MaiXinRong 5 years ago
parent
commit
8fa572b9c5
1 changed files with 4 additions and 3 deletions
  1. 4 3
      app/public/js/stage.js

+ 4 - 3
app/public/js/stage.js

@@ -1053,14 +1053,15 @@ $(document).ready(() => {
                         self.loadCurPosData();
                         return;
                     }
+                    const lastOrder = sortData.length > 0 ? sortData[sortData.length - 1].porder + 1 : 1;
                     for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
                         const curRow = info.cellRange.row + iRow;
-                        const newData = {lid: node.id};
+                        const newData = {lid: node.id, porder: lastOrder + curRow - sortData.length};
                         for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
                             const curCol = info.cellRange.col + iCol;
                             const colSetting = info.sheet.zh_setting.cols[curCol];
                             newData[colSetting.field] = info.sheet.getText(curRow, curCol);
-                            if (col.type === 'Number') {
+                            if (colSetting.type === 'Number') {
                                 const num = _.toNumber(newData[colSetting.field]);
                                 if (num) {
                                     newData[colSetting.field] = num;
@@ -1089,7 +1090,7 @@ $(document).ready(() => {
                                 const curCol = info.cellRange.col + iCol;
                                 const colSetting = info.sheet.zh_setting.cols[curCol];
                                 newData[colSetting.field] = info.sheet.getText(curRow, curCol);
-                                if (col.type === 'Number') {
+                                if (colSetting.type === 'Number') {
                                     const num = _.toNumber(newData[colSetting.field]);
                                     if (num) {
                                         newData[colSetting.field] = num;