From 03eaa258e9f6ae5aceb9e26989cd1025d35de147 Mon Sep 17 00:00:00 2001
From: Lou <luzhiping@qqyjz.com>
Date: Sat, 11 Nov 2023 21:51:30 +0800
Subject: [PATCH] merge
---
subPackage/workbench/views/editExamine.vue | 120 ++++++++++++++++++++++++++++++++++++------------------------
1 files changed, 72 insertions(+), 48 deletions(-)
diff --git a/subPackage/workbench/views/editExamine.vue b/subPackage/workbench/views/editExamine.vue
index d7edc75..3166e89 100644
--- a/subPackage/workbench/views/editExamine.vue
+++ b/subPackage/workbench/views/editExamine.vue
@@ -52,7 +52,7 @@
<script>
import {
- updatePlaceExtData,
+ updatePlaceExtData,
getPlaceDetail
} from '@/api/placeExp/placeExp.js'
import uploadMixin from "@/mixin/uploadMixin";
@@ -65,8 +65,8 @@
},
data() {
return {
- form: {
- id: '',
+ form: {
+ id: '',
placeId: '',
localtion: '',
placeName: '',
@@ -97,44 +97,68 @@
}
},
onShow() {
- this.curSelectSite = uni.getStorageSync('siteInfo')
+ this.curSelectSite = uni.getStorageSync('siteInfo')
this.getCsDetails()
+ // this.getLocation()
},
- methods: {
- getCsDetails() {
- getPlaceDetail({
- placeId: this.curSelectSite.id
- }).then(detailRes => {
- const { code, data } = detailRes
- if (code !== 200) {
- uni.showToast({
- title: '数据请求失败',
- icon: 'error'
- })
- return
- }
- 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()
- }
+ methods: {
+ // getLocation() {
+ // uni.chooseLocation({
+ // success: (res) => {
+ // console.log(res);
+ // }
+ // })
+ // },
+ getCsDetails() {
+ getPlaceDetail({
+ placeId: this.curSelectSite.id
+ }).then(detailRes => {
+ const {
+ code,
+ data
+ } = detailRes
+ if (code !== 200) {
+ uni.showToast({
+ title: '数据请求失败',
+ icon: 'error'
+ })
+ return
+ }
+ const placePractitioner = data?.placePractitioner || []
+ 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.personNum = placePractitioner.length
- this.$nextTick(() => {
- console.log(placePractitioner);
- this.$refs.formItemRef.forEach((item, index) => {
- item.form = placePractitioner[index]
- })
- })
- })
- },
+
+ console.log(this.form);
+ this.personNum = placePractitioner.length
+ this.$nextTick(() => {
+ console.log(placePractitioner);
+ this.$refs.formItemRef.forEach((item, index) => {
+ item.form = placePractitioner[index]
+ })
+ })
+ })
+ },
updatePlaceExt(data) {
- data['imageUrls'] = JSON.stringify(data['imageUrls'])
- data['planImageUrls'] = JSON.stringify(data['planImageUrls'])
- updatePlaceExtData({...data}).then(res => {
- const { code } = res
+ data['imageUrls'] = data['imageUrls'].join('、')
+ data['planImageUrls'] = data['planImageUrls'].join('、')
+ updatePlaceExtData({
+ ...data
+ }).then(res => {
+ const {
+ code
+ } = res
if (code !== 200) {
uni.showToast({
title: '提交失败',
@@ -151,19 +175,19 @@
}, 1500)
}
})
- })
- },
- addPerson() {
- this.personNum++
- },
- submit() {
- const placePractitioner = []
+ })
+ },
+ addPerson() {
+ this.personNum++
+ },
+ submit() {
+ const placePractitioner = []
this.$refs.formItemRef.forEach(item => {
- item.form.placeId = this.form.placeId
- placePractitioner.push(item.form)
- })
+ item.form.placeId = this.form.placeId
+ placePractitioner.push(item.form)
+ })
this.form.placePractitioner = placePractitioner
- this.updatePlaceExt(this.form)
+ this.updatePlaceExt(this.form)
},
pushPage() {
this.$u.func.globalNavigator('/subPackage/workbench/views/cshw')
--
Gitblit v1.9.3