forked from integrated_whb/integrated_whb_vue
隐患排查清单
parent
92e98ffa1b
commit
e24a7c48aa
|
|
@ -330,6 +330,15 @@ export default [
|
||||||
},
|
},
|
||||||
component: "hazard_investigation/inventory_management/add",
|
component: "hazard_investigation/inventory_management/add",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/hazard_investigation/inventory_management/check_standard_add",
|
||||||
|
meta: {
|
||||||
|
title: "新增",
|
||||||
|
activeMenu: "/hazard_investigation/inventory_management",
|
||||||
|
},
|
||||||
|
component:
|
||||||
|
"hazard_investigation/inventory_management/check_standard_add",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/hazard_investigation/inventory_management/edit",
|
path: "/hazard_investigation/inventory_management/edit",
|
||||||
meta: {
|
meta: {
|
||||||
|
|
@ -384,6 +393,15 @@ export default [
|
||||||
},
|
},
|
||||||
component: "hazard_investigation/inventory_troubleshooting/inspect",
|
component: "hazard_investigation/inventory_troubleshooting/inspect",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/hazard_investigation/inventory_troubleshooting/standard_inspect",
|
||||||
|
meta: {
|
||||||
|
title: "开始检查",
|
||||||
|
activeMenu: "/hazard_investigation/inventory_troubleshooting",
|
||||||
|
},
|
||||||
|
component:
|
||||||
|
"hazard_investigation/inventory_troubleshooting/standard_inspect",
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"
|
"
|
||||||
>
|
>
|
||||||
<div>{{ item.NAME }}</div>
|
<div>{{ item.NAME }}</div>
|
||||||
<div>
|
<div v-if="isDelete">
|
||||||
<el-icon @click.stop="fnDelete(index)">
|
<el-icon @click.stop="fnDelete(index)">
|
||||||
<circle-close />
|
<circle-close />
|
||||||
</el-icon>
|
</el-icon>
|
||||||
|
|
@ -47,6 +47,10 @@ const props = defineProps({
|
||||||
required: true,
|
required: true,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
isDelete: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const emits = defineEmits(["update:modelValue", "delete-option"]);
|
const emits = defineEmits(["update:modelValue", "delete-option"]);
|
||||||
const modelValue = useVModel(props, "modelValue", emits);
|
const modelValue = useVModel(props, "modelValue", emits);
|
||||||
|
|
|
||||||
|
|
@ -78,3 +78,9 @@ export const getHiddenDangerType = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 获取数据字典-检查类别
|
||||||
|
export const getStandardLevels = () =>
|
||||||
|
post("/hiddenstandardDictionary/list", {
|
||||||
|
loading: false,
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ export const setInventoryManagementInsuranceCoverageList = (params) =>
|
||||||
export const setInventoryManagementInsuranceCoverageSave = (params) =>
|
export const setInventoryManagementInsuranceCoverageSave = (params) =>
|
||||||
post("/listmanager/saveBaoBaoType", params); // 清单管理设置包保责任类型提交
|
post("/listmanager/saveBaoBaoType", params); // 清单管理设置包保责任类型提交
|
||||||
export const getInventoryManagementInspectionItems = (params) =>
|
export const getInventoryManagementInspectionItems = (params) =>
|
||||||
post("/riskcheckitem/itemlistAll", params); // 清单管理检查项列表
|
post("/richeckitem/itemlistAllsk", params); // 清单管理检查项列表
|
||||||
export const getInventoryManagementOtherRiskList = (params) =>
|
export const getInventoryManagementOtherRiskList = (params) =>
|
||||||
post("/riskcheckitem/list", params); // 清单管理选择其他存在风险列表
|
post("/riskcheckitem/list", params); // 清单管理选择其他存在风险列表
|
||||||
export const setInventoryManagementAdd = (params) =>
|
export const setInventoryManagementAdd = (params) =>
|
||||||
|
|
@ -34,6 +34,8 @@ export const setDeleteInventoryManagementRecovery = (params) =>
|
||||||
post("/stoplistmanager/restore", params); // 删除清单管理恢复
|
post("/stoplistmanager/restore", params); // 删除清单管理恢复
|
||||||
export const getInventoryTroubleshootingList = (params) =>
|
export const getInventoryTroubleshootingList = (params) =>
|
||||||
post("/listmanager/checkList", params); // 清单排查列表
|
post("/listmanager/checkList", params); // 清单排查列表
|
||||||
|
export const getRiskStandardList = (params) =>
|
||||||
|
post("/listmanager/riskStandardCheckList", params); // 清单排查列表
|
||||||
export const getInventoryTroubleshootingOtherHiddenList = (params) =>
|
export const getInventoryTroubleshootingOtherHiddenList = (params) =>
|
||||||
post("/hidden/getOtherHidden", params); // 清单排查其它隐患列表
|
post("/hidden/getOtherHidden", params); // 清单排查其它隐患列表
|
||||||
export const getHiddenDangerDatabaseList = (params) =>
|
export const getHiddenDangerDatabaseList = (params) =>
|
||||||
|
|
@ -46,8 +48,10 @@ export const setHiddenDangerListAdd = (params) =>
|
||||||
post("/hidden/listAdd", params); // 清单排查其它隐患添加
|
post("/hidden/listAdd", params); // 清单排查其它隐患添加
|
||||||
export const setInventoryTroubleshootingSubmit = (params) =>
|
export const setInventoryTroubleshootingSubmit = (params) =>
|
||||||
post("/checkrecord/add", params); // 清单排查提交
|
post("/checkrecord/add", params); // 清单排查提交
|
||||||
export const getChecklistInspectionStatusList = (params) =>
|
// export const getChecklistInspectionStatusList = (params) =>
|
||||||
post("/listmanager/recordList", params); // 清单检查情况列表
|
// post("/listmanager/recordList", params); // 清单检查情况列表
|
||||||
|
export const getRiskStandardStatusList = (params) =>
|
||||||
|
post("/listmanager/riskStandardRecordList", params); // 清单检查情况列表
|
||||||
export const getChecklistInspectionStatusRecordList = (params) =>
|
export const getChecklistInspectionStatusRecordList = (params) =>
|
||||||
post("/checkrecord/list", params); // 清单检查情况检查记录列表
|
post("/checkrecord/list", params); // 清单检查情况检查记录列表
|
||||||
export const setChecklistInspectionStatusRecordDelete = (params) =>
|
export const setChecklistInspectionStatusRecordDelete = (params) =>
|
||||||
|
|
@ -66,3 +70,28 @@ export const getInspectionRecordList = (params) =>
|
||||||
post("/checkrecord/allList", params); // 检查记录管理列表
|
post("/checkrecord/allList", params); // 检查记录管理列表
|
||||||
export const getTroubleshootingPlanList = (params) =>
|
export const getTroubleshootingPlanList = (params) =>
|
||||||
post("/listmanager/checkPlan", params); // 排查计划列表
|
post("/listmanager/checkPlan", params); // 排查计划列表
|
||||||
|
|
||||||
|
export const getCustomList = (params) =>
|
||||||
|
post("/hiddenstandardCustom/list", params); // 隐患排查清单管理列表
|
||||||
|
export const setCustomDisable = (params) =>
|
||||||
|
post("/hiddenstandardCustom/delete", params); // 隐患排查清单管理禁用
|
||||||
|
export const setCustomEnable = (params) =>
|
||||||
|
post("/hiddenstandardCustom/enable", params); // 清单管理启用
|
||||||
|
export const setCustomBatchDeleteTemporary = (params) =>
|
||||||
|
post("/hiddenstandardCustom/deleteAlltemp", params); // 隐患排查清单管理批量删除临时清单
|
||||||
|
export const setCustomBatchBatchDelete = (params) =>
|
||||||
|
post("/hiddenstandardCustom/deleteAll", params); // 清单管理批量删除
|
||||||
|
export const getCheckstandardCommonList = (params) =>
|
||||||
|
post("/hiddenstandardCommon/list", params); // 隐患排清单管理选择其他检查标准
|
||||||
|
export const setCheckStandardManagementAdd = (params) =>
|
||||||
|
post("/hiddenstandardCustom/add", params); // 隐患排查清单管理新增
|
||||||
|
export const setCheckStandardManagementEdit = (params) =>
|
||||||
|
post("/listmanager/hiddencheckedit", params); // 隐患排查清单管理修改
|
||||||
|
export const getCheckStandardManagementView = (params) =>
|
||||||
|
post("/hiddenstandardCustom/goEdit", params); // 隐患排查清单管理查看
|
||||||
|
export const getCheckStandardOtherHiddenList = (params) =>
|
||||||
|
post("/customHidden/getOtherHidden", params); // 隐患排查清单排查其它隐患列表
|
||||||
|
export const setCheckStandardSupplementaryRecordingSubmit = (params) =>
|
||||||
|
post("/customCheckrecord/recording", params); // 隐患排查清单检查情况检查记录补录提交
|
||||||
|
export const setCheckStandardSubmit = (params) =>
|
||||||
|
post("/customCheckrecord/add", params); // 清单排查提交
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,14 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单种类" prop="LIST_TYPE">
|
||||||
|
<el-select v-model="searchForm.LIST_TYPE">
|
||||||
|
<el-option label="风险管控清单" value="1" />
|
||||||
|
<el-option label="隐患排查清单" value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="周期内检查状态" prop="STATUS">
|
<el-form-item label="周期内检查状态" prop="STATUS">
|
||||||
<el-select v-model="searchForm.STATUS">
|
<el-select v-model="searchForm.STATUS">
|
||||||
|
|
@ -137,6 +145,12 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="NAME" label="清单名称" />
|
<el-table-column prop="NAME" label="清单名称" />
|
||||||
|
<el-table-column label="清单种类">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.list_type === '1'">风险管控清单</span>
|
||||||
|
<span v-if="row.list_type === '2'">隐患排查清单</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
||||||
<el-table-column prop="POST_NAME" label="岗位" />
|
<el-table-column prop="POST_NAME" label="岗位" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -219,7 +233,7 @@ import {
|
||||||
layoutFnGetInventoryType,
|
layoutFnGetInventoryType,
|
||||||
layoutFnGetTroubleshootingCycle,
|
layoutFnGetTroubleshootingCycle,
|
||||||
} from "@/assets/js/data_dictionary.js";
|
} from "@/assets/js/data_dictionary.js";
|
||||||
import { getChecklistInspectionStatusList } from "@/request/hazard_investigation.js";
|
import { getRiskStandardStatusList } from "@/request/hazard_investigation.js";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||||
import { useUserStore } from "@/pinia/user.js";
|
import { useUserStore } from "@/pinia/user.js";
|
||||||
|
|
@ -229,7 +243,7 @@ const router = useRouter();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getChecklistInspectionStatusList);
|
useListData(getRiskStandardStatusList);
|
||||||
const troubleshootingCycleList = await layoutFnGetTroubleshootingCycle();
|
const troubleshootingCycleList = await layoutFnGetTroubleshootingCycle();
|
||||||
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
||||||
const inventoryTypeList = await layoutFnGetInventoryType();
|
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,252 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form
|
||||||
|
:model="searchForm"
|
||||||
|
label-width="90px"
|
||||||
|
@submit.prevent="fnResetPaginationTransfer"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单名称" prop="KEYWORDS">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.KEYWORDS"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="人员" prop="USERNAME">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.USERNAME"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="部门" prop="DEPTIDS">
|
||||||
|
<layout-department
|
||||||
|
v-model="searchForm.DEPTIDS"
|
||||||
|
multiple
|
||||||
|
show-checkbox
|
||||||
|
collapse-tags
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单类型" prop="TYPE">
|
||||||
|
<el-select v-model="searchForm.TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in inventoryTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="排查类型" prop="RISKCHECKLISTTYPE">
|
||||||
|
<el-select v-model="searchForm.RISKCHECKLISTTYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in troubleshootingTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
||||||
|
<el-select v-model="searchForm.LISTINGLEVEL">
|
||||||
|
<el-option
|
||||||
|
v-for="item in [
|
||||||
|
{ BIANMA: '1', NAME: '公司' },
|
||||||
|
...inventoryLevelList,
|
||||||
|
]"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||||
|
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<layout-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="list"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
@get-data="fnGetDataTransfer"
|
||||||
|
row-key="LISTMANAGER_ID"
|
||||||
|
>
|
||||||
|
<el-table-column reserve-selection type="selection" width="55" />
|
||||||
|
<el-table-column label="序号" width="70">
|
||||||
|
<template v-slot="{ $index }">
|
||||||
|
{{ serialNumber(pagination, $index) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="NAME" label="清单名称" />
|
||||||
|
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
||||||
|
<el-table-column prop="POST_NAME" label="岗位" />
|
||||||
|
<el-table-column
|
||||||
|
prop="USER_NAME"
|
||||||
|
label="人员"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="PERIODNAME"
|
||||||
|
label="排查周期"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="SCREENTYPENAME"
|
||||||
|
label="排查类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="TYPENAME"
|
||||||
|
label="清单类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
||||||
|
prop="TASK_TYPE_NAME"
|
||||||
|
label="任务类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" width="100">
|
||||||
|
<template #default> 已删除 </template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="100">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/delete_inventory_management/view',
|
||||||
|
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
查看
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnRecovery(row.LISTMANAGER_ID)"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template #button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.del"
|
||||||
|
type="danger"
|
||||||
|
@click="fnBatchDelete"
|
||||||
|
>
|
||||||
|
彻底删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</layout-table>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { serialNumber } from "@/assets/js/utils.js";
|
||||||
|
import useListData from "@/assets/js/useListData.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
||||||
|
import {
|
||||||
|
layoutFnGetInventoryLevel,
|
||||||
|
layoutFnGetInventoryType,
|
||||||
|
layoutFnGetTroubleshootingType,
|
||||||
|
} from "@/assets/js/data_dictionary.js";
|
||||||
|
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||||
|
import { useUserStore } from "@/pinia/user.js";
|
||||||
|
import {
|
||||||
|
getDeleteInventoryManagementList,
|
||||||
|
setDeleteInventoryManagementRecovery,
|
||||||
|
setInventoryManagementBatchDelete,
|
||||||
|
} from "@/request/hazard_investigation.js";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const router = useRouter();
|
||||||
|
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
||||||
|
useListData(getDeleteInventoryManagementList, {
|
||||||
|
LIST_TYPE: name === "risk" ? "1" : "2",
|
||||||
|
});
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||||
|
const buttonJurisdiction = await useButtonJurisdiction("stoplistmanager");
|
||||||
|
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||||
|
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
||||||
|
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
||||||
|
const fnGetDataTransfer = () => {
|
||||||
|
fnGetData({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnResetPaginationTransfer = () => {
|
||||||
|
fnResetPagination({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnRecovery = debounce(
|
||||||
|
1000,
|
||||||
|
async (LISTMANAGER_ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要恢复吗?", { type: "warning" });
|
||||||
|
await setDeleteInventoryManagementRecovery({ LISTMANAGER_ID });
|
||||||
|
ElMessage.success("恢复成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnBatchDelete = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
if (selectionData.length === 0) {
|
||||||
|
ElMessage.warning("请选中要删除的项");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
"删除之后该清单无法恢复,确认要删除选中的数据吗?",
|
||||||
|
{ type: "warning" }
|
||||||
|
);
|
||||||
|
const DATA_IDS = selectionData.map((item) => item.LISTMANAGER_ID).join(",");
|
||||||
|
await setInventoryManagementBatchDelete({ DATA_IDS });
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -1,247 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<layout-card>
|
||||||
<el-card>
|
<el-tabs v-model="name" @tab-change="fnTabChange">
|
||||||
<el-form
|
<el-tab-pane label="风险管控清单" name="risk" lazy>
|
||||||
:model="searchForm"
|
<list name="risk" />
|
||||||
label-width="90px"
|
</el-tab-pane>
|
||||||
@submit.prevent="fnResetPaginationTransfer"
|
<el-tab-pane label="隐患排查清单" name="checkStandard" lazy>
|
||||||
>
|
<list name="checkStandard" />
|
||||||
<el-row>
|
</el-tab-pane>
|
||||||
<el-col :span="6">
|
</el-tabs>
|
||||||
<el-form-item label="清单名称" prop="KEYWORDS">
|
</layout-card>
|
||||||
<el-input
|
|
||||||
v-model="searchForm.KEYWORDS"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="人员" prop="USERNAME">
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.USERNAME"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="部门" prop="DEPTIDS">
|
|
||||||
<layout-department
|
|
||||||
v-model="searchForm.DEPTIDS"
|
|
||||||
multiple
|
|
||||||
show-checkbox
|
|
||||||
collapse-tags
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="清单类型" prop="TYPE">
|
|
||||||
<el-select v-model="searchForm.TYPE">
|
|
||||||
<el-option
|
|
||||||
v-for="item in inventoryTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="排查类型" prop="RISKCHECKLISTTYPE">
|
|
||||||
<el-select v-model="searchForm.RISKCHECKLISTTYPE">
|
|
||||||
<el-option
|
|
||||||
v-for="item in troubleshootingTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
|
||||||
<el-select v-model="searchForm.LISTINGLEVEL">
|
|
||||||
<el-option
|
|
||||||
v-for="item in [
|
|
||||||
{ BIANMA: '1', NAME: '公司' },
|
|
||||||
...inventoryLevelList,
|
|
||||||
]"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label-width="10px">
|
|
||||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
|
||||||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
<layout-card>
|
|
||||||
<layout-table
|
|
||||||
ref="tableRef"
|
|
||||||
:data="list"
|
|
||||||
v-model:pagination="pagination"
|
|
||||||
@get-data="fnGetDataTransfer"
|
|
||||||
row-key="LISTMANAGER_ID"
|
|
||||||
>
|
|
||||||
<el-table-column reserve-selection type="selection" width="55" />
|
|
||||||
<el-table-column label="序号" width="70">
|
|
||||||
<template v-slot="{ $index }">
|
|
||||||
{{ serialNumber(pagination, $index) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="NAME" label="清单名称" />
|
|
||||||
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
|
||||||
<el-table-column prop="POST_NAME" label="岗位" />
|
|
||||||
<el-table-column
|
|
||||||
prop="USER_NAME"
|
|
||||||
label="人员"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="PERIODNAME"
|
|
||||||
label="排查周期"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="SCREENTYPENAME"
|
|
||||||
label="排查类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="TYPENAME"
|
|
||||||
label="清单类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
|
||||||
prop="TASK_TYPE_NAME"
|
|
||||||
label="任务类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column label="状态" width="100">
|
|
||||||
<template #default> 已删除 </template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="100">
|
|
||||||
<template v-slot="{ row }">
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/delete_inventory_management/view',
|
|
||||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
查看
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnRecovery(row.LISTMANAGER_ID)"
|
|
||||||
>
|
|
||||||
启用
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<template #button>
|
|
||||||
<el-button
|
|
||||||
v-if="buttonJurisdiction.del"
|
|
||||||
type="danger"
|
|
||||||
@click="fnBatchDelete"
|
|
||||||
>
|
|
||||||
彻底删除
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</layout-table>
|
|
||||||
</layout-card>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { serialNumber } from "@/assets/js/utils.js";
|
import { ref } from "vue";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import List from "./components/list.vue";
|
||||||
import LayoutDepartment from "@/components/department/index.vue";
|
import { useRouter, useRoute, onBeforeRouteUpdate } from "vue-router";
|
||||||
import { debounce } from "throttle-debounce";
|
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
|
||||||
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
|
||||||
import {
|
|
||||||
layoutFnGetInventoryLevel,
|
|
||||||
layoutFnGetInventoryType,
|
|
||||||
layoutFnGetTroubleshootingType,
|
|
||||||
} from "@/assets/js/data_dictionary.js";
|
|
||||||
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
|
||||||
import { useUserStore } from "@/pinia/user.js";
|
|
||||||
import {
|
|
||||||
getDeleteInventoryManagementList,
|
|
||||||
setDeleteInventoryManagementRecovery,
|
|
||||||
setInventoryManagementBatchDelete,
|
|
||||||
} from "@/request/hazard_investigation.js";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
const route = useRoute();
|
||||||
useListData(getDeleteInventoryManagementList);
|
const defaultName = "risk";
|
||||||
const userStore = useUserStore();
|
const name = ref(route.query.name || defaultName);
|
||||||
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
onBeforeRouteUpdate((to, from, next) => {
|
||||||
const buttonJurisdiction = await useButtonJurisdiction("stoplistmanager");
|
name.value = to.query.name || defaultName;
|
||||||
const inventoryTypeList = await layoutFnGetInventoryType();
|
next();
|
||||||
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
});
|
||||||
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
const fnTabChange = (name) => {
|
||||||
const fnGetDataTransfer = () => {
|
router.replace({
|
||||||
fnGetData({
|
path: "/hazard_investigation/delete_inventory_management",
|
||||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
query: {
|
||||||
|
name,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fnResetPaginationTransfer = () => {
|
|
||||||
fnResetPagination({
|
|
||||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const fnRecovery = debounce(
|
|
||||||
1000,
|
|
||||||
async (LISTMANAGER_ID) => {
|
|
||||||
await ElMessageBox.confirm("确定要恢复吗?", { type: "warning" });
|
|
||||||
await setDeleteInventoryManagementRecovery({ LISTMANAGER_ID });
|
|
||||||
ElMessage.success("恢复成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
const fnBatchDelete = debounce(
|
|
||||||
1000,
|
|
||||||
async () => {
|
|
||||||
const selectionData = tableRef.value.getSelectionRows();
|
|
||||||
if (selectionData.length === 0) {
|
|
||||||
ElMessage.warning("请选中要删除的项");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
await ElMessageBox.confirm(
|
|
||||||
"删除之后该清单无法恢复,确认要删除选中的数据吗?",
|
|
||||||
{ type: "warning" }
|
|
||||||
);
|
|
||||||
const DATA_IDS = selectionData.map((item) => item.LISTMANAGER_ID).join(",");
|
|
||||||
await setInventoryManagementBatchDelete({ DATA_IDS });
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<el-divider content-position="left">清单信息</el-divider>
|
<el-divider content-position="left">风险管控清单信息</el-divider>
|
||||||
<el-form
|
<el-form
|
||||||
ref="formRef"
|
ref="formRef"
|
||||||
:model="data.form"
|
:model="data.form"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,461 @@
|
||||||
|
<template>
|
||||||
|
<layout-card>
|
||||||
|
<el-divider content-position="left">隐患排查清单信息</el-divider>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="data.form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单名称" prop="NAME">
|
||||||
|
<el-input v-model="data.form.NAME" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item
|
||||||
|
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
||||||
|
label="是否包保责任人任务"
|
||||||
|
prop="BAO_BAO_TYPE"
|
||||||
|
label-width="160px"
|
||||||
|
>
|
||||||
|
<el-select v-model="data.form.BAO_BAO_TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in [
|
||||||
|
{ BIANMA: '0', NAME: '否' },
|
||||||
|
{ BIANMA: '1', NAME: '是' },
|
||||||
|
]"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col v-if="data.form.BAO_BAO_TYPE === '1'" :span="6">
|
||||||
|
<el-form-item label="任务类型" prop="TASK_TYPE">
|
||||||
|
<el-select v-model="data.form.TASK_TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in taskTypeList"
|
||||||
|
:key="item.DICTIONARIES_ID"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.DICTIONARIES_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item prop="DEPARTMENT_ID" label="部门">
|
||||||
|
<layout-department
|
||||||
|
v-model="data.form.DEPARTMENT_ID"
|
||||||
|
@update:model-value="fnDepartmentChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="岗位" prop="POST_ID">
|
||||||
|
<el-select v-model="data.form.POST_ID" @change="fnPostChange">
|
||||||
|
<el-option
|
||||||
|
v-for="item in data.postList"
|
||||||
|
:key="item.POST_ID"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.POST_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item v-if="!LISTMANAGER_ID" label="负责人" prop="USER_IDS">
|
||||||
|
<el-select v-model="data.form.USER_IDS" multiple>
|
||||||
|
<el-option
|
||||||
|
v-for="item in data.userList"
|
||||||
|
:key="item.USER_ID"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.USER_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-else-if="LISTMANAGER_ID"
|
||||||
|
label="负责人"
|
||||||
|
prop="USER_ID"
|
||||||
|
>
|
||||||
|
<el-select v-model="data.form.USER_ID">
|
||||||
|
<el-option
|
||||||
|
v-for="item in data.userList"
|
||||||
|
:key="item.USER_ID"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.USER_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="排查类型" prop="SCREENTYPE">
|
||||||
|
<el-select v-model="data.form.SCREENTYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in troubleshootingTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="排查周期" prop="PERIOD">
|
||||||
|
<el-select v-model="data.form.PERIOD">
|
||||||
|
<el-option
|
||||||
|
v-for="item in troubleshootingCycleList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单类型" prop="TYPE">
|
||||||
|
<el-select v-model="data.form.TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in inventoryTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col
|
||||||
|
v-if="
|
||||||
|
data.form.TYPE === 'listType0005' ||
|
||||||
|
data.form.TYPE === 'listType0006'
|
||||||
|
"
|
||||||
|
:key="data.form.TYPE"
|
||||||
|
:span="6"
|
||||||
|
>
|
||||||
|
<el-form-item label="排查日期" prop="dates">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="data.form.dates"
|
||||||
|
:disabled-date="
|
||||||
|
data.form.TYPE === 'listType0006' ? fnDisabledDate : null
|
||||||
|
"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="至"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="YYYY-MM-DD"
|
||||||
|
format="YYYY-MM-DD"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<el-divider content-position="left">检查内容</el-divider>
|
||||||
|
<el-form
|
||||||
|
:model="data.searchForm"
|
||||||
|
label-width="60px"
|
||||||
|
@submit.prevent="fnGetDataFilter"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="关键字" prop="KEYWORDS">
|
||||||
|
<el-input
|
||||||
|
v-model="data.searchForm.KEYWORDS"
|
||||||
|
placeholder="请输入内容"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||||
|
<el-button native-type="reset" @click="fnGetDataFilter">
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-form-item class="end">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="data.selectStandardDialogVisible = true"
|
||||||
|
>
|
||||||
|
选择其他检查标准
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="data.addOrEditDialog.visible = true"
|
||||||
|
>
|
||||||
|
添加检查标准
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<layout-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="data.list"
|
||||||
|
:show-pagination="false"
|
||||||
|
max-height="400"
|
||||||
|
row-key="RISKCHECKITEM_ID"
|
||||||
|
>
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column type="index" label="序号" width="55" />
|
||||||
|
<el-table-column
|
||||||
|
prop="CHECK_CATEGORY_NAME"
|
||||||
|
label="检查类别"
|
||||||
|
width="180"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="CHECK_ITEM_NAME" label="检查项目" width="180" />
|
||||||
|
<el-table-column prop="CHECK_CONTENT" label="检查内容" width="300" />
|
||||||
|
<el-table-column prop="CHECK_STANDARD" label="检查标准" width="180" />
|
||||||
|
<el-table-column prop="CHECK_QUALIFIED" label="检查合格项" width="180" />
|
||||||
|
<el-table-column prop="CHECK_UNQUALIFIED" label="检查不合格项" />
|
||||||
|
<el-table-column label="操作类型">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.OPERATION_TYPE === 1">选择</span>
|
||||||
|
<span v-if="row.OPERATION_TYPE === 2">填写</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</layout-table>
|
||||||
|
<div class="tc mt-10">
|
||||||
|
<el-button type="primary" @click="fnSubmit">保存</el-button>
|
||||||
|
</div>
|
||||||
|
<add-checkstandard
|
||||||
|
title="添加检查标准"
|
||||||
|
type="add"
|
||||||
|
v-model:visible="data.addOrEditDialog.visible"
|
||||||
|
v-model:form="data.addOrEditDialog.form"
|
||||||
|
:standard-data="data.checkStandardList"
|
||||||
|
:category-data="data.categoryList"
|
||||||
|
@submit="fnAddStandardSubmit"
|
||||||
|
/>
|
||||||
|
<select-checkstandard
|
||||||
|
v-model:visible="data.selectStandardDialogVisible"
|
||||||
|
v-model:list-data="data.listAll"
|
||||||
|
@submit="fnSelectStandardSubmit"
|
||||||
|
/>
|
||||||
|
</layout-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { nextTick, reactive, ref, watchEffect } from "vue";
|
||||||
|
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||||
|
import { useUserStore } from "@/pinia/user.js";
|
||||||
|
import {
|
||||||
|
layoutFnGetInventoryType,
|
||||||
|
layoutFnGetTaskType,
|
||||||
|
layoutFnGetTroubleshootingCycle,
|
||||||
|
layoutFnGetTroubleshootingType,
|
||||||
|
} from "@/assets/js/data_dictionary.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import {
|
||||||
|
getPostListAll,
|
||||||
|
getStandardLevels,
|
||||||
|
getUserListAll,
|
||||||
|
} from "@/request/data_dictionary.js";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import {
|
||||||
|
setCheckStandardManagementAdd,
|
||||||
|
setCheckStandardManagementEdit,
|
||||||
|
} from "@/request/hazard_investigation.js";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||||
|
import { ElMessage } from "element-plus";
|
||||||
|
import AddCheckstandard from "@/views/hazard_investigation/inventory_management/components/checkstandard_add.vue";
|
||||||
|
import SelectCheckstandard from "./components/select_checkstandard.vue";
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const { LISTMANAGER_ID } = route.query;
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||||
|
const rules = {
|
||||||
|
NAME: [{ required: true, message: "清单名称不能为空", trigger: "blur" }],
|
||||||
|
BAO_BAO_TYPE: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "是否包保责任人任务不能为空",
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
TASK_TYPE: [
|
||||||
|
{ required: true, message: "任务类型不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
DEPARTMENT_ID: [
|
||||||
|
{ required: true, message: "部门不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
POST_ID: [{ required: true, message: "岗位不能为空", trigger: "change" }],
|
||||||
|
USER_IDS: [{ required: true, message: "负责人不能为空", trigger: "change" }],
|
||||||
|
USER_ID: [{ required: true, message: "负责人不能为空", trigger: "change" }],
|
||||||
|
SCREENTYPE: [
|
||||||
|
{ required: true, message: "排查类型不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
PERIOD: [{ required: true, message: "排查周期不能为空", trigger: "change" }],
|
||||||
|
TYPE: [{ required: true, message: "清单类型不能为空", trigger: "change" }],
|
||||||
|
dates: [{ required: true, message: "排查日期不能为空", trigger: "change" }],
|
||||||
|
};
|
||||||
|
const formRef = ref(null);
|
||||||
|
const tableRef = ref(null);
|
||||||
|
const data = reactive({
|
||||||
|
form: {
|
||||||
|
NAME: "",
|
||||||
|
BAO_BAO_TYPE: "",
|
||||||
|
TASK_TYPE: "",
|
||||||
|
DEPARTMENT_ID: "",
|
||||||
|
POST_ID: "",
|
||||||
|
USER_IDS: [],
|
||||||
|
USER_ID: "",
|
||||||
|
SCREENTYPE: "",
|
||||||
|
PERIOD: "",
|
||||||
|
TYPE: "",
|
||||||
|
dates: [],
|
||||||
|
},
|
||||||
|
postList: [],
|
||||||
|
userList: [],
|
||||||
|
list: [],
|
||||||
|
listAll: [],
|
||||||
|
searchForm: {},
|
||||||
|
selectStandardDialogVisible: false,
|
||||||
|
addOrEditDialog: {
|
||||||
|
visible: false,
|
||||||
|
form: {
|
||||||
|
CHECK_CATEGORY_NAME: "",
|
||||||
|
CHECK_ITEM_NAME: "",
|
||||||
|
CHECK_CONTENT: "",
|
||||||
|
CHECK_STANDARD: "",
|
||||||
|
REFERENCE_BASIS: "",
|
||||||
|
CHECK_QUALIFIED: "",
|
||||||
|
CHECK_UNQUALIFIED: "",
|
||||||
|
OPERATION_TYPE: "",
|
||||||
|
COMMON_ITEM_SORT: "",
|
||||||
|
letItemType: "",
|
||||||
|
letCategoryType: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
checkStandardList: [],
|
||||||
|
categoryList: [],
|
||||||
|
itemList: [],
|
||||||
|
});
|
||||||
|
const taskTypeList = await layoutFnGetTaskType();
|
||||||
|
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
||||||
|
const troubleshootingCycleList = await layoutFnGetTroubleshootingCycle();
|
||||||
|
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||||
|
// const fnGetInspectionItems = async () => {
|
||||||
|
// const resData = await getCheckStandardManagementInspectionItems();
|
||||||
|
// data.list = [...tableRef.value.getSelectionRows(), ...resData.varList];
|
||||||
|
// data.listAll = [...tableRef.value.getSelectionRows(), ...resData.varList];
|
||||||
|
// await fnTableSelection();
|
||||||
|
// };
|
||||||
|
// fnGetInspectionItems();
|
||||||
|
const fnDepartmentChange = () => {
|
||||||
|
data.postList = [];
|
||||||
|
data.userList = [];
|
||||||
|
data.form.POST_ID = "";
|
||||||
|
data.form.USER_IDS = [];
|
||||||
|
data.form.USER_ID = "";
|
||||||
|
};
|
||||||
|
const fnPostChange = () => {
|
||||||
|
data.userList = [];
|
||||||
|
data.form.USER_IDS = [];
|
||||||
|
data.form.USER_ID = "";
|
||||||
|
};
|
||||||
|
const fnGetPost = async (DEPARTMENT_ID) => {
|
||||||
|
const resData = await getPostListAll({ DEPARTMENT_ID });
|
||||||
|
data.postList = resData.postList;
|
||||||
|
};
|
||||||
|
const fnGetUser = async (POST_ID) => {
|
||||||
|
const resData = await getUserListAll({ POST_ID });
|
||||||
|
data.userList = resData.userList;
|
||||||
|
};
|
||||||
|
const fnDisabledDate = (time) => {
|
||||||
|
return time.getTime() < Date.now();
|
||||||
|
};
|
||||||
|
const fnGetDataFilter = () => {
|
||||||
|
const keyword = data.searchForm.KEYWORDS;
|
||||||
|
if (keyword) {
|
||||||
|
data.list = data.listAll.filter(
|
||||||
|
(item) =>
|
||||||
|
item.CHECK_ITEM_NAME?.indexOf(keyword) > -1 ||
|
||||||
|
item.CHECK_CONTENT?.indexOf(keyword) > -1 ||
|
||||||
|
item.CHECK_STANDARD?.indexOf(keyword) > -1
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
data.list = [...data.listAll];
|
||||||
|
}
|
||||||
|
fnTableSelection();
|
||||||
|
};
|
||||||
|
const fnTableSelection = async () => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
await nextTick();
|
||||||
|
selectionData.forEach((item) => {
|
||||||
|
tableRef.value.toggleRowSelection(item);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnAddStandardSubmit = (item) => {
|
||||||
|
console.log(item);
|
||||||
|
data.list.push(item);
|
||||||
|
data.listAll.push(item);
|
||||||
|
fnTableSelection();
|
||||||
|
};
|
||||||
|
const fnSelectStandardSubmit = (listData) => {
|
||||||
|
data.list.push(...listData);
|
||||||
|
data.listAll.push(...listData);
|
||||||
|
fnTableSelection();
|
||||||
|
};
|
||||||
|
const fnSubmit = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
await useFormValidate(formRef);
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
if (selectionData.length === 0) {
|
||||||
|
ElMessage.error("请选择检查内容");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const params = {
|
||||||
|
...data.form,
|
||||||
|
USER_IDS: data.form.USER_IDS?.join(","),
|
||||||
|
LISTITEM: JSON.stringify(selectionData),
|
||||||
|
BAO_BAO_DEPARTMENT_ID: data.form.DEPARTMENT_ID,
|
||||||
|
BAO_BAO_USER_ID: data.form.USER_ID,
|
||||||
|
START_DATE: data.form.dates[0],
|
||||||
|
END_DATE: data.form.dates[1],
|
||||||
|
BAO_BAO_TYPE: data.form.BAO_BAO_TYPE || "0",
|
||||||
|
};
|
||||||
|
!LISTMANAGER_ID
|
||||||
|
? await setCheckStandardManagementAdd(params)
|
||||||
|
: await setCheckStandardManagementEdit(params);
|
||||||
|
ElMessage.success("保存成功");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnCheckStandard = async () => {
|
||||||
|
const list = await getStandardLevels();
|
||||||
|
list.varList.forEach((item) => {
|
||||||
|
data.checkStandardList.push({
|
||||||
|
DICTIONARIES_ID: item.DICTIONARY_ID,
|
||||||
|
NAME: item.DICTIONARY_NAME,
|
||||||
|
PARENT_IDS: item.PARENT_IDS,
|
||||||
|
PARENT_ID: item.PARENT_ID,
|
||||||
|
});
|
||||||
|
if (item.PARENT_ID === "0") {
|
||||||
|
data.categoryList.push({
|
||||||
|
DICTIONARIES_ID: item.DICTIONARY_ID,
|
||||||
|
NAME: item.DICTIONARY_NAME,
|
||||||
|
PARENT_IDS: item.PARENT_IDS,
|
||||||
|
PARENT_ID: item.PARENT_ID,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
fnCheckStandard();
|
||||||
|
console.log(data.checkStandardList);
|
||||||
|
watchEffect(() => {
|
||||||
|
if (data.form.DEPARTMENT_ID) fnGetPost(data.form.DEPARTMENT_ID);
|
||||||
|
if (data.form.POST_ID) fnGetUser(data.form.POST_ID);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
|
|
@ -0,0 +1,221 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog
|
||||||
|
v-model="visible"
|
||||||
|
:title="title ? title : type === 'add' ? '新增' : '修改'"
|
||||||
|
:before-close="fnClose"
|
||||||
|
>
|
||||||
|
<el-form ref="formRef" :rules="rules" :model="form" label-width="240px">
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查类别" prop="CHECK_CATEGORY">
|
||||||
|
<layout-select-create
|
||||||
|
:list="categoryData"
|
||||||
|
v-model="data.CHECK_CATEGORY_NAME"
|
||||||
|
@change="goChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查项目" prop="CHECK_ITEM">
|
||||||
|
<layout-select-create
|
||||||
|
:list="data.itemData"
|
||||||
|
v-model="data.CHECK_ITEM_NAME"
|
||||||
|
@change="goChange"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查内容" prop="CHECK_CONTENT">
|
||||||
|
<el-input v-model="form.CHECK_CONTENT" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查标准" prop="CHECK_STANDARD">
|
||||||
|
<el-input v-model="form.CHECK_STANDARD" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="参考依据" prop="REFERENCE_BASIS">
|
||||||
|
<el-input v-model="form.REFERENCE_BASIS" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查合格项" prop="CHECK_QUALIFIED">
|
||||||
|
<el-input v-model="form.CHECK_QUALIFIED" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查不合格项" prop="CHECK_UNQUALIFIED">
|
||||||
|
<el-input v-model="form.CHECK_UNQUALIFIED" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="操作类型" prop="OPERATION_TYPE">
|
||||||
|
<el-select v-model="form.OPERATION_TYPE">
|
||||||
|
<el-option :value="1" label="选择" />
|
||||||
|
<el-option :value="2" label="填写" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-form-item label="排序" prop="COMMON_ITEM_SORT">
|
||||||
|
<el-input-number
|
||||||
|
:min="1"
|
||||||
|
:precision="0"
|
||||||
|
v-model="form.COMMON_ITEM_SORT"
|
||||||
|
controls-position="right"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="fnClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
|
import { useVModels } from "@vueuse/core";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||||
|
import LayoutSelectCreate from "@/components/select_create/index.vue";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
form: {
|
||||||
|
type: Object,
|
||||||
|
required: true,
|
||||||
|
default: () => ({}),
|
||||||
|
},
|
||||||
|
standardData: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
categoryData: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
title: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:visible", "update:form", "submit"]);
|
||||||
|
const { visible, form } = useVModels(props, emits);
|
||||||
|
const formRef = ref(null);
|
||||||
|
const data = reactive({
|
||||||
|
nameValue: "",
|
||||||
|
CHECK_CATEGORY_NAME: "",
|
||||||
|
CHECK_ITEM_NAME: "",
|
||||||
|
standardData: props.standardData,
|
||||||
|
itemData: [],
|
||||||
|
});
|
||||||
|
// const fnCheckStandard = async () => {
|
||||||
|
// const list = await layoutFnGetCheckStandard();
|
||||||
|
// data.checkStandardList = list;
|
||||||
|
// list.forEach((item) => {
|
||||||
|
// if (item.PARENT_ID === "0") {
|
||||||
|
// data.categoryList.push(item);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
// fnCheckStandard();
|
||||||
|
const goChange = (event) => {
|
||||||
|
if (fnFindValueInList(props.categoryData, data.CHECK_CATEGORY_NAME)) {
|
||||||
|
form.value.letCategoryType = "select";
|
||||||
|
form.value.CHECK_CATEGORY_NAME = data.nameValue;
|
||||||
|
} else {
|
||||||
|
form.value.letCategoryType = "value";
|
||||||
|
form.value.CHECK_CATEGORY_NAME = data.CHECK_CATEGORY_NAME;
|
||||||
|
}
|
||||||
|
if (form.value.letCategoryType === "select" && event) {
|
||||||
|
getItemList(data.CHECK_CATEGORY_NAME);
|
||||||
|
}
|
||||||
|
if (fnFindValueInList(data.itemData, data.CHECK_ITEM_NAME)) {
|
||||||
|
form.value.letItemType = "select";
|
||||||
|
form.value.CHECK_ITEM_NAME = data.nameValue;
|
||||||
|
} else {
|
||||||
|
form.value.letItemType = "value";
|
||||||
|
form.value.CHECK_ITEM_NAME = data.CHECK_ITEM_NAME;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const getItemList = (val) => {
|
||||||
|
data.standardData.forEach((item) => {
|
||||||
|
if (item.PARENT_ID !== "0" && item.PARENT_IDS.includes(val)) {
|
||||||
|
data.itemData.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnFindValueInList = (list, value) => {
|
||||||
|
let existence = false;
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
if (list[i].DICTIONARIES_ID === value) {
|
||||||
|
existence = true;
|
||||||
|
data.nameValue = list[i].NAME;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return existence;
|
||||||
|
};
|
||||||
|
const rules = {
|
||||||
|
CHECK_CATEGORY_NAME: [
|
||||||
|
{ required: true, message: "检查类别不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
CHECK_ITEM_NAME: [
|
||||||
|
{ required: true, message: "检查项目不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
CHECK_CONTENT: [
|
||||||
|
{ required: true, message: "检查内容不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
CHECK_STANDARD: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "检查标准不能为空",
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
REFERENCE_BASIS: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "参考依据不能为空",
|
||||||
|
trigger: "change",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
CHECK_QUALIFIED: [
|
||||||
|
{ required: true, message: "检查合格项不能为空", trigger: "change" },
|
||||||
|
],
|
||||||
|
CHECK_UNQUALIFIED: [
|
||||||
|
{ required: true, message: "检查不合格项不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
OPERATION_TYPE: [
|
||||||
|
{ required: true, message: "操作类型不能为空", trigger: "blur" },
|
||||||
|
],
|
||||||
|
};
|
||||||
|
const fnClose = () => {
|
||||||
|
// form.resetFields();
|
||||||
|
visible.value = false;
|
||||||
|
};
|
||||||
|
const fnSubmit = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
await useFormValidate(formRef);
|
||||||
|
emits("submit", form.value);
|
||||||
|
fnClose();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
|
|
@ -0,0 +1,483 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form
|
||||||
|
:model="searchForm"
|
||||||
|
label-width="90px"
|
||||||
|
@submit.prevent="fnResetPaginationTransfer"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单名称" prop="KEYWORDS">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.KEYWORDS"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="人员" prop="USERNAME">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.USERNAME"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="部门" prop="DEPTIDS">
|
||||||
|
<layout-department
|
||||||
|
v-model="searchForm.DEPTIDS"
|
||||||
|
multiple
|
||||||
|
show-checkbox
|
||||||
|
collapse-tags
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单类型" prop="TYPE">
|
||||||
|
<el-select v-model="searchForm.TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in inventoryTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="排查类型" prop="RISKCHECKLISTTYPE">
|
||||||
|
<el-select v-model="searchForm.RISKCHECKLISTTYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in troubleshootingTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
||||||
|
<el-select v-model="searchForm.LISTINGLEVEL">
|
||||||
|
<el-option
|
||||||
|
v-for="item in [
|
||||||
|
{ BIANMA: '1', NAME: '公司' },
|
||||||
|
...inventoryLevelList,
|
||||||
|
]"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||||
|
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<layout-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="list"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
@get-data="fnGetDataTransfer"
|
||||||
|
:row-key="name === 'risk' ? LISTMANAGER_ID : CUSTOM_ID"
|
||||||
|
>
|
||||||
|
<el-table-column reserve-selection type="selection" width="55" />
|
||||||
|
<el-table-column label="序号" width="70">
|
||||||
|
<template v-slot="{ $index }">
|
||||||
|
{{ serialNumber(pagination, $index) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="NAME" label="清单名称" />
|
||||||
|
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
||||||
|
<el-table-column prop="POST_NAME" label="岗位" />
|
||||||
|
<el-table-column
|
||||||
|
prop="USER_NAME"
|
||||||
|
label="人员"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="PERIODNAME"
|
||||||
|
label="排查周期"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="SCREENTYPENAME"
|
||||||
|
label="排查类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="TYPENAME"
|
||||||
|
label="清单类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
||||||
|
prop="TASK_TYPE_NAME"
|
||||||
|
label="任务类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" width="100">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.ISDELETE === '0'">启用</span>
|
||||||
|
<span v-else-if="row.ISDELETE === '1'">禁用</span>
|
||||||
|
<span v-else-if="row.ISDELETE === '-99'">未开始</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="470">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.edit"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/print',
|
||||||
|
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
打印
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.edit"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnListQRCode(row)"
|
||||||
|
>
|
||||||
|
清单二维码
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
(row.cdcount === 0 &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit) &&
|
||||||
|
row.TYPE !== 'listType0006') ||
|
||||||
|
row.ISDELETE === '-99'
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/edit',
|
||||||
|
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
row.ISDELETE === '0' &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
name === 'risk'
|
||||||
|
? fnDisable(row.LISTMANAGER_ID)
|
||||||
|
: fnDisable(row.CUSTOM_ID)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
禁用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
row.ISDELETE === '1' &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
name === 'risk'
|
||||||
|
? fnEnable(row.LISTMANAGER_ID)
|
||||||
|
: fnEnable(row.CUSTOM_ID)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/part_qr_code',
|
||||||
|
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
v-if="name === 'risk'"
|
||||||
|
>
|
||||||
|
部位二维码
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnInspectionRoute(row)"
|
||||||
|
v-if="name === 'risk'"
|
||||||
|
>
|
||||||
|
巡检路线
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="row.TASK_TYPE && row.TASK_TYPE !== ''"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/insurance_coverage',
|
||||||
|
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
设置包保责任类型
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template #button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.add"
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path:
|
||||||
|
name === 'risk'
|
||||||
|
? '/hazard_investigation/inventory_management/add'
|
||||||
|
: '/hazard_investigation/inventory_management/check_standard_add',
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.del"
|
||||||
|
type="danger"
|
||||||
|
@click="fnBatchDelete"
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
@click="fnInheritanceList"
|
||||||
|
v-if="name === 'risk'"
|
||||||
|
>
|
||||||
|
继承清单
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</layout-table>
|
||||||
|
<list-qr-code
|
||||||
|
:info="data.listQrCodeDialog.info"
|
||||||
|
v-model:visible="data.listQrCodeDialog.visible"
|
||||||
|
/>
|
||||||
|
<inspection-route
|
||||||
|
v-model:visible="data.inspectionRouteDialog.visible"
|
||||||
|
v-model:list="data.inspectionRouteDialog.list"
|
||||||
|
:info="data.inspectionRouteDialog.info"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { serialNumber } from "@/assets/js/utils.js";
|
||||||
|
import { reactive } from "vue";
|
||||||
|
import useListData from "@/assets/js/useListData.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
||||||
|
import {
|
||||||
|
layoutFnGetInventoryLevel,
|
||||||
|
layoutFnGetInventoryType,
|
||||||
|
layoutFnGetTroubleshootingType,
|
||||||
|
} from "@/assets/js/data_dictionary.js";
|
||||||
|
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||||
|
import { useUserStore } from "@/pinia/user.js";
|
||||||
|
import {
|
||||||
|
getCustomList,
|
||||||
|
getInventoryManagementList,
|
||||||
|
getInventoryManagementRouteView,
|
||||||
|
setCustomBatchBatchDelete,
|
||||||
|
setCustomBatchDeleteTemporary,
|
||||||
|
setCustomDisable,
|
||||||
|
setCustomEnable,
|
||||||
|
setInventoryManagementBatchDelete,
|
||||||
|
setInventoryManagementBatchDeleteTemporary,
|
||||||
|
setInventoryManagementDisable,
|
||||||
|
setInventoryManagementEnable,
|
||||||
|
} from "@/request/hazard_investigation.js";
|
||||||
|
import ListQrCode from "./list_qr_code.vue";
|
||||||
|
import InspectionRoute from "./inspection_route.vue";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
const tabName = defineProps({
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const router = useRouter();
|
||||||
|
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
||||||
|
tabName.name === "risk"
|
||||||
|
? useListData(getInventoryManagementList)
|
||||||
|
: useListData(getCustomList);
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const USER_ID = userStore.getUserInfo.USER_ID;
|
||||||
|
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||||
|
const buttonJurisdiction = await useButtonJurisdiction("listmanager");
|
||||||
|
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||||
|
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
||||||
|
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
||||||
|
const data = reactive({
|
||||||
|
listQrCodeDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
|
inspectionRouteDialog: {
|
||||||
|
visible: false,
|
||||||
|
list: [],
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const fnGetDataTransfer = () => {
|
||||||
|
fnGetData({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnResetPaginationTransfer = () => {
|
||||||
|
fnResetPagination({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnListQRCode = (row) => {
|
||||||
|
data.listQrCodeDialog.visible = true;
|
||||||
|
data.listQrCodeDialog.info = row;
|
||||||
|
};
|
||||||
|
const fnInspectionRoute = async (row) => {
|
||||||
|
const resData = await getInventoryManagementRouteView({
|
||||||
|
LISTMANAGER_ID: row.LISTMANAGER_ID,
|
||||||
|
});
|
||||||
|
data.inspectionRouteDialog.list = resData.varList;
|
||||||
|
data.inspectionRouteDialog.info = row;
|
||||||
|
data.inspectionRouteDialog.visible = true;
|
||||||
|
};
|
||||||
|
const fnDisable = debounce(
|
||||||
|
1000,
|
||||||
|
async (ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要禁用吗?", { type: "warning" });
|
||||||
|
if (name === "risk") {
|
||||||
|
await setInventoryManagementDisable({ ID });
|
||||||
|
} else {
|
||||||
|
await setCustomDisable({ ID });
|
||||||
|
}
|
||||||
|
ElMessage.success("禁用成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnEnable = debounce(
|
||||||
|
1000,
|
||||||
|
async (ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要启用吗?", { type: "warning" });
|
||||||
|
if (name === "risk") {
|
||||||
|
await setInventoryManagementEnable({ ID });
|
||||||
|
} else {
|
||||||
|
await setCustomEnable({ ID });
|
||||||
|
}
|
||||||
|
ElMessage.success("启用成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnBatchDelete = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
if (selectionData.length === 0) {
|
||||||
|
ElMessage.warning("请选中要删除的项");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const DATA_IDS1 = [];
|
||||||
|
const DATA_IDS2 = [];
|
||||||
|
selectionData.forEach((item) => {
|
||||||
|
if (item.TYPE === "listType0006") {
|
||||||
|
if (name === "risk") {
|
||||||
|
DATA_IDS1.push(item.LISTMANAGER_ID);
|
||||||
|
} else {
|
||||||
|
DATA_IDS1.push(item.CUSTOM_ID);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (name === "risk") {
|
||||||
|
DATA_IDS2.push(item.LISTMANAGER_ID);
|
||||||
|
} else {
|
||||||
|
DATA_IDS2.push(item.CUSTOM_ID);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (DATA_IDS1.length > 0) {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
"临时清单会彻底被删除不可恢复,确定要删除吗?",
|
||||||
|
{ type: "warning" }
|
||||||
|
);
|
||||||
|
if (name === "risk") {
|
||||||
|
await setInventoryManagementBatchDeleteTemporary({
|
||||||
|
DATA_IDS: DATA_IDS1.join(","),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await setCustomBatchDeleteTemporary({
|
||||||
|
DATA_IDS: DATA_IDS1.join(","),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await ElMessageBox.confirm("确定要删除选中的数据吗?", {
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (name === "risk") {
|
||||||
|
await setInventoryManagementBatchDelete({
|
||||||
|
DATA_IDS: DATA_IDS2.join(","),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await setCustomBatchBatchDelete({ DATA_IDS: DATA_IDS2.join(",") });
|
||||||
|
}
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnInheritanceList = () => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
if (selectionData.length === 0) {
|
||||||
|
ElMessage.warning("请选中要继承的清单");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (selectionData.length > 1) {
|
||||||
|
ElMessage.warning("只能选择一个清单");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
router.push({
|
||||||
|
path: "/hazard_investigation/inventory_management/inheritance_list",
|
||||||
|
query: {
|
||||||
|
LISTMANAGER_ID: selectionData[0].LISTMANAGER_ID,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -0,0 +1,172 @@
|
||||||
|
<template>
|
||||||
|
<el-dialog title="选择其他检查标准" v-model="visible" width="1500">
|
||||||
|
<el-form
|
||||||
|
:model="searchForm"
|
||||||
|
label-width="60px"
|
||||||
|
@submit.prevent="fnResetPagination"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="检查类型" prop="KEYWORDS" @change="getLevelData">
|
||||||
|
<el-select v-model="searchForm.CHECK_CATEGORY">
|
||||||
|
<el-option
|
||||||
|
v-for="item in data.categoryList"
|
||||||
|
:key="item.DICTIONARY_ID"
|
||||||
|
:label="item.DICTIONARY_NAME"
|
||||||
|
:value="item.DICTIONARY_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="检查项目" prop="DEPARTMENT_ID">
|
||||||
|
<el-select v-model="searchForm.CHECK_ITEM">
|
||||||
|
<el-option
|
||||||
|
v-for="item in data.itemList"
|
||||||
|
:key="item.DICTIONARY_ID"
|
||||||
|
:label="item.DICTIONARY_ID"
|
||||||
|
:value="item.DICTIONARY_NAME"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="检查内容">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.OTHERKEYWORDS"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||||
|
<el-button native-type="reset" @click="fnResetPagination">
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<layout-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="list"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
@get-data="fnGetData"
|
||||||
|
row-key="CUSTOM_ITEM_ID"
|
||||||
|
>
|
||||||
|
<el-table-column reserve-selection type="selection" width="55" />
|
||||||
|
<el-table-column label="序号" width="70">
|
||||||
|
<template v-slot="{ $index }">
|
||||||
|
{{ serialNumber(pagination, $index) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="CHECK_CATEGORY_NAME"
|
||||||
|
label="检查类别"
|
||||||
|
width="105"
|
||||||
|
/>
|
||||||
|
<el-table-column prop="CHECK_ITEM_NAME" label="检查项目" width="90" />
|
||||||
|
<el-table-column prop="CHECK_CONTENT" label="检查内容" />
|
||||||
|
<el-table-column prop="CHECK_STANDARD" label="检查标准" width="100" />
|
||||||
|
<el-table-column prop="CHECK_QUALIFIED" label="检查合格项" width="90" />
|
||||||
|
<el-table-column prop="CHECK_UNQUALIFIED" label="检查不合格项" />
|
||||||
|
<el-table-column label="操作类型">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.OPERATION_TYPE === 1">选择</span>
|
||||||
|
<span v-if="row.OPERATION_TYPE === 2">填写</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="OPERATION_TYPE" label="操作">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-button type="primary" text link @click="edit(row)"
|
||||||
|
>修改</el-button
|
||||||
|
>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</layout-table>
|
||||||
|
<template #footer>
|
||||||
|
<el-button @click="fnClose">取消</el-button>
|
||||||
|
<el-button type="primary" @click="fnSubmit"> 确定 </el-button>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { useVModel } from "@vueuse/core";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import useListData from "@/assets/js/useListData.js";
|
||||||
|
import { getCheckstandardCommonList } from "@/request/hazard_investigation.js";
|
||||||
|
import { reactive, watch } from "vue";
|
||||||
|
import { serialNumber } from "@/assets/js/utils.js";
|
||||||
|
import { differenceWith } from "lodash-es";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
visible: {
|
||||||
|
type: Boolean,
|
||||||
|
required: true,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
|
listData: {
|
||||||
|
type: Array,
|
||||||
|
required: true,
|
||||||
|
default: () => [],
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const data = reactive({
|
||||||
|
checkStandardList: [],
|
||||||
|
categoryList: [],
|
||||||
|
itemList: [],
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:visible", "submit"]);
|
||||||
|
const visible = useVModel(props, "visible", emits);
|
||||||
|
const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } =
|
||||||
|
useListData(getCheckstandardCommonList, {
|
||||||
|
immediate: false,
|
||||||
|
clearSelection: false,
|
||||||
|
});
|
||||||
|
// const fnCheckStandard = async () => {
|
||||||
|
// const list = await layoutFnGetCheckStandard();
|
||||||
|
// data.checkStandardList = list;
|
||||||
|
// list.forEach((item) => {
|
||||||
|
// if (item.PARENT_ID === "0") {
|
||||||
|
// data.categoryList.push(item);
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// };
|
||||||
|
// fnCheckStandard();
|
||||||
|
const getLevelData = () => {
|
||||||
|
data.checkStandardList.forEach((item) => {
|
||||||
|
if (
|
||||||
|
item.PARENT_ID !== "0" &&
|
||||||
|
item.PARENT_IDS.contains(searchForm.CHECK_CATEGORY)
|
||||||
|
) {
|
||||||
|
this.itemList.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const stop = watch(
|
||||||
|
() => props.visible,
|
||||||
|
(value) => {
|
||||||
|
if (value) {
|
||||||
|
fnGetData();
|
||||||
|
stop && stop();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const fnClose = () => {
|
||||||
|
visible.value = false;
|
||||||
|
};
|
||||||
|
const fnSubmit = debounce(
|
||||||
|
1000,
|
||||||
|
() => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
const listData = differenceWith(selectionData, props.listData);
|
||||||
|
fnClose();
|
||||||
|
emits("submit", listData);
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
|
|
@ -0,0 +1,385 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-form
|
||||||
|
:model="searchForm"
|
||||||
|
label-width="90px"
|
||||||
|
@submit.prevent="fnResetPaginationTransfer"
|
||||||
|
>
|
||||||
|
<el-row
|
||||||
|
>{{ name }}
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单名称" prop="KEYWORDS">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.KEYWORDS"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="人员" prop="USERNAME">
|
||||||
|
<el-input
|
||||||
|
v-model="searchForm.USERNAME"
|
||||||
|
placeholder="请输入关键字"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="部门" prop="DEPTIDS">
|
||||||
|
<layout-department
|
||||||
|
v-model="searchForm.DEPTIDS"
|
||||||
|
multiple
|
||||||
|
show-checkbox
|
||||||
|
collapse-tags
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单类型" prop="TYPE">
|
||||||
|
<el-select v-model="searchForm.TYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in inventoryTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="排查类型" prop="RISKCHECKLISTTYPE">
|
||||||
|
<el-select v-model="searchForm.RISKCHECKLISTTYPE">
|
||||||
|
<el-option
|
||||||
|
v-for="item in troubleshootingTypeList"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
||||||
|
<el-select v-model="searchForm.LISTINGLEVEL">
|
||||||
|
<el-option
|
||||||
|
v-for="item in [
|
||||||
|
{ BIANMA: '1', NAME: '公司' },
|
||||||
|
...inventoryLevelList,
|
||||||
|
]"
|
||||||
|
:key="item.BIANMA"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.BIANMA"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||||
|
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<layout-table
|
||||||
|
ref="tableRef"
|
||||||
|
:data="list"
|
||||||
|
v-model:pagination="pagination"
|
||||||
|
@get-data="fnGetDataTransfer"
|
||||||
|
:row-key="CUSTOM_ID"
|
||||||
|
>
|
||||||
|
<el-table-column reserve-selection type="selection" width="55" />
|
||||||
|
<el-table-column label="序号" width="70">
|
||||||
|
<template v-slot="{ $index }">
|
||||||
|
{{ serialNumber(pagination, $index) }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column prop="NAME" label="清单名称" />
|
||||||
|
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
||||||
|
<el-table-column prop="POST_NAME" label="岗位" />
|
||||||
|
<el-table-column
|
||||||
|
prop="USER_NAME"
|
||||||
|
label="人员"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="PERIODNAME"
|
||||||
|
label="排查周期"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="SCREENTYPENAME"
|
||||||
|
label="排查类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
prop="TYPENAME"
|
||||||
|
label="清单类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column
|
||||||
|
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
||||||
|
prop="TASK_TYPE_NAME"
|
||||||
|
label="任务类型"
|
||||||
|
width="100"
|
||||||
|
show-overflow-tooltip
|
||||||
|
/>
|
||||||
|
<el-table-column label="状态" width="100">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.ISDELETE === '0'">启用</span>
|
||||||
|
<span v-else-if="row.ISDELETE === '1'">禁用</span>
|
||||||
|
<span v-else-if="row.ISDELETE === '-99'">未开始</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="470">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.edit"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/print',
|
||||||
|
query: { CUSTOM_ID: row.CUSTOM_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
打印
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.edit"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnListQRCode(row)"
|
||||||
|
>
|
||||||
|
清单二维码
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
(row.cdcount === 0 &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit) &&
|
||||||
|
row.TYPE !== 'listType0006') ||
|
||||||
|
row.ISDELETE === '-99'
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/edit',
|
||||||
|
query: { CUSTOM_ID: row.CUSTOM_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
row.ISDELETE === '0' &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnDisable(row.CUSTOM_ID)"
|
||||||
|
>
|
||||||
|
禁用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="
|
||||||
|
row.ISDELETE === '1' &&
|
||||||
|
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
||||||
|
"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnEnable(row.CUSTOM_ID)"
|
||||||
|
>
|
||||||
|
启用
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="row.TASK_TYPE && row.TASK_TYPE !== ''"
|
||||||
|
type="primary"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path: '/hazard_investigation/inventory_management/insurance_coverage',
|
||||||
|
query: { CUSTOM_ID: row.CUSTOM_ID },
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
设置包保责任类型
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<template #button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.add"
|
||||||
|
type="primary"
|
||||||
|
@click="
|
||||||
|
router.push({
|
||||||
|
path:
|
||||||
|
name === 'risk'
|
||||||
|
? '/hazard_investigation/inventory_management/add'
|
||||||
|
: '/hazard_investigation/inventory_management/check_standard_add',
|
||||||
|
})
|
||||||
|
"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
v-if="buttonJurisdiction.del"
|
||||||
|
type="danger"
|
||||||
|
@click="fnBatchDelete"
|
||||||
|
>
|
||||||
|
批量删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</layout-table>
|
||||||
|
<list-qr-code
|
||||||
|
:info="data.listQrCodeDialog.info"
|
||||||
|
v-model:visible="data.listQrCodeDialog.visible"
|
||||||
|
/>
|
||||||
|
<inspection-route
|
||||||
|
v-model:visible="data.inspectionRouteDialog.visible"
|
||||||
|
v-model:list="data.inspectionRouteDialog.list"
|
||||||
|
:info="data.inspectionRouteDialog.info"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { serialNumber } from "@/assets/js/utils.js";
|
||||||
|
import { reactive } from "vue";
|
||||||
|
import useListData from "@/assets/js/useListData.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
||||||
|
import {
|
||||||
|
layoutFnGetInventoryLevel,
|
||||||
|
layoutFnGetInventoryType,
|
||||||
|
layoutFnGetTroubleshootingType,
|
||||||
|
} from "@/assets/js/data_dictionary.js";
|
||||||
|
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
||||||
|
import { useUserStore } from "@/pinia/user.js";
|
||||||
|
import {
|
||||||
|
getInventoryManagementList,
|
||||||
|
setCustomBatchBatchDelete,
|
||||||
|
setCustomBatchDeleteTemporary,
|
||||||
|
setCustomDisable,
|
||||||
|
setCustomEnable,
|
||||||
|
} from "@/request/hazard_investigation.js";
|
||||||
|
import ListQrCode from "./list_qr_code.vue";
|
||||||
|
import InspectionRoute from "./inspection_route.vue";
|
||||||
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
name: {
|
||||||
|
type: String,
|
||||||
|
required: true,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const router = useRouter();
|
||||||
|
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
||||||
|
useListData(getInventoryManagementList);
|
||||||
|
// getCustomList
|
||||||
|
const userStore = useUserStore();
|
||||||
|
const USER_ID = userStore.getUserInfo.USER_ID;
|
||||||
|
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
||||||
|
const buttonJurisdiction = await useButtonJurisdiction("listmanager");
|
||||||
|
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||||
|
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
||||||
|
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
||||||
|
const data = reactive({
|
||||||
|
listQrCodeDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
|
inspectionRouteDialog: {
|
||||||
|
visible: false,
|
||||||
|
list: [],
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const fnGetDataTransfer = () => {
|
||||||
|
fnGetData({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnResetPaginationTransfer = () => {
|
||||||
|
fnResetPagination({
|
||||||
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const fnListQRCode = (row) => {
|
||||||
|
data.listQrCodeDialog.visible = true;
|
||||||
|
data.listQrCodeDialog.info = row;
|
||||||
|
};
|
||||||
|
const fnDisable = debounce(
|
||||||
|
1000,
|
||||||
|
async (ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要禁用吗?", { type: "warning" });
|
||||||
|
await setCustomDisable({ ID });
|
||||||
|
ElMessage.success("禁用成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnEnable = debounce(
|
||||||
|
1000,
|
||||||
|
async (ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要启用吗?", { type: "warning" });
|
||||||
|
await setCustomEnable({ ID });
|
||||||
|
ElMessage.success("启用成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
const fnBatchDelete = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
const selectionData = tableRef.value.getSelectionRows();
|
||||||
|
if (selectionData.length === 0) {
|
||||||
|
ElMessage.warning("请选中要删除的项");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const DATA_IDS1 = [];
|
||||||
|
const DATA_IDS2 = [];
|
||||||
|
selectionData.forEach((item) => {
|
||||||
|
if (item.TYPE === "listType0006") {
|
||||||
|
DATA_IDS1.push(item.CUSTOM_ID);
|
||||||
|
DATA_IDS2.push(item.CUSTOM_ID);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (DATA_IDS1.length > 0) {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
"临时清单会彻底被删除不可恢复,确定要删除吗?",
|
||||||
|
{ type: "warning" }
|
||||||
|
);
|
||||||
|
await setCustomBatchDeleteTemporary({
|
||||||
|
DATA_IDS: DATA_IDS1.join(","),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
await ElMessageBox.confirm("确定要删除选中的数据吗?", {
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await setCustomBatchBatchDelete({ DATA_IDS: DATA_IDS2.join(",") });
|
||||||
|
ElMessage.success("删除成功");
|
||||||
|
fnResetPaginationTransfer();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped></style>
|
||||||
|
|
@ -1,423 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<layout-card>
|
||||||
<el-card>
|
<el-tabs v-model="name" @tab-change="fnTabChange">
|
||||||
<el-form
|
<el-tab-pane label="风险管控清单" name="risk" lazy>
|
||||||
:model="searchForm"
|
<list name="risk" />
|
||||||
label-width="90px"
|
</el-tab-pane>
|
||||||
@submit.prevent="fnResetPaginationTransfer"
|
<el-tab-pane label="隐患排查清单" name="checkStandard" lazy>
|
||||||
>
|
<list name="checkStandard" />
|
||||||
<el-row>
|
</el-tab-pane>
|
||||||
<el-col :span="6">
|
</el-tabs>
|
||||||
<el-form-item label="清单名称" prop="KEYWORDS">
|
</layout-card>
|
||||||
<el-input
|
|
||||||
v-model="searchForm.KEYWORDS"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="人员" prop="USERNAME">
|
|
||||||
<el-input
|
|
||||||
v-model="searchForm.USERNAME"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="部门" prop="DEPTIDS">
|
|
||||||
<layout-department
|
|
||||||
v-model="searchForm.DEPTIDS"
|
|
||||||
multiple
|
|
||||||
show-checkbox
|
|
||||||
collapse-tags
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="清单类型" prop="TYPE">
|
|
||||||
<el-select v-model="searchForm.TYPE">
|
|
||||||
<el-option
|
|
||||||
v-for="item in inventoryTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="排查类型" prop="RISKCHECKLISTTYPE">
|
|
||||||
<el-select v-model="searchForm.RISKCHECKLISTTYPE">
|
|
||||||
<el-option
|
|
||||||
v-for="item in troubleshootingTypeList"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
|
||||||
<el-select v-model="searchForm.LISTINGLEVEL">
|
|
||||||
<el-option
|
|
||||||
v-for="item in [
|
|
||||||
{ BIANMA: '1', NAME: '公司' },
|
|
||||||
...inventoryLevelList,
|
|
||||||
]"
|
|
||||||
:key="item.BIANMA"
|
|
||||||
:label="item.NAME"
|
|
||||||
:value="item.BIANMA"
|
|
||||||
/>
|
|
||||||
</el-select>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
<el-col :span="6">
|
|
||||||
<el-form-item label-width="10px">
|
|
||||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
|
||||||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
|
||||||
重置
|
|
||||||
</el-button>
|
|
||||||
</el-form-item>
|
|
||||||
</el-col>
|
|
||||||
</el-row>
|
|
||||||
</el-form>
|
|
||||||
</el-card>
|
|
||||||
<layout-card>
|
|
||||||
<layout-table
|
|
||||||
ref="tableRef"
|
|
||||||
:data="list"
|
|
||||||
v-model:pagination="pagination"
|
|
||||||
@get-data="fnGetDataTransfer"
|
|
||||||
row-key="LISTMANAGER_ID"
|
|
||||||
>
|
|
||||||
<el-table-column reserve-selection type="selection" width="55" />
|
|
||||||
<el-table-column label="序号" width="70">
|
|
||||||
<template v-slot="{ $index }">
|
|
||||||
{{ serialNumber(pagination, $index) }}
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column prop="NAME" label="清单名称" />
|
|
||||||
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
|
||||||
<el-table-column prop="POST_NAME" label="岗位" />
|
|
||||||
<el-table-column
|
|
||||||
prop="USER_NAME"
|
|
||||||
label="人员"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="PERIODNAME"
|
|
||||||
label="排查周期"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="SCREENTYPENAME"
|
|
||||||
label="排查类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
prop="TYPENAME"
|
|
||||||
label="清单类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
v-if="SPECIAL_ENTERPRISES.includes(CORPINFO_ID)"
|
|
||||||
prop="TASK_TYPE_NAME"
|
|
||||||
label="任务类型"
|
|
||||||
width="100"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column label="状态" width="100">
|
|
||||||
<template v-slot="{ row }">
|
|
||||||
<span v-if="row.ISDELETE === '0'">启用</span>
|
|
||||||
<span v-else-if="row.ISDELETE === '1'">禁用</span>
|
|
||||||
<span v-else-if="row.ISDELETE === '-99'">未开始</span>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column label="操作" width="470">
|
|
||||||
<template v-slot="{ row }">
|
|
||||||
<el-button
|
|
||||||
v-if="buttonJurisdiction.edit"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/inventory_management/print',
|
|
||||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
打印
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="buttonJurisdiction.edit"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnListQRCode(row)"
|
|
||||||
>
|
|
||||||
清单二维码
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="
|
|
||||||
(row.cdcount === 0 &&
|
|
||||||
(row.USER_ID === USER_ID || buttonJurisdiction.edit) &&
|
|
||||||
row.TYPE !== 'listType0006') ||
|
|
||||||
row.ISDELETE === '-99'
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/inventory_management/edit',
|
|
||||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
修改
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="
|
|
||||||
row.ISDELETE === '0' &&
|
|
||||||
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnDisable(row.LISTMANAGER_ID)"
|
|
||||||
>
|
|
||||||
禁用
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="
|
|
||||||
row.ISDELETE === '1' &&
|
|
||||||
(row.USER_ID === USER_ID || buttonJurisdiction.edit)
|
|
||||||
"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="fnEnable(row.LISTMANAGER_ID)"
|
|
||||||
>
|
|
||||||
启用
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/inventory_management/part_qr_code',
|
|
||||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
部位二维码
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" text link @click="fnInspectionRoute(row)">
|
|
||||||
巡检路线
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="row.TASK_TYPE && row.TASK_TYPE !== ''"
|
|
||||||
type="primary"
|
|
||||||
text
|
|
||||||
link
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/inventory_management/insurance_coverage',
|
|
||||||
query: { LISTMANAGER_ID: row.LISTMANAGER_ID },
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
设置包保责任类型
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</el-table-column>
|
|
||||||
<template #button>
|
|
||||||
<el-button
|
|
||||||
v-if="buttonJurisdiction.add"
|
|
||||||
type="primary"
|
|
||||||
@click="
|
|
||||||
router.push({
|
|
||||||
path: '/hazard_investigation/inventory_management/add',
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
|
||||||
新增
|
|
||||||
</el-button>
|
|
||||||
<el-button
|
|
||||||
v-if="buttonJurisdiction.del"
|
|
||||||
type="danger"
|
|
||||||
@click="fnBatchDelete"
|
|
||||||
>
|
|
||||||
批量删除
|
|
||||||
</el-button>
|
|
||||||
<el-button type="primary" @click="fnInheritanceList">
|
|
||||||
继承清单
|
|
||||||
</el-button>
|
|
||||||
</template>
|
|
||||||
</layout-table>
|
|
||||||
</layout-card>
|
|
||||||
<list-qr-code
|
|
||||||
:info="data.listQrCodeDialog.info"
|
|
||||||
v-model:visible="data.listQrCodeDialog.visible"
|
|
||||||
/>
|
|
||||||
<inspection-route
|
|
||||||
v-model:visible="data.inspectionRouteDialog.visible"
|
|
||||||
v-model:list="data.inspectionRouteDialog.list"
|
|
||||||
:info="data.inspectionRouteDialog.info"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { serialNumber } from "@/assets/js/utils.js";
|
import { ref } from "vue";
|
||||||
import { reactive } from "vue";
|
import List from "./components/list.vue";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import { useRouter, useRoute, onBeforeRouteUpdate } from "vue-router";
|
||||||
import LayoutDepartment from "@/components/department/index.vue";
|
|
||||||
import { debounce } from "throttle-debounce";
|
|
||||||
import { ElMessage, ElMessageBox } from "element-plus";
|
|
||||||
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
|
|
||||||
import {
|
|
||||||
layoutFnGetInventoryLevel,
|
|
||||||
layoutFnGetInventoryType,
|
|
||||||
layoutFnGetTroubleshootingType,
|
|
||||||
} from "@/assets/js/data_dictionary.js";
|
|
||||||
import { SPECIAL_ENTERPRISES } from "@/assets/js/constant.js";
|
|
||||||
import { useUserStore } from "@/pinia/user.js";
|
|
||||||
import {
|
|
||||||
getInventoryManagementList,
|
|
||||||
getInventoryManagementRouteView,
|
|
||||||
setInventoryManagementBatchDelete,
|
|
||||||
setInventoryManagementBatchDeleteTemporary,
|
|
||||||
setInventoryManagementDisable,
|
|
||||||
setInventoryManagementEnable,
|
|
||||||
} from "@/request/hazard_investigation.js";
|
|
||||||
import ListQrCode from "./components/list_qr_code.vue";
|
|
||||||
import InspectionRoute from "./components/inspection_route.vue";
|
|
||||||
import { useRouter } from "vue-router";
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
|
const route = useRoute();
|
||||||
useListData(getInventoryManagementList);
|
const defaultName = "risk";
|
||||||
const userStore = useUserStore();
|
const name = ref(route.query.name || defaultName);
|
||||||
const USER_ID = userStore.getUserInfo.USER_ID;
|
onBeforeRouteUpdate((to, from, next) => {
|
||||||
const CORPINFO_ID = userStore.getUserInfo.CORPINFO_ID;
|
name.value = to.query.name || defaultName;
|
||||||
const buttonJurisdiction = await useButtonJurisdiction("listmanager");
|
next();
|
||||||
const inventoryTypeList = await layoutFnGetInventoryType();
|
|
||||||
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
|
||||||
const inventoryLevelList = await layoutFnGetInventoryLevel();
|
|
||||||
const data = reactive({
|
|
||||||
listQrCodeDialog: {
|
|
||||||
visible: false,
|
|
||||||
info: {},
|
|
||||||
},
|
|
||||||
inspectionRouteDialog: {
|
|
||||||
visible: false,
|
|
||||||
list: [],
|
|
||||||
info: {},
|
|
||||||
},
|
|
||||||
});
|
});
|
||||||
const fnGetDataTransfer = () => {
|
const fnTabChange = (name) => {
|
||||||
fnGetData({
|
router.replace({
|
||||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
path: "/hazard_investigation/inventory_management",
|
||||||
});
|
|
||||||
};
|
|
||||||
const fnResetPaginationTransfer = () => {
|
|
||||||
fnResetPagination({
|
|
||||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const fnListQRCode = (row) => {
|
|
||||||
data.listQrCodeDialog.visible = true;
|
|
||||||
data.listQrCodeDialog.info = row;
|
|
||||||
};
|
|
||||||
const fnInspectionRoute = async (row) => {
|
|
||||||
const resData = await getInventoryManagementRouteView({
|
|
||||||
LISTMANAGER_ID: row.LISTMANAGER_ID,
|
|
||||||
});
|
|
||||||
data.inspectionRouteDialog.list = resData.varList;
|
|
||||||
data.inspectionRouteDialog.info = row;
|
|
||||||
data.inspectionRouteDialog.visible = true;
|
|
||||||
};
|
|
||||||
const fnDisable = debounce(
|
|
||||||
1000,
|
|
||||||
async (LISTMANAGER_ID) => {
|
|
||||||
await ElMessageBox.confirm("确定要禁用吗?", { type: "warning" });
|
|
||||||
await setInventoryManagementDisable({ LISTMANAGER_ID });
|
|
||||||
ElMessage.success("禁用成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
const fnEnable = debounce(
|
|
||||||
1000,
|
|
||||||
async (LISTMANAGER_ID) => {
|
|
||||||
await ElMessageBox.confirm("确定要启用吗?", { type: "warning" });
|
|
||||||
await setInventoryManagementEnable({ LISTMANAGER_ID });
|
|
||||||
ElMessage.success("启用成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
const fnBatchDelete = debounce(
|
|
||||||
1000,
|
|
||||||
async () => {
|
|
||||||
const selectionData = tableRef.value.getSelectionRows();
|
|
||||||
if (selectionData.length === 0) {
|
|
||||||
ElMessage.warning("请选中要删除的项");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const DATA_IDS1 = [];
|
|
||||||
const DATA_IDS2 = [];
|
|
||||||
selectionData.forEach((item) => {
|
|
||||||
if (item.TYPE === "listType0006") {
|
|
||||||
DATA_IDS1.push(item.LISTMANAGER_ID);
|
|
||||||
} else {
|
|
||||||
DATA_IDS2.push(item.LISTMANAGER_ID);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (DATA_IDS1.length > 0) {
|
|
||||||
await ElMessageBox.confirm(
|
|
||||||
"临时清单会彻底被删除不可恢复,确定要删除吗?",
|
|
||||||
{ type: "warning" }
|
|
||||||
);
|
|
||||||
await setInventoryManagementBatchDeleteTemporary({
|
|
||||||
DATA_IDS: DATA_IDS1.join(","),
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
await ElMessageBox.confirm("确定要删除选中的数据吗?", {
|
|
||||||
type: "warning",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
await setInventoryManagementBatchDelete({ DATA_IDS: DATA_IDS2.join(",") });
|
|
||||||
ElMessage.success("删除成功");
|
|
||||||
fnResetPaginationTransfer();
|
|
||||||
},
|
|
||||||
{ atBegin: true }
|
|
||||||
);
|
|
||||||
const fnInheritanceList = () => {
|
|
||||||
const selectionData = tableRef.value.getSelectionRows();
|
|
||||||
if (selectionData.length === 0) {
|
|
||||||
ElMessage.warning("请选中要继承的清单");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (selectionData.length > 1) {
|
|
||||||
ElMessage.warning("只能选择一个清单");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
router.push({
|
|
||||||
path: "/hazard_investigation/inventory_management/inheritance_list",
|
|
||||||
query: {
|
query: {
|
||||||
LISTMANAGER_ID: selectionData[0].LISTMANAGER_ID,
|
name,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped lang="scss"></style>
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,14 @@
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="6">
|
||||||
|
<el-form-item label="清单种类" prop="KEYWORDS">
|
||||||
|
<el-select v-model="searchForm.LIST_TYPE">
|
||||||
|
<el-option label="风险管控清单" value="1" />
|
||||||
|
<el-option label="隐患排查清单" value="2" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-form-item label="人员" prop="USERNAME">
|
<el-form-item label="人员" prop="USERNAME">
|
||||||
<el-input
|
<el-input
|
||||||
|
|
@ -91,6 +99,12 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="NAME" label="清单名称" />
|
<el-table-column prop="NAME" label="清单名称" />
|
||||||
|
<el-table-column prop="list_type" label="清单种类">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.list_type === '1'">风险管控清单</span>
|
||||||
|
<span v-if="row.list_type === '2'">隐患排查清单</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
<el-table-column prop="DEPARTMENT_NAME_ALL" label="部门" />
|
||||||
<el-table-column prop="POST_NAME" label="岗位" />
|
<el-table-column prop="POST_NAME" label="岗位" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
|
@ -124,7 +138,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="fnInspect(row.LISTMANAGER_ID)"
|
@click="fnInspect(row.LISTMANAGER_ID, row.list_type)"
|
||||||
>
|
>
|
||||||
开始检查
|
开始检查
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
@ -143,14 +157,14 @@ import {
|
||||||
layoutFnGetInventoryLevel,
|
layoutFnGetInventoryLevel,
|
||||||
layoutFnGetTroubleshootingCycle,
|
layoutFnGetTroubleshootingCycle,
|
||||||
} from "@/assets/js/data_dictionary.js";
|
} from "@/assets/js/data_dictionary.js";
|
||||||
import { getInventoryTroubleshootingList } from "@/request/hazard_investigation.js";
|
import { getRiskStandardList } from "@/request/hazard_investigation.js";
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
import { ElMessageBox } from "element-plus";
|
import { ElMessageBox } from "element-plus";
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
let ISREST = "";
|
let ISREST = "";
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getInventoryTroubleshootingList, {
|
useListData(getRiskStandardList, {
|
||||||
callbackFn: (list, resData) => {
|
callbackFn: (list, resData) => {
|
||||||
ISREST = resData.ISREST;
|
ISREST = resData.ISREST;
|
||||||
},
|
},
|
||||||
|
|
@ -167,14 +181,17 @@ const fnResetPaginationTransfer = () => {
|
||||||
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
DEPTIDS: searchForm.value.DEPTIDS?.join(","),
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
const fnInspect = (LISTMANAGER_ID) => {
|
const fnInspect = (ID, LIST_TYPE) => {
|
||||||
if (ISREST === "1") {
|
if (ISREST === "1") {
|
||||||
ElMessageBox.alert("您处于离岗状态,无需检查清单");
|
ElMessageBox.alert("您处于离岗状态,无需检查清单");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
router.push({
|
router.push({
|
||||||
path: "/hazard_investigation/inventory_troubleshooting/inspect",
|
path:
|
||||||
query: { LISTMANAGER_ID },
|
LIST_TYPE === "1"
|
||||||
|
? "/hazard_investigation/inventory_troubleshooting/inspect"
|
||||||
|
: "/hazard_investigation/inventory_troubleshooting/standard_inspect",
|
||||||
|
query: { ID },
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,531 @@
|
||||||
|
<template>
|
||||||
|
<layout-card>
|
||||||
|
<el-divider content-position="left">清单信息</el-divider>
|
||||||
|
<el-descriptions :column="2" border>
|
||||||
|
<el-descriptions-item label="清单名称">
|
||||||
|
{{ info.NAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="排查清单类型">
|
||||||
|
{{ info.SCREENTYPENAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item
|
||||||
|
:label="info.BAO_BAO_TYPE === '1' ? '包保责任人部门' : '所属部门'"
|
||||||
|
>
|
||||||
|
{{ info.DEPARTMENT_NAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item
|
||||||
|
:label="info.BAO_BAO_TYPE === '1' ? '包保责任人岗位' : '所属岗位'"
|
||||||
|
>
|
||||||
|
{{ info.POST_NAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="排查周期">
|
||||||
|
{{ info.PERIODNAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="清单类型">
|
||||||
|
{{ info.TYPENAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item
|
||||||
|
label="排查日期"
|
||||||
|
v-if="info.TYPE === 'listType0006'"
|
||||||
|
>
|
||||||
|
{{ info.START_DATE }} - {{ info.END_DATE }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
<el-descriptions-item label="包保责任人" v-if="info.BAO_BAO_TYPE === '1'">
|
||||||
|
{{ info.USER_NAME }}
|
||||||
|
</el-descriptions-item>
|
||||||
|
</el-descriptions>
|
||||||
|
<el-divider content-position="left">检查内容</el-divider>
|
||||||
|
<layout-table :data="inspectionList" :show-pagination="false">
|
||||||
|
<el-table-column label="序号" width="70" type="index" />
|
||||||
|
<el-table-column prop="CHECK_CATEGORY_NAME" label="检查类别" />
|
||||||
|
<el-table-column prop="CHECK_ITEM_NAME" label="检查项目" />
|
||||||
|
<el-table-column prop="CHECK_CONTENT" label="检查内容" />
|
||||||
|
<el-table-column prop="CHECK_STANDARD" label="检查标准" />
|
||||||
|
<el-table-column prop="CHECK_QUALIFIED" label="检查合格项" />
|
||||||
|
<el-table-column prop="CHECK_UNQUALIFIED" label="检查不合格项" />
|
||||||
|
<el-table-column label="操作类型">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-if="row.OPERATION_TYPE === 1">选择</span>
|
||||||
|
<span v-if="row.OPERATION_TYPE === 2">填写</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="操作" width="280">
|
||||||
|
<template v-slot="{ row, $index }">
|
||||||
|
<el-radio-group
|
||||||
|
v-if="data.canDoCheck"
|
||||||
|
:disabled="row.HASHIDDEN > 0"
|
||||||
|
v-model="row.ISNORMAL"
|
||||||
|
>
|
||||||
|
<el-radio
|
||||||
|
:label="0"
|
||||||
|
:disabled="!data.canDoCheck"
|
||||||
|
@click.prevent="fnQualified($index, row)"
|
||||||
|
>
|
||||||
|
合格
|
||||||
|
<el-tooltip
|
||||||
|
content="注意:补录时,不允许添加隐患"
|
||||||
|
placement="top"
|
||||||
|
v-if="entrance === 'supplementaryRecording'"
|
||||||
|
>
|
||||||
|
<el-icon><warning-filled /></el-icon>
|
||||||
|
</el-tooltip>
|
||||||
|
</el-radio>
|
||||||
|
<el-radio
|
||||||
|
:label="1"
|
||||||
|
:disabled="entrance === 'supplementaryRecording'"
|
||||||
|
@click.prevent="fnUnqualified($index, row)"
|
||||||
|
>
|
||||||
|
不合格
|
||||||
|
</el-radio>
|
||||||
|
<el-radio
|
||||||
|
:label="2"
|
||||||
|
:disabled="entrance === 'supplementaryRecording'"
|
||||||
|
@click.prevent="fnNotInvolved($index, row)"
|
||||||
|
>
|
||||||
|
不涉及
|
||||||
|
</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</layout-table>
|
||||||
|
<el-divider content-position="left">其他隐患</el-divider>
|
||||||
|
<div class="tr mb-10">
|
||||||
|
<el-button
|
||||||
|
v-if="data.canDoCheck"
|
||||||
|
type="primary"
|
||||||
|
@click="fnAddOrEditOtherHidden({}, 'add')"
|
||||||
|
:disabled="entrance === 'supplementaryRecording'"
|
||||||
|
>
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button disabled v-else type="primary">添加</el-button>
|
||||||
|
</div>
|
||||||
|
<layout-table :data="otherHiddenList" :show-pagination="false">
|
||||||
|
<el-table-column label="序号" width="70" type="index" />
|
||||||
|
<el-table-column prop="HIDDENDESCR" label="隐患描述" />
|
||||||
|
<el-table-column label="操作" width="280">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="data.canDoCheck"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnAddOrEditOtherHidden(row, 'edit')"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
:disabled="data.canDoCheck"
|
||||||
|
text
|
||||||
|
link
|
||||||
|
@click="fnDeleteOtherHidden(row.HIDDEN_ID)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</layout-table>
|
||||||
|
<el-form
|
||||||
|
ref="formRef"
|
||||||
|
:model="data.form"
|
||||||
|
:rules="rules"
|
||||||
|
label-width="100px"
|
||||||
|
>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="检查时间" prop="CHECK_TIME">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="data.form.CHECK_TIME"
|
||||||
|
format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
value-format="YYYY-MM-DD HH:mm:ss"
|
||||||
|
type="datetime"
|
||||||
|
placeholder="这里输入检查时间"
|
||||||
|
:disabled-date="fnDisabledDate"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<template
|
||||||
|
v-for="(item, index) in data.form.inspectedList"
|
||||||
|
:key="item.id"
|
||||||
|
>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item
|
||||||
|
label="检查部门"
|
||||||
|
:prop="'inspectedList.' + index + '.DEPARTMENT_ID'"
|
||||||
|
:rules="{
|
||||||
|
required: true,
|
||||||
|
message: '请选择检查部门',
|
||||||
|
trigger: 'change',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<layout-department
|
||||||
|
v-model="item.DEPARTMENT_ID"
|
||||||
|
@update:model-value="fnInspectDepartmentChange($event, index)"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="11">
|
||||||
|
<el-form-item
|
||||||
|
label="检查人"
|
||||||
|
:prop="'inspectedList.' + index + '.USER_ID'"
|
||||||
|
:rules="{
|
||||||
|
required: true,
|
||||||
|
message: '请选择检查人',
|
||||||
|
trigger: 'change',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
<el-select
|
||||||
|
:model-value="item.USER_ID"
|
||||||
|
@change="
|
||||||
|
verifyDuplicateSelection(
|
||||||
|
data.form.inspectedList,
|
||||||
|
index,
|
||||||
|
'USER_ID',
|
||||||
|
$event
|
||||||
|
)
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
v-for="item in item.userList"
|
||||||
|
:key="item.USER_ID"
|
||||||
|
:label="item.NAME"
|
||||||
|
:value="item.USER_ID"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-form-item label-width="10px">
|
||||||
|
<el-button
|
||||||
|
:disabled="!data.canDoCheck"
|
||||||
|
type="primary"
|
||||||
|
v-if="index === 0"
|
||||||
|
@click="fnAddInspectedList"
|
||||||
|
>
|
||||||
|
添加
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
:disabled="!data.canDoCheck"
|
||||||
|
type="danger"
|
||||||
|
v-if="index !== 0"
|
||||||
|
@click="data.form.inspectedList.splice(index, 1)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</template>
|
||||||
|
<el-col :span="24" v-if="entrance === 'supplementaryRecording'">
|
||||||
|
<el-form-item label="补录原因" prop="REASON">
|
||||||
|
<el-input v-model="data.form.REASON" type="textarea" autosize />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="备注" prop="DESCR">
|
||||||
|
<el-input
|
||||||
|
v-model="data.form.DESCR"
|
||||||
|
type="textarea"
|
||||||
|
:autosize="{
|
||||||
|
minRows: 3,
|
||||||
|
}"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
<div class="tc mt-10">
|
||||||
|
<el-button :disabled="!data.canDoCheck" type="primary" @click="fnSubmit"
|
||||||
|
>保存</el-button
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<qualified
|
||||||
|
v-model:visible="data.qualifiedDialog.visible"
|
||||||
|
v-model:form="data.qualifiedDialog.form"
|
||||||
|
:id="data.qualifiedDialog.RECORDITEM_ID"
|
||||||
|
/>
|
||||||
|
<!-- <un-qualified-->
|
||||||
|
<!-- v-model:visible="data.unQualifiedDialog.visible"-->
|
||||||
|
<!-- v-model:form="data.unQualifiedDialog.form"-->
|
||||||
|
<!-- :type="data.unQualifiedDialog.type"-->
|
||||||
|
<!-- :hidden-type="data.unQualifiedDialog.hiddenType"-->
|
||||||
|
<!-- :custom-id="CUSTOM_ID"-->
|
||||||
|
<!-- :info="{ ...data.unQualifiedDialog.info, ...info.value }"-->
|
||||||
|
<!-- :longitude="data.longitude"-->
|
||||||
|
<!-- :latitude="data.latitude"-->
|
||||||
|
<!-- @submit="fnHiddenSubmit"-->
|
||||||
|
<!-- />-->
|
||||||
|
</layout-card>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { nextTick, onMounted, reactive, ref } from "vue";
|
||||||
|
import {
|
||||||
|
getCheckStandardOtherHiddenList,
|
||||||
|
getHiddenDangerView,
|
||||||
|
setHiddenDangerDelete,
|
||||||
|
getCheckStandardManagementView,
|
||||||
|
setCheckStandardSupplementaryRecordingSubmit,
|
||||||
|
setCheckStandardSubmit,
|
||||||
|
} from "@/request/hazard_investigation.js";
|
||||||
|
import { useRoute, useRouter } from "vue-router";
|
||||||
|
import useListData from "@/assets/js/useListData.js";
|
||||||
|
import LayoutDepartment from "@/components/department/index.vue";
|
||||||
|
import {
|
||||||
|
addingPrefixToFile,
|
||||||
|
getFileSuffix,
|
||||||
|
verifyDuplicateSelection,
|
||||||
|
} from "@/assets/js/utils.js";
|
||||||
|
import { getUserListAll } from "@/request/data_dictionary.js";
|
||||||
|
import { getViewImg } from "@/request/api.js";
|
||||||
|
import { debounce } from "throttle-debounce";
|
||||||
|
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||||
|
import { ElMessage, ElMessageBox } from "element-plus";
|
||||||
|
import Qualified from "./components/qualified.vue";
|
||||||
|
import { cloneDeep } from "lodash-es";
|
||||||
|
import { WarningFilled } from "@element-plus/icons-vue";
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
|
const { ID, CHECKRECORD_ID, DATEEND, DATESTART } = route.query;
|
||||||
|
const props = defineProps({
|
||||||
|
entrance: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const rules = {
|
||||||
|
CHECK_TIME: [
|
||||||
|
{ required: true, message: "请选择检查时间", trigger: "change" },
|
||||||
|
],
|
||||||
|
REASON: [{ required: true, message: "请输入补录原因", trigger: "blur" }],
|
||||||
|
};
|
||||||
|
const formRef = ref(null);
|
||||||
|
const info = ref({});
|
||||||
|
const data = reactive({
|
||||||
|
longitude: 0,
|
||||||
|
latitude: 0,
|
||||||
|
// 是否可以清单排查
|
||||||
|
canDoCheck: true,
|
||||||
|
form: {
|
||||||
|
CHECK_TIME: "",
|
||||||
|
REASON: "",
|
||||||
|
inspectedList: [],
|
||||||
|
},
|
||||||
|
qualifiedDialog: {
|
||||||
|
visible: false,
|
||||||
|
RECORDITEM_ID: "",
|
||||||
|
form: { file: [] },
|
||||||
|
},
|
||||||
|
unQualifiedDialog: {
|
||||||
|
visible: false,
|
||||||
|
type: "",
|
||||||
|
index: "",
|
||||||
|
hiddenType: "",
|
||||||
|
info: {},
|
||||||
|
form: {
|
||||||
|
HIDDENPART: "",
|
||||||
|
HIDDENDESCR: "",
|
||||||
|
HIDDENLEVEL: "",
|
||||||
|
HIDDEN_CATEGORY: "",
|
||||||
|
HIDDENTYPE: [],
|
||||||
|
hiddenImgs: [],
|
||||||
|
videoFiles: [],
|
||||||
|
RECTIFICATIONTYPE: "2",
|
||||||
|
RECTIFYDESCR: "",
|
||||||
|
rectifyImgs: [],
|
||||||
|
RECTIFICATIONDEADLINE: "",
|
||||||
|
RECTIFICATIONDEPT: "",
|
||||||
|
RECTIFICATIONOR: "",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const { list: inspectionList } = useListData(getCheckStandardManagementView, {
|
||||||
|
otherParams: { ID },
|
||||||
|
usePagination: false,
|
||||||
|
callbackFn: (list, resData) => {
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
if (list[i].HASHIDDEN <= 0) list[i].ISNORMAL = 0;
|
||||||
|
if (list[i].ELECTRONIC_FENCE_ID) {
|
||||||
|
// 存在电子围栏禁止清单排查
|
||||||
|
data.canDoCheck = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
info.value = resData.pd;
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const { list: otherHiddenList, fnGetData: fnGetOtherHidden } = useListData(
|
||||||
|
getCheckStandardOtherHiddenList,
|
||||||
|
{
|
||||||
|
otherParams: { ID },
|
||||||
|
usePagination: false,
|
||||||
|
key: "hiddenList",
|
||||||
|
}
|
||||||
|
);
|
||||||
|
onMounted(() => {
|
||||||
|
const geolocation = new window.BMapGL.Geolocation();
|
||||||
|
geolocation.getCurrentPosition(async (r) => {
|
||||||
|
if (!r) {
|
||||||
|
await ElMessageBox.alert("获取位置信息失败,请刷新重试", {
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
data.longitude = r.longitude;
|
||||||
|
data.latitude = r.latitude;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
const fnDisabledDate = (time) => {
|
||||||
|
if (DATEEND && DATESTART)
|
||||||
|
return (
|
||||||
|
time.getTime() > new Date(DATEEND).getTime() ||
|
||||||
|
time.getTime() < new Date(DATESTART).getTime()
|
||||||
|
);
|
||||||
|
else return false;
|
||||||
|
};
|
||||||
|
const fnQualified = async (index, row) => {
|
||||||
|
if (row.HASHIDDEN > 0) return;
|
||||||
|
data.qualifiedDialog.visible = true;
|
||||||
|
await nextTick();
|
||||||
|
data.qualifiedDialog.RECORDITEM_ID = row.RECORDITEM_ID;
|
||||||
|
if (row.ISNORMAL === 1) fnRemoveUnqualified(index);
|
||||||
|
else if (row.ISNORMAL !== 1) {
|
||||||
|
const resData = await getViewImg({
|
||||||
|
FOREIGN_KEY: row.RECORDITEM_ID,
|
||||||
|
TYPE: "14",
|
||||||
|
});
|
||||||
|
data.qualifiedDialog.form.file = addingPrefixToFile(resData.imgs);
|
||||||
|
}
|
||||||
|
inspectionList.value[index].ISNORMAL = 0;
|
||||||
|
};
|
||||||
|
const fnNotInvolved = (index, row) => {
|
||||||
|
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
|
||||||
|
fnRemoveUnqualified(index);
|
||||||
|
inspectionList.value[index].ISNORMAL = 2;
|
||||||
|
};
|
||||||
|
const fnRemoveUnqualified = (index) => {
|
||||||
|
inspectionList.value[index].HIDDEN_ID = "";
|
||||||
|
};
|
||||||
|
const fnUnqualified = async (index, row) => {
|
||||||
|
if (row.HASHIDDEN > 0 || props.entrance === "supplementaryRecording") return;
|
||||||
|
data.unQualifiedDialog.visible = true;
|
||||||
|
await nextTick();
|
||||||
|
if (
|
||||||
|
inspectionList.value[index].ISNORMAL === 0 ||
|
||||||
|
inspectionList.value[index].ISNORMAL === 2
|
||||||
|
)
|
||||||
|
data.unQualifiedDialog.type = "add";
|
||||||
|
else if (inspectionList.value[index].ISNORMAL === 1) {
|
||||||
|
data.unQualifiedDialog.type = "edit";
|
||||||
|
await fnGetHiddenDangerView(inspectionList.value[index].HIDDEN_ID);
|
||||||
|
}
|
||||||
|
data.unQualifiedDialog.info = row;
|
||||||
|
data.unQualifiedDialog.index = index;
|
||||||
|
data.unQualifiedDialog.hiddenType = "unqualified";
|
||||||
|
};
|
||||||
|
const fnGetHiddenDangerView = async (HIDDEN_ID) => {
|
||||||
|
const resData = await getHiddenDangerView({
|
||||||
|
HIDDEN_ID,
|
||||||
|
});
|
||||||
|
data.unQualifiedDialog.form = resData.pd;
|
||||||
|
const HIDDENTYPE = [];
|
||||||
|
const videoFiles = [];
|
||||||
|
const hiddenImgs = [];
|
||||||
|
for (let i = 0; i < resData.hImgs.length; i++) {
|
||||||
|
if (getFileSuffix(resData.hImgs[i].FILEPATH) === "mp4")
|
||||||
|
videoFiles.push(...addingPrefixToFile([resData.hImgs[i]]));
|
||||||
|
else hiddenImgs.push(...addingPrefixToFile([resData.hImgs[i]]));
|
||||||
|
}
|
||||||
|
data.unQualifiedDialog.form.videoFiles = videoFiles;
|
||||||
|
data.unQualifiedDialog.form.hiddenImgs = hiddenImgs;
|
||||||
|
data.unQualifiedDialog.form.rectifyImgs = addingPrefixToFile(resData.rImgs);
|
||||||
|
if (resData.pd.HIDDENTYPE1) HIDDENTYPE.push(resData.pd.HIDDENTYPE1);
|
||||||
|
if (resData.pd.HIDDENTYPE2) HIDDENTYPE.push(resData.pd.HIDDENTYPE2);
|
||||||
|
if (resData.pd.HIDDENTYPE3) HIDDENTYPE.push(resData.pd.HIDDENTYPE3);
|
||||||
|
data.unQualifiedDialog.form.HIDDENTYPE = HIDDENTYPE;
|
||||||
|
};
|
||||||
|
// const fnHiddenSubmit = (currentHiddenId) => {
|
||||||
|
// const { hiddenType, index } = data.unQualifiedDialog;
|
||||||
|
// if (hiddenType === "unqualified") {
|
||||||
|
// inspectionList.value[index].ISNORMAL = 1;
|
||||||
|
// inspectionList.value[index].HIDDEN_ID = currentHiddenId;
|
||||||
|
// }
|
||||||
|
// if (hiddenType === "otherHidden") {
|
||||||
|
// fnGetOtherHidden();
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
const fnAddInspectedList = () => {
|
||||||
|
data.form.inspectedList.push({
|
||||||
|
id: Math.random(),
|
||||||
|
DEPARTMENT_ID: "",
|
||||||
|
USER_ID: "",
|
||||||
|
userList: [],
|
||||||
|
});
|
||||||
|
};
|
||||||
|
fnAddInspectedList();
|
||||||
|
const fnInspectDepartmentChange = async (event, index) => {
|
||||||
|
data.form.inspectedList[index].USER_ID = "";
|
||||||
|
const resData = await getUserListAll({
|
||||||
|
DEPARTMENT_ID: event,
|
||||||
|
NOMAIN: "1",
|
||||||
|
});
|
||||||
|
data.form.inspectedList[index].userList = resData.userList;
|
||||||
|
};
|
||||||
|
const fnDeleteOtherHidden = async (HIDDEN_ID) => {
|
||||||
|
await ElMessageBox.confirm("确定要删除吗?", {
|
||||||
|
type: "warning",
|
||||||
|
});
|
||||||
|
await setHiddenDangerDelete({ HIDDEN_ID });
|
||||||
|
fnGetOtherHidden();
|
||||||
|
};
|
||||||
|
const fnAddOrEditOtherHidden = async (row, type) => {
|
||||||
|
data.unQualifiedDialog.visible = true;
|
||||||
|
await nextTick();
|
||||||
|
data.unQualifiedDialog.type = type;
|
||||||
|
data.unQualifiedDialog.info = row;
|
||||||
|
data.unQualifiedDialog.hiddenType = "otherHidden";
|
||||||
|
if (type === "edit") await fnGetHiddenDangerView(row.HIDDEN_ID);
|
||||||
|
};
|
||||||
|
const fnSubmit = debounce(
|
||||||
|
1000,
|
||||||
|
async () => {
|
||||||
|
await useFormValidate(formRef);
|
||||||
|
const items = [];
|
||||||
|
const ids = [];
|
||||||
|
for (let i = 0; i < inspectionList.value.length; i++) {
|
||||||
|
const item = {};
|
||||||
|
item.CUSTOM_ITEM_ID = inspectionList.value[i].CUSTOM_ITEM_ID;
|
||||||
|
item.ISNORMAL = inspectionList.value[i].ISNORMAL;
|
||||||
|
item.RECORDITEM_ID = inspectionList.value[i].RECORDITEM_ID;
|
||||||
|
items.push(item);
|
||||||
|
if (inspectionList.value[i].ISNORMAL === 1)
|
||||||
|
ids.push(inspectionList.value[i].HIDDEN_ID);
|
||||||
|
}
|
||||||
|
const inspectedList = cloneDeep(data.form.inspectedList);
|
||||||
|
if (inspectedList.length > 0) inspectedList.splice(0, 1);
|
||||||
|
const params = {
|
||||||
|
ID,
|
||||||
|
LIST_NAME: info.value.NAME,
|
||||||
|
CHECK_TIME: data.form.CHECK_TIME,
|
||||||
|
DESCR: data.form.DESCR,
|
||||||
|
ITEMS: JSON.stringify(items),
|
||||||
|
IDS: ids.join(","),
|
||||||
|
CHECKDEPT: data.form.inspectedList[0].DEPARTMENT_ID,
|
||||||
|
CHECKOR: data.form.inspectedList[0].USER_ID,
|
||||||
|
OTHER: JSON.stringify(inspectedList),
|
||||||
|
LONGITUDE: data.longitude,
|
||||||
|
LATITUDE: data.latitude,
|
||||||
|
};
|
||||||
|
if (props.entrance === "supplementaryRecording") {
|
||||||
|
params.REASON = data.form.REASON;
|
||||||
|
params.CHECKRECORD_ID = CHECKRECORD_ID;
|
||||||
|
await setCheckStandardSupplementaryRecordingSubmit(params);
|
||||||
|
} else await setCheckStandardSubmit(params);
|
||||||
|
ElMessage.success("操作成功");
|
||||||
|
router.back();
|
||||||
|
},
|
||||||
|
{ atBegin: true }
|
||||||
|
);
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss"></style>
|
||||||
Loading…
Reference in New Issue