Procházet zdrojové kódy

项目报表 表头修改,执行项目预算显示未设置

XuZinan před 2 roky
rodič
revize
59e216fe0a

+ 18 - 8
src/pages/PurchaseAdmin/PurchaseList/Report/ProjectTree.js

@@ -25,17 +25,27 @@ function ProjectTree(props) {
         dataIndex: 'name',
         // render: (name, item) => <a onClick={() => handleClick(item)}>{name}</a>,
       },
-      { title: '待审核工时', dataIndex: 'month_pending_audit_cnt', width: '10%' },
-      { title: '已审核工时', dataIndex: 'month_refuse_audit_cnt', width: '10%' },
-      { title: '已拒绝工时', dataIndex: 'month_pass_audit_cnt', width: '10%' },
-      { title: '总工时', dataIndex: 'total_workload', width: '10%' },
+      { title: '本月待审核工时', dataIndex: 'month_pending_audit_cnt', width: '15%' },
+      { title: '本月已审核工时', dataIndex: 'month_refuse_audit_cnt', width: '15%' },
+      { title: '本月已拒绝工时', dataIndex: 'month_pass_audit_cnt', width: '15%' },
+      { title: '累计有效工时', dataIndex: 'total_workload', width: '15%' },
     ];
     if (columnsFilter.budget) {
-      arr.push({ title: '预算 ', dataIndex: 'budget', width: '10%' });
-    }
-    if (columnsFilter.dep) {
-      arr.splice(1, 0, { title: '所属部门', dataIndex: 'dep_name', width: '15%' });
+      arr.push({
+        title: '预算 ',
+        dataIndex: 'budget',
+        width: '10%',
+        render: (_, record) =>
+          record.cond?.project_id && record.cond?.status == 0
+            ? record.budget === null
+              ? '未设置'
+              : record.budget
+            : null,
+      });
     }
+    // if (columnsFilter.dep) {
+    //   arr.splice(1, 0, { title: '所属部门', dataIndex: 'dep_name', width: '15%' });
+    // }
     return arr;
   }, [columnsFilter]);