瀏覽代碼

甲供材料、其他,删除判断问题

MaiXinRong 4 年之前
父節點
當前提交
86179d69cc
共有 4 個文件被更改,包括 7 次插入4 次删除
  1. 1 1
      app/public/js/se_jgcl.js
  2. 1 1
      app/public/js/se_other.js
  3. 3 1
      app/service/stage_jgcl.js
  4. 2 1
      app/service/stage_other.js

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

@@ -224,7 +224,7 @@ $(document).ready(() => {
 
                 for (let iRow = sels[0].row, iLen = sels[0].row + sels[0].rowCount; iRow < iLen; iRow++) {
                     const node = sortData[iRow];
-                    if (node.pre_used) {
+                    if (node.pre_used || !checkZero(node.end_arrive_qty) || !checkZero(node.end_deduct_qty)) {
                         toastMessageUniq(hint.isOld);
                         continue;
                     } else {

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

@@ -230,7 +230,7 @@ $(document).ready(() => {
 
                 for (let iRow = sels[0].row, iLen = sels[0].row + sels[0].rowCount; iRow < iLen; iRow++) {
                     const node = sortData[iRow];
-                    if (node.pre_used) {
+                    if (node.pre_used || !checkZero(node.end_tp)) {
                         toastMessageUniq(hint.isOld);
                         continue;
                     } else {

+ 3 - 1
app/service/stage_jgcl.js

@@ -223,12 +223,14 @@ module.exports = app => {
                 throw '标段数据有误';
             }
             const preDatas = await this.getAllDataByCondition({
-                columns: ['uuid', 'name', 'unit', 'unit_price', 'source', 'bills_code', 'check_code', 'memo', 'add_uid', 'add_sid', 'order'],
+                columns: ['uuid', 'name', 'unit', 'unit_price', 'source', 'bills_code', 'check_code', 'memo', 'add_uid', 'add_sid', 'order', 'arrive_qty', 'deduct_qty'],
                 where: { sid: preStage.id },
             });
             if (preDatas.length > 0) {
                 for (const pd of preDatas) {
                     pd.pre_used = pd.pre_used || !this.ctx.helper.checkZero(pd.arrive_qty) || !this.ctx.helper.checkZero(pd.deduct_qty);
+                    delete pd.arrive_qty;
+                    delete pd.deduct_qty;
                     pd.sid = stage.id;
                 }
                 const result = await transaction.insert(this.tableName, preDatas);

+ 2 - 1
app/service/stage_other.js

@@ -192,12 +192,13 @@ module.exports = app => {
                 throw '标段数据有误';
             }
             const preDatas = await this.getAllDataByCondition({
-                columns: ['uuid', 'tid', 'add_uid', 'add_sid', 'add_time', 'name', 'o_type', 'total_price', 'order', 'memo', 'real_time'],
+                columns: ['uuid', 'tid', 'add_uid', 'add_sid', 'add_time', 'name', 'o_type', 'tp', 'total_price', 'order', 'memo', 'real_time'],
                 where: { sid: preStage.id }
             });
             if (preDatas.length > 0) {
                 for (const pd of preDatas) {
                     pd.pre_used = pd.pre_used || !this.ctx.helper.checkZero(pd.tp);
+                    delete pd.tp;
                     pd.sid = stage.id;
                     pd.sorder = stage.order;
                 }