guoshilong
2023-11-12 03e24712b3534ffacd58ac8237237eccd4a4dd02
subPackage/workbench/views/editExamine.vue
@@ -56,7 +56,7 @@
      getPlaceDetail
   } from '@/api/placeExp/placeExp.js'
   import uploadMixin from "@/mixin/uploadMixin";
   import boxTtitle from '@/components/boxTitle/index.vue'
   import boxTitle from "@/subPackage/workbench/components/boxTitle/index.vue"
   import formItem from '../components/formItem.vue'
   export default {
      mixins: [uploadMixin],
@@ -128,18 +128,18 @@
               Object.keys(this.form).forEach(key => {
                  this.form[key] = data[key]
                  if (key === 'imageUrls' || key === 'planImageUrls') {
                     this.form[key] = []
                     if (!!data[key]) {
                        data[key] = JSON.parse(data[key])
                        if (Array.isArray(data[key])) {
                           this.form[key] = data[key]
                        }
                     } else {
                        this.form[key].push(data[key])
                     this.form[key] = []
                     if (!!data[key]) {
                        data[key] = JSON.parse(data[key])
                        if (Array.isArray(data[key])) {
                           this.form[key] = data[key]
                        }
                     } else {
                        this.form[key].push(data[key])
                     }
                  }
               })
               })
               console.log(this.form);
               this.personNum = placePractitioner.length
               this.$nextTick(() => {
@@ -149,48 +149,48 @@
                  })
               })
            })
         },
         updatePlaceExt(data) {
            data['imageUrls'] = data['imageUrls'].join('、')
            data['planImageUrls'] = data['planImageUrls'].join('、')
            updatePlaceExtData({
               ...data
            }).then(res => {
               const {
                  code
               } = res
               if (code !== 200) {
                  uni.showToast({
                     title: '提交失败',
                     icon: 'error'
                  })
                  return
               }
               uni.showToast({
                  title: '提交成功',
                  icon: 'success',
                  complete() {
                     setTimeout(() => {
                        uni.navigateBack()
                     }, 1500)
                  }
               })
            })
         },
         addPerson() {
            this.personNum++
         },
         submit() {
            const placePractitioner = []
            this.$refs.formItemRef.forEach(item => {
               item.form.placeId = this.form.placeId
               placePractitioner.push(item.form)
            })
            this.form.placePractitioner = placePractitioner
            this.updatePlaceExt(this.form)
         },
         pushPage() {
            this.$u.func.globalNavigator('/subPackage/workbench/views/cshw')
         },
         updatePlaceExt(data) {
            data['imageUrls'] = data['imageUrls'].join('、')
            data['planImageUrls'] = data['planImageUrls'].join('、')
            updatePlaceExtData({
               ...data
            }).then(res => {
               const {
                  code
               } = res
               if (code !== 200) {
                  uni.showToast({
                     title: '提交失败',
                     icon: 'error'
                  })
                  return
               }
               uni.showToast({
                  title: '提交成功',
                  icon: 'success',
                  complete() {
                     setTimeout(() => {
                        uni.navigateBack()
                     }, 1500)
                  }
               })
            })
         },
         addPerson() {
            this.personNum++
         },
         submit() {
            const placePractitioner = []
            this.$refs.formItemRef.forEach(item => {
               item.form.placeId = this.form.placeId
               placePractitioner.push(item.form)
            })
            this.form.placePractitioner = placePractitioner
            this.updatePlaceExt(this.form)
         },
         pushPage() {
            this.$u.func.globalNavigator('/subPackage/workbench/views/cshw')
         }
      }
   }