|
|
|
|
@ -114,7 +114,7 @@
@@ -114,7 +114,7 @@
|
|
|
|
|
</el-table-column> |
|
|
|
|
<el-table-column |
|
|
|
|
label="操作" |
|
|
|
|
width="210" |
|
|
|
|
width="290" |
|
|
|
|
fixed="right" |
|
|
|
|
align="center" |
|
|
|
|
class-name="data-list-operation-column" |
|
|
|
|
@ -123,6 +123,7 @@
@@ -123,6 +123,7 @@
|
|
|
|
|
<el-button size="mini" @click="openDetail(scope.row)">详情</el-button> |
|
|
|
|
<el-button v-if="canAudit(scope.row)" type="primary" size="mini" @click="goAudit(scope.row)">去审核</el-button> |
|
|
|
|
<el-button v-if="isSyncFailed(scope.row)" type="warning" size="mini" @click="handleRetrySync(scope.row)">重试同步</el-button> |
|
|
|
|
<el-button type="danger" size="mini" @click="handleDelete(scope.row)">删除</el-button> |
|
|
|
|
</template> |
|
|
|
|
</el-table-column> |
|
|
|
|
</el-table> |
|
|
|
|
@ -271,7 +272,7 @@
@@ -271,7 +272,7 @@
|
|
|
|
|
<script> |
|
|
|
|
/* global MyConfig */ |
|
|
|
|
import { getMyFactoryDepartment, listFactoryDepartments } from '@/api/system/dept' |
|
|
|
|
import { listHazardLedger, getHazardLedgerDetail, listHazardLedgerAttachments, retryHazardSync, getHazardImportAction, downloadHazardImportTemplate } from '@/api/hazard/ledger' |
|
|
|
|
import { listHazardLedger, getHazardLedgerDetail, listHazardLedgerAttachments, retryHazardSync, getHazardImportAction, downloadHazardImportTemplate, deleteHazardLedger } from '@/api/hazard/ledger' |
|
|
|
|
import { flowRecord } from '@/api/flowable/finished' |
|
|
|
|
import { getToken } from '@/utils/auth' |
|
|
|
|
|
|
|
|
|
@ -325,6 +326,7 @@ export default {
@@ -325,6 +326,7 @@ export default {
|
|
|
|
|
loadFlowNodes(procInsId) { if (!procInsId) { this.flowNodes = []; return } this.flowLoading = true; flowRecord({ procInsId: String(procInsId) }).then(response => { const data = response.data || {}; this.flowNodes = Array.isArray(data.flowList) ? data.flowList : [] }).catch(() => { this.flowNodes = [] }).finally(() => { this.flowLoading = false }) }, |
|
|
|
|
goAudit(row) { const query = { id: String(row.id) }; if (row.canApprove === true || String(row.canApprove) === 'true') query.canApprove = '1'; if (row.flowInstanceId) query.flowInstanceId = String(row.flowInstanceId); this.detailVisible = false; this.$router.push({ path: '/hazard/audit/detail', query }) }, |
|
|
|
|
handleRetrySync(row) { this.$confirm('确认重试将该隐患同步到生产运营平台吗?', '重试同步', { type: 'warning' }).then(() => retryHazardSync(row.id)).then(() => { this.$modal.msgSuccess('同步重试成功'); this.getList() }).catch(error => { if (error !== 'cancel') this.$modal.msgError(error.message || '同步重试失败') }) }, |
|
|
|
|
handleDelete(row) { this.$confirm('确认删除该隐患吗?删除后不可恢复,关联附件将一并删除。', '删除确认', { type: 'warning', confirmButtonText: '删除' }).then(() => deleteHazardLedger(row.id)).then(() => { this.$modal.msgSuccess('删除成功'); this.getList() }).catch(error => { if (error !== 'cancel') this.$modal.msgError(error.message || '删除失败') }) }, |
|
|
|
|
handleImport() { this.importUpload.mode = 'excel'; this.importUpload.action = getHazardImportAction('excel'); this.importUpload.isUploading = false; this.importUpload.open = true }, |
|
|
|
|
handleImportModeChange(mode) { if (this.$refs.hazardImportUpload) this.$refs.hazardImportUpload.clearFiles(); this.importUpload.action = getHazardImportAction(mode) }, |
|
|
|
|
beforeImportUpload(file) { |
|
|
|
|
|