Bladeren bron

调差一些bug修复

laiguoran 3 jaren geleden
bovenliggende
commit
e0f4240ea8
2 gewijzigde bestanden met toevoegingen van 6 en 9 verwijderingen
  1. 2 1
      app/controller/material_controller.js
  2. 4 8
      app/public/js/material_list.js

+ 2 - 1
app/controller/material_controller.js

@@ -732,7 +732,8 @@ module.exports = app => {
                     msg: '',
                     data: {},
                 };
-                if (ctx.session.sessionProject.page_show.openMaterialChecklist && ctx.app._.indexOf(['join', 'notjoin', 'self', 'noself', 'useOther'], data.type) === -1) {
+                const notControlList = ['join', 'notjoin', 'self', 'noself', 'useOther', 'add', 'del', 'update', 'paste'];
+                if (ctx.session.sessionProject.page_show.openMaterialChecklist && ctx.app._.indexOf(notControlList, data.type) === -1) {
                     throw '清单设置功能已启动,请前往清单设置页操作清单内容';
                 }
                 switch (data.type) {

+ 4 - 8
app/public/js/material_list.js

@@ -457,7 +457,7 @@ $(document).ready(() => {
             if (type === 'del') {
                 flag = data.order === stage_order;
             }
-            return flag && !openMaterialChecklist;
+            return flag;
         }
     };
 
@@ -654,8 +654,6 @@ $(document).ready(() => {
                     type: type,
                     select: type === 'join' ? findNotJoinLeafXmj(select) : select,
                 };
-                console.log(iGclRow, iRow, nRow, select);
-                console.log(materialList);
                 // 添加到
                 postData(window.location.pathname + '/save', data, function (result) {
                     if (type === 'join') {
@@ -668,7 +666,7 @@ $(document).ready(() => {
                     calculateJiaCha(gclGatherData, iGclRow);
                     SpreadJsObj.reLoadRowData(sheet, nRow);
                     sheet.getRange(nRow, -1, 1, -1).backColor(color);
-                    loadMaterialData(iGclRow, 0);
+                    loadMaterialData(iGclRow);
                     SpreadJsObj.reLoadRowData(ledgerSpread.getActiveSheet(), iGclRow);
                 });
             },
@@ -679,8 +677,6 @@ $(document).ready(() => {
                     type: type,
                     select: type === 'noself' ? findSelfLeafXmj(select) : select,
                 };
-                console.log(iGclRow, iRow, nRow, select);
-                console.log(materialList);
                 // 添加到
                 postData(window.location.pathname + '/save', data, function (result) {
                     if (type === 'noself') {
@@ -716,10 +712,10 @@ $(document).ready(() => {
                         const sheet = leafXmjSpread.getActiveSheet();
                         const select = SpreadJsObj.getSelectObject(sheet);
                         const sel = sheet.getSelections()[0];
-                        const notx = findNotJoinLeafXmj(select);
                         if (!select || sel.rowCount !== 1) {
                             return false;
                         }
+                        const notx = findNotJoinLeafXmj(select);
                         if (!readOnly && select && notx === undefined) {
                             return true;
                         } else {
@@ -737,10 +733,10 @@ $(document).ready(() => {
                         const sheet = leafXmjSpread.getActiveSheet();
                         const select = SpreadJsObj.getSelectObject(sheet);
                         const sel = sheet.getSelections()[0];
-                        const notx = findNotJoinLeafXmj(select);
                         if (!select || sel.rowCount !== 1) {
                             return false;
                         }
+                        const notx = findNotJoinLeafXmj(select);
                         if (!readOnly && select && notx === undefined) {
                             return false;
                         } else {