| | |
| | | <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="table1" |
| | | :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }" border> |
| | | <el-table-column type="index" label="序号" width="120"> |
| | | <template v-slot="scope"> |
| | | <span>{{ (page.current - 1) * page.size + scope.$index + 1 }}</span> |
| | |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-pagination :current-page="1" :page-size="page.size" :page-sizes="[10, 20, 30, 50, 100]" :total="page.total" |
| | | layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" |
| | | layout="->,total, sizes, prev, pager, next, jumper" @size-change="handleSizeChange" background |
| | | @current-change="handleCurrentChange"> |
| | | </el-pagination> |
| | | <el-dialog title="提示" :visible.sync="dialogVisible" width="50%"> |
| | |
| | | page: { |
| | | total: 0, |
| | | size: 10, |
| | | current: 0, |
| | | current: 1, |
| | | }, |
| | | tableData: [], |
| | | loading: false |
| | |
| | | initData() { |
| | | this.tableData = [] |
| | | getPageResults(this.page).then(res => { |
| | | if (res.code === 201) return; |
| | | this.tableData = res.data.records; |
| | | this.page.total = res.data.total; |
| | | }); |
| | |
| | | // 审批接口 |
| | | approvalApi(userId, status) { |
| | | dangerousRiskApproval({ approval: userId, status: status }).then(res => { |
| | | if (res.code === 201) return; |
| | | this.initData() |
| | | this.$message({ |
| | | type: 'success', |
| | |
| | | // 批准接口 |
| | | approveApi(userId, status) { |
| | | hazardIdentificationAndRiskApproval({ approve: userId, status: 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, |
| | |
| | | type: 'warning' |
| | | }).then(() => { |
| | | removeRiskFactors({ id: row.id }).then(res => { |
| | | if (res.code === 201) return; |
| | | this.initData() |
| | | this.$message({ |
| | | type: 'success', |
| | |
| | | addApi() { |
| | | this.loading = true |
| | | addNewRiskFactors(this.form).then(res => { |
| | | if (res.code === 201) return; |
| | | this.dialogVisible = false |
| | | this.loading = false |
| | | this.initData() |
| | |
| | | openDownloadDia() { |
| | | exportHazardFactorIdentification().then(res => { |
| | | this.outLoading = false |
| | | this.$message.success('导出成功') |
| | | const blob = new Blob([res], { type: 'application/msword' }); |
| | | this.$download.saveAs(blob, '危险因素辨识与风险评价结果一览' + '.docx'); |
| | | }) |