浏览代码

修复新建期单独的数据bug

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

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

@@ -455,6 +455,7 @@ $(document).ready(() => {
             selfSheet.setCellType(1, 3, new TipCellType(), spreadNS.SheetArea.colHeader);
             selfSheet.resumePaint();
             checkNotJoinMaterialData();
+            ledgerSpread.getActiveSheet().setSelection(0, 0, 1, 1);
         }
     }
 

+ 2 - 3
app/public/js/measure_material.js

@@ -327,9 +327,9 @@ $(function () {
                     for (const one of insertGcl) {
                         if (one.leafXmjs && one.leafXmjs.length > 0) {
                             for (const xmj of one.leafXmjs) {
-                                const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null }) !== -1;// 区分单独计量的明细工料含量
+                                const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' }) !== -1;// 区分单独计量的明细工料含量
                                 if (is_self) {
-                                    const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null });
+                                    const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : '' });
                                     for (const bill of billsList) {
                                         if (!_.find(hadQtySelfList, bill)) {
                                             hadQtySelfList.push(bill);
@@ -415,7 +415,6 @@ $(function () {
                             const is_self = _.findIndex(selfList, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null }) !== -1;// 区分单独计量的明细工料含量
                             if (is_self) {
                                 const billsList = _.filter(materialListForSelf, { gcl_id: xmj.gcl_id, xmj_id: xmj.id, mx_id: xmj.mx_id ? xmj.mx_id : null });
-                                console.log(billsList);
                                 for (const bill of billsList) {
                                     hadQtySelfList.push(bill);
                                     insertSelfList.push({