|
@@ -95,22 +95,38 @@
|
|
<el-table-column label="检查表名称" align="center" prop="name" />
|
|
<el-table-column label="检查表名称" align="center" prop="name" />
|
|
<el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
|
|
<el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
|
|
<el-table-column label="检查频率" align="center" prop="checkCycleTxt" />
|
|
<el-table-column label="检查频率" align="center" prop="checkCycleTxt" />
|
|
- <el-table-column label="创建时间" align="center" prop="createTimeView" />
|
|
|
|
- <el-table-column label="隐患分类" align="center" prop="dangerCategoryTxt" />
|
|
|
|
|
|
+ <el-table-column label="状态" align="center" prop="statusTxt" />
|
|
<el-table-column label="数据创建人" align="center" prop="createByName" />
|
|
<el-table-column label="数据创建人" align="center" prop="createByName" />
|
|
- <el-table-column label="操作" align="center" width="150" fixed="right" class-name="small-padding fixed-width">
|
|
|
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTimeView" />
|
|
|
|
+ <el-table-column label="最后更新时间" align="center" prop="updateTimeView" />
|
|
|
|
+ <el-table-column label="操作" align="center" width="300" fixed="right" class-name="small-padding fixed-width">
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
type="primary"
|
|
type="primary"
|
|
|
|
+ icon="View"
|
|
@click="handleDetail(scope.row)"
|
|
@click="handleDetail(scope.row)"
|
|
>详情</el-button>
|
|
>详情</el-button>
|
|
<el-button
|
|
<el-button
|
|
link
|
|
link
|
|
- type="primary"
|
|
|
|
|
|
+ type="info"
|
|
icon="Edit"
|
|
icon="Edit"
|
|
@click="handleUpdate(scope.row)"
|
|
@click="handleUpdate(scope.row)"
|
|
>修改</el-button>
|
|
>修改</el-button>
|
|
|
|
+ <el-button :disabled="scope.row.status === 2"
|
|
|
|
+ link
|
|
|
|
+ type="danger"
|
|
|
|
+ icon="Remove"
|
|
|
|
+ :loading="disableLoading"
|
|
|
|
+ @click="handleDisable(scope.row)"
|
|
|
|
+ >停用</el-button>
|
|
|
|
+ <el-button :disabled="scope.row.status === 1"
|
|
|
|
+ link
|
|
|
|
+ type="success"
|
|
|
|
+ icon="Refresh"
|
|
|
|
+ :loading="enableLoading"
|
|
|
|
+ @click="handleEnable(scope.row)"
|
|
|
|
+ >启用</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -300,7 +316,7 @@
|
|
<script setup name="DangerCheckForm">
|
|
<script setup name="DangerCheckForm">
|
|
import { listEnumValue } from "@/api/system/base"
|
|
import { listEnumValue } from "@/api/system/base"
|
|
import { listAllDangerCategory } from "@/api/danger/DangerCategory";
|
|
import { listAllDangerCategory } from "@/api/danger/DangerCategory";
|
|
-import { detail, modify, create, search } from "@/api/form/DangerCheckForm";
|
|
|
|
|
|
+import { detail, modify, create, search, stop, enable } from "@/api/form/DangerCheckForm";
|
|
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
|
|
@@ -314,6 +330,9 @@ const dialogOpenCreate = ref(false);
|
|
const modifyLoading = ref(false);
|
|
const modifyLoading = ref(false);
|
|
const dialogOpenModify = ref(false);
|
|
const dialogOpenModify = ref(false);
|
|
|
|
|
|
|
|
+const disableLoading = ref(false);
|
|
|
|
+const enableLoading = ref(false);
|
|
|
|
+
|
|
const total = ref(0);
|
|
const total = ref(0);
|
|
const dateRangeCreateTime = ref([]);
|
|
const dateRangeCreateTime = ref([]);
|
|
const ids = ref([]);
|
|
const ids = ref([]);
|
|
@@ -520,14 +539,14 @@ function submitModify() {
|
|
modifyLoading.value = true;
|
|
modifyLoading.value = true;
|
|
|
|
|
|
modify(formModify.value)
|
|
modify(formModify.value)
|
|
- .then((response) => {
|
|
|
|
- proxy.$modal.msgSuccess("修改成功");
|
|
|
|
- dialogOpenModify.value = false;
|
|
|
|
- getList();
|
|
|
|
- })
|
|
|
|
- .finally(() => {
|
|
|
|
- modifyLoading.value = false;
|
|
|
|
- });
|
|
|
|
|
|
+ .then((response) => {
|
|
|
|
+ proxy.$modal.msgSuccess("修改成功");
|
|
|
|
+ dialogOpenModify.value = false;
|
|
|
|
+ getList();
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ modifyLoading.value = false;
|
|
|
|
+ });
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -561,6 +580,52 @@ function handleRemovePoint(type, item) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+/** 停用 */
|
|
|
|
+function handleDisable(row) {
|
|
|
|
+ const id = row.id || ids.value[0];
|
|
|
|
+ proxy.$modal.confirm('确认停用吗?')
|
|
|
|
+ .then(() => {
|
|
|
|
+ disableLoading.value = true;
|
|
|
|
+
|
|
|
|
+ stop(id)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ proxy.$modal.msgSuccess("操作成功");
|
|
|
|
+ getList();
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ disableLoading.value = false;
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch((action) => {
|
|
|
|
+ if (action === 'cancel') {
|
|
|
|
+ proxy.$modal.msg('取消操作');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+/** 启用 */
|
|
|
|
+function handleEnable(row) {
|
|
|
|
+ const id = row.id || ids.value[0];
|
|
|
|
+ proxy.$modal.confirm('确认启用吗?')
|
|
|
|
+ .then(() => {
|
|
|
|
+ enableLoading.value = true;
|
|
|
|
+
|
|
|
|
+ enable(id)
|
|
|
|
+ .then((response) => {
|
|
|
|
+ proxy.$modal.msgSuccess("操作成功");
|
|
|
|
+ getList();
|
|
|
|
+ })
|
|
|
|
+ .finally(() => {
|
|
|
|
+ enableLoading.value = false;
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+ .catch((action) => {
|
|
|
|
+ if (action === 'cancel') {
|
|
|
|
+ proxy.$modal.msg('取消操作');
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
/** 获取检查频率下拉框枚举值列表 */
|
|
/** 获取检查频率下拉框枚举值列表 */
|
|
function getCheckCycleList() {
|
|
function getCheckCycleList() {
|