| | |
| | | </uni-forms-item> |
| | | <uni-forms-item label="甲方单位" required name="cstmrId"> |
| | | <view @click="autoLoad('cstmr','')"> |
| | | <uni-combox :candidates="cstmrs" placeholder="请选择甲方单位" v-model="baseFormData.cstmrId" |
| | | @input="autoLoad('cstmr',baseFormData.cstmrId)"></uni-combox> |
| | | <uni-combox :candidates="cstmrs" placeholder="请选择甲方单位" v-model="baseFormData.cstmrId$" |
| | | @input="autoLoad('cstmr',baseFormData.cstmrId$)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="所属公司" required name="company"> |
| | | <view @click="autoLoad('company','')"> |
| | | <uni-combox :candidates="companies" placeholder="请选所属公司" v-model="baseFormData.company" |
| | | @input="autoLoad('company',baseFormData.company)"></uni-combox> |
| | | <uni-combox :candidates="companies" placeholder="请选所属公司" v-model="baseFormData.company$" |
| | | @input="autoLoad('company',baseFormData.company$)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="预算金额(万元)" name="money" required> |
| | |
| | | </uni-forms-item> |
| | | <uni-forms-item label="负责人" name="director" required> |
| | | <view @click="autoLoad('user','')"> |
| | | <uni-combox :candidates="directors" placeholder="请选择负责人" v-model="baseFormData.director" |
| | | @input="autoLoad('user',baseFormData.director)"></uni-combox> |
| | | <uni-combox :candidates="directors" placeholder="请选择负责人" v-model="baseFormData.director$" |
| | | @input="autoLoad('user',baseFormData.director$)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="产品类型" name="orderProductTypeId" required> |
| | | <view @click="autoLoad('orderProductType','')"> |
| | | <uni-combox :candidates="orderProductTypeIds" placeholder="请选择产品类型" |
| | | v-model="baseFormData.orderProductTypeId" |
| | | @input="autoLoad('orderProductType',baseFormData.orderProductTypeId)"></uni-combox> |
| | | v-model="baseFormData.orderProductTypeId$" |
| | | @input="autoLoad('orderProductType',baseFormData.orderProductTypeId$)"></uni-combox> |
| | | </view> |
| | | </uni-forms-item> |
| | | <uni-forms-item label="省市区" name="citysData" required> |
| | | <uni-forms-item label="省市区" name="pcd" required> |
| | | <uni-data-picker @change="areaChange" placeholder="请选择省市区" popup-title="请选择所在地区" |
| | | :localdata="citysData" v-model="baseFormData.pcd"> |
| | | </uni-data-picker> |
| | |
| | | onLoad: function(option) { |
| | | let _this = this |
| | | const eventChannel = this.getOpenerEventChannel(); |
| | | eventChannel.emit('acceptDataFromOpenedPage', {data: 'data from test page'}); |
| | | eventChannel.emit('someEvent', {data: 'data from test page for someEvent'}); |
| | | // 监听acceptDataFromOpenerPage事件,获取上一页面通过eventChannel传送到当前页面的数据 |
| | | eventChannel.on('saleManage', function(data) { |
| | | data = data.data |
| | | console.log(data); |
| | | _this.cstmrList = [{value: data.cstmrId$,id: data.cstmrId}] |
| | | _this.companyList = [{name: data.company$,id: data.company}] |
| | | _this.directorList = [{value: data.director$,id: data.director}] |
| | | _this.orderProductTypeList = [{value: data.orderProductTypeId$,id: data.orderProductTypeId}] |
| | | data.cstmrId = data.cstmrId$ |
| | | data.company = data.company$ |
| | | data.director = data.director$ |
| | | data.orderProductTypeId = data.orderProductTypeId$ |
| | | _this.citysDataTemp = data.pcd |
| | | _this.id = data.id |
| | | _this.memoExperience = data.memoExperience |
| | | _this.status = data.status |
| | | _this.baseFormData = data |
| | | _this.init() |
| | | return |
| | | }) |
| | | }, |
| | | methods: { |
| | | init() { |
| | | let that = this |
| | | uni.request({ |
| | | url: that.baseUrl + '/order/' + that.id +'/auth', |
| | | header: {'token' : uni.getStorageSync('token')}, |
| | | method: 'GET', |
| | | success(res) { |
| | | res = res.data |
| | | for (let key in res.data) { |
| | | if (res.data[key] === null) { |
| | | res.data[key] = '' |
| | | } |
| | | if (key == 'pcd') { |
| | | that.citysDataTemp = res.data[key] |
| | | res.data[key] = res.data[key].split(',')[2] |
| | | } |
| | | } |
| | | that.ide = res.data.id |
| | | that.baseFormData = res.data |
| | | } |
| | | }) |
| | | }, |
| | | async getDetail() { |
| | | let res = await user.getDetail() |
| | | if (res.code === 200) { |
| | |
| | | var element; |
| | | // 所属公司 |
| | | for (element of that.companyList) { |
| | | if (element.name == that.baseFormData.company) { |
| | | if (element.name == that.baseFormData.company$) { |
| | | that.baseFormData.company = element.id |
| | | } |
| | | } |
| | | for (element of that.cstmrList) { |
| | | if (element.value == that.baseFormData.cstmrId) { |
| | | if (element.value == that.baseFormData.cstmrId$) { |
| | | that.baseFormData.cstmrId = element.id |
| | | } |
| | | } |
| | | for (element of that.directorList) { |
| | | if (element.value == that.baseFormData.director) { |
| | | if (element.value == that.baseFormData.director$) { |
| | | that.baseFormData.director = element.id |
| | | } |
| | | } |
| | | for (element of that.orderProductTypeList) { |
| | | if (element.value == that.baseFormData.orderProductTypeId) { |
| | | if (element.value == that.baseFormData.orderProductTypeId$) { |
| | | that.baseFormData.orderProductTypeId = element.id |
| | | } |
| | | } |
| | | console.log(this.citysDataTemp); |
| | | console.log(this.baseFormData); |
| | | that.baseFormData.transactionRate = Number(that.baseFormData.transactionRate.split('%')[0]) |
| | | this.$refs.baseForm.validate().then(res => { |
| | | if (res.addr == undefined) { |
| | |
| | | res.remarks = '' |
| | | } |
| | | res.pcd = this.citysDataTemp |
| | | console.log(res.pcd); |
| | | res.id = this.id |
| | | res.memoExperience = this.memoExperience |
| | | res.status = this.status |