|
@@ -6,6 +6,8 @@ function BudgetModal(props) {
|
|
|
const { visible, onCancel, onOk, loading, currentItem, dispatch, budget } = props;
|
|
|
const [form] = Form.useForm();
|
|
|
|
|
|
+ useEffect(() => form.resetFields(), [visible]);
|
|
|
+
|
|
|
const subTypeList = [
|
|
|
{ name: '建设期项目管理人员', code: '02-010', id: 12 },
|
|
|
{ name: '工程设计人日(含BIM设计)', code: '04-010', id: 13 },
|
|
@@ -35,13 +37,13 @@ function BudgetModal(props) {
|
|
|
let elm = {
|
|
|
project_id: Number(currentItem?.id),
|
|
|
type_id: Number(item),
|
|
|
- workload: Number(values[item])
|
|
|
+ workload: Number(values[item]),
|
|
|
};
|
|
|
if (isUpdate) {
|
|
|
elm.id = budget?.find(child => child.type_id == item)?.id;
|
|
|
}
|
|
|
params.push(elm);
|
|
|
- })
|
|
|
+ });
|
|
|
console.log(params);
|
|
|
dispatch({
|
|
|
type: 'approval/setBudget',
|
|
@@ -62,7 +64,11 @@ function BudgetModal(props) {
|
|
|
>
|
|
|
<Form form={form} labelCol={{ span: 10 }} wrapperCol={{ span: 10 }}>
|
|
|
{subTypeList.map(item => (
|
|
|
- <Form.Item label={item.name} name={item.id} initialValue={Number(budget?.find(child => child.type_id === item.id)?.workload) || 0}>
|
|
|
+ <Form.Item
|
|
|
+ label={item.name}
|
|
|
+ name={item.id}
|
|
|
+ initialValue={Number(budget?.find(child => child.type_id === item.id)?.workload) || 0}
|
|
|
+ >
|
|
|
<InputNumber min={0} style={{ width: '100%' }} />
|
|
|
</Form.Item>
|
|
|
))}
|