doum
2025-08-19 05db93c48c69b1fc5db8bb2fce4c37014e92e450
h5/pages/report_dca/report_dca.vue
@@ -33,16 +33,17 @@
            </view>
         </u-form-item>
         <u-form-item label="DCA图片" labelWidth="120" prop="multifileList" labelPosition="top" borderBottom>
            <u-upload
            :fileList="model.multifileList"
            @afterRead="afterRead"
            @delete="deletePic"
            name="1"
            style="margin-top: 15rpx;" />
            <UploadImage
               :fileList="model.multifileList"
               folder="WORKORDER_FILE_PATH"
               @dele="deletePic"
               @getFileList="afterRead"
               style="margin-top: 15rpx;"
            />
         </u-form-item>
         <u-form-item label="通知人" labelWidth="120" prop="notifier" borderBottom required>
            <u--input v-model="model.notifier" border="none" placeholder="请输入通知人" disabledColor="#ffffff"
               disabled></u--input>
            <u--textarea v-model="model.notifier" border="none" placeholder="请输入通知人" disabledColor="#ffffff"
               disabled></u--textarea>
         </u-form-item>
      </u--form>
      <u-button type="primary" text="提交" @click="submit" style="margin-top: 60rpx;"></u-button>
@@ -90,9 +91,10 @@
<script>
   import { mapState } from 'vuex'
   import UploadImage from '@/components/uploadImage/uploadImage.vue'
   import pengTree from '@/uni_modules/peng-tree/peng-tree/peng-tree.vue'
   export default {
      components: { pengTree },
      components: { pengTree, UploadImage },
      computed: {
         ...mapState(['userInfo'])
      },
@@ -163,10 +165,13 @@
            time1: new Date().getTime(),
            address: [],
            theme: [],
            total: 0
            total: 0,
            list: []
         };
      },
      onLoad() {
         this.model.submitDate = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM:ss')
         this.model.happenTime = uni.$u.timeFormat(new Date().getTime(), 'yyyy-mm-dd hh:MM:ss')
         this.model.companyName = this.userInfo.companyName
         this.getNotifier()
         this.getLocation()
@@ -177,10 +182,17 @@
            this.model.dcaYesNum = data.dcaYesNum
            this.model.dcaNoNum = data.dcaNoNum
            this.model.dcaNoProblemDTOList = data.dcaNoProblemDTOList
            this.list = data.list
         })
      },
      methods: {
         openG() {
            // this.theme = []
            this.total = 0
            this.list = []
            this.model.dcaYesNum = ''
            this.model.dcaNoNum = ''
            this.model.dcaNoProblemDTOList = []
            this.stopScroll()
            this.show2 = true
         },
@@ -191,6 +203,19 @@
         next() {
            this.canScroll()
            this.show6 = false
         },
         next1() {
            this.model.submitDate = ''
            this.model.happenTime = ''
            this.model.localtionName = ''
            this.model.localtionId = ''
            this.model.typeId = ''
            this.model.typeName = ''
            this.model.dcaYesNum = 0
            this.model.dcaNoNum = 0
            this.model.dcaNoProblemDTOList = []
            this.model.multifileList = []
            this.model.type = 1
         },
         toDesc() {
            this.canScroll()
@@ -203,6 +228,7 @@
         async report() {
            let res = await this.$u.api.workOrderCreate(this.model)
            if (res.code === 200) {
               this.next1()
               this.show4 = false
               this.id = res.data
               this.show6 = true
@@ -250,38 +276,31 @@
               })
               return
            }
            uni.navigateTo({
               url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}`
            })
            if (this.list.length > 0) {
               uni.setStorageSync('list', this.list);
               uni.navigateTo({
                  url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}&disable=1`
               })
            } else {
               uni.navigateTo({
                  url: `/pages/type_dca/type_dca?theme=${this.model.typeId}&themeName=${this.model.typeName}`
               })
            }
         },
         // 删除图片
         deletePic(event) {
            this.model.multifileList.forEach((item, index) => {
               if (item.imgaddr === event.file.imgaddr) {
                  this.model.multifileList.splice(index, 1)
               }
            })
         deletePic(index) {
            this.model.multifileList.splice(index, 1)
         },
         // 新增图片
         async afterRead(event) {
            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)
                  }
               }
            });
         afterRead(arr) {
            this.model.multifileList = [...this.model.multifileList, ...arr]
         },
         submit() {
            this.$refs.uForm.validate().then(res => {
               if (this.total === 0) return uni.showToast({
                  title: '请选择观察项',
                  icon: 'none'
               })
               this.show4 = true
            }).catch(errors => {