jiangping
2024-06-28 43942a545271345ce26e40d82bb97138c5ea7611
h5/pages/staff/task/vDangetAppr.vue
@@ -1,13 +1,19 @@
<template>
  <view class="main_app">
    <view class="status_wrap">
      <view class="name">{{ info.name }}提交的{{ cateList[type].name }}</view>
      <view class="name">{{ info.categoryName }}</view>
      <view v-if="info.status == '0'" class="status">{{
        statusMap[info.status]
      }}</view>
      <image
        v-if="info.status == '1'"
        src="@/static/ic_yizhenggai.png"
        mode="widthFix"
        class="status_img"
      ></image>
      <image
        v-if="info.status == '2'"
        src="@/static/ic_passed@2x.png"
        src="@/static/ic_yituihui-1.png"
        mode="widthFix"
        class="status_img"
      ></image>
@@ -19,22 +25,24 @@
      ></image>
      <view>{{ info.content }}</view>
      <view class="file_list">
        <template v-for="item in info.submitFileList">
        <view
          class="img_wrap"
          v-for="item in info.submitFileList"
          :key="item.id"
        >
          <image
            v-if="item.type == 0"
            :key="item.id"
            :src="item.fileurlFull"
            mode="widthFix"
            class="img"
          />
          <video
            v-if="item.type == 1"
            :key="item.id"
            :src="item.fileurlFull"
            class="img"
            controls
          />
        </template>
        </view>
      </view>
      <view class="text_wrap">
        <view class="line">
@@ -52,14 +60,14 @@
    <view v-if="info.status == 1" class="module_list">
      <view class="item">
        <view class="label">处理结果</view>
        <!-- <view class="value">{{ info. }}</view> -->
        <view class="value primaryColor">{{ statusMap[info.status] }}</view>
      </view>
      <view class="item">
        <view class="label">整改前</view>
        <view class="value">
          <view
            class="adduser_list_item_ipt1_upload"
            v-for="(item, i) in dealBeforeFileList"
            v-for="(item, i) in info.dealBeforeFileList"
            :key="i"
            ><image
              v-if="item.type == 0"
@@ -75,7 +83,7 @@
        <view class="value">
          <view
            class="adduser_list_item_ipt1_upload"
            v-for="(item, i) in dealAfterFileList"
            v-for="(item, i) in info.dealAfterFileList"
            :key="i"
            ><image
              v-if="item.type == 0"
@@ -116,15 +124,24 @@
              "
            />
            <image
              v-if="item.status == 1"
              class="status"
              src="@/static/staff/liucheng_success@2x.png"
              mode="widthFix"
            />
            <image
              v-if="item.status == 2"
              class="status"
              src="@/static/staff/liucheng_fail@2x.png"
              mode="widthFix"
            />
          </view>
          <view class="content">
            <view class="head">
              <view class="event">{{ item.title }}</view>
              <view class="time">{{ item.checkDate }}</view>
              <view class="time" v-if="item.createDate">{{
                item.createDate.slice(0, 16)
              }}</view>
            </view>
            <view class="name_wrap">
              <text
@@ -160,12 +177,13 @@
      </view>
    </view>
    <view class="emyty"></view>
    <view class="main_footer">
      <view class="btn" @click="isShowBack = true">退回</view>
    <view v-if="info.approveDateVO!=null&& info.approveDateVO.canBeApproved!=null &&info.approveDateVO.canBeApproved ==1 && info.status == 0" class="main_footer" >
      <view class="btn" @click="handleBack">退回</view>
      <view class="btn transfer" @click="handleTransfer">转交</view>
      <view class="btn handle" @click="isShowHandle = true">处理</view>
      <view class="btn handle" @click="handleOpen">处理</view>
    </view>
    <!-- 退回 -->
    <u-popup
      :show="isShowBack"
      :round="10"
@@ -177,24 +195,36 @@
        <view class="title">隐患退回</view>
        <view class="df_sb">
          <view>退回时间</view>
          <view @click="isShowBackDate = true" v-if="backParam.dealTime">{{
            backParam.dealTime.slice(0, 16)
          }}</view>
          <view @click="isShowBackDate = true" v-else class="placeholder9"
            >请选择</view
          >
          <view
            class="df_ac"
            @click="isShowBackDate = true"
            v-if="backParam.dealTime"
            >{{ backParam.dealTime }}<u-icon name="arrow-right"></u-icon
          ></view>
          <view @click="isShowBackDate = true" v-else class="placeholder9 df_ac"
            >请选择<u-icon name="arrow-right"></u-icon
          ></view>
        </view>
        <view class="label">图片/视频</view>
        <view class="upload_wrap">
          <view class="adduser_list_item_ipt1_upload" @click="showUpload = true"
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon
          ></view>
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
            <view class="mt6">图片/视频</view>
          </view>
          <view
            class="adduser_list_item_ipt1_upload"
            v-for="(item, i) in submitFileList"
            :key="i"
            ><image
          >
            <u-icon
              class="close"
              size="20"
              name="close-circle-fill"
              color="red"
              @click="fileDel('submitFileList', i)"
            ></u-icon>
            <image
              v-if="item.type == 0"
              :src="item.fileurlFull"
              mode="widthFix"
@@ -220,18 +250,25 @@
      :round="10"
      :safeAreaInsetBottom="true"
      mode="bottom"
      @close="isShowBack = false"
      @close="isShowHandle = false"
    >
      <view class="appr_modal">
        <view class="title">隐患整改</view>
        <view class="df_sb">
          <view>整改时间</view>
          <view @click="isShowHandleDate = true" v-if="handleParam.dealTime">{{
            handleParam.dealTime.slice(0, 16)
          }}</view>
          <view @click="isShowHandleDate = true" v-else class="placeholder9"
            >请选择</view
          >
          <view
            class="df_ac"
            @click="isShowHandleDate = true"
            v-if="handleParam.dealTime"
            >{{ handleParam.dealTime }}
            <u-icon name="arrow-right"></u-icon>
          </view>
          <view
            @click="isShowHandleDate = true"
            v-else
            class="placeholder9 df_ac"
            >请选择<u-icon name="arrow-right"></u-icon
          ></view>
        </view>
        <view class="label"><text>*</text>整改前</view>
@@ -239,13 +276,22 @@
          <view
            class="adduser_list_item_ipt1_upload"
            @click="showUploadBe = true"
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon
          ></view>
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
            <view class="mt6">图片/视频</view>
          </view>
          <view
            class="adduser_list_item_ipt1_upload"
            v-for="(item, i) in dealBeforeFileList"
            :key="i"
            ><image
          >
            <u-icon
              class="close"
              size="20"
              name="close-circle-fill"
              color="red"
              @click="fileDel('dealBeforeFileList', i)"
            ></u-icon>
            <image
              v-if="item.type == 0"
              :src="item.fileurlFull"
              mode="widthFix"
@@ -258,13 +304,22 @@
          <view
            class="adduser_list_item_ipt1_upload"
            @click="showUploadAf = true"
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon
          ></view>
            ><u-icon name="plus" color="rgb(153, 153, 153)" size="28"></u-icon>
            <view class="mt6">图片/视频</view></view
          >
          <view
            class="adduser_list_item_ipt1_upload"
            v-for="(item, i) in dealAfterFileList"
            :key="i"
            ><image
          >
            <u-icon
              class="close"
              size="20"
              name="close-circle-fill"
              color="red"
              @click="fileDel('dealAfterFileList', i)"
            ></u-icon>
            <image
              v-if="item.type == 0"
              :src="item.fileurlFull"
              mode="widthFix"
@@ -336,6 +391,7 @@
          />
        </view>
        <view class="member_list">
          <view class="mt24 placeholder6">共{{ memberList.length }}条数据</view>
          <view v-for="item in memberList" :key="item.id" class="line">
            <image
              :src="
@@ -372,7 +428,7 @@
          <view class="empty"></view>
        </view>
        <view class="Transfer_footer">
          <view class="btn" @click="isShowTransfer = fale">取消</view>
          <view class="btn" @click="isShowTransfer = fales">取消</view>
          <view class="btn active" @click="enterTransfer">确认转交</view>
        </view>
      </view>
@@ -386,6 +442,7 @@
    ></u-datetime-picker>
    <u-datetime-picker
      :minDate="new Date().getTime()"
      :show="isShowHandleDate"
      @confirm="confirmHandleDate"
      @cancel="isShowHandleDate = false"
@@ -420,9 +477,9 @@
        { name: '物流车申请', id: 4 },
      ],
      statusMap: {
        0: '待审批',
        1: '审批中',
        2: '审批通过',
        0: '待处理',
        1: '已整改',
        2: '已退回',
        3: '审批未通过',
        4: '已取消',
        5: '他人或签',
@@ -459,6 +516,17 @@
    this.getDetail()
  },
  methods: {
    handleOpen() {
      this.isShowHandle = true
      console.log('info', this.info)
      this.dealBeforeFileList = [...this.info.submitFileList]
      this.$set(this.handleParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
    },
    handleBack() {
      this.isShowBack = true
      this.submitFileList = [...this.info.submitFileList]
      this.$set(this.backParam, 'dealTime', dayjs().format('YYYY-MM-DD HH:mm:ss'))
    },
    getDetail() {
      const { id } = this
      hiddenDangerDetail(id).then(res => {
@@ -467,6 +535,14 @@
    },
    onSubmit() {
      const { dealBeforeFileList, dealAfterFileList, handleParam } = 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,
@@ -488,6 +564,10 @@
    },
    enterTransfer() {
      const { transferParam, id } = this
      if (!transferParam.id) return uni.showToast({
        title: '请选择人员',
        icon: 'none'
      })
      transferHiddenDanger({
        checkUserId: transferParam.id,
        id
@@ -513,7 +593,10 @@
    },
    getMemList() {
      findHiddenAreaMemberList({
        model: { ...this.transferModel },
        model: {
          ...this.transferModel,
          id: this.info.areaId
         },
        ...this.pagination,
      }).then(res => {
        this.memberList = res.data || []
@@ -547,63 +630,86 @@
        }
      })
    },
    fileDel(str, i) {
      this[str].splice(i, 1)
    },
    uploadBeImage() {
      this.showUploadBe = false
      let token = uni.getStorageSync('token') || ''
      uni.chooseImage({
        count: 1,
        count: 4,
        success: (chooseImageRes) => {
          console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths)
          uni.showLoading({ title: '上传中', mask: true })
          for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
            uni.uploadFile({
              url: `${uploadUrl}`,
              filePath: chooseImageRes.tempFilePaths[i],
          const tempFilePaths = chooseImageRes.tempFilePaths
          let imgs = tempFilePaths.map((value, index) => {
            return {
              name: 'file',
              formData: {
                folderCode: 'HIDDEN_DANGER_FILE'
              },
              success: (uploadFileRes) => {
                let res = JSON.parse(uploadFileRes.data)
                console.log('res', res)
                let obj = {
                  type: '0'
                }
                obj.fileurl = res.data.halfPath
                obj.fileurlFull = res.data.addr
                this.dealBeforeFileList.push(obj)
              },
              complete() {
                if (i === chooseImageRes.tempFilePaths.length - 1) {
                  uni.hideLoading()
                }
              uri: value
            }
          })
          uni.uploadFile({
            url: `${uploadUrl}`,
            files: imgs,
            name: 'file',
            formData: {
              folder: 'HIDDEN_DANGER_FILE'
            },
            header: {
              Dm_user_token: token
            },
            success: (uploadFileRes) => {
              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)
                })
              }
            },
            fail(err) {
              console.log('err', err)
            },
            complete() {
              uni.hideLoading()
              // if (i === chooseImageRes.tempFilePaths.length - 1) {
              //   uni.hideLoading()
              // }
            }
          })
        }
      })
    },
    uploadBeVideo() {
      this.showUploadBe = false
      let that = this
      let token = uni.getStorageSync('token') || ''
      uni.chooseVideo({
        success: (chooseImageRes) => {
          uni.showLoading({ title: '上传中', mask: true })
          uni.uploadFile({
            url: `${uploadUrl}`,
            filePath: chooseImageRes.tempFilePath,
            header: {
              Dm_user_token: token
            },
            name: 'file',
            formData: {
              folderCode: 'HIDDEN_DANGER_FILE'
              folder: 'HIDDEN_DANGER_FILE'
            },
            success: (uploadFileRes) => {
              let res = JSON.parse(uploadFileRes.data)
              console.log('res', res)
              let obj = {
                type: '1'
              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)
                })
              }
              obj.fileurl = res.data.halfPath
              obj.fileurlFull = res.data.addr
              this.dealBeforeFileList.push(obj)
            },
            complete() {
              uni.hideLoading()
@@ -614,61 +720,78 @@
    },
    uploadAfImage() {
      this.showUploadAf = false
      let token = uni.getStorageSync('token') || ''
      uni.chooseImage({
        count: 1,
        count: 4,
        success: (chooseImageRes) => {
          console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths)
          uni.showLoading({ title: '上传中', mask: true })
          for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
            uni.uploadFile({
              url: `${uploadUrl}`,
              filePath: chooseImageRes.tempFilePaths[i],
          const tempFilePaths = chooseImageRes.tempFilePaths
          let imgs = tempFilePaths.map((value, index) => {
            return {
              name: 'file',
              formData: {
                folderCode: 'HIDDEN_DANGER_FILE'
              },
              success: (uploadFileRes) => {
                let res = JSON.parse(uploadFileRes.data)
                console.log('res', res)
                let obj = {
                  type: '0'
                }
                obj.fileurl = res.data.halfPath
                obj.fileurlFull = res.data.addr
                this.dealAfterFileList.push(obj)
              },
              complete() {
                if (i === chooseImageRes.tempFilePaths.length - 1) {
                  uni.hideLoading()
                }
              uri: value
            }
          })
          uni.uploadFile({
            url: `${uploadUrl}`,
            files: imgs,
            name: 'file',
            formData: {
              folder: 'HIDDEN_DANGER_FILE'
            },
            header: {
              Dm_user_token: token
            },
            success: (uploadFileRes) => {
              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)
                })
              }
            })
          }
            },
            fail(err) {
              console.log('err', err)
            },
            complete() {
              uni.hideLoading()
              // if (i === chooseImageRes.tempFilePaths.length - 1) {
              //   uni.hideLoading()
              // }
            }
          })
        }
      })
    },
    uploadAfVideo() {
      this.showUploadAf = false
      let that = this
      let token = uni.getStorageSync('token') || ''
      uni.chooseVideo({
        success: (chooseImageRes) => {
          uni.showLoading({ title: '上传中', mask: true })
          uni.uploadFile({
            url: `${uploadUrl}`,
            filePath: chooseImageRes.tempFilePath,
            header: {
              Dm_user_token: token
            },
            name: 'file',
            formData: {
              folderCode: 'HIDDEN_DANGER_FILE'
              folder: 'HIDDEN_DANGER_FILE'
            },
            success: (uploadFileRes) => {
              let res = JSON.parse(uploadFileRes.data)
              console.log('res', res)
              let obj = {
                type: '1'
              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)
                })
              }
              obj.fileurl = res.data.halfPath
              obj.fileurlFull = res.data.addr
              this.dealAfterFileList.push(obj)
            },
            complete() {
              uni.hideLoading()
@@ -679,61 +802,78 @@
    },
    uploadImage() {
      this.showUpload = false
      let token = uni.getStorageSync('token') || ''
      uni.chooseImage({
        count: 1,
        count: 4,
        success: (chooseImageRes) => {
          console.log('chooseImageRes.tempFilePaths', chooseImageRes.tempFilePaths)
          uni.showLoading({ title: '上传中', mask: true })
          for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
            uni.uploadFile({
              url: `${uploadUrl}`,
              filePath: chooseImageRes.tempFilePaths[i],
          const tempFilePaths = chooseImageRes.tempFilePaths
          let imgs = tempFilePaths.map((value, index) => {
            return {
              name: 'file',
              formData: {
                folderCode: 'HIDDEN_DANGER_FILE'
              },
              success: (uploadFileRes) => {
                let res = JSON.parse(uploadFileRes.data)
                console.log('res', res)
                let obj = {
                  type: '0'
                }
                obj.fileurl = res.data.halfPath
                obj.fileurlFull = res.data.addr
                this.submitFileList.push(obj)
              },
              complete() {
                if (i === chooseImageRes.tempFilePaths.length - 1) {
                  uni.hideLoading()
                }
              uri: value
            }
          })
          uni.uploadFile({
            url: `${uploadUrl}`,
            files: imgs,
            name: 'file',
            formData: {
              folder: 'HIDDEN_DANGER_FILE'
            },
            header: {
              Dm_user_token: token
            },
            success: (uploadFileRes) => {
              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)
                })
              }
            })
          }
            },
            fail(err) {
              console.log('err', err)
            },
            complete() {
              uni.hideLoading()
              // if (i === chooseImageRes.tempFilePaths.length - 1) {
              //   uni.hideLoading()
              // }
            }
          })
        }
      })
    },
    uploadVideo() {
      this.showUpload = false
      let that = this
      let token = uni.getStorageSync('token') || ''
      uni.chooseVideo({
        success: (chooseImageRes) => {
          uni.showLoading({ title: '上传中', mask: true })
          uni.uploadFile({
            url: `${uploadUrl}`,
            filePath: chooseImageRes.tempFilePath,
            header: {
              Dm_user_token: token
            },
            name: 'file',
            formData: {
              folderCode: 'HIDDEN_DANGER_FILE'
              folder: 'HIDDEN_DANGER_FILE'
            },
            success: (uploadFileRes) => {
              let res = JSON.parse(uploadFileRes.data)
              console.log('res', res)
              let obj = {
                type: '1'
              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)
                })
              }
              obj.fileurl = res.data.halfPath
              obj.fileurlFull = res.data.addr
              this.submitFileList.push(obj)
            },
            complete() {
              uni.hideLoading()
@@ -759,7 +899,7 @@
    padding: 30rpx 0;
    .flow_title {
      font-weight: 500;
      font-weight: 600;
      font-size: 32rpx;
      color: #222222;
      margin-bottom: 24rpx;
@@ -883,6 +1023,34 @@
      }
    }
  }
  .adduser_list_item_ipt1_upload {
      width: 120rpx;
      height: 120rpx;
      margin-right: 24rpx;
      border: 2rpx solid #e5e5e5;
      background: #f7f7f7;
      color: #666666;
      font-size: 22rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      position: relative;
      .close {
        position: absolute;
        right: -20rpx;
        top: -20rpx;
        z-index: 9999;
      }
      image {
        width: 100%;
        height: 100%;
      }
      video {
        width: 100%;
        max-height: 120rpx;
      }
    }
  .module_list {
    .item {
@@ -930,10 +1098,10 @@
    padding: 30rpx 0;
    .name {
      font-weight: 500;
      font-weight: 600;
      font-size: 32rpx;
      margin-bottom: 20rpx;
      color: #222222;
      color: $uni-color-primary;
    }
    .desc {
@@ -947,12 +1115,24 @@
      display: flex;
      flex-wrap: wrap;
      margin-bottom: 20rpx;
      .img_wrap {
        margin-top: 24rpx;
        width: 120rpx;
        height: 120rpx;
        margin-right: 24rpx;
        border: 2rpx solid #e5e5e5;
        background: #f7f7f7;
        color: #666666;
        font-size: 22rpx;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        position: relative;
      }
      .img {
        width: 140rpx;
        width: 120rpx;
        max-height: 120rpx;
        margin-right: 12rpx;
        margin-bottom: 12rpx;
        border-radius: 8rpx;
      }
    }
    .text_wrap {
@@ -1026,7 +1206,7 @@
  .appr_modal {
    padding: 36rpx 30rpx 0;
    .title {
      font-weight: 500;
      font-weight: 600;
      font-size: 32rpx;
      color: #222222;
      margin-bottom: 40rpx;
@@ -1090,15 +1270,23 @@
      color: #666666;
      font-size: 22rpx;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      position: relative;
      .close {
        position: absolute;
        right: -20rpx;
        top: -20rpx;
        z-index: 9999;
      }
      image {
        width: 100%;
        height: 100%;
      }
      video {
        width: 100%;
        max-height: 120rpx;
      }
    }
  }