فهرست منبع

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

TonyKang 5 سال پیش
والد
کامیت
ec2fc75ad4

+ 7 - 2
app/lib/ledger.js

@@ -157,14 +157,19 @@ class baseTree {
      * @returns {Array}
      */
     getPosterity (node) {
+        let posterity;
         if (node.full_path !== '') {
             const reg = new RegExp('^' + node.full_path + '-');
-            return this.datas.filter(function (x) {
+            posterity = this.datas.filter(function (x) {
                 return reg.test(x.full_path);
             });
         } else {
-            return this._recursiveGetPosterity(node);
+            posterity = this._recursiveGetPosterity(node);
         }
+        posterity.sort(function (x, y) {
+            return self.getNodeIndex(x) - self.getNodeIndex(y);
+        });
+        return posterity;
     };
 
     /**

+ 50 - 24
app/lib/stage_im.js

@@ -61,7 +61,7 @@ class StageIm {
         this.ImData = [];
         this.ImBillsData = [];
         //
-        this.imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img', 'position'];
+        this.imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img', 'position', 'jldy'];
         this.splitChar = '-';
     }
 
@@ -255,8 +255,9 @@ class StageIm {
                 (!im.pos_name || im.pos_name === d.pos_name);
         });
         if (cd) {
+            im.custom_define = cd.custom_define ? cd.custom_define.split(',') : this.imFields;
             this._.assignInWith(im, cd, function(oV, sV, key) {
-                return self.imFields.indexOf(key) > -1 && sV !== undefined && sV !== null ? sV : oV;
+                return im.custom_define.indexOf(key) > -1 && sV !== undefined && sV !== null ? sV : oV;
             });
         }
     }
@@ -273,6 +274,10 @@ class StageIm {
             }
             im.calc_memo = memo.join('\n');
         } else if (im.gclBills && im.gclBills.length > 0) {
+            const self = this;
+            im.gclBills.sort(function (x, y) {
+                return self.ctx.helper.compareCode(x.b_code, y.b_code);
+            });
             const memo = [];
             for (const [i, b] of im.gclBills.entries()) {
                 if (b.pos && b.pos.length > 0) {
@@ -435,6 +440,32 @@ class StageIm {
         }
     }
 
+    _addBwBillsGclBills(im, bills) {
+        if (!im.gclBills) im.gclBills = [];
+        let gcl = im.gclBills.find(function (x) {
+            return (!bills.b_code || bills.b_code === x.b_code) &&
+                (!bills.name || bills.name === x.name) &&
+                (!bills.unit || bills.unit === x.unit) &&
+                checkZero(this.ctx.helper.sub(bills.unit_price, x.unit_price));
+        });
+        if (!gcl) {
+            gcl = {b_code: bills.b_code, name: bills.name, unit: bills.unit, unit_price: bills.unit_price};
+            im.gclBills.push(gcl);
+        }
+        gcl.contract_jl = this.ctx.helper.add(gcl.contract_jl, bills.contract_jl);
+        gcl.qc_jl = this.ctx.helper.add(gcl.qc_jl, bills.qc_jl);
+        gcl.jl = this.ctx.helper.add(gcl.jl, bills.jl);
+    }
+    _calculateBwBillsIm(im) {
+        const tp_decimal = this.ctx.tender.info.decimal.tp;
+        im.contract_jl = 0;
+        im.qc_jl = 0;
+        for (const b of im.gclBills) {
+            im.contract_jl = this.ctx.helper.add(im.contract_jl, this.ctx.helper.mul(b.contract_jl, b.unit_price, tp_decimal));
+            im.qc_jl = this.ctx.helper.add(im.qc_jl, this.ctx.helper.mul(b.qc_jl, b.unit_price, tp_decimal));
+        }
+        im.jl = this.ctx.helper.add(im.contract_jl, im.qc_jl);
+    }
     _getBwBillsIm(node, peg, index, bw) {
         const im = {
             lid: node.id, pid: '', code: node.code, name: node.name, pos_name: '',
@@ -470,7 +501,6 @@ class StageIm {
     _generateBwBillsImData (node) {
         if (!node.gather_tp && !node.contract_tp && !node.qc_tp) return;
 
-        const tp_decimal = this.ctx.tender.info.decimal.tp;
         const nodeIndex = gsTree.getNodeIndex(node);
         const peg = this._getPegNode(node);
         const nodeImData = [], posterity = gsTree.getPosterity(node);
@@ -488,23 +518,19 @@ class StageIm {
 
                     const im = this._getBwBillsPosIm(nodeImData, node, peg, nodeIndex, bw, pp.name);
 
+                    this._addBwBillsGclBills(im, {
+                        b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
+                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty
+                    });
+
                     for (const c of changes) {
                         if (c.lid === p.id && c.pid == pp.id && c.qty && c.qty !== 0) {
                             im.changes.push(c);
                         }
                     }
 
-                    im.jl = ZhCalc.add(im.jl, ZhCalc.mul(pp.gather_qty, p.unit_price, tp_decimal));
-                    im.contract_jl = ZhCalc.add(im.contract_jl, ZhCalc.mul(pp.contract_qty, p.unit_price, tp_decimal));
-                    im.qc_jl = ZhCalc.add(im.qc_jl, ZhCalc.mul(pp.qc_qty, p.unit_price, tp_decimal));
-                    if (pp.drawing_code) im.drawing_code.push(pp.drawing_code);
-                    if (pp.position) im.position.push(pp.position);
-
-                    im.gclBills.push({
-                        bid: p.id,
-                        b_code: p.b_code, name: p.name, unit: p.unit,
-                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty
-                    });
+                    if (pp.drawing_code && im.drawing_code instanceof Array) im.drawing_code.push(pp.drawing_code);
+                    if (pp.position && im.position instanceof Array) im.position.push(pp.position);
                 }
             } else {
                 for (const c of changes) {
@@ -513,23 +539,23 @@ class StageIm {
                     }
                 }
 
-                imDefault.jl = ZhCalc.add(imDefault.jl, p.gather_qty);
-                imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_qty);
-                imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_qty);
+                imDefault.contract_jl = this.ctx.helper.add(imDefault.contract_jl, p.contract_qty);
+                imDefault.qc_jl = this.ctx.helper.add(imDefault.qc_jl, p.qc_qty);
 
-                imDefault.gclBills.push({
-                    bid: p.id,
-                    b_code: p.b_code, name: p.name, unit: p.unit,
-                    jl: p.gather_tp, contract_jl: p.contract_tp, qc_jl: p.qc_tp
+                this._addBwBillsGclBills(imDefault, {
+                    b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
+                    jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_jl,
                 });
             }
         }
-        if (imDefault.jl) {
+        if (imDefault.contract_jl || imDefault.qc_jl) {
+            imDefault.jl = this.ctx.helper.add(imDefault.contract_jl, imDefault.qc_jl);
             ImData.push(imDefault);
         }
         for (const im of nodeImData) {
-            im.drawing_code = im.drawing_code.join(mergeChar);
-            im.position = im.position.join(mergeChar);
+            this._calculateBwBillsIm(im);
+            im.drawing_code = this.ctx.helper._.uniq(im.drawing_code).join(mergeChar);
+            im.position = this.ctx.helper._.uniq(im.position).join(mergeChar);
             ImData.push(im);
         }
     }

+ 5 - 0
app/public/js/ledger.js

@@ -23,6 +23,7 @@ const invalidFields = {
     posCalc: ['sgfh_qty', 'sgfh_tp', 'sjcl_qty', 'sjcl_tp', 'qtcl_qty', 'qtcl_tp'],
     posXmj: ['code'],
 };
+const exprField = ['sgfh_qty', 'sgfh_tp', 'sjcl_qty'];
 function transExpr(expr) {
     return expr.replace('=', '').replace('%', '/100');
 }
@@ -427,6 +428,9 @@ $(document).ready(function() {
          * @param {Object} e
          * @param {Object} info
          */
+        _setExpr: function (field, text, data) {
+
+        },
         editEnded: function (e, info) {
             if (info.sheet.zh_setting) {
                 const col = info.sheet.zh_setting.cols[info.col];
@@ -475,6 +479,7 @@ $(document).ready(function() {
                         } else {
                             try {
                                 data[col.field] = math.evaluate(transExpr(newValue));
+                                if (exprField.indexOf(col.field) >= 0) data[col.field + '']
                             } catch(err) {
                                 toastr.error('输入的表达式非法');
                                 SpreadJsObj.reLoadRowData(info.sheet, info.row);

+ 8 - 2
app/public/js/path_tree.js

@@ -455,14 +455,20 @@ const createNewPathTree = function (type, setting) {
          * @returns {Array}
          */
         getPosterity(node) {
+            const self = this;
+            let posterity;
             if (node.full_path !== '') {
                 const reg = new RegExp('^' + node.full_path + '-');
-                return this.datas.filter(function (x) {
+                posterity = this.datas.filter(function (x) {
                     return reg.test(x.full_path);
                 });
             } else {
-                return this._recursiveGetPosterity(node);
+                posterity = this._recursiveGetPosterity(node);
             }
+            posterity.sort(function (x, y) {
+                return self.getNodeIndex(x) - self.getNodeIndex(y);
+            });
+            return posterity;
         };
         /**
          * 查询node是否是父节点的最后一个子节点

+ 44 - 10
app/public/js/stage.js

@@ -1778,6 +1778,11 @@ $(document).ready(() => {
                                 updateData.unit_price = data.unit_price;
                                 updateData.pos_name = data.pos_name;
                             }
+                            if (data.custom_define.indexOf('doc_code') === -1) {
+                                updateData.custom_define = data.custom_define;
+                                updateData.custom_define.push('doc_code');
+                                updateData.custom_define = updateData.custom_define.join(',');
+                            }
                             updateData.doc_code = info.editingText === null ? '' : info.editingText;
                             postData(window.location.pathname + '/detail/save', updateData, function (result) {
                                 stageIm.loadUpdateDetailData(result);
@@ -1818,6 +1823,11 @@ $(document).ready(() => {
                                     updateData.unit_price = data.unit_price;
                                     updateData.pos_name = data.pos_name;
                                 }
+                                if (data.custom_define.indexOf('doc_code') === -1) {
+                                    updateData.custom_define = data.custom_define;
+                                    updateData.custom_define.push('doc_code');
+                                    updateData.custom_define = updateData.custom_define.join(',');
+                                }
                                 updateData.doc_code = info.sheet.getText(curRow, info.cellRange.col).replace('\n', '');
                                 datas.push(updateData);
                             }
@@ -1844,6 +1854,7 @@ $(document).ready(() => {
                                     const updateData = {lid: data.lid};
                                     if (data.uuid) {
                                         updateData.uuid = data.uuid;
+                                        updateData.custom_define = data.custom_define;
                                         updateData.doc_code = '';
                                         datas.push(updateData);
                                     }
@@ -1889,6 +1900,11 @@ $(document).ready(() => {
                             } else {
                                 updateData.doc_code = text.replace('\n', '');
                             }
+                            if (data.custom_define.indexOf('doc_code') === -1) {
+                                updateData.custom_define = data.custom_define;
+                                updateData.custom_define.push('doc_code');
+                                updateData.custom_define = updateData.custom_define.join(',');
+                            }
                             datas.push(updateData);
                         }
                     }
@@ -1953,7 +1969,7 @@ $(document).ready(() => {
                 $('#type-title-contract').text('本期合同计量数量');
                 $('#type-title-qc').text('本期变更计量数量');
             }
-            if (stage.im_type === imType.bb.value) {
+            if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                 $('#show-jldy').parent().show();
                 $('#jldy').parent().show();
                 $('#show-xm-name').parent().hide();
@@ -2037,7 +2053,7 @@ $(document).ready(() => {
                         $('#type-title-contract').text('本期合同计量数量');
                         $('#type-title-qc').text('本期变更计量数量');
                     }
-                    if (stage.im_type === imType.bb.value) {
+                    if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                         $('#show-jldy').parent().show();
                         $('#jldy').parent().show();
                         $('#show-xm-name').parent().hide();
@@ -2071,7 +2087,7 @@ $(document).ready(() => {
                         defaultRowHeight: 21,
                         headerFont: '12px 微软雅黑',
                         font: '12px 微软雅黑',
-                    }
+                    };
                     sjsSettingObj.setFxTreeStyle(setting, sjsSettingObj.FxTreeStyle.jz);
                     SpreadJsObj.initSheet(self.gsSpread.getActiveSheet(), setting);
                     self.gsSpread.bind(spreadNS.Events.ButtonClicked, function (e, info) {
@@ -2209,9 +2225,11 @@ $(document).ready(() => {
                     if (!org[field]) {
                         if (newValue !== '') {
                             update[field] = newValue;
+                            if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
                         }
                     } else if (newValue !== org[field]){
                         update[field] = newValue;
+                        if (data.custom_define.indexOf(field) === -1) update.custom_define.push(field);
                     }
                 }
 
@@ -2219,19 +2237,30 @@ $(document).ready(() => {
                 const updateData = {lid: data.lid, pid: data.pid};
                 if (data.uuid) {
                     updateData.uuid = data.uuid;
+                    updateData.custom_define = data.custom_define;
                 } else {
                     updateData.code = data.code;
                     updateData.name = data.name;
                     updateData.unit = data.unit;
                     updateData.unit_price = data.unit_price;
                     updateData.pos_name = data.pos_name;
-                }
-                updateData.bw = $('#bw-name').val();
-                updateData.peg = $('#peg').val();
-                updateData.xm = $('#xm-name').val();
-                updateData.position = $('#position').val();
-                updateData.drawing_code = $('#drawing-code').val();
-                updateData.calc_memo = $('#calc-memo').val();
+                    updateData.custom_define = [];
+                }
+                check('bw', $('#bw-name'), data, updateData);
+                check('peg', $('#peg'), data, updateData);
+                check('xm', $('#xm'), data, updateData);
+                check('position', $('#position'), data, updateData);
+                check('jldy', $('#jldy'), data, updateData);
+                check('drawing_code', $('#drawing_code'), data, updateData);
+                check('calc-memo', $('#calc-memo'), data, updateData);
+                updateData.custom_define = updateData.custom_define.join(',');
+                // updateData.bw = $('#bw-name').val();
+                // updateData.peg = $('#peg').val();
+                // updateData.xm = $('#xm-name').val();
+                // updateData.position = $('#position').val();
+                // updateData.jldy = $('#jldy').val();
+                // updateData.drawing_code = $('#drawing-code').val();
+                // updateData.calc_memo = $('#calc-memo').val();
                 postData(window.location.pathname + '/detail/save', updateData, function (result) {
                     stageIm.loadUpdateDetailData(result);
                     self.reLoadDetailData();
@@ -2378,6 +2407,11 @@ $(document).ready(() => {
                         updateData.unit_price = data.unit_price;
                         updateData.pos_name = data.pos_name;
                     }
+                    if (data.custom_define.indexOf('calc_img') === -1) {
+                        updateData.custom_define = data.custom_define;
+                        updateData.custom_define.push('calc_img');
+                        updateData.custom_define = updateData.custom_define.join(',');
+                    }
                     updateData.img = canvas.toDataURL('image/png');
                     updateData.imgInfo = itemInfo;
                     postData(window.location.pathname + '/detail/merge-img', updateData, function (result) {

+ 52 - 20
app/public/js/stage_im.js

@@ -9,7 +9,7 @@
  */
 
 const stageIm = (function () {
-    const imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img', 'position'];
+    const imFields = ['uuid', 'doc_code', 'peg', 'bw', 'xm', 'drawing_code', 'calc_memo', 'calc_img', 'position', 'jldy'];
     const splitChar = '-';
     const mergeChar = ';';
     let stage, imType, decimal, details, changes, ImData, pre;
@@ -265,8 +265,9 @@ const stageIm = (function () {
                 (!im.pos_name || im.pos_name === d.pos_name);
         });
         if (cd) {
+            im.custom_define = cd.custom_define ? cd.custom_define.split(',') : imFields;
             _.assignInWith(im, cd, function (oV, sV, key) {
-                return (imFields.indexOf(key) > -1 && sV !== undefined && sV !== null) ? sV : oV;
+                return (im.custom_define.indexOf(key) > -1 && sV !== undefined && sV !== null) ? sV : oV;
             });
         }
     }
@@ -283,6 +284,9 @@ const stageIm = (function () {
             }
             im.calc_memo = memo.join('\n');
         } else if (im.gclBills && im.gclBills.length > 0) {
+            im.gclBills.sort(function (x, y) {
+                return compareCode(x.b_code, y.b_code);
+            });
             const memo = [];
             for (const [i, b] of im.gclBills.entries()) {
                 if (b.pos && b.pos.length > 0) {
@@ -428,6 +432,7 @@ const stageIm = (function () {
                 peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
                 position: '',
                 lIndex: nodeIndex,
+                custom_define: [],
             };
             if (stage.im_gather && node.check) {
                 im.bw = getZlGatherBw(node, peg);
@@ -445,6 +450,31 @@ const stageIm = (function () {
         }
     }
 
+    function addBwBillsGclBills(im, bills) {
+        if (!im.gclBills) im.gclBills = [];
+        let gcl = im.gclBills.find(function (x) {
+            return (!bills.b_code || bills.b_code === x.b_code) &&
+                (!bills.name || bills.name === x.name) &&
+                (!bills.unit || bills.unit === x.unit) &&
+                checkZero(ZhCalc.sub(bills.unit_price, x.unit_price));
+        });
+        if (!gcl) {
+            gcl = {b_code: bills.b_code, name: bills.name, unit: bills.unit, unit_price: bills.unit_price};
+            im.gclBills.push(gcl);
+        }
+        gcl.contract_jl = ZhCalc.add(gcl.contract_jl, bills.contract_jl);
+        gcl.qc_jl = ZhCalc.add(gcl.qc_jl, bills.qc_jl);
+        gcl.jl = ZhCalc.add(gcl.jl, bills.jl);
+    }
+    function calculateBwBillsIm(im) {
+        im.contract_jl = 0;
+        im.qc_jl = 0;
+        for (const b of im.gclBills) {
+            im.contract_jl = ZhCalc.add(im.contract_jl, ZhCalc.mul(b.contract_jl, b.unit_price, decimal.tp));
+            im.qc_jl = ZhCalc.add(im.qc_jl, ZhCalc.mul(b.qc_jl, b.unit_price, decimal.tp));
+        }
+        im.jl = ZhCalc.add(im.contract_jl, im.qc_jl);
+    }
     function generateBwBillsImData (node) {
         if (node.gather_tp) {
             const nodeIndex = gsTree.getNodeIndex(node);
@@ -459,6 +489,7 @@ const stageIm = (function () {
                 lIndex: nodeIndex,
                 bw: bw, jldy: node.name,
                 changes: [], gclBills: [],
+                custom_define: [],
             };
             checkCustomDetail(imDefault);
             for (const p of posterity) {
@@ -481,6 +512,7 @@ const stageIm = (function () {
                                 lIndex: nodeIndex,
                                 bw: bw, jldy: pp.name,
                                 changes: [], gclBills: [],
+                                custom_define: [],
                             };
                             nodeImData.push(im);
                             checkCustomDetail(im);
@@ -491,18 +523,15 @@ const stageIm = (function () {
                                 im.changes.push(c);
                             }
                         }
-
-                        im.jl = ZhCalc.add(im.jl, ZhCalc.mul(pp.gather_qty, p.unit_price, decimal.tp));
-                        im.contract_jl = ZhCalc.add(im.contract_jl, ZhCalc.mul(pp.contract_qty, p.unit_price, decimal.tp));
-                        im.qc_jl = ZhCalc.add(im.qc_jl, ZhCalc.mul(pp.qc_qty, p.unit_price, decimal.tp));
-                        if (pp.drawing_code) im.drawing_code.push(pp.drawing_code);
-                        if (pp.position) im.position.push(pp.position);
-
-                        im.gclBills.push({
-                            bid: p.id,
-                            b_code: p.b_code, name: p.name, unit: p.unit,
+                        addBwBillsGclBills(im, {
+                            b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
                             jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty
                         });
+
+                        if (pp.drawing_code && im.drawing_code instanceof Array)
+                            im.drawing_code.push(pp.drawing_code);
+                        if (pp.position && im.position instanceof Array)
+                            im.position.push(pp.position);
                     }
                 } else {
                     for (const c of changes) {
@@ -511,23 +540,23 @@ const stageIm = (function () {
                         }
                     }
 
-                    imDefault.jl = ZhCalc.add(imDefault.jl, p.gather_qty);
                     imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_qty);
                     imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_qty);
 
-                    imDefault.gclBills.push({
-                        bid: p.id,
-                        b_code: p.b_code, name: p.name, unit: p.unit,
-                        jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty
+                    addBwBillsGclBills(imDefault, {
+                        b_code: p.b_code, name: p.name, unit: p.unit, unit_price: p.unit_price,
+                        jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_jl,
                     });
                 }
             }
-            if (imDefault.jl) {
+            if (imDefault.contract_jl || imDefault.qc_jl) {
+                imDefault.jl = ZhCalc.add(imDefault.contract_jl, imDefault.qc_jl);
                 ImData.push(imDefault);
             }
             for (const im of nodeImData) {
-                im.drawing_code = im.drawing_code.join(mergeChar);
-                im.position = im.position.join(mergeChar);
+                calculateBwBillsIm(im);
+                im.drawing_code = _.uniq(im.drawing_code).join(mergeChar);
+                im.position = _.uniq(im.position).join(mergeChar);
                 ImData.push(im);
             }
         }
@@ -621,6 +650,7 @@ const stageIm = (function () {
                     peg: peg ? getPegStr(peg.name) : '',
                     position: '',
                     lIndex: nodeIndex,
+                    custom_define: [],
                 };
                 if (stage.im_gather && node.check) {
                     im.bw = getZlGatherBw(node, peg);
@@ -668,6 +698,7 @@ const stageIm = (function () {
                         changes: [],
                         position: pp.position,
                         lIndex: nodeIndex,
+                        custom_define: [],
                     };
                     im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                     checkCustomDetail(im);
@@ -694,6 +725,7 @@ const stageIm = (function () {
                     changes: [],
                     position: '',
                     lIndex: gsTree.getNodeIndex(node),
+                    custom_define: [],
                 };
                 im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
                 checkCustomDetail(im);

+ 1 - 1
app/view/change/info_modal.ejs

@@ -707,7 +707,7 @@
                                                     <div class="alert alert-warning">
                                                         <div class="form-check form-check-inline">
                                                             <input class="form-check-input" type="radio" name="status" id="change-back" value="5" <% if (a.usite === 1) { %>checked<% } %>>
-                                                            <label class="form-check-label" for="change-back">退回报 <%= auditList3[0].name %></label>
+                                                            <label class="form-check-label" for="change-back">退回报 <%= auditList3[0].name %></label>
                                                         </div>
                                                         <% if (a.usite !== 1) { %>
                                                             <div class="form-check form-check-inline">

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

@@ -261,7 +261,7 @@
                                                     <label>审批意见<b class="text-danger">*</b></label>
                                                     <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                                 </div>
-                                                <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
+                                                <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
                                             <% } %>
                                         </li>
                                     <% } %>

+ 1 - 1
app/view/material/audit_modal.ejs

@@ -319,7 +319,7 @@
                                         <label>审批意见<b class="text-danger">*</b></label>
                                         <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                     </div>
-                                    <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
+                                    <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
                                     <% } %>
                                 </li>
                                 <% } %>

+ 1 - 1
app/view/revise/info_modal.ejs

@@ -419,7 +419,7 @@
                                                 <label>审批意见<b class="text-danger">*</b></label>
                                                 <textarea class="form-control form-control-sm" name="opinion">不同意</textarea>
                                             </div>
-                                            <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
+                                            <div class="alert alert-warning">审批退回,将直接退回给报人。</div>
                                         <% } else { %>
                                             <h5 class="card-title">
                                                 <i class="<%- (i < iLen - 1 ? 'fa fa-chevron-circle-down' : 'fa fa-stop-circle') %>"></i> <%- auditors[i].name %> <small class="text-muted"><%- auditors[i].role %></small><span class="pull-right"><%= i < iLen - 1 ? ctx.helper.transFormToChinese(i+1) : '终' %>审</span>

+ 3 - 3
app/view/stage/audit_modal.ejs

@@ -383,7 +383,7 @@
                                                     <div class="alert alert-warning">
                                                         <div class="form-check form-check-inline">
                                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>>
-                                                            <label class="form-check-label" for="inlineRadio1">退回报 <%- ctx.stage.user.name %></label>
+                                                            <label class="form-check-label" for="inlineRadio1">退回报 <%- ctx.stage.user.name %></label>
                                                         </div>
                                                         <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
                                                             <% const auditorIndex = ctx.stage.auditors2.findIndex(function (item) { return item.aid === auditors[iA].aid }) %>
@@ -1404,7 +1404,7 @@
                                                     <div class="alert alert-warning">
                                                         <div class="form-check form-check-inline">
                                                             <input class="form-check-input" type="radio" name="checkType" id="inlineRadio1" value="<%- auditConst.status.checkNo %>" <% if (auditors[iA].order === 1 || auditors[iA].aid === auditors[0].aid) { %>checked<% } %>>
-                                                            <label class="form-check-label" for="inlineRadio1">退回报 <%- ctx.stage.user.name %></label>
+                                                            <label class="form-check-label" for="inlineRadio1">退回报 <%- ctx.stage.user.name %></label>
                                                         </div>
                                                         <% if (auditors[iA].order > 1 && auditors[iA].aid !== auditors[0].aid) { %>
                                                             <% const auditorIndex = ctx.stage.auditors2.findIndex(function (item) { return item.aid === auditors[iA].aid }) %>
@@ -1553,4 +1553,4 @@
         $('#hide-all').hide();
         return false;
     });
-</script>
+</script>

+ 25 - 1
sql/update.sql

@@ -5,4 +5,28 @@ UPDATE `zh_stage_pay` sp
   WHERE (sp.`start_stage_order` < s.`order` OR ((not IsNULL(sp.pre_tp)) AND sp.pre_tp) AND sp.`pre_used` = 0 AND p.`ptype` = 1;
 
 ALTER TABLE `zh_stage_detail`
-ADD COLUMN `pos_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '计量单元名称' AFTER `position`;
+ADD COLUMN `pos_name`  varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL COMMENT '计量单元名称' AFTER `position`;
+
+ALTER TABLE `zh_formula`
+MODIFY COLUMN `sid`  int(11) NOT NULL DEFAULT -1 COMMENT '期id' AFTER `tid`,
+MODIFY COLUMN `rid`  varchar(50) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT '修订id' AFTER `sid`,
+MODIFY COLUMN `formula`  varchar(1000) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT '' COMMENT '表达式' AFTER `table_field`,
+ADD COLUMN `valid`  tinyint(1) NOT NULL DEFAULT 1 COMMENT '是否可用' AFTER `formula`;
+
+ALTER TABLE `zh_stage_detail`
+ADD COLUMN `custom_define`  varchar(1000) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '修改过的字段' AFTER `pos_name`;
+
+ALTER TABLE `zh_ledger`
+MODIFY COLUMN `sgfh_qty`  decimal(24,8) NULL DEFAULT NULL COMMENT '施工复核 - 数量' AFTER `deal_tp`,
+MODIFY COLUMN `sgfh_tp`  decimal(24,8) NULL DEFAULT NULL COMMENT '施工复核 - 金额' AFTER `sgfh_qty`,
+ADD COLUMN `sgfh_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '施工复核-公式' AFTER `is_tp`,
+ADD COLUMN `sjcl_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '设计错漏-公式' AFTER `sgfh_expr`,
+ADD COLUMN `qtcl_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '其他错漏-公式' AFTER `sjcl_qty`;
+
+
+ALTER TABLE `zh_revise_bills`
+MODIFY COLUMN `sgfh_qty`  decimal(24,8) NULL DEFAULT NULL COMMENT '施工复核 - 数量' AFTER `deal_tp`,
+MODIFY COLUMN `sgfh_tp`  decimal(24,8) NULL DEFAULT NULL COMMENT '施工复核 - 金额' AFTER `sgfh_qty`,
+ADD COLUMN `sgfh_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '施工复核-公式' AFTER `is_tp`,
+ADD COLUMN `sjcl_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '设计错漏-公式' AFTER `sgfh_expr`,
+ADD COLUMN `qtcl_expr`  varchar(255) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT '' COMMENT '其他错漏-公式' AFTER `sjcl_qty`;