| | |
| | | }); |
| | | } |
| | | |
| | | export function self_template() { |
| | | return request({ |
| | | headers: { |
| | | 'token': getTokenAndVerify().token, |
| | | 'verify': getTokenAndVerify().verify |
| | | }, |
| | | url: '/taboi/download/self_template', |
| | | method: 'get', |
| | | responseType: 'arraybuffer', |
| | | }); |
| | | } |
| | | |
| | | export function self_import_do(data) { |
| | | return request({ |
| | |
| | | data |
| | | }) |
| | | } |
| | | export function self_revoke(data) { |
| | | return request({ |
| | | headers: { |
| | | 'token': getTokenAndVerify().token, |
| | | 'verify': getTokenAndVerify().verify |
| | | }, |
| | | url: '/taboi/danger/self_revoke?id=' + data, |
| | | method: 'post', |
| | | data |
| | | }) |
| | | } |
| | | |
| | | |
| | | export function self_edit_do(data) { |
| | | return request({ |
| | |
| | | <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 { |
| | |
| | | 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' |