daiyanrong 3 lat temu
rodzic
commit
f638a61d5a
46 zmienionych plików z 253 dodań i 328 usunięć
  1. 0 0
      dist/index.html
  2. 0 0
      dist/static/css/app.69a9362c.css
  3. BIN
      dist/static/css/app.69a9362c.css.gz
  4. 0 0
      dist/static/css/app.dae04d70.css
  5. BIN
      dist/static/css/app.dae04d70.css.gz
  6. 0 0
      dist/static/css/chunk-410924d4.86e74fb0.css
  7. 0 0
      dist/static/css/chunk-6c647578.29b97e65.css
  8. 0 0
      dist/static/css/chunk-73ede65c.7a8d88c0.css
  9. 0 0
      dist/static/css/chunk-920fca46.7638e7d1.css
  10. 0 0
      dist/static/css/chunk-d1023eaa.f326e645.css
  11. 0 0
      dist/static/css/chunk-f0f44a88.c400605d.css
  12. 0 0
      dist/static/js/app.488d6c82.js
  13. BIN
      dist/static/js/app.488d6c82.js.gz
  14. 0 0
      dist/static/js/app.fe81fcae.js
  15. BIN
      dist/static/js/app.fe81fcae.js.gz
  16. 0 1
      dist/static/js/chunk-00b166e3.5a5cf40e.js
  17. 0 0
      dist/static/js/chunk-02a3c4d8.4e9c05d8.js
  18. 1 1
      dist/static/js/chunk-410924d4.4b25a253.js
  19. 0 0
      dist/static/js/chunk-647837dc.fe617167.js
  20. BIN
      dist/static/js/chunk-647837dc.fe617167.js.gz
  21. 0 0
      dist/static/js/chunk-6c647578.fad6a9a9.js
  22. BIN
      dist/static/js/chunk-6c647578.fad6a9a9.js.gz
  23. 0 0
      dist/static/js/chunk-711f7760.ad6e0853.js
  24. BIN
      dist/static/js/chunk-711f7760.ad6e0853.js.gz
  25. 0 0
      dist/static/js/chunk-73ede65c.d55a1d95.js
  26. 0 0
      dist/static/js/chunk-745ae29d.a2e8c277.js
  27. BIN
      dist/static/js/chunk-745ae29d.a2e8c277.js.gz
  28. 0 0
      dist/static/js/chunk-7e70f35b.51a1fb4f.js
  29. BIN
      dist/static/js/chunk-7e70f35b.51a1fb4f.js.gz
  30. 0 0
      dist/static/js/chunk-8d40dce4.a43f7b7c.js
  31. 1 0
      dist/static/js/chunk-920fca46.133cee2a.js
  32. 0 0
      dist/static/js/chunk-d1023eaa.65005bf4.js
  33. BIN
      dist/static/js/chunk-d1023eaa.65005bf4.js.gz
  34. 0 0
      dist/static/js/chunk-elementUI.0a6ce017.js
  35. BIN
      dist/static/js/chunk-elementUI.0a6ce017.js.gz
  36. 0 0
      dist/static/js/chunk-elementUI.9dedfe29.js
  37. BIN
      dist/static/js/chunk-elementUI.9dedfe29.js.gz
  38. 0 0
      dist/static/js/chunk-f0f44a88.b3f6e5bc.js
  39. 0 0
      dist/static/js/chunk-libs.07ac3f76.js
  40. BIN
      dist/static/js/chunk-libs.07ac3f76.js.gz
  41. 0 0
      dist/static/js/chunk-libs.55c3c8c7.js
  42. BIN
      dist/static/js/chunk-libs.55c3c8c7.js.gz
  43. 5 1
      src/apis/service/mobile/order/index.js
  44. 40 40
      src/views/mobile/order/columns.js
  45. 200 284
      src/views/mobile/order/inPostModel.vue
  46. 6 1
      src/views/mobile/order/index.vue

Plik diff jest za duży
+ 0 - 0
dist/index.html


Plik diff jest za duży
+ 0 - 0
dist/static/css/app.69a9362c.css


BIN
dist/static/css/app.69a9362c.css.gz


Plik diff jest za duży
+ 0 - 0
dist/static/css/app.dae04d70.css


BIN
dist/static/css/app.dae04d70.css.gz


+ 0 - 0
dist/static/css/chunk-11441a0f.86e74fb0.css → dist/static/css/chunk-410924d4.86e74fb0.css


+ 0 - 0
dist/static/css/chunk-7e70f35b.29b97e65.css → dist/static/css/chunk-6c647578.29b97e65.css


+ 0 - 0
dist/static/css/chunk-8d40dce4.7a8d88c0.css → dist/static/css/chunk-73ede65c.7a8d88c0.css


+ 0 - 0
dist/static/css/chunk-00b166e3.7638e7d1.css → dist/static/css/chunk-920fca46.7638e7d1.css


+ 0 - 0
dist/static/css/chunk-745ae29d.f326e645.css → dist/static/css/chunk-d1023eaa.f326e645.css


+ 0 - 0
dist/static/css/chunk-02a3c4d8.c400605d.css → dist/static/css/chunk-f0f44a88.c400605d.css


Plik diff jest za duży
+ 0 - 0
dist/static/js/app.488d6c82.js


BIN
dist/static/js/app.488d6c82.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/app.fe81fcae.js


BIN
dist/static/js/app.fe81fcae.js.gz


+ 0 - 1
dist/static/js/chunk-00b166e3.5a5cf40e.js

@@ -1 +0,0 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-00b166e3"],{"0aa1":function(t,n,a){"use strict";a("23a8")},"1db4":function(t,n,a){"use strict";a.r(n);var s=[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticClass:"wscn-http404-container"},[t("div",{staticClass:"wscn-http404"},[t("img",{attrs:{src:a("a8f0"),alt:""}})])])}],e={name:"Page404"},c=(a("0aa1"),a("2877"));s=Object(c.a)(e,(function(){var t=this;t.$createElement;return t._self._c,t._m(0)}),s,!1,null,"612dd7f5",null);n.default=s.exports},"23a8":function(t,n,a){},a8f0:function(t,n,a){t.exports=a.p+"static/img/404.3550f437.jpg"}}]);

Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-02a3c4d8.4e9c05d8.js


+ 1 - 1
dist/static/js/chunk-11441a0f.c62c6895.js → dist/static/js/chunk-410924d4.4b25a253.js

@@ -1 +1 @@
-(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-11441a0f"],{9406:function(t,a,n){"use strict";n.r(a),n("2f62");var e={name:"dashboard",data:function(){return{}},created:function(){}};n("acb2"),n=n("2877"),e=Object(n.a)(e,(function(){var t=this;t.$createElement;return t._self._c,t._m(0)}),[function(){var t=this,a=t.$createElement;a=t._self._c||a;return a("div",{staticClass:"dashboard-container"},[a("div",{staticClass:"dashboard-editor-container"},[a("div",{staticClass:"info-container clearfix"},[a("span",{staticClass:"welcome-title"},[t._v("欢迎登录")]),a("span",{staticClass:"welcome-title"},[t._v("藏金1745管理系统运营端")])])])])}],!1,null,"3cb964a2",null);a.default=e.exports},acb2:function(t,a,n){"use strict";n("b715")},b715:function(t,a,n){}}]);
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-410924d4"],{9406:function(t,a,n){"use strict";n.r(a),n("2f62");var e={name:"dashboard",data:function(){return{}},created:function(){}};n("acb2"),n=n("2877"),n=Object(n.a)(e,(function(){var t=this;t.$createElement;return t._self._c,t._m(0)}),[function(){var t=this,a=t.$createElement;a=t._self._c||a;return a("div",{staticClass:"dashboard-container"},[a("div",{staticClass:"dashboard-editor-container"},[a("div",{staticClass:"info-container clearfix"},[a("span",{staticClass:"welcome-title"},[t._v("欢迎登录")]),a("span",{staticClass:"welcome-title"},[t._v("藏金1745管理系统运营端")])])])])}],!1,null,"3cb964a2",null);a.default=n.exports},acb2:function(t,a,n){"use strict";n("f30a")},f30a:function(t,a,n){}}]);

Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-647837dc.fe617167.js


BIN
dist/static/js/chunk-647837dc.fe617167.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-6c647578.fad6a9a9.js


BIN
dist/static/js/chunk-6c647578.fad6a9a9.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-711f7760.ad6e0853.js


BIN
dist/static/js/chunk-711f7760.ad6e0853.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-73ede65c.d55a1d95.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-745ae29d.a2e8c277.js


BIN
dist/static/js/chunk-745ae29d.a2e8c277.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-7e70f35b.51a1fb4f.js


BIN
dist/static/js/chunk-7e70f35b.51a1fb4f.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-8d40dce4.a43f7b7c.js


+ 1 - 0
dist/static/js/chunk-920fca46.133cee2a.js

@@ -0,0 +1 @@
+(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-920fca46"],{"0aa1":function(t,n,a){"use strict";a("9711")},"1db4":function(t,n,a){"use strict";a.r(n);var s=[function(){var t=this.$createElement;t=this._self._c||t;return t("div",{staticClass:"wscn-http404-container"},[t("div",{staticClass:"wscn-http404"},[t("img",{attrs:{src:a("a8f0"),alt:""}})])])}],c={name:"Page404"},e=(a("0aa1"),a("2877"));e=Object(e.a)(c,(function(){var t=this;t.$createElement;return t._self._c,t._m(0)}),s,!1,null,"612dd7f5",null);n.default=e.exports},9711:function(t,n,a){},a8f0:function(t,n,a){t.exports=a.p+"static/img/404.3550f437.jpg"}}]);

Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-d1023eaa.65005bf4.js


BIN
dist/static/js/chunk-d1023eaa.65005bf4.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-elementUI.0a6ce017.js


BIN
dist/static/js/chunk-elementUI.0a6ce017.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-elementUI.9dedfe29.js


BIN
dist/static/js/chunk-elementUI.9dedfe29.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-f0f44a88.b3f6e5bc.js


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-libs.07ac3f76.js


BIN
dist/static/js/chunk-libs.07ac3f76.js.gz


Plik diff jest za duży
+ 0 - 0
dist/static/js/chunk-libs.55c3c8c7.js


BIN
dist/static/js/chunk-libs.55c3c8c7.js.gz


+ 5 - 1
src/apis/service/mobile/order/index.js

@@ -9,6 +9,10 @@ export default {
   post: (data, params) => http(api + 'orderdelivery', data, 'post', params),
   // 获取启用物流
   exquery: (data, params) => http(api + 'expressquery', data, 'post', params),
-  // 获取启用物流
+  // 获取启用物流 线下物流状态
   orderexpress: (data, params) => http(api + 'orderexpress', data, 'post', params),
+  // 快递列表
+  expresslist: (data, params) => http(api + 'expresslist', data, 'post', params),
+  // 批量导入物流信息
+  updateOrder: (data, params) => http(api + 'updateOrder', data, 'post', params),
 }

+ 40 - 40
src/views/mobile/order/columns.js

@@ -66,81 +66,81 @@ const columns = [
     },
 ]
 const postColumns = [
+
     {
-        prop: "value",
+        prop: "value1",
         label: "订单编号",
-        width: "140px",
+        width: "155px",
     },
     {
-        prop: "value",
-        label: "订单数量",
-        width: "140px",
+        prop: "value5",
+        label: "发货状态",
+        width: "70px",
     },
     {
-        prop: "value",
-        label: "下单时间",
-        width: "140px",
+        prop: "value4",
+        label: "商品名称",
+        width: "115px",
     },
     {
-        prop: "value",
-        label: "商品名称",
-        width: "140px",
+        prop: "value2",
+        label: "订单数量",
+        width: "70px",
     },
     {
-        prop: "value",
-        label: "发货状态",
-        width: "140px",
+        prop: "value8",
+        label: "导入快递公司",
+        width: "95px",
     },
     {
-        prop: "value",
-        label: "发货时间",
-        width: "140px",
+        prop: "value0",
+        label: "系统解析快递公司",
+        width: "120px",
     },
-
     {
-        prop: "value",
+        prop: "value7",
         label: "快递编号",
         width: "140px",
     },
     {
-        prop: "value",
-        label: "导入快递公司",
-        width: "140px",
+        prop: "value6",
+        label: "发货时间",
+        width: "145px",
     },
     {
-        prop: "value",
-        label: "系统解析快递公司",
-        width: "140px",
+        prop: "value11",
+        label: "收货人",
+        width: "60px",
     },
     {
-        prop: "value",
-        label: "账户名",
-        width: "140px",
+        prop: "value12",
+        label: "收货电话",
+        width: "100px",
     },
     {
-        prop: "value",
+        prop: "value10",
         label: "收货地址",
-        width: "140px",
+        'min-width': "150px",
     },
     {
-        prop: "value",
-        label: "收货人",
-        width: "140px",
+        prop: "value3",
+        label: "下单时间",
+        width: "145px",
     },
     {
-        prop: "value",
-        label: "收货电话",
-        width: "140px",
+        prop: "value9",
+        label: "账户名",
+        width: "130px",
     },
     {
-        prop: "value",
+        prop: "value13",
         label: "用户名",
-        width: "140px",
+        width: "70px",
     },
     {
-        prop: "value",
+        prop: "value14",
         label: "用户电话",
-        width: "140px",
+        width: "100px",
     },
 
 ]

+ 200 - 284
src/views/mobile/order/inPostModel.vue

@@ -15,18 +15,51 @@
     append-to-body
   >
     <el-card style="margin-top: -25px">
-      <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
+      <upload-excel
+        v-show="!hasData"
+        :on-success="handleSuccess"
+        :before-upload="beforeUpload"
+      />
+      <el-row v-show="hasData" :gutter="10" style="margin-bottom: 12px">
+        <el-col :span="3" class="tr" style="height: 28px; line-height: 28px"
+          >选择快递公司:</el-col
+        >
+        <el-col :span="8">
+          <el-select
+            v-model="express"
+            style="width: 100%"
+            :size="'mini'"
+            placeholder="请选择快递公司"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.express_name + item.id"
+              :label="item.express_name"
+              :value="item.express_name"
+            >
+            </el-option> </el-select
+        ></el-col>
+        <el-col :span="3"
+          ><el-button type="primary" :size="'mini'" @click="batch_set()"
+            >批量设置快递公司</el-button
+          ></el-col
+        >
+      </el-row>
       <el-form :model="ruleForm" ref="ruleForm" :size="'mini'">
         <el-table
-          :data="ruleForm.order_addr"
+          :data="order_addr"
+          ref="multipleTable"
+          @selection-change="handleSelectionChange"
           border
           :size="'mini'"
           style="width: 100%"
           max-height="400px"
           row-key="key"
         >
+          <el-table-column align="center" type="selection" width="45">
+          </el-table-column>
           <el-table-column
-            v-for="(si, sii) in postColumns"
+            v-for="(si, sii) in columns"
             :key="si.prop + sii"
             :prop="si.prop"
             :label="si.label"
@@ -34,34 +67,36 @@
             :min-width="si['min-width']"
             show-overflow-tooltip
           />
-          <el-table-column fixed="right" width="80" label="操作">
-            <template slot-scope="scope">
-              <el-tooltip effect="dark" content="编辑" placement="top">
+          <el-table-column fixed="right" width="80">
+            <template slot="header" slot-scope="scope">
+              <span>操作</span>
+              <el-tooltip
+                effect="dark"
+                class="fr"
+                v-show="hasData"
+                content="重新导入"
+                placement="top"
+              >
                 <i
-                  class="el-icon-edit tb-icon"
-                  @click="openHouseModal(scope.$index)"
+                  class="el-icon-brush tb-icon"
+                  style="margin: 3px 0 0 0; font-size: 15px"
+                  @click="resetForm"
                 ></i>
               </el-tooltip>
+            </template>
+            <template slot-scope="scope">
               <el-tooltip effect="dark" content="删除" placement="top">
                 <i
                   class="el-icon-delete tb-icon"
-                  @click="deleteRow(scope.$index, ruleForm.order_addr)"
+                  @click="deleteRow(scope.$index, order_addr)"
                 ></i>
               </el-tooltip>
             </template>
           </el-table-column>
         </el-table>
       </el-form>
-      <!-- <addr-add-edit-modal
-        :showModel="showAddrAddEditModal"
-        :index="AddrAddEditModalIndex"
-        :sitem="AddrAddEditModalSitem"
-        @cancel="showAddrAddEditModal = false"
-        :type="'1'"
-        @refresh="showAddrAddEditModalRefresh"
-      /> -->
       <div class="tr" style="padding: 10px 0 0 0">
-        <el-button type="primary" size="small" @click="submitForm"
+        <el-button type="primary" :size="'mini'" @click="submitForm"
           >保 存
         </el-button>
       </div>
@@ -72,8 +107,10 @@
 // import resToken from "@/mixins/resToken";
 // import { province_list, city_list, county_list } from "@/assets/js/area-data";
 import { isnumber, isMobile } from "@/utils/validate";
+import asyncRequest from "@/apis/service/mobile/order";
 // import AddrAddEditModal from "@/components/addr-add-edit-modal";
 import resToken from "@/mixins/resToken";
+import { postColumns } from "./columns";
 export default {
   name: "inAddrModel",
   props: ["showModel", "id", "sitem"],
@@ -106,60 +143,18 @@ export default {
       showAddrAddEditModal: false,
       AddrAddEditModalIndex: -1,
       AddrAddEditModalSitem: {},
+      options: [],
+      express: "",
       tableData: [],
       tableHeader: [],
-      title: "",
+      hasData: false,
+      title: "批量发货",
       showModelThis: false,
       loading: false,
-      newTime: 0,
-      pickerOptions: {
-        disabledDate: (time) => {
-          return time.getTime() < new Date().valueOf();
-        },
-      },
+      multipleSelection: [],
+      columns: postColumns,
       rulesThis: this.rules,
-      ruleForm: {
-        order_addr: [], //收货地址
-      },
-      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",
-          },
-        ],
-      },
+      order_addr: [], //收货地址
     };
   },
   watch: {
@@ -175,9 +170,7 @@ export default {
       }
     },
   },
-  mounted() {
-    // this.get_code();
-  },
+  mounted() {},
   methods: {
     async resetForm() {
       // 重置
@@ -185,41 +178,59 @@ export default {
         if (this.$refs.ruleForm) {
           this.$refs.ruleForm.resetFields();
           this.$refs.ruleForm.clearValidate();
-          this.ruleForm = {
-            order_addr: [],
-          };
+          this.order_addr = [];
+          this.hasData = false;
+          this.express = "";
         }
       });
     },
-    // 省市区删除行操作
+    // 删除行操作
     deleteRow(index, rows) {
       rows.splice(index, 1);
     },
-    showAddrAddEditModalRefresh(e) {
-      const { index, item } = e;
-
-      if (index === -1) {
-        this.ruleForm.order_addr.push(JSON.parse(JSON.stringify(item)));
+    //选择数据
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
+    },
+    batch_set() {
+      if (this.multipleSelection.length === 0) {
+        this.$message.warning("请选择要设置的订单!");
+        return;
+      }
+      if (this.express === "") {
+        this.$message.warning("请选择快递公司!");
+        return;
+      }
+      this.multipleSelection.forEach((a) => {
+        let findex = this.order_addr.findIndex((b) => b.value1 === a.value1);
+        if (findex !== -1) {
+          this.order_addr[findex].value0 = this.express;
+          this.$set(this.order_addr, findex, this.order_addr[findex]);
+        }
+      });
+    },
+    // 刷新快递公司
+    async get_express() {
+      this.options = [];
+      let model = {
+        status: "1",
+        code: "",
+        express_name: "",
+        page: 1,
+        size: 10000,
+      };
+      const { code, data, message } = await asyncRequest.expresslist(model);
+      if (code === 0) {
+        const { list } = data;
+        console.log(list);
+        this.options = list;
+      } else if (code >= 100 && code <= 104) {
+        await this.logout();
       } else {
-        const {
-          receipt_quantity,
-          contactor,
-          mobile,
-          addr_code,
-          addr_code_name,
-          addr,
-          id,
-        } = JSON.parse(JSON.stringify(item));
-        this.ruleForm.order_addr[index].receipt_quantity = receipt_quantity;
-        this.ruleForm.order_addr[index].contactor = contactor;
-        this.ruleForm.order_addr[index].mobile = mobile;
-        this.ruleForm.order_addr[index].addr_code = addr_code;
-        this.ruleForm.order_addr[index].addr_code_name = addr_code_name;
-        this.ruleForm.order_addr[index].addr = addr;
-        this.ruleForm.order_addr[index].id = id;
+        this.$message.warning(message);
       }
-      this.$refs.ruleForm.validateField("order_addr");
     },
+
     beforeUpload(file) {
       const isLt1M = file.size / 1024 / 1024 < 1;
       if (isLt1M) {
@@ -231,8 +242,8 @@ export default {
       });
       return false;
     },
-    handleSuccess({ results, header }) {
-      console.log(header);
+    async handleSuccess({ results, header }) {
+      // console.log(header);
       if (results.length === 0) {
         this.$message.error("表格无有效数据!");
         return;
@@ -272,126 +283,137 @@ export default {
       this.tableHeader = header;
       this.tableData = [];
       let list = results;
-      let tableOk = true;
-      this.ruleForm.order_addr = [];
-      // list.forEach((v1) => {
-      //   let b = Object.values(v1);
-      //   let item = this.get_code(b[3], b[4], b[5]);
-      //   let model = {
-      //     receipt_quantity: b[0] + "",
-      //     contactor: b[1] + "",
-      //     mobile: b[2] + "",
-      //     in_addr: b[3] + "/" + b[4] + "/" + b[5],
-      //     addr_code_name: item.name + "",
-      //     addr_code: item.code,
-      //     addr: b[6] + "",
-      //     edit: false,
-      //   };
-      //   this.ruleForm.order_addr.push(model);
-      // });
-      if (!tableOk) {
-        this.$message.error("最晚收货日期不正确,请将表格格式转为文本上传!");
+      this.order_addr = [];
+      let resList = [];
+      let repeatList = [];
+      list.forEach((a) => {
+        let Okey = Object.values(a);
+        if (resList.length === 0) {
+          resList.push(Okey[0]);
+        } else {
+          let findex = resList.findIndex((b) => b === Okey[0]);
+          if (findex === -1) {
+            resList.push(Okey[0]);
+          } else {
+            repeatList.push(Okey[0]);
+          }
+        }
+      });
+      const result = Array.from(new Set(repeatList));
+      if (result.length !== 0) {
+        this.show_p(result, "以下订单出现重复!不允许导入!");
+        return;
       }
-    },
-    openHouseModal(index) {
-      this.AddrAddEditModalIndex = index;
+      await this.get_express();
+      list.forEach((v1) => {
+        let b = Object.values(v1);
+        let item = {
+          value0: "",
+        };
+        for (let key = 0; key < b.length; key++) {
+          if (key === 5) {
+            item.value6 = this.setTime(b[key]);
+          } else {
+            item[`value${key + 1}`] = b[key];
+          }
 
-      if (index === -1) {
-        this.AddrAddEditModalSitem = {};
-      } else {
-        this.AddrAddEditModalSitem = JSON.parse(
-          JSON.stringify(this.ruleForm.order_addr[index])
-        );
-      }
-      this.showAddrAddEditModal = true;
-      // let findex = this.ruleForm.order_addr.findIndex((v) => v.edit === true);
-      // if (findex !== -1) {
-      //   this.$message.warning("当前已有地址在编辑,请保存后再试!");
-      //   return;
-      // } else {
-      //   this.ruleForm.order_addr[index].edit = true;
-      // }
-    },
-    unique(arr) {
-      let hash = [];
-      for (let i = 0; i < arr.length; i++) {
-        let index = hash.findIndex((v1) => v1.inv_number === arr[i].inv_number);
-        if (index === -1) {
-          hash.push(arr[i]);
+          if (key === 7) {
+            item.value0 =
+              (this.options.find((item) => item.express_name === b[key]) || {})
+                .express_name || "";
+          }
         }
-      }
-      return hash;
+
+        this.order_addr.push(item);
+      });
+      this.hasData = this.order_addr.length !== 0;
     },
-    setTime(time) {
-      time = time.replace(/\//g, "-");
-      time = time.replace(/\./g, "-");
+
+    setTime(tkey) {
+      let time = tkey;
+      time = (time + "").replace(/\//g, "-");
+      time = (time + "").replace(/\./g, "-");
       let key = new Date(time).valueOf() + "";
+      console.log(time, key);
       if (key.length !== 13) {
         time = "";
       }
       return time;
     },
+    show_p(result, title) {
+      let html = `<ul>`;
+      result.forEach((c) => {
+        html += `<li>${c}</li>`;
+      });
+      html += "</ul>";
+      this.$notify({
+        title: title,
+        dangerouslyUseHTMLString: true,
+        message: html,
+      });
+    },
     async initForm() {
       this.rulesThis = this.rules;
       await this.resetForm();
-      this.newTime = 0;
       this.loading = true;
       this.tableData = [];
       this.tableHeader = [];
       this.step = 1;
-      this.title = "批量导入收货地址信息";
-
-      this.changea();
       this.loading = false;
     },
     refreshAll() {
       this.showModelThis = false;
       this.$emit("refresh");
     },
-    changea() {
-      this.newTime = new Date().valueOf();
-    },
 
     async submitForm() {
       if (!this.loading) {
         this.loading = true;
-        const { order_addr } = this.ruleForm;
-        if (order_addr.length < 1) {
+        if (this.order_addr.length === 0) {
           this.$message.error("导入数据不能为空!");
           this.loading = false;
           return;
         }
-        let isEdit = false;
-        order_addr.forEach((v) => {
-          v.err = false;
-          if (v.edit) {
-            v.err = true;
+        let isEdit = false,
+          list = [];
+        this.order_addr.forEach((v) => {
+          let item = {
+            order_sn: v.value1, //订单编号
+            order_num: v.value2, //订单数量
+            delivery_time: v.value6, //发货时间
+            post_name: v.value0, //快递公司
+            post_code: v.value7, //快递编号
+          };
+          if (v.value0 === "") {
             isEdit = true;
           }
+          list.push(item);
         });
         if (isEdit) {
-          this.$message.error("当前收货地址已在编辑,请保存后再试!");
+          this.$message.error("部分订单未匹配到快递公司。物流编号为空!");
           this.loading = false;
           return;
         }
-        let cItem = null;
-        order_addr.some((x, i) => {
-          cItem = this.checkItem(x);
-          if (!cItem.isok) {
-            cItem.index = i;
-            return true;
-          }
-        });
-        if (cItem && !cItem.isok) {
-          this.$message.error(`第${cItem.index + 1}行,${cItem.message}`);
+        let model = {
+          list: list,
+        };
+        console.log(model);
+        const { code, data, msg } = await asyncRequest.updateOrder(model);
           this.loading = false;
-          return;
+        if (code === 0) {
+         this.showModelThis = false;
+        this.$emit("refresh");
+        } else if (code === 1005 || code === 1006) {
+          this.show_p(data, msg);
+        } else if (code >= 100 && code <= 104) {
+          await this.logout();
+        } else {
+          this.$message.warning(msg);
         }
-        this.loading = false;
-        this.showModelThis = false;
-        let list = JSON.parse(JSON.stringify(order_addr));
-        console.log(list);
-        this.$emit("refresh", { list: list });
+        // 批量导入物流信息
+
+      
+     
       }
     },
     checkItem(sitem) {
@@ -442,115 +464,9 @@ export default {
       }
       return model;
     },
-    // get_code(name1, name2, name3) {
-    //   let name = "",
-    //     code = [];
-    //   if (name1 && name2 && name3) {
-    //     for (let x in province_list) {
-    //       if (name1 === province_list[x]) {
-    //         code.push(x);
-    //         name += province_list[x];
-    //         break;
-    //       }
-    //     }
-    //     if (code.length === 1) {
-    //       for (let y in city_list) {
-    //         if (name2 === city_list[y]) {
-    //           code.push(y);
-    //           name += "/" + city_list[y];
-    //           break;
-    //         }
-    //       }
-    //     }
-    //     if (code.length === 2) {
-    //       for (let z in county_list) {
-    //         if (name3 === county_list[z]) {
-    //           code.push(z);
-    //           name += "/" + county_list[z];
-    //           break;
-    //         }
-    //       }
-    //     }
-
-    //     if (code.length === 3) {
-    //       let str1 = "",
-    //         str2 = "",
-    //         isok = false;
-    //       str1 = code[0].slice(0, 2);
-    //       str2 = code[1].slice(2, 4);
-    //       if (
-    //         code[1].indexOf(str1) === 0 &&
-    //         code[2].indexOf(str1) === 0 &&
-    //         code[2].indexOf(str2) == 2
-    //       ) {
-    //         isok = true;
-    //       }
-    //       if (!isok) {
-    //         name = "";
-    //         code = [];
-    //       }
-    //     } else {
-    //       name = "";
-    //       code = [];
-    //     }
-    //   }
-    //   return { name: name, code: code };
-    // },
   },
 };
 </script>
 
    <style lang="scss" scoped>
-.account {
-  .gongshi {
-    span {
-      vertical-align: top;
-      display: inline-block;
-      color: #000;
-    }
-    .icon-span {
-      padding: 0 5px;
-      height: 40px;
-      line-height: 40px;
-      font-size: 20px;
-      color: #606266;
-      display: inline-block;
-      // vertical-align: top;
-      // display: inline-block;
-    }
-    .label {
-      height: 40px;
-      line-height: 40px;
-    }
-    .tuan {
-      &.chu {
-        width: 60px;
-        height: 40px;
-        display: inline-block;
-        span {
-          width: 60px;
-          display: inline-block;
-          line-height: 20px;
-          text-align: center;
-          font-size: 12px;
-          height: 20px;
-          &:last-child {
-            border-top: 1px solid #606266;
-          }
-        }
-      }
-      &.cheng {
-        .name {
-          height: 40px;
-          line-height: 40px;
-        }
-        .icon-span {
-          line-height: 40px;
-          font-size: 16px;
-          padding: 0 1px;
-        }
-      }
-    }
-  }
-}
 </style>

+ 6 - 1
src/views/mobile/order/index.vue

@@ -172,7 +172,12 @@
     <in-post-model
       :show-model="postModel"
       @cancel="postModel = false"
-      @refresh="postRefresh"
+      @refresh="
+        postModel = false;
+        pageInfo.curr = 1;
+        parmValue.page = 1;
+        searchList();
+      "
     />
   </div>
 </template>

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików