| | |
| | | <view> |
| | | <view class="container"> |
| | | <uni-forms ref="baseForm" :modelValue="baseFormData"> |
| | | <uni-forms-item label="客户名称" required name="name"> |
| | | <!-- <uni-forms-item label="客户名称" required name="name"> |
| | | <uni-easyinput v-model="baseFormData.name" placeholder="请输入客户名称" /> |
| | | </uni-forms-item> --> |
| | | |
| | | <uni-forms-item label="客户名称" required name="name"> |
| | | <view> |
| | | <uni-combox :candidates="names" placeholder="请输入客户名称" |
| | | v-model="baseFormData.name" @input="cstmrSearch()"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item label="客户类别" required name="cstmrType"> |
| | |
| | | v-model="baseFormData.cstmrType" @input="autoLoad('cstmrType',baseFormData.cstmrType)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="客户行业" required name="industry"> |
| | | <view > |
| | | <uni-combox :candidates="industrys" placeholder="请选择客户行业" |
| | | v-model="baseFormData.industry"></uni-combox> |
| | | <uni-forms-item label="客户行业" name="industry" required> |
| | | <view @click="autoLoad('customerIndustryName','')"> |
| | | <uni-combox :candidates="industrys" placeholder="请选择客户行业" |
| | | v-model="baseFormData.industry" |
| | | @input="autoLoad('customerIndustryName',baseFormData.industry)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | |
| | | <uni-forms-item label="产品类别" required name="productCategory"> |
| | | <view> |
| | | <uni-combox :candidates="productCategorys" placeholder="请选择产品类别" |
| | | v-model="baseFormData.productCategory"></uni-combox> |
| | | <uni-forms-item label="产品类型" name="productCategory" required> |
| | | <view @click="autoLoad('orderProductType','')"> |
| | | <uni-combox :candidates="productCategorys" placeholder="请选择产品类型" |
| | | v-model="baseFormData.productCategory" |
| | | @input="autoLoad('orderProductType',baseFormData.orderProductTypeId)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | |
| | |
| | | director: '', |
| | | cstmrTypeList: [], |
| | | directorList: [], |
| | | industrys: ['医药业','制造业','纺织业'], |
| | | productCategorys: ['立体库(货架)','立体库(集成)','四向穿梭库/两向穿梭库','阁楼货架/钢平台','周转容器','平库'], |
| | | names: [], |
| | | nameList: [], |
| | | industrys: [], |
| | | industryList: [], |
| | | productCategorys: [], |
| | | productCategoryList: [], |
| | | baseFormData: { |
| | | name: '', |
| | | citysData: [], |
| | | cstmrType: '', |
| | | director: '', |
| | |
| | | value: 2 |
| | | }], |
| | | citysData: [], |
| | | citysDataTemp: '' |
| | | citysDataTemp: '', |
| | | uraddr: 'add' |
| | | |
| | | } |
| | | }, |
| | |
| | | this.citysData = test.citysData |
| | | this.autoLoad('cstmrType','') |
| | | this.autoLoad('user','') |
| | | this.autoLoad('orderProductType','') |
| | | }, |
| | | onLoad(option) { |
| | | if(option.type == 1) { |
| | | this.uraddr = 'add2' |
| | | } |
| | | }, |
| | | methods: { |
| | | cstmrSearch() { |
| | | this.names = [] |
| | | let _this = this |
| | | if(_this.baseFormData.name.length < 4) { |
| | | return |
| | | } |
| | | uni.request({ |
| | | url: `${_this.baseUrl}/cstmrSearch/auth`, |
| | | header:{'token':uni.getStorageSync('token'),'content-type':'application/x-www-form-urlencoded',}, |
| | | data: {condition: _this.baseFormData.name}, |
| | | method: 'POST', |
| | | success(res) { |
| | | res = res.data |
| | | if (res.code === 200 && res.data.length > 0) { |
| | | for(let element of res.data) { |
| | | _this.names.push(element.name) |
| | | _this.nameList.push(element) |
| | | } |
| | | } |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | bindPickerChange: function(e) { |
| | | this.cstmrTypeIndex = e.detail.value |
| | | this.baseFormData.cstmrType = this.cstmrTypes[e.detail.value].id |
| | |
| | | that.cstmrTypes = [] |
| | | that.directors = [] |
| | | that.directorList = [] |
| | | that.industrys = [] |
| | | var a = that.baseUrl + '/' + type + 'Query/auth' |
| | | uni.request({ |
| | | url: that.baseUrl + '/' + type + 'Query' +'/auth', |
| | |
| | | } |
| | | return |
| | | } |
| | | |
| | | if (type == 'orderProductType') { |
| | | for (element of res.data) { |
| | | that.productCategorys.push(element.value) |
| | | that.productCategoryList.push(element) |
| | | } |
| | | return |
| | | } |
| | | if (type == 'customerIndustryName') { |
| | | for (element of res.data) { |
| | | that.industrys.push(element.value) |
| | | that.industryList.push(element) |
| | | } |
| | | return |
| | | } |
| | | } |
| | | } |
| | | }) |
| | |
| | | that.baseFormData.cstmrType = element.id |
| | | } |
| | | } |
| | | for (element of that.productCategoryList) { |
| | | if(element.value == that.baseFormData.productCategory) { |
| | | that.baseFormData.productCategory = element.id |
| | | } |
| | | } |
| | | for (element of that.industryList) { |
| | | if(element.value == that.baseFormData.industry) { |
| | | that.baseFormData.industry = element.id |
| | | } |
| | | } |
| | | this.$refs.baseForm.validate().then(res=>{ |
| | | if (res.rela == undefined) { |
| | | res.rela = '' |
| | |
| | | } |
| | | res.pcd = this.citysDataTemp |
| | | uni.request({ |
| | | url: that.baseUrl + '/cstmr/add/auth', |
| | | url: `${that.baseUrl}/cstmr/${that.uraddr}/auth`, |
| | | header:{ |
| | | 'token':uni.getStorageSync('token'), |
| | | 'content-type':'application/x-www-form-urlencoded', |