|
@@ -53,7 +53,7 @@
|
|
|
</el-form>
|
|
</el-form>
|
|
|
|
|
|
|
|
<div>
|
|
<div>
|
|
|
- <el-button type="primary" @click="$router.push({ name: 'hazardManageAdd' })">添加 </el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="handleAddPlan">添加 </el-button>
|
|
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
|
<el-button type="primary" @click="queryTableList">查询</el-button>
|
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
<el-button @click="handleRestParams">重置</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -62,24 +62,24 @@
|
|
|
<div class="table-content">
|
|
<div class="table-content">
|
|
|
<el-table :data="tableData.data">
|
|
<el-table :data="tableData.data">
|
|
|
<el-table-column type="index" label="序号" width="80" />
|
|
<el-table-column type="index" label="序号" width="80" />
|
|
|
- <el-table-column label="计划/方案名称" prop="planName" width="180" />
|
|
|
|
|
|
|
+ <el-table-column label="计划/方案名称" prop="planName" width="180">
|
|
|
|
|
+ <template #default="scope">
|
|
|
|
|
+ <el-link type="primary" underline @click="handleShowPlan(scope)">
|
|
|
|
|
+ {{ scope.row.planName }}
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
- <el-table-column label="状态" prop="statusName" width="80" />
|
|
|
|
|
|
|
+ <el-table-column label="状态" prop="statusName" width="100" />
|
|
|
<el-table-column label="执行部门" prop="executorName" width="180" />
|
|
<el-table-column label="执行部门" prop="executorName" width="180" />
|
|
|
<el-table-column label="执行人" prop="executor" width="130" />
|
|
<el-table-column label="执行人" prop="executor" width="130" />
|
|
|
<el-table-column label="计划/方案描述" prop="planContent" width="180" />
|
|
<el-table-column label="计划/方案描述" prop="planContent" width="180" />
|
|
|
- <el-table-column label="计划开始时间" prop="planStartDate" width="180" />
|
|
|
|
|
- <el-table-column label="计划结束时间" prop="planEndDate" width="180" />
|
|
|
|
|
|
|
+ <el-table-column label="计划开始时间" prop="planStartDate" width="220" />
|
|
|
|
|
+ <el-table-column label="计划结束时间" prop="planEndDate" width="220" />
|
|
|
|
|
|
|
|
<el-table-column fixed="right" min-width="240" label="操作">
|
|
<el-table-column fixed="right" min-width="240" label="操作">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
- <el-button
|
|
|
|
|
- type="primary"
|
|
|
|
|
- link
|
|
|
|
|
- @click="$router.push({ name: 'hazardManageEdit', query: { id: scope.row.id } })"
|
|
|
|
|
- >
|
|
|
|
|
- 编辑
|
|
|
|
|
- </el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" link @click="handleEditPlan(scope)"> 编辑 </el-button>
|
|
|
|
|
|
|
|
<el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button>
|
|
<el-button type="primary" link @click="handleConfirmDeleteRow(scope)">删除</el-button>
|
|
|
</template>
|
|
</template>
|
|
@@ -98,6 +98,12 @@
|
|
|
</div>
|
|
</div>
|
|
|
</main>
|
|
</main>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <PlansAndProgramsDialog
|
|
|
|
|
+ v-if="planDialogOpen"
|
|
|
|
|
+ v-model.visible="planDialogOpen"
|
|
|
|
|
+ :dialogInfo="dialogInfo"
|
|
|
|
|
+ @submit="handlePlanSubmit"
|
|
|
|
|
+ />
|
|
|
</template>
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
import { onMounted, reactive, ref } from 'vue';
|
|
@@ -107,6 +113,8 @@
|
|
|
safetyHazardInventoryQueryPlanAndSchemePage,
|
|
safetyHazardInventoryQueryPlanAndSchemePage,
|
|
|
safetyHazardInventoryDeletePlan,
|
|
safetyHazardInventoryDeletePlan,
|
|
|
safetyHazardInventoryQueryPlanDetail,
|
|
safetyHazardInventoryQueryPlanDetail,
|
|
|
|
|
+ safetyHazardInventorySavePlan,
|
|
|
|
|
+ safetyHazardInventoryUpdatePlan,
|
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
} from '@/api/production-safety/responsibility-implementation';
|
|
|
import { omit } from 'lodash-es';
|
|
import { omit } from 'lodash-es';
|
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
import { useUserInfoHook } from '@/hooks/useUserInfoHook';
|
|
@@ -114,6 +122,8 @@
|
|
|
import { downloadFile } from '@/views/disaster/utils';
|
|
import { downloadFile } from '@/views/disaster/utils';
|
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
import { formatDeptTree } from '@/views/disaster/utils/formatDeptTree';
|
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
import { getAllDepartments } from '@/api/auth/dept';
|
|
|
|
|
+ import PlansAndProgramsDialog from './components/PlansAndProgramsDialog.vue';
|
|
|
|
|
+ import { exec } from 'child_process';
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
@@ -127,6 +137,7 @@
|
|
|
label: 'deptName',
|
|
label: 'deptName',
|
|
|
};
|
|
};
|
|
|
const activeTab = ref('');
|
|
const activeTab = ref('');
|
|
|
|
|
+ const planDialogOpen = ref(false);
|
|
|
const queryParams = reactive<any>({
|
|
const queryParams = reactive<any>({
|
|
|
pageNumber: 1,
|
|
pageNumber: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -148,6 +159,59 @@
|
|
|
total: 0,
|
|
total: 0,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ const dialogInfo = reactive<any>({
|
|
|
|
|
+ title: '新增风险源计划与方案',
|
|
|
|
|
+ currentRow: null,
|
|
|
|
|
+ type: 'add',
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ const handleAddPlan = () => {
|
|
|
|
|
+ planDialogOpen.value = true;
|
|
|
|
|
+ dialogInfo.title = '新增风险源计划与方案';
|
|
|
|
|
+ dialogInfo.type = 'add';
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleEditPlan = async (scope: any) => {
|
|
|
|
|
+ dialogInfo.currentRow = scope.row;
|
|
|
|
|
+ dialogInfo.title = '编辑风险源计划与方案';
|
|
|
|
|
+ dialogInfo.type = 'edit';
|
|
|
|
|
+ planDialogOpen.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleShowPlan = async (scope: any) => {
|
|
|
|
|
+ dialogInfo.currentRow = scope.row;
|
|
|
|
|
+ dialogInfo.title = '查看风险源计划与方案';
|
|
|
|
|
+ dialogInfo.type = 'view';
|
|
|
|
|
+ planDialogOpen.value = true;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handleClosePlanDialog = () => {
|
|
|
|
|
+ planDialogOpen.value = false;
|
|
|
|
|
+ dialogInfo.currentRow = null;
|
|
|
|
|
+ dialogInfo.type = '';
|
|
|
|
|
+ dialogInfo.title = '';
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ const handlePlanSubmit = (formData, loading) => {
|
|
|
|
|
+ const req = dialogInfo.type === 'edit' ? safetyHazardInventoryUpdatePlan : safetyHazardInventorySavePlan;
|
|
|
|
|
+ loading.value = true;
|
|
|
|
|
+ req({
|
|
|
|
|
+ ...formData,
|
|
|
|
|
+ id: dialogInfo.type === 'edit' ? dialogInfo.currentRow.id : undefined,
|
|
|
|
|
+ hazardListId: route.query.id,
|
|
|
|
|
+ execDepartmentId: formData.execDepartmentId.join(','),
|
|
|
|
|
+ executor: formData.executor.join(','),
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ handleClosePlanDialog();
|
|
|
|
|
+ queryTableList();
|
|
|
|
|
+ ElMessage.success('操作成功!');
|
|
|
|
|
+ })
|
|
|
|
|
+ .finally(() => {
|
|
|
|
|
+ loading.value = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
const handleSizeChange = (value) => {};
|
|
const handleSizeChange = (value) => {};
|
|
|
const handleCurrentChange = (value) => {
|
|
const handleCurrentChange = (value) => {
|
|
|
queryParams.pageNumber = value;
|
|
queryParams.pageNumber = value;
|
|
@@ -176,7 +240,6 @@
|
|
|
const queryTableList = () => {
|
|
const queryTableList = () => {
|
|
|
safetyHazardInventoryQueryPlanAndSchemePage({
|
|
safetyHazardInventoryQueryPlanAndSchemePage({
|
|
|
...queryParams,
|
|
...queryParams,
|
|
|
-
|
|
|
|
|
queryParam: {
|
|
queryParam: {
|
|
|
...omit(queryParams.queryParam, ['date', 'responsibleDepartmentId']),
|
|
...omit(queryParams.queryParam, ['date', 'responsibleDepartmentId']),
|
|
|
hazardListId: route.query.id,
|
|
hazardListId: route.query.id,
|
|
@@ -185,8 +248,9 @@
|
|
|
endTime: queryParams.queryParam.date ? queryParams.queryParam.date[1] : undefined,
|
|
endTime: queryParams.queryParam.date ? queryParams.queryParam.date[1] : undefined,
|
|
|
},
|
|
},
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
|
- tableData.data = res.records;
|
|
|
|
|
|
|
+ tableData.data = res.page.records;
|
|
|
tableData.total = res.totalRow;
|
|
tableData.total = res.totalRow;
|
|
|
|
|
+ Object.assign(detailData, res);
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
const handleRestParams = () => {
|
|
const handleRestParams = () => {
|
|
@@ -203,14 +267,8 @@
|
|
|
queryTableList();
|
|
queryTableList();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
- const handlesafetyHazardInventoryQueryPlanDetail = async () => {
|
|
|
|
|
- const res = await safetyHazardInventoryQueryPlanDetail(route.query.id as string);
|
|
|
|
|
- Object.assign(detailData, res);
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
await getDeptData();
|
|
await getDeptData();
|
|
|
- handlesafetyHazardInventoryQueryPlanDetail();
|
|
|
|
|
queryTableList();
|
|
queryTableList();
|
|
|
});
|
|
});
|
|
|
</script>
|
|
</script>
|