|
|
@@ -65,6 +65,19 @@
|
|
|
>{{ getEmergencyPlanStatusLabel(scope.row.status) }}</span
|
|
|
>
|
|
|
</template>
|
|
|
+ <template #isDisabled="scope">
|
|
|
+ <div
|
|
|
+ style="cursor: pointer; width: 50px; margin: auto"
|
|
|
+ @click="handleChangeDisable(scope.row.id, scope.row.isDisabled)"
|
|
|
+ >
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.isDisabled"
|
|
|
+ :active-value="0"
|
|
|
+ :inactive-value="1"
|
|
|
+ style="pointer-events: none"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
<template #action="scope">
|
|
|
<div class="action-container--div">
|
|
|
<ActionButton text="查看" @click="handleView(scope.row.id)" />
|
|
|
@@ -106,7 +119,7 @@
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { ref, reactive, onMounted } from 'vue';
|
|
|
import { Plus } from '@element-plus/icons-vue';
|
|
|
- import { ElMessage } from 'element-plus';
|
|
|
+ import { ElMessage, ElSwitch } from 'element-plus';
|
|
|
import BasicSearch from '@/components/BasicSearch.vue';
|
|
|
import BasicTable from '@/components/BasicTable.vue';
|
|
|
import BasicDialog from '@/components/BasicDialog.vue';
|
|
|
@@ -123,7 +136,12 @@
|
|
|
ApprovalProcessResponse,
|
|
|
ProcessInfoListType,
|
|
|
} from '@/types/emergency-plan';
|
|
|
- import { getEmergencyPlanList, deleteEmergencyPlan, queryApprovalProcess } from '@/api/emergency-plan';
|
|
|
+ import {
|
|
|
+ getEmergencyPlanList,
|
|
|
+ deleteEmergencyPlan,
|
|
|
+ updateEmergencyPlanDisabled,
|
|
|
+ queryApprovalProcess,
|
|
|
+ } from '@/api/emergency-plan';
|
|
|
import {
|
|
|
EMERGENCY_PLAN_MANAGEMENT_SEARCH_CONFIG,
|
|
|
EMERGENCY_PLAN_MANAGEMENT_TABLE_OPTIONS,
|
|
|
@@ -134,7 +152,13 @@
|
|
|
APPROVAL_PROCESS_TABLE_OPTIONS,
|
|
|
} from './src/config';
|
|
|
import { EMERGENCY_PERMISSIONS } from '@/views/emergency/src/constant';
|
|
|
- import { EMERGENCY_PLAN_STATUS, APPROVAL_TYPE_MAP, APPROVAL_STATUS_MAP, APPROVAL_STATUS, APPROVAL_TYPE } from './src/constant';
|
|
|
+ import {
|
|
|
+ EMERGENCY_PLAN_STATUS,
|
|
|
+ APPROVAL_TYPE_MAP,
|
|
|
+ APPROVAL_STATUS_MAP,
|
|
|
+ APPROVAL_STATUS,
|
|
|
+ APPROVAL_TYPE,
|
|
|
+ } from './src/constant';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const planManagementPremissions = ref<boolean>(false);
|
|
|
@@ -183,30 +207,30 @@
|
|
|
// 遍历所有行,寻找符合条件的行
|
|
|
for (let i = 0; i < approvalProcessData.value.length; i++) {
|
|
|
const row = approvalProcessData.value[i];
|
|
|
-
|
|
|
+
|
|
|
// 如果没有审批时间,返回该行索引
|
|
|
if (!row.approvalTime) {
|
|
|
return i;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果有审批时间且状态为退回,返回该行索引
|
|
|
if (row.approvalTime && row.approvalStatus === APPROVAL_STATUS.REJECTED) {
|
|
|
return i;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 如果没有找到符合条件的行,返回最后一行索引
|
|
|
return approvalProcessData.value.length - 1;
|
|
|
};
|
|
|
-
|
|
|
+
|
|
|
// 获取应该高亮的行索引
|
|
|
const highlightRowIndex = findHighlightRowIndex();
|
|
|
-
|
|
|
+
|
|
|
// 如果当前行是应该高亮的行,则高亮
|
|
|
if (rowIndex === highlightRowIndex) {
|
|
|
return 'row--highlight';
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// 特殊处理:如果高亮行是或签,且当前行与高亮行属于同一流程步骤,也高亮
|
|
|
const highlightRow = approvalProcessData.value[highlightRowIndex];
|
|
|
if (highlightRow) {
|
|
|
@@ -216,7 +240,7 @@
|
|
|
return 'row--highlight';
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return '';
|
|
|
};
|
|
|
const { tableConfig: approvalProcessConfig } = useTableConfig(
|
|
|
@@ -242,6 +266,7 @@
|
|
|
planName: null,
|
|
|
planType: null,
|
|
|
eventType: null,
|
|
|
+ professionalTestSite: null,
|
|
|
status: null,
|
|
|
});
|
|
|
const handleSearch = () => {
|
|
|
@@ -255,6 +280,9 @@
|
|
|
if (searchData.eventType) {
|
|
|
planManagementListQuery.queryParam.eventType = searchData.eventType;
|
|
|
}
|
|
|
+ if (searchData.professionalTestSite) {
|
|
|
+ planManagementListQuery.queryParam.professionalTestSite = searchData.professionalTestSite;
|
|
|
+ }
|
|
|
if (searchData.status !== null) {
|
|
|
planManagementListQuery.queryParam.status = searchData.status;
|
|
|
}
|
|
|
@@ -277,6 +305,17 @@
|
|
|
planManagementListQuery.pageNumber = value;
|
|
|
getTableData();
|
|
|
};
|
|
|
+
|
|
|
+ const handleChangeDisable = async (id: number, value: number) => {
|
|
|
+ try {
|
|
|
+ await updateEmergencyPlanDisabled({ planId: id, isDisabled: value === 1 ? 0 : 1 });
|
|
|
+ ElMessage.success('操作成功');
|
|
|
+ } catch (error) {
|
|
|
+ ElMessage.error('操作失败');
|
|
|
+ }
|
|
|
+ getTableData();
|
|
|
+ return false;
|
|
|
+ };
|
|
|
const defaultName = 'plan-management-detail';
|
|
|
const handleAdd = () => {
|
|
|
router.push({
|