| | |
| | | <el-row class="title-center"> |
| | | <el-col :span="7"> |
| | | <el-radio-group v-model="listQuery.form.alter_status"> |
| | | <el-radio-button v-for="item in statusList" :label="item.value" :key="item.value" @change.native="getPageList"></el-radio-button> |
| | | <el-radio-button v-for="item in statusList" :label="item.value" :key="item.value" |
| | | @change.native="getPageList"></el-radio-button> |
| | | </el-radio-group> |
| | | </el-col> |
| | | <el-col :span="10"> |
| | |
| | | class="btns" |
| | | size="small" |
| | | v-show="buttomShow" |
| | | @click="downTemplate" |
| | | icon="el-icon-download" |
| | | >下载模板 |
| | | </el-button |
| | |
| | | type="primary" |
| | | size="small" |
| | | v-show="!buttomShow" |
| | | @click="cancel()" |
| | | @click="revoke()" |
| | | >撤销 |
| | | </el-button |
| | | > |
| | | <el-button class="btns" type="primary" icon="el-icon-plus" @click="jump" size="small" v-show="buttomShow" |
| | | <el-button class="btns" type="primary" icon="el-icon-plus" @click="jump" size="small" |
| | | v-show="buttomShow" |
| | | >添加 |
| | | </el-button |
| | | > |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {getPageList, self_export_do, self_import_do, self_del_do} from "@/api/sgyhpczl/hiddenDangerManagement"; |
| | | import { |
| | | getPageList, |
| | | self_export_do, |
| | | self_import_do, |
| | | self_del_do, |
| | | self_revoke, |
| | | self_template |
| | | } from "@/api/sgyhpczl/hiddenDangerManagement"; |
| | | import {initJCBM, initYHLX, initBC, initJCLB, initYHBM, initYHJB, initReformStatus} from "@/api/sgyhpczl/initSelect"; |
| | | |
| | | export default { |
| | | data() { |
| | | return { |
| | | buttomShow:true, |
| | | buttomShow: true, |
| | | fileList: [], |
| | | statusList: [], |
| | | options: [], |
| | |
| | | this.initJCLB() |
| | | this.initReformStatus() |
| | | }, |
| | | watch:{ |
| | | "listQuery.form.alter_status":function (newVal,oldVal) { |
| | | watch: { |
| | | "listQuery.form.alter_status": function (newVal, oldVal) { |
| | | console.log(newVal) |
| | | if(newVal == "整改完成"){ |
| | | if (newVal == "整改完成") { |
| | | this.buttomShow = false; |
| | | }else{ |
| | | } else { |
| | | this.buttomShow = true; |
| | | } |
| | | } |
| | |
| | | }, |
| | | fillRectification() { |
| | | var checkData = this.$refs.dataTable.selection; |
| | | if(checkData.length < 1){ |
| | | if (checkData.length < 1) { |
| | | this.$message({type: 'warn', message: "请选择勾选需要填写的数据!", duration: 3000}) |
| | | return; |
| | | } |
| | | this.$router.push({ |
| | | path: "/fillRectification", |
| | | query:{"checkData":checkData} |
| | | query: {"checkData": checkData} |
| | | }) |
| | | }, |
| | | fillInspector() { |
| | | var checkData = this.$refs.dataTable.selection; |
| | | if(checkData.length < 1){ |
| | | if (checkData.length < 1) { |
| | | this.$message({type: 'warn', message: "请选择勾选需要填写的数据!", duration: 3000}) |
| | | return; |
| | | } |
| | | this.$router.push({ |
| | | path: "/fillInspector", |
| | | query:{"checkData":checkData} |
| | | query: {"checkData": checkData} |
| | | }) |
| | | window.open(href, '_blank'); |
| | | }, |
| | |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | downTemplate() { |
| | | //删除分页参数 |
| | | self_template().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) |
| | | }) |
| | | }, |
| | | |
| | | |
| | | //文件发生改变就会触发的事件 导入 |
| | | uploadByJsqd(file) { |
| | | //判断是否符合beforeAvatarUpload方法中的条件 |
| | |
| | | return true |
| | | }, |
| | | |
| | | cancel(){ |
| | | revoke() { |
| | | var checkData = this.$refs.dataTable.selection; |
| | | if (checkData.length < 1) { |
| | | this.$message({type: 'warn', message: "请勾选需要撤销的数据!", duration: 3000}) |
| | | return; |
| | | } |
| | | var revokeIds = ""; |
| | | checkData.forEach(n => { |
| | | revokeIds += n.id + ","; |
| | | }) |
| | | revokeIds = revokeIds.substring(0, revokeIds.length - 1); |
| | | this.$confirm('确认要撤销吗', '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then((res) => { |
| | | console.log(res); |
| | | self_revoke(revokeIds).then(res => { |
| | | if (res.data.ok) { |
| | | this.$message({type: 'success', message: res.data.msg, duration: 3000}) |
| | | this.getPageList()//调用表格方法,刷新页面 |
| | | } else { |
| | | this.$message({type: 'error', message: res.data.msg, duration: 3000}) |
| | | } |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | deleteBath() { |
| | |
| | | deleteIds += n.id + ","; |
| | | }) |
| | | deleteIds = deleteIds.substring(0, deleteIds.length - 1); |
| | | console.log(deleteIds) |
| | | this.$confirm('确认删除吗', '提示', { |
| | | this.$confirm('确认要删除吗', '提示', { |
| | | confirmButtonText: '确认', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then((res) => { |
| | | console.log(res); |
| | | self_del_do(deleteIds).then(res=>{ |
| | | self_del_do(deleteIds).then(res => { |
| | | if (res.data.ok) { |
| | | this.$message({type: 'success', message: res.data.msg, duration: 3000}) |
| | | this.getPageList()//调用表格方法,刷新页面 |