diff --git a/src/views/train/synInfo/components/sendUtil.vue b/src/views/train/synInfo/components/sendUtil.vue index ef2a763..444b5e2 100644 --- a/src/views/train/synInfo/components/sendUtil.vue +++ b/src/views/train/synInfo/components/sendUtil.vue @@ -44,6 +44,17 @@ + + + + + @@ -59,9 +70,11 @@ import vueQr from 'vue-qr' import Treeselect from '@riophae/vue-treeselect' import { requestFN } from '@/utils/request' +import uploadFile from '../../../util/uploadFile/index.vue' +import { upload } from '@/utils/upload' export default { - components: { Treeselect, vueQr }, + components: { Treeselect, vueQr, uploadFile }, props: { appendToBody: { type: Boolean, @@ -95,6 +108,7 @@ export default { APPOINT_DEPARTMENT_NAME: '', APPOINT_USER_ID: '', APPOINT_USER_NAME: '', + APPOINT_ANNEX: [], user: '', tm: new Date().getTime(), list: [] @@ -108,6 +122,9 @@ export default { ], APPOINT_CORP_ID: [ { required: true, message: '请选择企业', trigger: 'change' } + ], + APPOINT_ANNEX: [ + { required: true, message: '请上传文件', trigger: 'change' } ] } } @@ -172,7 +189,12 @@ export default { this.$message.error('请填写完整信息') } else { this.form.list = this.heirloom - requestFN('/trainingbatch/sendMessage', this.form + const formData = new FormData() + Object.keys(this.form).map(key => { + formData.append(key, this.form[key]) + }) + formData.append('chenNuoShu', this.form.APPOINT_ANNEX[0].raw) + upload('/trainingbatch/sendMessage', formData ).then((data) => { if (data.code !== '0') { this.$message.error(data.msg) diff --git a/src/views/util/uploadFile/index.vue b/src/views/util/uploadFile/index.vue index 6e8428c..ba25c46 100644 --- a/src/views/util/uploadFile/index.vue +++ b/src/views/util/uploadFile/index.vue @@ -39,7 +39,7 @@ export default { }, info: { type: String, - default: '文件大小不超过500kb' + default: '文件大小不超过500MB' } }, data() {