diff --git a/src/saas/AppCountryAlbum/components/report/Daily.vue b/src/saas/AppCountryAlbum/components/report/Daily.vue index 4c4b168d..1d9cc7fc 100644 --- a/src/saas/AppCountryAlbum/components/report/Daily.vue +++ b/src/saas/AppCountryAlbum/components/report/Daily.vue @@ -141,26 +141,33 @@ addPhoto () { uni.chooseImage({ - count: 1, + count: 9, sizeType: ['compressed'], success: res => { - this.$loading() - let formData = new FormData() - formData.append('file', res.tempFiles[0]) - this.$http.post('/admin/file/add2?type=image', formData).then(res => { - if (res.code === 0) { - this.richList.push({ - type: 'img', - value: res.data.url - }) - } else { - this.$u.toast(res.msg) - } + res.tempFiles.forEach(v => { + this.upload(v) }) } }) }, + upload (img) { + let formData = new FormData() + formData.append('file', img) + + this.$loading() + this.$http.post('/admin/file/add2?type=image', formData).then(res => { + if (res.code === 0) { + this.richList.push({ + type: 'img', + value: res.data.url + }) + } else { + this.$u.toast(res.msg) + } + }) + }, + confirm () { if (!this.content) { return this.$u.toast('文本不能为空') diff --git a/src/saas/AppCountryAlbum/components/report/InspectLog.vue b/src/saas/AppCountryAlbum/components/report/InspectLog.vue index eabb59e1..4c5a2b23 100644 --- a/src/saas/AppCountryAlbum/components/report/InspectLog.vue +++ b/src/saas/AppCountryAlbum/components/report/InspectLog.vue @@ -150,26 +150,33 @@ addPhoto () { uni.chooseImage({ - count: 1, + count: 9, sizeType: ['compressed'], success: res => { - this.$loading() - let formData = new FormData() - formData.append('file', res.tempFiles[0]) - this.$http.post('/admin/file/add2?type=image', formData).then(res => { - if (res.code === 0) { - this.richList.push({ - type: 'img', - value: res.data.url - }) - } else { - this.$u.toast(res.msg) - } + res.tempFiles.forEach(v => { + this.upload(v) }) } }) }, + upload (img) { + let formData = new FormData() + formData.append('file', img) + + this.$loading() + this.$http.post('/admin/file/add2?type=image', formData).then(res => { + if (res.code === 0) { + this.richList.push({ + type: 'img', + value: res.data.url + }) + } else { + this.$u.toast(res.msg) + } + }) + }, + confirm () { if (!this.content) { return this.$u.toast('文本不能为空') diff --git a/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue b/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue index 6e465c34..51660a14 100644 --- a/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue +++ b/src/saas/AppCountryAlbum/components/report/MeetingMminutes.vue @@ -171,26 +171,33 @@ addPhoto () { uni.chooseImage({ - count: 1, + count: 9, sizeType: ['compressed'], success: res => { - this.$loading() - let formData = new FormData() - formData.append('file', res.tempFiles[0]) - this.$http.post('/admin/file/add2?type=image', formData).then(res => { - if (res.code === 0) { - this.richList.push({ - type: 'img', - value: res.data.url - }) - } else { - this.$u.toast(res.msg) - } + res.tempFiles.forEach(v => { + this.upload(v) }) } }) }, + upload (img) { + let formData = new FormData() + formData.append('file', img) + + this.$loading() + this.$http.post('/admin/file/add2?type=image', formData).then(res => { + if (res.code === 0) { + this.richList.push({ + type: 'img', + value: res.data.url + }) + } else { + this.$u.toast(res.msg) + } + }) + }, + confirm () { if (!this.content) { return this.$u.toast('文本不能为空') diff --git a/src/saas/AppCountryAlbum/components/report/WorkReport.vue b/src/saas/AppCountryAlbum/components/report/WorkReport.vue index aec60669..91a69c3f 100644 --- a/src/saas/AppCountryAlbum/components/report/WorkReport.vue +++ b/src/saas/AppCountryAlbum/components/report/WorkReport.vue @@ -141,27 +141,33 @@ addPhoto () { uni.chooseImage({ - count: 1, + count: 9, sizeType: ['compressed'], success: res => { - this.$loading() - let formData = new FormData() - formData.append('file', res.tempFiles[0]) - this.$http.post('/admin/file/add2?type=image', formData).then(res => { - console.log(res) - if (res.code === 0) { - this.richList.push({ - type: 'img', - value: res.data.url - }) - } else { - this.$u.toast(res.msg) - } + res.tempFiles.forEach(v => { + this.upload(v) }) } }) }, + upload (img) { + let formData = new FormData() + formData.append('file', img) + + this.$loading() + this.$http.post('/admin/file/add2?type=image', formData).then(res => { + if (res.code === 0) { + this.richList.push({ + type: 'img', + value: res.data.url + }) + } else { + this.$u.toast(res.msg) + } + }) + }, + confirm () { if (!this.content) { return this.$u.toast('文本不能为空')