| | |
| | | <el-button type="primary" size="small" @click="addFun">新 增</el-button> |
| | | <el-button type="primary" size="small" @click="approvalFun">审 批</el-button> |
| | | <el-button type="primary" size="small" @click="approveFun">批 准</el-button> |
| | | <el-upload style="display: inline-block; padding: 0 6px" :action="action" :headers="headers" :on-error="onError" |
| | | :show-file-list="false" :on-success="onSuccess"> |
| | | <el-upload style="display: inline-block; padding: 0 6px" :action="action" :headers="uploadHeader" |
| | | :on-error="onError" :show-file-list="false" :on-success="onSuccess"> |
| | | <el-button size="small" type="primary">导 入</el-button> |
| | | </el-upload> |
| | | <el-button size="small" @click="openDownloadDia">导出</el-button> |
| | | </div> |
| | | </div> |
| | | <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)"> |
| | | <el-table :data="tableData" style="width: 100%" height="calc(100vh - 18em)" key="table0"> |
| | | <el-table-column type="index" label="序号" width="120"> |
| | | <template v-slot="scope"> |
| | | <span>{{ (search.current - 1) * search.size + scope.$index + 1 }}</span> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getToken } from "@/utils/auth"; |
| | | import { |
| | | getPageList, |
| | | riskAnalysisApprovalOfControlPlanChecklist, |
| | |
| | | } |
| | | }, |
| | | computed: { |
| | | headers() { |
| | | return { |
| | | 'Authorization': "Bearer " + getToken() |
| | | } |
| | | }, |
| | | action() { |
| | | return this.javaApi + '/manageControlPlanList/importControlPlanList' |
| | | }, |
| | |
| | | }, |
| | | initData() { |
| | | getPageList(this.search).then(res => { |
| | | if (res.code === 201) return; |
| | | this.tableData = res.data.records; |
| | | this.search.total = res.data.total; |
| | | }); |
| | |
| | | // 审批接口 |
| | | approvalApi(userId, status) { |
| | | riskAnalysisApprovalOfControlPlanChecklist({ approval: userId, status }).then(res => { |
| | | if (res.code === 201) return; |
| | | this.initData() |
| | | this.$message({ |
| | | type: 'success', |
| | |
| | | // 批准接口 |
| | | approveApi(userId, status) { |
| | | approvalOfControlPlanChecklist({ approve: userId, status }).then(res => { |
| | | if (res.code === 201) return; |
| | | this.initData() |
| | | this.$message({ |
| | | type: 'success', |
| | |
| | | }); |
| | | }, |
| | | onSuccess(response) { |
| | | if (response.code == 201) { |
| | | if (response.code != 200) { |
| | | this.$message({ |
| | | type: 'error', |
| | | message: response.message, |
| | |
| | | openDownloadDia() { |
| | | exportSignificantRiskFactors().then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '重大风险因素分析及控制计划清单' + '.docx'); |
| | | }) |