Kaynağa Gözat

营业期限可选长期有效

lmx 1 ay önce
ebeveyn
işleme
a2221f26a3
1 değiştirilmiş dosya ile 21 ekleme ve 2 silme
  1. 21 2
      src/views/store/storeConfig/userInfo.vue

+ 21 - 2
src/views/store/storeConfig/userInfo.vue

@@ -97,7 +97,15 @@
           </el-form-item>
         </el-col>
         <el-col :span="12">
-          <el-form-item label="营业执照失效日期" prop="businessLicenseExpire">
+          <el-form-item label="营业执照是否长期有效" prop="isBusinessLicensePermanent">
+              <el-switch
+                @change="switchChange()"
+                v-model="switchValue"
+                active-color="#13ce66"
+                inactive-color="#ff4949">
+              </el-switch>
+             </el-form-item>
+          <el-form-item label="营业执照失效日期" prop="businessLicenseExpire"  v-if="!switchValue">
             <el-date-picker
               v-model="form.businessLicenseExpire"
               end-placeholder="结束日期"
@@ -374,6 +382,8 @@ export default {
   data() {
 
     return {
+      
+      switchValue:false,
       title:'',
       statusOptions: [],
       citys: [],
@@ -548,6 +558,8 @@ export default {
     },
     // 表单重置
     reset() {
+      
+      this.switchValue = false;
       this.form = {
         storeId: null,
         cityIds: null,
@@ -652,6 +664,11 @@ export default {
             formData.businessLicenseExpireStart = formData.businessLicenseExpire[0]
             formData.businessLicenseExpireEnd = formData.businessLicenseExpire[1]
           }
+                   if(!!this.switchValue){
+              formData.isBusinessLicensePermanent = 1;
+          }else{
+              formData.isBusinessLicensePermanent = 0;
+          }
 
           if (formData.storeId != null) {
             updateStore(formData).then(response => {
@@ -687,7 +704,9 @@ export default {
         this.form = response.data
         this.open = true
         this.title = '修改店铺'
-
+        if(this.form.isBusinessLicensePermanent == 1){
+          this.switchValue = true;
+        }
         let str = this.form.shippingType
         this.form.shippingType = str.split(',')
         this.form.cityIds = ((this.form.cityIds).split(',')).map(Number)