Browse Source

Merge branch 'master' of http://192.168.1.41:3000/maixinrong/Calculation

TonyKang 5 years ago
parent
commit
b816c14b01

+ 3 - 3
app/const/spread.js

@@ -140,7 +140,7 @@ const stageTz = {
     },
     pos: {
         cols: [
-            {title: '部位名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@', readOnly: true},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@', readOnly: true},
             {title: '台账数量', colSpan: '1', rowSpan: '2', field: 'quantity', hAlign: 2, width: 60, formatter: '@', readOnly: true},
             {title: '本期计量|合同', colSpan: '3|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量变更', colSpan: '|1', rowSpan: '|1', field: 'qc_qty', hAlign: 2, width: 80, type: 'Number'},
@@ -202,7 +202,7 @@ const stageCl = {
     },
     pos: {
         cols: [
-            {title: '部位名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@'},
             {title: '台账数量|施工图复核', colSpan: '4|1', rowSpan: '1|1', field: 'sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|设计错漏增减', colSpan: '1', rowSpan: '|1', field: 'sjcl_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|其他错漏增减', colSpan: '1', rowSpan: '|1', field: 'qtcl_qty', hAlign: 2, width: 60, type: 'Number'},
@@ -267,7 +267,7 @@ const stageNoCl = {
     },
     pos: {
         cols: [
-            {title: '部位名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@'},
+            {title: '名称', colSpan: '1', rowSpan: '2', field: 'name', hAlign: 0, width: 180, formatter: '@'},
             {title: '设计量', colSpan: '1', rowSpan: '2', field: 'sgfh_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '本期计量|合同', colSpan: '3|1', rowSpan: '1|1', field: 'contract_qty', hAlign: 2, width: 60, type: 'Number'},
             {title: '|数量变更', colSpan: '|1', rowSpan: '|1', field: 'qc_qty', hAlign: 2, width: 80, type: 'Number'},

+ 0 - 1
app/const/tender_info.js

@@ -77,7 +77,6 @@ const defaultInfo = {
         ke: { unit: '棵', value: 0 },
         zu: { unit: '组', value: 0 },
         xitong: { unit: '系统', value: 0 },
-        zonge: { unit: '总额', value: 0 },
         other: { value: 3 },
     },
     // 合同参数

+ 2 - 2
app/controller/revise_controller.js

@@ -207,11 +207,11 @@ module.exports = app => {
 
         async _getDefaultReviseInfoData(ctx, revise) {
             const reviseBills = revise.bills_file
-                ? JSON.parse(await fs.readFileSync(this.ctx.app.baseDir + revise.bills_file, 'utf8'))
+                ? JSON.parse(await fs.readFileSync(this.ctx.app.filePath + revise.bills_file, 'utf8'))
                 : await ctx.service.reviseBills.getData(ctx.tender.id);
 
             const revisePos = revise.pos_file
-                ? JSON.parse(await fs.readFileSync(this.ctx.app.baseDir + revise.pos_file, 'utf8'))
+                ? JSON.parse(await fs.readFileSync(this.ctx.app.filePath + revise.pos_file, 'utf8'))
                 : await ctx.service.revisePos.getData(ctx.tender.id);
             const [ledgerSpread, posSpread] = this._getSpreadSetting(revise);
             const [stdBills, stdChapters] = await this.ctx.service.valuation.getValuationStdList(ctx.tender.data.valuation);

+ 8 - 7
app/lib/stage_im.js

@@ -10,6 +10,7 @@
 
 const Ledger = require('./ledger');
 const imType = require('../const/tender').imType;
+const mergeChar = ';';
 
 class StageIm {
     constructor (ctx) {
@@ -166,9 +167,9 @@ class StageIm {
             const subPeg2 = this._getNodeByLevel(node, peg.level + 2);
             let result = peg.name;
             if (subPeg1 && subPeg1.id !== peg.id && subPeg1.id !== node.id) {
-                result = result + '-' + subPeg1.name;
+                result = result + mergeChar + subPeg1.name;
                 if (subPeg2 && subPeg2.id !== subPeg1.id && subPeg2.id !== node.id) {
-                    result = result + '-' + subPeg2.name;
+                    result = result + mergeChar + subPeg2.name;
                 }
             }
             return result;
@@ -179,7 +180,7 @@ class StageIm {
                 let parent = this.billsTree.getParent(node), result = parent.name;
                 while (parent.level > 3 && parent) {
                     parent = this._getNodeByLevel(node, parent.level - 1);
-                    result = parent.name + '-' + result;
+                    result = parent.name + mergeChar + result;
                 }
                 return result;
             } else {
@@ -192,7 +193,7 @@ class StageIm {
             const subPeg1 = this._getNodeByLevel(node, peg.level + 1);
             let result = peg.name;
             if (subPeg1 && subPeg1.id !== peg.id) {
-                result = result + '-' + subPeg1.name;
+                result = result + mergeChar + subPeg1.name;
             }
             return result;
         } else {
@@ -202,7 +203,7 @@ class StageIm {
                 let parent = node, result = parent.name;
                 while (parent.level > 3 && parent) {
                     parent = this._getNodeByLevel(node, parent.level - 1);
-                    result = parent.name + '-' + result;
+                    result = parent.name + mergeChar + result;
                 }
                 return result;
             }
@@ -295,7 +296,7 @@ class StageIm {
             }
             let b = this._.find(im.gclBills, {bid: p.id});
             if (!b) {
-                b = {imid: im.id, bid: p.id, b_code: p.b_code, name: p.name, unit: p.unit};
+                b = {imid: im.id, bid: p.id, b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price};
                 im.gclBills.push(b);
                 this.ImBillsData.push(b);
             }
@@ -326,7 +327,7 @@ class StageIm {
                 }
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_tp || pp.qc_tp === 0)) {
+                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
                         continue;
                     }
                     for (const c of this.changes) {

+ 8 - 8
app/public/js/category.js

@@ -45,9 +45,9 @@ function getCategoryHtml(category) {
         }
         html.push('</td>');
         html.push('<td>');
-        html.push('<a href="javasrcipt: void(0);" name="add" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id, '">添加值</a>\n');
-        html.push('<a href="javasrcipt: void(0);" name="edit-cate" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id + '">编辑</a>\n');
-        html.push('<a href="javasrcipt: void(0);" name="del" class="btn btn-sm btn-outline-danger"', 'cid="' + d.id + '">删除</a> ');
+        html.push('<a href="javascript: void(0);" name="add" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id, '">添加值</a>\n');
+        html.push('<a href="javascript: void(0);" name="edit-cate" class="btn btn-sm btn-outline-primary"', 'cid="' + d.id + '">编辑</a>\n');
+        html.push('<a href="javascript: void(0);" name="del" class="btn btn-sm btn-outline-danger"', 'cid="' + d.id + '">删除</a> ');
         html.push('</td>');
         html.push('<tr>');
     }
@@ -60,7 +60,7 @@ function getValueHtml(value) {
         html.push('<tr name="value" vid="' + v.id + '">');
         html.push('<td><input class="form-control form-control-sm" name="value" placeholder="请输入值" value="' + v.value + '" vid ="' + v.id +  '"></td>');
         html.push('<td>', v.relaTenders.length + v.newTenders.length ,'</td>');
-        html.push('<td><a href="javasrcipt: void(0);" class="text-danger" name="del-value" vid="' + v.id + '">删除</a></td>');
+        html.push('<td><a href="javascript: void(0);" class="text-danger" name="del-value" vid="' + v.id + '">删除</a></td>');
         html.push('</tr>');
     }
     return html.join('');
@@ -108,7 +108,7 @@ function getEditCate(category) {
 }
 // 绑定编辑值、删除值
 function bindCategoryValueControl() {
-    $('a[name="del-value"]').click(function () {
+    $('body').on('click', 'a[name="del-value"]', function () {
         const vid = $(this).attr('vid');
         const value = _.find(editCate.value, function (v) {
             return v.id == vid;
@@ -152,7 +152,7 @@ function bindCategoryValueControl() {
 // 绑定分类控制等(添加值、编辑、删除)
 function bindCategoryControl() {
     // 弹出添加值
-    $('a[name=add]').bind('click', function () {
+    $('body').on('click', 'a[name=add]', function () {
         const id = parseInt($(this).attr('cid'));
         const category = findCategory(id);
         getEditCate(category);
@@ -178,7 +178,7 @@ function bindCategoryControl() {
         }
     });
     // 弹出 编辑
-    $('a[name=edit-cate]').bind('click', function () {
+    $('body').on('click', 'a[name=edit-cate]', function () {
         const id = parseInt($(this).attr('cid'));
         const category = findCategory(id);
         $('input[name=name]', '#edit-cate').val(category.name);
@@ -188,7 +188,7 @@ function bindCategoryControl() {
         $('#edit-cate').modal('show');
     });
     // 弹出 删除类别
-    $('a[name=del]').bind('click', function () {
+    $('body').on('click', 'a[name=del]', function () {
         $('#del-cate-ok').attr('cid', $(this).attr('cid'));
         $('#del-cate').modal('show');
     });

+ 23 - 4
app/public/js/gcl_gather.js

@@ -38,6 +38,7 @@ const gclGatherModel = (function () {
     let deal = [];
 
     const gclList = [], leafXmjs = [];
+    const mergeChar = ';';
 
 
 
@@ -122,7 +123,7 @@ const gclGatherModel = (function () {
      * @constructor
      */
     function CheckPeg(text) {
-        const pegReg = /[kK][0-9][++][0-9]{3}/;
+        const pegReg = /[a-zA-Z]?[kK][0-9]+[++][0-9]{3}([.][0-9]+)?/;
         return pegReg.test(text);
     }
 
@@ -201,18 +202,18 @@ const gclGatherModel = (function () {
                 let value = '';
                 for (let level = 4; level < xmj.level; level++) {
                     const node = getNodeByLevel(xmj, level);
-                    value = value === '' ? node.name : node.name + '-' + value;
+                    value = value === '' ? node.name : value + mergeChar + node.name;
                 }
                 return value;
             } else {
                 return '';
             }
         } else {
-            if (peg.level - 2 > xmj.level) {
+            if (peg.level + 2 < xmj.level) {
                 let value = '';
                 for (let level = peg.level + 2; level < xmj.level; level++) {
                     const node = getNodeByLevel(xmj, level);
-                    value = value === '' ? node.name : node.name + '-' + value;
+                    value = value === '' ? node.name : value + mergeChar + node.name;
                 }
                 return value;
             } else {
@@ -378,13 +379,31 @@ const gclGatherModel = (function () {
                 }
             }
         });
+
         return gclList;
     }
 
+    function checkDiffer(gclList) {
+        for (const gcl of gclList) {
+            gcl.differ = false;
+        }
+        for (const [i, gcl] of gclList.entries()) {
+            if (i === gclList.length - 1) continue;
+            const next = gclList[i+1];
+            if (gcl.b_code === next.b_code) {
+                if (gcl.name !== next.name || gcl.unit !== next.unit || !checkZero(gcl.unit_price - next.unit_price)) {
+                    gcl.differ = true;
+                    next.differ = true;
+                }
+            }
+        }
+    }
+
     return {
         loadLedgerData,
         loadPosData,
         loadDealBillsData,
         gatherGclData,
+        checkDiffer,
     };
 })();

+ 2 - 2
app/public/js/ledger.js

@@ -443,7 +443,7 @@ $(document).ready(function() {
                 if (col.type === 'Number') {
                     if (newValue) {
                         const num = _.toNumber(newValue);
-                        if (num) {
+                        if (_.isFinite(num)) {
                             data[col.field] = num;
                         } else {
                             try {
@@ -1161,7 +1161,7 @@ $(document).ready(function() {
 
                     if (col.type === 'Number') {
                         const num = _.toNumber(newText);
-                        if (num) {
+                        if (_.isFinite(num)) {
                             data.updateData[col.field] = num;
                         } else {
                             try {

+ 10 - 0
app/public/js/ledger_gather.js

@@ -21,6 +21,8 @@ $(document).ready(() => {
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'deal_bills_tp', hAlign: 2, width: 80, type: 'Number'},
             {title: '台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'quantity', hAlign: 2, width: 80, type: 'Number'},
             {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'total_price', hAlign: 2, width: 80, type: 'Number'},
+            {title: '签约-台账|数量', colSpan: '2|1', rowSpan: '1|1', field: 'compare_qty', hAlign: 2, width: 80, type: 'Number'},
+            {title: '|金额', colSpan: '|1', rowSpan: '|1', field: 'compare_tp', hAlign: 2, width: 80, type: 'Number'},
         ],
         emptyRows: 0,
         headRows: 2,
@@ -29,6 +31,9 @@ $(document).ready(() => {
         headerFont: '12px 微软雅黑',
         font: '12px 微软雅黑',
         readOnly: true,
+        getColor: function (sheet, data, col, defaultColor) {
+            return data && data.differ ? '#FFE699' : defaultColor;
+        }
     });
     const gclSheet = gclSpread.getActiveSheet();
     const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
@@ -76,6 +81,11 @@ $(document).ready(() => {
         gclGatherModel.loadPosData(data.pos);
         gclGatherModel.loadDealBillsData(data.dealBills);
         gclGatherData = gclGatherModel.gatherGclData();
+        gclGatherModel.checkDiffer(gclGatherData);
+        for (const gcl of gclGatherData) {
+            gcl.compare_qty = ZhCalc.sub(gcl.deal_bills_qty, gcl.quantity);
+            gcl.compare_tp = ZhCalc.sub(gcl.deal_bills_tp, gcl.total_price);
+        }
         SpreadJsObj.loadSheetData(gclSheet, SpreadJsObj.DataType.Data, gclGatherData);
         loadLeafXmjData(0);
     }, null, true);

+ 5 - 5
app/public/js/path_tree.js

@@ -575,7 +575,7 @@ const createNewPathTree = function (type, setting) {
             for (const data of datas) {
                 let node = this.getItems(data[this.setting.id]);
                 if (node) {
-                    for (const prop in node) {
+                    for (const prop in data) {
                         if (data[prop] !== undefined && data[prop] !== node[prop]) {
                             if (prop === this.setting.pid) {
                                 loadedData.push(this.getItems(node[this.setting.pid]));
@@ -615,7 +615,7 @@ const createNewPathTree = function (type, setting) {
                 let node = this.getItems(data[this.setting.id]);
                 if (node) {
                     const parent = this.getItems(node[this.setting.pid]);
-                    for (const prop in node) {
+                    for (const prop in data) {
                         if (data[prop] !== undefined && data[prop] !== node[prop]) {
                             node[prop] = data[prop];
                             if (parent && resortData.indexOf(parent) === -1) {
@@ -788,7 +788,7 @@ const createNewPathTree = function (type, setting) {
             for (const data of datas) {
                 let node = this.getItems(data[this.setting.id]);
                 if (node) {
-                    for (const prop in node) {
+                    for (const prop in data) {
                         if (data[prop] !== undefined) {
                             node[prop] = data[prop];
                         }
@@ -840,7 +840,7 @@ const createNewPathTree = function (type, setting) {
             for (const d of datas) {
                 let node = this.getItems(d[this.setting.id]);
                 if (node && node.is_leaf) {
-                    for (const prop in node) {
+                    for (const prop in d) {
                         if (data[prop] !== undefined) {
                             node[prop] = d[prop];
                         }
@@ -1073,7 +1073,7 @@ const createNewPathTree = function (type, setting) {
             for (const data of datas) {
                 let node = this.getItems(data[this.setting.id]);
                 if (node) {
-                    for (const prop in node) {
+                    for (const prop in data) {
                         if (prop === this.setting.pid && data[prop] !== node[prop]) {
 
                         }

+ 2 - 2
app/public/js/revise.js

@@ -352,7 +352,7 @@ $(document).ready(() => {
                     }
                     if (col.type === 'Number') {
                         const num = _.toNumber(text);
-                        if (num) {
+                        if (_.isFinite(num)) {
                             data[col.field] = num;
                         } else {
                             try {
@@ -770,7 +770,7 @@ $(document).ready(() => {
                 data.postData = {id: posData.id};
                 if (col.type === 'Number') {
                     const num = _.toNumber(newText);
-                    if (num) {
+                    if (_.isFinite(num)) {
                         data.postData[col.field] = num;
                     } else {
                         try {

+ 7 - 5
app/public/js/stage.js

@@ -447,6 +447,8 @@ $(document).ready(() => {
         }
     };
     ledgerSpreadSetting.imageClick = function (data) {
+        if (data.children && data.children.length > 0) return;
+
         const nodePos = stagePos.getLedgerPos(data.id);
         if (nodePos && nodePos.length > 0) return;
 
@@ -525,7 +527,7 @@ $(document).ready(() => {
                 }
                 if (col.type === 'Number' && newValue && newValue !== '') {
                     const num = _.toNumber(newValue);
-                    if (num) {
+                    if (_.isFinite(num)) {
                         newValue = num;
                     } else {
                         try {
@@ -732,7 +734,7 @@ $(document).ready(() => {
                         } else {
                             if (col.type === 'Number') {
                                 const num = _.toNumber(text);
-                                if (num) {
+                                if (_.isFinite(num)) {
                                     data[col.field] = num;
                                     filter = false;
                                 } else {
@@ -844,7 +846,7 @@ $(document).ready(() => {
                     info.cancel = !node.is_tp;
                     break;
                 case 'is_tp':
-                    info.cancel = false;
+                    info.cancel = true;
                     break;
             }
         },
@@ -853,7 +855,7 @@ $(document).ready(() => {
                 const node = SpreadJsObj.getSelectObject(info.sheet);
                 const col = info.sheet.zh_setting.cols[info.col];
                 const posRange = stagePos.getLedgerPos(node.id);
-                if (node.pre_used || node.unit !== '总额' || (posRange && posRange.length > 0) /*|| !checkZero(node.qc_qty)*/) {
+                if (node.pre_used === 1 || node.unit !== '总额' || (posRange && posRange.length > 0) /*|| !checkZero(node.qc_qty)*/) {
                     SpreadJsObj.reLoadRowData(info.sheet, info.row);
                     return;
                 }
@@ -1047,7 +1049,7 @@ $(document).ready(() => {
                     data.updateData = {pid: posData.id, lid: posData.lid};
                     if (col.type === 'Number') {
                         const num = _.toNumber(newText);
-                        if (num) {
+                        if (_.isFinite(num)) {
                             data.updateData[col.field] = num;
                         } else {
                             try {

+ 4 - 0
app/public/js/stage_gather.js

@@ -19,6 +19,9 @@ $(document).ready(function () {
     autoFlashHeight();
     // 初始化工程量清单
     const gclSpread = SpreadJsObj.createNewSpread($('#gcl-spread')[0]);
+    gclSpreadSetting.getColor = function (sheet, data, col, defaultColor) {
+        return data && data.differ ? '#FFE699' : defaultColor;
+    }
     SpreadJsObj.initSheet(gclSpread.getActiveSheet(), gclSpreadSetting);
     // 初始化所属项目节
     const leafXmjSpread = SpreadJsObj.createNewSpread($('#leaf-xmj-spread')[0]);
@@ -58,6 +61,7 @@ $(document).ready(function () {
     gclGatherModel.loadPosData(pos, curPosData, prePosData);
     gclGatherModel.loadDealBillsData(dealBills);
     const gclGatherData = gclGatherModel.gatherGclData();
+    gclGatherModel.checkDiffer(gclGatherData);
     // 获取项目节数据
     function loadLeafXmjData(iGclRow) {
         const gcl = gclGatherData[iGclRow];

+ 7 - 9
app/public/js/stage_im.js

@@ -11,6 +11,7 @@
 const stageIm = (function () {
     const imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img'];
     const splitChar = '-';
+    const mergeChar = ';';
     let stage, imType, details, changes, ImData, pre;
     const gsTreeSetting = {
         id: 'ledger_id',
@@ -123,14 +124,14 @@ const stageIm = (function () {
     function getFbfx (node, pegNode) {
         if (pegNode) {
             const subPegNode = getNodeByLevel(node, pegNode.level + 1);
-            return subPegNode.id === pegNode.id ? pegNode.name : pegNode.name + '-' + subPegNode.name;
+            return subPegNode.id === pegNode.id ? pegNode.name : pegNode.name + ';' + subPegNode.name;
         } else {
             if (node.level < 3) {
                 return node.name;
             } else {
                 const l3Node = getNodeByLevel(node, 3);
                 const l4Node = getNodeByLevel(node, 4);
-                return l3Node.id === l4Node.id ? l3Node.name : l3Node.name + '-' + l4Node.name;
+                return l3Node.id === l4Node.id ? l3Node.name : l3Node.name + ';' + l4Node.name;
             }
         }
         return node.name;
@@ -138,15 +139,12 @@ const stageIm = (function () {
 
     function CheckPeg(text) {
         const pegReg = /[a-zA-Z]?[kK][0-9]+[++][0-9]{3}([.][0-9]+)?/;
-        console.log(text);
-        console.log(text.match(pegReg));
         return pegReg.test(text);
     }
 
     function getPegStr(text) {
         const pegReg1 = /[a-zA-Z]?[kK][0-9]+[++][0-9]{3}([.][0-9]+)?[~~—][a-zA-Z]?[kK][0-9]+[++][0-9]{3}([.][0-9]+)?/;
         const result1 = text.match(pegReg1);
-        console.log(result1);
         if (result1) {
             return result1[0];
         } else {
@@ -199,9 +197,9 @@ const stageIm = (function () {
             const subPeg2 = getNodeByLevel(node, peg.level + 2);
             let result = peg.name;
             if (subPeg1 && subPeg1.id !== peg.id && subPeg1.id !== node.id) {
-                result = result + '-' + subPeg1.name;
+                result = result + mergeChar + subPeg1.name;
                 if (subPeg2 && subPeg2.id !== subPeg1.id && subPeg2.id !== node.id) {
-                    result = result + '-' + subPeg2.name;
+                    result = result + mergeChar + subPeg2.name;
                 }
             }
             return result;
@@ -212,7 +210,7 @@ const stageIm = (function () {
                 let parent = gsTree.getParent(node), result = parent.name;
                 while (parent.level > 3 && parent) {
                     parent = getNodeByLevel(node, parent.level - 1);
-                    result = parent.name + '-' + result;
+                    result = parent.name + mergeChar + result;
                 }
                 return result;
             } else {
@@ -383,7 +381,7 @@ const stageIm = (function () {
                 }
             } else {
                 for (const pp of posRange) {
-                    if ((!pp.qc_tp || pp.qc_tp === 0)) {
+                    if ((!pp.qc_qty || pp.qc_qty === 0)) {
                         continue;
                     }
                     for (const c of changes) {

+ 7 - 10
app/public/js/tender.js

@@ -138,7 +138,7 @@ $(document).ready(function() {
         SpreadJsObj.massOperationSheet(sheet, function () {
             sheet.defaults.rowHeight = 25;
             sheet.setColumnCount(3);
-            sheet.setRowCount(15);
+            sheet.setRowCount(14);
             sheet.setColumnWidth(0, 1);
             sheet.setColumnWidth(1, 100);
             sheet.setColumnWidth(2, 60);
@@ -157,11 +157,10 @@ $(document).ready(function() {
             sheet.setText(10, 1, '棵');
             sheet.setText(11, 1, '组');
             sheet.setText(12, 1, '系统');
-            sheet.setText(13, 1, '总额');
-            sheet.setText(14, 1, '其他未列单位');
+            sheet.setText(13, 1, '其他未列单位');
             const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
-            sheet.getRange(0, 0, 15, 3).setBorder(lineBorder, {all: true});
-            sheet.getRange(0, 0, 15, 3).formatter('@');
+            sheet.getRange(0, 0, 14, 3).setBorder(lineBorder, {all: true});
+            sheet.getRange(0, 0, 14, 3).formatter('@');
             sheet.setSelection(1, 2, 1, 1);
         });
 
@@ -232,11 +231,10 @@ $(document).ready(function() {
             sheet.setValue(10, 2, property.precision.ke.value);
             sheet.setValue(11, 2, property.precision.zu.value);
             sheet.setValue(12, 2, property.precision.xitong.value);
-            sheet.setValue(13, 2, property.precision.zonge.value);
-            sheet.setValue(14, 2, property.precision.other.value);
+            sheet.setValue(13, 2, property.precision.other.value);
         }
         function setReadOnly(readOnly) {
-            sheet.getRange(1, 2, 15, 1).locked(readOnly);
+            sheet.getRange(1, 2, 14, 1).locked(readOnly);
         }
         function getNewPrecisionData() {
             const precision = JSON.parse(JSON.stringify(property.precision));
@@ -252,8 +250,7 @@ $(document).ready(function() {
             precision.ke.value = _.toNumber(sheet.getText(10, 2));
             precision.zu.value = _.toNumber(sheet.getText(11, 2));
             precision.xitong.value = _.toNumber(sheet.getText(12, 2));
-            precision.zonge.value = _.toNumber(sheet.getText(13, 2));
-            precision.other.value = _.toNumber(sheet.getText(14, 2));
+            precision.other.value = _.toNumber(sheet.getText(13, 2));
             return precision;
         }
         function checkPrecisionMinLimit(precision, limit) {

+ 0 - 1
app/public/js/tender_list.js

@@ -254,7 +254,6 @@ function initTenderTree () {
             tenderTree.push(t);
         }
     }
-    console.log(tenderTree);
 }
 function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];

+ 75 - 17
app/public/js/tender_list_info.js

@@ -45,6 +45,7 @@ const levelTreeSetting = {
 };
 const levelNodes =[];
 const tenderTree = [];
+let parentId = 0;
 function createTree() {
     const zTree = $.fn.zTree.getZTreeObj('treeLevel');
     if (zTree) {
@@ -167,11 +168,11 @@ function getCategoryHtml() {
     }
     const html = [];
     for (const c of category) {
-        if (c.type === categoryType.key.dropDown) {
+        // if (c.type === categoryType.key.dropDown) {
             html.push(getSelectCategoryHtml(c));
-        } else if (c.type === categoryType.key.radio) {
-            html.push(getRadioCategoryHtml(c));
-        }
+        // } else if (c.type === categoryType.key.radio) {
+        //     html.push(getRadioCategoryHtml(c));
+        // }
     }
     return html.join('');
 }
@@ -187,7 +188,7 @@ function initTenderTree () {
             }
         }
     }
-    function getCategoryNode(category, value, parent) {
+    function getCategoryNode(category, value, parent, i = null) {
         const array = parent ?  parent.children : tenderTree;
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
@@ -198,7 +199,8 @@ function initTenderTree () {
                 vid: value,
                 name: cateValue.value,
                 children: [],
-                level: category.level,
+                level: i ? i : category.level,
+                sort_id: ++parentId,
             };
             array.push(cate);
         }
@@ -206,11 +208,17 @@ function initTenderTree () {
     }
     function loadTenderCategory (tender) {
         let tenderCategory = null;
-        for (const lc of levelCategory) {
+        for (const [index, lc] of levelCategory.entries()) {
             const tenderCate = findNode('cid', lc.id, tender.category);
             if (tenderCate) {
                 tenderCategory = getCategoryNode(lc, tenderCate.value, tenderCategory);
             } else {
+                if (index === 0 && tender.category) {
+                    for (const [i,c] of tender.category.entries()) {
+                        const cate = findNode('id', c.cid, category);
+                        tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
+                    }
+                }
                 return tenderCategory;
             }
         }
@@ -231,6 +239,7 @@ function initTenderTree () {
     for (const t of tenders) {
         calculateTender(t);
         t.valid = true;
+        delete t.level;
         if (t.category && levelCategory.length > 0) {
             const parent = loadTenderCategory(t);
             if (parent) {
@@ -244,13 +253,13 @@ function initTenderTree () {
         }
     }
 }
-function recursiveGetTenderNodeHtml (node, arr) {
+function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];
-    html.push('<tr>');
+    html.push('<tr pid="' + pid + '">');
     // 名称
     html.push('<td class="in-' + node.level + '">');
     if (node.cid) {
-        html.push('<i class="fa fa-folder-o"></i> ', node.name);
+        html.push('<span class="fold-switch mr-1" title="收起" cid="'+ node.sort_id +'"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ', node.name);
     } else {
         html.push('<span class="text-muted mr-2">');
         html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
@@ -311,7 +320,7 @@ function recursiveGetTenderNodeHtml (node, arr) {
     html.push('</tr>');
     if (node.children) {
         for (const c of node.children) {
-            html.push(recursiveGetTenderNodeHtml(c, node.children));
+            html.push(recursiveGetTenderNodeHtml(c, node.children, node.sort_id));
         }
     }
     return html.join('');
@@ -336,7 +345,7 @@ function getTenderTreeHtml () {
         html.push('<th>', '截止本期应付', '</th>');
         html.push('</tr>', '</thead>');
         for (const t of tenderTree) {
-            html.push(recursiveGetTenderNodeHtml(t, tenderTree));
+            html.push(recursiveGetTenderNodeHtml(t, tenderTree, ''));
         }
         html.push('</table>');
         return html.join('');
@@ -411,13 +420,15 @@ $(document).ready(() => {
             return;
         }
         for (const c of category) {
-            const cate = {cid: c.id};
-            if (c.type === categoryType.key.dropDown) {
+            if (parseInt($('select', '[cate-id=' + c.id + ']').val()) !== 0) {
+                const cate = {cid: c.id};
+                // if (c.type === categoryType.key.dropDown) {
                 cate.value = parseInt($('select', '[cate-id=' + c.id + ']').val());
-            } else if (c.type === categoryType.key.radio) {
-                cate.value = parseInt($('input:checked', '[cate-id=' + c.id + ']').val());
+                // } else if (c.type === categoryType.key.radio) {
+                //     cate.value = parseInt($('input:checked', '[cate-id=' + c.id + ']').val());
+                // }
+                data.category.push(cate);
             }
-            data.category.push(cate);
         }
         $('#hide-all').show();
         postData('/list/add', data, function (result) {
@@ -430,4 +441,51 @@ $(document).ready(() => {
             $('#hide-all').hide();
         });
     });
+
+    // 展开和收起
+    $('body').on('click', '.fold-switch', function () {
+        if ($(this).children('i').hasClass('fa-minus-square-o')) {
+            $(this).children('i').removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
+            $(this).attr('title', '展开');
+            const cid = $(this).attr('cid');
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
+            doTrStatus(returnItem, 'hide');
+        } else {
+            $(this).children('i').removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
+            $(this).attr('title', '收起');
+            const cid = $(this).attr('cid');
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
+            doTrStatus(returnItem, 'show');
+        }
+    })
 });
+
+function doTrStatus(node, status) {
+    if (status === 'show') {
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"]').show();
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '收起');
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-plus-square-o').removeClass('fa-minus-square-o').addClass('fa-minus-square-o');
+    } else {
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"]').hide();
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '展开');
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-minus-square-o').removeClass('fa-plus-square-o').addClass('fa-plus-square-o');
+
+    }
+    // 判断是否还有一层
+    if (node.children) {
+        for (const c of node.children) {
+            doTrStatus(c, status);
+        }
+    }
+}
+let returnItem;
+const findTenderTreeNode = function(sortId, tree) {
+    tree.forEach((item) => {
+        if (item.sort_id !== undefined && item.sort_id === sortId) {
+            returnItem = item;
+            return item;
+        } else if (item.children && item.children.length > 0) {
+            findTenderTreeNode(sortId, item.children);
+        }
+    });
+}

+ 75 - 17
app/public/js/tender_list_progress.js

@@ -45,6 +45,7 @@ const levelTreeSetting = {
 };
 const levelNodes =[];
 const tenderTree = [];
+let parentId = 0;
 function createTree() {
     const zTree = $.fn.zTree.getZTreeObj('treeLevel');
     if (zTree) {
@@ -167,11 +168,11 @@ function getCategoryHtml() {
     }
     const html = [];
     for (const c of category) {
-        if (c.type === categoryType.key.dropDown) {
+        // if (c.type === categoryType.key.dropDown) {
             html.push(getSelectCategoryHtml(c));
-        } else if (c.type === categoryType.key.radio) {
-            html.push(getRadioCategoryHtml(c));
-        }
+        // } else if (c.type === categoryType.key.radio) {
+        //     html.push(getRadioCategoryHtml(c));
+        // }
     }
     return html.join('');
 }
@@ -187,7 +188,7 @@ function initTenderTree () {
             }
         }
     }
-    function getCategoryNode(category, value, parent) {
+    function getCategoryNode(category, value, parent, i = null) {
         const array = parent ?  parent.children : tenderTree;
         let cate = findCategoryNode(category.id, value, array);
         if (!cate) {
@@ -198,7 +199,8 @@ function initTenderTree () {
                 vid: value,
                 name: cateValue.value,
                 children: [],
-                level: category.level,
+                level: i ? i : category.level,
+                sort_id: ++parentId,
             };
             array.push(cate);
         }
@@ -206,11 +208,17 @@ function initTenderTree () {
     }
     function loadTenderCategory (tender) {
         let tenderCategory = null;
-        for (const lc of levelCategory) {
+        for (const [index, lc] of levelCategory.entries()) {
             const tenderCate = findNode('cid', lc.id, tender.category);
             if (tenderCate) {
                 tenderCategory = getCategoryNode(lc, tenderCate.value, tenderCategory);
             } else {
+                if (index === 0 && tender.category) {
+                    for (const [i,c] of tender.category.entries()) {
+                        const cate = findNode('id', c.cid, category);
+                        tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
+                    }
+                }
                 return tenderCategory;
             }
         }
@@ -230,6 +238,7 @@ function initTenderTree () {
     for (const t of tenders) {
         calculateTender(t);
         t.valid = true;
+        delete t.level;
         if (t.category && levelCategory.length > 0) {
             const parent = loadTenderCategory(t);
             if (parent) {
@@ -259,13 +268,13 @@ function getProgressHtml(total, pre, cur) {
         return '';
     }
 }
-function recursiveGetTenderNodeHtml (node, arr) {
+function recursiveGetTenderNodeHtml (node, arr, pid) {
     const html = [];
-    html.push('<tr>');
+    html.push('<tr pid="' + pid + '">');
     // 名称
     html.push('<td class="in-' + node.level + '">');
     if (node.cid) {
-        html.push('<i class="fa fa-folder-o"></i> ', node.name);
+        html.push('<span class="fold-switch mr-1" title="收起" cid="'+ node.sort_id +'"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ', node.name);
     } else {
         html.push('<span class="text-muted mr-2">');
         html.push(arr.indexOf(node) === arr.length - 1 ? '└' : '├');
@@ -296,7 +305,7 @@ function recursiveGetTenderNodeHtml (node, arr) {
     html.push('</tr>');
     if (node.children) {
         for (const c of node.children) {
-            html.push(recursiveGetTenderNodeHtml(c, node.children));
+            html.push(recursiveGetTenderNodeHtml(c, node.children, node.sort_id));
         }
     }
     return html.join('');
@@ -313,7 +322,7 @@ function getTenderTreeHtml () {
         html.push('<th>', '截止上期完成/本期完成/未完成', '</th>');
         html.push('</tr>', '</thead>');
         for (const t of tenderTree) {
-            html.push(recursiveGetTenderNodeHtml(t, tenderTree));
+            html.push(recursiveGetTenderNodeHtml(t, tenderTree, ''));
         }
         html.push('</table>');
         return html.join('');
@@ -388,13 +397,15 @@ $(document).ready(() => {
             return;
         }
         for (const c of category) {
-            const cate = {cid: c.id};
-            if (c.type === categoryType.key.dropDown) {
+            if (parseInt($('select', '[cate-id=' + c.id + ']').val()) !== 0) {
+                const cate = {cid: c.id};
+                // if (c.type === categoryType.key.dropDown) {
                 cate.value = parseInt($('select', '[cate-id=' + c.id + ']').val());
-            } else if (c.type === categoryType.key.radio) {
-                cate.value = parseInt($('input:checked', '[cate-id=' + c.id + ']').val());
+                // } else if (c.type === categoryType.key.radio) {
+                //     cate.value = parseInt($('input:checked', '[cate-id=' + c.id + ']').val());
+                // }
+                data.category.push(cate);
             }
-            data.category.push(cate);
         }
         postData('/list/add', data, function (result) {
             tenders.push(result);
@@ -405,4 +416,51 @@ $(document).ready(() => {
             $('[name=name]', '#add-bd').val('');
         });
     });
+
+    // 展开和收起
+    $('body').on('click', '.fold-switch', function () {
+        if ($(this).children('i').hasClass('fa-minus-square-o')) {
+            $(this).children('i').removeClass('fa-minus-square-o').addClass('fa-plus-square-o');
+            $(this).attr('title', '展开');
+            const cid = $(this).attr('cid');
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
+            doTrStatus(returnItem, 'hide');
+        } else {
+            $(this).children('i').removeClass('fa-plus-square-o').addClass('fa-minus-square-o');
+            $(this).attr('title', '收起');
+            const cid = $(this).attr('cid');
+            const node = findTenderTreeNode(parseInt(cid), tenderTree);
+            doTrStatus(returnItem, 'show');
+        }
+    })
 });
+
+function doTrStatus(node, status) {
+    if (status === 'show') {
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"]').show();
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '收起');
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-plus-square-o').removeClass('fa-minus-square-o').addClass('fa-minus-square-o');
+    } else {
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"]').hide();
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch').attr('title', '展开');
+        $('.c-body').find('tr[pid="'+ node.sort_id +'"] .fold-switch i').removeClass('fa-minus-square-o').removeClass('fa-plus-square-o').addClass('fa-plus-square-o');
+
+    }
+    // 判断是否还有一层
+    if (node.children) {
+        for (const c of node.children) {
+            doTrStatus(c, status);
+        }
+    }
+}
+let returnItem;
+const findTenderTreeNode = function(sortId, tree) {
+    tree.forEach((item) => {
+        if (item.sort_id !== undefined && item.sort_id === sortId) {
+            returnItem = item;
+            return item;
+        } else if (item.children && item.children.length > 0) {
+            findTenderTreeNode(sortId, item.children);
+        }
+    });
+}

+ 1 - 1
app/service/ledger.js

@@ -658,7 +658,7 @@ module.exports = app => {
                     newIds.push(qd.id);
                     if (data[i].pos.length > 0) {
                         await this.ctx.service.pos.insertLedgerPosData(this.transaction, tenderId, qd, data[i].pos);
-                        await this._calcNode(qd, this.transaction);
+                        await this.calcNode(qd, this.transaction);
                     }
                 }
                 this._cacheMaxLid(tenderId, maxId + data.length);

+ 25 - 1
app/service/ledger_revise.js

@@ -131,6 +131,26 @@ module.exports = app => {
         }
 
         /**
+         * 备份
+         * @param {Object} revise - 修订
+         * @returns {Promise<void>}
+         * @private
+         */
+        async backupReviseHistoryFile(revise) {
+            const timestamp = (new Date()).getTime();
+
+            const billsHis = '/revise/bills' + timestamp + '.json';
+            const bills = await this.ctx.service.reviseBills.getData(revise.tid);
+            await this.ctx.helper.saveBufferFile(JSON.stringify(bills), this.ctx.app.filePath + billsHis);
+
+            const posHis = '/revise/pos' + timestamp + '.json';
+            const pos = await this.ctx.service.revisePos.getData(revise.tid);
+            await this.ctx.helper.saveBufferFile(JSON.stringify(pos), this.ctx.app.filePath + posHis);
+
+            return [billsHis, posHis];
+        }
+
+        /**
          * 新增修订
          * @param {Number}tid - 标段id
          * @param {Number}uid - 提交人id
@@ -170,7 +190,11 @@ module.exports = app => {
          * @returns {Promise<void>}
          */
         async cancelRevise(revise) {
-            const result = await this.db.update(this.tableName, {id: revise.id, valid: false, end_time: new Date()});
+            const [billsHis, posHis] = await this.backupReviseHistoryFile(revise);
+            const result = await this.db.update(this.tableName, {
+                id: revise.id, valid: false, end_time: new Date(),
+                bills_file: billsHis, pos_file: posHis,
+            });
             return result.affectedRows === 1;
         }
 

+ 8 - 2
app/service/revise_audit.js

@@ -184,11 +184,18 @@ module.exports = app => {
             if (!audit) throw '审核人信息错误';
             const time = new Date();
 
+            // 拷贝备份台账数据
+            const [billsHis, posHis] = await this.ctx.service.ledgerRevise.backupReviseHistoryFile(revise);
+
             const transaction = await this.db.beginTransaction();
             try {
-                await transaction.update(this.tableName, {id: audit.id, status: auditConst.status.checking, begin_time: time});
+                await transaction.update(this.tableName, {
+                    id: audit.id, status: auditConst.status.checking, begin_time: time,
+                    bills_file: revise.bills_file, pos_file: revise.pos_file,
+                });
                 const reviseData = {
                     id: revise.id, status: auditConst.status.checking,
+                    bills_file: billsHis, pos_file: posHis,
                 };
                 if (revise.times === 1) {
                     reviseData.begin_time = time;
@@ -257,7 +264,6 @@ module.exports = app => {
                 // 更新当前审核流程
                 await transaction.update(this.tableName, {
                     id: audit.id, status: checkType, opinion: opinion, end_time: time,
-                    bills_file: revise.bills_file, pos_file: revise.pos_file,
                 });
                 if (checkType === auditConst.status.checked) {
                     const nextAudit = await this.getDataByCondition({rid: revise.id, times: times, audit_order: audit.audit_order + 1});

+ 8 - 6
app/service/stage_bills.js

@@ -335,13 +335,15 @@ module.exports = app => {
             const transaction = await this.db.beginTransaction();
             try {
                 await transaction.update(this.ctx.service.ledger.tableName, data);
-                if (!stageBills || stageBills.times !== this.ctx.stage.curTimes || stageBills.order !== this.ctx.stage.curOrder) {
-                    await this._insertStageBillsData(transaction, updateData, stageBills, ledgerBills);
-                } else {
-                    updateData.id = stageBills.id;
-                    await transaction.update(this.tableName, updateData);
+                if (stageBills) {
+                    if (stageBills.times !== this.ctx.stage.curTimes || stageBills.order !== this.ctx.stage.curOrder) {
+                        const ledgerBills = await this.ctx.service.ledger.getDataById(data.id);
+                        await this._insertStageBillsData(transaction, updateData, stageBills, ledgerBills);
+                    } else {
+                        updateData.id = stageBills.id;
+                        await transaction.update(this.tableName, updateData);
+                    }
                 }
-                await transaction.update(this.tableName, updateData);
                 await transaction.commit();
             } catch (err) {
                 await transaction.rollback();

+ 1 - 1
app/service/stage_pos.js

@@ -192,7 +192,7 @@ module.exports = app => {
                         if (d.qc_qty) ps.qc_qty = this.round(d.qc_qty, precision.value);
                         if (d.postil) ps.postil = d.postil;
                         await transaction.insert(this.tableName, ps);
-                        if (d.contract_qty || d.qc_qty) {
+                        if ((d.contract_qty || d.qc_qty) && calcStageBills.indexOf(ps.lid) === -1) {
                             calcStageBills.push(ps.lid);
                         }
                         result.stageUpdate = true;

+ 1 - 1
app/view/ledger/gather.ejs

@@ -5,7 +5,7 @@
             <% include ../tender/tender_sub_mini_menu.ejs %>
             <div>
                 <div class="d-inline-block">
-                    台帐对比
+                    清单对比
                 </div>
             </div>
             <div class="ml-auto">

+ 1 - 1
app/view/tender/tender_sub_menu.ejs

@@ -17,7 +17,7 @@
                 <% if (ctx.tender.data.ledger_status !== ctx.tender.auditLedgerConst.status.uncheck) { %>
                 <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/audit') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/audit"><span>台帐审批</span></a></li>
                 <% } %>
-                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/gather') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/gather"><span>台帐对比</span></a></li>
+                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/gather') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/gather"><span>清单对比</span></a></li>
                 <li <% if (ctx.url.indexOf('/tender/' + ctx.tender.id + '/revise') >= 0) { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/revise"><span>台帐修订</span></a></li>
             </ul>
         </div>

+ 1 - 1
app/view/tender/tender_sub_mini_menu.ejs

@@ -17,7 +17,7 @@
                 <% if (ctx.tender.data.ledger_status !== ctx.tender.auditLedgerConst.status.uncheck) { %>
                 <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/audit') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/audit"><span>台帐审批</span></a></li>
                 <% } %>
-                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/gather') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/gather"><span>台帐对比</span></a></li>
+                <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/ledger/gather') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/ledger/gather"><span>清单对比</span></a></li>
                 <li <% if (ctx.url === '/tender/' + ctx.tender.id + '/revise') { %>class="active"<% } %>><a href="/tender/<%- ctx.tender.id %>/revise"><span>台帐修订</span></a></li>
             </ul>
         </div>

+ 1 - 1
config/config.default.js

@@ -100,7 +100,7 @@ module.exports = appInfo => {
         app: true,
     };
 
-    config.filePath = '/etc/calc_file/';
+    config.filePath = '/etc/calc/files/';
 
     // 上传设置
     config.multipart = {

+ 1 - 1
config/config.qa.js

@@ -43,7 +43,7 @@ module.exports = appInfo => {
         version: '1.0.0',
     };
 
-    config.filePath = appInfo.baseDir + '/app/public/';
+    config.filePath = appInfo.baseDir + '/app/public/files';
 
     // session配置
     config.session = {

+ 0 - 3
test/app/service/ledger_audit.test.js

@@ -144,9 +144,6 @@ describe('test/app/service/ledger_audit.test.js', () => {
         const ctx = app.mockContext(mockData);
         yield ctx.service.ledgerAudit.check(ctx.tender.id, auditConst.ledger.status.checkNo, '审批不通过', ctx.tender.data.ledger_times);
 
-        const copyData = yield app.mysql.select(ctx.service.ledgerAudit.tableName + '_copy', {where: {tender_id: ctx.tender.id, times: ctx.tender.data.ledger_times}});
-        assert(copyData.length === 53);
-
         const auditors = yield ctx.service.ledgerAudit.getAuditors(ctx.tender.id, ctx.tender.data.ledger_times);
         assert(auditors);
         assert(auditors.length === 1);

+ 0 - 2
test/app/service/tender.test.js

@@ -110,8 +110,6 @@ describe('test/app/service/tender.test.js', () => {
         assert(count === 0);
         count = yield ctx.service.ledgerAudit.count({tender_id: testTenderId});
         assert(count === 0);
-        count = yield app.mysql.count(ctx.service.ledgerAudit.tableName + '_copy', {tender_id: testTenderId});
-        assert(count === 0);
         count = yield ctx.service.pos.count({tid: testTenderId});
         assert(count === 0);
         count = yield ctx.service.pay.count({tid: testTenderId});