浏览代码

清单汇总模型调整

MaiXinRong 4 年之前
父节点
当前提交
9bdd00e694
共有 3 个文件被更改,包括 21 次插入18 次删除
  1. 9 8
      app/public/js/gcl_gather.js
  2. 10 8
      app/public/js/shares/gcl_gather_compare.js
  3. 2 2
      db_script/depart-database-table.js

+ 9 - 8
app/public/js/gcl_gather.js

@@ -429,23 +429,22 @@ const gclGatherModel = (function () {
             cc.filter = '^[^0-9]*' + c.code.substr(0, c.code.length - 2) + '[0-9]{2}-';
             gclChapter.push(cc);
         }
-        gclChapter.push({ name: '未计入章节清单合计', cType: 21, serialNo: serialNo++ });
-
-        otherChapter.push({ name: '清单小计(A)', cType: 11, serialNo: serialNo++ });
-
-        otherChapter.push({ name: '非清单项费用(B)', cType: 31, serialNo: serialNo++ });
+        gclChapter.push({ name: '未计入章节清单合计', cType: 21, serialNo: serialNo+1 });
 
+        otherChapter.push({ name: '合计(C=A+B+Z)', cType: 41, serialNo: serialNo+5, deal_bills_tp: option.zlj.deal_bills_tp });
         gclChapterFilter.push({node_type: option.jrg.value});
         gclChapterFilter.push({field: 'name', part: option.jrg.text});
         const zlChapter = {
-            name: '暂列金额(Z)', cType: 32, serialNo: serialNo++,
+            name: '暂列金额(Z)', cType: 32, serialNo: serialNo+4,
             deal_bills_tp: option.zlj.deal_bills_tp, match: [], matchPath: []
         };
         zlChapter.match.push({node_type: option.zlj.value});
         zlChapter.match.push({field: 'name', part: option.zlj.text});
         otherChapter.push(zlChapter);
 
-        otherChapter.push({ name: '合计(C=A+B+Z)', cType: 41, serialNo: serialNo });
+        otherChapter.push({ name: '清单小计(A)', cType: 11, serialNo: serialNo+2 });
+        otherChapter.push({ name: '非清单项费用(B)', cType: 31, serialNo: serialNo+3 });
+
         return [gclChapter, otherChapter, gclChapterFilter];
     }
 
@@ -495,13 +494,14 @@ const gclGatherModel = (function () {
             if (checkFilterPath(d, calcFilterPath)) continue;
 
             for (const c of otherChapter) {
+                if (d.name.indexOf('暂列金额') > -1) console.log(c);
                 if (c.cType === 41) {
                     gatherfields(c, d, fields);
                 }
                 if (c.cType === 32 && _checkFilter(d, c.match)) {
                     gatherfields(c, d, fields);
                     calcFilterPath.push(d.full_path);
-                    continue;
+                    break;
                 }
                 if (c.cType === 11 && (d.b_code)) {
                     gatherfields(c, d, fields);
@@ -528,6 +528,7 @@ const gclGatherModel = (function () {
             const c = _getGclChapter(gclChapter, d);
             c.deal_bills_tp = ZhCalc.add(c.deal_bills_tp, d.total_price);
         }
+        otherChapter.sort((x, y) => {return x.serialNo - y.serialNo});
         return gclChapter.concat(otherChapter);
     }
 

+ 10 - 8
app/public/js/shares/gcl_gather_compare.js

@@ -258,7 +258,10 @@ const gclCompareModel = (function () {
     }
 
     function _getCalcChapter(chapter, option) {
-        const gclChapter = [], otherChapter = [], gclChapterFilter = [];
+        gclChapter = [];
+        otherChapter = [];
+        gclChapterFilter = [];
+
         let serialNo = 1;
         for (const c of chapter) {
             const cc = { code: c.code, name: c.name, cType: 1 };
@@ -268,21 +271,19 @@ const gclCompareModel = (function () {
         }
         gclChapter.push({ name: '未计入章节清单合计', cType: 21, serialNo: serialNo++ });
 
-        otherChapter.push({ name: '清单小计(A)', cType: 11, serialNo: serialNo++ });
-
-        otherChapter.push({ name: '非清单项费用(B)', cType: 31, serialNo: serialNo++ });
-
+        otherChapter.push({ name: '合计(C=A+B+Z)', cType: 41, serialNo: serialNo+5, deal_bills_tp: option.zlj.deal_bills_tp });
         gclChapterFilter.push({node_type: option.jrg.value});
         gclChapterFilter.push({field: 'name', part: option.jrg.text});
         const zlChapter = {
-            name: '暂列金额(Z)', cType: 32, serialNo: serialNo++,
+            name: '暂列金额(Z)', cType: 32, serialNo: serialNo+4,
             deal_bills_tp: option.zlj.deal_bills_tp, match: [], matchPath: []
         };
         zlChapter.match.push({node_type: option.zlj.value});
         zlChapter.match.push({field: 'name', part: option.zlj.text});
         otherChapter.push(zlChapter);
 
-        otherChapter.push({ name: '合计(C=A+B+Z)', cType: 41, serialNo: serialNo });
+        otherChapter.push({ name: '清单小计(A)', cType: 11, serialNo: serialNo+2 });
+        otherChapter.push({ name: '非清单项费用(B)', cType: 31, serialNo: serialNo+3 });
     }
 
     function _gatherChapterFields(chapter, data, fields) {
@@ -336,7 +337,7 @@ const gclCompareModel = (function () {
                 if (c.cType === 32 && _checkFilter(d, c.match)) {
                     gatherfields(c, d, ledgerSetting.chapterFields, ledgerSetting.prefix);
                     calcFilterPath.push(d.full_path);
-                    continue;
+                    break;
                 }
                 if (c.cType === 11 && (d.b_code)) {
                     gatherfields(c, d, ledgerSetting.chapterFields, ledgerSetting.prefix);
@@ -355,6 +356,7 @@ const gclCompareModel = (function () {
                 gatherfields(c, d, ledgerSetting.chapterFields, ledgerSetting.prefix);
             }
         }
+        otherChapter.sort((x, y) => {return x.serialNo - y.serialNo});
     }
 
     function init (gclData, chapter, option) {

+ 2 - 2
db_script/depart-database-table.js

@@ -250,8 +250,8 @@ const departTable = {
     revise_pos: { count: 20, table: 'zh_revise_pos', relaId: 'tid', createSql: revisePosSql },
     stage_bills: { count: 10, table: 'zh_stage_bills', relaId: 'tid', createSql: stageBillsSql },
     stage_pos: { count: 20, table: 'zh_stage_pos', relaId: 'tid', createSql: stagePosSql },
-    stage_bills_final: { count: 10, table: 'zh_stage_bills', relaId: 'tid', createSql: stageBillsFinalSql },
-    stage_pos_final: { count: 20, table: 'zh_stage_pos', relaId: 'tid', createSql: stagePosFinalSql },
+    stage_bills_final: { count: 10, table: 'zh_stage_bills_final', relaId: 'tid', createSql: stageBillsFinalSql },
+    stage_pos_final: { count: 20, table: 'zh_stage_pos_final', relaId: 'tid', createSql: stagePosFinalSql },
 };
 
 // 2020/1/12各表行数统计