岗位安全承诺书、责任书,职业危害告知书,管理人员配备,安全生产目标,安全责任制考核模块开发,优化

dev
WenShiJun 2024-03-13 18:05:42 +08:00
parent f570e9dcc6
commit 68a22f3702
36 changed files with 2078 additions and 286 deletions

View File

@ -2,6 +2,8 @@ import { post, upload } from "@/request/axios.js";
export const getSafetyOccupationalHazardsList = (params) =>
post("/occupationalhazards/listForSecurityOccupationalHazards", params); // 职业危害告知书列表
export const getSafetyOccupationalHazardsUserList = (params) =>
post("/occupationalhazards/listForSafetyOccupationalHazardsUser", params); // 用户 职业危害告知书列表
export const addOccupationalHazardsView = (params) =>
upload("/occupationalhazards/add", params); // 添加 职业危害告知书
@ -9,3 +11,6 @@ export const editOccupationalHazardsView = (params) =>
upload("/occupationalhazards/edit", params); // 修改 职业危害告知书
export const infoOccupationalHazardsView = (params) =>
upload("/occupationalhazards/goEdit", params); // 详情 职业危害告知书
export const deleteOccupationalHazardsView = (params) =>
post("/occupationalhazards/delete", params); // 删除 岗位安全责任书

View File

@ -0,0 +1,10 @@
import { post, upload } from "@/request/axios.js";
export const getSafetyAssessmentList = (params) =>
post("/assessment/listForSafetyAssessmentlist", params); // 安全责任制考核列表
export const addAssessmentView = (params) => upload("/assessment/add", params); // 添加 安全责任制考核
export const editAssessmentView = (params) =>
upload("/assessment/edit", params); // 修改 安全责任制考核
export const infoAssessmentView = (params) =>
upload("/assessment/goEdit", params); // 详情 安全责任制考核

View File

@ -2,6 +2,9 @@ import { post, upload } from "@/request/axios.js";
export const getSafetyCommitmentList = (params) =>
post("/commitment/listForSecurityCommitment", params); // 承诺书列表
export const getSafetyCommitmentUserList = (params) =>
post("/commitment/listForSecurityCommitmentUser", params); // 用户承诺书列表
export const addCommitmentView = (params) => upload("/commitment/add", params); // 添加 承诺书
export const editCommitmentView = (params) =>
@ -9,3 +12,6 @@ export const editCommitmentView = (params) =>
export const infoCommitmentView = (params) =>
upload("/commitment/goEdit", params); // 详情 承诺书
export const deleteCommitmentView = (params) =>
post("/commitment/delete", params); // 删除 承诺书

View File

@ -1,6 +1,9 @@
import { post, upload } from "@/request/axios.js";
export const getSafetyContractList = (params) =>
post("/laborcontract/listForSecurityStaffing", params); // 合同列表
post("/laborcontract/listForLaborContract", params); // 合同列表
export const getSafetyContractUserList = (params) =>
post("/laborcontract/listForLaborContractUser", params); // 用户合同列表
export const addContractView = (params) => upload("/laborcontract/add", params); // 添加 合同
@ -8,3 +11,6 @@ export const editContractView = (params) =>
upload("/laborcontract/edit", params); // 修改 合同
export const infoContractView = (params) =>
upload("/laborcontract/goEdit", params); // 详情 合同
export const deleteContractView = (params) =>
post("/laborcontract/delete", params); // 删除 合同

View File

@ -0,0 +1,10 @@
import { post, upload } from "@/request/axios.js";
export const getSafetyProductionList = (params) =>
post("/production/listForSafetyProductionlist", params); // 安全生产目标列表
export const addProductionView = (params) => upload("/production/add", params); // 添加 安全生产目标
export const editProductionView = (params) =>
upload("/production/edit", params); // 修改 安全生产目标
export const infoProductionView = (params) =>
upload("/production/goEdit", params); // 详情 安全生产目标

View File

@ -2,6 +2,8 @@ import { post, upload } from "@/request/axios.js";
export const getSafetyResponsibilityList = (params) =>
post("/responsibility/listForSecurityResponsibility", params); // 岗位安全责任书列表
export const getSafetyResponsibilityUserList = (params) =>
post("/responsibility/listForSafetyResponsibilityUser", params); // 用户岗位安全责任书列表
export const addResponsibilityView = (params) =>
upload("/responsibility/add", params); // 添加 岗位安全责任书
@ -9,3 +11,6 @@ export const editResponsibilityView = (params) =>
upload("/responsibility/edit", params); // 修改 岗位安全责任书
export const infoResponsibilityView = (params) =>
upload("/responsibility/goEdit", params); // 详情 岗位安全责任书
export const deleteResponsibilityView = (params) =>
post("/responsibility/delete", params); // 删除 岗位安全责任书

View File

@ -1,8 +1,11 @@
import { post, upload } from "@/request/axios.js";
export const getSafetyStaffingList = (params) =>
post("/staffing/listForSecurityStaffing", params); // 管理人员配备列表
post("/managementstaffing/listForManagementStaffing", params); // 管理人员配备列表
export const addStaffingView = (params) => upload("/staffing/add", params); // 添加 管理人员配备
export const addStaffingView = (params) =>
upload("/managementstaffing/add", params); // 添加 管理人员配备
export const editStaffingView = (params) => upload("/staffing/edit", params); // 修改 管理人员配备
export const infoStaffingView = (params) => upload("/staffing/goEdit", params); // 详情 管理人员配备
export const editStaffingView = (params) =>
upload("/managementstaffing/edit", params); // 修改 管理人员配备
export const infoStaffingView = (params) =>
upload("/managementstaffing/goEdit", params); // 详情 管理人员配备

View File

@ -9,6 +9,7 @@
<el-input
v-model="form.CONTRACTNAME"
placeholder="请输入合同名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
@ -26,7 +27,7 @@
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
@ -35,11 +36,13 @@
placeholder="选择时间"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
<layout-editor
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
type="textarea"
placeholder="请输入内容"
/>
style="width: 300px"
></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -54,7 +57,6 @@ import { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import LayoutEditor from "@/components/editor/index.vue";
import {
addContractView,
editContractView,

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="合同名称">
{{ info.CONTRACTNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -1,38 +1,175 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="NAME" label="姓名" width="100"></el-table-column>
<el-table-column
prop="CORP_NAME"
label="公司名称"
width="150"
></el-table-column>
<el-table-column
prop="CONTRACTNAME"
label="名称"
width="200"
></el-table-column>
<el-table-column
prop="EXPIRYDATE"
label="到期日期"
width="150"
></el-table-column>
<el-table-column
prop="CREATORNAME"
label="上传人"
width="150"
></el-table-column>
<el-table-column
prop="CREATETIME"
label="上传时间"
width="180"
></el-table-column>
<el-table-column label="有效状态" width="180">
<template #default="{ row }">
<div v-if="row.VALIDSTATUS === '1'"></div>
<div v-else-if="row.VALIDSTATUS === '2'">已失效</div>
</template>
</el-table-column>
<el-table-column label="文件" width="300">
<template #default="{ row }">
<div @click="previewPdf(row.ATTACHMENT_ROUTE)">
{{ fileName(row.ATTACHMENT_ROUTE) }}
<el-button type="primary" text link class="ml-10">预览</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="fnAddOrEdit(row.LABORCONTRACT_ID, row.USER_ID, 'edit')"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="deleteItem(row.LABORCONTRACT_ID)"
>
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
type="primary"
@click="fnAddOrEdit('', $route.query.USER_ID, 'add')"
>
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/labor_contract/components/add.vue";
import LayoutPdf from "@/components/pdf/index.vue";
import { infoContractView } from "@/request/traffic_safety_contract.js";
import {
deleteContractView,
getSafetyContractUserList,
} from "@/request/traffic_safety_contract.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const LABORCONTRACT_ID = route.query.LABORCONTRACT_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" });
onMounted(async () => {
const response = await infoContractView({ LABORCONTRACT_ID });
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
pdfDialog.value.visible = true;
const { list, pagination, fnGetData, fnResetPagination } = useListData(
getSafetyContractUserList,
{
defaultSearchForm: {
USER_ID: route.query.USER_ID,
},
immediate: true,
}
loading.value = false; //
);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
function fileName(path) {
return path.split("/").pop();
}
const fnAddOrEdit = async (
LABORCONTRACT_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && LABORCONTRACT_ID) {
data.addOrEditDialog.form.LABORCONTRACT_ID = LABORCONTRACT_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
}
await nextTick();
};
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteContractView({ LABORCONTRACT_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
</script>
<style scoped></style>

View File

@ -76,14 +76,7 @@
type="primary"
text
link
@click="
router.push({
path: '/labor_contract/details',
query: {
LABORCONTRACT_ID: row.LABORCONTRACT_ID,
},
})
"
@click="fnView(row.LABORCONTRACT_ID)"
>
查看
</el-button>
@ -91,17 +84,17 @@
type="primary"
text
link
@click="fnAddOrEdit(row.LABORCONTRACT_ID, '', 'edit')"
@click="
router.push({
path: '/labor_contract/details',
query: {
LABORCONTRACT_ID: row.LABORCONTRACT_ID,
USER_ID: row.USER_ID,
},
})
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="fnAddOrEdit('', row.USER_ID, 'add')"
>
新增
管理
</el-button>
</template>
</el-table-column>
@ -113,6 +106,11 @@
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
@ -120,11 +118,14 @@
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive, watchEffect } from "vue";
import { reactive, watchEffect } from "vue";
import ViewInfo from "./components/view.vue";
import {
getSafetyContractList,
infoContractView,
} from "@/request/traffic_safety_contract.js";
import router from "@/router/index.js";
import { getSafetyContractList } from "@/request/traffic_safety_contract.js";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyContractList);
const data = reactive({
@ -133,6 +134,10 @@ const data = reactive({
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
watchEffect(() => {
@ -142,21 +147,15 @@ watchEffect(() => {
});
}
});
const fnAddOrEdit = async (
LABORCONTRACT_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && LABORCONTRACT_ID) {
data.addOrEditDialog.form.LABORCONTRACT_ID = LABORCONTRACT_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
}
await nextTick();
const fnView = async (LABORCONTRACT_ID) => {
const resData = await infoContractView({
LABORCONTRACT_ID,
});
if (resData && resData.pd) {
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
}
};
</script>

View File

@ -5,10 +5,11 @@
:before-close="fnClose"
>
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
<el-form-item v-if="type === 'add'" label="制度名称" prop="SYSTEMNAME">
<el-form-item v-if="type === 'add'" label="名称" prop="SYSTEMNAME">
<el-input
v-model="form.SYSTEMNAME"
placeholder="请输入制度名称"
placeholder="请输入名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
@ -25,7 +26,7 @@
<!-- >-->
<!-- <span>{{ operationType }}</span>-->
<!-- </el-form-item>-->
<el-form-item label="会议文本附件" prop="file">
<el-form-item label="附件" prop="file">
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
@ -33,7 +34,7 @@
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
@ -42,15 +43,12 @@
placeholder="选择时间"
/>
</el-form-item>
<el-form-item
v-if="type === 'add'"
label="制度备注"
prop="MEETING_CONTENT"
>
<layout-editor
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
placeholder="请输入内容"
/>
style="width: 300px"
></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -70,7 +68,6 @@ import {
editStaffingView,
getSafetyStaffingList,
} from "@/request/traffic_safety_staffing.js";
import LayoutEditor from "@/components/editor/index.vue";
const props = defineProps({
visible: {
@ -102,8 +99,8 @@ const props = defineProps({
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const rules = {
file: [{ required: true, message: "请上传会议文本附件", trigger: "change" }],
SYSTEMNAME: [{ required: true, message: "请输入制度名称", trigger: "blur" }],
file: [{ required: true, message: "请上传附件", trigger: "change" }],
SYSTEMNAME: [{ required: true, message: "请输入名称", trigger: "blur" }],
};
const operatingCompany = ref("");

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="名称">
{{ info.SYSTEMNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -76,14 +76,7 @@
type="primary"
text
link
@click="
router.push({
path: '/management_staffing/details',
query: {
STAFFING_ID: row.STAFFING_ID,
},
})
"
@click="fnView(row.STAFFING_ID)"
>
查看
</el-button>
@ -110,6 +103,11 @@
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
@ -118,8 +116,11 @@ import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
import router from "@/router/index.js";
import { getSafetyStaffingList } from "@/request/traffic_safety_staffing.js";
import {
getSafetyStaffingList,
infoStaffingView,
} from "@/request/traffic_safety_staffing.js";
import ViewInfo from "./components/view.vue";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyStaffingList);
@ -129,6 +130,10 @@ const data = reactive({
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
data.addOrEditDialog.visible = true;
@ -141,6 +146,14 @@ const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
await nextTick();
};
const fnView = async (STAFFING_ID) => {
const resData = await infoStaffingView({
STAFFING_ID,
});
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
};
</script>
<style scoped></style>

View File

@ -13,6 +13,7 @@
<el-input
v-model="form.OCCUPATIONALNAME"
placeholder="请输入职业危害告知书名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
@ -30,7 +31,7 @@
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
@ -39,11 +40,13 @@
placeholder="选择时间"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
<layout-editor
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
type="textarea"
placeholder="请输入内容"
/>
style="width: 300px"
></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -58,7 +61,6 @@ import { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import LayoutEditor from "@/components/editor/index.vue";
import {
addOccupationalHazardsView,
editOccupationalHazardsView,
@ -142,8 +144,8 @@ const fnSubmit = async () => {
await addOccupationalHazardsView(formData);
} else {
formData.append(
"SAFETYRESPONSIBILITY_ID",
rawFormValue.SAFETYRESPONSIBILITY_ID
"OCCUPATIONALHAZARDS_ID",
rawFormValue.OCCUPATIONALHAZARDS_ID
);
await editOccupationalHazardsView(formData);
}

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="告知书名称">
{{ info.OCCUPATIONALNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -1,41 +1,177 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="NAME" label="姓名" width="100"></el-table-column>
<el-table-column
prop="CORP_NAME"
label="公司名称"
width="150"
></el-table-column>
<el-table-column
prop="OCCUPATIONALNAME"
label="名称"
width="200"
></el-table-column>
<el-table-column
prop="EXPIRYDATE"
label="到期日期"
width="150"
></el-table-column>
<el-table-column
prop="CREATORNAME"
label="上传人"
width="150"
></el-table-column>
<el-table-column
prop="CREATETIME"
label="上传时间"
width="180"
></el-table-column>
<el-table-column label="有效状态" width="180">
<template #default="{ row }">
<div v-if="row.VALIDSTATUS === '1'"></div>
<div v-else-if="row.VALIDSTATUS === '2'">已失效</div>
</template>
</el-table-column>
<el-table-column label="文件" width="300">
<template #default="{ row }">
<div @click="previewPdf(row.ATTACHMENT_ROUTE)">
{{ fileName(row.ATTACHMENT_ROUTE) }}
<el-button type="primary" text link class="ml-10">预览</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
fnAddOrEdit(row.OCCUPATIONALHAZARDS_ID, row.USER_ID, 'edit')
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="deleteItem(row.OCCUPATIONALHAZARDS_ID)"
>
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
type="primary"
@click="fnAddOrEdit('', $route.query.USER_ID, 'add')"
>
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import { infoOccupationalHazardsView } from "@/request/traffic_occupational_hazards.js";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/occupational_hazards/components/add.vue";
import LayoutPdf from "@/components/pdf/index.vue";
import {
deleteOccupationalHazardsView,
getSafetyOccupationalHazardsUserList,
} from "@/request/traffic_occupational_hazards.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const OCCUPATIONALHAZARDS_ID = route.query.OCCUPATIONALHAZARDS_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" });
onMounted(async () => {
const response = await infoOccupationalHazardsView({
OCCUPATIONALHAZARDS_ID,
});
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
pdfDialog.value.visible = true;
const { list, pagination, fnGetData, fnResetPagination } = useListData(
getSafetyOccupationalHazardsUserList,
{
defaultSearchForm: {
USER_ID: route.query.USER_ID,
},
immediate: true,
}
loading.value = false; //
);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
function fileName(path) {
return path.split("/").pop();
}
const fnAddOrEdit = async (
OCCUPATIONALHAZARDS_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && OCCUPATIONALHAZARDS_ID) {
data.addOrEditDialog.form.OCCUPATIONALHAZARDS_ID = OCCUPATIONALHAZARDS_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
}
await nextTick();
};
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteOccupationalHazardsView({ OCCUPATIONALHAZARDS_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
</script>
<style scoped></style>

View File

@ -80,14 +80,7 @@
type="primary"
text
link
@click="
router.push({
path: '/occupational_hazards/details',
query: {
OCCUPATIONALHAZARDS_ID: row.OCCUPATIONALHAZARDS_ID,
},
})
"
@click="fnView(row.OCCUPATIONALHAZARDS_ID)"
>
查看
</el-button>
@ -95,17 +88,17 @@
type="primary"
text
link
@click="fnAddOrEdit(row.OCCUPATIONALHAZARDS_ID, '', 'edit')"
@click="
router.push({
path: '/occupational_hazards/details',
query: {
OCCUPATIONALHAZARDS_ID: row.OCCUPATIONALHAZARDS_ID,
USER_ID: row.USER_ID,
},
})
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="fnAddOrEdit('', row.USER_ID, 'add')"
>
新增
管理
</el-button>
</template>
</el-table-column>
@ -117,6 +110,11 @@
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
@ -124,9 +122,13 @@
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive, watchEffect } from "vue";
import { reactive, watchEffect } from "vue";
import {
getSafetyOccupationalHazardsList,
infoOccupationalHazardsView,
} from "@/request/traffic_occupational_hazards.js";
import ViewInfo from "./components/view.vue";
import router from "@/router/index.js";
import { getSafetyOccupationalHazardsList } from "@/request/traffic_occupational_hazards.js";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyOccupationalHazardsList);
@ -136,6 +138,10 @@ const data = reactive({
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
watchEffect(() => {
@ -145,21 +151,14 @@ watchEffect(() => {
});
}
});
const fnAddOrEdit = async (
OCCUPATIONALHAZARDS_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && OCCUPATIONALHAZARDS_ID) {
data.addOrEditDialog.form.OCCUPATIONALHAZARDS_ID = OCCUPATIONALHAZARDS_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
const fnView = async (OCCUPATIONALHAZARDS_ID) => {
const resData = await infoOccupationalHazardsView({
OCCUPATIONALHAZARDS_ID,
});
if (resData && resData.pd) {
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
}
await nextTick();
};
</script>

View File

@ -0,0 +1,155 @@
<template>
<el-dialog
v-model="visible"
:title="type === 'edit' ? '修改' : '新增'"
:before-close="fnClose"
>
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
<el-form-item v-if="type === 'add'" label="名称" prop="SYSTEMNAME">
<el-input
v-model="form.SYSTEMNAME"
placeholder="请输入名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
v-if="type === 'edit'"
label="经营企业"
prop="OPERATINGCOMPANY"
>
<span>{{ operatingCompany }}</span>
</el-form-item>
<el-form-item label="附件" prop="file">
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择时间"
/>
</el-form-item>
</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 { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import {
addAssessmentView,
editAssessmentView,
getSafetyAssessmentList,
} from "@/request/traffic_safety_assessment.js";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: {},
required: false,
default: false,
},
loading: {
type: Boolean,
required: true,
default: false,
},
options: {
type: Array,
required: true,
default: () => [],
},
type: {
type: String,
required: true,
default: "",
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const rules = {
file: [{ required: true, message: "请上传附件", trigger: "change" }],
SYSTEMNAME: [{ required: true, message: "请输入名称", trigger: "blur" }],
};
const operatingCompany = ref("");
const operationType = ref("");
onMounted(async () => {
const resData = await getSafetyAssessmentList();
if (resData && resData.varList && resData.varList.length > 0) {
operatingCompany.value = resData.varList[0].CORP_NAME;
operationType.value = resData.varList[0].OPERATIONTYPE;
}
});
const formRef = ref(null);
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = async () => {
await formRef.value.validate();
const rawFormValue = toRaw(form.value);
const formData = new FormData();
//
if (Array.isArray(rawFormValue.file)) {
rawFormValue.file.forEach((fileItem) => {
if (fileItem.raw) {
formData.append("FFILE", fileItem.raw);
}
});
}
Object.keys(rawFormValue).forEach((key) => {
if (key !== "file") {
formData.append(key, rawFormValue[key]);
}
});
//
if (props.type === "add") {
await addAssessmentView(formData);
} else {
formData.append("SAFETYASSESSMENT_ID", rawFormValue.SAFETYASSESSMENT_ID);
await editAssessmentView(formData);
}
//
ElMessage.success("操作成功");
//
fnClose();
//
emits("get-data");
};
const fnUpload = (file) => {
const isLt100M = file.size / 1024 / 1024 < 100;
if (!isLt100M) {
ElMessage.error("文件大小不能超过100M");
return false;
}
return true;
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="名称">
{{ info.SYSTEMNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,38 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
</div>
</layout-card>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import LayoutPdf from "@/components/pdf/index.vue";
import { infoAssessmentView } from "@/request/traffic_safety_assessment.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const SAFETYASSESSMENT_ID = route.query.SAFETYASSESSMENT_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" });
onMounted(async () => {
const response = await infoAssessmentView({ SAFETYASSESSMENT_ID });
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
pdfDialog.value.visible = true;
}
loading.value = false; //
});
</script>
<style scoped></style>

View File

@ -0,0 +1,158 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="6">
<el-form-item label="制度名称" prop="SYSTEMNAME">
<el-input v-model="searchForm.SYSTEMNAME" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="完成状态" prop="COMPLETIONSTATUS">
<el-select v-model="searchForm.COMPLETIONSTATUS">
<el-option label="已上传" :value="1" />
<el-option label="未上传" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="有效状态" prop="VALIDSTATUS">
<el-select v-model="searchForm.VALIDSTATUS">
<el-option label="正常" :value="1" />
<el-option label="未生效" :value="0" />
</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>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
row-key="SAFETYASSESSMENT_ID"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="SYSTEMNAME" label="制度名称" width="250" />
<el-table-column prop="COMPLETIONSTATUS" label="完成状态" width="250">
<template #default="{ row }">
<el-tag v-if="row.COMPLETIONSTATUS === '1'"></el-tag>
<el-tag v-else-if="row.COMPLETIONSTATUS === '0'">未上传</el-tag>
</template>
</el-table-column>
<el-table-column label="有效状态" prop="VALIDSTATUS">
<template #default="{ row }">
<el-tag v-if="row.VALIDSTATUS === '1'"></el-tag>
<el-tag v-else-if="row.VALIDSTATUS === '0'">未生效</el-tag>
</template>
</el-table-column>
<el-table-column prop="CORP_NAME" label="经营企业" width="150" />
<el-table-column prop="EXPIRYDATE" label="到期时间" width="150" />
<el-table-column prop="CREATETIME" label="创建时间" width="150" />
<el-table-column prop="OPERATTIME" label="修改时间" width="150" />
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="fnView(row.SAFETYASSESSMENT_ID)"
>
查看
</el-button>
<el-button
type="primary"
text
link
@click="fnAddOrEdit(row.SAFETYASSESSMENT_ID, 'edit')"
>
编辑
</el-button>
</template>
</el-table-column>
<template #button>
<el-button type="primary" @click="fnAddOrEdit('', 'add')">
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
import {
getSafetyAssessmentList,
infoAssessmentView,
} from "@/request/traffic_safety_assessment.js";
import ViewInfo from "./components/view.vue";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyAssessmentList);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const fnAddOrEdit = async (SAFETYASSESSMENT_ID = "", type = "add") => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
if (type === "edit" && SAFETYASSESSMENT_ID) {
data.addOrEditDialog.form.SAFETYASSESSMENT_ID = SAFETYASSESSMENT_ID;
} else {
data.addOrEditDialog.form = {};
}
await nextTick();
};
const fnView = async (SAFETYASSESSMENT_ID) => {
const resData = await infoAssessmentView({
SAFETYASSESSMENT_ID,
});
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
};
</script>
<style scoped></style>

View File

@ -0,0 +1,155 @@
<template>
<el-dialog
v-model="visible"
:title="type === 'edit' ? '修改' : '新增'"
:before-close="fnClose"
>
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
<el-form-item v-if="type === 'add'" label="名称" prop="SYSTEMNAME">
<el-input
v-model="form.SYSTEMNAME"
placeholder="请输入名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
v-if="type === 'edit'"
label="经营企业"
prop="OPERATINGCOMPANY"
>
<span>{{ operatingCompany }}</span>
</el-form-item>
<el-form-item label="会议附件" prop="file">
<layout-upload
v-model:file-list="form.file"
accept=".pdf"
:limit="9"
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择时间"
/>
</el-form-item>
</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 { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import {
addProductionView,
editProductionView,
getSafetyProductionList,
} from "@/request/traffic_safety_production.js";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
form: {
type: {},
required: false,
default: false,
},
loading: {
type: Boolean,
required: true,
default: false,
},
options: {
type: Array,
required: true,
default: () => [],
},
type: {
type: String,
required: true,
default: "",
},
});
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
const { visible, form } = useVModels(props, emits);
const rules = {
file: [{ required: true, message: "请上传附件", trigger: "change" }],
SYSTEMNAME: [{ required: true, message: "请输入名称", trigger: "blur" }],
};
const operatingCompany = ref("");
const operationType = ref("");
onMounted(async () => {
const resData = await getSafetyProductionList();
if (resData && resData.varList && resData.varList.length > 0) {
operatingCompany.value = resData.varList[0].CORP_NAME;
operationType.value = resData.varList[0].OPERATIONTYPE;
}
});
const formRef = ref(null);
const fnClose = () => {
formRef.value.resetFields();
visible.value = false;
};
const fnSubmit = async () => {
await formRef.value.validate();
const rawFormValue = toRaw(form.value);
const formData = new FormData();
//
if (Array.isArray(rawFormValue.file)) {
rawFormValue.file.forEach((fileItem) => {
if (fileItem.raw) {
formData.append("FFILE", fileItem.raw);
}
});
}
Object.keys(rawFormValue).forEach((key) => {
if (key !== "file") {
formData.append(key, rawFormValue[key]);
}
});
//
if (props.type === "add") {
await addProductionView(formData);
} else {
formData.append("SAFETYPRODUCTION_ID", rawFormValue.SAFETYPRODUCTION_ID);
await editProductionView(formData);
}
//
ElMessage.success("操作成功");
//
fnClose();
//
emits("get-data");
};
const fnUpload = (file) => {
const isLt100M = file.size / 1024 / 1024 < 100;
if (!isLt100M) {
ElMessage.error("文件大小不能超过100M");
return false;
}
return true;
};
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="名称">
{{ info.SYSTEMNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -0,0 +1,38 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
</div>
</layout-card>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import LayoutPdf from "@/components/pdf/index.vue";
import { infoProductionView } from "@/request/traffic_safety_production.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const SAFETYPRODUCTION_ID = route.query.SAFETYPRODUCTION_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" });
onMounted(async () => {
const response = await infoProductionView({ SAFETYPRODUCTION_ID });
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
pdfDialog.value.visible = true;
}
loading.value = false; //
});
</script>
<style scoped></style>

View File

@ -0,0 +1,158 @@
<template>
<div>
<el-card>
<el-form
:model="searchForm"
label-width="100px"
@submit.prevent="fnResetPagination"
>
<el-row>
<el-col :span="6">
<el-form-item label="制度名称" prop="SYSTEMNAME">
<el-input v-model="searchForm.SYSTEMNAME" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="完成状态" prop="COMPLETIONSTATUS">
<el-select v-model="searchForm.COMPLETIONSTATUS">
<el-option label="已上传" :value="1" />
<el-option label="未上传" :value="0" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="有效状态" prop="VALIDSTATUS">
<el-select v-model="searchForm.VALIDSTATUS">
<el-option label="正常" :value="1" />
<el-option label="未生效" :value="0" />
</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>
</el-card>
<layout-card>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
row-key="SAFETYPRODUCTION_ID"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="SYSTEMNAME" label="名称" width="250" />
<el-table-column prop="COMPLETIONSTATUS" label="完成状态" width="250">
<template #default="{ row }">
<el-tag v-if="row.COMPLETIONSTATUS === '1'"></el-tag>
<el-tag v-else-if="row.COMPLETIONSTATUS === '0'">未上传</el-tag>
</template>
</el-table-column>
<el-table-column label="有效状态" prop="VALIDSTATUS">
<template #default="{ row }">
<el-tag v-if="row.VALIDSTATUS === '1'"></el-tag>
<el-tag v-else-if="row.VALIDSTATUS === '0'">未生效</el-tag>
</template>
</el-table-column>
<el-table-column prop="CORP_NAME" label="经营企业" width="150" />
<el-table-column prop="EXPIRYDATE" label="到期时间" width="150" />
<el-table-column prop="CREATETIME" label="创建时间" width="150" />
<el-table-column prop="OPERATTIME" label="修改时间" width="150" />
<el-table-column label="操作" width="180">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="fnView(row.SAFETYPRODUCTION_ID)"
>
查看
</el-button>
<el-button
type="primary"
text
link
@click="fnAddOrEdit(row.SAFETYPRODUCTION_ID, 'edit')"
>
编辑
</el-button>
</template>
</el-table-column>
<template #button>
<el-button type="primary" @click="fnAddOrEdit('', 'add')">
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive } from "vue";
import {
getSafetyProductionList,
infoProductionView,
} from "@/request/traffic_safety_production.js";
import ViewInfo from "./components/view.vue";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyProductionList);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const fnAddOrEdit = async (SAFETYPRODUCTION_ID = "", type = "add") => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
if (type === "edit" && SAFETYPRODUCTION_ID) {
data.addOrEditDialog.form.SAFETYPRODUCTION_ID = SAFETYPRODUCTION_ID;
} else {
data.addOrEditDialog.form = {};
}
await nextTick();
};
const fnView = async (SAFETYPRODUCTION_ID) => {
const resData = await infoProductionView({
SAFETYPRODUCTION_ID,
});
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
};
</script>
<style scoped></style>

View File

@ -8,11 +8,12 @@
<el-form-item
v-if="type === 'add'"
label="岗位安全责任书"
prop="CONTRACTNAME"
prop="RESPONSIBILITYNAME"
>
<el-input
v-model="form.CONTRACTNAME"
v-model="form.RESPONSIBILITYNAME"
placeholder="请输入岗位安全责任书"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
@ -30,7 +31,7 @@
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
@ -39,11 +40,13 @@
placeholder="选择时间"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
<layout-editor
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
type="textarea"
placeholder="请输入内容"
/>
style="width: 300px"
></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -58,7 +61,6 @@ import { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import LayoutEditor from "@/components/editor/index.vue";
import {
addResponsibilityView,
editResponsibilityView,

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="责任书名称">
{{ info.RESPONSIBILITYNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -1,38 +1,177 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="NAME" label="姓名" width="100"></el-table-column>
<el-table-column
prop="CORP_NAME"
label="公司名称"
width="150"
></el-table-column>
<el-table-column
prop="RESPONSIBILITYNAME"
label="名称"
width="200"
></el-table-column>
<el-table-column
prop="EXPIRYDATE"
label="到期日期"
width="150"
></el-table-column>
<el-table-column
prop="CREATORNAME"
label="上传人"
width="150"
></el-table-column>
<el-table-column
prop="CREATETIME"
label="上传时间"
width="180"
></el-table-column>
<el-table-column label="有效状态" width="180">
<template #default="{ row }">
<div v-if="row.VALIDSTATUS === '1'"></div>
<div v-else-if="row.VALIDSTATUS === '2'">已失效</div>
</template>
</el-table-column>
<el-table-column label="文件" width="300">
<template #default="{ row }">
<div @click="previewPdf(row.ATTACHMENT_ROUTE)">
{{ fileName(row.ATTACHMENT_ROUTE) }}
<el-button type="primary" text link class="ml-10">预览</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
fnAddOrEdit(row.SAFETYRESPONSIBILITY_ID, row.USER_ID, 'edit')
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="deleteItem(row.SAFETYRESPONSIBILITY_ID)"
>
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
type="primary"
@click="fnAddOrEdit('', $route.query.USER_ID, 'add')"
>
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/safety_responsibility/components/add.vue";
import LayoutPdf from "@/components/pdf/index.vue";
import { infoResponsibilityView } from "@/request/traffic_safety_responsibility.js";
import {
deleteResponsibilityView,
getSafetyResponsibilityUserList,
} from "@/request/traffic_safety_responsibility.js";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const SAFETYRESPONSIBILITY_ID = route.query.SAFETYRESPONSIBILITY_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" });
onMounted(async () => {
const response = await infoResponsibilityView({ SAFETYRESPONSIBILITY_ID });
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
pdfDialog.value.visible = true;
const { list, pagination, fnGetData, fnResetPagination } = useListData(
getSafetyResponsibilityUserList,
{
defaultSearchForm: {
USER_ID: route.query.USER_ID,
},
immediate: true,
}
loading.value = false; //
);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
function fileName(path) {
return path.split("/").pop();
}
const fnAddOrEdit = async (
SAFETYRESPONSIBILITY_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && SAFETYRESPONSIBILITY_ID) {
data.addOrEditDialog.form.SAFETYRESPONSIBILITY_ID = SAFETYRESPONSIBILITY_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
}
await nextTick();
};
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteResponsibilityView({ SAFETYRESPONSIBILITY_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
</script>
<style scoped></style>

View File

@ -80,14 +80,7 @@
type="primary"
text
link
@click="
router.push({
path: '/safety_responsibility/details',
query: {
SAFETYRESPONSIBILITY_ID: row.SAFETYRESPONSIBILITY_ID,
},
})
"
@click="fnView(row.SAFETYRESPONSIBILITY_ID)"
>
查看
</el-button>
@ -95,17 +88,17 @@
type="primary"
text
link
@click="fnAddOrEdit(row.SAFETYRESPONSIBILITY_ID, '', 'edit')"
@click="
router.push({
path: '/safety_responsibility/details',
query: {
SAFETYRESPONSIBILITY_ID: row.SAFETYRESPONSIBILITY_ID,
USER_ID: row.USER_ID,
},
})
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="fnAddOrEdit('', row.USER_ID, 'add')"
>
新增
管理
</el-button>
</template>
</el-table-column>
@ -117,6 +110,11 @@
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
@ -124,9 +122,13 @@
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive, watchEffect } from "vue";
import { reactive, watchEffect } from "vue";
import {
getSafetyResponsibilityList,
infoResponsibilityView,
} from "@/request/traffic_safety_responsibility.js";
import ViewInfo from "./components/view.vue";
import router from "@/router/index.js";
import { getSafetyResponsibilityList } from "@/request/traffic_safety_responsibility.js";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyResponsibilityList);
@ -136,6 +138,10 @@ const data = reactive({
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
watchEffect(() => {
@ -145,21 +151,14 @@ watchEffect(() => {
});
}
});
const fnAddOrEdit = async (
SAFETYRESPONSIBILITY_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && SAFETYRESPONSIBILITY_ID) {
data.addOrEditDialog.form.SAFETYRESPONSIBILITY_ID = SAFETYRESPONSIBILITY_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
const fnView = async (SAFETYRESPONSIBILITY_ID) => {
const resData = await infoResponsibilityView({
SAFETYRESPONSIBILITY_ID,
});
if (resData && resData.pd) {
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
}
await nextTick();
};
</script>

View File

@ -13,6 +13,7 @@
<el-input
v-model="form.COMMITMENTNAME"
placeholder="请输入承诺书名称"
style="width: 300px"
></el-input>
</el-form-item>
<el-form-item
@ -30,20 +31,23 @@
:before-upload="fnUpload"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
<el-form-item label="到期时间" prop="EXPIRYDATE">
<el-date-picker
v-model="form.EXPIRYDATE"
type="date"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
placeholder="选择时间"
style="width: 200px"
/>
</el-form-item>
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
<layout-editor
<el-form-item label="备注" prop="MEETING_CONTENT">
<el-input
v-model="form.MEETING_CONTENT"
type="textarea"
placeholder="请输入内容"
/>
style="width: 300px"
></el-input>
</el-form-item>
</el-form>
<template #footer>
@ -58,7 +62,6 @@ import { onMounted, ref, toRaw } from "vue";
import { useVModels } from "@vueuse/core";
import { ElMessage } from "element-plus";
import LayoutUpload from "@/components/upload/index.vue";
import LayoutEditor from "@/components/editor/index.vue";
import {
addCommitmentView,
editCommitmentView,

View File

@ -0,0 +1,70 @@
<template>
<el-dialog v-model="visible" title="查看">
<el-descriptions :column="1" border>
<el-descriptions-item label="承诺书名称">
{{ info.COMMITMENTNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传人">
{{ info.CREATORNAME }}
</el-descriptions-item>
<el-descriptions-item label="上传时间">
{{ info.CREATETIME }}
</el-descriptions-item>
<el-descriptions-item label="文件">
<div @click="previewPdf(info.ATTACHMENT_ROUTE)">
{{ getFileName(info.ATTACHMENT_ROUTE) }}
<el-button type="primary" class="ml-10">预览</el-button>
</div>
</el-descriptions-item>
</el-descriptions>
<template #footer>
<el-button @click="visible = false">关闭</el-button>
</template>
</el-dialog>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</template>
<script setup>
import { ref } from "vue"; // ref
import { useVModel } from "@vueuse/core";
import LayoutPdf from "@/components/pdf/index.vue";
const props = defineProps({
visible: {
type: Boolean,
required: true,
default: false,
},
info: {
type: Object,
required: true,
default: () => ({}),
},
labelName: {
type: String,
required: true,
default: "",
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
const getFileName = (path) => {
return path.split("/").pop();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>
<style scoped lang="scss"></style>

View File

@ -1,38 +1,178 @@
<template>
<div>
<layout-card>
<div v-if="loading">...</div>
<div v-else>
<layout-pdf
v-model:visible="pdfDialog.visible"
:src="pdfDialog.src"
append-to-body
></layout-pdf>
<layout-table
ref="tableRef"
v-model:pagination="pagination"
:data="list"
@get-data="fnGetData"
>
<el-table-column label="序号" width="60">
<template #default="{ $index }">
{{ serialNumber(pagination, $index) }}
</template>
</el-table-column>
<el-table-column prop="NAME" label="姓名" width="100"></el-table-column>
<el-table-column
prop="CORP_NAME"
label="公司名称"
width="150"
></el-table-column>
<el-table-column
prop="COMMITMENTNAME"
label="名称"
width="200"
></el-table-column>
<el-table-column
prop="EXPIRYDATE"
label="到期日期"
width="150"
></el-table-column>
<el-table-column
prop="CREATORNAME"
label="上传人"
width="150"
></el-table-column>
<el-table-column
prop="CREATETIME"
label="上传时间"
width="180"
></el-table-column>
<el-table-column label="有效状态" width="180">
<template #default="{ row }">
<div v-if="row.VALIDSTATUS === '1'"></div>
<div v-else-if="row.VALIDSTATUS === '2'">已失效</div>
</template>
</el-table-column>
<el-table-column label="文件" width="300">
<template #default="{ row }">
<div @click="previewPdf(row.ATTACHMENT_ROUTE)">
{{ fileName(row.ATTACHMENT_ROUTE) }}
<el-button type="primary" text link class="ml-10">预览</el-button>
</div>
</template>
</el-table-column>
<el-table-column label="操作" width="150">
<template #default="{ row }">
<el-button
type="primary"
text
link
@click="
fnAddOrEdit(row.SECURITYCOMMITMENT_ID, row.USER_ID, 'edit')
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="deleteItem(row.SECURITYCOMMITMENT_ID)"
>
删除
</el-button>
</template>
</el-table-column>
<template #button>
<el-button
type="primary"
@click="fnAddOrEdit('', $route.query.USER_ID, 'add')"
>
新增
</el-button>
</template>
</layout-table>
</layout-card>
<add
v-model:visible="data.addOrEditDialog.visible"
v-model:form="data.addOrEditDialog.form"
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<layout-pdf
v-if="pdfVisible"
:src="pdfSrc"
:visible="pdfVisible"
@update:visible="pdfVisible = $event"
></layout-pdf>
</div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";
import LayoutPdf from "@/components/pdf/index.vue"; // LayoutPdf
import { infoCommitmentView } from "@/request/traffic_safety_commitment.js";
import {
deleteCommitmentView,
getSafetyCommitmentUserList,
} from "@/request/traffic_safety_commitment.js";
import useListData from "@/assets/js/useListData.js";
import { serialNumber } from "@/assets/js/utils.js";
import { ElMessage, ElMessageBox } from "element-plus";
import { nextTick, reactive, ref } from "vue";
import Add from "@/views/security_commitment/components/add.vue";
import LayoutPdf from "@/components/pdf/index.vue";
const VITE_FILE_URL = import.meta.env.VITE_FILE_URL;
const route = useRoute();
const SECURITYCOMMITMENT_ID = route.query.SECURITYCOMMITMENT_ID;
const loading = ref(true); //
const pdfDialog = ref({ visible: false, src: "" }); // PDFPDF
onMounted(async () => {
const response = await infoCommitmentView({ SECURITYCOMMITMENT_ID });
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE; // PDF
pdfDialog.value.visible = true; // PDF
const { list, pagination, fnGetData, fnResetPagination } = useListData(
getSafetyCommitmentUserList,
{
defaultSearchForm: {
SECURITYCOMMITMENT_ID: route.query.SECURITYCOMMITMENT_ID,
USER_ID: route.query.USER_ID,
},
immediate: true,
}
loading.value = false; //
);
const data = reactive({
addOrEditDialog: {
visible: false,
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
const pdfVisible = ref(false); // pdfVisible
const pdfSrc = ref(""); // pdfSrc
function fileName(path) {
return path.split("/").pop();
}
const fnAddOrEdit = async (
SECURITYCOMMITMENT_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && SECURITYCOMMITMENT_ID) {
data.addOrEditDialog.form.SECURITYCOMMITMENT_ID = SECURITYCOMMITMENT_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
}
await nextTick();
};
//
const deleteItem = async (value) => {
await ElMessageBox.confirm(`确定要删除吗?`, {
type: "warning",
});
await deleteCommitmentView({ SECURITYCOMMITMENT_ID: value });
ElMessage.success("删除成功");
fnGetData();
};
const previewPdf = (src) => {
pdfSrc.value = src; // PDF
pdfVisible.value = true; // PDF
};
</script>
<style scoped></style>

View File

@ -80,14 +80,7 @@
type="primary"
text
link
@click="
router.push({
path: '/security_commitment/details',
query: {
SECURITYCOMMITMENT_ID: row.SECURITYCOMMITMENT_ID,
},
})
"
@click="fnView(row.SECURITYCOMMITMENT_ID)"
>
查看
</el-button>
@ -95,17 +88,17 @@
type="primary"
text
link
@click="fnAddOrEdit(row.SECURITYCOMMITMENT_ID, '', 'edit')"
@click="
router.push({
path: '/security_commitment/details',
query: {
SECURITYCOMMITMENT_ID: row.SECURITYCOMMITMENT_ID,
USER_ID: row.USER_ID,
},
})
"
>
编辑
</el-button>
<el-button
text
link
type="primary"
@click="fnAddOrEdit('', row.USER_ID, 'add')"
>
新增
管理
</el-button>
</template>
</el-table-column>
@ -117,16 +110,25 @@
:type="data.addOrEditDialog.type"
@get-data="fnResetPagination"
/>
<view-info
v-model:visible="data.viewDialog.visible"
:info="data.viewDialog.info"
:label-name="labelName"
/>
</div>
</template>
<script setup>
import { serialNumber } from "@/assets/js/utils";
import useListData from "@/assets/js/useListData.js";
import Add from "./components/add.vue";
import { nextTick, reactive, watchEffect } from "vue";
import router from "@/router/index.js";
import { getSafetyCommitmentList } from "@/request/traffic_safety_commitment.js";
import Add from "./components/add.vue";
import { reactive, watchEffect } from "vue";
import {
getSafetyCommitmentList,
infoCommitmentView,
} from "@/request/traffic_safety_commitment.js";
import ViewInfo from "./components/view.vue";
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
useListData(getSafetyCommitmentList);
@ -136,6 +138,10 @@ const data = reactive({
type: "",
form: {},
},
viewDialog: {
visible: false,
info: {},
},
});
watchEffect(() => {
@ -146,21 +152,12 @@ watchEffect(() => {
}
});
const fnAddOrEdit = async (
SECURITYCOMMITMENT_ID = "",
USER_ID = "",
type = "add"
) => {
data.addOrEditDialog.visible = true;
data.addOrEditDialog.type = type;
data.addOrEditDialog.form = {};
if (type === "edit" && SECURITYCOMMITMENT_ID) {
data.addOrEditDialog.form.SECURITYCOMMITMENT_ID = SECURITYCOMMITMENT_ID;
} else {
data.addOrEditDialog.form = { USER_ID };
const fnView = async (SECURITYCOMMITMENT_ID) => {
const resData = await infoCommitmentView({ SECURITYCOMMITMENT_ID });
if (resData && resData.pd) {
data.viewDialog.info = resData.pd;
data.viewDialog.visible = true;
}
await nextTick();
};
</script>

View File

@ -336,6 +336,7 @@ const fnView = async (BUS_TEXT_LIBRARY_ID) => {
data.viewDialog.info = resData.data;
data.viewDialog.info.TEXT_INFO = info.TEXT_INFO;
data.viewDialog.visible = true;
console.log(data, 7979);
};
const fnAddOrEdit = async (BUS_TEXT_LIBRARY_ID, type) => {
data.addOrEditDialog.visible = true;

View File

@ -8,17 +8,6 @@
:label-name="labelName[pathName] + '名称'"
/>
</el-tab-pane>
<el-tab-pane
:label="labelName[pathName] + '平台资源库'"
name="platform_resource_library"
lazy
>
<list-view
tab-name="platform_resource_library"
:path-name="pathName"
:label-name="labelName[pathName] + '名称'"
/>
</el-tab-pane>
</el-tabs>
</layout-card>
</template>