戴艳蓉 vor 3 Jahren
Ursprung
Commit
e22b517489

BIN
public/static/收货地址模板.xlsx


+ 6 - 6
src/apis/service/user/index.js

@@ -7,16 +7,16 @@ export default {
   resetpwd: (data, params) => http(`admin/passmobile`, data, 'post', params),
   // 手机号更换
   resetmobile: (data, params) =>
-    http(`admin/resetmobile`, data, 'post', params),
+    http(`Api/resetmobile`, data, 'post', params),
   // 密码修改
-  setpwd: (data, params) => http(`admin/passsave`, data, 'post', params),
+  setpwd: (data, params) => http(`Api/passsave`, data, 'post', params),
   // 获取导航列表
   list: (data, params) => http(`admin/menu`, data, 'post', params),
   // 获取个人信息
-  detail: (data, params) => http(`admin/userinfo`, data, 'post', params),
+  detail: (data, params) => http(`Api/userinfo`, data, 'post', params),
   // 获取最新版本号
   version: (data, params) => http(`admin/lastversion`, data, 'post', params),
-   // 个人信息完善
-   prefect: (data, params) => http(`admin/prefect`, data, 'post', params),
-  
+  // 个人信息完善
+  prefect: (data, params) => http(`Api/prefect`, data, 'post', params),
+
 }

+ 1 - 0
src/components/globalComponents/send-verification-code/main.vue

@@ -14,6 +14,7 @@ import { isMobile } from "@/utils/validate";
 import asyncRequest from "@/apis/service/user/index";
 import resToken from "@/mixins/resToken";
 export default {
+  name:"sendVerificationCode",
   props: {
     mobile: {
       type: String,

+ 23 - 10
src/views/person-infor/change-phone.vue

@@ -3,7 +3,7 @@
     <div class="change">
       <div class="title">更换手机号</div>
       <el-form
-        ref="loginForms"
+        ref="loginForm"
         :model="loginForm"
         :rules="loginRules"
         class="login-form"
@@ -57,7 +57,7 @@ import asyncRequest from "@/apis/service/user/index";
 import resToken from "@/mixins/resToken";
 export default {
   name: "Login",
-  mixins:[resToken],
+  mixins: [resToken],
   data() {
     const validatemobile = (rule, value, callback) => {
       if (value === "") {
@@ -100,16 +100,30 @@ export default {
   },
 
   mounted() {
-    if (this.loginForm.mobile === "") {
-      this.$refs.mobile.focus();
-    }
-    if (this.loginForm.code === "") {
-      this.$refs.code.focus();
-    }
+   this.resetForm();
+    // if (this.loginForm.mobile === "") {
+    //   this.$refs.mobile.focus();
+    // }
+    // if (this.loginForm.code === "") {
+    //   this.$refs.code.focus();
+    // }
   },
   methods: {
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+          mobile: "",
+        code: "",
+          };
+        }
+      });
+    },
     async handleLogin() {
-      this.$refs.loginForms.validate(async (valid) => {
+      this.$refs.loginForm.validate(async (valid) => {
         if (valid) {
           if (!this.loading) {
             this.loading = true;
@@ -132,7 +146,6 @@ export default {
         }
       });
     },
-   
   },
 };
 </script>

+ 10 - 10
src/views/person-infor/my-message.vue

@@ -31,13 +31,13 @@
                 <el-input v-model="ruleForm.email" />
               </el-form-item>
             </el-col>
-            <el-col :span="24">
+            <!-- <el-col :span="24">
               <el-form-item label="角色" prop="role_name">
                 <el-input
                   v-model="ruleForm.role_name"
                   :disabled="isDetail"
                 /> </el-form-item
-            ></el-col>
+            ></el-col> -->
             <el-col :span="24">
               <el-form-item label="加入时间" prop="addtime">
                 <el-input
@@ -104,7 +104,7 @@ export default {
         nickname: "",
         mobile: "",
         email: "",
-        role_name: "",
+        // role_name: "",
         addtime: "",
       },
       rules: {
@@ -136,13 +136,13 @@ export default {
             trigger: "blur",
           },
         ],
-        role_name: [
-          {
-            required: true,
-            message: "请输入角色",
-            trigger: "blur",
-          },
-        ],
+        // role_name: [
+        //   {
+        //     required: true,
+        //     message: "请输入角色",
+        //     trigger: "blur",
+        //   },
+        // ],
         addtime: [
           {
             required: true,

+ 13 - 0
src/views/purchaseIn/purchaseDiffOrder/index.vue

@@ -243,6 +243,11 @@ export default {
           prop: "good_name",
           label: "商品名称",
         },
+          {
+          prop: "class_cat",
+          label: "商品分类",
+        },
+        
         {
           prop: "good_weight",
           label: "商品总重量(g)",
@@ -354,6 +359,14 @@ export default {
       const res = await asyncRequest.list(this.parmValue);
       if (res && res.code === 0 && res.data) {
         this.tableData = res.data.list;
+           this.tableData.forEach((v) => {
+          v.class_cat = "";
+          if (v.can && v.can.length > 0) {
+            v.can.forEach((x, i) => {
+              v.class_cat += i === 0 ? x.name : "/" + x.name;
+            });
+          }
+        });
         this.pageInfo.total = Number(res.data.count);
       } else if (res && res.code >= 100 && res.code <= 104) {
         await this.logout();

+ 11 - 2
src/views/sellOut/consultOrder/components/addEdit.vue

@@ -208,12 +208,16 @@
                     :size="'mini'"
                     :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
                   >
+                    <!-- type="datetime"
+                      style="width: 100%"
+                      value-format="yyyy-MM-dd HH:mm:ss" -->
+
                     <el-date-picker
                       :disabled="!scope.row.edit"
                       v-model="scope.row.arrive_time"
-                      type="datetime"
+                      type="date"
                       style="width: 100%"
-                      value-format="yyyy-MM-dd HH:mm:ss"
+                      value-format="yyyy-MM-dd"
                       :picker-options="pickerOptions"
                     >
                     </el-date-picker>
@@ -400,6 +404,11 @@ export default {
       showGoodsModel: false,
       stock_code: "",
       cat_id: "",
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() > new Date().valueOf();
+        },
+      },
       ruleForm: {
         goods_class: [],
         good_name: "",

+ 99 - 87
src/views/sellOut/salesOrder/components/addEdit.vue

@@ -469,39 +469,51 @@ export default {
         order_addr: [], //收货地址
       },
       addrRules: {
-        arrive_time: {
-          required: true,
-          message: "最晚收货日期不能为空",
-          trigger: "change",
-        },
-        receipt_quantity: {
-          required: true,
-          validator: validateWeight,
-          trigger: "blur",
-        },
+        arrive_time: [
+          {
+            required: true,
+            message: "最晚收货日期不能为空",
+            trigger: "change",
+          },
+        ],
+        receipt_quantity: [
+          {
+            required: true,
+            validator: validateWeight,
+            trigger: "blur",
+          },
+        ],
 
-        contactor: {
-          required: true,
-          trigger: "blur",
-          message: "联系人不能为空",
-        },
-        mobile: {
-          required: true,
-          validator: validatemobile,
-          trigger: "blur",
-        },
+        contactor: [
+          {
+            required: true,
+            trigger: "blur",
+            message: "联系人不能为空",
+          },
+        ],
+        mobile: [
+          {
+            required: true,
+            validator: validatemobile,
+            trigger: "blur",
+          },
+        ],
 
-        order_addr: {
-          type: "array",
-          required: true,
-          message: "收货省市区不能为空",
-          trigger: "change",
-        },
-        addr: {
-          required: true,
-          message: "详细地址不能为空",
-          trigger: "blur",
-        },
+       addr_code: [
+          {
+            type: "array",
+            required: true,
+            message: "收货省市区不能为空",
+            trigger: "change",
+          },
+        ],
+        addr: [
+          {
+            required: true,
+            message: "详细地址不能为空",
+            trigger: "blur",
+          },
+        ],
       },
       stockForm: {
         good_stock: [], //出货仓库
@@ -835,70 +847,70 @@ export default {
    
    <style lang="scss" scoped>
 // .capitalClaim {
-  .excelUploadBox {
-    position: relative;
-    width: 100%;
-    height: 120px;
-    line-height: 120px;
-    box-sizing: border-box;
-    &:hover {
-      cursor: pointer;
-    }
-    .el-icon-receiving {
-      width: 100%;
-      text-align: center;
-      height: 50px;
-      display: block;
-      font-size: 32px;
-      line-height: 90px;
-      color: #d3d4d6;
-    }
-    .boxM {
-      width: 100%;
-      display: block;
-      text-align: center;
-      line-height: 65px;
-      height: 60px;
-      color: #909399;
-    }
+.excelUploadBox {
+  position: relative;
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+  &:hover {
+    cursor: pointer;
   }
-  .excelUpload {
-    top: 0;
-    left: 0;
-    position: absolute;
-    z-index: 2;
+  .el-icon-receiving {
     width: 100%;
-    height: 120px;
-    line-height: 120px;
-    box-sizing: border-box;
+    text-align: center;
+    height: 50px;
+    display: block;
+    font-size: 32px;
+    line-height: 90px;
+    color: #d3d4d6;
   }
-  .excelUploadRes {
+  .boxM {
     width: 100%;
+    display: block;
+    text-align: center;
+    line-height: 65px;
+    height: 60px;
+    color: #909399;
+  }
+}
+.excelUpload {
+  top: 0;
+  left: 0;
+  position: absolute;
+  z-index: 2;
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+}
+.excelUploadRes {
+  width: 100%;
+  height: 120px;
+  line-height: 120px;
+  box-sizing: border-box;
+  i {
+    width: 55px;
     height: 120px;
     line-height: 120px;
-    box-sizing: border-box;
-    i {
-      width: 55px;
-      height: 120px;
-      line-height: 120px;
-      text-align: center;
-      font-size: 20px;
-      &.fl {
-        padding-left: 16px;
-      }
-      &.fr {
-        padding-right: 16px;
-        &:hover {
-          cursor: pointer;
-        }
-      }
+    text-align: center;
+    font-size: 20px;
+    &.fl {
+      padding-left: 16px;
     }
-    span {
-      width: 386px;
-      line-height: 16px;
-      margin: 52px 0 0 0;
-      font-size: 16px;
+    &.fr {
+      padding-right: 16px;
+      &:hover {
+        cursor: pointer;
+      }
     }
   }
+  span {
+    width: 386px;
+    line-height: 16px;
+    margin: 52px 0 0 0;
+    font-size: 16px;
+  }
+}
 // }
 </style>

+ 416 - 63
src/views/sellOut/salesOrder/components/in-addr-model.vue

@@ -16,30 +16,160 @@
   >
     <el-card style="margin-top: -25px">
       <upload-excel :on-success="handleSuccess" :before-upload="beforeUpload" />
-      <el-table
-        :data="tableData"
-        size="mini"
-        border
-        max-height="400px"
-        highlight-current-row
-        style="width: 100%; margin-top: 20px"
-      >
-        <el-table-column prop="invNo" label="收货总数" width="100" />
-        <el-table-column
-          prop="inv_type_name"
-          label="最晚收货日期"
-          width="142"
-        />
-        <el-table-column prop="inv_code" label="收货联系人" width="85" />
-        <el-table-column prop="inv_number" label="收货联系电话" width="110" />
-        <el-table-column
-          prop="inv_total"
-          label="收货省市区(导入值)"
-          width="130"
-        />
-        <el-table-column prop="createtime" label="收货省市区(系统识别后)" />
-        <el-table-column prop="createtime" label="详细地址" width="150" />
-      </el-table>
+      <el-form :model="ruleForm" ref="ruleForm" :size="'mini'">
+        <el-table
+          :data="ruleForm.order_addr"
+          border
+          :size="'mini'"
+          style="width: 100%"
+          row-key="key"
+        >
+          <el-table-column prop="receipt_quantity" label="收货总数" width="100">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'receipt_quantity'"
+                :rules="scope.row.edit ? rulesThis.receipt_quantity : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.row.receipt_quantity"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="arrive_time" label="最晚收货日期" width="150">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'arrive_time'"
+                :rules="scope.row.edit ? rulesThis.arrive_time : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-date-picker
+                  :disabled="!scope.row.edit"
+                  v-model="scope.row.arrive_time"
+                  type="date"
+                  style="width: 100%"
+                  value-format="yyyy-MM-dd"
+                  :picker-options="pickerOptions"
+                >
+                </el-date-picker>
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="contactor" label="收件联系人" width="90">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'contactor'"
+                :rules="scope.row.edit ? rulesThis.contactor : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.row.contactor"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+
+          <el-table-column prop="mobile" label="收货联系电话" min-width="130">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'mobile'"
+                :rules="scope.row.edit ? rulesThis.mobile : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.row.mobile"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column
+            show-overflow-tooltip
+            prop="in_addr"
+            label="收货省市区(文件导入)"
+            width="140"
+          />
+          <el-table-column
+            prop="addr_code"
+            label="收货省市区(系统解析)"
+            min-width="230"
+          >
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'addr_code'"
+                :rules="scope.row.edit ? rulesThis.addr_code : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <select-area
+                  :value="scope.row.addr_code"
+                  :disabled="!scope.row.edit"
+                  :size="'mini'"
+                  @selectChange="select_area_change($event, scope.$index)"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+          <el-table-column prop="addr" label="详细地址" width="170">
+            <template slot-scope="scope">
+              <el-form-item
+                :prop="'order_addr.' + scope.$index + '.' + 'addr'"
+                :rules="scope.row.edit ? rulesThis.addr : {}"
+                :size="'mini'"
+                :style="{ marginBottom: scope.row.edit ? '13px' : '0' }"
+              >
+                <el-input
+                  v-model="scope.row.addr"
+                  :disabled="!scope.row.edit"
+                />
+              </el-form-item>
+            </template>
+          </el-table-column>
+
+          <el-table-column fixed="right" width="80" label="操作">
+            <template slot-scope="scope">
+              <el-tooltip
+                effect="dark"
+                content="编辑"
+                v-if="!scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-edit tb-icon"
+                  @click="openHouseModal(scope.$index)"
+                ></i>
+              </el-tooltip>
+
+              <el-tooltip
+                effect="dark"
+                content="保存"
+                v-if="scope.row.edit"
+                placement="top"
+              >
+                <i
+                  class="el-icon-circle-check tb-icon"
+                  @click="checkRow(scope.$index)"
+                ></i>
+              </el-tooltip>
+
+              <el-tooltip effect="dark" content="删除" placement="top">
+                <i
+                  class="el-icon-delete tb-icon"
+                  @click="deleteRow(scope.$index, ruleForm.order_addr)"
+                ></i>
+              </el-tooltip>
+            </template>
+          </el-table-column>
+        </el-table>
+      </el-form>
       <div class="tr" style="padding: 10px 0 0 0">
         <el-button type="primary" size="small" @click="submitForm"
           >保 存
@@ -52,12 +182,39 @@
 import asyncRequest from "@/apis/service/sellOut/salesOrder/detail";
 import resToken from "@/mixins/resToken";
 import { province_list, city_list, county_list } from "@/assets/js/area-data";
-import { isnumber, isnumber2, isAlphanumeric } from "@/utils/validate";
+import {
+  isnumber,
+  isMobile,
+  isnumber2,
+  isAlphanumeric,
+} from "@/utils/validate";
 export default {
   name: "Account",
   props: ["showModel", "id", "sitem"],
   mixins: [resToken],
   data() {
+    const validatemobile = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("手机号不能为空!"));
+      } else {
+        if (!isMobile(value)) {
+          callback(new Error("手机号格式不正确!"));
+        } else {
+          callback();
+        }
+      }
+    };
+    const validateWeight = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("收货总数不能为空!"));
+      } else {
+        if (!isnumber(value)) {
+          callback(new Error("收货总数仅支持整数!"));
+        } else {
+          callback();
+        }
+      }
+    };
     return {
       tableData: [],
       tableHeader: [],
@@ -65,6 +222,61 @@ export default {
       showModelThis: false,
       loading: false,
       newTime: 0,
+      pickerOptions: {
+        disabledDate: (time) => {
+          return time.getTime() < new Date().valueOf();
+        },
+      },
+      rulesThis: this.rules,
+      ruleForm: {
+        order_addr: [], //收货地址
+      },
+      rules: {
+        arrive_time: [
+          {
+            required: true,
+            message: "最晚收货日期不能为空",
+            trigger: "change",
+          },
+        ],
+        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",
+          },
+        ],
+      },
     };
   },
   watch: {
@@ -87,13 +299,41 @@ export default {
     closeModel() {
       console.log("closeModel!!");
     },
-
+    async resetForm() {
+      // 重置
+      await this.$nextTick(() => {
+        if (this.$refs.ruleForm) {
+          this.$refs.ruleForm.resetFields();
+          this.$refs.ruleForm.clearValidate();
+          this.ruleForm = {
+            order_addr: [],
+          };
+        }
+      });
+    },
+    // 省市区删除行操作
+    deleteRow(index, rows) {
+      rows.splice(index, 1);
+    },
+    //省市区选择
+    select_area_change(e, index) {
+      this.ruleForm.order_addr[index].addr_code = e;
+    },
+    //省市区保存某一行
+    checkRow(rowIndex) {
+      this.$refs.ruleForm.validate((valid) => {
+        if (valid) {
+          this.ruleForm.order_addr[rowIndex].edit = false;
+        } else {
+          return false;
+        }
+      });
+    },
     beforeUpload(file) {
       const isLt1M = file.size / 1024 / 1024 < 1;
       if (isLt1M) {
         return true;
       }
-
       this.$message({
         message: "请不要上传大于1MB的文件.",
         type: "warning",
@@ -101,6 +341,10 @@ export default {
       return false;
     },
     handleSuccess({ results, header }) {
+      if (results.length === 0) {
+        this.$message.error("表格无有效数据!");
+        return;
+      }
       let head = [
         "收货总数",
         "最晚收货日期",
@@ -131,28 +375,40 @@ export default {
       let list = results;
       console.log(list);
       let tableOk = true;
-      this.tableData = [];
+      this.ruleForm.order_addr = [];
       list.forEach((v1) => {
         let b = Object.values(v1);
         let time = this.setTime((b[1] + "").replace(/^\s*|\s*$/g, ""));
-        console.log(time);
-        console.log(b);
-        // console.log(this.get_code(b[4], b[5], b[6]));
+        // console.log(time);
+        // console.log(b);
+        let item = this.get_code(b[4], b[5], b[6]);
         let model = {
-          receipt_quantity: b[0],
-          arrive_time: time,
-
-          contactor: b[2],
-          mobile: b[3],
-          order_addr: b[4],
-          addr: b[7],
+          receipt_quantity: b[0] + "",
+          arrive_time: time + "",
+          contactor: b[2] + "",
+          mobile: b[3] + "",
+          in_addr: b[4] + "/" + b[5] + "/" + b[6],
+          addr_name: item.name + "",
+          addr_code: item.code,
+          addr: b[7] + "",
+          edit: false,
+          err: false,
         };
-        this.tableData.push(model);
+        this.ruleForm.order_addr.push(model);
       });
       if (!tableOk) {
         this.$message.error("最晚收货日期不正确,请将表格格式转为文本上传!");
       }
     },
+    openHouseModal(index) {
+      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++) {
@@ -173,6 +429,8 @@ export default {
       return time;
     },
     async initForm() {
+      this.rulesThis = this.rules;
+      await this.resetForm();
       this.newTime = 0;
       this.loading = true;
       this.tableData = [];
@@ -193,14 +451,34 @@ export default {
 
     async submitForm() {
       if (!this.loading) {
-        if (this.tableData.length < 1) {
+        if (this.ruleForm.order_addr.length < 1) {
           this.$message.error("导入数据不能为空!");
           this.loading = false;
           return;
         }
-        let arr = this.unique(this.tableData);
-        if (arr.length !== this.tableData.length) {
-          this.$message.error("收货联系电话不可以重复出现!");
+        let isEdit = false;
+        this.ruleForm.order_addr.forEach((v) => {
+          v.err = false;
+          if (v.edit) {
+            v.err = true;
+            isEdit = true;
+          }
+        });
+        if (isEdit) {
+          this.$message.error("当前收货地址已在编辑,请保存后再试!");
+          this.loading = false;
+          return;
+        }
+        let cItem = null;
+        this.ruleForm.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}`);
           this.loading = false;
           return;
         }
@@ -237,32 +515,107 @@ export default {
         }
       }
     },
+    checkItem(sitem) {
+      let model = {
+        isok: true,
+        message: "",
+      };
+      const {
+        arrive_time,
+        receipt_quantity,
+        contactor,
+        mobile,
+        addr_code,
+        addr,
+      } = sitem;
+      if (receipt_quantity === "" && model.isok) {
+        model.isok = false;
+        model.message = "收货总数不能为空!";
+      }
+      if (!isnumber(receipt_quantity) && model.isok) {
+        model.isok = false;
+        model.message = "收货总数仅支持整数!";
+      }
+      if (arrive_time === "" && model.isok) {
+        model.isok = false;
+        model.message = "最晚收货日期不能为空!";
+      }
+
+      if (contactor === "" && model.isok) {
+        model.isok = false;
+        model.message = "收货联系人不能为空!";
+      }
+      if (mobile === "" && model.isok) {
+        model.isok = false;
+        model.message = "收货联系电话不能为空!";
+      }
+      if (!isMobile(mobile) && model.isok) {
+        model.isok = false;
+        model.message = "收货联系电话格式不正确!";
+      }
+      if (addr_code.length !== 3 && model.isok) {
+        model.isok = false;
+        model.message = "收货省市区不能为空!";
+      }
+      if (addr === "" && model.isok) {
+        model.isok = false;
+        model.message = "详细地址不能为空!";
+      }
+      return model;
+    },
     get_code(name1, name2, name3) {
-      let name = [],
+      let name = "",
         code = [];
-      for (let i in province_list) {
-        if (name1 === province_list[i]) {
-          code.push(i);
-          name.push(province_list[i]);
-          break;
+      if (name1 && name2 && name3) {
+        for (let x in province_list) {
+          if (name1 === province_list[x]) {
+            code.push(x);
+            name += province_list[x];
+            break;
+          }
         }
-      }
-        for (let i in province_list) {
-        if (name1 === province_list[i]) {
-          code.push(i);
-          name.push(province_list[i]);
-          break;
+        if (code.length === 1) {
+          for (let y in city_list) {
+            if (name2 === city_list[y]) {
+              code.push(y);
+              name += "/" + city_list[y];
+              break;
+            }
+          }
         }
-      }
-        for (let i in province_list) {
-        if (name1 === province_list[i]) {
-          code.push(i);
-          name.push(province_list[i]);
-          break;
+        if (code.length === 2) {
+          for (let z in county_list) {
+            if (name3 === county_list[z]) {
+              code.push(z);
+              name += "/" + county_list[z];
+              break;
+            }
+          }
         }
-      }
 
-      return { name: [], code: [] };
+        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 };
     },
   },
 };