Forráskód Böngészése

Squashed commit of the following:
merge dev
commit baac9dae9d14508a7939e21b6e7e9087524e9a65
Author: Renxy <18510891294@163.com>
Date: Thu Sep 7 20:14:29 2023 +0800

添加权限

commit 04eb7ffdff7add3838b795a108084b38dabcf839
Merge: ae1b55b 5c5dfb0
Author: Renxy <18510891294@163.com>
Date: Thu Sep 7 13:59:35 2023 +0800

Merge branch 'develop' of http://120.55.44.4:10080/xujunjie/GtDigManageWeb into develop

commit ae1b55bcb66fef635da9ce076badb391d537cb87
Author: Renxy <18510891294@163.com>
Date: Thu Sep 7 13:59:29 2023 +0800

合同管理分子公司直接归档和作废

commit 5c5dfb04fcff09bd7f67b0628c94cf9173a80fb9
Author: ZhaoJun <jun.zhao@greentech.com.cn>
Date: Sat Aug 5 17:41:41 2023 +0800

feat: 增加对Token的处理

commit 577114db3da662a9d3bd0ec471c42dd2ade8df90
Author: ZhaoJun <jun.zhao@greentech.com.cn>
Date: Sat Aug 5 17:16:52 2023 +0800

feat: 修改传参方式

commit 0077653263f9ca6b41f8b026ea2f7d1cbb362be8
Author: ZhaoJun <jun.zhao@greentech.com.cn>
Date: Thu Aug 3 16:19:31 2023 +0800

fix: 修改控件类型识别为componentName

# Conflicts:
# public/excelData.json
# src/pages/PSRManage/detail.js

Renxy 1 éve
szülő
commit
113cae08b7

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/css/luckysheet.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/luckysheet.umd.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/luckysheet.umd.js.map


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/plugins/css/pluginsCss.css


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/plugins/js/plugin.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 0
public/Luckysheet/plugins/plugins.css


+ 1 - 1
src/components/AuditForm/ComponentLibrary.js

@@ -22,7 +22,7 @@ function ComponentLibrary(props) {
     <Modal open={visible} onCancel={handleCancel} onOk={handleOk}>
       <Row gutter={12} style={{ paddingTop: 20 }}>
         {COMPONENT_LIST.map((item) => {
-          if (addToTable && item.props.label === '表格') {
+          if (addToTable && item.componentName === 'DIYTable') {
             return null;
           }
           return (

+ 2 - 2
src/components/AuditForm/index.js

@@ -57,7 +57,7 @@ function AuditForm(props) {
       props: { ...item.props, id: `${item.componentName}_${uuidv4()}` },
     };
     // 如果是表格的话
-    if (item.props.label === '表格') {
+    if (item.componentName === 'DIYTable') {
       newItem.columns = [];
       newItem.isTable = true;
     }
@@ -165,7 +165,7 @@ function AuditForm(props) {
           onChange={handleChangeList}
           onTableColumnChange={handleTableColumnChange}
           list={formList}
-        ></FormContent>
+        />
         <ItemAttribute
           formList={formList}
           key={selectList[selectList.length - 1]}

+ 16 - 8
src/pages/ContractManager/component/Modal.jsx

@@ -104,6 +104,9 @@ const ContractModal = (props) => {
   const project_name = Form.useWatch('project_name', form);
   const archives_dep = Form.useWatch('archives_dep', form);
 
+  //处理分子公司创建合同直接已归档   作废合同直接作废
+  const [isFlag, setIsFlag] = useState();
+
   // 当为审核拒绝状态时,点击编辑按钮可以时为强制修改状态
   const [forceModify, setForceModify] = useState(false);
 
@@ -217,7 +220,7 @@ const ContractModal = (props) => {
   });
 
   //供应商列表
-  const { data: supplierList = [], loading } = useRequest(querySupplierList, {
+  const { data: supplierList = [] } = useRequest(querySupplierList, {
     defaultParams: [
       {
         project_id: 1,
@@ -288,8 +291,10 @@ const ContractModal = (props) => {
   useEffect(() => {
     //兼容之前选择的所属部门,用的现在的接口匹配不到部门显示数字的问题
     if (data?.company_id) {
-      const deps = getDepItemById(data?.company_id)?.children;
-      deps ? setCompanyDepList(deps) : setCompanyDepList([]);
+      const deps = getDepItemById(data?.company_id);
+      deps?.children ? setCompanyDepList(deps.children) : setCompanyDepList([]);
+      //只有本部展示归档审批流和作废审批流
+      if (deps?.Flag == 1) setIsFlag(true);
     }
   }, [data, depList]);
 
@@ -379,9 +384,13 @@ const ContractModal = (props) => {
       data?.status !== Status.CheckReject
     )
       return;
+    const item = companyData?.find((item) => item.ID == company);
+    //子公司不获取审批流
+    if (item?.Flag !== 1) return;
+
     const param = { ...advance };
     let formValues = [];
-    const item = companyData?.find((item) => item.ID == company);
+
     formValues.push({
       ...formData[0],
       value: item?.Flag == 1 ? ['是'] : ['否'],
@@ -484,7 +493,6 @@ const ContractModal = (props) => {
         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,
         );
@@ -494,7 +502,7 @@ const ContractModal = (props) => {
         values.dep_name = depItem?.Name;
         values.dep_code = depItem?.Code;
         values.created_by = user?.ID;
-        handleOk(values, Type.add, form, audit_list);
+        handleOk(values, Type.add, form, audit_list, companyItem.Flag !== 1); //分子公司不创建审批流,直接已归档
       } else if (type == Type.cancel) {
         const form = getAuditData(values, '2');
         const audit_list = auditData?.OaAuditList?.map((item) => item?.auditor);
@@ -1087,7 +1095,7 @@ const ContractModal = (props) => {
             </Col>
           </Row>
 
-          {data?.status >= Status.Checking && !forceModify && (
+          {isFlag && data?.status >= Status.Checking && !forceModify && (
             <>
               <ModuleTitle title="归档流程" />
               <div className={styles.modelItem}>
@@ -1133,7 +1141,7 @@ const ContractModal = (props) => {
               </span>
             </Form.Item>
           )}
-          {data?.status >= Status.CalChecking && (
+          {isFlag && data?.status >= Status.CalChecking && (
             <>
               <ModuleTitle title="作废流程" />
               <div className={styles.modelItem}>

+ 11 - 8
src/pages/ContractManager/index.jsx

@@ -266,7 +266,7 @@ const ConteactManager = (props) => {
     manual: true,
     onSuccess: () => {
       // message.success('添加成功');
-      createRun(oaParamsRef.current);
+      if (oaParamsRef.current) createRun(oaParamsRef.current);
       oaParamsRef.current = null;
       setVisible(false);
       run(searchData);
@@ -414,14 +414,17 @@ const ConteactManager = (props) => {
     }
   };
 
-  const handleOk = (data, type, formData = [], audit_list = []) => {
+  const handleOk = (data, type, formData = [], audit_list = [], notFlag) => {
+    //notFlag=true 不是本部
     if (type == Type.add) {
-      oaParamsRef.current = {
-        form: JSON.stringify(formData),
-        audit_list,
-        extend_code: data.code,
-        extend_type: 0, //归档提交
-      };
+      oaParamsRef.current = notFlag
+        ? null
+        : {
+            form: JSON.stringify(formData),
+            audit_list,
+            extend_code: data.code,
+            extend_type: 0, //归档提交
+          };
       editRun(data);
     } else if (type == Type.cancel) {
       calRun(data);

+ 31 - 21
src/pages/Flow/OaAuditDetail.js

@@ -1,33 +1,42 @@
 // 审批详情
-import React, { useState, useMemo, useEffect } from 'react';
-import { Steps, Button, Tooltip, message, Spin } from 'antd';
-import { useParams, useRequest, useModel, useLocation } from 'umi';
+import React, {useState, useMemo, useEffect} from 'react';
+import {Steps, Button, Tooltip, message, Spin} from 'antd';
+import {useRequest, useModel, useLocation} from 'umi';
 import AuditModal from './components/AuditModal';
 import FormAndFilesNode from './components/FormAndFilesNode';
-import { queryAuditDetail, updateAuditList } from '@/services/boom';
-import { queryGetContractList } from '@/services/contract';
+import {queryAuditDetail, updateAuditList} from '@/services/boom';
+import {queryGetContractList} from '@/services/contract';
 import PageContent from '@/components/PageContent';
 import SignModal from './components/SignModal';
 import ContractDetail from '../ContractManager/detail';
-import { Type } from '../Profile';
-import { queryContractDetail } from '../../services/contract';
+import {Type} from '../Profile';
+import {queryContractDetail} from '../../services/contract';
 
 function OaAuditDetail() {
-  const { initialState } = useModel('@@initialState');
+  const {initialState} = useModel('@@initialState');
   const user = initialState?.user || {};
   const [auditVisible, setAuditVisible] = useState(false);
-  const location = useLocation();
-  const {
-    state: { id, type, code },
-  } = location;
   const [visible, setVisible] = useState(false);
 
+  const location = useLocation();
+  const queryParams = new URLSearchParams(location.search);
+  // 使用queryParams来获取特定查询参数
+  const id = queryParams.get('id');
+  const code = queryParams.get('code');
+  const token = queryParams.get('JWT-TOKEN')
+  if (!localStorage['JWT-TOKEN']) {
+    localStorage['JWT-TOKEN'] = token
+  }
+
+  const type = code ? Type.CON : Type.OA
+
+
   useEffect(() => {
-    if (type == Type.CON) runCon({ code });
+    if (type == Type.CON) runCon({code});
   }, [type]);
 
-  const { data, loading, refresh } = useRequest(queryAuditDetail, {
-    defaultParams: [{ id }],
+  const {data, loading, refresh} = useRequest(queryAuditDetail, {
+    defaultParams: [{id}],
   });
   const {
     current_seq,
@@ -49,7 +58,8 @@ function OaAuditDetail() {
     formatResult: (res) => {
       return res?.data?.detail;
     },
-    onSuccess: (res) => {},
+    onSuccess: (res) => {
+    },
   });
   // console.log(conData);
 
@@ -63,7 +73,7 @@ function OaAuditDetail() {
           {str}
           <div>
             <Tooltip title={node.desc}>
-              <span style={{ color: '#1A73E8', textDecoration: 'undeline' }}>
+              <span style={{color: '#1A73E8', textDecoration: 'undeline'}}>
                 审批意见
               </span>
             </Tooltip>
@@ -109,7 +119,7 @@ function OaAuditDetail() {
       return [
         <Button
           key={1}
-          style={{ marginRight: 10 }}
+          style={{marginRight: 10}}
           type="primary"
           onClick={() => setAuditVisible(1)}
         >
@@ -129,7 +139,7 @@ function OaAuditDetail() {
   return (
     <PageContent extra={btns} loading={loading && conLoading}>
       <Steps
-        style={{ marginBottom: 20 }}
+        style={{marginBottom: 20}}
         current={audit_status == 3 ? OaAuditList?.length : current_seq - 1}
         status={audit_status == 2 ? 'error' : 'process'}
         items={OaAuditList?.map((item) => ({
@@ -138,9 +148,9 @@ function OaAuditDetail() {
         }))}
       ></Steps>
       {type == Type.OA ? (
-        <FormAndFilesNode formData={form} fileList={Files} />
+        <FormAndFilesNode formData={form} fileList={Files}/>
       ) : (
-        <ContractDetail data={conData} />
+        <ContractDetail data={conData}/>
       )}
 
       <AuditModal

+ 4 - 1
src/pages/PSRManage/detail.js

@@ -9,6 +9,7 @@ import {
   useRequest,
   useSearchParams,
   useNavigate,
+  useModel,
 } from '@umijs/max';
 import {
   queryPsrExcel,
@@ -213,6 +214,8 @@ const workConfig = [
 ];
 
 const PSRDetail = () => {
+  const { initialState } = useModel('@@initialState');
+  const user = initialState?.user || {};
   const navigate = useNavigate();
   const params = useParams();
   const location = useLocation();
@@ -542,7 +545,6 @@ const PSRDetail = () => {
     luckysheetRef.current = contentWindow.luckysheet;
   };
   const renderSheet = (currentData, is_edit = false) => {
-    console.log('==================', JSON.stringify(currentData));
     if (!luckysheetRef.current) {
       setTimeout(() => {
         renderSheet(currentData, is_edit);
@@ -577,6 +579,7 @@ const PSRDetail = () => {
       lang: 'zh',
       showinfobar: false,
       showstatisticBar: false,
+      permissions: user?.Permission,
       data: JSON.parse(JSON.stringify(data)),
       hook: {
         cellMousedown: (cell, position, sheet) => {

+ 2 - 10
src/pages/Profile/index.js

@@ -85,17 +85,9 @@ function profile(props) {
                   style={{ color: '#4096ff' }}
                   onClick={() => {
                     if (record.extend_code) {
-                      navigate('/profile/detail', {
-                        state: {
-                          id: record.id,
-                          code: record.extend_code,
-                          type: Type.CON,
-                        },
-                      });
+                      navigate(`/profile/detail?id=${record.id}&code=${record.extend_code}`);
                     } else {
-                      navigate('/profile/detail', {
-                        state: { id: record.id, type: Type.OA },
-                      });
+                      navigate(`/profile/detail?id=${record.id}`);
                     }
                   }}
                 >

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott