安全例会打印

pull/1/head
dearlin 2024-02-20 11:10:49 +08:00
parent 4a84899838
commit de4b84b501
2 changed files with 130 additions and 97 deletions

View File

@ -150,7 +150,10 @@ import LayoutUpload from "@/components/upload/index.vue";
import LayoutDepartment from "@/components/department/index.vue"; import LayoutDepartment from "@/components/department/index.vue";
import { getPostListAll, getUserListAll } from "@/request/data_dictionary.js"; import { getPostListAll, getUserListAll } from "@/request/data_dictionary.js";
import { addingPrefixToFile, verifyDuplicateSelection } from "@/assets/js/utils.js"; import {
addingPrefixToFile,
verifyDuplicateSelection,
} from "@/assets/js/utils.js";
import { debounce } from "throttle-debounce"; import { debounce } from "throttle-debounce";
import { useRoute, useRouter } from "vue-router"; import { useRoute, useRouter } from "vue-router";
import useFormValidate from "@/assets/js/useFormValidate.js"; import useFormValidate from "@/assets/js/useFormValidate.js";
@ -177,7 +180,6 @@ const data = reactive({
people: [], people: [],
file: [], file: [],
}, },
selectTemplateDialogVisible: false,
}); });
const fnAddPeople = () => { const fnAddPeople = () => {
data.form.people.push({ data.form.people.push({

View File

@ -1,117 +1,148 @@
<template> <template>
<layout-card> <layout-card>
<el-divider content-position="left">基本信息</el-divider> <div id="printContent">
<el-descriptions :column="2" border> <el-divider content-position="left">安全例会</el-divider>
<el-descriptions-item label="承诺书名称"> <el-descriptions border :column="2">
{{ info.PROMISE_NAME }} <el-descriptions-item class="my-content" label="安全例会标题"
>{{ data.form.SAFETY_MEETING_TITLE }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="级别"> <el-descriptions-item label="安全例会内容"
{{ info.LEVELNAME }} >{{ data.form.SAFETY_MEETING_CONTENT }}
</el-descriptions-item>
<el-descriptions-item label="适用期限开始">
{{ info.PROMISE_TERM_START }}
</el-descriptions-item>
<el-descriptions-item label="适用期限结束">
{{ info.PROMISE_TERM_END }}
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-divider content-position="left">涉及人</el-divider> <el-divider content-position="left">涉及人</el-divider>
<el-descriptions :column="3" border> <div class="print_no_use">
<template v-for="(item, index) in info.coverpeople" :key="item.id"> <layout-table :data="data.form.people" :show-pagination="false">
<el-descriptions-item :label="'部门' + (index + 1)"> <el-table-column label="序号" type="index" />
{{ item.DEPTNAME }} <el-table-column prop="DEPARTMENT_NAME" label="部门" />
<el-table-column prop="POST_NAME" label="岗位" />
<el-table-column prop="NAME" label="姓名" />
</layout-table>
</div>
<table class="print_use">
<thead>
<tr>
<th width="55">序号</th>
<th>部门</th>
<th>岗位</th>
<th>姓名</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in data.form.people" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item.DEPARTMENT_NAME }}</td>
<td>{{ item.POST_NAME }}</td>
<td>{{ item.NAME }}</td>
</tr>
</tbody>
</table>
<el-divider content-position="left">附件</el-divider>
<el-descriptions>
<el-descriptions-item>
<img
v-for="(item, index) in data.form.file"
:key="index"
:src="item.url"
style="width: 200px; height: 200px"
/>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item :label="'岗位' + (index + 1)">
{{ item.POSTNAME }}
</el-descriptions-item>
<el-descriptions-item :label="'人员' + (index + 1)">
{{ item.USERNAME?.join("、") }}
</el-descriptions-item>
</template>
</el-descriptions> </el-descriptions>
<el-divider content-position="left">承诺内容</el-divider> <el-divider content-position="left">反馈情况</el-divider>
<el-descriptions :column="1" border> <div class="print_no_use">
<el-descriptions-item label="正文"> <layout-table :data="inspectionList" :show-pagination="false" border>
{{ info.TEXT }} <el-table-column label="序号" type="index" />
</el-descriptions-item> <el-table-column prop="CHECK_CATEGORY_NAME" label="反馈人" />
<template v-for="(item, index) in info.DETAIL" :key="item.id"> <el-table-column label="是否反馈">
<el-descriptions-item :label="'副文' + (index + 1)"> <template v-slot="{ row }">
{{ item.value }} <span>{{ row.FEED_BACK ? "是" : "否" }}</span>
</el-descriptions-item>
</template> </template>
</el-descriptions> </el-table-column>
<el-table-column prop="FEED_BACK" label="意见" />
<el-table-column prop="CHECK_STANDARD" label="签字">
<template v-slot="{ row }">
<img
v-if="row.FILEPATH"
:src="FILE_URL + row.FILEPATH"
style="width: 100px; height: 100px"
/>
</template>
</el-table-column>
</layout-table>
</div>
<table class="print_use">
<thead>
<tr>
<th width="55">序号</th>
<th>反馈人</th>
<th>是否反馈</th>
<th>意见</th>
<th>签字</th>
</tr>
</thead>
<tbody>
<tr v-for="(item, index) in inspectionList" :key="index">
<td>{{ index + 1 }}</td>
<td>{{ item.CHECK_CATEGORY_NAME }}</td>
<td>{{ item.FEED_BACK ? "是" : "否" }}</td>
<td>{{ item.FEED_BACK }}</td>
<td>
<img
v-if="item.FILEPATH"
:src="FILE_URL + item.FILEPATH"
style="width: 100px; height: 100px"
/>
</td>
</tr>
</tbody>
</table>
</div>
<div class="tc mt-10"> <div class="tc mt-10">
<el-button type="primary" @click="fnView"> </el-button> <el-button v-print="'#printContent'" type="primary"></el-button>
</div> </div>
</layout-card> </layout-card>
</template> </template>
<script setup> <script setup>
import { reactive, ref } from "vue";
import { getAdministrationView } from "@/request/security_commitment_pro.js";
import { useRoute } from "vue-router"; import { useRoute } from "vue-router";
import { uniqBy } from "lodash-es"; import { getSafetyMeetingView } from "@/request/safety_meeting.js";
import { addingPrefixToFile } from "@/assets/js/utils.js";
import { reactive } from "vue";
const route = useRoute(); const route = useRoute();
const { PROMISE_ID } = route.query; const FILE_URL = import.meta.env.VITE_FILE_URL;
const info = ref({}); const { SAFETY_MEETING_ID } = route.query;
const inspectionList = [
{
CHECK_CATEGORY_NAME: "123",
FEED_BACK: "FEED_BACK1",
FILEPATH:
"/uploadFiles/file/13cf0f4ec77e4d98ae8cdd9c3386ae0c/20240126/a244a5ed273d4e77b466aa29c4361820.jpg",
},
{
CHECK_CATEGORY_NAME: "123",
FEED_BACK: "FEED_BACK1",
},
{
CHECK_CATEGORY_NAME: "132",
},
];
const data = reactive({ const data = reactive({
viewDialog: { form: {
visible: false, people: [],
info: {}, file: [],
}, },
}); });
const fnGetData = async () => { const fnGetData = async () => {
const resData = await getAdministrationView({ PROMISE_ID }); const resData = await getSafetyMeetingView({ SAFETY_MEETING_ID });
const DETAIL = resData.promistDetail.map((item) => ({ data.form = {
value: item.COLLATERAL, ...resData.pd,
id: item.PROMISEDETAIL_ID, people: resData.people,
}));
const people = resData.people;
const coverpeople = resData.coverpeople;
const newPeople = [];
const newCoverpeople = [];
for (let i = 0; i < people.length; i++) {
newPeople.push({
...people[i],
USERNAME: [],
id: people[i].PROMISEPEOPLE_ID,
});
for (let j = 0; j < newPeople.length; j++) {
if (people[i].POST_ID === newPeople[j].POST_ID) {
newPeople[j].USERNAME.push(people[i].USERNAME);
}
}
}
for (let i = 0; i < coverpeople.length; i++) {
newCoverpeople.push({
...coverpeople[i],
USERNAME: [],
id: coverpeople[i].PROMISEPEOPLE_ID,
});
for (let j = 0; j < newCoverpeople.length; j++) {
if (coverpeople[i].POST_ID === newCoverpeople[j].POST_ID) {
newCoverpeople[j].USERNAME.push(coverpeople[i].USERNAME);
}
}
}
info.value = {
...resData.varList,
DETAIL,
people: uniqBy(newPeople, "POST_ID"),
coverpeople: uniqBy(newCoverpeople, "POST_ID"),
}; };
if (resData.imgs) {
data.form.file = addingPrefixToFile(resData.imgs);
}
}; };
fnGetData(); fnGetData();
const fnView = () => {
data.viewDialog.info = {
...info.value,
FILEPATH: "",
SIGNTIME: "",
COVERPEOPLE: info.value.coverpeople[0].USERNAME[0],
};
data.viewDialog.visible = true;
};
</script> </script>
<style scoped lang="scss"></style> <style />