| | |
| | | :fileList="model.multifileList" |
| | | @afterRead="afterRead" |
| | | @delete="deletePic" |
| | | multiple |
| | | name="1" |
| | | style="margin-top: 15rpx;" /> |
| | | </u-form-item> |
| | |
| | | this.show2 = false |
| | | }, |
| | | next() { |
| | | this.model.submitDate = '' |
| | | this.model.happenTime = '' |
| | | this.model.companyName = '' |
| | | this.model.localtionName = '' |
| | | this.model.localtionId = '' |
| | | this.model.typeId = '' |
| | | this.model.typeName = '' |
| | | this.model.notifier = '' |
| | | this.model.dcaYesNum = 0 |
| | | this.model.dcaNoNum = 0 |
| | | this.model.dcaNoProblemDTOList = [] |
| | | this.model.multifileList = [] |
| | | this.model.type = 1 |
| | | this.canScroll() |
| | | this.show6 = false |
| | | }, |
| | |
| | | }, |
| | | // 新增图片 |
| | | async afterRead(event) { |
| | | var that = this |
| | | uni.showLoading({ title: '上传中...', mask: true }) |
| | | uni.uploadFile({ |
| | | url: this.$baseUrl + '/web/public/upload', |
| | | filePath: event.file.url, |
| | | name: "file", |
| | | url: this.$baseUrl + '/web/public/uploadBatch', |
| | | files: event.file.map(e => { |
| | | return { name: 'files', uri: e.url } |
| | | }), |
| | | formData: { |
| | | folder: "WORKORDER_FILE_PATH" |
| | | }, |
| | | success: (res) => { |
| | | folder: "WORKORDER_FILE_PATH", |
| | | }, |
| | | success(res) { |
| | | uni.hideLoading(); |
| | | let obj = JSON.parse(res.data) |
| | | if (obj.code === 200) { |
| | | obj.data.fileurl = obj.data.imgaddr |
| | | this.model.multifileList.push(obj.data) |
| | | console.log(obj.data) |
| | | obj.data.forEach(item => { |
| | | item.fileurl = item.imgaddr |
| | | }) |
| | | that.model.multifileList = [...that.model.multifileList, ...obj.data] |
| | | } |
| | | } |
| | | }); |
| | | }) |
| | | // uni.uploadFile({ |
| | | // url: this.$baseUrl + '/web/public/upload', |
| | | // filePath: event.file.url, |
| | | // name: "file", |
| | | // formData: { |
| | | // folder: "WORKORDER_FILE_PATH" |
| | | // }, |
| | | // success: (res) => { |
| | | // let obj = JSON.parse(res.data) |
| | | // if (obj.code === 200) { |
| | | // obj.data.fileurl = obj.data.imgaddr |
| | | // this.model.multifileList.push(obj.data) |
| | | // } |
| | | // } |
| | | // }); |
| | | }, |
| | | submit() { |
| | | this.$refs.uForm.validate().then(res => { |
| | | if (this.total === 0) return uni.showToast({ |
| | | title: '请选择观察项', |
| | | icon: 'none' |
| | | }) |
| | | this.show4 = true |
| | | }).catch(errors => { |
| | | |