Browse Source

变更已调用清单不参与右键计价

ellisran 1 year ago
parent
commit
8de8c3772d

+ 1 - 1
app/controller/change_controller.js

@@ -964,7 +964,7 @@ module.exports = app => {
                         await ctx.service.changeAuditList.changeOrder(data.postData);
                         break;
                     case 'set_all_valuation':
-                        await ctx.service.changeAuditList.setAllValuation(ctx.change.cid, data.is_valuation);
+                        await ctx.service.changeAuditList.setAllValuation(ctx.change.cid, data.ids, data.is_valuation);
                         // 取所有工料表
                         responseData.data = await ctx.service.changeAuditList.getList(ctx.change.cid);
                         break;

+ 11 - 1
app/public/js/change_information_set.js

@@ -767,7 +767,17 @@ $(document).ready(() => {
                 toastr.warning('全部清单已设置清单'+ (is_valuation ? '' : '不') +'计价');
                 return;
             }
-            postData(window.location.pathname + '/save', { type:'set_all_valuation', is_valuation }, function (result) {
+            const realNeedChangeList = [];
+            for (const nc of needChangeList) {
+                if (_.findIndex(changeUsedData, { cbid: nc.id }) === -1) {
+                    realNeedChangeList.push(nc.id);
+                }
+            }
+            if (realNeedChangeList.length === 0) {
+                toastr.warning('全部清单已设置清单'+ (is_valuation ? '' : '不') +'计价');
+                return;
+            }
+            postData(window.location.pathname + '/save', { type:'set_all_valuation', ids: realNeedChangeList, is_valuation }, function (result) {
                 changeList = result;
                 SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
                 changeSpreadObj.makeSjsFooter();

+ 2 - 1
app/service/change_audit_list.js

@@ -1041,10 +1041,11 @@ module.exports = app => {
             }
         }
 
-        async setAllValuation(cid, is_valuation) {
+        async setAllValuation(cid, ids, is_valuation) {
             return await this.db.update(this.tableName, { is_valuation }, {
                 where: {
                     cid,
+                    id: ids,
                 },
             });
         }