浏览代码

永久材料排序调整

MaiXinRong 10 月之前
父节点
当前提交
3db4fba57f
共有 2 个文件被更改,包括 8 次插入3 次删除
  1. 7 2
      app/public/js/se_yjcl.js
  2. 1 1
      app/service/stage_yjcl.js

+ 7 - 2
app/public/js/se_yjcl.js

@@ -118,6 +118,9 @@ $(document).ready(() => {
             this.calculateAll();
             this.resortData();
         }
+        getMaxOrder() {
+            return this.data.length > 0 ? this.data[this.data.length - 1].m_order : 0;
+        }
     }
     const yjclObj = new Yjcl();
 
@@ -212,6 +215,7 @@ $(document).ready(() => {
                 const node = info.sheet.zh_data[info.row];
                 const col = info.sheet.zh_setting.cols[info.col];
                 const data = {};
+                const maxOrder = yjclObj.getMaxOrder();
 
                 if (node) {
                     data.update = {};
@@ -231,7 +235,7 @@ $(document).ready(() => {
                         return;
                     }
                     data.add = {};
-                    data.add.m_order = info.row + 1;
+                    data.add.m_order = maxOrder + 1;
                     data.add.name = trimInvalidChar(info.editingText);
                 }
 
@@ -286,6 +290,7 @@ $(document).ready(() => {
                 };
 
                 const uDatas = [], iDatas = [];
+                const maxOrder = yjclObj.getMaxOrder();
                 for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
                     const curRow = info.cellRange.row + iRow;
                     const node = sortData[curRow];
@@ -317,7 +322,7 @@ $(document).ready(() => {
                             data.id = node.id;
                             uDatas.push(data);
                         } else {
-                            data.m_order = curRow + 1;
+                            data.m_order = maxOrder + iDatas.length + 1;
                             iDatas.push(data);
                         }
                     }

+ 1 - 1
app/service/stage_yjcl.js

@@ -212,7 +212,7 @@ module.exports = app => {
             }
             const preDatas = await this.getAllDataByCondition({
                 columns: ['uuid', 'add_sid', 'add_sorder', 'add_uid', 'tid', 'name', 'm_order', 'unit', 'tax', 'arrive_time', 'source', 'bills_code', 'location', 'prepare_pos', 'memo',
-                    'arrive_qty', 'deduct_qty', 'unit_price', 'ex_tax_tp', 'qty', 'tp', 'pre_qty', 'pre_tp', 'pre_used'],
+                    'arrive_qty', 'arrive_tp', 'unit_price', 'ex_tax_up', 'qty', 'tp', 'pre_qty', 'pre_tp', 'pre_used'],
                 where: { sid: preStage.id },
             });
             if (preDatas.length > 0) {