| | |
| | | <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"> |
| | |
| | | // 获取省市区 |
| | | 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', |
| | |
| | | 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 |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |