jiangping
2025-04-18 015b4f31cebbecf6f6da760ed2f8af3da721e802
h5/pages/reporting_she/reporting_she.vue
@@ -48,18 +48,18 @@
            <u--input v-model="model.remark" border="none" placeholder="如选择其它区域请务必填写具体位置"></u--input>
         </u-form-item>
         <u-form-item label="是否外部就医" labelWidth="120" prop="outJiuyi" borderBottom required>
            <u-radio-group v-model="model.outJiuyi" placement="row">
            <u-radio-group v-model="model.outJiuyi" placement="row" @change="model.isYiwushi = ''; model.isHurted = ''">
               <u-radio label="否" name="0"></u-radio>
               <u-radio label="是" name="1"></u-radio>
            </u-radio-group>
         </u-form-item>
         <u-form-item label="是否医务室" labelWidth="120" prop="isYiwushi" borderBottom required>
            <u-radio-group v-model="model.isYiwushi" placement="row">
         <u-form-item label="是否医务室" labelWidth="120" prop="isYiwushi" borderBottom required v-if="model.outJiuyi === '0'">
            <u-radio-group v-model="model.isYiwushi" placement="row" @change="model.isHurted = ''">
               <u-radio label="否" name="0"></u-radio>
               <u-radio label="是" name="1"></u-radio>
            </u-radio-group>
         </u-form-item>
         <u-form-item label="是否受伤" labelWidth="120" prop="isHurted" borderBottom required>
         <u-form-item label="是否受伤" labelWidth="120" prop="isHurted" borderBottom required v-if="model.isYiwushi === '0'">
            <u-radio-group v-model="model.isHurted" placement="row">
               <u-radio label="否" name="0"></u-radio>
               <u-radio label="是" name="1"></u-radio>
@@ -85,6 +85,7 @@
               @afterRead="afterRead"
               @delete="deletePic"
               accept="image"
               multiple
               name="1"
               style="margin-top: 15rpx;"></u-upload>
         </u-form-item>
@@ -317,6 +318,27 @@
            }
         },
         next() {
            this.model.name = ''
            this.model.submitDate = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM')
            this.model.companyName = ''
            this.model.happenTime = ''
            this.model.memberType = ''
            this.model.memberTypeName = ''
            this.model.memberNames = ''
            this.model.memberQwids = ''
            this.model.localtionId = ''
            this.model.localtionName = ''
            this.model.remark = ''
            this.model.outJiuyi = ''
            this.model.isYiwushi = ''
            this.model.isHurted = ''
            this.model.typeId = ''
            this.model.typeName = ''
            this.model.workRelated = ''
            this.model.eventInfo = ''
            this.model.multifileList = []
            this.model.fileList = []
            this.model.type = 0
            this.canScroll()
            this.show4 = false
         },
@@ -337,45 +359,37 @@
         },
         // 新增图片
         async afterRead(event) {
            // event.file.forEach(async (item) => {
            //    const filePath = item.url
            //    uni.uploadFile({
            //       url: this.$baseUrl + '/web/public/upload',
            //       filePath,
            //       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)
            //          }
            //       }
            //    });
            // })
            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]
                  }
               }
            });
            })
         },
         // 提交
         submit() {
            var that = this
            that.$refs.uForm.validate().then(async () => {
               let res = await that.$u.api.workOrderCreate(that.model)
               let form = JSON.parse(JSON.stringify(that.model))
               form.submitDate = form.submitDate + ':00'
               form.happenTime = form.happenTime + ':00'
               let res = await that.$u.api.workOrderCreate(form)
               if (res.code === 200) {
                  that.id = res.data
                  this.stopScroll()