#
whycq
2023-10-10 155f2b80f2a9b6f900c73f6e4461e9cebb7cd028
pages/business/cstmr/addCsmtr.vue
@@ -18,7 +18,7 @@
               <uni-data-checkbox v-model="baseFormData.type" :localdata="type$" />
            </uni-forms-item>
            <uni-forms-item label="省市区" required name="citysData">
               <uni-data-picker @change="areaChange" placeholder="请选择省市区" popup-title="请选择所在地区" :localdata="citysData" v-model="baseFormData.userArea">
               <uni-data-picker @change="areaChange" placeholder="请选择省市区" popup-title="请选择所在地区" :localdata="citysData" v-model="baseFormData.pcd">
               </uni-data-picker>
            </uni-forms-item>
            <uni-forms-item label="电话" required name="tel">
@@ -50,7 +50,6 @@
   export default {
      data() {
         return {
            baseUrl: '',
            cstmrTypes: [],
            cstmrType: '',
            directors: [],
@@ -143,11 +142,10 @@
      onReady() {
            // 需要在onReady中设置规则
            this.$refs.baseForm.setRules(this.rules)
         },
      mounted() {
      },
      onShow() {
         // 获取省市区
         this.citysData = test.citysData
         this.baseUrl = uni.getStorageSync('baseUrl')
         this.autoLoad('cstmrType','')
         this.autoLoad('user','')
      },
@@ -214,8 +212,7 @@
               if(res.remarks == undefined) {
                  res.remarks = ''
               }
               res.citysData = this.citysDataTemp
               console.log(res);
               res.pcd = this.citysDataTemp
               uni.request({
                  url: that.baseUrl + '/cstmr/add/auth',
                  header:{
@@ -227,13 +224,20 @@
                  success(result) {
                     var res = result.data
                     if (res.code === 200) {
                        uni.back
                        uni.navigateBack()
                     } else if (res.code === 403) {
                        uni.showToast({title: res.msg, icon: "none", position: 'top'})
                        setTimeout(() => {
                           uni.reLaunch({
                              url: '../../login/login'
                           });
                        }, 1000);
                     } else {
                        uni.showToast({title: res.msg, icon: "none",position: 'top'})
                     }
                     console.log(res);
                  }
               })
            }).catch(err =>{
               console.log(err);
            })
         }
      }