Merge remote-tracking branch 'origin/dev' into dev

pull/1/head
chenxinying 2024-02-02 14:09:20 +08:00
commit d699e3472f
12 changed files with 936 additions and 3 deletions

View File

@ -945,6 +945,56 @@ export default [
}, },
], ],
}, },
{
path: "/safety_environmental_management",
redirect: "/safety_environmental_management/safety_environmental",
meta: { title: "安全、环保检查管理", model: MODEL["1"] },
component: "children",
children: [
{
path: "/safety_environmental_management/safety_environmental",
meta: { title: "安全、环保检查", isSubMenu: false },
component: "children",
children: [
{
path: "",
component:
"safety_environmental_management/safety_environmental/index",
},
{
path: "/safety_environmental_management/safety_environmental/add",
meta: {
title: "新增",
activeMenu:
"/safety_environmental_management/safety_environmental",
},
component:
"safety_environmental_management/safety_environmental/add",
},
{
path: "/safety_environmental_management/safety_environmental/edit",
meta: {
title: "编辑",
activeMenu:
"/safety_environmental_management/safety_environmental",
},
component:
"safety_environmental_management/safety_environmental/add",
},
{
path: "/safety_environmental_management/safety_environmental/view",
meta: {
title: "查看",
activeMenu:
"/safety_environmental_management/safety_environmental",
},
component:
"safety_environmental_management/safety_environmental/view",
},
],
},
],
},
{ {
path: "/off_duty_management", path: "/off_duty_management",
redirect: "/off_duty_management/leave", redirect: "/off_duty_management/leave",

View File

@ -6,6 +6,7 @@ import {
getDepartmentTree, getDepartmentTree,
getLevelsCorp, getLevelsCorp,
getElectronicFenceTree, getElectronicFenceTree,
getListSelectTree,
} from "@/request/data_dictionary.js"; } from "@/request/data_dictionary.js";
import { ref } from "vue"; import { ref } from "vue";
@ -388,6 +389,13 @@ export const layoutFnGetElectronicFenceTree = async (params) => {
const resData = await getElectronicFenceTree(params); const resData = await getElectronicFenceTree(params);
return ref(JSON.parse(resData.zTreeNodes)); return ref(JSON.parse(resData.zTreeNodes));
}; };
// 检查类型树
export const layoutFnGetInspectionTypeTree = async () => {
const resData = await getListSelectTree({
DICTIONARIES_ID: "60e6481d96e44a5390ff5c347c4d1ffe",
});
return ref(JSON.parse(resData.zTreeNodes));
};
// 无法确定DICTIONARIES_ID的数据字典 // 无法确定DICTIONARIES_ID的数据字典
export const layoutFnGetLevels = async (DICTIONARIES_ID) => { export const layoutFnGetLevels = async (DICTIONARIES_ID) => {
const resData = await getLevels({ DICTIONARIES_ID }); const resData = await getLevels({ DICTIONARIES_ID });

View File

@ -0,0 +1,46 @@
<template>
<el-tree-select
ref="treeSelectRef"
v-model="modelValue"
:data="data"
:props="{
value: 'id',
children: 'nodes',
label: 'name',
}"
node-key="id"
:render-after-expand="false"
accordion
check-strictly
:clearable="true"
/>
</template>
<script setup>
import { layoutFnGetInspectionTypeTree } from "@/assets/js/data_dictionary";
import { ref } from "vue";
import { useVModel } from "@vueuse/core";
defineOptions({
name: "LayoutInspectionType",
});
const props = defineProps({
modelValue: {
type: String,
required: true,
default: "",
},
});
const emits = defineEmits(["update:modelValue"]);
const modelValue = useVModel(props, "modelValue", emits);
const treeSelectRef = ref(null);
const getCurrentNode = () => {
return treeSelectRef.value.getCurrentNode();
};
defineExpose({
getCurrentNode,
});
const data = await layoutFnGetInspectionTypeTree();
</script>
<style scoped></style>

View File

@ -14,7 +14,7 @@
:height="300" :height="300"
:is-crop="false" :is-crop="false"
:line-width="6" :line-width="6"
line-color="red" line-color="#fff"
/> />
<template #footer> <template #footer>
<el-button @click="fnReset"></el-button> <el-button @click="fnReset"></el-button>

View File

@ -45,12 +45,18 @@ export const getDepartmentTree = (params) =>
loading: false, loading: false,
...params, ...params,
}); });
// 部门 // 电子围栏
export const getElectronicFenceTree = (params) => export const getElectronicFenceTree = (params) =>
post("/electronicfence/listTree", { post("/electronicfence/listTree", {
loading: false, loading: false,
...params, ...params,
}); });
// 下拉选择树
export const getListSelectTree = (params) =>
post("/dictionaries/listSelectTree", {
loading: false,
...params,
});
// 获取岗位 // 获取岗位
export const getPostListAll = (params) => export const getPostListAll = (params) =>
post("/post/listAll", { post("/post/listAll", {

View File

@ -0,0 +1,10 @@
import { post } from "@/request/axios.js";
export const getSafetyEnvironmentalList = (params) =>
post("/safetyenvironmental/list", params); // 安全环保管理列表
export const getSafetyEnvironmentalFlowChart = (params) =>
post("/safetyenvironmental/getFlow", params); // 安全环保管理流程图
export const setSafetyEnvironmentalDelete = (params) =>
post("/safetyenvironmental/hide", params); // 安全环保管理删除
export const setSafetyEnvironmentalDefense = (params) =>
post("/safetyenvironmental/explain", params); // 安全环保管理申辩

View File

@ -246,7 +246,6 @@ export const addEntity = (
width: 30, width: 30,
verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM, verticalOrigin: window.Cesium.VerticalOrigin.BOTTOM,
horizontalOrigin: window.Cesium.HorizontalOrigin.CENTER, horizontalOrigin: window.Cesium.HorizontalOrigin.CENTER,
heightReference: window.Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY, disableDepthTestDistance: Number.POSITIVE_INFINITY,
}, },
label: { label: {

View File

@ -0,0 +1,258 @@
<template>
<layout-card>
<el-form
ref="formRef"
:model="data.form"
:rules="rules"
label-width="180px"
>
<el-row>
<el-col :span="24">
<el-form-item label="检查题目" prop="INSPECTION_SUBJECT">
<el-radio-group v-model="data.form.INSPECTION_SUBJECT">
<el-radio label="安全">安全</el-radio>
<el-radio label="环保">环保</el-radio>
<el-radio label="综合">综合</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="被检查单位" prop="INSPECTED_DEPARTMENT_ID">
<layout-department
v-model="data.form.INSPECTED_DEPARTMENT_ID"
@update:model-value="fnInspectedDepartmentChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item
label="被检查单位现场负责人"
prop="INSPECTED_SITEUSER_ID"
>
<el-select v-model="data.form.INSPECTED_SITEUSER_ID">
<el-option
v-for="item in data.inspectedSiteUserList"
:key="item.USER_ID"
:label="item.NAME"
:value="item.USER_ID"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="检查场所" prop="INSPECTION_PLACE">
<el-input v-model="data.form.INSPECTION_PLACE" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="检查人意见" prop="INSPECTION_USER_OPINION">
<el-input
v-model="data.form.INSPECTION_USER_OPINION"
: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>
</el-col>
<el-col :span="8">
<el-form-item label="检查类型" prop="INSPECTION_TYPE">
<layout-inspection-type v-model="data.form.INSPECTION_TYPE" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检查开始时间" prop="INSPECTION_TIME_START">
<el-date-picker
v-model="data.form.INSPECTION_TIME_START"
format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm"
type="datetime"
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="检查结束时间" prop="INSPECTION_TIME_END">
<el-date-picker
v-model="data.form.INSPECTION_TIME_END"
format="YYYY-MM-DD HH:mm"
value-format="YYYY-MM-DD HH:mm"
type="datetime"
/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-divider content-position="left">检查人员</el-divider>
</el-col>
<el-col :span="24" class="tr mb-10">
<el-button type="primary" @click="fnAddInspectorList">
添加检查人员
</el-button>
</el-col>
<template
v-for="(item, index) in data.form.inspectorList"
:key="item.id"
>
<el-col :span="12">
<el-form-item label="检查人员部门" prop="INSPECTION_DEPARTMENT_ID">
<layout-department
v-model="item.INSPECTION_DEPARTMENT_ID"
@update:model-value="
fnInspectionDepartmentChange($event, index)
"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="检查人员" prop="INSPECTION_USER_ID">
<div
style="
flex: 1;
display: flex;
justify-content: space-between;
align-items: flex-start;
"
>
<el-select v-model="item.INSPECTION_USER_ID">
<el-option
v-for="data in item.inspectionUserList"
:key="data.USER_ID"
:label="data.NAME"
:value="data.USER_ID"
/>
</el-select>
<el-button
v-if="index !== 0"
type="danger"
class="ml-10"
@click="data.form.inspectorList.splice(index, 1)"
>
删除
</el-button>
</div>
</el-form-item>
</el-col>
</template>
<el-col :span="24">
<el-divider content-position="left">检查情况</el-divider>
</el-col>
<el-col :span="24" class="tr mb-10">
<el-button type="primary" @click="fnAddSituationList">
添加检查情况
</el-button>
</el-col>
<template
v-for="(item, index) in data.form.situationList"
:key="item.id"
>
<el-col :span="24">
<el-form-item label="检查情况" prop="SITUATION">
<div
style="
flex: 1;
display: flex;
justify-content: space-between;
align-items: flex-start;
"
>
<el-input
v-model="item.SITUATION"
:autosize="{ minRows: 3 }"
type="textarea"
/>
<el-button
v-if="index !== 0"
class="ml-10"
type="danger"
@click="data.form.situationList.splice(index, 1)"
>
删除
</el-button>
</div>
</el-form-item>
</el-col>
</template>
<el-col :span="24">
<el-divider content-position="left">发现问题</el-divider>
</el-col>
<el-col :span="24" class="tr mb-10">
<el-button type="primary"> 添加发现问题 </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" />
</layout-table>
</el-col>
</el-row>
</el-form>
</layout-card>
</template>
<script setup>
import { reactive, ref, watchEffect } from "vue";
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";
const rules = {};
const formRef = ref(null);
const data = reactive({
form: {
INSPECTION_SUBJECT: "安全",
INSPECTED_DEPARTMENT_ID: "",
INSPECTED_SITEUSER_ID: "",
INSPECTION_PLACE: "",
INSPECTION_USER_OPINION: "",
INSPECTION_USER_SIGN_IMG: "",
INSPECTION_TYPE: "",
INSPECTION_TIME_START: "",
INSPECTION_TIME_END: "",
inspectorList: [],
situationList: [],
hiddenList: [],
},
inspectedSiteUserList: [],
});
const fnAddInspectorList = () => {
data.form.inspectorList.push({
INSPECTION_DEPARTMENT_ID: "",
INSPECTION_USER_ID: "",
inspectionUserList: [],
id: Math.random(),
});
};
fnAddInspectorList();
const fnAddSituationList = () => {
data.form.situationList.push({
SITUATION: "",
id: Math.random(),
});
};
fnAddSituationList();
const fnInspectedDepartmentChange = () => {
data.inspectedSiteUserList.value = [];
data.form.INSPECTED_SITEUSER_ID = "";
};
const fnGetInspectedSitUserList = async (DEPARTMENT_ID) => {
const { userList } = await getUserListAll({ DEPARTMENT_ID });
data.inspectedSiteUserList.value = userList;
};
const fnInspectionDepartmentChange = (value, index) => {
data.form.inspectorList[index].INSPECTION_USER_ID = "";
data.form.inspectorList[index].inspectionUserList = [];
fnGetInspectionSitUserList(value, index);
};
const fnGetInspectionSitUserList = async (DEPARTMENT_ID, index) => {
const { userList } = await getUserListAll({ DEPARTMENT_ID });
data.form.inspectorList[index].inspectionUserList = userList;
};
watchEffect(() => {
if (data.form.INSPECTED_DEPARTMENT_ID)
fnGetInspectedSitUserList(data.form.INSPECTED_DEPARTMENT_ID);
});
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,126 @@
<template>
<el-dialog v-model="visible" title="申辩处理" :on-close="fnClose">
<el-form ref="formRef" :rules="rules" :model="form" label-width="130px">
<el-form-item label="申辩人">
<img
v-viewer
:src="VITE_FILE_URL + info.INSPECTED_SITEUSER_SIGN_IMG"
style="width: 100px; height: 100px"
alt=""
/>
</el-form-item>
<el-form-item label="申辩时间">
<el-input :model-value="info.INSPECTED_SITEUSER_SIGN_TIME" disabled />
</el-form-item>
<el-form-item label="申辩说明">
<el-input
:model-value="info.INSPECTED_EXPLAIN"
disabled
type="textarea"
autosize
/>
</el-form-item>
<el-form-item label="申辩附件" v-if="info.INSPECTED_EXPLAIN_FILEPATH">
<el-input :model-value="info.INSPECTED_EXPLAIN_FILENAME" disabled />
<el-button type="primary" @click="fnDownloadFile(info.INSPECTION_ID)">
下载
</el-button>
</el-form-item>
<el-form-item label="申辩是否成立" prop="INSPECTION_STATUS">
<el-radio v-model="form.INSPECTION_STATUS" label="3"></el-radio>
<el-radio v-model="form.INSPECTION_STATUS" label="-2"></el-radio>
</el-form-item>
<template v-if="form.INSPECTION_STATUS === '3'">
<el-form-item label="不成立理由内容" prop="INSPECTED_EXPLAIN_REFUSE">
<el-input
v-model="form.INSPECTED_EXPLAIN_REFUSE"
:autosize="{ minRows: 3 }"
type="textarea"
/>
</el-form-item>
<el-form-item label="确认人" prop="INSPECTION_ORIGINATOR_SIGN_IMG">
<layout-sign v-model="form.INSPECTION_ORIGINATOR_SIGN_IMG" />
</el-form-item>
</template>
</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 { useVModel } from "@vueuse/core";
import { debounce } from "throttle-debounce";
import { reactive, ref } from "vue";
import LayoutSign from "@/components/sign/index.vue";
import useFormValidate from "@/assets/js/useFormValidate.js";
import { setSafetyEnvironmentalDefense } from "@/request/safety_environmental_management.js";
import { ElMessage } from "element-plus";
import { useRouter } from "vue-router";
const router = useRouter();
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
});
const emits = defineEmits(["update:visible", "get-data"]);
const visible = useVModel(props, "visible", emits);
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const rules = {
INSPECTION_STATUS: [
{ required: true, message: "请选择申辩是否成立", trigger: "change" },
],
INSPECTED_EXPLAIN_REFUSE: [
{ required: true, message: "请输入不成立理由内容", trigger: "blur" },
],
INSPECTION_ORIGINATOR_SIGN_IMG: [
{ required: true, message: "请签字", trigger: "change" },
],
};
const form = reactive({
INSPECTION_STATUS: "3",
INSPECTED_EXPLAIN_REFUSE: "",
INSPECTION_ORIGINATOR_SIGN_IMG: "",
});
const formRef = ref(null);
const fnDownloadFile = (INSPECTION_ID) => {
window.location.href =
import.meta.env[import.meta.env.DEV ? "VITE_PROXY" : "VITE_BASE_URL"] +
"safetyenvironmental/download?INSPECTION_ID=" +
INSPECTION_ID;
};
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = debounce(
1000,
async () => {
await useFormValidate(formRef.value);
if (form.INSPECTION_STATUS === "3") {
await setSafetyEnvironmentalDefense({ ...props.info, ...form.value });
ElMessage.success("申辩处理成功");
fnClose();
emits("get-data");
} else {
await router.push({
path: "/safety_environmental_management/safety_environmental/edit",
query: { INSPECTION_ID: props.info.INSPECTION_ID },
});
}
},
{ atBegin: true }
);
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,79 @@
<template>
<el-dialog v-model="visible" title="流程图" width="80%">
<div style="height: calc(100vh - 200px)">
<RelationGraph ref="relationGraphRef" :options="graphOptions" />
</div>
</el-dialog>
</template>
<script setup>
import { useVModel } from "@vueuse/core";
import RelationGraph from "relation-graph/vue3";
import { ref, watchEffect } from "vue";
import { getSafetyEnvironmentalFlowChart } from "@/request/safety_environmental_management.js";
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);
const relationGraphRef = ref(null);
const graphOptions = ref({
disableDragNode: "false",
layouts: [
{
label: "中心",
layoutName: "tree",
layoutClassName: "seeks-layout-center",
defaultJunctionPoint: "border",
defaultNodeShape: 0,
defaultLineShape: 1,
min_per_width: 300,
max_per_width: 600,
min_per_height: 40,
max_per_height: 60,
from: "left",
},
],
buttonloading: false,
defaultLineMarker: {
markerWidth: 12,
markerHeight: 12,
refX: 6,
refY: 6,
data: "M2,2 L10,6 L2,10 L6,6 L2,2",
},
defaultNodeShape: 1,
defaultLineShape: 2,
defaultJunctionPoint: "lr",
defaultNodeBorderWidth: 0,
backgroundColor: "#08163b",
defaultLineColor: "rgba(0, 186, 189, 1)",
defaultNodeColor: "rgba(0, 206, 209, 1)",
defaultNodeHeight: 150,
defaultNodeWidth: 200,
});
const fnGetData = async () => {
const { nodes, from } = await getSafetyEnvironmentalFlowChart({
INSPECTION_ID: props.id,
});
fnSeeksGraph(nodes, from);
};
const fnSeeksGraph = (nodes, links) => {
relationGraphRef.value.setJsonData({ nodes, links }, () => {});
};
watchEffect(() => {
if (visible.value) fnGetData();
});
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,344 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPaginationTransfer"
>
<el-row>
<el-col :span="4">
<el-form-item label="被检查单位" prop="INSPECTED_DEPARTMENT_ID">
<layout-department v-model="searchForm.INSPECTED_DEPARTMENT_ID" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="检查部门" prop="INSPECTION_DEPARTMENT_ID">
<layout-department
v-model="searchForm.INSPECTION_DEPARTMENT_ID"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="检查发起人" prop="INSPECTION_ORIGINATOR_NAME">
<el-input v-model="searchForm.INSPECTION_ORIGINATOR_NAME" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="检查类型" prop="INSPECTION_TYPE">
<layout-inspection-type v-model="searchForm.INSPECTION_TYPE" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="检查时间" prop="dates">
<el-date-picker
v-model="searchForm.dates"
type="daterange"
value-format="YYYY-MM-DD"
format="YYYY-MM-DD"
range-separator="至"
/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="检查状态" prop="INSPECTION_STATUS">
<el-select v-model="searchForm.INSPECTION_STATUS">
<el-option
v-for="item in stateList"
:key="item.ID"
:label="item.NAME"
:value="item.ID"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="隐患描述" prop="HIDDENDESCR">
<el-input v-model="searchForm.HIDDENDESCR" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="检查题目" prop="INSPECTION_SUBJECT">
<el-select v-model="searchForm.INSPECTION_SUBJECT">
<el-option
v-for="item in inspectionQuestionList"
:key="item.ID"
:label="item.NAME"
:value="item.ID"
/>
</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>
<div class="mtb-10">
{{
INSPECT_NAME_MAP[searchForm.INSPECTION_SUBJECT] || "安全环保总数"
}}
<b>
<i>{{ safetyTotal }}</i>
</b>
<span class="pl-10">
涉及隐患总数
<b>
<i>{{ hiddenTotal }}</i>
</b>
</span>
</div>
<layout-table
:data="list"
@get-data="fnGetDataTransfer"
v-model:pagination="pagination"
ref="tableRef"
row-key="INSPECTION_ID"
>
<el-table-column reserve-selection type="selection" width="55" />
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="INSPECTED_DEPARTMENT_NAMES" label="被检查单位" />
<el-table-column
prop="INSPECTED_SITEUSER_NAME"
label="被检查单位现场负责人"
/>
<el-table-column prop="INSPECTION_DEPARTMENT_NAME" label="检查部门" />
<el-table-column
prop="INSPECTION_ORIGINATOR_NAME"
label="检查发起人"
width="120"
/>
<el-table-column prop="INSPECTION_TYPE_NAME" label="检查类型" />
<el-table-column prop="HIDDEN_COUNT" label="涉及隐患数" width="120" />
<el-table-column label="检查时间" width="270">
<template v-slot="{ row }">
<span>
{{ row.INSPECTION_TIME_START }}
{{ row.INSPECTION_TIME_END }}
</span>
</template>
</el-table-column>
<el-table-column label="状态" width="120">
<template v-slot="{ row }">
{{ translationStatus(row.INSPECTION_STATUS, stateList) }}
</template>
</el-table-column>
<el-table-column prop="INSPECTION_SUBJECT" label="检查题目" />
<el-table-column label="操作" width="270">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
router.push({
path: '/safety_environmental_management/safety_environmental/view',
query: { INSPECTION_ID: row.INSPECTION_ID },
})
"
>
查看
</el-button>
<el-button
type="primary"
text
link
@click="fnFlowChart(row.INSPECTION_ID)"
>
流程图
</el-button>
<el-button
v-if="buttonJurisdiction.edit && row.INSPECTION_STATUS === '-1'"
type="primary"
text
link
@click="
router.push({
path: '/safety_environmental_management/safety_environmental/edit',
query: { INSPECTION_ID: row.INSPECTION_ID },
})
"
>
编辑
</el-button>
<el-button
v-if="
row.INSPECTION_ORIGINATOR_ID === USER_ID &&
row.INSPECTION_STATUS === '-2'
"
type="primary"
text
link
@click="fnDefense(row)"
>
申辩处理
</el-button>
<el-button
v-if="buttonJurisdiction.del && row.INSPECTION_SOURCE !== '4'"
type="primary"
text
link
@click="fnDelete(row.INSPECTION_ID)"
>
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
v-if="buttonJurisdiction.add"
type="primary"
@click="
router.push({
path: '/safety_environmental_management/safety_environmental/add',
})
"
>
新建检查
</el-button>
</template>
</layout-table>
</layout-card>
<flow-chart
v-model:visible="data.flowChartDialog.visible"
:id="data.flowChartDialog.INSPECTION_ID"
/>
<defense
v-model:visible="data.defenseDialog.visible"
:info="data.defenseDialog.info"
@get-data="fnResetPaginationTransfer"
/>
</div>
</template>
<script setup>
import { useRouter } from "vue-router";
import { serialNumber, translationStatus } from "@/assets/js/utils";
import { debounce } from "throttle-debounce";
import { ElMessage, ElMessageBox } from "element-plus";
import useButtonJurisdiction from "@/assets/js/useButtonJurisdiction.js";
import useListData from "@/assets/js/useListData.js";
import LayoutDepartment from "@/components/department/index.vue";
import LayoutInspectionType from "@/components/inspection_type/index.vue";
import {
getSafetyEnvironmentalList,
setSafetyEnvironmentalDelete,
} from "@/request/safety_environmental_management.js";
import { useUserStore } from "@/pinia/user.js";
import { reactive, ref } from "vue";
import FlowChart from "./components/flow_chart.vue";
import Defense from "./components/defense.vue";
const stateList = [
{ ID: "0", NAME: "待检查人核实" },
{ ID: "1", NAME: "检查人核实中" },
{ ID: "2", NAME: "待被检查人确认" },
{ ID: "3", NAME: "待指派整改人" },
{ ID: "4", NAME: "指派中" },
{ ID: "5", NAME: "指派完成" },
{ ID: "6", NAME: "检查待验收" },
{ ID: "7", NAME: "检查已验收" },
{ ID: "8", NAME: "已归档" },
{ ID: "-1", NAME: "检查人核实打回" },
{ ID: "-2", NAME: "被检查人申辩" },
];
const inspectionQuestionList = [
{ ID: "安全", NAME: "安全" },
{ ID: "环保", NAME: "环保" },
{ ID: "综合", NAME: "综合" },
];
const INSPECT_NAME_MAP = {
安全: "安全检查总数",
环保: "环保检查总数",
综合: "安全检查总数",
};
const safetyTotal = ref(0);
const hiddenTotal = ref(0);
const userStore = useUserStore();
const USER_ID = userStore.getUserInfo.USER_ID;
const router = useRouter();
const { list, pagination, searchForm, fnGetData, fnResetPagination, tableRef } =
useListData(getSafetyEnvironmentalList, {
callbackFn: (list, resData) => {
safetyTotal.value = resData.safetyTotal;
hiddenTotal.value = resData.hiddenTotal;
},
});
const data = reactive({
flowChartDialog: {
visible: false,
INSPECTION_ID: "",
},
defenseDialog: {
visible: false,
info: {
INSPECTION_ID: "",
INSPECTED_SITEUSER_SIGN_IMG: "",
INSPECTED_SITEUSER_SIGN_TIME: "",
INSPECTED_EXPLAIN: "",
INSPECTED_EXPLAIN_FILENAME: "",
INSPECTED_EXPLAIN_FILEPATH: "",
},
},
});
const fnGetDataTransfer = () => {
fnGetData({
INSPECTION_TIME_START: searchForm.value.dates?.[0],
INSPECTION_TIME_END: searchForm.value.dates?.[1],
});
};
const fnResetPaginationTransfer = () => {
fnResetPagination({
INSPECTION_TIME_START: searchForm.value.dates?.[0],
INSPECTION_TIME_END: searchForm.value.dates?.[1],
});
};
const buttonJurisdiction = await useButtonJurisdiction("safetyenvironmental");
const fnDelete = debounce(
1000,
async (INSPECTION_ID) => {
await ElMessageBox.confirm("确定要删除吗?", { type: "warning" });
await setSafetyEnvironmentalDelete({ INSPECTION_ID, hide: "1" });
ElMessage.success("删除成功");
fnResetPaginationTransfer();
},
{ atBegin: true }
);
const fnFlowChart = (INSPECTION_ID) => {
data.flowChartDialog.visible = true;
data.flowChartDialog.INSPECTION_ID = INSPECTION_ID;
};
const fnDefense = ({
INSPECTED_SITEUSER_SIGN_IMG,
INSPECTED_SITEUSER_SIGN_TIME,
INSPECTED_EXPLAIN,
INSPECTED_EXPLAIN_FILENAME,
INSPECTED_EXPLAIN_FILEPATH,
INSPECTION_ID,
}) => {
data.defenseDialog.visible = true;
data.defenseDialog.info.INSPECTED_SITEUSER_SIGN_IMG =
INSPECTED_SITEUSER_SIGN_IMG;
data.defenseDialog.info.INSPECTED_SITEUSER_SIGN_TIME =
INSPECTED_SITEUSER_SIGN_TIME;
data.defenseDialog.info.INSPECTED_EXPLAIN = INSPECTED_EXPLAIN;
data.defenseDialog.info.INSPECTED_EXPLAIN_FILENAME =
INSPECTED_EXPLAIN_FILENAME;
data.defenseDialog.info.INSPECTED_EXPLAIN_FILEPATH =
INSPECTED_EXPLAIN_FILEPATH;
data.defenseDialog.info.INSPECTION_ID = INSPECTION_ID;
};
</script>
<style scoped></style>

View File

@ -0,0 +1,7 @@
<template>
<layout-card></layout-card>
</template>
<script setup></script>
<style scoped lang="scss"></style>