diff --git a/src/project/pingchang/AppCheckpointRegistration/Edit.vue b/src/project/pingchang/AppCheckpointRegistration/Edit.vue index 29fe416e..67e97eae 100644 --- a/src/project/pingchang/AppCheckpointRegistration/Edit.vue +++ b/src/project/pingchang/AppCheckpointRegistration/Edit.vue @@ -187,14 +187,17 @@ export default { this.$http.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${this.id}`).then((res) => { if (res.code == 0) { this.form = res.data - this.travelType = res.data.travelType?.split(',') || [] + if(res.data.travelType) { + this.travelType = res.data.travelType?.split(',') + } + if(res.data.startTime) { this.form.startTime = res.data.startTime.substring(0, 16) } if(res.data.arriveTime) { this.form.arriveTime = res.data.arriveTime.substring(0, 16) } - console.log(this.form) + console.log(this.travelType) } }) }, diff --git a/src/project/pingchang/AppCommunityManagement/Edit.vue b/src/project/pingchang/AppCommunityManagement/Edit.vue index dc8100ce..08d92f66 100644 --- a/src/project/pingchang/AppCommunityManagement/Edit.vue +++ b/src/project/pingchang/AppCommunityManagement/Edit.vue @@ -255,9 +255,16 @@ export default { this.$http.post(`/app/appepidemicpreventionregisterinfo/queryDetailById?id=${this.id}`).then((res) => { if (res.code == 0) { this.form = res.data - this.travelType = res.data.travelType?.split(',') - this.form.startTime = res.data.startTime.substr(0, res.data.startTime.length - 3) - this.form.arriveTime = res.data.arriveTime.substr(0, res.data.arriveTime.length - 3) + if(res.data.travelType) { + this.travelType = res.data.travelType?.split(',') + } + + if(res.data.startTime) { + this.form.startTime = res.data.startTime.substring(0, 16) + } + if(res.data.arriveTime) { + this.form.arriveTime = res.data.arriveTime.substring(0, 16) + } } }) },