Przeglądaj źródła

表格导入修改

lucky-lzx 2 lat temu
rodzic
commit
ce85b87400

+ 17 - 12
src/views/orderEntry/orderImport/columns.js

@@ -8,37 +8,37 @@ const columns = [
   },
   {
     prop: "cs1",
-    label: "平台商品编号",
+    label: "其他单号",
     width: "140px",
   },
   {
     prop: "cs2",
-    label: "销售渠道",
+    label: "平台订单下单时间",
     width: "140px",
   },
   {
     prop: "cs3",
-    label: "平台订单下单时间",
+    label: "销售渠道",
     width: "140px",
   },
   {
     prop: "cs4",
-    label: "订单单价",
+    label: "平台商品编号",
     width: "140px",
   },
   {
     prop: "cs5",
-    label: "销售数量",
+    label: "单价(元)",
     width: "140px",
   },
   {
     prop: "cs6",
-    label: "订单总金额",
+    label: "数量",
     width: "140px",
   },
   {
     prop: "cs7",
-    label: "活动名称",
+    label: "优惠前总金额",
     width: "140px",
   },
   {
@@ -48,31 +48,36 @@ const columns = [
   },
   {
     prop: "cs9",
-    label: "优惠后的金额",
+    label: "商品优惠后的金额",
     width: "140px",
   },
   {
     prop: "cs10",
-    label: "收费模式",
+    label: "优惠活动名称",
     width: "140px",
   },
   {
     prop: "cs11",
-    label: "订单备注",
+    label: "收费模式",
     width: "140px",
   },
   {
     prop: "cs12",
-    label: "收货人",
+    label: "订单备注",
     width: "140px",
   },
   {
     prop: "cs13",
-    label: "联系电话",
+    label: "收货人",
     width: "140px",
   },
   {
     prop: "cs14",
+    label: "联系电话",
+    width: "140px",
+  },
+  {
+    prop: "cs15",
     label: "联系地址",
     width: "140px",
   },

+ 15 - 47
src/views/orderEntry/orderImport/index.vue

@@ -69,46 +69,7 @@ export default {
       // 表格 - 列参数
       columns: columns,
 
-      rules: {
-    
-        receipt_quantity: [
-          {
-            required: true,
-            validator: validateWeight,
-            trigger: "blur",
-          },
-        ],
 
-        contactor: [
-          {
-            required: true,
-            trigger: "blur",
-            message: "联系人不能为空",
-          },
-        ],
-        mobile: [
-          {
-            required: true,
-            validator: validatemobile,
-            trigger: "blur",
-          },
-        ],
-        addr_code: [
-          {
-            type: "array",
-            required: true,
-            message: "收货省市区不能为空",
-            trigger: "change",
-          },
-        ],
-        addr: [
-          {
-            required: true,
-            message: "详细地址不能为空",
-            trigger: "blur",
-          },
-        ],
-      },
     };
   },
   methods: {
@@ -124,22 +85,23 @@ export default {
       return false;
     },
     handleSuccess({ results, header }) {
-      console.log(results,header)
+      console.log("表格导入数据",results,"表格表头",header)
       if (results.length === 0) {
         this.$message.error("表格无有效数据!");
         return;
       }
       let head = [
         "平台订单号",
-        "平台商品编号",
+        "其他单号(不必填)",
+        "平台下单时间",
         "销售渠道",
-        "平台订单下单时间",
-        "订单单价",
-        "销售数量",
-        "订单总金额",
-        "活动名称",
+        "平台商品编号",
+        "单价(元)",
+        "数量",
+        "优惠前总金额",
         "优惠金额",
-        "优惠后金额",
+        "商品优惠后金额",
+        "优惠活动名称",
         "收费模式",
         "订单备注",
         "收货人",
@@ -147,17 +109,22 @@ export default {
         "联系地址"
       ];
       if (head.length !== header.length) {
+        console.log("自定义head长度",head.length)
+        console.log("表格内数据长度:",header.length)
         this.$message.error("表头与导入模板不匹配!");
         return;
       }
       let hederOk = true;
       head.forEach((v1, i1) => {
         if (v1 !== header[i1].replace(/\s*/g, "")) {
+          console.log(v1)
+          console.log(header[i1])
           hederOk = false;
         }
       });
 
       if (!hederOk) {
+        console.log(hederOk)
         this.$message.error("表头与导入模板不匹配!");
         return;
       }
@@ -187,6 +154,7 @@ export default {
           cs12: b[12] + "",
           cs13: b[13] + "",
           cs14: b[14] + "",
+          cs15: b[15] + "",
           
         };
         console.log(model)