forked from integrated_whb/integrated_whb_vue
init
parent
fe685942cf
commit
4ee2018f16
2
.env
2
.env
|
@ -1,4 +1,4 @@
|
|||
VITE_BASE_URL=http://192.168.0.17:8001/
|
||||
VITE_BASE_URL=http://192.168.0.42:8099/
|
||||
VITE_PROXY=/api/
|
||||
VITE_FILE_URL=https://file.zcloudchina.com/YTHFile
|
||||
VITE_TEMPLATE_URL=https://qaaq.qhdsafety.com/file/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
<template>
|
||||
<el-cascader
|
||||
v-if="type === 'cascader'"
|
||||
ref="cascaderRef"
|
||||
v-model="modelValue"
|
||||
:options="hiddenDangerTypeList"
|
||||
|
@ -10,6 +11,22 @@
|
|||
checkStrictly: true,
|
||||
}"
|
||||
/>
|
||||
<el-tree-select
|
||||
v-if="type === 'tree'"
|
||||
ref="treeSelectRef"
|
||||
v-model="modelValue"
|
||||
:data="hiddenDangerTypeList"
|
||||
:props="{
|
||||
value: 'BIANMA',
|
||||
children: 'nodes',
|
||||
label: 'name',
|
||||
}"
|
||||
node-key="id"
|
||||
:render-after-expand="false"
|
||||
accordion
|
||||
check-strictly
|
||||
:clearable="true"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
@ -30,10 +47,26 @@ const props = defineProps({
|
|||
type: String,
|
||||
default: "/",
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
default: "cascader",
|
||||
validator: (value) => {
|
||||
const typeList = ["cascader", "tree"];
|
||||
if (typeList.includes(value)) {
|
||||
return true;
|
||||
} else {
|
||||
throw new Error(`type必须是${typeList.join("、")}之一`);
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:modelValue"]);
|
||||
const modelValue = useVModel(props, "modelValue", emits);
|
||||
const cascaderRef = ref(null);
|
||||
const treeSelectRef = ref(null);
|
||||
const getCurrentNode = () => {
|
||||
return treeSelectRef.value.getCurrentNode();
|
||||
};
|
||||
const getCheckedNodes = () => {
|
||||
return cascaderRef.value
|
||||
.getCheckedNodes()[0]
|
||||
|
@ -41,6 +74,7 @@ const getCheckedNodes = () => {
|
|||
};
|
||||
defineExpose({
|
||||
getCheckedNodes,
|
||||
getCurrentNode,
|
||||
});
|
||||
const hiddenDangerTypeList = await getHiddenDangerType();
|
||||
</script>
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
<span v-if="data.info.SOURCE === '1'"> 隐患快报 </span>
|
||||
<span v-else-if="data.info.SOURCE === '2'"> 隐患排查 </span>
|
||||
<span v-else-if="data.info.SOURCE === '3'"> 隐患排查 </span>
|
||||
<span v-else-if="data.info.SOURCE === '4'"> 安全环保检查 </span>
|
||||
<span v-else-if="data.info.SOURCE === '5'"> 安全环保检查 </span>
|
||||
</el-descriptions-item>
|
||||
<template v-if="data.info.SOURCE === '2'">
|
||||
<el-descriptions-item label="风险点(单元)">
|
||||
|
@ -233,7 +235,7 @@
|
|||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from "vue";
|
||||
import { reactive, watchEffect } from "vue";
|
||||
import { getFileSuffix } from "@/assets/js/utils.js";
|
||||
import { VideoPlay } from "@element-plus/icons-vue";
|
||||
import LayoutVideo from "@/components/video/index.vue";
|
||||
|
@ -283,7 +285,9 @@ const fnGetData = async () => {
|
|||
data.pImgs = resData.pImgs;
|
||||
emits("throw-data", data.info);
|
||||
};
|
||||
fnGetData();
|
||||
watchEffect(() => {
|
||||
if (props.hiddenId) fnGetData();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
:height="300"
|
||||
:is-crop="false"
|
||||
:line-width="6"
|
||||
line-color="#fff"
|
||||
line-color="#000"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="fnReset">重签</el-button>
|
||||
|
|
|
@ -17,6 +17,7 @@ export const getInfo = (params) =>
|
|||
export const setUploadImg = (params) => upload("/imgfiles/add", params); // 上传附件
|
||||
export const setDeleteImg = (params) => post("/imgfiles/delete", params); // 删除附件
|
||||
export const getViewImg = (params) => post("/imgfiles/listImgs", params); // 查看图片
|
||||
export const setUploadVideo = (params) => upload("/imgfiles/addVideo", params); // 上传视频
|
||||
export const getVideoSource = (params) =>
|
||||
post("/videoRes/getVideoPlayAuth", params); // 获取视频
|
||||
export const getVideoAuth = (params) =>
|
||||
|
|
|
@ -2,9 +2,15 @@ import { post } from "@/request/axios.js";
|
|||
|
||||
export const getSafetyEnvironmentalList = (params) =>
|
||||
post("/safetyenvironmental/list", params); // 安全环保管理列表
|
||||
export const getSafetyEnvironmentalFlowChart = (params) =>
|
||||
post("/safetyenvironmental/getFlow", params); // 安全环保管理流程图
|
||||
export const getSafetyEnvironmentalListFlowChart = (params) =>
|
||||
post("/safetyenvironmental/getFlow", params); // 安全环保管理列表流程图
|
||||
export const setSafetyEnvironmentalDelete = (params) =>
|
||||
post("/safetyenvironmental/hide", params); // 安全环保管理删除
|
||||
export const setSafetyEnvironmentalDefense = (params) =>
|
||||
post("/safetyenvironmental/explain", params); // 安全环保管理申辩
|
||||
export const setSafetyEnvironmentalAdd = (params) =>
|
||||
post("/safetyenvironmental/add", params); // 安全环保管理新增
|
||||
export const getSafetyEnvironmentalView = (params) =>
|
||||
post("/safetyenvironmental/goShow", params); // 安全环保管理查看
|
||||
export const getSafetyEnvironmentalViewFlowChart = (params) =>
|
||||
post("/safetyenvironmental/getFlowChart", params); // 安全环保管理查看流程图
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
@submit.prevent="fnResetPaginationTransfer"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="清单名称" prop="KEYWORDS">
|
||||
<el-input
|
||||
v-model="searchForm.KEYWORDS"
|
||||
|
@ -15,7 +15,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="清单种类" prop="LIST_TYPE">
|
||||
<el-select v-model="searchForm.LIST_TYPE">
|
||||
<el-option label="风险管控清单" value="1" />
|
||||
|
@ -23,7 +23,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="周期内检查状态" prop="STATUS">
|
||||
<el-select v-model="searchForm.STATUS">
|
||||
<el-option label="未检查" value="0" />
|
||||
|
@ -31,7 +31,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="是否存在隐患项" prop="HASHIDDEN">
|
||||
<el-select v-model="searchForm.HASHIDDEN">
|
||||
<el-option label="无隐患" value="0" />
|
||||
|
@ -39,7 +39,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="是否有超期记录" prop="OVERTIME">
|
||||
<el-select v-model="searchForm.OVERTIME">
|
||||
<el-option label="无超期" value="0" />
|
||||
|
@ -47,7 +47,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="人员" prop="USERNAME">
|
||||
<el-input
|
||||
v-model="searchForm.USERNAME"
|
||||
|
@ -55,7 +55,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="清单类型" prop="TYPE">
|
||||
<el-select v-model="searchForm.TYPE">
|
||||
<el-option
|
||||
|
@ -67,7 +67,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="排查周期" prop="PERIOD">
|
||||
<el-select v-model="searchForm.PERIOD">
|
||||
<el-option
|
||||
|
@ -79,7 +79,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="清单级别" prop="LISTINGLEVEL">
|
||||
<el-select v-model="searchForm.LISTINGLEVEL">
|
||||
<el-option
|
||||
|
@ -94,7 +94,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="4">
|
||||
<el-form-item label="部门" prop="DEPTIDS">
|
||||
<layout-department
|
||||
v-model="searchForm.DEPTIDS"
|
||||
|
@ -104,7 +104,7 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="清单状态" prop="ISDELETE">
|
||||
<el-select v-model="searchForm.ISDELETE">
|
||||
<el-option label="启用" value="0" />
|
||||
|
@ -114,7 +114,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label="在岗状态" prop="WORKSTATUS">
|
||||
<el-select v-model="searchForm.WORKSTATUS">
|
||||
<el-option label="在岗" value="0" />
|
||||
|
@ -122,7 +122,7 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :span="5">
|
||||
<el-form-item label-width="10px">
|
||||
<el-button type="primary" native-type="submit">搜索</el-button>
|
||||
<el-button native-type="reset" @click="fnResetPaginationTransfer">
|
||||
|
@ -145,7 +145,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="NAME" label="清单名称" />
|
||||
<el-table-column label="清单种类">
|
||||
<el-table-column label="清单种类" width="100">
|
||||
<template v-slot="{ row }">
|
||||
<span v-if="row.list_type === '1'">风险管控清单</span>
|
||||
<span v-if="row.list_type === '2'">隐患排查清单</span>
|
||||
|
|
|
@ -45,17 +45,17 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查人意见" prop="INSPECTION_USER_OPINION">
|
||||
<el-form-item label="检查人意见" prop="CONFIRM_MESSAGE">
|
||||
<el-input
|
||||
v-model="data.form.INSPECTION_USER_OPINION"
|
||||
v-model="data.form.CONFIRM_MESSAGE"
|
||||
:autosize="{ minRows: 3 }"
|
||||
type="textarea"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查人" prop="INSPECTION_USER_SIGN_IMG">
|
||||
<layout-sign v-model="data.form.INSPECTION_USER_SIGN_IMG" />
|
||||
<el-form-item label="检查人" prop="CONFIRM_MESSAGE_SIGN">
|
||||
<layout-sign v-model="data.form.CONFIRM_MESSAGE_SIGN" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -96,7 +96,15 @@
|
|||
:key="item.id"
|
||||
>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检查人员部门" prop="INSPECTION_DEPARTMENT_ID">
|
||||
<el-form-item
|
||||
label="检查人员部门"
|
||||
:prop="'inspectorList.' + index + '.INSPECTION_DEPARTMENT_ID'"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择检查人员部门',
|
||||
trigger: 'change',
|
||||
}"
|
||||
>
|
||||
<layout-department
|
||||
v-model="item.INSPECTION_DEPARTMENT_ID"
|
||||
@update:model-value="
|
||||
|
@ -106,7 +114,15 @@
|
|||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="检查人员" prop="INSPECTION_USER_ID">
|
||||
<el-form-item
|
||||
label="检查人员"
|
||||
:prop="'inspectorList.' + index + '.INSPECTION_USER_ID'"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请选择检查人员',
|
||||
trigger: 'change',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
flex: 1;
|
||||
|
@ -148,7 +164,15 @@
|
|||
:key="item.id"
|
||||
>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="检查情况" prop="SITUATION">
|
||||
<el-form-item
|
||||
label="检查情况"
|
||||
:prop="'situationList.' + index + '.SITUATION'"
|
||||
:rules="{
|
||||
required: true,
|
||||
message: '请输入检查情况',
|
||||
trigger: 'blur',
|
||||
}"
|
||||
>
|
||||
<div
|
||||
style="
|
||||
flex: 1;
|
||||
|
@ -178,15 +202,38 @@
|
|||
<el-divider content-position="left">发现问题</el-divider>
|
||||
</el-col>
|
||||
<el-col :span="24" class="tr mb-10">
|
||||
<el-button type="primary"> 添加发现问题 </el-button>
|
||||
<el-button type="primary" @click="fnAddHidden">
|
||||
添加发现问题
|
||||
</el-button>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<layout-table :data="data.form.hiddenList" :show-pagination="false">
|
||||
<el-table-column type="index" label="序号" width="60" />
|
||||
<el-table-column label="问题描述" prop="HIDDENDESCR" />
|
||||
<el-table-column label="操作" width="80">
|
||||
<template v-slot="{ $index }">
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="data.form.hiddenList.splice($index, 1)"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</layout-table>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div class="mt-10 tc">
|
||||
<el-button type="primary" @click="fnSubmit">提交</el-button>
|
||||
</div>
|
||||
<hidden-add
|
||||
v-model:visible="data.addHiddenDialog.visible"
|
||||
:hazard-discoverer-list="data.addHiddenDialog.hazardDiscovererList"
|
||||
@submit="fnAddHiddenSubmit"
|
||||
/>
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
|
@ -196,8 +243,51 @@ import LayoutDepartment from "@/components/department/index.vue";
|
|||
import LayoutSign from "@/components/sign/index.vue";
|
||||
import { getUserListAll } from "@/request/data_dictionary.js";
|
||||
import LayoutInspectionType from "@/components/inspection_type/index.vue";
|
||||
import HiddenAdd from "./components/hidden_add.vue";
|
||||
import { useUserStore } from "@/pinia/user.js";
|
||||
import { debounce } from "throttle-debounce";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
import { ElMessage } from "element-plus";
|
||||
import { useRouter } from "vue-router";
|
||||
import { setSafetyEnvironmentalAdd } from "@/request/safety_environmental_management.js";
|
||||
import { setUploadImg, setUploadVideo } from "@/request/api.js";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
const rules = {};
|
||||
const router = useRouter();
|
||||
const userStore = useUserStore();
|
||||
const rules = {
|
||||
INSPECTION_SUBJECT: [
|
||||
{ required: true, message: "请选择检查题目", trigger: "change" },
|
||||
],
|
||||
INSPECTED_DEPARTMENT_ID: [
|
||||
{ required: true, message: "请选择被检查单位", trigger: "change" },
|
||||
],
|
||||
INSPECTED_SITEUSER_ID: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择被检查单位现场负责人",
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
INSPECTION_PLACE: [
|
||||
{ required: true, message: "请输入检查场所", trigger: "blur" },
|
||||
],
|
||||
CONFIRM_MESSAGE: [
|
||||
{ required: true, message: "请输入检查人意见", trigger: "blur" },
|
||||
],
|
||||
CONFIRM_MESSAGE_SIGN: [
|
||||
{ required: true, message: "请上传检查人签名", trigger: "change" },
|
||||
],
|
||||
INSPECTION_TYPE: [
|
||||
{ required: true, message: "请选择检查类型", trigger: "change" },
|
||||
],
|
||||
INSPECTION_TIME_START: [
|
||||
{ required: true, message: "请选择检查开始时间", trigger: "change" },
|
||||
],
|
||||
INSPECTION_TIME_END: [
|
||||
{ required: true, message: "请选择检查结束时间", trigger: "change" },
|
||||
],
|
||||
};
|
||||
const formRef = ref(null);
|
||||
const data = reactive({
|
||||
form: {
|
||||
|
@ -205,8 +295,8 @@ const data = reactive({
|
|||
INSPECTED_DEPARTMENT_ID: "",
|
||||
INSPECTED_SITEUSER_ID: "",
|
||||
INSPECTION_PLACE: "",
|
||||
INSPECTION_USER_OPINION: "",
|
||||
INSPECTION_USER_SIGN_IMG: "",
|
||||
CONFIRM_MESSAGE: "",
|
||||
CONFIRM_MESSAGE_SIGN: "",
|
||||
INSPECTION_TYPE: "",
|
||||
INSPECTION_TIME_START: "",
|
||||
INSPECTION_TIME_END: "",
|
||||
|
@ -215,6 +305,10 @@ const data = reactive({
|
|||
hiddenList: [],
|
||||
},
|
||||
inspectedSiteUserList: [],
|
||||
addHiddenDialog: {
|
||||
visible: false,
|
||||
hazardDiscovererList: [],
|
||||
},
|
||||
});
|
||||
const fnAddInspectorList = () => {
|
||||
data.form.inspectorList.push({
|
||||
|
@ -233,12 +327,12 @@ const fnAddSituationList = () => {
|
|||
};
|
||||
fnAddSituationList();
|
||||
const fnInspectedDepartmentChange = () => {
|
||||
data.inspectedSiteUserList.value = [];
|
||||
data.inspectedSiteUserList = [];
|
||||
data.form.INSPECTED_SITEUSER_ID = "";
|
||||
};
|
||||
const fnGetInspectedSitUserList = async (DEPARTMENT_ID) => {
|
||||
const { userList } = await getUserListAll({ DEPARTMENT_ID });
|
||||
data.inspectedSiteUserList.value = userList;
|
||||
data.inspectedSiteUserList = userList;
|
||||
};
|
||||
const fnInspectionDepartmentChange = (value, index) => {
|
||||
data.form.inspectorList[index].INSPECTION_USER_ID = "";
|
||||
|
@ -246,13 +340,82 @@ const fnInspectionDepartmentChange = (value, index) => {
|
|||
fnGetInspectionSitUserList(value, index);
|
||||
};
|
||||
const fnGetInspectionSitUserList = async (DEPARTMENT_ID, index) => {
|
||||
const { userList } = await getUserListAll({ DEPARTMENT_ID });
|
||||
const { userList } = await getUserListAll({ DEPARTMENT_ID, NOMAIN: "1" });
|
||||
data.form.inspectorList[index].inspectionUserList = userList;
|
||||
};
|
||||
watchEffect(() => {
|
||||
if (data.form.INSPECTED_DEPARTMENT_ID)
|
||||
fnGetInspectedSitUserList(data.form.INSPECTED_DEPARTMENT_ID);
|
||||
});
|
||||
const fnAddHidden = () => {
|
||||
data.addHiddenDialog.visible = true;
|
||||
data.addHiddenDialog.hazardDiscovererList = [
|
||||
{
|
||||
NAME: userStore.getUserInfo.NAME,
|
||||
USER_ID: userStore.getUserInfo.USER_ID,
|
||||
},
|
||||
];
|
||||
const inspectorList = data.form.inspectorList;
|
||||
for (let i = 0; i < inspectorList.length; i++) {
|
||||
const inspectionUserList = inspectorList[i].inspectionUserList;
|
||||
for (let j = 0; j < inspectionUserList.length; j++) {
|
||||
if (
|
||||
inspectorList[i].INSPECTION_USER_ID === inspectionUserList[j].USER_ID
|
||||
) {
|
||||
data.addHiddenDialog.hazardDiscovererList.push(inspectionUserList[j]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const fnAddHiddenSubmit = (item) => {
|
||||
data.form.hiddenList.push(item);
|
||||
};
|
||||
const fnSubmit = debounce(
|
||||
1000,
|
||||
async () => {
|
||||
await useFormValidate(formRef);
|
||||
const resData = await setSafetyEnvironmentalAdd({
|
||||
...data.form,
|
||||
INSPECTORJSON: JSON.stringify(data.form.inspectorList),
|
||||
SITUATIONJSON: JSON.stringify(data.form.situationList),
|
||||
HIDDENJSON: JSON.stringify(data.form.hiddenList),
|
||||
CONFIRM_MESSAGE_TIME: dayjs().format("YYYY-MM-DD HH:mm"),
|
||||
});
|
||||
const hiddenList = resData.pd.hiddenList;
|
||||
for (let i = 0; i < hiddenList.length; i++) {
|
||||
await fnUploadImage(
|
||||
hiddenList[i].HIDDEN_ID,
|
||||
data.form.hiddenList[i].hiddenImgs
|
||||
);
|
||||
await fnUploadVideo(
|
||||
hiddenList[i].HIDDEN_ID,
|
||||
data.form.hiddenList[i].videoFiles
|
||||
);
|
||||
}
|
||||
ElMessage.success("提交成功");
|
||||
router.back();
|
||||
},
|
||||
{ atBegin: true }
|
||||
);
|
||||
const fnUploadImage = async (HIDDEN_ID, files) => {
|
||||
const formData = new FormData();
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
formData.append("FFILE", files[i]);
|
||||
}
|
||||
formData.append("FOREIGN_KEY", HIDDEN_ID);
|
||||
formData.append("TYPE", 3);
|
||||
await setUploadImg(formData);
|
||||
};
|
||||
const fnUploadVideo = async (HIDDEN_ID, files) => {
|
||||
const formData = new FormData();
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
formData.append("FFILE", files[i]);
|
||||
}
|
||||
formData.append("FOREIGN_KEY", HIDDEN_ID);
|
||||
formData.append("TYPE", 102);
|
||||
await setUploadVideo(formData);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
|
|
|
@ -10,7 +10,10 @@
|
|||
import { useVModel } from "@vueuse/core";
|
||||
import RelationGraph from "relation-graph/vue3";
|
||||
import { ref, watchEffect } from "vue";
|
||||
import { getSafetyEnvironmentalFlowChart } from "@/request/safety_environmental_management.js";
|
||||
import {
|
||||
getSafetyEnvironmentalListFlowChart,
|
||||
getSafetyEnvironmentalViewFlowChart,
|
||||
} from "@/request/safety_environmental_management.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
|
@ -23,6 +26,11 @@ const props = defineProps({
|
|||
required: true,
|
||||
default: "",
|
||||
},
|
||||
type: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
|
@ -63,10 +71,17 @@ const graphOptions = ref({
|
|||
defaultNodeWidth: 200,
|
||||
});
|
||||
const fnGetData = async () => {
|
||||
const { nodes, from } = await getSafetyEnvironmentalFlowChart({
|
||||
INSPECTION_ID: props.id,
|
||||
});
|
||||
fnSeeksGraph(nodes, from);
|
||||
if (props.type === "list") {
|
||||
const { nodes, from } = await getSafetyEnvironmentalListFlowChart({
|
||||
INSPECTION_ID: props.id,
|
||||
});
|
||||
fnSeeksGraph(nodes, from);
|
||||
} else if (props.type === "view") {
|
||||
const { nodes, from } = await getSafetyEnvironmentalViewFlowChart({
|
||||
HIDDEN_ID: props.id,
|
||||
});
|
||||
fnSeeksGraph(nodes, from);
|
||||
}
|
||||
};
|
||||
const fnSeeksGraph = (nodes, links) => {
|
||||
relationGraphRef.value.setJsonData({ nodes, links }, () => {});
|
||||
|
|
|
@ -0,0 +1,166 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="添加隐患" :on-close="fnClose">
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患描述" prop="HIDDENDESCR">
|
||||
<el-input
|
||||
v-model="form.HIDDENDESCR"
|
||||
placeholder="请输入内容"
|
||||
type="textarea"
|
||||
:autosize="{ minRows: 3 }"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item prop="DISCOVERYTIME" label="隐患发现时间">
|
||||
<el-date-picker
|
||||
v-model="form.DISCOVERYTIME"
|
||||
format="YYYY-MM-DD HH:mm:ss"
|
||||
value-format="YYYY-MM-DD HH:mm:ss"
|
||||
type="datetime"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患部位" prop="HIDDENPART">
|
||||
<el-input v-model="form.HIDDENPART" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患级别" prop="HIDDENLEVEL">
|
||||
<el-select v-model="form.HIDDENLEVEL">
|
||||
<el-option
|
||||
v-for="item in [
|
||||
{ BIANMA: 'hiddenLevel0001', NAME: '一般隐患' },
|
||||
]"
|
||||
:key="item.BIANMA"
|
||||
:label="item.NAME"
|
||||
:value="item.BIANMA"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患类型" prop="HIDDENTYPE">
|
||||
<layout-hidden-danger-type v-model="form.HIDDENTYPE" type="tree" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患图片" prop="hiddenImgs">
|
||||
<layout-upload
|
||||
v-model:file-list="form.hiddenImgs"
|
||||
list-type="picture-card"
|
||||
accept=".jpg,.jpeg,.png"
|
||||
:limit="99"
|
||||
delete-to-server
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患视频" prop="videoFiles">
|
||||
<layout-upload
|
||||
v-model:file-list="form.videoFiles"
|
||||
accept=".mp4"
|
||||
:size="50"
|
||||
>
|
||||
<template #tip>只能上传mp4文件,且不超过50M</template>
|
||||
</layout-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="隐患发现人" prop="CREATOR">
|
||||
<el-select v-model="form.CREATOR">
|
||||
<el-option
|
||||
v-for="item in hazardDiscovererList"
|
||||
:key="item.USER_ID"
|
||||
:label="item.NAME"
|
||||
:value="item.USER_ID"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="fnClose">取消</el-button>
|
||||
<el-button @click="fnSubmit">确定</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import LayoutHiddenDangerType from "@/components/hazard_type/index.vue";
|
||||
import LayoutUpload from "@/components/upload/index.vue";
|
||||
import { ref } from "vue";
|
||||
import { useVModels } from "@vueuse/core";
|
||||
import useFormValidate from "@/assets/js/useFormValidate.js";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
hazardDiscovererList: {
|
||||
type: Array,
|
||||
required: true,
|
||||
default: () => [],
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible", "submit"]);
|
||||
const { visible } = useVModels(props, emits);
|
||||
const rules = {
|
||||
HIDDENDESCR: [{ required: true, message: "请输入隐患描述", trigger: "blur" }],
|
||||
DISCOVERYTIME: [
|
||||
{ required: true, message: "请选择隐患发现时间", trigger: "change" },
|
||||
],
|
||||
HIDDENPART: [{ required: true, message: "请输入隐患部位", trigger: "blur" }],
|
||||
HIDDENLEVEL: [
|
||||
{ required: true, message: "请选择隐患级别", trigger: "change" },
|
||||
],
|
||||
HIDDENTYPE: [
|
||||
{ required: true, message: "请选择隐患类型", trigger: "change" },
|
||||
],
|
||||
hiddenImgs: [
|
||||
{ required: true, message: "请上传隐患图片", trigger: "change" },
|
||||
],
|
||||
CREATOR: [{ required: true, message: "请选择隐患发现人", trigger: "change" }],
|
||||
};
|
||||
const form = ref({
|
||||
SOURCE: "5",
|
||||
HIDDENDESCR: "",
|
||||
DISCOVERYTIME: "",
|
||||
HIDDENPART: "",
|
||||
HIDDENLEVEL: "",
|
||||
HIDDENTYPE: "",
|
||||
hiddenImgs: [],
|
||||
videoFiles: [],
|
||||
CREATOR: "",
|
||||
});
|
||||
const formRef = ref(null);
|
||||
const fnClose = () => {
|
||||
formRef.value.resetFields();
|
||||
visible.value = false;
|
||||
};
|
||||
const fnSubmit = async () => {
|
||||
await useFormValidate(formRef);
|
||||
const throwForm = { ...form.value };
|
||||
delete throwForm.hiddenImgs;
|
||||
delete throwForm.videoFiles;
|
||||
throwForm.hiddenImgs = [];
|
||||
throwForm.videoFiles = [];
|
||||
for (let i = 0; i < form.value.hiddenImgs.length; i++) {
|
||||
if (form.value.hiddenImgs[i].raw)
|
||||
throwForm.hiddenImgs.push(form.value.hiddenImgs[i].raw);
|
||||
}
|
||||
for (let i = 0; i < form.value.videoFiles.length; i++) {
|
||||
if (form.value.videoFiles[i].raw)
|
||||
throwForm.videoFiles.push(form.value.videoFiles[i].raw);
|
||||
}
|
||||
emits("submit", throwForm);
|
||||
fnClose();
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -0,0 +1,30 @@
|
|||
<template>
|
||||
<el-dialog v-model="visible" title="查看隐患">
|
||||
<layout-hidden-view :hidden-id="id" />
|
||||
<template #footer>
|
||||
<el-button @click="visible = false">取 消</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import LayoutHiddenView from "@/components/hidden_view/index.vue";
|
||||
import { useVModel } from "@vueuse/core";
|
||||
|
||||
const props = defineProps({
|
||||
visible: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
id: {
|
||||
type: String,
|
||||
required: true,
|
||||
default: "",
|
||||
},
|
||||
});
|
||||
const emits = defineEmits(["update:visible"]);
|
||||
const visible = useVModel(props, "visible", emits);
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss"></style>
|
|
@ -213,6 +213,7 @@
|
|||
<flow-chart
|
||||
v-model:visible="data.flowChartDialog.visible"
|
||||
:id="data.flowChartDialog.INSPECTION_ID"
|
||||
type="list"
|
||||
/>
|
||||
<defense
|
||||
v-model:visible="data.defenseDialog.visible"
|
||||
|
|
|
@ -1,7 +1,205 @@
|
|||
<template>
|
||||
<layout-card></layout-card>
|
||||
<layout-card>
|
||||
<div id="printContainer">
|
||||
<el-divider content-position="left">
|
||||
秦港股份有限公司现场{{ data.info.INSPECTION_SUBJECT }}检查记录
|
||||
</el-divider>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="被检查单位">
|
||||
{{ data.info.INSPECTED_DEPARTMENT_NAMES }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="被检查单位现场负责人">
|
||||
{{ data.info.INSPECTED_SITEUSER_NAME }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="检查场所" :span="2">
|
||||
{{ data.info.INSPECTION_PLACE }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="牵头检查部门">
|
||||
{{ data.info.INSPECTION_LEADDEPARTMENT_NAME }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="检查人员">
|
||||
{{ data.info.INSPECTION_USER_NAME }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="检查类型">
|
||||
{{ data.info.INSPECTION_TYPE_NAME }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="检查时间">
|
||||
{{
|
||||
dayjs(data.info.INSPECTION_TIME_START).format(
|
||||
"YYYY年MM月DD日HH时mm分"
|
||||
)
|
||||
}}
|
||||
至
|
||||
{{
|
||||
dayjs(data.info.INSPECTION_TIME_END).format(
|
||||
"YYYY年MM月DD日HH时mm分"
|
||||
)
|
||||
}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="记录填写时间">
|
||||
{{ data.info.CREATTIME }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider content-position="left">检查情况</el-divider>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in data.info.situationList"
|
||||
:key="'situation' + index"
|
||||
:label="'检查情况' + (index + 1)"
|
||||
>
|
||||
{{ item.SITUATION }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-divider content-position="left">发现问题</el-divider>
|
||||
<table>
|
||||
<tr>
|
||||
<th class="title">隐患描述</th>
|
||||
<th class="title">隐患部位</th>
|
||||
<th class="title print_no_use">操作</th>
|
||||
</tr>
|
||||
<tr v-for="item in data.info.hiddenList" :key="item.HIDDEN_ID">
|
||||
<td>{{ item.HIDDENDESCR }}</td>
|
||||
<td>{{ item.HIDDENPART_NAME || item.HIDDENPART }}</td>
|
||||
<td class="print_no_use">
|
||||
<el-button type="primary" text link @click="fnView(item.HIDDEN_ID)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
type="primary"
|
||||
text
|
||||
link
|
||||
@click="fnFlowChart(item.HIDDEN_ID)"
|
||||
>
|
||||
流程图
|
||||
</el-button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="print_no_use" v-if="data.info?.inspectorList?.length > 0">
|
||||
<el-divider content-position="left">检查人员核实情况</el-divider>
|
||||
<table class="table-ui">
|
||||
<tr>
|
||||
<th>序号</th>
|
||||
<th>核实人员</th>
|
||||
<th>核实时间</th>
|
||||
<th>核实意见</th>
|
||||
<th>签字</th>
|
||||
</tr>
|
||||
<tr v-for="(item, index) in data.info.inspectorList" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td>{{ item.INSPECTION_USER_NAME }}</td>
|
||||
<td>{{ item.INSPECTION_USER_SIGN_TIME }}</td>
|
||||
<td>{{ item.INSPECTION_USER_OPINION }}</td>
|
||||
<td>
|
||||
<img
|
||||
v-viewer
|
||||
:src="VITE_FILE_URL + item.INSPECTION_USER_SIGN_IMG"
|
||||
width="100"
|
||||
height="100"
|
||||
alt=""
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<el-descriptions :column="1" border class="mt-10">
|
||||
<el-descriptions-item label="检查人员(签名)">
|
||||
<img
|
||||
v-for="(item, index) in data.info?.inspectorList"
|
||||
:key="index"
|
||||
v-viewer
|
||||
:src="VITE_FILE_URL + item.INSPECTION_USER_SIGN_IMG"
|
||||
width="100"
|
||||
height="100"
|
||||
alt=""
|
||||
/>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions :column="1" border class="mt-10">
|
||||
<el-descriptions-item label="被检查单位负责人(签名)">
|
||||
<img
|
||||
v-if="data.info.INSPECTED_SITEUSER_SIGN_IMG"
|
||||
v-viewer
|
||||
:src="VITE_FILE_URL + data.info.INSPECTED_SITEUSER_SIGN_IMG"
|
||||
width="100"
|
||||
height="100"
|
||||
alt=""
|
||||
/>
|
||||
<div v-else>签名未生成</div>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
<div class="mt-10 tc">
|
||||
<el-button type="primary" v-print="'#printContainer'">打印</el-button>
|
||||
</div>
|
||||
<div v-html="PRINT_STYLE" />
|
||||
<flow-chart
|
||||
v-model:visible="data.flowChartDialog.visible"
|
||||
:id="data.flowChartDialog.HIDDEN_ID"
|
||||
type="view"
|
||||
/>
|
||||
<view-hidden
|
||||
v-model:visible="data.viewDialog.visible"
|
||||
:id="data.viewDialog.HIDDEN_ID"
|
||||
/>
|
||||
</layout-card>
|
||||
</template>
|
||||
|
||||
<script setup></script>
|
||||
<script setup>
|
||||
import { useRoute } from "vue-router";
|
||||
import { getSafetyEnvironmentalView } from "@/request/safety_environmental_management.js";
|
||||
import { reactive } from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import FlowChart from "./components/flow_chart.vue";
|
||||
import ViewHidden from "./components/view_hidden.vue";
|
||||
import { PRINT_STYLE } from "@/assets/js/constant.js";
|
||||
|
||||
<style scoped lang="scss"></style>
|
||||
const route = useRoute();
|
||||
const { INSPECTION_ID } = route.query;
|
||||
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
|
||||
const data = reactive({
|
||||
info: {},
|
||||
flowChartDialog: {
|
||||
visible: false,
|
||||
HIDDEN_ID: "",
|
||||
},
|
||||
viewDialog: {
|
||||
visible: false,
|
||||
HIDDEN_ID: "",
|
||||
},
|
||||
});
|
||||
const fnGetData = async () => {
|
||||
const resData = await getSafetyEnvironmentalView({ INSPECTION_ID });
|
||||
data.info = resData.pd;
|
||||
};
|
||||
fnGetData();
|
||||
const fnFlowChart = (HIDDEN_ID) => {
|
||||
data.flowChartDialog.visible = true;
|
||||
data.flowChartDialog.HIDDEN_ID = HIDDEN_ID;
|
||||
};
|
||||
const fnView = (HIDDEN_ID) => {
|
||||
data.viewDialog.visible = true;
|
||||
data.viewDialog.HIDDEN_ID = HIDDEN_ID;
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
|
||||
td,
|
||||
th {
|
||||
border: 1px solid var(--el-border-color);
|
||||
padding: 8px 12px;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
background: var(--el-fill-color-light);
|
||||
width: 200px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
Loading…
Reference in New Issue