Commit e73c3f10 authored by 前端-黄佳鑫's avatar 前端-黄佳鑫

fix: 修改采购询价BUG

parent 4140bdd1
......@@ -7,10 +7,12 @@ interface DatePickerSelectPropsType {
startTimeName?: string,
/** 结束时间name */
endTimeName?: string,
/** ononPress */
onPress?: () => void,
}
const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => {
const { startTimeName, endTimeName } = props;
const { startTimeName, endTimeName, onPress } = props;
const [timeList, setTimeList] = useState<Array<any>>([]);
/**
......@@ -32,11 +34,22 @@ const DatePickerSelect: React.FC<DatePickerSelectPropsType> = (props) => {
const startTimeChange = (val) => {
let time = [...timeList]
time[0] = val
if (onPress) {
if (time[0] && time[1]) {
onPress()
}
}
setTimeList(time)
}
const endStartTimeChange = (val) => {
let time = [...timeList]
time[1] = val
if (onPress) {
if (time[0] && time[1]) {
onPress()
}
}
setTimeList(time)
}
return (
......
......@@ -172,6 +172,7 @@ const Table: React.FC<Iprops> = (props: any) => {
useImperativeHandle(reload, () => ({
reload: () => {
tableRef.current.reload();
selectRowFns.setSelectedRowKeys([]);
}
}));
......
......@@ -55,13 +55,14 @@ const BasicInfo: React.FC<BasicInfoprops> = (props: any) => {
}
}, [fetchdata])
const handleSummary = () => {
form.setFieldsValue({ 'summary': `${form.getFieldValue('startTime').format('YYYY-MM-DD')}-${form.getFieldValue('endTime').format('YYYY-MM-DD')}需求计划` })
}
return (
<Form {...layout} form={form}>
<Form.Item noStyle shouldUpdate={(prevValues, curValues) => (prevValues.startTime && prevValues.endTime) !== (curValues.startTime && curValues.endTime)}>
{({ getFieldValue }) => {
if (getFieldValue('startTime') && getFieldValue('endTime')) {
form.setFieldsValue({'summary': `${getFieldValue('startTime').format('YYYY-MM-DD')}-${getFieldValue('endTime').format('YYYY-MM-DD')}需求计划`})
}
return (getFieldValue('startTime') && getFieldValue('endTime')) && (
<Form.Item
label="需求计划摘要"
......@@ -80,6 +81,7 @@ const BasicInfo: React.FC<BasicInfoprops> = (props: any) => {
<DatePicker
startTimeName='startTime'
endTimeName='endTime'
onPress={handleSummary}
/>
</Form.Item>
<Form.Item label="需求计划编号" name="needPlanNo">
......
......@@ -76,6 +76,9 @@ const AuditInquiryOne = () => {
</>
)
}];
console.log(rowkeys, 'rowkeys')
return (
<Table
selectedRow
......
......@@ -78,6 +78,9 @@ const AuditInquiryTwo = () => {
</>
)
}];
console.log(rowkeys, 'rowkeys')
return (
<Table
selectedRow
......
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