Browse Source

隐藏现金流表单

xujunjie 1 year ago
parent
commit
ef3a66910c
1 changed files with 9 additions and 7 deletions
  1. 9 7
      src/utils/uploadExcelByUrl.js

+ 9 - 7
src/utils/uploadExcelByUrl.js

@@ -1,15 +1,14 @@
 import LuckyExcel from 'luckyexcel';
 import { getToken } from '@/utils/utils';
 import moment from 'moment';
-window.moment = moment
-
+window.moment = moment;
 
 const uploadExcelByUrl = (nodeType, versionId, project) => {
   const TEMPLATE_URL =
     'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/bom/psr1010.xlsx';
-    // 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/bom/psr1009.xlsx';
-    // 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/bom/psr1008.xlsx';
-    // 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/public/bom/psr0913.xlsx';
+  // 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/bom/psr1009.xlsx';
+  // 'https://water-service-test.oss-cn-hangzhou.aliyuncs.com/public/bom/psr1008.xlsx';
+  // 'https://gt-digitization.oss-cn-hangzhou.aliyuncs.com/public/bom/psr0913.xlsx';
 
   return new Promise((resolve, reject) => {
     LuckyExcel.transformExcelToLuckyByUrl(
@@ -35,6 +34,9 @@ const uploadExcelByUrl = (nodeType, versionId, project) => {
         res.push(initPSR(excelData[1], category, project?.project_name));
 
         if (nodeType == 4) {
+          // 隐藏现金流表
+          excelData[3].hide = 1;
+          excelData[3].status = 0;
           // 处理现金流
           res.push(initActual(excelData[3], category, project));
         }
@@ -184,8 +186,8 @@ function initActual(actual, category, project) {
       }
     } else if (item.c == 12 && item.r == 5) {
       // 设置第一个月时间
-      let start_date = moment("1900-01-01 00:00:00");
-      let end_date = moment().startOf('month')
+      let start_date = moment('1900-01-01 00:00:00');
+      let end_date = moment().startOf('month');
       item.v.v = end_date.diff(start_date, 'days');
     }
   });