| | |
| | | <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" |
| | |
| | | </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" |
| | |
| | | </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> |
| | | <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 |
| | |
| | | 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> |
| | |
| | | <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> |
| | |
| | | > |
| | | </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:{ |
| | |
| | | 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() { |
| | |
| | | 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(){ |
| | |
| | | } |
| | | }) |
| | | }, |
| | | 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 |
| | |
| | | }) |
| | | }, |
| | | reset(){ |
| | | this.listQuery.form={}; |
| | | this.getPageList() |
| | | }, |
| | | radioChange(val){ |
| | | this.listQuery.type = val; |
| | | this.getPageList() |
| | | }, |
| | | changeBox(val){ |
| | |
| | | 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> |