xuxy
2024-06-28 b07d5f16634fc4a695fa8e6f6b18c33806f2b05a
sub_pages/supplier/supplier-info/supplier-info.vue
文件名从 sub_pages/farmer/farmer-info/farmer-info.vue 修改
@@ -283,14 +283,29 @@
      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()
            }
@@ -312,6 +327,8 @@
            // 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)
         },
@@ -339,20 +356,20 @@
               }
               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()
@@ -370,15 +387,15 @@
               }
               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 = '身份证'
               }
            }
@@ -393,6 +410,7 @@
            var dto = {
               ...this.dto,
               idcardType: this.dto.idcardType === '身份证' ? "1" : '2'
            }
            this.$message.showLoading()
            const re = await this.$http.request('post', '/api/supplier/addOrUpdate', {
@@ -403,6 +421,7 @@
               this.$message.showToast('操作成功')
               //需要标记加一下
               this.$store.dispatch('sign_add', 'application');
               this.$store.dispatch('getCurrentInfo')
               this.backpage()
            }