#
whycq
2022-12-14 289e204f67b8ae0144772707e028a4aa82f2002a
pages/business/cstmr/addCsmtr.vue
@@ -9,7 +9,7 @@
               <uni-easyinput v-model="baseFormData.rela" placeholder="请输入客户关系" />
            </uni-forms-item>
            <uni-forms-item label="客户类别" required name="cstmrType">
               <uni-combox :candidates="cstmrTypes" placeholder="请选择客户类别" v-model="cstmrType" @input="autoLoad(cstmrType)"></uni-combox>
               <uni-combox :candidates="cstmrTypes" placeholder="请选择客户类别" v-model="cstmrType" @input="autoLoad('cstmrType',cstmrTypeQuery)"></uni-combox>
               <!-- <uni-easyinput v-model="baseFormData.cstmrType" placeholder="请输入客户类别" /> -->
            </uni-forms-item>
            <uni-forms-item label="区分" required name="type">
@@ -125,11 +125,13 @@
         // 获取省市区
         this.citysData = test.citysData
         this.baseUrl = uni.getStorageSync('baseUrl')
         this.getCstmrType()
         this.getUser()
         this.autoLoad('cstmrType',cstmrType)
         this.autoLoad('contacts',user)
         // this.getCstmrType()
         // this.getUser()
      },
      methods: {
         autoLoad(condition) {
         autoLoad(type,condition) {
            let that = this
            uni.request({
               url: that.baseUrl + '/' + condition +'/auth',
@@ -140,7 +142,15 @@
                  if (res.code === 200) {
                     var element;
                     for(element of res.data) {
                        that.cstmrTypes.push(element.value)
                        if (type == cstmrType) {
                           that.cstmrTypes.push(element.value)
                           return
                        }
                        if (type == contacts) {
                           that.contacts.push(element.value)
                           return
                        }
                     }
                  }
               }