Ver Fonte

修复版本显示不正确

xujunjie há 3 anos atrás
pai
commit
279a52bb32

+ 1 - 0
config/config.js

@@ -63,6 +63,7 @@ if (APP_TYPE === 'site') {
 }
 
 export default {
+  hash: true,
   // add for transfer to umi
   plugins,
   base: '/bom/',

+ 4 - 4
public/luckysheet.html

@@ -7,20 +7,20 @@
     <title>Document</title>
 
    <!-- 线上发布使用路径 -->
-   <link rel="stylesheet" href="/bom/Luckysheet/plugins/css/pluginsCss.css" />
+   <!-- <link rel="stylesheet" href="/bom/Luckysheet/plugins/css/pluginsCss.css" />
    <link rel="stylesheet" href="/bom/Luckysheet/plugins/plugins.css" />
    <link rel="stylesheet" href="/bom/Luckysheet/css/luckysheet.css" />
    <link rel="stylesheet" href="/bom/Luckysheet/assets/iconfont/iconfont.css" />
    <script src="/bom/Luckysheet/plugins/js/plugin.js"></script>
-   <script src="/bom/Luckysheet/luckysheet.umd.js"></script>
+   <script src="/bom/Luckysheet/luckysheet.umd.js"></script> -->
 
    <!-- 本地开发使用路径 -->
-   <!-- <link rel='stylesheet' href='http://localhost:3000/plugins/css/pluginsCss.css' />
+   <link rel='stylesheet' href='http://localhost:3000/plugins/css/pluginsCss.css' />
    <link rel='stylesheet' href='http://localhost:3000/plugins/plugins.css' />
    <link rel='stylesheet' href='http://localhost:3000/css/luckysheet.css' />
    <link rel='stylesheet' href='http://localhost:3000/assets/iconfont/iconfont.css' />
    <script src="http://localhost:3000/plugins/js/plugin.js"></script>
-   <script src="http://localhost:3000/luckysheet.umd.js"></script> -->
+   <script src="http://localhost:3000/luckysheet.umd.js"></script>
   </head>
   <body>
     <div

+ 8 - 4
src/pages/PurchaseAdmin/PurchaseList/Detail/FlowModal.js

@@ -36,11 +36,15 @@ function FlowModal(props) {
     // setData(node.version);
     let res = await queryVserionByNode({ template_node_id: node.Id });
     console.log(res);
-    let data = []
+    let data = [];
     Object.values(res.data.excel_version).map(arr => {
-      data = [...data,arr[arr.length - 1]]
-    })
-    console.log(data)
+      if (res.data.flow_id) {
+        data = [...data, arr[arr.length - 1]];
+      } else {
+        data = [...data, ...arr];
+      }
+    });
+    console.log(data);
     setData(data);
   };
 

+ 19 - 16
src/pages/PurchaseAdmin/PurchaseList/Detail/Index.js

@@ -92,13 +92,13 @@ function Detail(props) {
     if (version?.flow_id && auditList?.length > 0) {
       let item = auditList.find(item => item.list.id == version.flow_id);
       if (!item) return data;
-      // 合并同审批级别项
-      let nodes = {};
-      item.list.FlowNodes.map(item => {
-        if (!nodes[item.seq]) nodes[item.seq] = { ...item, user: [] };
-        nodes[item.seq].user.push(item.AuditorUser);
-      });
-      item.list.FlowNodes = Object.values(nodes);
+      // // 合并同审批级别项
+      // let nodes = {};
+      // item.list.FlowNodes.map(item => {
+      //   if (!nodes[item.seq]) nodes[item.seq] = { ...item, user: [] };
+      //   nodes[item.seq].user.push(item.AuditorUser);
+      // });
+      // item.list.FlowNodes = Object.values(nodes);
       // 查询当前节点
       let current = item.list.FlowNodes.findIndex(node => node.seq == item.active);
       item.current = current == -1 ? 0 : current;
@@ -113,7 +113,9 @@ function Detail(props) {
 
   const isAuditor = useMemo(() => {
     const getUserRole = () => {
-      let item = flow.currentNode?.user?.find?.(item => item.ID == currentUser.ID);
+      let roleID = flow.currentNode?.AuditRoleInfo?.ID;
+      let item = currentUser.Permissions.find(role => role.RoleId == roleID);
+      //.find?.(item => item.ID == currentUser.ID);
       if (item) return true;
       return false;
     };
@@ -878,7 +880,7 @@ function Detail(props) {
     const nodeId = version.template_node_id;
     if (!flowDetail?.nodes || !nodeId) return;
     const node = flowDetail.nodes.find(item => item.Id == nodeId);
-    return `当前节点:${node?.label || '-'}`;
+    return `当前版本:${version.version_name || '-'};    当前节点:${node?.label || '-'}`;
   };
 
   const handleSubmitCell = (value, callback) => {
@@ -998,17 +1000,18 @@ function Detail(props) {
               </Option>
             ))}
           </Select> */}
-          {/* {flow?.active == 0 && ( */}
           <Button type="primary" onClick={() => setFlowVisible(true)}>
             查看流程
           </Button>
-          <Button
-            type="primary"
-            icon={<PlusOutlined onClick={() => setVersionVisible(true)} />}
-            onClick={() => setVersionVisible(true)}
-          ></Button>
 
-          {/* )} */}
+          {/* 非审批节点可以创建版本 */}
+          {flow?.active == 0 && (
+            <Button
+              type="primary"
+              icon={<PlusOutlined onClick={() => setVersionVisible(true)} />}
+              onClick={() => setVersionVisible(true)}
+            ></Button>
+          )}
           <span style={{ marginLeft: 20 }}>{renderNode()}</span>
         </div>
         <div className={styles.btns}>

+ 1 - 3
src/pages/PurchaseAdmin/PurchaseList/Detail/TimeNode.js

@@ -22,9 +22,7 @@ function TimeNode(props) {
             <Step
               key={item.id}
               title={item.node}
-              description={`审批人:${item?.user
-                .map(user => user.CName)
-                .join(item.seq_relate == 1 ? '或' : '且') || '-'}`}
+              description={`审批角色:${item?.AuditRoleInfo.Name || '-'}`}
             />
           ))}
         </Steps>

+ 26 - 26
src/pages/PurchaseAdmin/PurchaseList/Flow/Audit.js

@@ -22,32 +22,32 @@ function Audit(props) {
       width: "20%",
       dataIndex: 'node',
     },
-    {
-      title: '审批级别',
-      dataIndex: 'seq',
-      width: "20%",
-    },
+    // {
+    //   title: '审批级别',
+    //   dataIndex: 'seq',
+    //   width: "20%",
+    // },
     {
       title: '审批角色',
-      dataIndex: 'auditor',
-      width: "20%",
-      render: auditor => roleList.find(item => item.ID == auditor)?.Name,
-    },
-    {
-      title: '审批关系',
+      dataIndex: 'audit_role',
       width: "20%",
-      dataIndex: 'seq_relate',
-      render: relate => {
-        switch (relate) {
-          case 0:
-            return '无';
-          case 1:
-            return '或';
-          case 2:
-            return '并';
-        }
-      },
+      render: audit_role => roleList.find(item => item.ID == audit_role)?.Name,
     },
+    // {
+    //   title: '审批关系',
+    //   width: "20%",
+    //   dataIndex: 'seq_relate',
+    //   render: relate => {
+    //     switch (relate) {
+    //       case 0:
+    //         return '无';
+    //       case 1:
+    //         return '或';
+    //       case 2:
+    //         return '并';
+    //     }
+    //   },
+    // },
     {
       title: '操作',
       width: "20%",
@@ -125,13 +125,13 @@ function Audit(props) {
   //   setCurrent({});
   // };
   const onSave = () => {
-    const nodes = current.FlowNodes.map(item => ({
+    const nodes = current.FlowNodes.map((item,index) => ({
       flow_id: current.id,
       node: item.node,
       desc: item.desc,
-      auditor: item.auditor,
-      seq: item.seq,
-      seq_relate: item.seq_relate,
+      audit_role: item.audit_role,
+      seq: index + 1,
+      // seq_relate: item.seq_relate,
     }));
 
     dispatch({

+ 3 - 3
src/pages/PurchaseAdmin/PurchaseList/Flow/AuditNodeModal.js

@@ -34,7 +34,7 @@ function AuditModal(props) {
         <Form.Item label="审批级别" name="seq">
           <InputNumber style={{ width: '100%' }} step={1} min={1} />
         </Form.Item>
-        <Form.Item label="审批角色" name="auditor">
+        <Form.Item label="审批角色" name="audit_role">
           <Select
             showSearch
             style={{ width: '100%' }}
@@ -48,12 +48,12 @@ function AuditModal(props) {
               ))}
           </Select>
         </Form.Item>
-        <Form.Item initialValue={data?.seq_relate || 1} label="审批关系" name="seq_relate">
+        {/* <Form.Item initialValue={data?.seq_relate || 1} label="审批关系" name="seq_relate">
           <Radio.Group>
             <Radio value={1}>或</Radio>
             <Radio value={2}>并</Radio>
           </Radio.Group>
-        </Form.Item>
+        </Form.Item> */}
       </Form>
     </Modal>
   );

+ 1 - 1
src/pages/PurchaseAdmin/PurchaseList/List/NewList.js

@@ -8,7 +8,7 @@ function List(props) {
 
   const columns = [
     {
-      title: '名称',
+      title: '流程名称',
       width: '35%',
       render: item => item.version_name || item.name,
     },