Browse Source

台账修订,单价只读判断调整

MaiXinRong 3 năm trước cách đây
mục cha
commit
60631b5ab6
2 tập tin đã thay đổi với 1 bổ sung25 xóa
  1. 0 24
      app/controller/revise_controller.js
  2. 1 1
      app/service/stage_bills.js

+ 0 - 24
app/controller/revise_controller.js

@@ -338,30 +338,6 @@ module.exports = app => {
             const renderData = await this._getDefaultReviseInfoData(ctx, revise);
             // 台账只读、使用数据
             renderData.readOnly = false;
-            // const lastStage = await ctx.service.stage.getLastestStage(ctx.tender.id, true);
-            // if (lastStage) {
-            //     if (lastStage.status === audit.stage.status.checked) {
-            //         const usedPreBills = await ctx.service.stageBillsFinal.getUsedBills(ctx.tender.id, lastStage.order);
-            //         for (const b of renderData.reviseBills) {
-            //             b.used = usedPreBills.indexOf(b.id) >= 0;
-            //         }
-            //         const usedPrePos = await ctx.service.stagePosFinal.getUsedPos(ctx.tender.id, lastStage.order);
-            //         for (const p of renderData.revisePos) {
-            //             p.used = usedPrePos.indexOf(p.id) >= 0;
-            //         }
-            //     } else {
-            //         const usedPreBills = lastStage.order > 1 ? await ctx.service.stageBillsFinal.getUsedBills(ctx.tender.id, lastStage.order - 1) : [];
-            //         const usedCurBills = await ctx.service.stageBills.getStageUsedBills(ctx.tender.id, lastStage.id);
-            //         for (const b of renderData.reviseBills) {
-            //             b.used = usedPreBills.indexOf(b.id) >= 0 || usedCurBills.indexOf(b.id) >= 0;
-            //         }
-            //         const usedPrePos = lastStage.order > 1 ? await ctx.service.stagePosFinal.getUsedPos(ctx.tender.id, lastStage.order - 1) : [];
-            //         const usedCurPos = await ctx.service.stagePos.getStageUsedPos(ctx.tender.id, lastStage.id);
-            //         for (const p of renderData.revisePos) {
-            //             p.used = usedPrePos.indexOf(p.id) >= 0 || usedCurPos.indexOf(p.id) >= 0;
-            //         }
-            //     }
-            // }
             // 修订历史
             renderData.history = false;
             renderData.historyRevise = [];

+ 1 - 1
app/service/stage_bills.js

@@ -127,7 +127,7 @@ module.exports = app => {
         }
 
         async getStageUsedBills(tid, sid) {
-            const sql = 'SELECT Bills.lid, ((not IsNull(Bills.contract_qty) and Bills.contract_qty <> 0) or (not IsNull(Bills.qc_qty) and Bills.qc_qty <> 0)) As used' +
+            const sql = 'SELECT Bills.lid, ((not IsNull(Bills.contract_qty) and Bills.contract_qty <> 0) or (not IsNull(Bills.contract_tp) and Bills.contract_tp <> 0) or (not IsNull(Bills.qc_qty) and Bills.qc_qty <> 0) or (not IsNull(Bills.qc_tp) and Bills.qc_tp <> 0)) As used' +
                 '  FROM ' + this.tableName + ' As Bills ' +
                 '  INNER JOIN ( ' +
                 '    SELECT MAX(`times` * ' + timesLen + ' + `order`) As `progress`, `lid`, `sid` From ' + this.tableName +