From f216078eeaf31e756399d0fb1fc998c6d8da8ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8A=B1=E6=9C=89=E6=B8=85=E9=A6=99=E6=9C=88=E6=9C=89?= =?UTF-8?q?=E9=98=B4?= <185154740@qq.com> Date: Mon, 28 Feb 2022 10:17:18 +0800 Subject: [PATCH] 27594 27623 --- src/mods/AppServiceOnlineNew/serviceForm.vue | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/mods/AppServiceOnlineNew/serviceForm.vue b/src/mods/AppServiceOnlineNew/serviceForm.vue index 2d4c60a..a5caa68 100644 --- a/src/mods/AppServiceOnlineNew/serviceForm.vue +++ b/src/mods/AppServiceOnlineNew/serviceForm.vue @@ -29,7 +29,7 @@ *

请上传{{ item.annexName }}

-
+

上传照片

@@ -347,7 +347,8 @@ export default { const i = e.target.dataset.i const dict = e.target.dataset.dict const value = e.detail.value - const key = this.$dict.getLabel(dict, value) + // const key = this.$dict.getLabel(dict, value) + const key = this.$dict.getDict(dict)[value].dictName this.$set(this.tableForm[index][i], 'fieldValue', value) this.$set(this.tableForm[index][i], 'fieldDictName', key) @@ -373,7 +374,7 @@ export default { /** * 图片上传 */ - upload(index) { + uploads(index) { uni.chooseImage({ count: 1, sizeType: ['compressed'], @@ -382,7 +383,7 @@ export default { const path = res.tempFilePaths[0] // this.$loading() uni.uploadFile({ - url: this.$instance.baseURL + '/admin/file/add', + url: this.$instance.config.baseURL + '/admin/file/add2', filePath: path, name: 'file', header: { @@ -391,10 +392,12 @@ export default { }, success: (res) => { const data = JSON.parse(res.data) - if (data.code === 0) { - this.$set(this.info.processAnnexDefs[index], 'src', data.data[0].split(';')[0]) - this.$set(this.info.processAnnexDefs[index], 'annexFileId', data.data[0].split(';')[1]) + // this.$set(this.info.processAnnexDefs[index], 'src', data.data[0].split(';')[0]) + // this.$set(this.info.processAnnexDefs[index], 'annexFileId', data.data[0].split(';')[1]) + + this.$set(this.info.processAnnexDefs[index], 'src', data.data.url) + this.$set(this.info.processAnnexDefs[index], 'id', data.data.id) } else { this.$toast(data.msg) } @@ -410,7 +413,7 @@ export default { next() { if (this.currIndex === 2) { for (let item of this.info.processAnnexDefs) { - if (item.mustFill === '1' && !item.annexFileId) { + if (item.mustFill === '1' && !item.id) { return this.$toast(`请上传${item.annexName}`) } }