소스 검색

1. 导入其他标段工程量清单计量数据,指定项目节
2. 批量导入,继承指定项目节配置

MaiXinRong 8 달 전
부모
커밋
ab356e5860
3개의 변경된 파일11개의 추가작업 그리고 6개의 파일을 삭제
  1. 8 4
      app/lib/sum_load.js
  2. 1 1
      app/public/js/shares/batch_import.js
  3. 2 1
      app/public/js/shares/tender_select.js

+ 8 - 4
app/lib/sum_load.js

@@ -453,12 +453,13 @@ class sumLoad {
         this.ctx = ctx;
     }
 
-    recusiveLoadGatherGcl(node, parent, ignoreParent = false) {
+    recusiveLoadGatherGcl(node, parent, ignoreParent = false, match = false) {
+        const loadMatch = match || node.match || (parent && parent.match);
         const isLeaf = !node.children || node.children.length === 0;
-        const cur = (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
+        const cur = loadMatch && (!ignoreParent || isLeaf) && node.b_code ? this.loadTree.gather(node, parent) : parent;
         if (isLeaf) return;
         for (const child of node.children) {
-            this.recusiveLoadGatherGcl(child, cur, ignoreParent);
+            this.recusiveLoadGatherGcl(child, cur, ignoreParent, loadMatch);
         }
     }
 
@@ -555,7 +556,7 @@ class sumLoad {
     async stageGatherGcl(select, maxId, tenders, defaultData, cover, ignore, loadChange) {
         const ignoreParent = this.ctx.tender.info.fun_rela.sum_load.ignoreParent;
         this.loadTree = new gatherStageGclTree(this.ctx, {
-            parent: select, maxId, type: 'ledger', defaultData, ignoreParent, cover, ignoreNotFind: ignore, loadChange,
+            parent: select, maxId, type: 'ledger', defaultData, ignoreParent, cover, ignoreNotFind: ignore, loadChange
         });
         const posterity = await this.ctx.service.ledger.getPosterityByParentId(this.ctx.tender.id, select.ledger_id);
         const extraData = await this.ctx.service.ledgerExtra.getData(this.ctx.tender.id, ['is_tp']);
@@ -599,6 +600,9 @@ class sumLoad {
                 stageId: 'id',
             });
             billsTree.loadDatas(billsData);
+            billsTree.nodes.forEach(x => {
+                x.match = tender.match_code ? x.code === tender.match_code : true;
+            });
             for (const top of billsTree.children) {
                 if ([1].indexOf(top.node_type) < 0) continue;
                 this.recusiveLoadGatherGcl(top, null, ignoreParent);

+ 1 - 1
app/public/js/shares/batch_import.js

@@ -131,7 +131,7 @@ const BatchImportStageGcl = function (setting) {
         importStageGcl: async function (node, cover, ignore, loadChange) {
             const updateData = { lid: node.lid, type: 'stage', cover, ignore, loadChange, tenders: [] };
             for (const tender of node.children) {
-                updateData.tenders.push({ tid: tender.tid, name: tender.name, stageCount: tender.stageCount, stage: tender.stage });
+                updateData.tenders.push({ tid: tender.tid, name: tender.name, stageCount: tender.stageCount, stage: tender.stage, match_code: tender.match_code });
             }
 
             const result = await postDataAsync(window.location.pathname + '/sumLoad', updateData);

+ 2 - 1
app/public/js/shares/tender_select.js

@@ -151,7 +151,7 @@ const TenderSelect = function (setting) {
                 defaultRowHeight: 21,
                 headerFont: '12px 微软雅黑',
                 font: '12px 微软雅黑',
-                headColWidth: [],
+                headColWidth: [30],
                 getColor: function (sheet, data, row, col, defaultColor) {
                     if (data) {
                         return data.invalid ? '#ddd' : defaultColor;
@@ -168,6 +168,7 @@ const TenderSelect = function (setting) {
                 resultSpreadSetting.cols.push(
                     {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 180, formatter: '@', readOnly: true, cellType: 'ellipsisAutoTip'},
                     {title: '可选期', colSpan: '1', rowSpan: '1', field: 'stage', hAlign: 0, width: 60},
+                    {title: '指定项目节', colSpan: '1', rowSpan: '1', field: 'match_code', hAlign: 0, width: 70, formatter: '@', },
                 )
             }
             SpreadJsObj.initSheet(this.resultSheet, resultSpreadSetting);