k94314517
2024-10-16 17efddc6a667670dca682bf36b51a43e99615e6d
admin/src/components/business/OperaHiddenDangerWindow.vue
@@ -13,8 +13,8 @@
            <div class="time">提报时间:{{model.createDate}}</div>
          </div>
          <div class="right" v-if="model.status==0">待处理</div>
          <div class="right" v-if="model.status==1">已处理</div>
          <div class="right" v-if="model.status==2">已撤销</div>
          <div class="right"  style="background:#53b76f " v-if="model.status==1">已处理</div>
          <div class="right" style="background:#dc362e "  v-if="model.status==2">已退回</div>
        </div>
        <div class="info">
          <div class="title">隐患提报详情</div>
@@ -43,7 +43,6 @@
                  <video
                      v-if="item.fileurlFull && item.fileurlFull.endsWith('.mp4')"
                      ref="videoRef"
                      autoplay
                      controls
                      preload="auto"
                      style="width: 80px;height: 80px;object-fit: contain;"
@@ -116,9 +115,9 @@
          <div class="item" v-for="(item,index) in logList" :key="item.id">
            <div class="separate" v-if="index < logList.length-1"></div>
            <div class="info">
              <i class="el-icon-success icon" v-if="(model.status ==1) || index < logList.length-1"></i>
              <i class="el-icon-question icon1" v-if="(model.status==0)  && index == logList.length-1"></i>
              <i class="el-icon-error icon2" v-if="(model.status==2)  && index == logList.length-1"></i>
              <img src="@/assets/icons/ic_tongguo.png"   class="iconnew" v-if="(model.status ==1) || index < logList.length-1"/>
              <img src="@/assets/icons/ic_dangqian.png"   class="iconnew"   v-if="(model.status==0)  && index == logList.length-1"/>
              <img src="@/assets/icons/ic_jujue.png"  class="iconnew"   v-if="(model.status==2)  && index == logList.length-1"/>
              <img v-if="item.avatar!=null && item.avatar !=''" :src="item.avatar" class="avatar" alt="" />
              <img v-if="item.avatar ==null ||item.avatar ==''"  src="@/assets/avatar/man.png" class="avatar" alt="" />
              <div class="content">
@@ -144,33 +143,16 @@
    </div>
    <!--  -->
    <template   v-slot:footer>
      <el-button @click="dealDo"  type="primary"  v-if="model.status==0&& model.checkUserId == userInfo.memberId"  class="status-red">处理</el-button>
      <el-button @click="openHandModal"  type="primary"  v-if="model.status==0&& model.checkUserId == userInfo.memberId"  class="status-red">处理</el-button>
      <el-button type="primary" plain v-if="model.status==0 && model.checkUserId == userInfo.memberId" @click="handleTransfer">转交</el-button>
      <el-button @click="backDo"  v-if="model.status==0&& model.checkUserId == userInfo.memberId" type="danger"  >退回</el-button>
      <el-button @click="openBackModal"  v-if="model.status==0&& model.checkUserId == userInfo.memberId" type="danger"  >退回</el-button>
      <el-button @click="visible=false">返回</el-button>
    </template>
    <!--  同意/拒绝 -->
    <el-dialog
        append-to-body
        :title="apprTitle"
        :visible.sync="isShowAppr"
        width="480px"
    >
      <el-input
          type="textarea"
          :placeholder="apprTitle + '说明,非必填'"
          :rows="4"
          v-model="param.explain"
      />
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowAppr = false">取消</el-button>
        <el-button type="primary" @click="isShowAppr = false">确定</el-button>
      </span>
    </el-dialog>
    <el-dialog
        append-to-body
        title="转交"
        style="text-align: center"
        class="dialogCl"
        :visible.sync="isShowTransfer"
        width="480px"
    >
@@ -188,42 +170,74 @@
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowTransfer = false">取消</el-button>
        <el-button type="primary" @click="transferSubmit">确定</el-button>
        <el-button type="primary" :loading="transfering" @click="transferSubmit">确定</el-button>
      </span>
    </el-dialog>
    <!-- 隐患 -->
    <el-dialog
        append-to-body
        title="隐患"
        title="隐患处理"
        class="dialogCl"
        :visible.sync="isShowProblem"
        width="480px"
        width="600px"
    >
      <el-form :model="param" :rules="rules" ref="ruleForm" label-width="100px">
        <el-form-item label="退回时间">
      <el-form :model="dealForm" :rules="rulesDeal" ref="dealForm" label-width="100px">
        <el-form-item label="整改时间" prop="checkDate">
          <el-date-picker
              class="w300"
              value-format="yyyy-MM-dd"
              type="date"
              placeholder="选择日期"
              v-model="param.date"
              type="datetime"
              value-format="yyyy-MM-dd HH:mm:ss"
              placeholder="选择整改时间"
              v-model="dealForm.checkDate"
          />
        </el-form-item>
        <el-form-item label="整改前">
        <el-form-item label="整改前" prop="dealBeforeFileList">
          <div class="df_ac">
            <img src="@/assets/avatar/man.png" />
            <el-upload
                class="avatar-uploader"
                action="https://jsonplaceholder.typicode.com/posts/"
                :show-file-list="false"
                :on-success="handleAvatarSuccess"
                :before-upload="beforeAvatarUpload"
            >
              <img v-if="param.url" :src="param.url" class="avatar" />
              <div v-else class="upload_box">
                <el-icon class="el-icon-plus icon" />
                <div class="text">图片/视频</div>
              </div>
            </el-upload>
            <upload  width="80px" height="80px" :list="dealForm.dealBeforeFileList" :tips="'图片/视频'"  accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true" @dele="dele($event,0)" @success="uploadFileList($event, 0)" />
          </div>
        </el-form-item>
        <el-form-item label="整改后" prop="dealAfterFileList">
          <div class="df_ac">
            <upload   width="80px" height="80px" :list="dealForm.dealAfterFileList"  :tips="'图片/视频'"   accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true"  @dele="dele($event,1)" @success="uploadFileList($event, 1)" />
          </div>
        </el-form-item>
        <el-form-item label="处理说明">
          <el-input
              type="textarea"
              placeholder="请填写说明"
              :rows="4"
              v-model="dealForm.checkInfo"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowProblem = false">取消</el-button>
        <el-button type="primary" :loading="dealing" @click="dealDo"
        >确定</el-button
        >
      </span>
    </el-dialog>
    <el-dialog
        append-to-body
        title="隐患退回"
        class="dialogCl"
        :visible.sync="isBackProblem"
        width="600px"
    >
      <el-form :model="backForm" :rules="rulesBack" ref="backForm" label-width="100px">
        <el-form-item label="退回时间" prop="checkDate">
          <el-date-picker
              class="w300"
              value-format="yyyy-MM-dd HH:mm:ss"
              type="datetime"
              placeholder="选择退回时间"
              v-model="backForm.checkDate"
          />
        </el-form-item>
        <el-form-item label="图片/视频" prop="dealBeforeFileList">
          <div class="df_ac">
            <upload  width="80px" height="80px" :list="backForm.dealBeforeFileList" :tips="'图片/视频'"    accept=".png,.jpg,.jpeg,.mp4" folder="hiddendanger" @loading="uploading = true" @dele="dele($event,2)" @success="uploadFileList($event, 2)" />
          </div>
        </el-form-item>
        <el-form-item label="退回说明">
@@ -231,13 +245,13 @@
              type="textarea"
              placeholder="请填写说明"
              :rows="4"
              v-model="param.explain"
              v-model="backForm.checkInfo"
          />
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="isShowProblem = false">取消</el-button>
        <el-button type="primary" :loading="transfering" @click="isShowProblem = false"
        <el-button @click="isBackProblem= false">取消</el-button>
        <el-button type="primary" :loading="transfering" @click="backDo"
        >确定</el-button
        >
      </span>
@@ -248,10 +262,12 @@
<script>
import BaseOpera from '@/components/base/BaseOpera'
import GlobalWindow from '@/components/common/GlobalWindow'
import upload from '@/components/common/upload'
import dayjs from 'dayjs'
import { memberList } from '@/api/business/hiddenDangerParam'
import {mapMutations} from "vuex";
import { mapState } from 'vuex'
export default {
  components: { GlobalWindow },
  components: { GlobalWindow, upload },
  extends: BaseOpera,
  data () {
    return {
@@ -264,7 +280,10 @@
      isShowAppr: false,
      apprTitle: '同意',
      param: {},
      uploading: false,
      dealing: false,
      isShowProblem: false,
      isBackProblem: false,
      isShowTransfer: false,
      rules: {},
      rulesTrans: {
@@ -272,11 +291,45 @@
          { required: true, message: '请选择' }
        ]
      },
      rulesDeal: {
        checkDate: [
          { required: true, message: '请选择整改时间' }
        ],
        dealBeforeFileList: [
          { required: true, message: '请上传整改前情况' }
        ],
        dealAfterFileList: [
          { required: true, message: '请上传整改后情况' }
        ]
      },
      rulesBack: {
        checkDate: [
          { required: true, message: '请选择退回时间' }
        ]
        /*,
        dealBeforeFileList: [
          { required: true, message: '请上传整改前情况' }
        ] */
      },
      memberList: [],
      transForm: {
        memberId: null
      },
      dealForm: {
        checkDate: null,
        checkInfo: null,
        dealBeforeFileList: [],
        dealAfterFileList: []
      },
      backForm: {
        checkDate: null,
        checkInfo: null,
        dealBeforeFileList: []
      }
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  created () {
    this.config({
@@ -285,16 +338,158 @@
    })
  },
  methods: {
    ...mapMutations(['userInfo']),
    dealDo () { this.isShowProblem = true },
    backDo () { this.isShowProblem = true },
    openHandModal () {
      const { model } = this
      this.isShowProblem = true
      this.$set(this.dealForm, 'checkDate', dayjs().format('YYYY-MM-DD HH:mm:ss'))
      if (model.submitFileList && model.submitFileList.length > 0) {
        this.$set(this.dealForm, 'dealBeforeFileList', model.submitFileList.map(item => {
          return {
            fileurl: item.fileurl,
            name: item.name,
            url: item.fileurlFull
          }
        }))
      }
    },
    openBackModal () {
      this.isBackProblem = true
      this.$set(this.backForm, 'checkDate', dayjs().format('YYYY-MM-DD HH:mm:ss'))
    },
    dele (index, type) {
      if (type == 0) {
        if (this.dealForm.dealBeforeFileList != null && this.dealForm.dealBeforeFileList.length > index) {
          this.dealForm.dealBeforeFileList.splice(index, 1)
        }
      } else if (type == 1) {
        if (this.dealForm.dealAfterFileList != null && this.dealForm.dealAfterFileList.length > index) {
          this.dealForm.dealAfterFileList.splice(index, 1)
        }
      } else if (type == 2) {
        if (this.backForm.dealBeforeFileList != null && this.backForm.dealBeforeFileList.length > index) {
          this.backForm.dealBeforeFileList.splice(index, 1)
        }
      }
    },
    uploadFileList (e, objType) {
      if (objType === 0) {
        if (this.dealForm.dealBeforeFileList == null) {
          this.dealForm.dealBeforeFileList = []
        }
        this.dealForm.dealBeforeFileList.push({
          fileurl: e.imgaddr,
          url: e.url,
          name: e.originname,
          fileType: e.type
        })
      } else if (objType === 1) {
        if (this.dealForm.dealAfterFileList == null) {
          this.dealForm.dealAfterFileList = []
        }
        this.dealForm.dealAfterFileList.push({
          fileurl: e.imgaddr,
          url: e.url,
          name: e.originname,
          fileType: e.type
        })
      } else if (objType === 2) {
        if (this.backForm.dealBeforeFileList == null) {
          this.backForm.dealBeforeFileList = []
        }
        this.backForm.dealBeforeFileList.push({
          fileurl: e.imgaddr,
          url: e.url,
          name: e.originname,
          fileType: e.type
        })
      }
    },
    dealDo () {
      this.$refs.dealForm.validate((valid) => {
      // debugger
        if (!valid) {
          return
        }
        this.$dialog.actionConfirm('操作确认', '您确认提交该隐患处理情况吗?')
          .then(() => {
            this.dealing = true
            this.api.dealHiddenDanger({
              id: this.dataId,
              status: 1,
              dealTime: this.dealForm.checkDate,
              checkInfo: this.dealForm.checkInfo,
              dealBeforeFileList: this.dealForm.dealBeforeFileList,
              dealAfterFileList: this.dealForm.dealAfterFileList
            })
              .then(res => {
                this.$tip.apiSuccess('处理成功')
                this.getDetail()
                this.getLogList()
                this.$emit('success')
                this.isShowProblem = false
              })
              .catch(e => {
              })
              .finally(() => {
                this.dealing = false
              })
          })
      })
    },
    backDo () {
      this.$refs.backForm.validate((valid) => {
        if (!valid) {
          return
        }
        this.$dialog.actionConfirm('操作确认', '您确认退回该隐患处理情况吗?')
          .then(() => {
            this.dealing = true
            this.api.dealHiddenDanger({
              id: this.dataId,
              status: 2,
              dealTime: this.backForm.checkDate,
              checkInfo: this.backForm.checkInfo,
              dealBeforeFileList: this.backForm.dealBeforeFileList
            })
              .then(res => {
                this.$tip.apiSuccess('退回成功')
                this.getDetail()
                this.getLogList()
                this.$emit('success')
                this.isBackProblem = false
              })
              .catch(e => {
              })
              .finally(() => {
                this.dealing = false
              })
          })
      })
    },
    open (title, target) {
      this.title = title
      this.visible = true
      this.model = {}
      this.dataId = target.id
      this.getDetail()
      this.getLogList()
      this.$nextTick(() => {
        this.memberList = []
        this.transForm = {
          memberId: null
        }
        this.dealForm = {
          checkDate: null,
          checkInfo: null,
          dealBeforeFileList: [],
          dealAfterFileList: []
        }
        this.backForm = {
          checkDate: null,
          checkInfo: null,
          dealBeforeFileList: []
        }
        this.getDetail()
        this.getLogList()
      })
    },
    transferSubmit () {
      this.$refs.transForm.validate((valid) => {
@@ -313,6 +508,8 @@
                this.$tip.apiSuccess('转交成功')
                this.getDetail()
                this.getLogList()
                this.$emit('success')
                this.isShowTransfer = false
              })
              .catch(e => {
              })
@@ -320,7 +517,6 @@
                this.transfering = false
              })
          })
          .catch(() => {})
      })
    },
    getLogList () {
@@ -419,6 +615,7 @@
          .value {
            color: #111111;
            flex: 1;
          }
        }
      }
@@ -508,6 +705,11 @@
            color: #53b76f;
            font-size: 24px;
          }
          .iconnew{
            width: 24px;
            height: 24px;
          }
          .icon1 {
            position: relative;
            z-index: 11;
@@ -517,7 +719,7 @@
          .icon2 {
            position: relative;
            z-index: 11;
            color: red;
            color: #dc362e;
            font-size: 24px;
          }
          .avatar {
@@ -525,7 +727,7 @@
            height: 40px;
            border-radius: 50%;
            margin: 0 12px 0 16px;
            border: 1px solid;
            //border: 1px solid;
          }
          .content {
            flex: 1;