|  | @@ -97,7 +97,6 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |      },
 |  |      },
 | 
											
												
													
														|  |    ];
 |  |    ];
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -  const [isPass, setIsPass] = useState(1);
 |  | 
 | 
											
												
													
														|  |    const [companyDepList, setCompanyDepList] = useState(depList || []);
 |  |    const [companyDepList, setCompanyDepList] = useState(depList || []);
 | 
											
												
													
														|  |    const [archivesDepList, setArchivesDepList] = useState(archivesOptions);
 |  |    const [archivesDepList, setArchivesDepList] = useState(archivesOptions);
 | 
											
												
													
														|  |    const [dealDisable, setDealDisable] = useState(false);
 |  |    const [dealDisable, setDealDisable] = useState(false);
 | 
											
										
											
												
													
														|  | @@ -313,7 +312,6 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      if (!visible) {
 |  |      if (!visible) {
 | 
											
												
													
														|  | -      setIsPass(1);
 |  | 
 | 
											
												
													
														|  |        setDealDisable(false);
 |  |        setDealDisable(false);
 | 
											
												
													
														|  |        setAuditList([]);
 |  |        setAuditList([]);
 | 
											
												
													
														|  |        setCompanyDepList([]);
 |  |        setCompanyDepList([]);
 | 
											
										
											
												
													
														|  | @@ -326,6 +324,14 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |      }
 |  |      }
 | 
											
												
													
														|  |    }, [visible]);
 |  |    }, [visible]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +  useEffect(() => {
 | 
											
												
													
														|  | 
 |  | +    //兼容之前选择的所属部门,用的现在的接口匹配不到部门显示数字的问题
 | 
											
												
													
														|  | 
 |  | +    if (data?.company_id) {
 | 
											
												
													
														|  | 
 |  | +      const deps = getDepItemById(data?.company_id)?.children;
 | 
											
												
													
														|  | 
 |  | +      setCompanyDepList(deps);
 | 
											
												
													
														|  | 
 |  | +    }
 | 
											
												
													
														|  | 
 |  | +  }, [data, depList]);
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      form.resetFields();
 |  |      form.resetFields();
 | 
											
												
													
														|  |      if (data?.status >= Status.Checking) runAudit({ extend_code: data.code });
 |  |      if (data?.status >= Status.Checking) runAudit({ extend_code: data.code });
 | 
											
										
											
												
													
														|  | @@ -355,17 +361,17 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |        (data?.status == Status.CheckReject && forceModify)
 |  |        (data?.status == Status.CheckReject && forceModify)
 | 
											
												
													
														|  |      )
 |  |      )
 | 
											
												
													
														|  |        return true;
 |  |        return true;
 | 
											
												
													
														|  | -    let currentAuditUserID;
 |  | 
 | 
											
												
													
														|  | -    if (data?.status == Status.Checking && auditData) {
 |  | 
 | 
											
												
													
														|  | -      const { OaAuditList, audit_status } = auditData;
 |  | 
 | 
											
												
													
														|  | -      currentAuditUserID = OaAuditList[audit_status]?.auditor;
 |  | 
 | 
											
												
													
														|  | -    } else if (data?.status == Status.CalChecking && auditCelData) {
 |  | 
 | 
											
												
													
														|  | -      const { OaAuditList, audit_status } = auditCelData;
 |  | 
 | 
											
												
													
														|  | -      currentAuditUserID = OaAuditList[audit_status]?.auditor;
 |  | 
 | 
											
												
													
														|  | -    }
 |  | 
 | 
											
												
													
														|  | -    if (user.ID == currentAuditUserID) return true;
 |  | 
 | 
											
												
													
														|  | -    return false;
 |  | 
 | 
											
												
													
														|  | -  }, [user, data, auditData, auditCelData, forceModify]);
 |  | 
 | 
											
												
													
														|  | 
 |  | +    // let currentAuditUserID;
 | 
											
												
													
														|  | 
 |  | +    // if (data?.status == Status.Checking && auditData) {
 | 
											
												
													
														|  | 
 |  | +    //   const { OaAuditList, audit_status } = auditData;
 | 
											
												
													
														|  | 
 |  | +    //   currentAuditUserID = OaAuditList[audit_status]?.auditor;
 | 
											
												
													
														|  | 
 |  | +    // } else if (data?.status == Status.CalChecking && auditCelData) {
 | 
											
												
													
														|  | 
 |  | +    //   const { OaAuditList, audit_status } = auditCelData;
 | 
											
												
													
														|  | 
 |  | +    //   currentAuditUserID = OaAuditList[audit_status]?.auditor;
 | 
											
												
													
														|  | 
 |  | +    // }
 | 
											
												
													
														|  | 
 |  | +    // if (user.ID == currentAuditUserID) return true;
 | 
											
												
													
														|  | 
 |  | +    // return false;
 | 
											
												
													
														|  | 
 |  | +  }, [data, type, forceModify]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      if (
 |  |      if (
 | 
											
										
											
												
													
														|  | @@ -435,6 +441,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |      runAuditList(param);
 |  |      runAuditList(param);
 | 
											
												
													
														|  |    }, [company, archives_dep]);
 |  |    }, [company, archives_dep]);
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +  //根据项目名称填充项目编号逻辑
 | 
											
												
													
														|  |    useEffect(() => {
 |  |    useEffect(() => {
 | 
											
												
													
														|  |      if (
 |  |      if (
 | 
											
												
													
														|  |        type !== Type.add &&
 |  |        type !== Type.add &&
 | 
											
										
											
												
													
														|  | @@ -571,20 +578,6 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |          values.created_by = user?.ID;
 |  |          values.created_by = user?.ID;
 | 
											
												
													
														|  |          values.id = data?.id;
 |  |          values.id = data?.id;
 | 
											
												
													
														|  |          handleOk(values, Type.add, form, audit_list);
 |  |          handleOk(values, Type.add, form, audit_list);
 | 
											
												
													
														|  | -      } else if (data?.status == Status.Checking) {
 |  | 
 | 
											
												
													
														|  | -        let result = {
 |  | 
 | 
											
												
													
														|  | -          id: auditData?.id,
 |  | 
 | 
											
												
													
														|  | -          status: values.is_pass,
 |  | 
 | 
											
												
													
														|  | -          desc: '',
 |  | 
 | 
											
												
													
														|  | -        };
 |  | 
 | 
											
												
													
														|  | -        handleOk(result, Type.check, data?.status);
 |  | 
 | 
											
												
													
														|  | -      } else if (data?.status == Status.CalChecking) {
 |  | 
 | 
											
												
													
														|  | -        let result = {
 |  | 
 | 
											
												
													
														|  | -          id: auditCelData?.id,
 |  | 
 | 
											
												
													
														|  | -          status: values.is_pass,
 |  | 
 | 
											
												
													
														|  | -          desc: '',
 |  | 
 | 
											
												
													
														|  | -        };
 |  | 
 | 
											
												
													
														|  | -        handleOk(result, Type.check, data?.status);
 |  | 
 | 
											
												
													
														|  |        }
 |  |        }
 | 
											
												
													
														|  |      });
 |  |      });
 | 
											
												
													
														|  |    };
 |  |    };
 | 
											
										
											
												
													
														|  | @@ -616,7 +609,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |    const renderFooter = () => {
 |  |    const renderFooter = () => {
 | 
											
												
													
														|  |      return (
 |  |      return (
 | 
											
												
													
														|  |        <Space>
 |  |        <Space>
 | 
											
												
													
														|  | -        {data?.status == Status.Checking && type !== Type.check && (
 |  | 
 | 
											
												
													
														|  | 
 |  | +        {data?.status == Status.Checking && (
 | 
											
												
													
														|  |            <Button onClick={() => handlerReCall(auditData?.id)}>撤回</Button>
 |  |            <Button onClick={() => handlerReCall(auditData?.id)}>撤回</Button>
 | 
											
												
													
														|  |          )}
 |  |          )}
 | 
											
												
													
														|  |          <Button
 |  |          <Button
 | 
											
										
											
												
													
														|  | @@ -721,24 +714,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                    },
 |  |                    },
 | 
											
												
													
														|  |                  ]}
 |  |                  ]}
 | 
											
												
													
														|  |                >
 |  |                >
 | 
											
												
													
														|  | -                <Select
 |  | 
 | 
											
												
													
														|  | -                  showSearch
 |  | 
 | 
											
												
													
														|  | -                  style={{ width: '100%' }}
 |  | 
 | 
											
												
													
														|  | -                  placeholder="请选择"
 |  | 
 | 
											
												
													
														|  | -                  disabled={disableds.contract || disableds.recall}
 |  | 
 | 
											
												
													
														|  | -                  filterOption={(input, option) =>
 |  | 
 | 
											
												
													
														|  | -                    (option?.label ?? '')
 |  | 
 | 
											
												
													
														|  | -                      .toLowerCase()
 |  | 
 | 
											
												
													
														|  | -                      .includes(input.toLowerCase())
 |  | 
 | 
											
												
													
														|  | -                  }
 |  | 
 | 
											
												
													
														|  | -                  options={companyDepList?.map((item) => {
 |  | 
 | 
											
												
													
														|  | -                    return {
 |  | 
 | 
											
												
													
														|  | -                      value: item.ID,
 |  | 
 | 
											
												
													
														|  | -                      label: item.Name,
 |  | 
 | 
											
												
													
														|  | -                    };
 |  | 
 | 
											
												
													
														|  | -                  })}
 |  | 
 | 
											
												
													
														|  | -                />
 |  | 
 | 
											
												
													
														|  | -                {/* <TreeSelect
 |  | 
 | 
											
												
													
														|  | 
 |  | +                <TreeSelect
 | 
											
												
													
														|  |                    style={{ width: '100%' }}
 |  |                    style={{ width: '100%' }}
 | 
											
												
													
														|  |                    placeholder="请选择"
 |  |                    placeholder="请选择"
 | 
											
												
													
														|  |                    showSearch
 |  |                    showSearch
 | 
											
										
											
												
													
														|  | @@ -751,7 +727,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                    disabled={disableds.contract || disableds.recall}
 |  |                    disabled={disableds.contract || disableds.recall}
 | 
											
												
													
														|  |                    dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
 |  |                    dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
 | 
											
												
													
														|  |                    treeData={companyDepList}
 |  |                    treeData={companyDepList}
 | 
											
												
													
														|  | -                /> */}
 |  | 
 | 
											
												
													
														|  | 
 |  | +                />
 | 
											
												
													
														|  |                </Form.Item>
 |  |                </Form.Item>
 | 
											
												
													
														|  |              </Col>
 |  |              </Col>
 | 
											
												
													
														|  |            </Row>
 |  |            </Row>
 | 
											
										
											
												
													
														|  | @@ -786,24 +762,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                    },
 |  |                    },
 | 
											
												
													
														|  |                  ]}
 |  |                  ]}
 | 
											
												
													
														|  |                >
 |  |                >
 | 
											
												
													
														|  | -                <Select
 |  | 
 | 
											
												
													
														|  | -                  showSearch
 |  | 
 | 
											
												
													
														|  | -                  style={{ width: '100%' }}
 |  | 
 | 
											
												
													
														|  | -                  placeholder="请选择"
 |  | 
 | 
											
												
													
														|  | -                  disabled={disableds.contract}
 |  | 
 | 
											
												
													
														|  | -                  filterOption={(input, option) =>
 |  | 
 | 
											
												
													
														|  | -                    (option?.label ?? '')
 |  | 
 | 
											
												
													
														|  | -                      .toLowerCase()
 |  | 
 | 
											
												
													
														|  | -                      .includes(input.toLowerCase())
 |  | 
 | 
											
												
													
														|  | -                  }
 |  | 
 | 
											
												
													
														|  | -                  options={companyDepList?.map((item) => {
 |  | 
 | 
											
												
													
														|  | -                    return {
 |  | 
 | 
											
												
													
														|  | -                      value: item.ID,
 |  | 
 | 
											
												
													
														|  | -                      label: item.Name,
 |  | 
 | 
											
												
													
														|  | -                    };
 |  | 
 | 
											
												
													
														|  | -                  })}
 |  | 
 | 
											
												
													
														|  | -                />
 |  | 
 | 
											
												
													
														|  | -                {/* <TreeSelect
 |  | 
 | 
											
												
													
														|  | 
 |  | +                <TreeSelect
 | 
											
												
													
														|  |                    style={{ width: '100%' }}
 |  |                    style={{ width: '100%' }}
 | 
											
												
													
														|  |                    placeholder="请选择"
 |  |                    placeholder="请选择"
 | 
											
												
													
														|  |                    showSearch
 |  |                    showSearch
 | 
											
										
											
												
													
														|  | @@ -816,7 +775,7 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                    }}
 |  |                    }}
 | 
											
												
													
														|  |                    dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
 |  |                    dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
 | 
											
												
													
														|  |                    treeData={companyDepList}
 |  |                    treeData={companyDepList}
 | 
											
												
													
														|  | -                /> */}
 |  | 
 | 
											
												
													
														|  | 
 |  | +                />
 | 
											
												
													
														|  |                </Form.Item>
 |  |                </Form.Item>
 | 
											
												
													
														|  |              </Col>
 |  |              </Col>
 | 
											
												
													
														|  |            </Row>
 |  |            </Row>
 | 
											
										
											
												
													
														|  | @@ -1152,58 +1111,6 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                </div>
 |  |                </div>
 | 
											
												
													
														|  |              </>
 |  |              </>
 | 
											
												
													
														|  |            )}
 |  |            )}
 | 
											
												
													
														|  | -          {isSuper && data.status == Status.Checking && (
 |  | 
 | 
											
												
													
														|  | -            <>
 |  | 
 | 
											
												
													
														|  | -              <ModuleTitle title="审核情况" />
 |  | 
 | 
											
												
													
														|  | -              <Row>
 |  | 
 | 
											
												
													
														|  | -                <Col span={10} offset={1}>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item
 |  | 
 | 
											
												
													
														|  | -                    name="check_by"
 |  | 
 | 
											
												
													
														|  | -                    initialValue={user?.CName}
 |  | 
 | 
											
												
													
														|  | -                    label="审核人:"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <Input disabled />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item name="is_pass" initialValue={1} label="审核意见:">
 |  | 
 | 
											
												
													
														|  | -                    <Select
 |  | 
 | 
											
												
													
														|  | -                      onChange={(e) => {
 |  | 
 | 
											
												
													
														|  | -                        setIsPass(e);
 |  | 
 | 
											
												
													
														|  | -                      }}
 |  | 
 | 
											
												
													
														|  | -                      style={{ width: '100%' }}
 |  | 
 | 
											
												
													
														|  | -                      options={[
 |  | 
 | 
											
												
													
														|  | -                        {
 |  | 
 | 
											
												
													
														|  | -                          value: 1,
 |  | 
 | 
											
												
													
														|  | -                          label: '同意',
 |  | 
 | 
											
												
													
														|  | -                        },
 |  | 
 | 
											
												
													
														|  | -                        {
 |  | 
 | 
											
												
													
														|  | -                          value: 2,
 |  | 
 | 
											
												
													
														|  | -                          label: '拒绝',
 |  | 
 | 
											
												
													
														|  | -                        },
 |  | 
 | 
											
												
													
														|  | -                      ]}
 |  | 
 | 
											
												
													
														|  | -                    />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                </Col>
 |  | 
 | 
											
												
													
														|  | -                <Col span={10}>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item
 |  | 
 | 
											
												
													
														|  | -                    name="check_date"
 |  | 
 | 
											
												
													
														|  | -                    initialValue={dayjs().format(FORMAT)}
 |  | 
 | 
											
												
													
														|  | -                    label="审核时间:"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <Input disabled />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                </Col>
 |  | 
 | 
											
												
													
														|  | -              </Row>
 |  | 
 | 
											
												
													
														|  | -              {isPass == 2 && (
 |  | 
 | 
											
												
													
														|  | -                <Form.Item
 |  | 
 | 
											
												
													
														|  | -                  name="check_desc"
 |  | 
 | 
											
												
													
														|  | -                  label="拒绝原因:"
 |  | 
 | 
											
												
													
														|  | -                  labelCol={{ span: 4 }}
 |  | 
 | 
											
												
													
														|  | -                >
 |  | 
 | 
											
												
													
														|  | -                  <Input.TextArea />
 |  | 
 | 
											
												
													
														|  | -                </Form.Item>
 |  | 
 | 
											
												
													
														|  | -              )}
 |  | 
 | 
											
												
													
														|  | -            </>
 |  | 
 | 
											
												
													
														|  | -          )}
 |  | 
 | 
											
												
													
														|  |            {(type == Type.cancel || data?.status >= Status.CalChecking) && (
 |  |            {(type == Type.cancel || data?.status >= Status.CalChecking) && (
 | 
											
												
													
														|  |              <>
 |  |              <>
 | 
											
												
													
														|  |                <ModuleTitle title="作废信息" />
 |  |                <ModuleTitle title="作废信息" />
 | 
											
										
											
												
													
														|  | @@ -1250,58 +1157,6 @@ const ContractModal = (props) => {
 | 
											
												
													
														|  |                </div>
 |  |                </div>
 | 
											
												
													
														|  |              </>
 |  |              </>
 | 
											
												
													
														|  |            )}
 |  |            )}
 | 
											
												
													
														|  | -          {isSuper && data.status == Status.CalChecking && (
 |  | 
 | 
											
												
													
														|  | -            <>
 |  | 
 | 
											
												
													
														|  | -              <ModuleTitle title="审核情况" />
 |  | 
 | 
											
												
													
														|  | -              <Row>
 |  | 
 | 
											
												
													
														|  | -                <Col span={10} offset={1}>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item
 |  | 
 | 
											
												
													
														|  | -                    name="cancel_check_by"
 |  | 
 | 
											
												
													
														|  | -                    initialValue={user?.CName}
 |  | 
 | 
											
												
													
														|  | -                    label="审核人:"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <Input disabled />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item name="is_pass" initialValue={1} label="审核意见:">
 |  | 
 | 
											
												
													
														|  | -                    <Select
 |  | 
 | 
											
												
													
														|  | -                      onChange={(e) => {
 |  | 
 | 
											
												
													
														|  | -                        setIsPass(e);
 |  | 
 | 
											
												
													
														|  | -                      }}
 |  | 
 | 
											
												
													
														|  | -                      style={{ width: '100%' }}
 |  | 
 | 
											
												
													
														|  | -                      options={[
 |  | 
 | 
											
												
													
														|  | -                        {
 |  | 
 | 
											
												
													
														|  | -                          value: 1,
 |  | 
 | 
											
												
													
														|  | -                          label: '同意',
 |  | 
 | 
											
												
													
														|  | -                        },
 |  | 
 | 
											
												
													
														|  | -                        {
 |  | 
 | 
											
												
													
														|  | -                          value: 0,
 |  | 
 | 
											
												
													
														|  | -                          label: '拒绝',
 |  | 
 | 
											
												
													
														|  | -                        },
 |  | 
 | 
											
												
													
														|  | -                      ]}
 |  | 
 | 
											
												
													
														|  | -                    />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                </Col>
 |  | 
 | 
											
												
													
														|  | -                <Col span={10}>
 |  | 
 | 
											
												
													
														|  | -                  <Form.Item
 |  | 
 | 
											
												
													
														|  | -                    name="check_date"
 |  | 
 | 
											
												
													
														|  | -                    initialValue={dayjs().format(FORMAT)}
 |  | 
 | 
											
												
													
														|  | -                    label="审核时间:"
 |  | 
 | 
											
												
													
														|  | -                  >
 |  | 
 | 
											
												
													
														|  | -                    <Input disabled />
 |  | 
 | 
											
												
													
														|  | -                  </Form.Item>
 |  | 
 | 
											
												
													
														|  | -                </Col>
 |  | 
 | 
											
												
													
														|  | -              </Row>
 |  | 
 | 
											
												
													
														|  | -              {!isPass && (
 |  | 
 | 
											
												
													
														|  | -                <Form.Item
 |  | 
 | 
											
												
													
														|  | -                  name="cancel_check_result"
 |  | 
 | 
											
												
													
														|  | -                  label="拒绝原因:"
 |  | 
 | 
											
												
													
														|  | -                  labelCol={{ span: 4 }}
 |  | 
 | 
											
												
													
														|  | -                >
 |  | 
 | 
											
												
													
														|  | -                  <Input.TextArea />
 |  | 
 | 
											
												
													
														|  | -                </Form.Item>
 |  | 
 | 
											
												
													
														|  | -              )}
 |  | 
 | 
											
												
													
														|  | -            </>
 |  | 
 | 
											
												
													
														|  | -          )}
 |  | 
 | 
											
												
													
														|  |            {(type == Type.add || data?.status == Status.ReCall || forceModify) &&
 |  |            {(type == Type.add || data?.status == Status.ReCall || forceModify) &&
 | 
											
												
													
														|  |              auditList.length > 0 && (
 |  |              auditList.length > 0 && (
 | 
											
												
													
														|  |                <>
 |  |                <>
 |