forked from integrated_whb/integrated_whb_vue
岗位安全承诺书、责任书,职业危害告知书,管理人员配备,安全生产目标,安全责任制考核模块开发,优化
parent
f570e9dcc6
commit
68a22f3702
|
@ -2,6 +2,8 @@ import { post, upload } from "@/request/axios.js";
|
||||||
export const getSafetyOccupationalHazardsList = (params) =>
|
export const getSafetyOccupationalHazardsList = (params) =>
|
||||||
post("/occupationalhazards/listForSecurityOccupationalHazards", params); // 职业危害告知书列表
|
post("/occupationalhazards/listForSecurityOccupationalHazards", params); // 职业危害告知书列表
|
||||||
|
|
||||||
|
export const getSafetyOccupationalHazardsUserList = (params) =>
|
||||||
|
post("/occupationalhazards/listForSafetyOccupationalHazardsUser", params); // 用户 职业危害告知书列表
|
||||||
export const addOccupationalHazardsView = (params) =>
|
export const addOccupationalHazardsView = (params) =>
|
||||||
upload("/occupationalhazards/add", params); // 添加 职业危害告知书
|
upload("/occupationalhazards/add", params); // 添加 职业危害告知书
|
||||||
|
|
||||||
|
@ -9,3 +11,6 @@ export const editOccupationalHazardsView = (params) =>
|
||||||
upload("/occupationalhazards/edit", params); // 修改 职业危害告知书
|
upload("/occupationalhazards/edit", params); // 修改 职业危害告知书
|
||||||
export const infoOccupationalHazardsView = (params) =>
|
export const infoOccupationalHazardsView = (params) =>
|
||||||
upload("/occupationalhazards/goEdit", params); // 详情 职业危害告知书
|
upload("/occupationalhazards/goEdit", params); // 详情 职业危害告知书
|
||||||
|
|
||||||
|
export const deleteOccupationalHazardsView = (params) =>
|
||||||
|
post("/occupationalhazards/delete", params); // 删除 岗位安全责任书
|
||||||
|
|
|
@ -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); // 详情 安全责任制考核
|
|
@ -2,6 +2,9 @@ import { post, upload } from "@/request/axios.js";
|
||||||
export const getSafetyCommitmentList = (params) =>
|
export const getSafetyCommitmentList = (params) =>
|
||||||
post("/commitment/listForSecurityCommitment", params); // 承诺书列表
|
post("/commitment/listForSecurityCommitment", params); // 承诺书列表
|
||||||
|
|
||||||
|
export const getSafetyCommitmentUserList = (params) =>
|
||||||
|
post("/commitment/listForSecurityCommitmentUser", params); // 用户承诺书列表
|
||||||
|
|
||||||
export const addCommitmentView = (params) => upload("/commitment/add", params); // 添加 承诺书
|
export const addCommitmentView = (params) => upload("/commitment/add", params); // 添加 承诺书
|
||||||
|
|
||||||
export const editCommitmentView = (params) =>
|
export const editCommitmentView = (params) =>
|
||||||
|
@ -9,3 +12,6 @@ export const editCommitmentView = (params) =>
|
||||||
|
|
||||||
export const infoCommitmentView = (params) =>
|
export const infoCommitmentView = (params) =>
|
||||||
upload("/commitment/goEdit", params); // 详情 承诺书
|
upload("/commitment/goEdit", params); // 详情 承诺书
|
||||||
|
|
||||||
|
export const deleteCommitmentView = (params) =>
|
||||||
|
post("/commitment/delete", params); // 删除 承诺书
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { post, upload } from "@/request/axios.js";
|
import { post, upload } from "@/request/axios.js";
|
||||||
export const getSafetyContractList = (params) =>
|
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); // 添加 合同
|
export const addContractView = (params) => upload("/laborcontract/add", params); // 添加 合同
|
||||||
|
|
||||||
|
@ -8,3 +11,6 @@ export const editContractView = (params) =>
|
||||||
upload("/laborcontract/edit", params); // 修改 合同
|
upload("/laborcontract/edit", params); // 修改 合同
|
||||||
export const infoContractView = (params) =>
|
export const infoContractView = (params) =>
|
||||||
upload("/laborcontract/goEdit", params); // 详情 合同
|
upload("/laborcontract/goEdit", params); // 详情 合同
|
||||||
|
|
||||||
|
export const deleteContractView = (params) =>
|
||||||
|
post("/laborcontract/delete", params); // 删除 合同
|
||||||
|
|
|
@ -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); // 详情 安全生产目标
|
|
@ -2,6 +2,8 @@ import { post, upload } from "@/request/axios.js";
|
||||||
export const getSafetyResponsibilityList = (params) =>
|
export const getSafetyResponsibilityList = (params) =>
|
||||||
post("/responsibility/listForSecurityResponsibility", params); // 岗位安全责任书列表
|
post("/responsibility/listForSecurityResponsibility", params); // 岗位安全责任书列表
|
||||||
|
|
||||||
|
export const getSafetyResponsibilityUserList = (params) =>
|
||||||
|
post("/responsibility/listForSafetyResponsibilityUser", params); // 用户岗位安全责任书列表
|
||||||
export const addResponsibilityView = (params) =>
|
export const addResponsibilityView = (params) =>
|
||||||
upload("/responsibility/add", params); // 添加 岗位安全责任书
|
upload("/responsibility/add", params); // 添加 岗位安全责任书
|
||||||
|
|
||||||
|
@ -9,3 +11,6 @@ export const editResponsibilityView = (params) =>
|
||||||
upload("/responsibility/edit", params); // 修改 岗位安全责任书
|
upload("/responsibility/edit", params); // 修改 岗位安全责任书
|
||||||
export const infoResponsibilityView = (params) =>
|
export const infoResponsibilityView = (params) =>
|
||||||
upload("/responsibility/goEdit", params); // 详情 岗位安全责任书
|
upload("/responsibility/goEdit", params); // 详情 岗位安全责任书
|
||||||
|
|
||||||
|
export const deleteResponsibilityView = (params) =>
|
||||||
|
post("/responsibility/delete", params); // 删除 岗位安全责任书
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
import { post, upload } from "@/request/axios.js";
|
import { post, upload } from "@/request/axios.js";
|
||||||
export const getSafetyStaffingList = (params) =>
|
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 editStaffingView = (params) =>
|
||||||
export const infoStaffingView = (params) => upload("/staffing/goEdit", params); // 详情 管理人员配备
|
upload("/managementstaffing/edit", params); // 修改 管理人员配备
|
||||||
|
export const infoStaffingView = (params) =>
|
||||||
|
upload("/managementstaffing/goEdit", params); // 详情 管理人员配备
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.CONTRACTNAME"
|
v-model="form.CONTRACTNAME"
|
||||||
placeholder="请输入合同名称"
|
placeholder="请输入合同名称"
|
||||||
|
style="width: 300px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -26,7 +27,7 @@
|
||||||
:before-upload="fnUpload"
|
:before-upload="fnUpload"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
|
<el-form-item label="到期时间" prop="EXPIRYDATE">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.EXPIRYDATE"
|
v-model="form.EXPIRYDATE"
|
||||||
type="date"
|
type="date"
|
||||||
|
@ -35,11 +36,13 @@
|
||||||
placeholder="选择时间"
|
placeholder="选择时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
|
<el-form-item label="备注" prop="MEETING_CONTENT">
|
||||||
<layout-editor
|
<el-input
|
||||||
v-model="form.MEETING_CONTENT"
|
v-model="form.MEETING_CONTENT"
|
||||||
|
type="textarea"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
style="width: 300px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -54,7 +57,6 @@ import { onMounted, ref, toRaw } from "vue";
|
||||||
import { useVModels } from "@vueuse/core";
|
import { useVModels } from "@vueuse/core";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import LayoutUpload from "@/components/upload/index.vue";
|
import LayoutUpload from "@/components/upload/index.vue";
|
||||||
import LayoutEditor from "@/components/editor/index.vue";
|
|
||||||
import {
|
import {
|
||||||
addContractView,
|
addContractView,
|
||||||
editContractView,
|
editContractView,
|
||||||
|
|
|
@ -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>
|
|
@ -1,38 +1,175 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div v-if="loading">加载中...</div>
|
<layout-table
|
||||||
<div v-else>
|
ref="tableRef"
|
||||||
<layout-pdf
|
v-model:pagination="pagination"
|
||||||
v-model:visible="pdfDialog.visible"
|
:data="list"
|
||||||
:src="pdfDialog.src"
|
@get-data="fnGetData"
|
||||||
append-to-body
|
>
|
||||||
></layout-pdf>
|
<el-table-column label="序号" width="60">
|
||||||
</div>
|
<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>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from "vue";
|
|
||||||
import { useRoute } from "vue-router";
|
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 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 route = useRoute();
|
||||||
const LABORCONTRACT_ID = route.query.LABORCONTRACT_ID;
|
|
||||||
const loading = ref(true); // 用于指示文件是否正在加载
|
|
||||||
const pdfDialog = ref({ visible: false, src: "" });
|
|
||||||
|
|
||||||
onMounted(async () => {
|
const { list, pagination, fnGetData, fnResetPagination } = useListData(
|
||||||
const response = await infoContractView({ LABORCONTRACT_ID });
|
getSafetyContractUserList,
|
||||||
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
|
{
|
||||||
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
|
defaultSearchForm: {
|
||||||
pdfDialog.value.visible = true;
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -76,14 +76,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="
|
@click="fnView(row.LABORCONTRACT_ID)"
|
||||||
router.push({
|
|
||||||
path: '/labor_contract/details',
|
|
||||||
query: {
|
|
||||||
LABORCONTRACT_ID: row.LABORCONTRACT_ID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -91,17 +84,17 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -113,6 +106,11 @@
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPagination"
|
@get-data="fnResetPagination"
|
||||||
/>
|
/>
|
||||||
|
<view-info
|
||||||
|
v-model:visible="data.viewDialog.visible"
|
||||||
|
:info="data.viewDialog.info"
|
||||||
|
:label-name="labelName"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -120,11 +118,14 @@
|
||||||
import { serialNumber } from "@/assets/js/utils";
|
import { serialNumber } from "@/assets/js/utils";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import useListData from "@/assets/js/useListData.js";
|
||||||
import Add from "./components/add.vue";
|
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 router from "@/router/index.js";
|
||||||
|
|
||||||
import { getSafetyContractList } from "@/request/traffic_safety_contract.js";
|
|
||||||
|
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getSafetyContractList);
|
useListData(getSafetyContractList);
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
|
@ -133,6 +134,10 @@ const data = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
form: {},
|
form: {},
|
||||||
},
|
},
|
||||||
|
viewDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
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>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -5,10 +5,11 @@
|
||||||
:before-close="fnClose"
|
:before-close="fnClose"
|
||||||
>
|
>
|
||||||
<el-form ref="formRef" :rules="rules" :model="form" label-width="150px">
|
<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
|
<el-input
|
||||||
v-model="form.SYSTEMNAME"
|
v-model="form.SYSTEMNAME"
|
||||||
placeholder="请输入制度名称"
|
placeholder="请输入名称"
|
||||||
|
style="width: 300px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -25,7 +26,7 @@
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
<!-- <span>{{ operationType }}</span>-->
|
<!-- <span>{{ operationType }}</span>-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="会议文本附件" prop="file">
|
<el-form-item label="附件" prop="file">
|
||||||
<layout-upload
|
<layout-upload
|
||||||
v-model:file-list="form.file"
|
v-model:file-list="form.file"
|
||||||
accept=".pdf"
|
accept=".pdf"
|
||||||
|
@ -33,7 +34,7 @@
|
||||||
:before-upload="fnUpload"
|
:before-upload="fnUpload"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
|
<el-form-item label="到期时间" prop="EXPIRYDATE">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.EXPIRYDATE"
|
v-model="form.EXPIRYDATE"
|
||||||
type="date"
|
type="date"
|
||||||
|
@ -42,15 +43,12 @@
|
||||||
placeholder="选择时间"
|
placeholder="选择时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item label="备注" prop="MEETING_CONTENT">
|
||||||
v-if="type === 'add'"
|
<el-input
|
||||||
label="制度备注"
|
|
||||||
prop="MEETING_CONTENT"
|
|
||||||
>
|
|
||||||
<layout-editor
|
|
||||||
v-model="form.MEETING_CONTENT"
|
v-model="form.MEETING_CONTENT"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
style="width: 300px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -70,7 +68,6 @@ import {
|
||||||
editStaffingView,
|
editStaffingView,
|
||||||
getSafetyStaffingList,
|
getSafetyStaffingList,
|
||||||
} from "@/request/traffic_safety_staffing.js";
|
} from "@/request/traffic_safety_staffing.js";
|
||||||
import LayoutEditor from "@/components/editor/index.vue";
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
visible: {
|
visible: {
|
||||||
|
@ -102,8 +99,8 @@ const props = defineProps({
|
||||||
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
const emits = defineEmits(["update:visible", "update:form", "get-data"]);
|
||||||
const { visible, form } = useVModels(props, emits);
|
const { visible, form } = useVModels(props, emits);
|
||||||
const rules = {
|
const rules = {
|
||||||
file: [{ required: true, message: "请上传会议文本附件", trigger: "change" }],
|
file: [{ required: true, message: "请上传附件", trigger: "change" }],
|
||||||
SYSTEMNAME: [{ required: true, message: "请输入制度名称", trigger: "blur" }],
|
SYSTEMNAME: [{ required: true, message: "请输入名称", trigger: "blur" }],
|
||||||
};
|
};
|
||||||
|
|
||||||
const operatingCompany = ref("");
|
const operatingCompany = ref("");
|
||||||
|
|
|
@ -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>
|
|
@ -76,14 +76,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="
|
@click="fnView(row.STAFFING_ID)"
|
||||||
router.push({
|
|
||||||
path: '/management_staffing/details',
|
|
||||||
query: {
|
|
||||||
STAFFING_ID: row.STAFFING_ID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -110,6 +103,11 @@
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPagination"
|
@get-data="fnResetPagination"
|
||||||
/>
|
/>
|
||||||
|
<view-info
|
||||||
|
v-model:visible="data.viewDialog.visible"
|
||||||
|
:info="data.viewDialog.info"
|
||||||
|
:label-name="labelName"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -118,8 +116,11 @@ import { serialNumber } from "@/assets/js/utils";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import useListData from "@/assets/js/useListData.js";
|
||||||
import Add from "./components/add.vue";
|
import Add from "./components/add.vue";
|
||||||
import { nextTick, reactive } from "vue";
|
import { nextTick, reactive } from "vue";
|
||||||
import router from "@/router/index.js";
|
import {
|
||||||
import { getSafetyStaffingList } from "@/request/traffic_safety_staffing.js";
|
getSafetyStaffingList,
|
||||||
|
infoStaffingView,
|
||||||
|
} from "@/request/traffic_safety_staffing.js";
|
||||||
|
import ViewInfo from "./components/view.vue";
|
||||||
|
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getSafetyStaffingList);
|
useListData(getSafetyStaffingList);
|
||||||
|
@ -129,6 +130,10 @@ const data = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
form: {},
|
form: {},
|
||||||
},
|
},
|
||||||
|
viewDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
|
const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
|
||||||
data.addOrEditDialog.visible = true;
|
data.addOrEditDialog.visible = true;
|
||||||
|
@ -141,6 +146,14 @@ const fnAddOrEdit = async (STAFFING_ID = "", type = "add") => {
|
||||||
|
|
||||||
await nextTick();
|
await nextTick();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const fnView = async (STAFFING_ID) => {
|
||||||
|
const resData = await infoStaffingView({
|
||||||
|
STAFFING_ID,
|
||||||
|
});
|
||||||
|
data.viewDialog.info = resData.pd;
|
||||||
|
data.viewDialog.visible = true;
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.OCCUPATIONALNAME"
|
v-model="form.OCCUPATIONALNAME"
|
||||||
placeholder="请输入职业危害告知书名称"
|
placeholder="请输入职业危害告知书名称"
|
||||||
|
style="width: 300px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -30,7 +31,7 @@
|
||||||
:before-upload="fnUpload"
|
:before-upload="fnUpload"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
|
<el-form-item label="到期时间" prop="EXPIRYDATE">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.EXPIRYDATE"
|
v-model="form.EXPIRYDATE"
|
||||||
type="date"
|
type="date"
|
||||||
|
@ -39,11 +40,13 @@
|
||||||
placeholder="选择时间"
|
placeholder="选择时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
|
<el-form-item label="备注" prop="MEETING_CONTENT">
|
||||||
<layout-editor
|
<el-input
|
||||||
v-model="form.MEETING_CONTENT"
|
v-model="form.MEETING_CONTENT"
|
||||||
|
type="textarea"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
style="width: 300px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -58,7 +61,6 @@ import { onMounted, ref, toRaw } from "vue";
|
||||||
import { useVModels } from "@vueuse/core";
|
import { useVModels } from "@vueuse/core";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import LayoutUpload from "@/components/upload/index.vue";
|
import LayoutUpload from "@/components/upload/index.vue";
|
||||||
import LayoutEditor from "@/components/editor/index.vue";
|
|
||||||
import {
|
import {
|
||||||
addOccupationalHazardsView,
|
addOccupationalHazardsView,
|
||||||
editOccupationalHazardsView,
|
editOccupationalHazardsView,
|
||||||
|
@ -142,8 +144,8 @@ const fnSubmit = async () => {
|
||||||
await addOccupationalHazardsView(formData);
|
await addOccupationalHazardsView(formData);
|
||||||
} else {
|
} else {
|
||||||
formData.append(
|
formData.append(
|
||||||
"SAFETYRESPONSIBILITY_ID",
|
"OCCUPATIONALHAZARDS_ID",
|
||||||
rawFormValue.SAFETYRESPONSIBILITY_ID
|
rawFormValue.OCCUPATIONALHAZARDS_ID
|
||||||
);
|
);
|
||||||
await editOccupationalHazardsView(formData);
|
await editOccupationalHazardsView(formData);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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>
|
|
@ -1,41 +1,177 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div v-if="loading">加载中...</div>
|
<layout-table
|
||||||
<div v-else>
|
ref="tableRef"
|
||||||
<layout-pdf
|
v-model:pagination="pagination"
|
||||||
v-model:visible="pdfDialog.visible"
|
:data="list"
|
||||||
:src="pdfDialog.src"
|
@get-data="fnGetData"
|
||||||
append-to-body
|
>
|
||||||
></layout-pdf>
|
<el-table-column label="序号" width="60">
|
||||||
</div>
|
<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>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from "vue";
|
|
||||||
import { useRoute } from "vue-router";
|
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 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 route = useRoute();
|
||||||
const OCCUPATIONALHAZARDS_ID = route.query.OCCUPATIONALHAZARDS_ID;
|
|
||||||
const loading = ref(true); // 用于指示文件是否正在加载
|
|
||||||
const pdfDialog = ref({ visible: false, src: "" });
|
|
||||||
|
|
||||||
onMounted(async () => {
|
const { list, pagination, fnGetData, fnResetPagination } = useListData(
|
||||||
const response = await infoOccupationalHazardsView({
|
getSafetyOccupationalHazardsUserList,
|
||||||
OCCUPATIONALHAZARDS_ID,
|
{
|
||||||
});
|
defaultSearchForm: {
|
||||||
|
USER_ID: route.query.USER_ID,
|
||||||
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
|
},
|
||||||
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
|
immediate: true,
|
||||||
pdfDialog.value.visible = 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>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -80,14 +80,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="
|
@click="fnView(row.OCCUPATIONALHAZARDS_ID)"
|
||||||
router.push({
|
|
||||||
path: '/occupational_hazards/details',
|
|
||||||
query: {
|
|
||||||
OCCUPATIONALHAZARDS_ID: row.OCCUPATIONALHAZARDS_ID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -95,17 +88,17 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -117,6 +110,11 @@
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPagination"
|
@get-data="fnResetPagination"
|
||||||
/>
|
/>
|
||||||
|
<view-info
|
||||||
|
v-model:visible="data.viewDialog.visible"
|
||||||
|
:info="data.viewDialog.info"
|
||||||
|
:label-name="labelName"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -124,9 +122,13 @@
|
||||||
import { serialNumber } from "@/assets/js/utils";
|
import { serialNumber } from "@/assets/js/utils";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import useListData from "@/assets/js/useListData.js";
|
||||||
import Add from "./components/add.vue";
|
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 router from "@/router/index.js";
|
||||||
import { getSafetyOccupationalHazardsList } from "@/request/traffic_occupational_hazards.js";
|
|
||||||
|
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getSafetyOccupationalHazardsList);
|
useListData(getSafetyOccupationalHazardsList);
|
||||||
|
@ -136,6 +138,10 @@ const data = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
form: {},
|
form: {},
|
||||||
},
|
},
|
||||||
|
viewDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
@ -145,21 +151,14 @@ watchEffect(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const fnAddOrEdit = async (
|
const fnView = async (OCCUPATIONALHAZARDS_ID) => {
|
||||||
OCCUPATIONALHAZARDS_ID = "",
|
const resData = await infoOccupationalHazardsView({
|
||||||
USER_ID = "",
|
OCCUPATIONALHAZARDS_ID,
|
||||||
type = "add"
|
});
|
||||||
) => {
|
if (resData && resData.pd) {
|
||||||
data.addOrEditDialog.visible = true;
|
data.viewDialog.info = resData.pd;
|
||||||
data.addOrEditDialog.type = type;
|
data.viewDialog.visible = true;
|
||||||
data.addOrEditDialog.form = {};
|
|
||||||
if (type === "edit" && OCCUPATIONALHAZARDS_ID) {
|
|
||||||
data.addOrEditDialog.form.OCCUPATIONALHAZARDS_ID = OCCUPATIONALHAZARDS_ID;
|
|
||||||
} else {
|
|
||||||
data.addOrEditDialog.form = { USER_ID };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -8,11 +8,12 @@
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="type === 'add'"
|
v-if="type === 'add'"
|
||||||
label="岗位安全责任书"
|
label="岗位安全责任书"
|
||||||
prop="CONTRACTNAME"
|
prop="RESPONSIBILITYNAME"
|
||||||
>
|
>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.CONTRACTNAME"
|
v-model="form.RESPONSIBILITYNAME"
|
||||||
placeholder="请输入岗位安全责任书"
|
placeholder="请输入岗位安全责任书"
|
||||||
|
style="width: 300px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -30,7 +31,7 @@
|
||||||
:before-upload="fnUpload"
|
:before-upload="fnUpload"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
|
<el-form-item label="到期时间" prop="EXPIRYDATE">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.EXPIRYDATE"
|
v-model="form.EXPIRYDATE"
|
||||||
type="date"
|
type="date"
|
||||||
|
@ -39,11 +40,13 @@
|
||||||
placeholder="选择时间"
|
placeholder="选择时间"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
|
<el-form-item label="备注" prop="MEETING_CONTENT">
|
||||||
<layout-editor
|
<el-input
|
||||||
v-model="form.MEETING_CONTENT"
|
v-model="form.MEETING_CONTENT"
|
||||||
|
type="textarea"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
style="width: 300px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -58,7 +61,6 @@ import { onMounted, ref, toRaw } from "vue";
|
||||||
import { useVModels } from "@vueuse/core";
|
import { useVModels } from "@vueuse/core";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import LayoutUpload from "@/components/upload/index.vue";
|
import LayoutUpload from "@/components/upload/index.vue";
|
||||||
import LayoutEditor from "@/components/editor/index.vue";
|
|
||||||
import {
|
import {
|
||||||
addResponsibilityView,
|
addResponsibilityView,
|
||||||
editResponsibilityView,
|
editResponsibilityView,
|
||||||
|
|
|
@ -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>
|
|
@ -1,38 +1,177 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div v-if="loading">加载中...</div>
|
<layout-table
|
||||||
<div v-else>
|
ref="tableRef"
|
||||||
<layout-pdf
|
v-model:pagination="pagination"
|
||||||
v-model:visible="pdfDialog.visible"
|
:data="list"
|
||||||
:src="pdfDialog.src"
|
@get-data="fnGetData"
|
||||||
append-to-body
|
>
|
||||||
></layout-pdf>
|
<el-table-column label="序号" width="60">
|
||||||
</div>
|
<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>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from "vue";
|
|
||||||
import { useRoute } from "vue-router";
|
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 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 route = useRoute();
|
||||||
const SAFETYRESPONSIBILITY_ID = route.query.SAFETYRESPONSIBILITY_ID;
|
|
||||||
const loading = ref(true); // 用于指示文件是否正在加载
|
|
||||||
const pdfDialog = ref({ visible: false, src: "" });
|
|
||||||
|
|
||||||
onMounted(async () => {
|
const { list, pagination, fnGetData, fnResetPagination } = useListData(
|
||||||
const response = await infoResponsibilityView({ SAFETYRESPONSIBILITY_ID });
|
getSafetyResponsibilityUserList,
|
||||||
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
|
{
|
||||||
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE;
|
defaultSearchForm: {
|
||||||
pdfDialog.value.visible = true;
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -80,14 +80,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="
|
@click="fnView(row.SAFETYRESPONSIBILITY_ID)"
|
||||||
router.push({
|
|
||||||
path: '/safety_responsibility/details',
|
|
||||||
query: {
|
|
||||||
SAFETYRESPONSIBILITY_ID: row.SAFETYRESPONSIBILITY_ID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -95,17 +88,17 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -117,6 +110,11 @@
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPagination"
|
@get-data="fnResetPagination"
|
||||||
/>
|
/>
|
||||||
|
<view-info
|
||||||
|
v-model:visible="data.viewDialog.visible"
|
||||||
|
:info="data.viewDialog.info"
|
||||||
|
:label-name="labelName"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -124,9 +122,13 @@
|
||||||
import { serialNumber } from "@/assets/js/utils";
|
import { serialNumber } from "@/assets/js/utils";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
import useListData from "@/assets/js/useListData.js";
|
||||||
import Add from "./components/add.vue";
|
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 router from "@/router/index.js";
|
||||||
import { getSafetyResponsibilityList } from "@/request/traffic_safety_responsibility.js";
|
|
||||||
|
|
||||||
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getSafetyResponsibilityList);
|
useListData(getSafetyResponsibilityList);
|
||||||
|
@ -136,6 +138,10 @@ const data = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
form: {},
|
form: {},
|
||||||
},
|
},
|
||||||
|
viewDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
@ -145,21 +151,14 @@ watchEffect(() => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const fnAddOrEdit = async (
|
const fnView = async (SAFETYRESPONSIBILITY_ID) => {
|
||||||
SAFETYRESPONSIBILITY_ID = "",
|
const resData = await infoResponsibilityView({
|
||||||
USER_ID = "",
|
SAFETYRESPONSIBILITY_ID,
|
||||||
type = "add"
|
});
|
||||||
) => {
|
if (resData && resData.pd) {
|
||||||
data.addOrEditDialog.visible = true;
|
data.viewDialog.info = resData.pd;
|
||||||
data.addOrEditDialog.type = type;
|
data.viewDialog.visible = true;
|
||||||
data.addOrEditDialog.form = {};
|
|
||||||
if (type === "edit" && SAFETYRESPONSIBILITY_ID) {
|
|
||||||
data.addOrEditDialog.form.SAFETYRESPONSIBILITY_ID = SAFETYRESPONSIBILITY_ID;
|
|
||||||
} else {
|
|
||||||
data.addOrEditDialog.form = { USER_ID };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await nextTick();
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
<el-input
|
<el-input
|
||||||
v-model="form.COMMITMENTNAME"
|
v-model="form.COMMITMENTNAME"
|
||||||
placeholder="请输入承诺书名称"
|
placeholder="请输入承诺书名称"
|
||||||
|
style="width: 300px"
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
|
@ -30,20 +31,23 @@
|
||||||
:before-upload="fnUpload"
|
:before-upload="fnUpload"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="到期时间" prop="EXPIRYDATE">
|
<el-form-item label="到期时间" prop="EXPIRYDATE">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
v-model="form.EXPIRYDATE"
|
v-model="form.EXPIRYDATE"
|
||||||
type="date"
|
type="date"
|
||||||
format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
||||||
value-format="YYYY-MM-DD"
|
value-format="YYYY-MM-DD"
|
||||||
placeholder="选择时间"
|
placeholder="选择时间"
|
||||||
|
style="width: 200px"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="type === 'add'" label="备注" prop="MEETING_CONTENT">
|
<el-form-item label="备注" prop="MEETING_CONTENT">
|
||||||
<layout-editor
|
<el-input
|
||||||
v-model="form.MEETING_CONTENT"
|
v-model="form.MEETING_CONTENT"
|
||||||
|
type="textarea"
|
||||||
placeholder="请输入内容"
|
placeholder="请输入内容"
|
||||||
/>
|
style="width: 300px"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
@ -58,7 +62,6 @@ import { onMounted, ref, toRaw } from "vue";
|
||||||
import { useVModels } from "@vueuse/core";
|
import { useVModels } from "@vueuse/core";
|
||||||
import { ElMessage } from "element-plus";
|
import { ElMessage } from "element-plus";
|
||||||
import LayoutUpload from "@/components/upload/index.vue";
|
import LayoutUpload from "@/components/upload/index.vue";
|
||||||
import LayoutEditor from "@/components/editor/index.vue";
|
|
||||||
import {
|
import {
|
||||||
addCommitmentView,
|
addCommitmentView,
|
||||||
editCommitmentView,
|
editCommitmentView,
|
||||||
|
|
|
@ -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>
|
|
@ -1,38 +1,178 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<layout-card>
|
<layout-card>
|
||||||
<div v-if="loading">加载中...</div>
|
<layout-table
|
||||||
<div v-else>
|
ref="tableRef"
|
||||||
<layout-pdf
|
v-model:pagination="pagination"
|
||||||
v-model:visible="pdfDialog.visible"
|
:data="list"
|
||||||
:src="pdfDialog.src"
|
@get-data="fnGetData"
|
||||||
append-to-body
|
>
|
||||||
></layout-pdf>
|
<el-table-column label="序号" width="60">
|
||||||
</div>
|
<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>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, onMounted } from "vue";
|
|
||||||
import { useRoute } from "vue-router";
|
import { useRoute } from "vue-router";
|
||||||
import LayoutPdf from "@/components/pdf/index.vue"; // 确保已经正确导入LayoutPdf组件
|
import {
|
||||||
import { infoCommitmentView } from "@/request/traffic_safety_commitment.js";
|
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 route = useRoute();
|
||||||
const SECURITYCOMMITMENT_ID = route.query.SECURITYCOMMITMENT_ID;
|
|
||||||
const loading = ref(true); // 用于指示文件是否正在加载
|
|
||||||
const pdfDialog = ref({ visible: false, src: "" }); // 控制PDF预览对话框的显示和PDF源地址
|
|
||||||
|
|
||||||
onMounted(async () => {
|
const { list, pagination, fnGetData, fnResetPagination } = useListData(
|
||||||
const response = await infoCommitmentView({ SECURITYCOMMITMENT_ID });
|
getSafetyCommitmentUserList,
|
||||||
if (response.pd && response.pd.ATTACHMENT_ROUTE) {
|
{
|
||||||
pdfDialog.value.src = VITE_FILE_URL + response.pd.ATTACHMENT_ROUTE; // 设置PDF文件的路径
|
defaultSearchForm: {
|
||||||
pdfDialog.value.visible = true; // 显示PDF预览对话框
|
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>
|
</script>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped></style>
|
||||||
|
|
|
@ -80,14 +80,7 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
link
|
||||||
@click="
|
@click="fnView(row.SECURITYCOMMITMENT_ID)"
|
||||||
router.push({
|
|
||||||
path: '/security_commitment/details',
|
|
||||||
query: {
|
|
||||||
SECURITYCOMMITMENT_ID: row.SECURITYCOMMITMENT_ID,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
"
|
|
||||||
>
|
>
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
|
@ -95,17 +88,17 @@
|
||||||
type="primary"
|
type="primary"
|
||||||
text
|
text
|
||||||
link
|
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>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
@ -117,16 +110,25 @@
|
||||||
:type="data.addOrEditDialog.type"
|
:type="data.addOrEditDialog.type"
|
||||||
@get-data="fnResetPagination"
|
@get-data="fnResetPagination"
|
||||||
/>
|
/>
|
||||||
|
<view-info
|
||||||
|
v-model:visible="data.viewDialog.visible"
|
||||||
|
:info="data.viewDialog.info"
|
||||||
|
:label-name="labelName"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { serialNumber } from "@/assets/js/utils";
|
import { serialNumber } from "@/assets/js/utils";
|
||||||
import useListData from "@/assets/js/useListData.js";
|
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 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 } =
|
const { list, pagination, searchForm, fnGetData, fnResetPagination } =
|
||||||
useListData(getSafetyCommitmentList);
|
useListData(getSafetyCommitmentList);
|
||||||
|
@ -136,6 +138,10 @@ const data = reactive({
|
||||||
type: "",
|
type: "",
|
||||||
form: {},
|
form: {},
|
||||||
},
|
},
|
||||||
|
viewDialog: {
|
||||||
|
visible: false,
|
||||||
|
info: {},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
watchEffect(() => {
|
watchEffect(() => {
|
||||||
|
@ -146,21 +152,12 @@ watchEffect(() => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const fnAddOrEdit = async (
|
const fnView = async (SECURITYCOMMITMENT_ID) => {
|
||||||
SECURITYCOMMITMENT_ID = "",
|
const resData = await infoCommitmentView({ SECURITYCOMMITMENT_ID });
|
||||||
USER_ID = "",
|
if (resData && resData.pd) {
|
||||||
type = "add"
|
data.viewDialog.info = resData.pd;
|
||||||
) => {
|
data.viewDialog.visible = true;
|
||||||
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();
|
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -336,6 +336,7 @@ const fnView = async (BUS_TEXT_LIBRARY_ID) => {
|
||||||
data.viewDialog.info = resData.data;
|
data.viewDialog.info = resData.data;
|
||||||
data.viewDialog.info.TEXT_INFO = info.TEXT_INFO;
|
data.viewDialog.info.TEXT_INFO = info.TEXT_INFO;
|
||||||
data.viewDialog.visible = true;
|
data.viewDialog.visible = true;
|
||||||
|
console.log(data, 7979);
|
||||||
};
|
};
|
||||||
const fnAddOrEdit = async (BUS_TEXT_LIBRARY_ID, type) => {
|
const fnAddOrEdit = async (BUS_TEXT_LIBRARY_ID, type) => {
|
||||||
data.addOrEditDialog.visible = true;
|
data.addOrEditDialog.visible = true;
|
||||||
|
|
|
@ -8,17 +8,6 @@
|
||||||
:label-name="labelName[pathName] + '名称'"
|
:label-name="labelName[pathName] + '名称'"
|
||||||
/>
|
/>
|
||||||
</el-tab-pane>
|
</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>
|
</el-tabs>
|
||||||
</layout-card>
|
</layout-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue