|
@@ -1,15 +1,14 @@
|
|
import LuckyExcel from 'luckyexcel';
|
|
import LuckyExcel from 'luckyexcel';
|
|
import { getToken } from '@/utils/utils';
|
|
import { getToken } from '@/utils/utils';
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
-window.moment = moment
|
|
|
|
-
|
|
|
|
|
|
+window.moment = moment;
|
|
|
|
|
|
const uploadExcelByUrl = (nodeType, versionId, project) => {
|
|
const uploadExcelByUrl = (nodeType, versionId, project) => {
|
|
const TEMPLATE_URL =
|
|
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/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) => {
|
|
return new Promise((resolve, reject) => {
|
|
LuckyExcel.transformExcelToLuckyByUrl(
|
|
LuckyExcel.transformExcelToLuckyByUrl(
|
|
@@ -35,6 +34,9 @@ const uploadExcelByUrl = (nodeType, versionId, project) => {
|
|
res.push(initPSR(excelData[1], category, project?.project_name));
|
|
res.push(initPSR(excelData[1], category, project?.project_name));
|
|
|
|
|
|
if (nodeType == 4) {
|
|
if (nodeType == 4) {
|
|
|
|
+ // 隐藏现金流表
|
|
|
|
+ excelData[3].hide = 1;
|
|
|
|
+ excelData[3].status = 0;
|
|
// 处理现金流
|
|
// 处理现金流
|
|
res.push(initActual(excelData[3], category, project));
|
|
res.push(initActual(excelData[3], category, project));
|
|
}
|
|
}
|
|
@@ -184,8 +186,8 @@ function initActual(actual, category, project) {
|
|
}
|
|
}
|
|
} else if (item.c == 12 && item.r == 5) {
|
|
} 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');
|
|
item.v.v = end_date.diff(start_date, 'days');
|
|
}
|
|
}
|
|
});
|
|
});
|