From c819024e241b9f7c54cc3786373ad0d2998f2190 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 05 五月 2023 08:55:46 +0800 Subject: [PATCH] 修改 --- src/views/oneFromanother/index.vue | 73 ++++++++++++++++++++++++------------ 1 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/views/oneFromanother/index.vue b/src/views/oneFromanother/index.vue index a62ce0c..6a33880 100644 --- a/src/views/oneFromanother/index.vue +++ b/src/views/oneFromanother/index.vue @@ -15,7 +15,7 @@ <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.checktype" placeholder="请选择"> + <el-select v-model="listQuery.form.ht_typesub" placeholder="请选择"> <el-option v-for="item in YHLBList" :key="item.value" @@ -38,7 +38,7 @@ <el-input v-model="listQuery.form.address" style="width:202px" placeholder="请输入内容"></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 JCLBList" :key="item.value" @@ -101,7 +101,17 @@ <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" show-overflow-tooltip label="内容" width="200" align="center"></el-table-column> + <el-table-column prop="ht_content" label="内容" width="200" align="center"> + <template slot-scope="scope"> + <el-popover trigger="hover" placement="top"> + <p>{{ scope.row.ht_content }}</p> + <div slot="reference" class="name-wrapper">{{ + scope.row.ht_content != null && scope.row.ht_content.length > 10 ? scope.row.ht_content.substring(0, 8) + "...." : scope.row.ht_content + }} + </div> + </el-popover> + </template> + </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"> @@ -124,7 +134,7 @@ > </el-pagination> </div> - <el-dialog title="填写自查结果" :visible.sync="selfInspectVisible" :modal-append-to-body="false" :close-on-click-modal="false" width="600px"> + <el-dialog :title="selfTitle" :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> @@ -140,16 +150,16 @@ <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 align="center"> + <el-button type="primary" v-if="listQuery.type == '0'" @click="submitSelfInspect()">确认</el-button> + <el-button @click="selfInspectVisible = false">关闭</el-button> </div> </el-dialog> </div> </template> <script> - import { getPageList, noExistSave, revoke, analogy_export_do} from "@/api/sgyhpczl/oneFromanother" + import { getPageList, noExistSave,selfCheckNotInfo, revoke, analogy_export_do} from "@/api/sgyhpczl/oneFromanother" import {initJCBM, initYHLX, initJCLB, initYHJB} from "@/api/sgyhpczl/initSelect"; export default{ @@ -179,6 +189,7 @@ markDate:'', remark:'', }, + selfTitle: '', selfInspectFormRules:{ markUserName: [{ required: true, message: '自查人不能为空', trigger: 'blur' }], markDate: [{ required: true, message: '自查时间不能为空', trigger: 'blur' }] @@ -219,34 +230,38 @@ }) }, handleClick(data,val){ - if(!val){ - this.$router.push({ - path:'/exist', - query: { - data: data, - type: this.listQuery.type - } - }) - return - } if(val=='不存在'){ this.$nextTick(() =>{ this.$refs["selfInspectForm"].clearValidate() }) + this.selfInspectForm={id:data.id} this.selfInspectVisible = true - this.selfInspectForm.id = data.id if (this.listQuery.type == '1'){ - initYHLX().then(res=>{ + let params = { + id: data.id, + type: 0, + } + selfCheckNotInfo(params).then(res=>{ if (res.data.ok==1){ - this.selfInspectForm.remark=res.data.data[0].value + this.selfInspectForm=res.data.data[0] } else{ this.$message({type:'error', message:res.data.msg, duration:3000}) } }) } - - + return } + let puType = '0'; + if (this.listQuery.type=='1' && data.jyfsFlag=='0'){ + puType = '1'; + } + this.$router.push({ + path:'/exist', + query: { + data: data, + type: puType + } + }) }, initXFDW(){ initJCBM(1).then(res=>{ @@ -306,7 +321,9 @@ getPageList(){ this.listQuery.page=1 this.checkTime() + this.listLoading = true getPageList(this.listQuery).then(res=>{ + this.listLoading = false if (res.data.ok==1) { this.tableData = res.data.data.items this.recordTotal=res.data.data.total @@ -319,8 +336,14 @@ this.listQuery.form={}; this.getPageList() }, + //自查切换 radioChange(val){ this.listQuery.type = val; + if (val == '0'){ + this.selfTitle = '填写自查结果' + }else { + this.selfTitle = '查看自查结果' + } this.getPageList() }, changeBox(val){ @@ -363,11 +386,13 @@ }) }, exportData() { - var requestData = this.listQuery; + this.listLoading = true + var requestData = JSON.parse(JSON.stringify(this.listQuery)); //删除分页参数 this.$delete(requestData, 'page') this.$delete(requestData, 'limit') analogy_export_do(requestData).then(res => { + this.listLoading = false var blob = new Blob([res.data]) var downloadElement = document.createElement('a') var href = window.URL.createObjectURL(blob) //创建下载的链接 -- Gitblit v1.9.2