| | |
| | | <view class="">
|
| | | <box-title title="营业执照"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
|
| | | <u-upload :fileList="form.imageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
|
| | | </u-upload>
|
| | |
| | | <view class="">
|
| | | <box-title title="场所平面图"></box-title>
|
| | | <view class="upload-img">
|
| | | <u-upload :fileList="form.images" :previewFullImage="uploadConfig.previewFullImage"
|
| | | <u-upload :fileList="form.planImageUrls" :previewFullImage="uploadConfig.previewFullImage"
|
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" :maxCount="uploadConfig.maxCount"
|
| | | :capture="uploadConfig.capture" @afterRead="afterReadImg" @delete="deletePic">
|
| | | </u-upload>
|
| | |
| | | </template>
|
| | |
|
| | | <script> |
| | | import { updatePlaceExtData } from '@/api/placeExp/placeExp.js'
|
| | | import {
|
| | | updatePlaceExtData, |
| | | getPlaceDetail
|
| | | } from '@/api/placeExp/placeExp.js'
|
| | | import uploadMixin from "@/mixin/uploadMixin";
|
| | | import boxTtitle from '@/components/boxTitle/index.vue'
|
| | | import formItem from '../components/formItem.vue'
|
| | |
| | | data() {
|
| | | return {
|
| | | form: {
|
| | | id: '',
|
| | | localtion: '',
|
| | | placeName: '',
|
| | | legalPerson: '',
|
| | |
| | | trigger: ['blur', 'change']
|
| | | }
|
| | | },
|
| | | personNum: 1
|
| | | personNum: 1,
|
| | | curSelectSite: {}, |
| | | placeId: '',
|
| | | }
|
| | | },
|
| | | onShow() {
|
| | | this.curSelectSite = uni.getStorageSync('siteInfo') |
| | | this.getCsDetails()
|
| | | },
|
| | | methods: { |
| | | updatePlaceExt() { |
| | | |
| | | getCsDetails() { |
| | | getPlaceDetail({ |
| | | placeId: this.curSelectSite.id |
| | | }).then(detailRes => { |
| | | const { code, data } = detailRes |
| | | if (code !== 200) { |
| | | uni.showToast({ |
| | | title: '数据请求失败', |
| | | icon: 'error' |
| | | }) |
| | | return |
| | | } |
| | | this.placeId = data.placeId |
| | | const placePractitioner = data?.placePractitioner || [] |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = data[key] |
| | | if(key === 'imageUrls' || key === 'planImageUrls') { |
| | | this.form[key] = [] |
| | | !!data[key] && this.form[key].push() |
| | | } |
| | | }) |
| | | this.personNum = placePractitioner.length |
| | | this.$nextTick(() => { |
| | | this.$refs.formItemRef.forEach((item, index) => { |
| | | item.form = this.$refs.formItemRef[index].form |
| | | }) |
| | | }) |
| | | }) |
| | | },
|
| | | updatePlaceExt(data) { |
| | | data['imageUrls'] = JSON.stringify(data['imageUrls']) |
| | | data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
|
| | | 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 personList = []
|
| | | const placePractitioner = []
|
| | | this.$refs.formItemRef.forEach(item => {
|
| | | personList.push(item.form)
|
| | | item.form.placeId = this.placeId
|
| | | placePractitioner.push(item.form)
|
| | | })
|
| | | console.log(personList);
|
| | | this.form.placePractitioner = placePractitioner |
| | | this.updatePlaceExt(this.form)
|
| | | }
|
| | | }
|
| | | }
|