From f12ae4a5bcfa5f7f1600a698c9eba1fd62eddaba Mon Sep 17 00:00:00 2001 From: z Date: Thu, 11 Jan 2024 18:01:45 +0800 Subject: [PATCH] init --- src/assets/js/asyncRouter.js | 54 +++ src/assets/js/data_dictionary.js | 21 + src/components/hazard_type/index.vue | 48 ++ src/request/data_dictionary.js | 18 + src/request/hazard_investigation.js | 18 + .../industry_qualifications/add.vue | 2 +- .../delete_inventory_management/index.vue | 247 ++++++++++ .../delete_inventory_management/view.vue | 73 +++ .../inventory_management/add.vue | 97 +++- .../components/add_inspection_route.vue | 53 +++ .../components/inspection_route.vue | 5 +- .../components/select_risk.vue | 24 +- .../inventory_management/index.vue | 27 +- .../components/qualified.vue | 75 ++++ .../components/un_qualified.vue | 424 ++++++++++++++++++ .../inventory_troubleshooting/index.vue | 189 ++++++++ .../inventory_troubleshooting/inspect.vue | 396 ++++++++++++++++ .../job_data/view.vue | 2 +- 18 files changed, 1748 insertions(+), 25 deletions(-) create mode 100644 src/components/hazard_type/index.vue create mode 100644 src/views/hazard_investigation/delete_inventory_management/index.vue create mode 100644 src/views/hazard_investigation/delete_inventory_management/view.vue create mode 100644 src/views/hazard_investigation/inventory_management/components/add_inspection_route.vue create mode 100644 src/views/hazard_investigation/inventory_troubleshooting/components/qualified.vue create mode 100644 src/views/hazard_investigation/inventory_troubleshooting/components/un_qualified.vue create mode 100644 src/views/hazard_investigation/inventory_troubleshooting/index.vue create mode 100644 src/views/hazard_investigation/inventory_troubleshooting/inspect.vue diff --git a/src/assets/js/asyncRouter.js b/src/assets/js/asyncRouter.js index d8c3244..c3f6a11 100644 --- a/src/assets/js/asyncRouter.js +++ b/src/assets/js/asyncRouter.js @@ -251,6 +251,60 @@ export default [ }, component: "hazard_investigation/inventory_management/add", }, + { + path: "/hazard_investigation/inventory_management/edit", + meta: { + title: "修改", + activeMenu: "/hazard_investigation/inventory_management", + }, + component: "hazard_investigation/inventory_management/add", + }, + { + path: "/hazard_investigation/inventory_management/inheritance_list", + meta: { + title: "继承清单", + activeMenu: "/hazard_investigation/inventory_management", + }, + component: "hazard_investigation/inventory_management/add", + }, + ], + }, + { + path: "/hazard_investigation/delete_inventory_management", + meta: { title: "删除清单管理", isSubMenu: false }, + component: "children", + children: [ + { + path: "", + component: "hazard_investigation/delete_inventory_management/index", + }, + { + path: "/hazard_investigation/delete_inventory_management/view", + meta: { + title: "查看", + activeMenu: "/hazard_investigation/delete_inventory_management", + }, + component: "hazard_investigation/delete_inventory_management/view", + }, + ], + }, + { + path: "/hazard_investigation/inventory_troubleshooting", + meta: { title: "清单排查", isSubMenu: false }, + component: "children", + children: [ + { + path: "", + component: "hazard_investigation/inventory_troubleshooting/index", + }, + { + path: "/hazard_investigation/inventory_troubleshooting/inspect", + meta: { + title: "开始检查", + activeMenu: "/hazard_investigation/inventory_troubleshooting", + }, + component: "hazard_investigation/inventory_troubleshooting/inspect", + }, ], }, ], diff --git a/src/assets/js/data_dictionary.js b/src/assets/js/data_dictionary.js index a27eb78..b72b135 100644 --- a/src/assets/js/data_dictionary.js +++ b/src/assets/js/data_dictionary.js @@ -139,6 +139,27 @@ export const layoutFnGetTroubleshootingType = async () => { }); return ref(resData.list); }; +// 隐患级别 +export const layoutFnGetHazardLevel = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "5e7cf8620ba54ad89719d0be62133c7a", + }); + return ref(resData.list); +}; +// 隐患类别 +export const layoutFnGetHazardCategories = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "ec1d6dcfd0f2438a88968feea542eab0", + }); + return ref(resData.list); +}; +// 各省隐患类型 +export const layoutFnGetEveryProvinceHiddenDangerType = async () => { + const resData = await getLevels({ + DICTIONARIES_ID: "3babc15144444bdc8d763d0af2bdfff8", + }); + return ref(resData.list); +}; // 排查周期 export const layoutFnGetTroubleshootingCycle = async () => { const resData = await getLevels({ diff --git a/src/components/hazard_type/index.vue b/src/components/hazard_type/index.vue new file mode 100644 index 0000000..2e2dca5 --- /dev/null +++ b/src/components/hazard_type/index.vue @@ -0,0 +1,48 @@ + + + + + diff --git a/src/request/data_dictionary.js b/src/request/data_dictionary.js index 9345557..87b830e 100644 --- a/src/request/data_dictionary.js +++ b/src/request/data_dictionary.js @@ -1,4 +1,7 @@ import { post } from "@/request/axios.js"; +import { useUserStore } from "@/pinia/user.js"; +import pinia from "@/pinia/index.js"; +import { layoutFnGetEveryProvinceHiddenDangerType } from "@/assets/js/data_dictionary.js"; // 获取数据字典 export const getLevels = (params) => @@ -54,3 +57,18 @@ export const getUserListAll = (params) => loading: false, ...params, }); + +// 获取当前用户省隐患类型 +export const getHiddenDangerType = async () => { + const userStore = useUserStore(pinia); + const { value } = await layoutFnGetEveryProvinceHiddenDangerType(); + for (let i = 0; i < value.length; i++) { + if (value[i].BIANMA.indexOf(userStore.getUserInfo.PROVINCE) > -1) { + const resData = await post("/dictionaries/listAllDictToParId", { + parentId: value[i].DICTIONARIES_ID, + loading: false, + }); + return JSON.parse(resData.zTreeNodes.replaceAll('"nodes":[],', "")); + } + } +}; diff --git a/src/request/hazard_investigation.js b/src/request/hazard_investigation.js index d9e7464..12cd4dc 100644 --- a/src/request/hazard_investigation.js +++ b/src/request/hazard_investigation.js @@ -24,3 +24,21 @@ export const getInventoryManagementInspectionItems = (params) => post("/riskcheckitem/itemlistAll", params); // 清单管理检查项列表 export const getInventoryManagementOtherRiskList = (params) => post("/riskcheckitem/list", params); // 清单管理选择其他存在风险列表 +export const setInventoryManagementAdd = (params) => + post("/listmanager/add", params); // 清单管理新增 +export const setInventoryManagementEdit = (params) => + post("/listmanager/edit", params); // 清单管理修改 +export const getDeleteInventoryManagementList = (params) => + post("/stoplistmanager/list", params); // 删除清单管理列表 +export const setDeleteInventoryManagementRecovery = (params) => + post("/stoplistmanager/restore", params); // 删除清单管理恢复 +export const getInventoryTroubleshootingList = (params) => + post("/listmanager/checkList", params); // 清单排查列表 +export const getInventoryTroubleshootingOtherHiddenList = (params) => + post("/hidden/getOtherHidden", params); // 清单排查其它隐患列表 +export const getHiddenDangerDatabaseList = (params) => + post("/hiddenLibrary/list", params); // 隐患数据库列表 +export const setInventoryTroubleshootingOtherHiddenDangerAdd = (params) => + post("/hidden/add", params); // 清单排查其它隐患添加 +export const setInventoryTroubleshootingOtherHiddenDangerView = (params) => + post("/hidden/goEdit", params); // 清单排查其它隐患查看 diff --git a/src/views/enterprise_management/industry_qualifications/add.vue b/src/views/enterprise_management/industry_qualifications/add.vue index 7d6ac21..d9770ed 100644 --- a/src/views/enterprise_management/industry_qualifications/add.vue +++ b/src/views/enterprise_management/industry_qualifications/add.vue @@ -38,7 +38,7 @@ /> -
+
提交
diff --git a/src/views/hazard_investigation/delete_inventory_management/index.vue b/src/views/hazard_investigation/delete_inventory_management/index.vue new file mode 100644 index 0000000..4fce8ca --- /dev/null +++ b/src/views/hazard_investigation/delete_inventory_management/index.vue @@ -0,0 +1,247 @@ + + + + + diff --git a/src/views/hazard_investigation/delete_inventory_management/view.vue b/src/views/hazard_investigation/delete_inventory_management/view.vue new file mode 100644 index 0000000..51607c5 --- /dev/null +++ b/src/views/hazard_investigation/delete_inventory_management/view.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_management/add.vue b/src/views/hazard_investigation/inventory_management/add.vue index 775ca07..9596ba5 100644 --- a/src/views/hazard_investigation/inventory_management/add.vue +++ b/src/views/hazard_investigation/inventory_management/add.vue @@ -155,12 +155,12 @@ 检查内容 - + - + + @@ -237,12 +246,18 @@ import { import LayoutDepartment from "@/components/department/index.vue"; import { getPostListAll, getUserListAll } from "@/request/data_dictionary.js"; import { useRoute, useRouter } from "vue-router"; -import { getInventoryManagementInspectionItems } from "@/request/hazard_investigation.js"; +import { + getInventoryManagementInspectionItems, + getInventoryManagementView, + setInventoryManagementAdd, + setInventoryManagementEdit, +} from "@/request/hazard_investigation.js"; import { debounce } from "throttle-debounce"; import useFormValidate from "@/assets/js/useFormValidate.js"; import { ElMessage } from "element-plus"; import AddRisk from "@/views/risk_control/ledger/components/add.vue"; import SelectRisk from "./components/select_risk.vue"; +import AddInspectionRoute from "./components/add_inspection_route.vue"; const route = useRoute(); const router = useRouter(); @@ -314,19 +329,32 @@ const data = reactive({ EME_MEASURES: "", }, }, + inspectionRouteDialog: { + visible: false, + list: [], + }, }); const taskTypeList = await layoutFnGetTaskType(); const troubleshootingTypeList = await layoutFnGetTroubleshootingType(); const troubleshootingCycleList = await layoutFnGetTroubleshootingCycle(); const inventoryTypeList = await layoutFnGetInventoryType(); const fnGetData = async () => { + if (!LISTMANAGER_ID) return; + const resData = await getInventoryManagementView({ LISTMANAGER_ID }); + data.form = resData.pd; + data.form.dates = [resData.pd.START_DATE, resData.pd.END_DATE]; + data.list = resData.varList; + data.listAll = resData.varList; +}; +fnGetData(); +const fnGetInspectionItems = async () => { const resData = await getInventoryManagementInspectionItems({ DEPARTMENT_ID: data.form.DEPARTMENT_ID, POST_ID: data.form.POST_ID, }); data.list = [...tableRef.value.getSelectionRows(), ...resData.varList]; data.listAll = [...tableRef.value.getSelectionRows(), ...resData.varList]; - fnTableSelection(); + await fnTableSelection(); }; const fnDepartmentChange = () => { data.postList = []; @@ -339,7 +367,7 @@ const fnPostChange = () => { data.userList = []; data.form.USER_IDS = []; data.form.USER_ID = ""; - fnGetData(); + fnGetInspectionItems(); }; const fnGetPost = async (DEPARTMENT_ID) => { const resData = await getPostListAll({ DEPARTMENT_ID }); @@ -357,8 +385,9 @@ const fnGetDataFilter = () => { if (keyword) { data.list = data.listAll.filter( (item) => - item.RISKUNITNAME.indexOf(keyword) > -1 || - item.PARTSNAME.indexOf(keyword) > -1 + item.RISKUNITNAME?.indexOf(keyword) > -1 || + item.PARTSNAME?.indexOf(keyword) > -1 || + item.USERNAME?.indexOf(keyword) > -1 ); } else { data.list = data.listAll; @@ -372,14 +401,56 @@ const fnTableSelection = async () => { tableRef.value.toggleRowSelection(item, true); }); }; -const fnAddRiskSubmit = (row) => { - data.list.push(row); - data.listAll.push(row); +const fnAddRiskSubmit = (item) => { + data.list.push(item); + data.listAll.push(item); + fnTableSelection(); }; -const fnSubmit = debounce( +const fnSelectRiskSubmit = (listData) => { + data.list.push(...listData); + data.listAll.push(...listData); + fnTableSelection(); +}; +const fnSubmit = async () => { + await useFormValidate(formRef); + const selectionData = tableRef.value.getSelectionRows(); + if (selectionData.length === 0) { + ElMessage.error("请选择检查内容"); + return; + } + const allParts = []; + const allPartIds = []; + selectionData.forEach((item) => { + if (!allPartIds.includes(item.IDENTIFICATIONPARTS_ID)) { + allPartIds.push(item.IDENTIFICATIONPARTS_ID); + const part = { + ID: item.IDENTIFICATIONPARTS_ID, + NAME: item.PARTSNAME, + }; + allParts.push(part); + } + }); + data.inspectionRouteDialog.list = allParts; + data.inspectionRouteDialog.visible = true; +}; +const fnInspectionRouteSubmit = debounce( 1000, async () => { - await useFormValidate(formRef); + const selectionData = tableRef.value.getSelectionRows(); + const params = { + ...data.form, + USER_IDS: data.form.USER_IDS?.join(","), + LISTITEM: JSON.stringify(selectionData), + ROUTE: JSON.stringify(data.inspectionRouteDialog.list), + 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 setInventoryManagementAdd(params) + : await setInventoryManagementEdit(params); ElMessage.success("保存成功"); router.back(); }, diff --git a/src/views/hazard_investigation/inventory_management/components/add_inspection_route.vue b/src/views/hazard_investigation/inventory_management/components/add_inspection_route.vue new file mode 100644 index 0000000..c9af8e4 --- /dev/null +++ b/src/views/hazard_investigation/inventory_management/components/add_inspection_route.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_management/components/inspection_route.vue b/src/views/hazard_investigation/inventory_management/components/inspection_route.vue index 44b958e..ab6c401 100644 --- a/src/views/hazard_investigation/inventory_management/components/inspection_route.vue +++ b/src/views/hazard_investigation/inventory_management/components/inspection_route.vue @@ -25,7 +25,10 @@ {{ info.TYPENAME }} - +
- + [], + }, }); -const emits = defineEmits(["update:visible"]); +const emits = defineEmits(["update:visible", "submit"]); const visible = useVModel(props, "visible", emits); const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } = useListData(getInventoryManagementOtherRiskList, { immediate: false }); const riskClassificationList = await layoutFnGetRiskClassification(); -watch( +const stop = watch( () => props.visible, (value) => { if (value) { fnGetData(); + stop && stop(); } } ); @@ -108,6 +111,11 @@ const fnClose = () => { const fnSubmit = debounce( 1000, () => { + const selectionData = tableRef.value.getSelectionRows(); + const listData = differenceWith(selectionData, props.listData, (a, b) => { + return a.RISKCHECKITEM_ID === b.RISKCHECKITEM_ID; + }); + emits("submit", listData); fnClose(); }, { atBegin: true } diff --git a/src/views/hazard_investigation/inventory_management/index.vue b/src/views/hazard_investigation/inventory_management/index.vue index cad07d8..2821e72 100644 --- a/src/views/hazard_investigation/inventory_management/index.vue +++ b/src/views/hazard_investigation/inventory_management/index.vue @@ -173,6 +173,12 @@ type="primary" text link + @click=" + router.push({ + path: '/hazard_investigation/inventory_management/edit', + query: { LISTMANAGER_ID: row.LISTMANAGER_ID }, + }) + " > 修改 @@ -251,7 +257,9 @@ > 批量删除 - 继承清单 + + 继承清单 + @@ -393,6 +401,23 @@ const fnBatchDelete = debounce( }, { 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, + }, + }); +}; diff --git a/src/views/hazard_investigation/inventory_troubleshooting/components/qualified.vue b/src/views/hazard_investigation/inventory_troubleshooting/components/qualified.vue new file mode 100644 index 0000000..db61a4b --- /dev/null +++ b/src/views/hazard_investigation/inventory_troubleshooting/components/qualified.vue @@ -0,0 +1,75 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_troubleshooting/components/un_qualified.vue b/src/views/hazard_investigation/inventory_troubleshooting/components/un_qualified.vue new file mode 100644 index 0000000..67926da --- /dev/null +++ b/src/views/hazard_investigation/inventory_troubleshooting/components/un_qualified.vue @@ -0,0 +1,424 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_troubleshooting/index.vue b/src/views/hazard_investigation/inventory_troubleshooting/index.vue new file mode 100644 index 0000000..f14a30e --- /dev/null +++ b/src/views/hazard_investigation/inventory_troubleshooting/index.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/src/views/hazard_investigation/inventory_troubleshooting/inspect.vue b/src/views/hazard_investigation/inventory_troubleshooting/inspect.vue new file mode 100644 index 0000000..09f0b1e --- /dev/null +++ b/src/views/hazard_investigation/inventory_troubleshooting/inspect.vue @@ -0,0 +1,396 @@ + + + + + diff --git a/src/views/temporary_electricity_usage/job_data/view.vue b/src/views/temporary_electricity_usage/job_data/view.vue index 9f65bd0..d184961 100644 --- a/src/views/temporary_electricity_usage/job_data/view.vue +++ b/src/views/temporary_electricity_usage/job_data/view.vue @@ -1,5 +1,5 @@