فهرست منبع

变更计量不计价,中间计量相关

MaiXinRong 2 سال پیش
والد
کامیت
7ca269af1e

+ 5 - 4
app/controller/stage_controller.js

@@ -97,7 +97,10 @@ module.exports = app => {
             }
             function hiddenFieldCols(setting, cols) {
                 setting.cols.forEach(x => {
-                    if (cols.indexOf(x.field) >= 0) x.defaultVisible = false;
+                    if (cols.indexOf(x.field) >= 0) {
+                        x.defaultVisible = false;
+                        x.visible = false;
+                    }
                 });
             }
             const tender = this.ctx.tender,
@@ -203,9 +206,9 @@ module.exports = app => {
                 renderData.sfData = sfData;
                 // 收方单附件删除权限
                 renderData.sfAttDelPower = ctx.session.sessionUser.accountId === ctx.stage.user_id || ctx.helper._.findIndex(ctx.stage.auditors2, { aid: ctx.session.sessionUser.accountId }) !== -1;
+                renderData.minusNoValue = projectFunInfo.minusNoValue && ctx.tender.info.fun_rela.stage_change.minusNoValue;
                 renderData.hintOver = projectFunInfo.hintOver && ctx.tender.info.fun_rela.hintOver;
                 renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
-                console.log(2, renderData.ledgerSpread.cols.find(x => { return x.field === 'qc_minus_qty'}));
                 await this.layout('stage/index.ejs', renderData, 'stage/modal.ejs');
             } catch (err) {
                 this.log(err);
@@ -241,13 +244,11 @@ module.exports = app => {
             if (this.ctx.session.sessionProject.dagl) ledgerColumn.push('dagl_status', 'dagl_url', 'dagl_limit');
             if (tender.data.measure_type === measureType.gcl.value) ledgerColumn.push('deal_qty', 'deal_tp');
             if (tender.info.display.ledger.dgnQty) ledgerColumn.push('dgn_qty1', 'dgn_qty2');
-            if (tender.info.fun_rela.stage_change.minusNoValue) ledgerColumn.push('qc_minus_qty');
 
             const posColumn = ['id', 'tid', 'lid', 'name', 'position', 'porder', 'quantity', 'add_stage_order', 'drawing_code'];
             if (tender.info.display.stage.realComplete) posColumn.push('real_qty');
             if (this.ctx.session.sessionProject.gxby) posColumn.push('gxby_status', 'gxby_url', 'gxby_limit');
             if (this.ctx.session.sessionProject.dagl) posColumn.push('dagl_status', 'dagl_url', 'dagl_limit');
-            if (tender.info.fun_rela.stage_change.minusNoValue) posColumn.push('qc_minus_qty');
             for (const field of sjsRela.ledgerCol) {
                 if (field.show) {
                     ledgerColumn.push(field.field);

+ 6 - 0
app/public/js/sr_detail.js

@@ -894,6 +894,8 @@ $(document).ready(() => {
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量金额');
                 $('[name=type-title-qc]').text('本期变更计量金额');
+                $('#show-qc-minus-jl').parent().hidden();
+                $('#qc-minus-jl').parent().hidden();
             } else {
                 const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                 jlCol.title = '本期计量数量';
@@ -967,6 +969,10 @@ $(document).ready(() => {
             $('#show-qc-jl').text(qcJl);
             $('#qc-jl').val(qcJl);
 
+            const qcMinusJl = data && data.qc_minus_jl ? data.qc_minus_jl : '';
+            $('#show-qc-minus-jl').text(qcMinusJl);
+            $('#qc-jl-minus-jl').val(qcMinusJl);
+
             const bglCode = data && data.bgl_code ? data.bgl_code : '';
             $('#show-bgl-code').text(bglCode);
             $('#bgl-code').val(bglCode);

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

@@ -3597,6 +3597,10 @@ $(document).ready(() => {
             $('#show-qc-jl').text(qcJl);
             $('#qc-jl').val(qcJl);
 
+            const qcMinusJl = data && data.qc_minus_jl ? data.qc_minus_jl : '';
+            $('#show-qc-minus-jl').text(qcMinusJl);
+            $('#qc-minus-jl').val(qcMinusJl);
+
             const bglCode = data && data.bgl_code ? data.bgl_code : '';
             $('#show-bgl-code').text(bglCode);
             $('#bgl-code').val(bglCode);

+ 24 - 16
app/public/js/stage_im.js

@@ -389,10 +389,10 @@ const stageIm = (function () {
         if (im.calc_memo !== undefined && im.calc_memo !== null && im.calc_memo !== '') return;
 
         if (im.leafXmjs && im.leafXmjs.length > 0) {
-            const memo = ['本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit];
+            const memo = ['本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit];
             for (const lx of im.leafXmjs) {
                 for (const p of lx.pos) {
-                    memo.push(p.name + ':' + p.jl + ' ' + im.unit);
+                    memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + im.unit);
                 }
             }
             im.calc_memo = memo.join('\n');
@@ -405,10 +405,10 @@ const stageIm = (function () {
                 if (b.pos && b.pos.length > 0) {
                     memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name);
                     for (const p of b.pos) {
-                        memo.push(p.name + ':' + p.jl + ' ' + b.unit);
+                        memo.push(p.name + ':' + p.jl + (p.qc_minus_jl ? (` (不计价 ${p.qc_minus_jl}) `) : ' ') + b.unit);
                     }
                 } else {
-                    memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + (checkZero(b.jl) ? 0 : b.jl) + ' ' + b.unit);
+                    memo.push('清单' + (i+1) + ':' + b.b_code + ' ' + b.name + ':' + (checkZero(b.jl) ? 0 : b.jl) + (b.qc_minus_jl ? (` (不计价 ${b.qc_minus_jl}) `) : ' ') + b.unit);
                 }
             }
             im.calc_memo = memo.join('\n');
@@ -466,6 +466,7 @@ const stageIm = (function () {
             lp.jl = ZhCalc.add(lp.jl, p.gather_qty);
             lp.contract_jl = ZhCalc.add(lp.contract_jl, p.contract_qty);
             lp.qc_jl = ZhCalc.add(lp.qc_jl, p.qc_qty);
+            lp.qc_minus_jl = ZhCalc.add(lp.qc_minus_jl, p.qc_minus_qty);
         }
     }
     function recursiveGenerateTzGclBills(node, im) {
@@ -488,6 +489,7 @@ const stageIm = (function () {
                 b.jl = ZhCalc.add(b.jl, p.gather_qty);
                 b.contract_jl = ZhCalc.add(b.contract_jl, p.contract_qty);
                 b.qc_jl = ZhCalc.add(b.qc_jl, p.qc_qty);
+                b.qc_minus_jl = ZhCalc.add(b.qc_minus_jl, p.qc_minus_qty);
                 generateTzPosData(p, b);
             }
         }
@@ -533,23 +535,23 @@ const stageIm = (function () {
             for (const p of posterity) {
                 if (p.children && p.children.length > 0) continue;
                 if (!checkZero(p.contract_qty) || !checkZero(p.contract_tp) ||
-                    !checkZero(p.qc_qty) || !checkZero(p.qc_tp))
+                    !checkZero(p.qc_qty) || !checkZero(p.qc_tp) || !checkZero(p.qc_minus_qty))
                     return true;
                 const pPos = gsPos.getLedgerPos(p.id);
                 if (!pPos || pPos.length === 0) continue;
                 for (const pp of pPos) {
-                    if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return true;
+                    if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return true;
                 }
             }
             return false;
         } else {
             if (!checkZero(node.contract_qty) || !checkZero(node.contract_tp) ||
-                !checkZero(node.qc_qty) || !checkZero(node.qc_tp))
+                !checkZero(node.qc_qty) || !checkZero(node.qc_tp) || !checkZero(node.qc_minus_qty))
                 return true;
             const pPos = gsPos.getLedgerPos(node.id);
             if (!pPos || pPos.length === 0) return false;
             for (const pp of pPos) {
-                if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return true;
+                if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return true;
             }
         }
     }
@@ -558,7 +560,7 @@ const stageIm = (function () {
         const pPos = gsPos.getLedgerPos(node.id);
         if (!pPos || pPos.length === 0) return null;
         for (const pp of pPos) {
-            if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty)) return pp;
+            if (!checkZero(pp.contract_qty) || !checkZero(pp.qc_qty) || !checkZero(pp.qc_minus_qty)) return pp;
         }
     }
 
@@ -587,7 +589,7 @@ const stageIm = (function () {
             const peg = getPegNode(node);
             const im = {
                 lid: node.id, pid: '', code: node.code,
-                jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp,
+                jl: node.gather_tp, contract_jl: node.contract_tp, qc_jl: node.qc_tp, qc_minus_jl: 0,
                 //im_code: getNewImCode(),
                 peg: peg ? getPegStr(peg.name) : '', drawing_code: getDrawingCode(node),
                 position: '',
@@ -625,11 +627,13 @@ const stageIm = (function () {
         }
         gcl.contract_jl = ZhCalc.add(gcl.contract_jl, bills.contract_jl);
         gcl.qc_jl = ZhCalc.add(gcl.qc_jl, bills.qc_jl);
+        gcl.qc_minus_jl = ZhCalc.add(gcl.qc_minus_jl, bills.qc_minus_jl);
         gcl.jl = ZhCalc.add(gcl.jl, bills.jl);
     }
     function calculateBwBillsIm(im) {
         im.contract_jl = 0;
         im.qc_jl = 0;
+        im.qc_minus_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));
@@ -689,7 +693,7 @@ const stageIm = (function () {
                         }
                         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
+                            jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_jl,
                         });
 
                         if (pp.drawing_code && im.drawing_code instanceof Array)
@@ -707,11 +711,12 @@ const stageIm = (function () {
 
                     imDefault.contract_jl = ZhCalc.add(imDefault.contract_jl, p.contract_tp);
                     imDefault.qc_jl = ZhCalc.add(imDefault.qc_jl, p.qc_tp);
+                    imDefault.qc_jl = 0;
                     imDefault.used = true;
 
                     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,
+                        jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_jl, qc_minus_jl: 0,
                     });
                 }
             }
@@ -737,7 +742,7 @@ const stageIm = (function () {
         const posRange = gsPos.getLedgerPos(node.id);
         if (!posRange) { return }
         for (const p of posRange) {
-            if (!p.gather_qty || checkZero(p.gather_qty)) { continue; }
+            if (checkZero(p.contract_qty) && checkZero(p.qc_qty) && checkZero(p.qc_minus_qty)) { continue; }
             let lp = _.find(lx.pos, {name: p.name});
             if (!lp) {
                 lp = {name: p.name};
@@ -746,6 +751,7 @@ const stageIm = (function () {
             lp.jl = ZhCalc.add(lp.jl, p.gather_qty);
             lp.contract_jl = ZhCalc.add(lp.contract_jl, p.contract_qty);
             lp.qc_jl = ZhCalc.add(lp.qc_jl, p.qc_qty);
+            lp.qc_minus_jl = ZhCalc.add(lp.qc_minus_jl, p.qc_minus_qty);
         }
     }
     function generateZlLeafXmjData(node, im) {
@@ -766,6 +772,7 @@ const stageIm = (function () {
         lx.jl = ZhCalc.add(lx.jl, node.gather_qty);
         lx.contract_jl = ZhCalc.add(lx.contract_jl, node.contract_qty);
         lx.qc_jl = ZhCalc.add(lx.qc_jl, node.qc_qty);
+        lx.qc_minus_jl = ZhCalc.add(lx.qc_minus_jl, node.qc_minus_qty);
         generateZlPosData(node, lx);
     }
     function generateZlChangeData(node, im) {
@@ -809,7 +816,7 @@ const stageIm = (function () {
                 const peg = getPegNode(node);
                 im = {
                     lid: node.id, pid: '', code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field],
-                    jl: 0, contract_jl: 0, qc_jl: 0,
+                    jl: 0, contract_jl: 0, qc_jl: 0, qc_minus_jl: 0,
                     peg: peg ? getPegStr(peg.name) : '',
                     position: '',
                     lIndex: nodeIndex,
@@ -837,6 +844,7 @@ const stageIm = (function () {
             im.jl = ZhCalc.add(im.jl, p.gather_qty);
             im.contract_jl = ZhCalc.add(im.contract_jl, p.contract_qty);
             im.qc_jl = ZhCalc.add(im.qc_jl, p.qc_qty);
+            im.qc_minus_jl = ZhCalc.add(im.qc_minus_jl, p.qc_minus_qty);
         }
     }
 
@@ -854,7 +862,7 @@ const stageIm = (function () {
                     if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty)) { continue }
                     const im = {
                         lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field], pid: pp.id,
-                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty,
+                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_jl,
                         //im_code: getNewImCode(),
                         bw: bw, jldy: pp.name,
                         peg: CheckPeg(pp.name) ? getPegStr(pp.name) : (peg ? getPegStr(peg.name) : ''),
@@ -880,7 +888,7 @@ const stageIm = (function () {
 
                 const im = {
                     lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field], pid: '',
-                    jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty,
+                    jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty, qc_minus_jl: p.qc_minus_qty,
                     im_code: getNewImCode(),
                     bw: bw,
                     peg: peg ? getPegStr(peg.name) : '',

+ 1 - 1
app/service/project.js

@@ -164,7 +164,7 @@ module.exports = app => {
             const result = await this.db.update(this.tableName, {
                 id: id, fun_rela: JSON.stringify({
                     banOver: data.banOver, hintOver: data.hintOver,
-                    imType: data.imType, needGcl: data.needGcl,
+                    imType: data.imType, needGcl: data.needGcl, minusNoValue: data.minusNoValue,
                 }),
             });
             return result.affectedRows === 1;

+ 1 - 1
app/view/setting/fun.ejs

@@ -33,7 +33,7 @@
                                 <div class="form-group mb-4">
                                     <div>
                                         <div class="form-check form-check-inline">
-                                            <input class="form-check-input" type="checkbox" id="ban_over" name="minusNoValue" <% if (funRela.minusNoValue) { %>checked<% } %> onchange="updateSetting();">
+                                            <input class="form-check-input" type="checkbox" id="minusNoValue" name="minusNoValue" <% if (funRela.minusNoValue) { %>checked<% } %> onchange="updateSetting();">
                                             <label class="form-check-label" for="minusNoValue">计量不计价</label>
                                         </div>
                                     </div>

+ 11 - 0
app/view/stage/index.ejs

@@ -151,6 +151,9 @@
                                 <tbody>
                                 <tr><th width="120" name="type-title-contract">本期合同计量数量</th><td id="show-contract-jl"></td></tr>
                                 <tr><th name="type-title-qc">本期变更计量数量</th><td id="show-qc-jl"></td></tr>
+                                <% if (minusNoValue) { %>
+                                <tr><th name="type-title-qc-minus">本期不计价变更数量</th><td id="show-qc-minus-jl"></td></tr>
+                                <% } %>
                                 <tr><th>变更令号</th><td id="show-bgl-code"></td></tr>
                                 <tr><th>变更图号</th><td id="show-bgl-drawing-code"></td></tr>
                                 <tr><th>部位</th><td id="show-bw-name"></td></tr>
@@ -180,6 +183,14 @@
                                     </div>
                                     <input type="text" class="form-control" value="" id="qc-jl" readonly="">
                                 </div>
+                                <% if (minusNoValue) { %>
+                                <div class="input-group input-group-sm mb-2">
+                                    <div class="input-group-prepend">
+                                        <span class="input-group-text" name="type-title-qc-minus">本期不计价变更数量</span>
+                                    </div>
+                                    <input type="text" class="form-control" value="" id="qc-minus-jl" readonly="">
+                                </div>
+                                <% } %>
                                 <div class="input-group input-group-sm mb-2">
                                     <div class="input-group-prepend">
                                         <span class="input-group-text">变更令号</span>

+ 2 - 2
app/view/tender/detail_modal.ejs

@@ -1806,7 +1806,7 @@
                 </div>
                 <div class="form-group">
                     <div class="custom-control custom-checkbox mb-2">
-                        <input type="checkbox" class="custom-control-input" id="sc-minusNoValue" checked="">
+                        <input type="checkbox" class="custom-control-input" id="sc_minusNoValue" checked="">
                         <label class="custom-control-label" for="sc_minusNoValue">计量台账-负变更-计量不计价</label>
                     </div>
                 </div>
@@ -1862,7 +1862,7 @@
 
     const loadFunRelaProperty = function () {
         $('#sl_ignoreParent')[0].checked = property.fun_rela.sum_load.ignoreParent;
-        $('#sc-minusNoValue')[0].checked = property.fun_rela.stage_change.minusNoValue;
+        $('#sc_minusNoValue')[0].checked = property.fun_rela.stage_change.minusNoValue;
         $('#sr_show')[0].checked = property.fun_rela.stage_rela.show;
         $('#hint_over')[0].checked = property.fun_rela.hintOver;
     };