NULL1222 před 2 dny
rodič
revize
7b98eb69b3
1 změnil soubory, kde provedl 14 přidání a 6 odebrání
  1. 14 6
      src/Form/terminalCustomerFile/edit.vue

+ 14 - 6
src/Form/terminalCustomerFile/edit.vue

@@ -32,11 +32,11 @@
               </el-form-item>
             </el-col>
             <el-col :span="24">
-              <el-form-item :label="$t('省市县')">
+              <el-form-item :label="$t('省市县')" prop="region">
                 <el-cascader
                   :placeholder="$t('请选择')"
                   style="width: 100%"
-                  v-model="regionValue"
+                  v-model="form.region"
                   :options="basicData.data().areaData"
                   @change="cascaderChange"
                   clearable
@@ -154,7 +154,6 @@ export default {
       agentTotal: 0,
       agentPageNumber: 1,
       agentPageSize: 20,
-      regionValue: [],
       userInfo: null,
       agentDisabled: false,
       form: {
@@ -165,7 +164,8 @@ export default {
         city: "",
         county: "",
         sa_agentsid: 0,
-        enterprisename: ""
+        enterprisename: "",
+        region: []
       },
       rules: {
         name: [
@@ -188,6 +188,13 @@ export default {
             message: this.$t("请选择归属经销商"),
             trigger: "change"
           }
+        ],
+        region: [
+          {
+            required: true,
+            message: this.$t("请选择省市县"),
+            trigger: "change"
+          }
         ]
       },
       agentParam: {
@@ -243,13 +250,14 @@ export default {
         if (this.data.province) arr.push(this.data.province);
         if (this.data.city) arr.push(this.data.city);
         if (this.data.county) arr.push(this.data.county);
-        this.regionValue = arr;
+        this.form.region = arr;
       } else {
-        this.regionValue = [];
+        this.form.region = [];
       }
       this.dialogFormVisible = true;
     },
     cascaderChange(val) {
+      this.form.region = val || [];
       if (val && val.length > 0) {
         this.form.province = val[0] || "";
         this.form.city = val[1] || "";