Quellcode durchsuchen

导入去重锁

lucky-lzx vor 2 Jahren
Ursprung
Commit
13bc645825
1 geänderte Dateien mit 11 neuen und 2 gelöschten Zeilen
  1. 11 2
      src/views/orderEntry/orderImport/index.vue

+ 11 - 2
src/views/orderEntry/orderImport/index.vue

@@ -23,6 +23,7 @@ import asyncRequest from "@/apis/service/orderEntry/orderImport";
 import resToken from "@/mixins/resToken";
 import resToken from "@/mixins/resToken";
 import { province_list, city_list, county_list } from "@/assets/js/area-data";
 import { province_list, city_list, county_list } from "@/assets/js/area-data";
 import { columns } from "./columns";
 import { columns } from "./columns";
+import { set } from 'js-cookie';
 export default {
 export default {
   mixins: [resToken],
   mixins: [resToken],
   data() {
   data() {
@@ -162,7 +163,7 @@ export default {
       const model = {
       const model = {
         list: this.tableData,
         list: this.tableData,
       };
       };
-
+    
       let obj = [
       let obj = [
         { name: "平台订单号", str: "platform_code" },
         { name: "平台订单号", str: "platform_code" },
         { name: "销售渠道", str: "sale_source" },
         { name: "销售渠道", str: "sale_source" },
@@ -173,7 +174,10 @@ export default {
         { name: "联系地址", str: "addr" },
         { name: "联系地址", str: "addr" },
       ];
       ];
       let flag = true;
       let flag = true;
+      let platform_code_arr = [];
       model.list.forEach((item, index) => {
       model.list.forEach((item, index) => {
+        platform_code_arr.push(item.platform_code)
+        //必填判断
         if (flag) {
         if (flag) {
         } else {
         } else {
           return;
           return;
@@ -189,7 +193,12 @@ export default {
           }
           }
         }
         }
       });
       });
-      
+
+      //去重锁
+      if(platform_code_arr.length != Array.from(new Set(platform_code_arr)).length){
+        this.$message.warning(`平台订单号不能重复`);
+        return;
+      }
       if(flag){
       if(flag){
         this.submitHttp(model)
         this.submitHttp(model)
       }
       }