소스 검색

修改合同管理撤回/添加修改密码

Renxy 2 년 전
부모
커밋
70e9acd861

+ 6 - 5
.umirc.ts

@@ -89,11 +89,12 @@ export default defineConfig({
     //   path: '/access',
     //   component: './Access',
     // },
-    // {
-    //   name: 'CRUD 示例',
-    //   path: '/table',
-    //   component: './Table',
-    // },
+    {
+      name: '修改密码',
+      path: '/safety',
+      component: './UserCenter',
+      hideInMenu: true,
+    },
     {
       name: '登录',
       path: '/login',

+ 14 - 10
src/components/UserDropdown/index.tsx

@@ -8,19 +8,23 @@ import { useModel } from '@umijs/max';
 
 const RenderDropDown = (menu: any) => {
   console.log(menu);
-  return <div className={styles.dropdown}>
-    <a key='1'>
-      修改密码
-    </a>
+  return (
+    <div className={styles.dropdown}>
+      <a key="1" href="/safety">
+        修改密码
+      </a>
 
-    <a key='2' href='/login'>
-      退出登录
-    </a>
-  </div>
-}
+      <a key="2" href="/login">
+        退出登录
+      </a>
+    </div>
+  );
+};
 
 export default function UserDropdown(props: any) {
-  const { initialState: { user } } = useModel('@@initialState');
+  const {
+    initialState: { user },
+  } = useModel('@@initialState');
   return (
     <div className={styles.root}>
       <Dropdown placement="top" dropdownRender={(menu) => RenderDropDown(menu)}>

+ 129 - 197
src/pages/ContractManager/component/Modal.jsx

@@ -15,6 +15,7 @@ import {
   Upload,
   Space,
   Radio,
+  message,
 } from 'antd';
 import ModuleTitle from '../../../components/ModuleTitle/moduleTitle';
 import { useEffect, useMemo, useState } from 'react';
@@ -22,6 +23,7 @@ import {
   queryAuditByCode,
   queryCompany,
   queryContractCode,
+  queryOAReCall,
   querySupplierList,
 } from '@/services/contract';
 import { useModel, useRequest } from '@umijs/max';
@@ -47,6 +49,7 @@ export const StatusText = [
   '已作废',
 ];
 export const Status = {
+  ReCall: -1,
   None: 0,
   Checking: 1,
   CheckReject: 2,
@@ -74,6 +77,7 @@ const ContractModal = (props) => {
     handleCancel,
     parent_id,
     handlePreView,
+    handlerReCall,
   } = props;
   const title =
     type == Type.add ? '新增' : type == Type.cancel ? '作废' : '详情';
@@ -92,6 +96,10 @@ const ContractModal = (props) => {
   const [companyDepList, setCompanyDepList] = useState(depList || []);
   const [archivesDepList, setArchivesDepList] = useState(archivesOptions);
   const [dealDisable, setDealDisable] = useState(false);
+  const [attachData, setAttachData] = useState({
+    attach: [],
+    attach_extend: [],
+  });
   const company = Form.useWatch('company_id', form);
   const project_name = Form.useWatch('project_name', form);
   const archives_dep = Form.useWatch('archives_dep', form);
@@ -151,13 +159,19 @@ const ContractModal = (props) => {
 
   const { data: companyData, run: runCompany } = useRequest(queryCompany);
 
-  //计算审批流接口
+  //填写表单时计算审批流接口
   const { run: runAuditList } = useRequest(
     (data) => advanceSubmitNextNode(data),
     {
       debounceInterval: 500,
       manual: true,
       formatResult(res) {
+        const list = res.data[0]?.map((item) => {
+          const name = userList?.find(
+            (user) => user.ID == item[0].value,
+          )?.CName;
+          return { ...item[0], name };
+        });
         setAuditList(
           res.data[0]?.map((item) => {
             const name = userList?.find(
@@ -203,6 +217,7 @@ const ContractModal = (props) => {
       manual: true,
     },
   );
+  console.log('-----------------------', auditData, auditList);
   //获取OA 作废审批列表
   const {
     data: auditCelData,
@@ -214,6 +229,8 @@ const ContractModal = (props) => {
 
   useEffect(() => {
     if (!visible) {
+      setIsPass(1);
+      setDealDisable(false);
       setAuditList([]);
       setCompanyDepList([]);
       setArchivesDepList([]);
@@ -221,20 +238,37 @@ const ContractModal = (props) => {
       userListRun();
       depListRun();
       runCompany();
-      if (data?.status >= Status.Checking) runAudit({ extend_code: data.code });
-      if (data?.status >= Status.CalChecking)
-        runCalAudit({ extend_code: data.code });
     }
   }, [visible]);
 
   useEffect(() => {
     form.resetFields();
+    if (data?.status >= Status.Checking) runAudit({ extend_code: data.code });
+    if (data?.status >= Status.CalChecking)
+      runCalAudit({ extend_code: data.code });
+    let result = { attach: [], attach_extend: [] };
+    if (data?.attach) {
+      let att = JSON.parse(data.attach);
+      result.attach = att.map((item, idx) => {
+        return { ...item, uid: idx, status: 'done' };
+      });
+    }
+    if (data?.attach_extend) {
+      let att = JSON.parse(data.attach_extend);
+      result.attach_extend = att.map((item, idx) => {
+        return { ...item, uid: idx, status: 'done' };
+      });
+    }
+    setAttachData(result);
   }, [data]);
 
   const isSuper = useMemo(() => {
-    // if (user?.Permission['menu-001-audit']) return true;
-    // return false;
-    if (type == Type.add || type == Type.cancel) return true;
+    if (
+      type == Type.add ||
+      type == Type.cancel ||
+      data?.status == Status.ReCall
+    )
+      return true;
     let currentAuditUserID;
     if (data?.status == Status.Checking && auditData) {
       const { OaAuditList, audit_status } = auditData;
@@ -248,15 +282,16 @@ const ContractModal = (props) => {
   }, [user, data, auditData, auditCelData]);
 
   useEffect(() => {
-    if (type !== Type.add) return;
-    if (!company) {
+    if (type !== Type.add && data?.status !== Status.ReCall) return;
+    const newCompony = company || data?.company_id; //recall状态时compony是空, 需要用data?.company_id
+    if (!newCompony) {
       setCompanyDepList([]);
       setArchivesDepList([]);
       return;
     }
-    const deps = getDepItemById(company)?.children;
+    const deps = getDepItemById(newCompony)?.children;
     if (deps) setCompanyDepList(deps);
-    const item = companyData?.find((item) => item.ID == company);
+    const item = companyData?.find((item) => item.ID == newCompony);
     if (item?.Flag == 1) {
       //公司为本部 经办人为自己并不可编辑 合同存档部门从财务和行政部选
       setDealDisable(false);
@@ -268,10 +303,17 @@ const ContractModal = (props) => {
       setArchivesDepList(deps);
       form.setFieldsValue({ deal_by: '' });
     }
-  }, [company]);
+  }, [company, data]);
 
+  //获取合同编号逻辑 只有新增才请求
   useEffect(() => {
-    if (type !== Type.add || !company || !dep_id) return;
+    if (
+      //&& data?.status !== Status.ReCall
+      type !== Type.add ||
+      !company ||
+      !dep_id
+    )
+      return;
     const item = companyData?.find((item) => item.ID == company);
     const dep_code = getDepItemById(dep_id)?.Code;
     if (item) {
@@ -287,7 +329,7 @@ const ContractModal = (props) => {
 
   //获取审批流逻辑
   useEffect(() => {
-    if (type !== Type.add) return;
+    if (type !== Type.add && data?.status !== Status.ReCall) return;
     const param = { ...advance };
     let formValues = [];
     const item = companyData?.find((item) => item.ID == company);
@@ -302,7 +344,7 @@ const ContractModal = (props) => {
   }, [company, archives_dep]);
 
   useEffect(() => {
-    if (type !== Type.add) return;
+    if (type !== Type.add && data?.status !== Status.ReCall) return;
     const project_code = projectList?.find(
       (item) => item.project_name == project_name,
     )?.project_full_code;
@@ -317,25 +359,17 @@ const ContractModal = (props) => {
   }, [companyData, supplierList]);
 
   const disableds = useMemo(() => {
-    if (!visible) {
-      setIsPass(1);
-      setDealDisable(false);
-    }
-    if (type == Type.add) {
-      return { contract: false, check: true };
-    } else if (type == Type.detail) {
-      return { contract: true, check: true };
-    } else if (type == Type.cancel) {
-      return { contract: true, check: true };
-    }
-    return { contract: true, check: false };
-  }, [type, visible]);
+    if (data?.status == Status.ReCall) return { contract: false, recall: true };
+    if (data?.status > Status.None) return { contract: true, recall: true };
+    return { contract: false, recall: false };
+  }, [visible]);
 
   const UploadProps = {
     action: `/api/contract/v1/attach`,
     headers: {
       'JWT-TOKEN': localStorage.getItem('JWT-TOKEN'),
     },
+    defaultFileList: attachData?.attach,
     onChange({ file, fileList }) {
       if (file.status !== 'uploading') {
         const list = fileList.map((item) => item.response?.data?.attach);
@@ -348,6 +382,7 @@ const ContractModal = (props) => {
     headers: {
       'JWT-TOKEN': localStorage.getItem('JWT-TOKEN'),
     },
+    defaultFileList: attachData?.attach_extend,
     onChange({ file, fileList }) {
       if (file.status !== 'uploading') {
         const list = fileList.map((item) => item.response?.data?.attach);
@@ -383,8 +418,6 @@ const ContractModal = (props) => {
         if (values.attach) values.attach = JSON.stringify(values.attach);
         if (values.attach_extend)
           values.attach_extend = JSON.stringify(values.attach_extend);
-
-        // if (values.party_c && values.party_c.length > 0)
         values.party_c = values.party_c?.join(',');
 
         const companyItem = companyData?.find(
@@ -406,20 +439,42 @@ const ContractModal = (props) => {
           code: data?.code,
         };
         handleOk(result, Type.cancel, form, audit_list);
+      } else if (data?.status == Status.ReCall) {
+        const form = getAuditData(values, '1');
+        const audit_list = auditList.map((item) => item.value);
+        values.effect_on = dayjs(values.effect_on).format(FORMAT);
+        values.created_on = values.created_on || dayjs().format(FORMAT);
+        if (values.amount || values.amount == 0)
+          values.amount = values.amount + '';
+        if (values.attach) values.attach = JSON.stringify(values.attach);
+        if (values.attach_extend)
+          values.attach_extend = JSON.stringify(values.attach_extend);
+        values.party_c = values.party_c?.join(',');
+        const companyItem = companyData?.find(
+          (item) => item.ID == values.company_id,
+        );
+        values.company_name = companyItem.Name;
+        values.company_code = companyItem.Code;
+        const depItem = getDepItemById(values.dep_id);
+        values.dep_name = depItem?.Name;
+        values.dep_code = depItem?.Code;
+        values.created_by = user?.ID;
+        values.id = data?.id;
+        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, data?.status);
+        handleOk(result, Type.check, data?.status);
       } else if (data?.status == Status.CalChecking) {
         let result = {
           id: auditCelData?.id,
           status: values.is_pass,
           desc: '',
         };
-        handleOk(result, data?.status);
+        handleOk(result, Type.check, data?.status);
       }
     });
   };
@@ -439,25 +494,18 @@ const ContractModal = (props) => {
     return fun(depList);
   };
 
-  const getDescription = (node) => {
-    let str = node?.AuditRoleInfo
-      ? `审批人:${node?.AuditRoleInfo.Name || '-'}`
-      : `审批人:${node?.AuditorUser.CName || '-'}`;
-    if (node.desc) {
-      return (
-        <div>
-          {str}
-          <div>
-            <Tooltip title={node.desc}>
-              <span style={{ color: '#1A73E8', textDecoration: 'undeline' }}>
-                审批意见
-              </span>
-            </Tooltip>
-          </div>
-        </div>
-      );
-    }
-    return str;
+  const renderFooter = () => {
+    return (
+      <Space>
+        {data?.status == Status.Checking && (
+          <Button onClick={() => handlerReCall(auditData?.id)}>撤回</Button>
+        )}
+        <Button onClick={handleCancel}>取消</Button>
+        <Button type="primary" onClick={handleSubmit} disabled={!isSuper}>
+          提交
+        </Button>
+      </Space>
+    );
   };
 
   return (
@@ -465,13 +513,8 @@ const ContractModal = (props) => {
       width={'85%'}
       title={title}
       open={visible}
-      okText="提交"
-      cancelText="返回"
-      onOk={handleSubmit}
+      footer={renderFooter()}
       onCancel={handleCancel}
-      okButtonProps={
-        type == Type.detail || !isSuper ? { disabled: true } : null
-      }
       destroyOnClose
     >
       <Divider />
@@ -507,7 +550,7 @@ const ContractModal = (props) => {
                 showSearch
                 style={{ width: '100%' }}
                 placeholder="请选择"
-                disabled={disableds.contract}
+                disabled={disableds.contract || disableds.recall}
                 filterOption={(input, option) =>
                   (option?.label ?? '')
                     .toLowerCase()
@@ -533,7 +576,7 @@ const ContractModal = (props) => {
             <Form.Item
               name="dep_id"
               label="所属部门:"
-              initialValue={data?.dep_name || data?.dep_id}
+              initialValue={data?.dep_id}
             >
               <TreeSelect
                 style={{ width: '100%' }}
@@ -545,7 +588,7 @@ const ContractModal = (props) => {
                   value: 'ID',
                   children: 'children',
                 }}
-                disabled={disableds.contract}
+                disabled={disableds.contract || disableds.recall}
                 dropdownStyle={{ maxHeight: 400, overflow: 'auto' }}
                 treeData={companyDepList}
               />
@@ -568,23 +611,6 @@ const ContractModal = (props) => {
               ]}
             >
               <Input disabled={!dealDisable} />
-              {/* <Select
-                showSearch
-                style={{ width: '100%' }}
-                placeholder="请选择"
-                disabled={!dealDisable}
-                filterOption={(input, option) =>
-                  (option?.label ?? '')
-                    .toLowerCase()
-                    .includes(input.toLowerCase())
-                }
-                options={userList?.map((item) => {
-                  return {
-                    value: item.CName,
-                    label: item.CName,
-                  };
-                })}
-              /> */}
             </Form.Item>
           </Col>
           <Col span={10}>
@@ -633,7 +659,7 @@ const ContractModal = (props) => {
                 },
               ]}
             >
-              <Radio.Group disabled={disableds.contract}>
+              <Radio.Group disabled={disableds.contract || disableds.recall}>
                 <Radio value={1}>是</Radio>
                 <Radio value={0}>否</Radio>
               </Radio.Group>
@@ -685,14 +711,6 @@ const ContractModal = (props) => {
                 },
               ]}
             >
-              {/* <InputSelect
-                list={projectList?.map((item) => {
-                  return {
-                    key: item.id,
-                    value: item.project_name,
-                  };
-                })}
-              /> */}
               <Select
                 style={{ width: '100%' }}
                 placeholder="请选择"
@@ -752,19 +770,16 @@ const ContractModal = (props) => {
                   : []
               }
             >
-              <Input placeholder="请填写" />
+              <Input
+                placeholder="请填写"
+                disabled={disableds.contract || disableds.recall}
+              />
             </Form.Item>
             <Form.Item
               name="code"
               tooltip="合同编号按《合同管理办法》的合同编码规则编号。"
               initialValue={data?.code}
               label="合同编号:"
-              // rules={[
-              //   {
-              //     required: true,
-              //     message: '请填写合同编号',
-              //   },
-              // ]}
             >
               <Input placeholder="提交后自动生成" disabled />
             </Form.Item>
@@ -871,8 +886,9 @@ const ContractModal = (props) => {
                       },
                     ]
               }
+              initialValue={attachData.attach}
             >
-              {type == Type.add ? (
+              {type == Type.add || data?.status == Status.ReCall ? (
                 <Upload {...UploadProps}>
                   <Button icon={<CloudUploadOutlined />}>Upload</Button>
                 </Upload>
@@ -912,6 +928,7 @@ const ContractModal = (props) => {
             <Form.Item
               name="attach_extend"
               label="合同相关资料上传:"
+              initialValue={attachData.attach_extend}
               tooltip={
                 <div>
                   依据《合同管理办法》,合同相关资料需要作为合同电子档案的一部分,包括:
@@ -947,60 +964,11 @@ const ContractModal = (props) => {
           </Col>
         </Row>
 
-        {type != Type.add && (
+        {data?.status >= Status.Checking && (
           <>
             <ModuleTitle title="归档流程" />
             <div className={styles.modelItem}>
               <AuditSteps {...auditData} statusText="已归档" />
-              {/* {renderAudit()} */}
-              {/* <Steps
-                current={data?.status == Status.Checking ? 1 : 2}
-                status={
-                  data?.status == Status.CheckReject ? 'error' : 'process'
-                }
-                items={[
-                  {
-                    title: '发起',
-                    description: (
-                      <>
-                        <div className={styles.textNowarp}>
-                          发起人:{data?.created_name}
-                        </div>
-                        <div className={styles.textNowarp}>
-                          发起时间:{data?.created_on}
-                        </div>
-                      </>
-                    ),
-                  },
-                  {
-                    title: '审核',
-                    description: (
-                      <>
-                        <div className={styles.textNowarp}>
-                          审核人:{data?.check_by}
-                        </div>
-                        <div className={styles.textNowarp}>
-                          审核时间:{data?.check_on}
-                        </div>
-                        {data?.check_desc && (
-                          <div
-                            className={styles.textNowarp}
-                            style={{ color: 'red' }}
-                          >
-                            拒绝原因:{data?.check_desc}
-                          </div>
-                        )}
-                      </>
-                    ),
-                  },
-                  {
-                    title:
-                      data?.status >= Status.CheckSuccess
-                        ? StatusText[Status.CheckSuccess]
-                        : StatusText[data?.status],
-                  },
-                ]}
-              /> */}
             </div>
           </>
         )}
@@ -1099,43 +1067,6 @@ const ContractModal = (props) => {
             <ModuleTitle title="作废流程" />
             <div className={styles.modelItem}>
               <AuditSteps {...auditCelData} statusText="已作废" />
-              {/* <Steps
-                current={data?.status == Status.CalChecking ? 1 : 2}
-                status={
-                  data?.status == Status.CalCheckReject ? 'error' : 'process'
-                }
-                items={[
-                  {
-                    title: '发起',
-                    description: (
-                      <>
-                        <div className={styles.textNowarp}>
-                          发起人:{data?.created_name}
-                        </div>
-                        <div className={styles.textNowarp}>
-                          发起时间:{data?.created_on}
-                        </div>
-                      </>
-                    ),
-                  },
-                  {
-                    title: '审核',
-                    description: (
-                      <>
-                        <div className={styles.textNowarp}>
-                          审核人:{data?.cancel_check_by}
-                        </div>
-                        <div className={styles.textNowarp}>
-                          审核时间:{data?.cancel_check_on}
-                        </div>
-                      </>
-                    ),
-                  },
-                  {
-                    title: StatusText[data?.status],
-                  },
-                ]}
-              /> */}
             </div>
           </>
         )}
@@ -1191,22 +1122,23 @@ const ContractModal = (props) => {
             )}
           </>
         )}
-        {auditList.length > 0 && (
-          <>
-            <ModuleTitle title="审批流程" />
-            <div className={styles.modelItem}>
-              <Steps
-                current={1}
-                items={auditList.map((item, index) => {
-                  return {
-                    title: `审批${index + 1}`,
-                    description: `审批人:${item.name}`,
-                  };
-                })}
-              />
-            </div>
-          </>
-        )}
+        {(type == Type.add || data?.status == Status.ReCall) &&
+          auditList.length > 0 && (
+            <>
+              <ModuleTitle title="审批流程" />
+              <div className={styles.modelItem}>
+                <Steps
+                  current={1}
+                  items={auditList.map((item, index) => {
+                    return {
+                      title: `审批${index + 1}`,
+                      description: `审批人:${item.name}`,
+                    };
+                  })}
+                />
+              </div>
+            </>
+          )}
       </Form>
       <Divider />
     </Modal>

+ 110 - 67
src/pages/ContractManager/index.jsx

@@ -22,7 +22,9 @@ import {
   queryContractCancelCheck,
   queryContractCheck,
   queryContractDownload,
+  queryDelById,
   queryGetContractList,
+  queryOAReCall,
 } from '../../services/contract';
 import dayjs from 'dayjs';
 import FileViewerModal from '@/components/FileViewerNew';
@@ -31,6 +33,7 @@ import PageContent from '@/components/PageContent';
 import EllipsisText from './component/EllipsisText';
 import { stringify } from 'qs';
 import { audit, createAduit } from '@/services/boom';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
 
 const ConteactManager = (props) => {
   const { dispatch } = props;
@@ -154,27 +157,36 @@ const ConteactManager = (props) => {
       width: 100,
       render: (status) => {
         let str = '';
+        let color = 'black';
         switch (status) {
-          case 1:
+          case Status.ReCall:
+            str = '待提交';
+            break;
+          case Status.Checking:
             str = '待审核';
+            color = 'blue';
             break;
-          case 2:
+          case Status.CheckReject:
             str = '审核拒绝';
+            color = 'red';
             break;
-          case 3:
+          case Status.CheckSuccess:
             str = '已存档';
+            color = 'green';
             break;
-          case 4:
+          case Status.CalChecking:
             str = '作废待审核';
+            color = 'blue';
             break;
-          case 5:
+          case Status.CalCheckReject:
             str = '作废拒绝';
+            color = 'red';
             break;
-          case 6:
+          case Status.CalCheckSuccess:
             str = '已作废';
             break;
         }
-        return <div>{str}</div>;
+        return <div style={{ color }}>{str}</div>;
       },
     },
     {
@@ -198,19 +210,7 @@ const ConteactManager = (props) => {
             {showBtn(record, 'download') && (
               <a onClick={() => handleUpload(record)}>下载</a>
             )}
-            {/* {showBtn(record, 'addOrCal') && !record.parent_id && (
-              <a
-                onClick={() => {
-                  typeRef.current = Type.add;
-                  parentIdRef.current = record.id;
-                  setDetail({});
-                  setVisible(true);
-                }}
-              >
-                增补
-              </a>
-            )} */}
-            {record.status == 3 && (
+            {record.status == Status.CheckSuccess && (
               <a
                 onClick={() => {
                   typeRef.current = Type.cancel;
@@ -221,6 +221,10 @@ const ConteactManager = (props) => {
                 作废
               </a>
             )}
+            {(record.status == Status.ReCall ||
+              record.status == Status.CheckReject) && (
+              <a onClick={() => handleDelete(record.id)}>删除</a>
+            )}
           </Space>
         );
       },
@@ -281,39 +285,58 @@ const ConteactManager = (props) => {
     },
   });
 
-  //作废审核
-  const { run: calCheckRun } = useRequest(
-    (data) => queryContractCancelCheck(data),
-    {
-      manual: true,
-      onSuccess: () => {
-        message.success('审核成功');
-        setVisible(false);
-        run(searchData);
-      },
-      onError: () => {
-        message.success('审核失败');
-      },
-    },
-  );
+  // //作废审核
+  // const { run: calCheckRun } = useRequest(
+  //   (data) => queryContractCancelCheck(data),
+  //   {
+  //     manual: true,
+  //     onSuccess: () => {
+  //       message.success('审核成功');
+  //       setVisible(false);
+  //       run(searchData);
+  //     },
+  //     onError: () => {
+  //       message.success('审核失败');
+  //     },
+  //   },
+  // );
+
+  // //审核合同
+  // const { run: runCheck, loading: checkLoading } = useRequest(
+  //   (data) => queryContractCheck(data),
+  //   {
+  //     manual: true,
+  //     onSuccess: () => {
+  //       // conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
+  //       // conAuditedRun({ check_by: user.CName });
+  //       setVisible(false);
+  //       run(searchData);
+  //       message.success('审核成功');
+  //     },
+  //     onErroe: () => {
+  //       message.error('审核失败');
+  //     },
+  //   },
+  // );
 
   //审核合同
-  const { run: runCheck, loading: checkLoading } = useRequest(
-    (data) => queryContractCheck(data),
-    {
-      manual: true,
-      onSuccess: () => {
-        // conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
-        // conAuditedRun({ check_by: user.CName });
-        setVisible(false);
+  const { run: runOACheck } = useRequest(audit, {
+    manual: true,
+    onSuccess: (data) => {
+      if (data?.Code) {
+        message.error(data?.Msg || '审核失败');
+        return;
+      }
+      setTimeout(() => {
         run(searchData);
-        message.success('审核成功');
-      },
-      onErroe: () => {
-        message.error('审核失败');
-      },
+      }, 1000);
+      setVisible(false);
+      message.success('审核成功');
     },
-  );
+    onErroe: () => {
+      message.error('审核失败');
+    },
+  });
 
   //请求项目列表
   const { data: projectData } = useRequest(queryApproval, {
@@ -328,20 +351,22 @@ const ConteactManager = (props) => {
     },
   );
 
-  // const handleAuditSubmit = async () => {
-  //   // setLoading(true);
-  //   try {
-  //     await audit({
-  //       id,
-  //       status: visible,
-  //       ...fieldsValue,
-  //     });
-  //     message.success('操作成功');
-  //     onClose();
-  //     onOk?.();
-  //   } catch (error) {}
-  //   // setLoading(false);
-  // };
+  const handleDelete = (id) => {
+    modal.confirm({
+      icon: <ExclamationCircleOutlined />,
+      title: '提示:',
+      content: <div>确定删除合同,删除后不可回复!</div>,
+      onOk: async () => {
+        const res = await queryDelById({ id });
+        if (res.code == 200) {
+          message.success('删除成功');
+          run(searchData);
+        } else {
+          message.success('删除失败,请重试');
+        }
+      },
+    });
+  };
   const handlePreView = (data) => {
     if (!data?.attach && !data?.attach_extend) return;
     const result = [];
@@ -424,12 +449,29 @@ const ConteactManager = (props) => {
         extend_code: data.code,
         extend_type: 1, //作废提交
       });
-    } else if (type == Status.Checking) {
-      runCheck(data);
-    } else if (type == Status.CalChecking) {
-      calCheckRun(data);
+    } else if (type == Type.check) {
+      runOACheck(data);
     }
   };
+
+  const handlerReCall = async (id) => {
+    modal.confirm({
+      icon: <ExclamationCircleOutlined />,
+      title: '提示:',
+      content: <div>确定撤回合同存档审批!</div>,
+      onOk: async () => {
+        const res = await queryOAReCall(id);
+        if (res.code == 200) {
+          message.success('撤回成功');
+          setVisible(false);
+          run(searchData);
+        } else {
+          message.success('撤回失败,请重试');
+        }
+      },
+    });
+  };
+
   const onPageChange = (page) => {
     run({ ...searchData, current: page });
   };
@@ -546,6 +588,7 @@ const ConteactManager = (props) => {
         handleOk={handleOk}
         handlePreView={handlePreViewSingle}
         handleCancel={() => setVisible(false)}
+        handlerReCall={handlerReCall}
       />
       <FileViewerModal
         data={fileViewerData}

+ 7 - 6
src/pages/Profile/approve.js

@@ -103,7 +103,7 @@ function Approve(props) {
   //   {
   //     manual: true,
   //     onSuccess: () => {
-  //       conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
+  //       conAuditRun({ multi_status: '1,4', current: 1, page_size: 10 });
   //       // conAuditedRun({ check_by: user.CName });
   //       setConVisible(false);
   //       message.success('审核成功');
@@ -121,7 +121,7 @@ function Approve(props) {
   //     onSuccess: () => {
   //       message.success('审核成功');
   //       setConVisible(false);
-  //       conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
+  //       conAuditRun({ multi_status: '1,4', current: 1, page_size: 10 });
   //     },
   //     onError: () => {
   //       message.success('审核失败');
@@ -129,6 +129,7 @@ function Approve(props) {
   //   },
   // );
 
+  //审核合同
   const { run: runOACheck } = useRequest(audit, {
     manual: true,
     onSuccess: (data) => {
@@ -137,7 +138,7 @@ function Approve(props) {
         return;
       }
       setTimeout(() => {
-        conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
+        conAuditRun({ multi_status: '1,4', current: 1, page_size: 10 });
       }, 1000);
 
       // conAuditedRun({ check_by: user.CName });
@@ -160,7 +161,7 @@ function Approve(props) {
       OAAuditRun({ current: 1, page_size: 10 });
     } else {
       if (user?.Permission['menu-001-audit'])
-        conAuditRun({ multi_status: '1,4', currentPage: 1, page_size: 10 });
+        conAuditRun({ multi_status: '1,4', current: 1, page_size: 10 });
     }
     setTabActive(activeKey);
   };
@@ -171,13 +172,13 @@ function Approve(props) {
   const handleProfilePaginationChange = (pagination) => {
     conAuditRun({
       multi_status: user?.Permission['menu-001-audit'] ? '1,4' : undefined,
-      currentPage: pagination.current,
+      current: pagination.current,
       page_size: 10,
     });
   };
   const handleApplyPaginationChange = (pagination) => {
     OAAuditRun({
-      currentPage: pagination.current,
+      current: pagination.current,
       pageSize: pagination.pageSize,
     });
   };

+ 72 - 0
src/pages/UserCenter/index.js

@@ -0,0 +1,72 @@
+import { queryChangePassWord } from '@/services/user';
+import { useModel, useNavigate } from '@umijs/max';
+import { Form, Input, Button, message } from 'antd';
+import { useState } from 'react';
+
+const ChangePassWord = () => {
+  const {
+    initialState: { user },
+  } = useModel('@@initialState');
+  const navigate = useNavigate();
+
+  const onFinish = async (values) => {
+    const res = await queryChangePassWord({
+      ID: user.ID,
+      Password: values.password,
+    });
+    if (res?.code === 200 && res?.msg === 'ok') {
+      message.success('修改密码成功');
+      navigate('/login');
+    }
+  };
+
+  return (
+    <div style={{ margin: 'auto' }}>
+      <Form
+        name="basic"
+        labelCol={{ span: 8 }}
+        wrapperCol={{ span: 16 }}
+        style={{ width: 600 }}
+        initialValues={{ remember: true }}
+        onFinish={onFinish}
+        autoComplete="off"
+      >
+        <Form.Item
+          label="请输入密码:"
+          name="password"
+          rules={[{ required: true, message: '请输入密码' }]}
+        >
+          <Input.Password autoComplete="false" />
+        </Form.Item>
+        <Form.Item
+          label="请再一次输入密码:"
+          name="password2"
+          rules={[
+            {
+              required: true,
+              message: '请再一次输入密码!',
+            },
+            ({ getFieldValue }) => ({
+              validator(_, value) {
+                if (!value || getFieldValue('password') === value) {
+                  return Promise.resolve();
+                }
+                return Promise.reject(new Error('两次输入的密码不一致!'));
+              },
+            }),
+          ]}
+        >
+          <Input.Password />
+        </Form.Item>
+
+        <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
+          <Button type="primary" htmlType="submit">
+            保存
+          </Button>
+        </Form.Item>
+      </Form>
+    </div>
+  );
+};
+
+export default ChangePassWord;

+ 12 - 0
src/services/contract.js

@@ -86,3 +86,15 @@ export const queryAuditByCode = async (data) => {
     params: data,
   });
 };
+
+//撤回合同审批申请
+export const queryOAReCall = async (data) => {
+  return await request(`/api/v1/oa/repeal/${data}`);
+};
+//删除合同
+export const queryDelById = async (data) => {
+  return await request(`/api/contract/v1/delete`, {
+    method: 'DELETE',
+    params: data,
+  });
+};

+ 10 - 2
src/services/user.js

@@ -1,4 +1,5 @@
-import {request }from 'umi';
+import { message } from 'antd';
+import { request } from 'umi';
 
 export async function query() {
   return request('/api/v1/user');
@@ -21,11 +22,18 @@ export async function queryCurrentV2() {
 export async function queryUserRole(userId) {
   return request('/api/v2/user/detail/' + userId, { method: 'GET' });
 }
+//ID:471
+// Password:"123123"
+export async function queryChangePassWord(data) {
+  return request('/api/v1/user/password', {
+    method: 'POST',
+    data,
+  });
+}
 // export async function queryCurrent() {
 //   return request('/api/v1/user/current-user', { method: 'GET' });
 // }
 
-
 // export async function queryUnreadNotification() {
 //   return request('/notification/unread/', { method: 'GET' });
 // }