Просмотр исходного кода

负变更,中间计量相关

MaiXinRong 3 лет назад
Родитель
Сommit
3ae1a88029
2 измененных файлов с 21 добавлено и 13 удалено
  1. 8 0
      app/public/js/stage.js
  2. 13 13
      app/public/js/stage_im.js

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

@@ -2909,12 +2909,16 @@ $(document).ready(() => {
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量金额');
                 $('[name=type-title-qc]').text('本期变更计量金额');
+                $('#show-qc-minus-jl').parent().hide();
+                $('#qc-minus-jl').parent().hide();
             } else {
                 const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                 jlCol.title = '本期计量数量';
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量数量');
                 $('[name=type-title-qc]').text('本期变更计量数量');
+                $('#show-qc-minus-jl').parent().show();
+                $('#qc-minus-jl').parent().show();
             }
             if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                 $('#show-jldy').parent().show();
@@ -3004,12 +3008,16 @@ $(document).ready(() => {
                         SpreadJsObj.reLoadSheetHeader(self.sheet);
                         $('[name=type-title-contract]').text('本期合同计量金额');
                         $('[name=type-title-qc]').text('本期变更计量金额');
+                        $('#show-qc-minus-jl').parent().hide();
+                        $('#qc-minus-jl').parent().hide();
                     } else {
                         const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                         jlCol.title = '本期计量数量';
                         SpreadJsObj.reLoadSheetHeader(self.sheet);
                         $('[name=type-title-contract]').text('本期合同计量数量');
                         $('[name=type-title-qc]').text('本期变更计量数量');
+                        $('#show-qc-minus-jl').parent().show();
+                        $('#qc-minus-jl').parent().show();
                     }
                     if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                         $('#show-jldy').parent().show();

+ 13 - 13
app/public/js/stage_im.js

@@ -24,8 +24,8 @@ const stageIm = (function () {
         keys: ['id', 'tender_id', 'ledger_id'],
         stageId: 'id',
     };
-    gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp'];
-    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
+    gsTreeSetting.updateFields = ['contract_qty', 'contract_tp', 'qc_qty', 'qc_tp', 'qc_minus_qty'];
+    gsTreeSetting.calcFields = ['deal_tp', 'total_price', 'contract_tp', 'qc_tp', 'qc_minus_qty', 'gather_tp', 'end_contract_tp', 'end_qc_tp', 'end_gather_tp'];
     gsTreeSetting.calcFun = function (node) {
         if (node.children && node.children.length === 0) {
             node.pre_gather_qty = ZhCalc.add(node.pre_contract_qty, node.pre_qc_qty);
@@ -457,7 +457,7 @@ const stageIm = (function () {
         const posRange = gsPos.getLedgerPos(node.id);
         if (!posRange) { return }
         for (const p of posRange) {
-            if (checkZero(p.contract_qty) && checkZero(p.qc_qty)) { continue; }
+            if (checkZero(p.contract_qty) && checkZero(p.qc_qty) && checkZero(p.qc_minus_qty)) { continue; }
             let lp = _.find(gclBills.pos, {name: p.name});
             if (!lp) {
                 lp = {name: p.name};
@@ -478,7 +478,7 @@ const stageIm = (function () {
                     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)) {
                     continue;
                 }
                 let b = _.find(im.gclBills, {bid: p.id});
@@ -665,7 +665,7 @@ const stageIm = (function () {
                 const pPos = gsPos.getLedgerPos(p.id);
                 if (pPos && pPos.length > 0) {
                     for (const pp of pPos) {
-                        if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty)) continue;
+                        if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty) && checkZero(pp.qc_minus_qty)) continue;
                         let im = nodeImData.find(function (d) {
                             return d.lid === node.id && d.pos_name === pp.name;
                         });
@@ -693,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, qc_minus_jl: pp.qc_minus_jl,
+                            jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_qty,
                         });
 
                         if (pp.drawing_code && im.drawing_code instanceof Array)
@@ -711,12 +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.qc_minus_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, qc_minus_jl: 0,
+                        jl: p.gather_qty, contract_jl: p.contract_qty, qc_jl: p.qc_qty, qc_minus_jl: p.qc_qty,
                     });
                 }
             }
@@ -859,10 +859,10 @@ const stageIm = (function () {
             if (pPos && pPos.length > 0) {
                 const nodeIndex = gsTree.getNodeIndex(node);
                 for (const pp of pPos) {
-                    if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty)) { continue }
+                    if (checkZero(pp.contract_qty) && checkZero(pp.qc_qty) && checkZero(pp.qc_minus_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, qc_minus_jl: pp.qc_minus_jl,
+                        jl: pp.gather_qty, contract_jl: pp.contract_qty, qc_jl: pp.qc_qty, qc_minus_jl: pp.qc_minus_qty,
                         //im_code: getNewImCode(),
                         bw: bw, jldy: pp.name,
                         peg: CheckPeg(pp.name) ? getPegStr(pp.name) : (peg ? getPegStr(peg.name) : ''),
@@ -875,7 +875,7 @@ const stageIm = (function () {
                         source: [{id: p.ledger_id, code: p.code, b_code: p.b_code}],
                         im_type: imType.bw.value,
                     };
-                    im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
+                    im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit;
                     ImData.push(im);
                     for (const c of changes) {
                         if (c.lid === p.id && c.pid === pp.id && c.qty && c.qty !== 0) {
@@ -884,7 +884,7 @@ const stageIm = (function () {
                     }
                 }
             } else {
-                if (checkZero(p.gather_qty) && checkZero(p.gather_tp)) { continue }
+                if (checkZero(p.gather_qty) && checkZero(p.gather_tp) && checkZero(p.qc_minus_qty)) { continue }
 
                 const im = {
                     lid: node.id, code: p.b_code, name: p.name, unit: p.unit, unit_price: p[up_field], pid: '',
@@ -901,7 +901,7 @@ const stageIm = (function () {
                     source: [{id: p.ledger_id, code: p.code, b_code: p.b_code}],
                     im_type: imType.bw.value,
                 };
-                im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + ' ' + im.unit;
+                im.calc_memo = '本期计量:' + (checkZero(im.jl) ? 0 : im.jl) + (im.qc_minus_jl ? (` (不计价 ${im.qc_minus_jl}) `) : ' ') + im.unit;
                 ImData.push(im);
                 for (const c of changes) {
                     if (c.lid === p.id && c.pid == -1 && c.qty && c.qty !== 0) {