ソースを参照

Merge branch 'dev' of http://192.168.1.41:3000/maixinrong/Calculation into dev

Tony Kang 1 年間 前
コミット
daf80fa3c7

+ 5 - 6
app/public/js/material_list.js

@@ -68,14 +68,14 @@ function calcOneBQJC(xmj) {
     const notx = findNotJoinLeafXmj(xmj);
     if (notx === undefined) {
         const list = xmj.mx_id !== undefined ? getMaterialListByLeafXmj(xmj.gcl_id, xmj.id, xmj.mx_id) : getMaterialListByLeafXmj(xmj.gcl_id, xmj.id);
-        // const notx2 = findNotChangeLeafXmj(xmj);
+        const notx2 = findNotChangeLeafXmj(xmj);
         // if (notx2 !== undefined) {
         //     for (const l of list) {
         //         jiacha = ZhCalc.add(jiacha, ZhCalc.mul(ZhCalc.mul(xmj.contract_qty, l.quantity), getMpSpreadByMBData(l.mb_id)));
         //     }
         // } else {
         for (const l of list) {
-            jiacha = ZhCalc.add(jiacha, ZhCalc.mul(ZhCalc.mul(calcQty(xmj, l.is_join), l.quantity), getMpSpreadByMBData(l.mb_id)));
+            jiacha = ZhCalc.add(jiacha, ZhCalc.mul(ZhCalc.mul(calcQty(xmj, notx2 !== undefined ? 2 : 1), l.quantity), getMpSpreadByMBData(l.mb_id)));
         }
         // }
     }
@@ -375,13 +375,11 @@ $(document).ready(() => {
                     updateBillsData(ms_id);
                     const newGclGatherListData = [];
                     for (const [index, s] of result.ledgerListData.entries()) {
-                        // gclGatherModel.clearGatherData();
                         gclGatherModel.loadLedgerData(_.cloneDeep(ledger), s);
                         gclGatherModel.loadPosData(_.cloneDeep(pos), result.posListData[index]);
                         const oneGclGatherData = gclGatherModel.gatherGclData().filter(item => {
                             return item.qc_qty || item.contract_qty || item.qc_minus_qty
                         });
-                        console.log(oneGclGatherData);
                         newGclGatherListData.push(oneGclGatherData);
                     }
                     gclGatherListData = newGclGatherListData;
@@ -1023,7 +1021,6 @@ $(document).ready(() => {
             const data = {
                 type: type,
                 select: type === 'join' ? findNotJoinLeafXmj(select) : select,
-                // gather_qty: select.gather_qty,
                 ms_id: $('#myTab').find('.active').data('msid') || null,
             };
             // 添加到
@@ -1050,7 +1047,6 @@ $(document).ready(() => {
             const data = {
                 type: type,
                 select: type === 'change' ? findNotChangeLeafXmj(select) : select,
-                // gather_qty: type === 'change' ? select.gather_qty : select.contract_qty,
                 ms_id: $('#myTab').find('.active').data('msid') || null,
             };
             // 添加到
@@ -1079,6 +1075,9 @@ $(document).ready(() => {
             };
             if (type === 'noself') {
                 if (isStageSelf) {
+                    data.select.contract_qty = {};
+                    data.select.qc_qty = {};
+                    data.select.qc_minus_qty = {};
                     data.select.gather_qty = {};
                     const ledgerSheet = ledgerSpread.getActiveSheet();
                     const ledgerSelect = SpreadJsObj.getSelectObject(ledgerSheet);

+ 1 - 1
app/public/js/setting_manage.js

@@ -644,7 +644,7 @@ const tenderListSpec = (function(){
             html.push('</div>');
             html.push('<div class="btn-group-table" tid="' + node.id + '">');
             html.push('<a href="javascript:void(0);" name="edit" class="mr-1"><i class="fa fa-pencil fa-fw"></i></a>');
-            const hasStage = node.progress ? node.stage_count > 0 : !!node.lastStage;
+            const hasStage = node.progress ? (node.stage_count > 0 ? true : node.stage_status !== 0) : !!node.lastStage;
             if (!hasStage) {
                 html.push('<a href="javascript:void(0);" name="del" class="mr-1"><i class="fa fa-trash-o fa-fw text-danger"></i></a>');
             } else {

+ 1 - 1
app/service/stage_bills.js

@@ -449,7 +449,7 @@ module.exports = app => {
          * @return {Promise<void>}
          */
         async getStagesData(tid, stage_id_list) {
-            const whereSql = this.ctx.helper.whereSql({tid: tid, sid: stage_id_list.split(',')});
+            const whereSql = this.ctx.helper.whereSql({ tid, sid: stage_id_list.split(',') });
             const sql = 'SELECT Bills.lid, Bills.tid, Bills.sid,' +
                 '    Sum(Bills.contract_qty) As contract_qty, Sum(Bills.contract_tp) As contract_tp,' +
                 '    Sum(Bills.qc_minus_qty) As qc_minus_qty,' +

+ 1 - 0
app/service/tender_cache.js

@@ -41,6 +41,7 @@ module.exports = app => {
                 tender.pre_flow = cache.ledger_flow_pre_info ? JSON.parse(cache.ledger_flow_pre_info) : null;
                 tender.stage_tp = {};
                 tender.stage_count = 0;
+                tender.stage_status = cache.stage_status;
                 tender.progress = {
                     title: '台账',
                     status: auditConst.ledger.tiStatusString[cache.ledger_status],