文件名从 sub_pages/farmer/farmer-info/farmer-info.vue 修改 |
| | |
| | | |
| | | methods: { |
| | | PickArea(item, e) { |
| | | // console.log('PickArea', item, e) |
| | | console.log('PickArea', item, e) |
| | | if (e.detail.value) { |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.city = e.detail.value[1].value |
| | | if (!!e.detail.value[2]) |
| | | this.dto.region = e.detail.value[2].value |
| | | this.dto.province = '' |
| | | this.dto.city = '' |
| | | this.dto.region = '' |
| | | if(e.detail.value.length<=3){ |
| | | if (!!e.detail.value[0]) |
| | | this.dto.province = e.detail.value[0].value |
| | | if (!!e.detail.value[1]) |
| | | this.dto.city = e.detail.value[1].value |
| | | if (!!e.detail.value[2]) |
| | | this.dto.region = e.detail.value[2].value |
| | | }else{ |
| | | //说明有重复的 |
| | | var plusnum = e.detail.value.length - 3 |
| | | if (!!e.detail.value[plusnum+0]) |
| | | this.dto.province = e.detail.value[plusnum+0].value |
| | | if (!!e.detail.value[plusnum+1]) |
| | | this.dto.city = e.detail.value[plusnum+1].value |
| | | if (!!e.detail.value[plusnum+2]) |
| | | this.dto.region = e.detail.value[plusnum+2].value |
| | | } |
| | | |
| | | this.$forceUpdate() |
| | | |
| | | } |
| | |
| | | // console.log('area', JSON.parse(res.data)) |
| | | this.regionDataPlus = res.data && JSON.parse(res.data.replaceAll('code', 'value').replaceAll('name', |
| | | 'text')) || [] |
| | | |
| | | console.log('area', this.regionDataPlus) |
| | | |
| | | |
| | | }, |
| | |
| | | } |
| | | if (!this.dto.pictures) { |
| | | this.dto.pictures = [] |
| | | }else if(typeof this.dto.pictures == 'string'){ |
| | | } else if (typeof this.dto.pictures == 'string') { |
| | | this.dto.pictures = JSON.parse(this.dto.pictures) |
| | | } |
| | | if (!this.dto.idCards) { |
| | | this.dto.idCards = [] |
| | | }else if(typeof this.dto.idCards == 'string'){ |
| | | } else if (typeof this.dto.idCards == 'string') { |
| | | this.dto.idCards = JSON.parse(this.dto.idCards) |
| | | } |
| | | |
| | | // if (this.dto.idCards.length > 0) { |
| | | // this.dto.idcardType = '身份证' |
| | | // } |
| | | if (this.dto.idcardType == '1') { |
| | | this.dto.idcardType = '身份证' |
| | | } |
| | | this.dto.userId = this.currentInfo.id |
| | | |
| | | |
| | | } |
| | | |
| | | this.$message.hideLoading() |
| | |
| | | } |
| | | if (!this.dto.pictures) { |
| | | this.dto.pictures = [] |
| | | }else if(typeof this.dto.pictures == 'string'){ |
| | | } else if (typeof this.dto.pictures == 'string') { |
| | | this.dto.pictures = JSON.parse(this.dto.pictures) |
| | | } |
| | | if (!this.dto.idCards) { |
| | | this.dto.idCards = [] |
| | | }else if(typeof this.dto.idCards == 'string'){ |
| | | } else if (typeof this.dto.idCards == 'string') { |
| | | this.dto.idCards = JSON.parse(this.dto.idCards) |
| | | } |
| | | if (this.dto.idCards.length > 0) { |
| | | if (this.dto.idcardType == '1') { |
| | | this.dto.idcardType = '身份证' |
| | | } |
| | | } |
| | |
| | | |
| | | var dto = { |
| | | ...this.dto, |
| | | idcardType: this.dto.idcardType === '身份证' ? "1" : '2' |
| | | } |
| | | this.$message.showLoading() |
| | | const re = await this.$http.request('post', '/api/supplier/addOrUpdate', { |
| | |
| | | this.$message.showToast('操作成功') |
| | | //需要标记加一下 |
| | | this.$store.dispatch('sign_add', 'application'); |
| | | this.$store.dispatch('getCurrentInfo') |
| | | |
| | | this.backpage() |
| | | } |