Commit f9e832fd authored by alwayOnlie's avatar alwayOnlie

修复时间选中

parent 07bfe748
...@@ -50,6 +50,7 @@ const FormList = (props: any) => { ...@@ -50,6 +50,7 @@ const FormList = (props: any) => {
render: (_, item, index) => <DatePicker render: (_, item, index) => <DatePicker
style={{ width: '100%' }} style={{ width: '100%' }}
format="YYYY-MM-DD" format="YYYY-MM-DD"
value={item.expectPayTime}
onChange={(e) => onSelectChange(e, 'expectPayTime', index)} onChange={(e) => onSelectChange(e, 'expectPayTime', index)}
/> />
}, },
...@@ -120,7 +121,6 @@ const FormList = (props: any) => { ...@@ -120,7 +121,6 @@ const FormList = (props: any) => {
/* 添加 */ /* 添加 */
const addtable = () => { const addtable = () => {
const data = [...PlanList]; const data = [...PlanList];
if (keys) { if (keys) {
data.push(keys); data.push(keys);
setkeys(''); setkeys('');
...@@ -205,7 +205,11 @@ const FormList = (props: any) => { ...@@ -205,7 +205,11 @@ const FormList = (props: any) => {
setPlanList(item) setPlanList(item)
} }
useEffect(() => { useEffect(() => {
payPlanList.map(item => {
item.expectPayTime = moment(item.expectPayTime)
})
setPlanList(payPlanList) setPlanList(payPlanList)
console.log(payPlanList)
}, [payPlanList]) }, [payPlanList])
useEffect(() => { useEffect(() => {
currentRef.current = { currentRef.current = {
......
...@@ -26,13 +26,22 @@ const Information = (props: any) => { ...@@ -26,13 +26,22 @@ const Information = (props: any) => {
PublicApi.getContractManageGetContractNo(data).then(res => { PublicApi.getContractManageGetContractNo(data).then(res => {
console.log(res.data) console.log(res.data)
if (res.code === 1000) { if (res.code === 1000) {
basic.contractNo = res.data basic.contractNo = res.data;
const rangePicker = [];
let startTime = moment(basic.startTime)
let endTime = moment(basic.endTime);
rangePicker.push(startTime, endTime);
basic.rangePicker = rangePicker;
attrValueForm.setFieldsValue(basic) attrValueForm.setFieldsValue(basic)
} }
}).catch((err) => { }).catch((err) => {
}); });
} else { } else {
const rangePicker = [];
let startTime = moment(basic.startTime)
let endTime = moment(basic.endTime);
rangePicker.push(startTime, endTime);
basic.rangePicker = rangePicker;
attrValueForm.setFieldsValue(basic) attrValueForm.setFieldsValue(basic)
} }
} }
...@@ -145,7 +154,7 @@ const Information = (props: any) => { ...@@ -145,7 +154,7 @@ const Information = (props: any) => {
labelAlign="left" labelAlign="left"
labelCol={{ span: 2 }} labelCol={{ span: 2 }}
wrapperCol={{ span: 8 }} wrapperCol={{ span: 8 }}
name="range-picker" name="rangePicker"
{...rangeConfig} {...rangeConfig}
> >
<RangePicker style={{ width: '100%' }} <RangePicker style={{ width: '100%' }}
......
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