jiangping
2025-04-18 015b4f31cebbecf6f6da760ed2f8af3da721e802
h5/pages/report_dca/report_dca.vue
@@ -37,6 +37,7 @@
            :fileList="model.multifileList"
            @afterRead="afterRead"
            @delete="deletePic"
            multiple
            name="1"
            style="margin-top: 15rpx;" />
         </u-form-item>
@@ -189,6 +190,19 @@
            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
         },
@@ -264,24 +278,50 @@
         },
         // 新增图片
         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"
                  folder: "WORKORDER_FILE_PATH",
               },   
               success: (res) => {
               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 => {