Commit 1086753e authored by LeeJiancong's avatar LeeJiancong

弹窗列表改为单选

parent 6b3a0258
......@@ -142,4 +142,11 @@ h6 {
border: none;
background: none;
}
}
\ No newline at end of file
}
//addonAfter 有选择弹窗时
.input_addonAfter{
.ant-input-group-addon{
padding: 0 !important;
}
}
......@@ -6,9 +6,9 @@ import {
FormEffectHooks
} from '@formily/antd'
import { Input, Radio, FormMegaLayout } from '@formily/antd-components'
import { values } from 'mobx';
import {PublicApi} from '@/services/api'
export interface Params {
import { PublicApi } from '@/services/api'
import {PATTERN_MAPS} from '@/constants/regExp'
export interface Params {
id: number | string;
dialogVisible: boolean;
onCancel: Function;
......@@ -16,33 +16,40 @@ export interface Params {
dontReceive?: boolean; //默认展示
}
const actions = createFormActions()
const {onFieldChange$} = FormEffectHooks
const { onFieldChange$ } = FormEffectHooks
const comfirmDialog: React.FC<Params> = (props) => {
console.log(props.dialogVisible)
const handleCancel = () => {
}
const handletOk = (values:any) => {
let value = {...values}
const handletOk = (values: any) => {
let value = { ...values }
value.id = props.id
console.log(values)
PublicApi.postLogisticsOrderWaitConfirmConfirm(value).then(res => {
if(res.code === 1000){
if (res.code === 1000) {
props.onOK()
}
})
}
useEffect(() => {
return () => {
}
}, [])
const useFormEffects = () => {
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({value}) => {
setFieldState('remarkOption',state => {
if(value == 3){
const { setFieldState } = createFormActions()
onFieldChange$('status').subscribe(({ value }) => {
setFieldState('remark', state => {
if (value == 3) {
state.visible = false
} else {
state.visible = true
}
})
setFieldState('freightPrice', state => {
if (value == 3) {
state.visible = false
}else{
} else {
state.visible = true
}
})
......@@ -62,21 +69,23 @@ const comfirmDialog: React.FC<Params> = (props) => {
okText='确定'
cancelText='取消'
>
<SchemaForm components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values) }
initialValues={{
status: 3
}}
<SchemaForm
labelCol={3}
components={{
Input, Radio: Radio.Group, TextArea: Input.TextArea
}}
actions={actions}
effects={() => useFormEffects()}
onSubmit={(values) => handletOk(values)}
initialValues={{
status: 3
}}
>
<Field
enum={
[
{ label: '接受物流单', value:3},
{ label: '不接受物流单', value:4 }
{ label: '接受物流单', value: 3 },
{ label: '不接受物流单', value: 4 }
]}
name='status'
required
......@@ -84,27 +93,41 @@ const comfirmDialog: React.FC<Params> = (props) => {
/>
{props.dontReceive &&
<FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top">
<Field
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules={value => {
if (value.length > 60) {
return {
type: 'warning',
message: '原因最多60个汉字'
}
}
}
}
/>
<>
<Field
title='运费'
name="freightPrice"
x-component="Input"
required
x-component-props={{
placeholder:'运费',
// addonBefore: ' '
}}
x-rules ={{
pattern: PATTERN_MAPS.money,
message:'数字类型,币制为当前站点对应的币制,保留2位小数'
}}
/>
{/* <FormMegaLayout name='remarkOption' label='不接受原因' full required labelCol={2} labelAlign="top"> */}
<Field
title='不接受原因'
name="remark"
x-component="TextArea"
required
x-component-props={{
placeholder: '在此输入你的内容,最多60个汉字'
}}
x-rules ={{
max:60,
// maximum:10,//最大数值
message:'原因最多60个汉字'
}}
/>
</FormMegaLayout>
</>
}
</SchemaForm>
</Modal>
......
......@@ -275,14 +275,6 @@ const detailInfo: React.FC<{}> = () => {
resolve(res.data)
}
})
// const queryResult = data.find(v => v.key === params.keywords);
// setTimeout(() => {
// resolve({
// code: 200,
// message: '',
// data: dataInfo.detailList//dataInfo.logList
// });
// }, 1000);
});
};
......@@ -483,9 +475,8 @@ const detailInfo: React.FC<{}> = () => {
{
item.key === 'freight' ?
<div className={style['cols-main-options']}>
{item.value}
{/* <Input addonBefore=" ¥ " defaultValue={100} /> */}
{dataInfo.status < 3 ?'未报价':item.value}
</div>
: <div className={style['cols-main-options']}>
{item.value}
......
......@@ -224,7 +224,7 @@ const company: React.FC<{}> = () => {
}
]}
>
<Input className={style['selectBtn']} disabled maxLength={20} addonAfter={selectBtn}/>
<Input className="input_addonAfter" disabled maxLength={20} addonAfter={selectBtn}/>
</Form.Item>
:
<Form.Item
......@@ -299,7 +299,10 @@ const company: React.FC<{}> = () => {
<StandardTable
columns={columns}
currentRef={ref}
rowSelection={rowSelection}
rowSelection={{
type:'radio',
...rowSelection
}}
fetchTableData={(params: any) => fetchData(params)}
/>
......
......@@ -2,7 +2,7 @@
* @Author: LeeJiancong
* @Date: 2020-07-28 11:25:30
* @LastEditors: LeeJiancong
* @LastEditTime: 2020-08-03 16:48:12
* @LastEditTime: 2020-08-03 18:28:38
*/
import React, { Component, useEffect, useRef, useState,ReactNode } from 'react'
import { Card, Row, Col, Tabs, Button, Input as SelectInput, Badge } from 'antd'
......@@ -357,12 +357,12 @@ const Deatail: React.FC<{}> = () => {
<FormItem name="digest" label="单据摘要" required component={Input} />
<FormItem name="shipmentOrderCode" label='对应发货单号'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn2} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn2} />
</>
</FormItem>
<FormItem name="invoicesNo" label='对应订单号/售后单'>
<>
<SelectInput className={style['btn-wrap']} addonAfter={selectBtn1} />
<SelectInput className='input_addonAfter' addonAfter={selectBtn1} />
</>
</FormItem>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment