浏览代码

修复调差bug

laiguoran 3 年之前
父节点
当前提交
cbf76203e7
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 1 1
      app/public/js/material_list.js
  2. 3 3
      app/service/material_list.js

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

@@ -454,7 +454,7 @@ $(document).ready(() => {
 
 
 
 
         // 上传到数据库
         // 上传到数据库
-        console.log(datas, gcl);
+        console.log(datas, gcl, mb_id);
         postData(window.location.pathname + '/save', {type: 'adds', postData: {xmjs: datas, mbIds: mb_id}}, function (result) {
         postData(window.location.pathname + '/save', {type: 'adds', postData: {xmjs: datas, mbIds: mb_id}}, function (result) {
             materialListData = result;
             materialListData = result;
             // toastr.success('已成功应用');
             // toastr.success('已成功应用');

+ 3 - 3
app/service/material_list.js

@@ -366,7 +366,7 @@ module.exports = app => {
                             };
                             };
                             list.push(newLists);
                             list.push(newLists);
                         }
                         }
-                        if (this._.findIndex(listGcl, {gcl_id: xmj.gcl_id}) === -1) {
+                        if (this._.findIndex(listGcl, { gcl_id: xmj.gcl_id, mb_id: mb }) === -1) {
                             const newListGcl = {
                             const newListGcl = {
                                 tid: this.ctx.tender.id,
                                 tid: this.ctx.tender.id,
                                 order: this.ctx.material.order,
                                 order: this.ctx.material.order,
@@ -548,8 +548,8 @@ module.exports = app => {
                             listGcl.push(xmj.gcl_id);
                             listGcl.push(xmj.gcl_id);
                             updateListGcl.push({
                             updateListGcl.push({
                                 row: {
                                 row: {
-                                    expr: datas.expr,
-                                    quantity: datas.quantity,
+                                    expr: data.expr,
+                                    quantity: data.quantity,
                                 },
                                 },
                                 where: {
                                 where: {
                                     tid: this.ctx.tender.id,
                                     tid: this.ctx.tender.id,