cqf
2022-05-18 19261ea7afe047694c8b035ce18a0abe24118130
05181717
已修改4个文件
347 ■■■■ 文件已修改
src/api/sgyhpczl/hiddenDangerRegistration.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/oneFromanother.js 48 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanother/exist.vue 93 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/oneFromanother/index.vue 202 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/sgyhpczl/hiddenDangerRegistration.js
@@ -3,6 +3,10 @@
export function getPageList(data) {
    var arr=[]
    /*举一反三ID*/
    if(data.form.jyfsId!=null && data.form.jyfsId!=''){
        arr.push({field:"jyfsId",value:data.form.jyfsId,type:'OPT'})
    }
    /*编号*/
    if(data.form.number!=null && data.form.number!=''){
        arr.push({field:"number",value:data.form.number,type:'TXT'})
src/api/sgyhpczl/oneFromanother.js
@@ -5,12 +5,12 @@
export function getPageList(data) {
    var arr=[]
    /*下发单位*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
        arr.push({field:"ht_typesub",value:data.form.ht_typesub,type:'OPT'})
    if(data.form.push_branch!=null && data.form.push_branch!=''){
        arr.push({field:"push_branch",value:data.form.push_branch,type:'OPT'})
    }
    /*隐患单位*/
    if(data.form.ht_branch!=null && data.form.ht_branch!=''){
        arr.push({field:"ht_branch",value:data.form.ht_branch,type:'TXT'})
    if(data.form.ht_community!=null && data.form.ht_community!=''){
        arr.push({field:"ht_community",value:data.form.ht_community,type:'TXT'})
    }
    /*隐患类别*/
    if(data.form.ht_typesub!=null && data.form.ht_typesub!=''){
@@ -48,7 +48,43 @@
        data
    });
}
//不存在保存
export function noExistSave(data) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        url: "/taboi/analogy/no_exist_save",
        contentType: "application/json",
        method: 'POST',
        data
    });
}
//撤销
export function revoke(id) {
    return request({
        headers:{
            'token': getTokenAndVerify().token,
            'verify':getTokenAndVerify().verify
        },
        contentType: "multipart/form-data",
        url: "/taboi/analogy/revoke_do?id="+id,
        method: 'GET',
    });
}
//导出
export function analogy_export_do(data) {
    return request({
        headers: {
            'token': getTokenAndVerify().token,
            'verify': getTokenAndVerify().verify
        },
        url: '/taboi/excel/analogy_export_do',
        method: 'POST',
        responseType: 'arraybuffer',
        data
    });
}
src/views/oneFromanother/exist.vue
@@ -1,6 +1,6 @@
<template>
  <div class="app-container">
    <div style="">
    <div v-if="type == '0'" style="">
      <Titlename title="录入隐患单页面"></Titlename>
      <div class="whole-form">
        <el-form
@@ -116,7 +116,6 @@
                                </el-button>
                                <el-button
                                    size="mini"
                                    v-if="addShow"
                                    @click="deleteDanger(scope.row, scope.$index)"
                                >删除
                                </el-button>
@@ -139,7 +138,55 @@
        </el-form>
      </div>
    </div>
      <div v-else>
          <el-table :data="detailTableData" style="width: 100%" >
              <el-table-column type="selection" width="55" align="center"></el-table-column>
              <el-table-column prop="number" label="编号" align="center" width="120"></el-table-column>
              <el-table-column prop="check_branch" label="检查部门" align="center" width="120"></el-table-column>
              <el-table-column prop="check_man" label="检查人" align="center" width="120"></el-table-column>
              <el-table-column prop="checktype" label="检查类别" align="center"></el-table-column>
              <el-table-column label="隐患项目" align="center">
                  <el-table-column prop="check_date" label="检查时间" width="120" align="center"></el-table-column>
                  <el-table-column prop="address" label="地点" align="center"> </el-table-column>
                  <el-table-column prop="ht_content" label="内容" align="center"> </el-table-column>
                  <el-table-column prop="ht_typesub" label="类别" align="center"> </el-table-column>
                  <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
              </el-table-column>
              <el-table-column label="整改计划" align="center">
                  <el-table-column prop="measure" label="整改措施" align="center"> </el-table-column>
                  <el-table-column prop="ht_branch" label="隐患部门" align="center"> </el-table-column>
                  <el-table-column prop="duty_officer" label="责任人" align="center"> </el-table-column>
                  <el-table-column prop="alter_time" label="限改时间" width="120" align="center"></el-table-column>
                  <el-table-column prop="ht_level" label="级别" align="center"> </el-table-column>
              </el-table-column>
              <el-table-column label="整改情况" align="center">
                  <el-table-column prop="ACCOMPLISHTIME" label="完成时间" width="110px" align="center"> </el-table-column>
                  <el-table-column prop="CALLBACKRESULT" label="复查结果" align="center"> </el-table-column>
                  <el-table-column prop="CALLBACKPERSON" label="复查人" align="center"> </el-table-column>
                  <el-table-column prop="CALLBACKTIME" label="复查时间"  width="120" align="center"></el-table-column>
              </el-table-column>
              <el-table-column  label="隐患处理状态" align="center">
                  <template slot-scope="scope">
                      <span v-if="scope.row.step =='1'">初始状态</span>
                      <span v-if="scope.row.step =='2'">整改中</span>
                      <span v-if="scope.row.step =='3'">复查中</span>
                      <span v-if="scope.row.step =='end'">处理结束</span>
                  </template>
              </el-table-column>
              <el-table-column prop="DTRisk_bankId" label="是否关联" align="center">
                  <template slot-scope="scope">
                      <span v-if="scope.row.DTRisk_bankId==0 || scope.row.DTRisk_bankId=='' || scope.row.DTRisk_bankId==null">未关联</span>
                      <span v-else>已关联</span>
                  </template>
              </el-table-column>
              <el-table-column prop="DTRisk_level" label="风险等级" align="center"> </el-table-column>
              <el-table-column prop="warningLevel" label="初始警情" align="center"> </el-table-column>
              <el-table-column prop="curWarningLevel" label="当前警情" align="center"> </el-table-column>
          </el-table>
          <el-button style="margin-top: 20px" @click="returnIndex">关闭</el-button>
      </div>
      <el-dialog
          :title="title"
          :visible.sync="dialogVisible"
@@ -295,8 +342,9 @@
              </el-row>
          </el-form>
      </el-dialog>
  </div>
</template>
<script>
@@ -314,7 +362,7 @@
        initYHLX,
        initYwks
    } from "@/api/sgyhpczl/initSelect";
    import {initDangerRebound} from '@/api/sgyhpczl/hiddenDangerRegistration'
    import {getPageList,initDangerRebound} from '@/api/sgyhpczl/hiddenDangerRegistration'
    import {deepClone} from '@/utils'
    export default {
@@ -322,7 +370,7 @@
  name: "hiddenDangerList",
  data() {
    return {
        addShow:true,
        type: '0',
        id:'',
        rowIndex:-1,
        dangerList:[],
@@ -363,6 +411,15 @@
          },
        tableData: [],
        paramsData: {},//上个页面参数
        listQuery:{
            page:1,
            limit:10,
            form:{},
        },
        currentPage: 1,
        pageSize: 10,
        recordTotal: 0,
        detailTableData:[],//隐患详情列表
    };
  },
@@ -377,8 +434,13 @@
        this.initYWKS()
        this.initWXY()
        this.initDangerRebound()
        this.id = this.$route.query.id;
        this.type = this.$route.query.type;
        if (this.type === '0'){
        this.initInfo(this.$route.query.data);
        }else {
            this.listQuery.form.jyfsId = this.$route.query.data.id
            this.getPageList();
        }
    },
  methods: {
      initInfo(data){
@@ -427,9 +489,18 @@
              }
          });
      },
      getPageList(){
          this.listQuery.page=1
          getPageList(this.listQuery).then(res=>{
              if (res.data.ok==1) {
                  this.detailTableData = res.data.data.items
                  this.recordTotal=res.data.data.total
              }else{
                  this.$message({type:'error', message:res.data.msg, duration:3000})
              }
          })
      },
      deleteDanger(row, index) {
          this.$confirm('确认删除吗', '提示', {
              confirmButtonText: '确认',
              cancelButtonText: '取消',
@@ -591,7 +662,7 @@
            if(this.judge(this.tableData[0])){
                this.$message({type:'error', message:"请完整录入隐患", duration:2000})
            }
            if(this.addShow){
            // if(this.addShow){
                console.log(this.ruleForm)
                saveDanger(this.ruleForm).then(res=>{
                    if (res.data.ok==1){
@@ -603,7 +674,7 @@
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            }else {
            // }else {
                // var param=deepClone(this.ruleForm)
                // var obj=deepClone(this.tableData[0])
                // param.ht_branch=obj.ht_branch
@@ -630,7 +701,7 @@
                //         this.$message({type:'error', message:res.data.msg, duration:3000})
                //     }
                // })
            }
            // }
src/views/oneFromanother/index.vue
@@ -2,7 +2,7 @@
    <div class="app-container">
            <el-form ref="form" :inline="true" class="inquire" :model="listQuery" label-width="80px">
            <el-form-item label="下发单位">
               <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
               <el-select v-model="listQuery.form.push_branch" placeholder="请选择">
                    <el-option
                        v-for="item in XFDWList"
                        :key="item.value"
@@ -12,10 +12,10 @@
                </el-select>
            </el-form-item>
            <el-form-item label="隐患单位">
                <el-input v-model="listQuery.form.ht_branch" style="width:202px"></el-input>
                <el-input v-model="listQuery.form.ht_community" style="width:202px"></el-input>
            </el-form-item>
            <el-form-item label="隐患类别">
                <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择">
                <el-select v-model="listQuery.form.checktype" placeholder="请选择">
                    <el-option
                        v-for="item in YHLBList"
                        :key="item.value"
@@ -71,16 +71,16 @@
        </el-form>
     <el-row class="title-center">
            <el-col :span="10">
              <el-radio-group v-model="radio1">
            <el-radio-button label="待自查">待自查</el-radio-button>
            <el-radio-button label="已自查">已自查</el-radio-button>
                <el-radio-group v-model="listQuery.type" @change="radioChange">
                    <el-radio-button label="0">待自查</el-radio-button>
                    <el-radio-button label="1">已自查</el-radio-button>
          </el-radio-group>
            </el-col>
            <el-col :span="14" v-if="radio1=='待自查'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理专业</el-button>
            </el-col>
              <el-col :span="14" v-if="radio1=='已自查'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="sendBath()">撤销</el-button>
<!--            <el-col :span="14" v-if="type=='待自查'" style="text-align:right;">-->
<!--                <el-button class="btns" type="primary" size="small" @click="sendBath()">管理专业</el-button>-->
<!--            </el-col>-->
              <el-col :span="14" v-if="listQuery.type=='1'" style="text-align:right;">
                <el-button class="btns" type="primary" size="small" @click="revoke()">撤销</el-button>
            </el-col>
        </el-row>
         <el-table
@@ -89,7 +89,7 @@
            style="width: 100%"
            @selection-change="changeBox">
            <el-table-column type="selection" width="55" align="center"></el-table-column>
          <el-table-column prop="check_date" label="检查时间" width="120" align="center">
          <el-table-column prop="check_date" label="检查时间" width="120" :formatter="formatColumnDate" align="center">
                    <!-- <template slot-scope="scope">
                        <label>{{ formatDate(scope.row.check_date)}}</label><br/>
                        <label>{{ scope.row.check_class}}</label>
@@ -101,13 +101,13 @@
            <el-table-column prop="ht_typesub" label="隐患类别" align="center"></el-table-column>
            <el-table-column prop="ht_level" label="隐患级别" align="center"></el-table-column>
            <el-table-column prop="address" label="隐患地点" align="center"></el-table-column>
            <el-table-column prop="ht_content" label="内容" width="200" align="center"></el-table-column>
            <el-table-column prop="ht_content" show-overflow-tooltip label="内容" width="200" align="center"></el-table-column>
            <el-table-column prop="push_branch" label="下发单位" align="center"></el-table-column>
            <el-table-column prop="date" label="流程操作" align="center">
                <template slot-scope="scope">
                    <el-button @click="handleClick(scope.row)" type="text"  size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="radio1=='已自查'" size="small">追查结果</el-button>
                    <el-button @click="handleClick(scope.row,'存在')" type="text"  v-if="radio1=='待自查'" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row,'不存在')"  v-if="scope.row.jyfsFlag=='1'" type="text"  size="small">不存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.type=='0' || scope.row.jyfsFlag=='0'" size="small">存在</el-button>
                    <el-button @click="handleClick(scope.row)" type="text" v-if="listQuery.type=='1'" size="small">追查结果</el-button>
                </template>
            </el-table-column>
        </el-table>
@@ -124,14 +124,36 @@
            >
            </el-pagination>
        </div>
        <el-dialog title="填写自查结果" :visible.sync="selfInspectVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px">
            <el-form ref="selfInspectForm" :rules="selfInspectFormRules" :model="selfInspectForm" label-position="right" label-width="80px">
                <el-form-item label="自查人" prop="markUserName">
                    <el-input v-model="selfInspectForm.markUserName" class="analyseUnit_input"></el-input>
                </el-form-item>
                <el-form-item label="自查时间" prop="markDate">
                    <el-col :span="11">
                        <el-date-picker type="date" placeholder="选择日期" v-model="selfInspectForm.markDate"
                                        style="width: 100%;" value-format="yyyy-MM-dd">
                        </el-date-picker>
                    </el-col>
                </el-form-item>
                <el-form-item label="备注" prop="remark">
                    <el-input v-model="selfInspectForm.remark" type="textarea" rows="5" class="analyseUnit_input"></el-input>
                </el-form-item>
            </el-form>
            <div  align="right">
                <el-button @click="selfInspectVisible = false">取消</el-button>
                <el-button type="primary" @click="submitSelfInspect()">确认</el-button>
            </div>
        </el-dialog>
    </div>
</template>
<script>
    import { getPageList } from "@/api/sgyhpczl/oneFromanother"
    import { getPageList, noExistSave, revoke, analogy_export_do} from "@/api/sgyhpczl/oneFromanother"
    import {initJCBM, initYHLX, initJCLB, initYHJB} from "@/api/sgyhpczl/initSelect";
    export default{
        name: 'index',
        data(){
            return{
                listQuery:{
@@ -148,10 +170,19 @@
                YHJBList:[],
                JCLBList:[],
                tableData:[],
                exportData:[],
                selectedList:[],
                radio1:'待自查',
                listLoading: false,
                selfInspectVisible: false,
                selfInspectForm:{
                    id: '',
                    markUserName:'',
                    markDate:'',
                    remark:'',
                },
                selfInspectFormRules:{
                    markUserName: [{ required: true, message: '自查人不能为空', trigger: 'blur' }],
                    markDate: [{ required: true, message: '自查时间不能为空', trigger: 'blur' }]
                },
            }
        },
        mounted() {
@@ -162,16 +193,59 @@
            this.initYHLB();
        },
        methods:{
            sendBath(){
                this.$router.push({
                    path:'/manage'
            revoke(){
                if (this.selectedList.length > 1 || this.selectedList.length === 0) {
                    this.$message({type:'warning', message:'请选择一条记录', duration:3000})
                    return
                }
                this.$confirm('确认撤销吗','提示', {
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(()=>{
                    revoke(this.selectedList[0].id).then((res)=>{
                        if (res.data.ok==1) {
                            this.getPageList();
                            this.$notify({
                                title: "成功",
                                message: "撤销成功",
                                type: "success",
                                duration: 2000,
                            });
                        }else{
                            this.$message({type:'error', message:res.data.msg, duration:3000})
                        }
                    })
                })
            },
            handleClick(data,val){
                if(val=='存在'){
                if(!val){
                    this.$router.push({
                        path:'/exist'
                        path:'/exist',
                        query: {
                            data: data,
                            type: this.listQuery.type
                        }
                    })
                    return
                }
                if(val=='不存在'){
                    this.$nextTick(() =>{
                        this.$refs["selfInspectForm"].clearValidate()
                    })
                    this.selfInspectVisible = true
                    this.selfInspectForm.id = data.id
                    if (this.listQuery.type == '1'){
                        initYHLX().then(res=>{
                            if (res.data.ok==1){
                                this.selfInspectForm.remark=res.data.data[0].value
                            } else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                }
            },
            initXFDW(){
@@ -210,10 +284,28 @@
                    }
                })
            },
            checkTime(){
                if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查结束时间", duration:3000})
                        return
                    }
                }
                if(this.listQuery.form.check_dateEnd!=null && this.listQuery.form.check_dateEnd!=''){
                    if(this.listQuery.form.check_dateStart!=null && this.listQuery.form.check_dateStart!=''){
                    }else {
                        this.$message({type:'error', message:"请选择检查开始时间", duration:3000})
                        return
                    }
                }
            },
            //搜索
            getPageList(){
                this.listQuery.page=1
                // this.checkTime()
                this.checkTime()
                getPageList(this.listQuery).then(res=>{
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
@@ -224,6 +316,11 @@
                })
            },
            reset(){
                this.listQuery.form={};
                this.getPageList()
            },
            radioChange(val){
                this.listQuery.type = val;
                this.getPageList()
            },
            changeBox(val){
@@ -240,7 +337,60 @@
                this.listQuery.page = val
                this.getPageListForPagination();
            },
            getPageListForPagination(){
                this.checkTime()
                getPageList(this.listQuery).then(res=>{
                    if (res.data.ok==1) {
                        this.tableData = res.data.data.items
                        this.recordTotal=res.data.data.total
                    }else{
                        this.$message({type:'error', message:res.data.msg, duration:3000})
                    }
                })
            },
            submitSelfInspect(){
                this.$refs["selfInspectForm"].validate((valid) =>{
                    if (valid){
                        noExistSave(this.selfInspectForm).then((res)=>{
                            if (res.data.ok==1) {
                                this.$message({type:'success', message:"保存成功", duration:3000});
                                this.selfInspectVisible = false
                            }else{
                                this.$message({type:'error', message:res.data.msg, duration:3000})
                            }
                        })
                    }
                })
            },
            exportData() {
                var requestData = this.listQuery;
                //删除分页参数
                this.$delete(requestData, 'page')
                this.$delete(requestData, 'limit')
                analogy_export_do(requestData).then(res => {
                    var blob = new Blob([res.data])
                    var downloadElement = document.createElement('a')
                    var href = window.URL.createObjectURL(blob) //创建下载的链接
                    downloadElement.href = href
                    downloadElement.download = '举一反三隐患.xlsx' //下载后文件名
                    document.body.appendChild(downloadElement)
                    downloadElement.click() //点击下载
                    document.body.removeChild(downloadElement) //下载完成移除元素
                    window.URL.revokeObjectURL(href) //释放掉blob对象
                }).catch(err => {
                    console.log(err)
                })
            },
            //日期格式转换
            formatColumnDate(row, column) {
                // 获取单元格数据
                let data = row[column.property]
                if (data == null) {
                    return null
                }
                let dt = new Date(data)
                return dt.getFullYear() + '-' + (dt.getMonth() + 1) + '-' + dt.getDate() + ' '
            },
        }
    }
</script>