| | |
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" |
| | | uploadIcon="/static/icon/upload.png"
|
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg($event,'imageUrls')"
|
| | | @delete="deletePic">
|
| | | @delete="deletePic($event,'imageUrls')">
|
| | | </u-upload>
|
| | | </view>
|
| | | </view>
|
| | |
| | | :accept="uploadConfig.acceptImg" :multiple="uploadConfig.multiple" |
| | | uploadIcon="/static/icon/upload.png"
|
| | | :maxCount="uploadConfig.maxCount" :capture="uploadConfig.capture" @afterRead="afterReadImg($event,'planImageUrls')"
|
| | | @delete="deletePic">
|
| | | @delete="deletePic($event,'planImageUrls')">
|
| | | </u-upload>
|
| | | </view>
|
| | | </view>
|
| | |
| | | import uploadMixin from "@/mixin/uploadMixin";
|
| | | import boxTitle from "@/subPackage/workbench/components/boxTitle/index.vue"
|
| | | import formItem from '../components/formItem.vue'
|
| | | import { minioBaseUrl } from '@/common/setting'
|
| | | export default {
|
| | | mixins: [uploadMixin],
|
| | | components: {
|
| | |
| | | return
|
| | | }
|
| | | const placePractitioner = data?.placePractitioner || []
|
| | | Object.keys(this.form).forEach(key => {
|
| | | this.form[key] = data[key]
|
| | | if (key === 'imageUrls' || key === 'planImageUrls') {
|
| | | data[key] = 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])
|
| | | }
|
| | | // Object.keys(this.form).forEach(key => {
|
| | | // this.form[key] = data[key]
|
| | | // if (key === 'imageUrls' || key === 'planImageUrls') {
|
| | | // data[key] = 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])
|
| | | // }
|
| | | // }
|
| | | // }
|
| | | // })
|
| | | |
| | | for(let i in this.form){
|
| | | if(i === 'imageUrls' || i === 'planImageUrls'){
|
| | | if(this.form[i]){
|
| | | this.form[i] = this.setImageUrl(i,data[i].split('、'))
|
| | | }
|
| | | }else{
|
| | | this.form[i] = data[i]
|
| | | }
|
| | | })
|
| | |
|
| | | }
|
| | | |
| | | this.personNum = placePractitioner.length
|
| | | const componetns = this.$refs.formItemRef || []
|
| | | this.$refs.formItemRef.forEach((item, index) => {
|
| | |
| | | })
|
| | | })
|
| | | },
|
| | | |
| | | |
| | | setImageUrl(key,arr){
|
| | | let urls = [];
|
| | | for(let i of arr){
|
| | | urls.push({
|
| | | name:i,
|
| | | url:`${minioBaseUrl}${i}`
|
| | | }) |
| | | }
|
| | | return urls
|
| | | },
|
| | | |
| | | getImageUrl(key){
|
| | | if(this.form[key].length){
|
| | | let urls = [];
|
| | | for(let i of this.form[key]){
|
| | | urls.push(i.name) |
| | | }
|
| | | return urls.join('、');
|
| | | }else {
|
| | | return "";
|
| | | }
|
| | | },
|
| | | |
| | | updatePlaceExt(data) {
|
| | | data['imageUrls'] = data['imageUrls'].join('、')
|
| | | data['planImageUrls'] = data['planImageUrls'].join('、')
|
| | | data['imageUrls'] = this.getImageUrl('imageUrls')
|
| | | data['planImageUrls'] = this.getImageUrl('planImageUrls')
|
| | | // data['imageUrls'] = data['imageUrls'].join('、')
|
| | | // data['planImageUrls'] = data['planImageUrls'].join('、')
|
| | | updatePlaceExtData({
|
| | | ...data
|
| | | }).then(res => {
|
| | |
| | | }
|
| | | uni.showToast({
|
| | | title: '提交成功',
|
| | | icon: 'success',
|
| | | complete() {
|
| | | setTimeout(() => {
|
| | | uni.navigateBack()
|
| | | }, 1500)
|
| | | }, 1000)
|
| | | }
|
| | | })
|
| | | })
|