瀏覽代碼

单价调整相关

MaiXinRong 1 年之前
父節點
當前提交
1f9be81459
共有 1 個文件被更改,包括 11 次插入5 次删除
  1. 11 5
      app/public/js/revise_price.js

+ 11 - 5
app/public/js/revise_price.js

@@ -268,18 +268,24 @@ $(document).ready(() => {
             });
         },
         addRevisePrices(datas) {
+            if (datas.length === 0) {
+                toastr.warning('请选择需要调整单价的清单');
+                return;
+            }
+
             const add = [];
             for (const data of datas) {
                 const op = revisePrice.data.find(x => {
                     return x.b_code === data.b_code && x.name === x.name && x.unit === x.unit && checkZero(ZhCalc.sub(x.org_price, data.unit_price)) && (!x.rela_lid || !x.rela_cid);
                 });
-                if (op) {
-                    toastr.warning('已存在该单价调整');
-                    SpreadJsObj.locateData(priceSheet, op);
-                    return;
-                }
+                if (op) continue;
                 add.push({ b_code: data.b_code, name: data.name, unit: data.unit, unit_price: data.unit_price });
             }
+            if (add.length === 0) {
+                toastr.warning('已存在该单价调整');
+                return;
+            }
+
             postData(window.location.pathname + '/update', { add }, result => {
                 revisePrice.loadUpdateData(result);
                 SpreadJsObj.reLoadSheetData(priceSheet);