forked from integrated_whb/integrated_whb_vue
init
parent
f74c51cbb7
commit
82f63b7698
|
@ -243,6 +243,14 @@ export default [
|
|||
component:
|
||||
"hazard_investigation/inventory_management/insurance_coverage",
|
||||
},
|
||||
{
|
||||
path: "/hazard_investigation/inventory_management/add",
|
||||
meta: {
|
||||
title: "新增",
|
||||
activeMenu: "/hazard_investigation/inventory_management",
|
||||
},
|
||||
component: "hazard_investigation/inventory_management/add",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
|
@ -139,6 +139,13 @@ export const layoutFnGetTroubleshootingType = async () => {
|
|||
});
|
||||
return ref(resData.list);
|
||||
};
|
||||
// 排查周期
|
||||
export const layoutFnGetTroubleshootingCycle = async () => {
|
||||
const resData = await getLevels({
|
||||
DICTIONARIES_ID: "f60cf0e8315b4993b6d6049dd29f2ba5",
|
||||
});
|
||||
return ref(resData.list);
|
||||
};
|
||||
// 清单级别
|
||||
export const layoutFnGetInventoryLevel = async () => {
|
||||
const resData = await getLevels({
|
||||
|
@ -146,6 +153,13 @@ export const layoutFnGetInventoryLevel = async () => {
|
|||
});
|
||||
return ref(resData.list);
|
||||
};
|
||||
// 任务类型
|
||||
export const layoutFnGetTaskType = async () => {
|
||||
const resData = await getLevels({
|
||||
DICTIONARIES_ID: "7a1afe8a5e594b6a9e0cef42bd00f352",
|
||||
});
|
||||
return ref(resData.list);
|
||||
};
|
||||
// 职务
|
||||
export const layoutFnGetDuties = async () => {
|
||||
const resData = await getLevelsCorp({
|
||||
|
|
|
@ -99,7 +99,7 @@ export function ArrayDeduplication(arr) {
|
|||
* @param {string} name 去重的key
|
||||
* @return {Array} 去重后的数组
|
||||
**/
|
||||
export function ArrayObjectDeduplication(arr, name) {
|
||||
export function arrayObjectDeduplication(arr, name) {
|
||||
const obj = {};
|
||||
arr = arr.reduce(function (previousValue, currentValue) {
|
||||
if (!obj[currentValue[name]]) {
|
||||
|
@ -349,10 +349,7 @@ export function idCardGetDateAndGender(idCard) {
|
|||
else MonthDate = Month;
|
||||
if (DayDate < 10) Day = "0" + DayDate;
|
||||
else Day = DayDate;
|
||||
sex =
|
||||
org_gender % 2 === 1
|
||||
? "998f8531a6254c2eab5c825fa2d9896f"
|
||||
: "fdd532d9def447cdb68af3a938f6f05c";
|
||||
sex = org_gender % 2 === 1 ? "1" : "0";
|
||||
date = birthdays.getFullYear() + "-" + MonthDate + "-" + Day;
|
||||
}
|
||||
return { sex, date };
|
||||
|
|
|
@ -138,10 +138,15 @@ const getSelectionRows = () => {
|
|||
const clearSelection = () => {
|
||||
return tableRef.value.clearSelection();
|
||||
};
|
||||
const toggleRowSelection = (id, selected) => {
|
||||
const toggleRowSelection = (value, selected) => {
|
||||
if (typeof value === "object") {
|
||||
tableRef.value.toggleRowSelection(value, selected);
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < props.data.length; i++) {
|
||||
if (props.data[i][props.rowKey] === id) {
|
||||
if (props.data[i][props.rowKey] === value) {
|
||||
tableRef.value.toggleRowSelection(props.data[i], selected);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -48,3 +48,9 @@ export const getPostListAll = (params) =>
|
|||
loading: false,
|
||||
...params,
|
||||
});
|
||||
// 获取用户
|
||||
export const getUserListAll = (params) =>
|
||||
post("/user/listAll", {
|
||||
loading: false,
|
||||
...params,
|
||||
});
|
||||
|
|
|
@ -20,3 +20,7 @@ export const setInventoryManagementInsuranceCoverageList = (params) =>
|
|||
post("/labelFactory/termList", params); // 清单管理设置包保责任类型选择列表
|
||||
export const setInventoryManagementInsuranceCoverageSave = (params) =>
|
||||
post("/listmanager/saveBaoBaoType", params); // 清单管理设置包保责任类型提交
|
||||
export const getInventoryManagementInspectionItems = (params) =>
|
||||
post("/riskcheckitem/itemlistAll", params); // 清单管理检查项列表
|
||||
export const getInventoryManagementOtherRiskList = (params) =>
|
||||
post("/riskcheckitem/list", params); // 清单管理选择其他存在风险列表
|
||||
|
|
|
@ -59,6 +59,21 @@
|
|||
<el-input v-model="data.form.NAME" placeholder="请输入" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="性别" prop="SEX">
|
||||
<el-select v-model="data.form.SEX">
|
||||
<el-option
|
||||
v-for="item in [
|
||||
{ NAME: '男', DICTIONARIES_ID: '1' },
|
||||
{ NAME: '女', DICTIONARIES_ID: '0' },
|
||||
]"
|
||||
:key="item.DICTIONARIES_ID"
|
||||
:label="item.NAME"
|
||||
:value="item.DICTIONARIES_ID"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="部门排序" prop="SORT">
|
||||
<el-input
|
||||
|
@ -215,7 +230,10 @@
|
|||
<el-form-item label="性别" prop="SEX">
|
||||
<el-select v-model="data.form.SEX">
|
||||
<el-option
|
||||
v-for="item in data.sexList"
|
||||
v-for="item in [
|
||||
{ NAME: '男', DICTIONARIES_ID: '1' },
|
||||
{ NAME: '女', DICTIONARIES_ID: '0' },
|
||||
]"
|
||||
:key="item.DICTIONARIES_ID"
|
||||
:label="item.NAME"
|
||||
:value="item.DICTIONARIES_ID"
|
||||
|
@ -416,7 +434,6 @@ import {
|
|||
layoutFnGetPersonnelType,
|
||||
layoutFnGetPoliticalLandscape,
|
||||
layoutFnGetProfessionalTitle,
|
||||
layoutFnGetSex,
|
||||
} from "@/assets/js/data_dictionary.js";
|
||||
import { ElMessageBox, ElMessage } from "element-plus";
|
||||
import { debounce } from "throttle-debounce";
|
||||
|
@ -532,7 +549,6 @@ const data = reactive({
|
|||
schedulingList1: [],
|
||||
periodList: [],
|
||||
nationList: [],
|
||||
sexList: [],
|
||||
politicalLandscapeList: [],
|
||||
degreeOfEducationList: [],
|
||||
personnelTypeList: [],
|
||||
|
@ -655,8 +671,6 @@ const fnChangeIdCard = () => {
|
|||
const fnGetLevels = async () => {
|
||||
const { value: nationList } = await layoutFnGetNation();
|
||||
data.nationList = nationList;
|
||||
const { value: sexList } = await layoutFnGetSex();
|
||||
data.sexList = sexList;
|
||||
const { value: politicalLandscapeList } =
|
||||
await layoutFnGetPoliticalLandscape();
|
||||
data.politicalLandscapeList = politicalLandscapeList;
|
||||
|
|
|
@ -0,0 +1,394 @@
|
|||
<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="130px"
|
||||
@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.selectRiskDialogVisible = 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="RISKUNITNAME" label="风险点(单元)" width="180" />
|
||||
<el-table-column prop="PARTSNAME" label="辨识部位" width="180" />
|
||||
<el-table-column prop="RISK_DESCR" label="存在风险" width="300" />
|
||||
<el-table-column prop="DNAME5" label="风险分级" width="180" />
|
||||
<el-table-column prop="USERNAME" label="管控负责人" width="180" />
|
||||
<el-table-column prop="CHECK_CONTENT" label="检查内容" />
|
||||
</layout-table>
|
||||
<div class="tc mt-10">
|
||||
<el-button type="primary" @click="fnSubmit">保存</el-button>
|
||||
</div>
|
||||
<add-risk
|
||||
title="添加存在风险"
|
||||
type="add"
|
||||
v-model:visible="data.addOrEditDialog.visible"
|
||||
v-model:form="data.addOrEditDialog.form"
|
||||
:control="false"
|
||||
@get-data="fnAddRiskSubmit"
|
||||
/>
|
||||
<select-risk v-model:visible="data.selectRiskDialogVisible" />
|
||||
</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, getUserListAll } from "@/request/data_dictionary.js";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
import { getInventoryManagementInspectionItems } 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";
|
||||
|
||||
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: {},
|
||||
selectRiskDialogVisible: false,
|
||||
addOrEditDialog: {
|
||||
visible: false,
|
||||
form: {
|
||||
DEPARTMENT_ID: "",
|
||||
USER_ID: "",
|
||||
RISK_UNIT_ID: "",
|
||||
IDENTIFICATION_ID: "",
|
||||
RISK_DESCR: "",
|
||||
LIKELIHOOD: "",
|
||||
EXPOSURE: "",
|
||||
CONSEQUENCE: "",
|
||||
LEVEL_NAME: "",
|
||||
DANGER: "",
|
||||
MEASURES: "",
|
||||
ACCIDENTS: [],
|
||||
EME_MEASURES: "",
|
||||
},
|
||||
},
|
||||
});
|
||||
const taskTypeList = await layoutFnGetTaskType();
|
||||
const troubleshootingTypeList = await layoutFnGetTroubleshootingType();
|
||||
const troubleshootingCycleList = await layoutFnGetTroubleshootingCycle();
|
||||
const inventoryTypeList = await layoutFnGetInventoryType();
|
||||
const fnGetData = 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();
|
||||
};
|
||||
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 = "";
|
||||
fnGetData();
|
||||
};
|
||||
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.RISKUNITNAME.indexOf(keyword) > -1 ||
|
||||
item.PARTSNAME.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, true);
|
||||
});
|
||||
};
|
||||
const fnAddRiskSubmit = (row) => {
|
||||
data.list.push(row);
|
||||
data.listAll.push(row);
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
ElMessage.success("保存成功");
|
||||
router.back();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
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>
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="设置包保责任类型">
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions :column="2" border class="mb-10">
|
||||
<el-descriptions-item label="风险点">
|
||||
{{ info.RISKUNITNAME }}
|
||||
</el-descriptions-item>
|
||||
|
|
|
@ -0,0 +1,117 @@
|
|||
<template>
|
||||
<el-dialog title="选择其他存在风险" v-model="visible" width="1500">
|
||||
<el-form
|
||||
:model="searchForm"
|
||||
label-width="90px"
|
||||
@submit.prevent="fnResetPagination"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-form-item
|
||||
label="风险点(单元)/辨识部位"
|
||||
prop="KEYWORDS"
|
||||
label-width="170px"
|
||||
>
|
||||
<el-input
|
||||
v-model="searchForm.KEYWORDS"
|
||||
placeholder="请输入关键字"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="部门" prop="DEPARTMENT_ID">
|
||||
<layout-department v-model="searchForm.DEPARTMENT_ID" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-form-item label="类型" prop="OTHERLEVELID">
|
||||
<el-select v-model="searchForm.OTHERLEVELID">
|
||||
<el-option
|
||||
v-for="item in riskClassificationList"
|
||||
: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="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="RISKCHECKITEM_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="RISKUNITNAME" label="风险点(单元)" width="105" />
|
||||
<el-table-column prop="PARTSNAME" label="辨识部位" width="90" />
|
||||
<el-table-column prop="RISK_DESCR" label="存在风险" />
|
||||
<el-table-column prop="DNAME5" label="风险分级" width="100" />
|
||||
<el-table-column prop="USERNAME" label="管控负责人" width="90" />
|
||||
<el-table-column prop="CHECK_CONTENT" label="检查内容" />
|
||||
</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 LayoutDepartment from "@/components/department/index.vue";
|
||||
import useListData from "@/assets/js/useListData.js";
|
||||
import { getInventoryManagementOtherRiskList } from "@/request/hazard_investigation.js";
|
||||
import { watch } from "vue";
|
||||
import { serialNumber } from "@/assets/js/utils.js";
|
||||
import { layoutFnGetRiskClassification } from "@/assets/js/data_dictionary.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
const { list, searchForm, pagination, fnGetData, fnResetPagination, tableRef } =
|
||||
useListData(getInventoryManagementOtherRiskList, { immediate: false });
|
||||
const riskClassificationList = await layoutFnGetRiskClassification();
|
||||
watch(
|
||||
() => props.visible,
|
||||
(value) => {
|
||||
if (value) {
|
||||
fnGetData();
|
||||
}
|
||||
}
|
||||
);
|
||||
const fnClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
() => {
|
||||
fnClose();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -30,7 +30,6 @@
|
|||
multiple
|
||||
show-checkbox
|
||||
collapse-tags
|
||||
root-disabled="N"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
@ -234,7 +233,15 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<template #button>
|
||||
<el-button v-if="buttonJurisdiction.add" type="primary">
|
||||
<el-button
|
||||
v-if="buttonJurisdiction.add"
|
||||
type="primary"
|
||||
@click="
|
||||
router.push({
|
||||
path: '/hazard_investigation/inventory_management/add',
|
||||
})
|
||||
"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
<el-button
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<el-dialog
|
||||
v-model="visible"
|
||||
:title="type === 'add' ? '新增' : '修改'"
|
||||
:title="title ? title : type === 'add' ? '新增' : '修改'"
|
||||
:before-close="fnClose"
|
||||
>
|
||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="240px">
|
||||
|
@ -150,44 +150,46 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类1" prop="MANAGEMENT_CONTROL_ONE">
|
||||
<el-select
|
||||
v-model="form.MANAGEMENT_CONTROL_ONE"
|
||||
@change="form.MANAGEMENT_CONTROL_TWO = ''"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in controlList1"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
<template v-if="control">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类1" prop="MANAGEMENT_CONTROL_ONE">
|
||||
<el-select
|
||||
v-model="form.MANAGEMENT_CONTROL_ONE"
|
||||
@change="form.MANAGEMENT_CONTROL_TWO = ''"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in controlList1"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类2" prop="MANAGEMENT_CONTROL_TWO">
|
||||
<el-select v-model="form.MANAGEMENT_CONTROL_TWO">
|
||||
<el-option
|
||||
v-for="item in controlList2"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类3" prop="MANAGEMENT_CONTROL_THREE">
|
||||
<el-input
|
||||
v-model="form.MANAGEMENT_CONTROL_THREE"
|
||||
type="textarea"
|
||||
:autosize="{
|
||||
minRows: 3,
|
||||
}"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类2" prop="MANAGEMENT_CONTROL_TWO">
|
||||
<el-select v-model="form.MANAGEMENT_CONTROL_TWO">
|
||||
<el-option
|
||||
v-for="item in controlList2"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="管控措施分类3" prop="MANAGEMENT_CONTROL_THREE">
|
||||
<el-input
|
||||
v-model="form.MANAGEMENT_CONTROL_THREE"
|
||||
type="textarea"
|
||||
:autosize="{
|
||||
minRows: 3,
|
||||
}"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</template>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
|
@ -232,6 +234,14 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: "",
|
||||
},
|
||||
control: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||
const { visible, form } = useVModels(props, emits);
|
||||
|
@ -371,11 +381,12 @@ const fnSubmit = debounce(
|
|||
ACCIDENTS: form.value.ACCIDENTS.join(","),
|
||||
ACCIDENTS_NAME,
|
||||
};
|
||||
if (props.type === "add") await setRiskControlLedgerAdd(params);
|
||||
else await setRiskControlLedgerEdit(params);
|
||||
let resData = {};
|
||||
if (props.type === "add") resData = await setRiskControlLedgerAdd(params);
|
||||
else resData = await setRiskControlLedgerEdit(params);
|
||||
ElMessage.success("操作成功");
|
||||
fnClose();
|
||||
emits("get-data");
|
||||
emits("get-data", resData.pd);
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
multiple
|
||||
show-checkbox
|
||||
collapse-tags
|
||||
root-disabled="N"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
|
Loading…
Reference in New Issue