ll
liukangdong
2024-12-23 fbe39da5114ac1f9d9b7d7341e29ed39a3c73535
h5/pages/staff/task/vDangetAppr.vue
@@ -88,8 +88,8 @@
                     v-if="info.status == 2 && index == flowList.length - 1" />
                  <image v-if="item.avatar != null && item.avatar != ''" :src="item.avatar" class="img" alt="" />
                  <!-- <image v-else src="@/static/default_avatar.png" class="img" mode=""></image> -->
                  <span v-if="item.avatar == null || item.avatar == ''"
                     class="img_name">{{ item.createUserName && item.createUserName.slice(0, 1) }}</span>
                  <span v-if="item.avatar == null || item.avatar == ''" class="img_name">{{ item.createUserName &&
                     item.createUserName.slice(0, 1) }}</span>
               </view>
               <view class="content">
                  <view class="head">
@@ -311,8 +311,8 @@
      dealHiddenDanger,
      transferHiddenDanger,
      findListFlowDanger
   } from '@/api';
   import dayjs from 'dayjs';
} from '@/api'
import dayjs from 'dayjs'
   export default {
      data() {
         return {
@@ -375,24 +375,24 @@
            videoPlay: false,
            videoContext: null,
            videoUrl: ''
         };
      }
      },
      onLoad(op) {
         uni.setStorageSync('ywinfo',{})
         this.id = op.id;
         this.getDetail();
      this.id = op.id
      this.getDetail()
      },
      methods: {
         priviewImage(url) {
            uni.previewImage({
               urls: [url]
            });
         })
         },
         screenChange(e) {
            let fullScreen = e.detail.fullScreen; // 值true为进入全屏,false为退出全屏
         let fullScreen = e.detail.fullScreen // 值true为进入全屏,false为退出全屏
            if (!fullScreen) {
               //退出全屏
               this.videoPlay = false; // 隐藏播放盒子
            this.videoPlay = false // 隐藏播放盒子
            }
         },
         closeVideo() {
@@ -400,58 +400,57 @@
            this.videoContext = null
         },
         videoClick(item, i) {
            this.videoPlay = true;
            this.videoContext = uni.createVideoContext("myvideo", this); // this这个是实例对象 必传
            this.videoUrl = item.fileurlFull;
            this.videoContext.requestFullScreen();
         this.videoPlay = true
         this.videoContext = uni.createVideoContext("myvideo", this) // this这个是实例对象 必传
         this.videoUrl = item.fileurlFull
         this.videoContext.requestFullScreen()
            this.$nextTick(() => {
               this.videoContext.play();
            this.videoContext.play()
            })
         },
         handleOpen() {
            this.isShowHandle = true;
         this.isShowHandle = true
            const submitFileList = this.info.submitFileList || []
            this.dealBeforeFileList = [...submitFileList]
            this.submitFileList = [...submitFileList];
            this.$set(this.handleParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'));
         this.submitFileList = [...submitFileList]
         this.$set(this.handleParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
         },
         handleBack() {
            this.isShowBack = true;
         this.isShowBack = true
            // const submitFileList = this.info.submitFileList || []
            // this.submitFileList = [...submitFileList];
            this.dealBeforeFileList = []
            this.$set(this.backParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'));
         this.$set(this.backParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
         },
         getDetail() {
            const {
               id
            } = this;
         } = this
            hiddenDangerDetail(id).then(res => {
               this.info = res.data;
            });
            this.info = res.data
         })
            findListFlowDanger({
               hiddenDangerId: id
            }).then(res => {
               this.flowList = res.data;
            });
            this.flowList = res.data
         })
         },
         onSubmit() {
            const {
               dealBeforeFileList,
               dealAfterFileList,
               handleParam
            } = this;
         } = this
            if (dealBeforeFileList.length === 0)
               return uni.showToast({
                  title: '请上传整改前图片或视频',
                  icon: 'none'
               });
            })
            if (dealAfterFileList.length === 0)
               return uni.showToast({
                  title: '请上传整改后图片或视频',
                  icon: 'none'
               });
            })
            dealHiddenDanger({
               ...handleParam,
               dealBeforeFileList: dealBeforeFileList,
@@ -460,49 +459,49 @@
               id: this.id
            }).then(res => {
               if (res.code === 200) {
                  this.isShowHandle = false;
               this.isShowHandle = false
                  setTimeout(() => {
                     uni.showToast({
                        title: '操作成功',
                        icon: 'success'
                     });
                  });
                  uni.navigateBack();
                  })
               })
               uni.navigateBack()
               }
            });
         })
         },
         enterTransfer() {
            const {
               transferParam,
               id
            } = this;
         } = this
            if (!transferParam.id)
               return uni.showToast({
                  title: '请选择人员',
                  icon: 'none'
               });
            })
            transferHiddenDanger({
               checkUserId: transferParam.id,
               id
            }).then(res => {
               if (res.code === 200) {
                  this.isShowTransfer = false;
               this.isShowTransfer = false
                  setTimeout(() => {
                     uni.showToast({
                        title: '操作成功',
                        icon: 'success'
                     });
                  });
                  uni.navigateBack();
                  })
               })
               uni.navigateBack()
               }
            });
         })
         },
         changeMem(e) {
            this.transferParam = e;
         this.transferParam = e
         },
         handleTransfer() {
            this.isShowTransfer = true;
            this.getMemList();
         this.isShowTransfer = true
         this.getMemList()
         },
         getMemList() {
            findHiddenAreaMemberList({
@@ -510,22 +509,22 @@
               id: this.info.areaId,
               ...this.pagination
            }).then(res => {
               this.memberList = res.data || [];
            });
            this.memberList = res.data || []
         })
         },
         confirmBackDate(e) {
            this.$set(this.backParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
            this.isShowBackDate = false;
         this.$set(this.backParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'))
         this.isShowBackDate = false
         },
         confirmHandleDate(e) {
            this.$set(this.handleParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'));
            this.isShowHandleDate = false;
         this.$set(this.handleParam, 'dealTime', dayjs(e.value).format('YYYY-MM-DD HH:mm:ss'))
         this.isShowHandleDate = false
         },
         onSubBack() {
            const {
               dealBeforeFileList,
               backParam
            } = this;
         } = this
            dealHiddenDanger({
               ...backParam,
               dealBeforeFileList,
@@ -533,37 +532,37 @@
               id: this.id
            }).then(res => {
               if (res.code === 200) {
                  this.isShowBack = false;
               this.isShowBack = false
                  setTimeout(() => {
                     uni.showToast({
                        title: '操作成功',
                        icon: 'success'
                     });
                  });
                  uni.navigateBack();
                  })
               })
               uni.navigateBack()
               }
            });
         })
         },
         fileDel(str, i) {
            this[str].splice(i, 1);
         this[str].splice(i, 1)
         },
         uploadBeImage() {
            this.showUploadBe = false;
            let token = uni.getStorageSync('token') || '';
         this.showUploadBe = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseImage({
               count: 9,
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
                  const tempFilePaths = chooseImageRes.tempFilePaths;
               })
               const tempFilePaths = chooseImageRes.tempFilePaths
                  let imgs = tempFilePaths.map((value, index) => {
                     return {
                        name: 'file',
                        uri: value
                     };
                  });
                  }
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     files: imgs,
@@ -575,41 +574,41 @@
                        Dm_user_token: token
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        let obj = {
                           type: '0'
                        };
                     }
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 0;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.dealBeforeFileList.push(i);
                           });
                           i.type = 0
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.dealBeforeFileList.push(i)
                        })
                        }
                     },
                     fail(err) {
                        console.log('err', err);
                     console.log('err', err)
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                        // if (i === chooseImageRes.tempFilePaths.length - 1) {
                        //   uni.hideLoading()
                        // }
                     }
                  });
               })
               }
            });
         })
         },
         uploadBeVideo() {
            this.showUploadBe = false;
            let token = uni.getStorageSync('token') || '';
         this.showUploadBe = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseVideo({
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     filePath: chooseImageRes.tempFilePath,
@@ -621,40 +620,40 @@
                        folder: 'HIDDEN_DANGER_FILE'
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 1;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.dealBeforeFileList.push(i);
                           });
                           i.type = 1
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.dealBeforeFileList.push(i)
                        })
                        }
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                     }
                  });
               })
               }
            });
         })
         },
         uploadAfImage() {
            this.showUploadAf = false;
            let token = uni.getStorageSync('token') || '';
         this.showUploadAf = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseImage({
               count: 9,
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
                  const tempFilePaths = chooseImageRes.tempFilePaths;
               })
               const tempFilePaths = chooseImageRes.tempFilePaths
                  let imgs = tempFilePaths.map((value, index) => {
                     return {
                        name: 'file',
                        uri: value
                     };
                  });
                  }
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     files: imgs,
@@ -666,38 +665,38 @@
                        Dm_user_token: token
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 0;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.dealAfterFileList.push(i);
                           });
                           i.type = 0
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.dealAfterFileList.push(i)
                        })
                        }
                     },
                     fail(err) {
                        console.log('err', err);
                     console.log('err', err)
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                        // if (i === chooseImageRes.tempFilePaths.length - 1) {
                        //   uni.hideLoading()
                        // }
                     }
                  });
               })
               }
            });
         })
         },
         uploadAfVideo() {
            this.showUploadAf = false;
            let token = uni.getStorageSync('token') || '';
         this.showUploadAf = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseVideo({
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     filePath: chooseImageRes.tempFilePath,
@@ -709,40 +708,40 @@
                        folder: 'HIDDEN_DANGER_FILE'
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 1;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.dealAfterFileList.push(i);
                           });
                           i.type = 1
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.dealAfterFileList.push(i)
                        })
                        }
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                     }
                  });
               })
               }
            });
         })
         },
         uploadImage() {
            this.showUpload = false;
            let token = uni.getStorageSync('token') || '';
         this.showUpload = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseImage({
               count: 9,
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
                  const tempFilePaths = chooseImageRes.tempFilePaths;
               })
               const tempFilePaths = chooseImageRes.tempFilePaths
                  let imgs = tempFilePaths.map((value, index) => {
                     return {
                        name: 'file',
                        uri: value
                     };
                  });
                  }
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     files: imgs,
@@ -754,38 +753,38 @@
                        Dm_user_token: token
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 0;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.submitFileList.push(i);
                           });
                           i.type = 0
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.submitFileList.push(i)
                        })
                        }
                     },
                     fail(err) {
                        console.log('err', err);
                     console.log('err', err)
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                        // if (i === chooseImageRes.tempFilePaths.length - 1) {
                        //   uni.hideLoading()
                        // }
                     }
                  });
               })
               }
            });
         })
         },
         uploadVideo() {
            this.showUpload = false;
            let token = uni.getStorageSync('token') || '';
         this.showUpload = false
         let token = uni.getStorageSync('token') || ''
            uni.chooseVideo({
               success: chooseImageRes => {
                  uni.showLoading({
                     title: '上传中',
                     mask: true
                  });
               })
                  uni.uploadFile({
                     url: `${uploadUrl}`,
                     filePath: chooseImageRes.tempFilePath,
@@ -797,25 +796,25 @@
                        folder: 'HIDDEN_DANGER_FILE'
                     },
                     success: uploadFileRes => {
                        let res = JSON.parse(uploadFileRes.data);
                     let res = JSON.parse(uploadFileRes.data)
                        if (res.data && res.data.length > 0) {
                           res.data.forEach(i => {
                              i.type = 1;
                              i.fileurl = i.imgaddr;
                              i.fileurlFull = i.url;
                              this.submitFileList.push(i);
                           });
                           i.type = 1
                           i.fileurl = i.imgaddr
                           i.fileurlFull = i.url
                           this.submitFileList.push(i)
                        })
                        }
                     },
                     complete() {
                        uni.hideLoading();
                     uni.hideLoading()
                     }
                  });
               })
               }
            });
         })
         }
      }
   };
}
</script>
<style lang="scss">
@@ -1299,6 +1298,7 @@
         margin: 0 -30rpx;
      }
   }
   .video_wrap {
         position: relative;
         border: 1px solid;
@@ -1315,6 +1315,7 @@
            transform: translate(-50%, -50%);
         }
      }
   .sel_upload_wrap {
      width: 100%;
      border-top: 1px solid #333333;
@@ -1423,6 +1424,7 @@
      display: flex;
      align-items: center;
      z-index: 9990;
      .bg {
         background-color: rgba(0, 0, 0, .6);
         position: absolute;