安全例会打印

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 { 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 { useRoute, useRouter } from "vue-router";
import useFormValidate from "@/assets/js/useFormValidate.js";
@ -177,7 +180,6 @@ const data = reactive({
people: [],
file: [],
},
selectTemplateDialogVisible: false,
});
const fnAddPeople = () => {
data.form.people.push({

View File

@ -1,117 +1,148 @@
<template>
<layout-card>
<el-divider content-position="left">基本信息</el-divider>
<el-descriptions :column="2" border>
<el-descriptions-item label="承诺书名称">
{{ info.PROMISE_NAME }}
<div id="printContent">
<el-divider content-position="left">安全例会</el-divider>
<el-descriptions border :column="2">
<el-descriptions-item class="my-content" label="安全例会标题"
>{{ data.form.SAFETY_MEETING_TITLE }}
</el-descriptions-item>
<el-descriptions-item label="级别">
{{ info.LEVELNAME }}
</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 label="安全例会内容"
>{{ data.form.SAFETY_MEETING_CONTENT }}
</el-descriptions-item>
</el-descriptions>
<el-divider content-position="left">涉及人</el-divider>
<el-descriptions :column="3" border>
<template v-for="(item, index) in info.coverpeople" :key="item.id">
<el-descriptions-item :label="'部门' + (index + 1)">
{{ item.DEPTNAME }}
<div class="print_no_use">
<layout-table :data="data.form.people" :show-pagination="false">
<el-table-column label="序号" type="index" />
<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 :label="'岗位' + (index + 1)">
{{ item.POSTNAME }}
</el-descriptions-item>
<el-descriptions-item :label="'人员' + (index + 1)">
{{ item.USERNAME?.join("、") }}
</el-descriptions-item>
</template>
</el-descriptions>
<el-divider content-position="left">承诺内容</el-divider>
<el-descriptions :column="1" border>
<el-descriptions-item label="正文">
{{ info.TEXT }}
</el-descriptions-item>
<template v-for="(item, index) in info.DETAIL" :key="item.id">
<el-descriptions-item :label="'副文' + (index + 1)">
{{ item.value }}
</el-descriptions-item>
<el-divider content-position="left">反馈情况</el-divider>
<div class="print_no_use">
<layout-table :data="inspectionList" :show-pagination="false" border>
<el-table-column label="序号" type="index" />
<el-table-column prop="CHECK_CATEGORY_NAME" label="反馈人" />
<el-table-column label="是否反馈">
<template v-slot="{ row }">
<span>{{ row.FEED_BACK ? "是" : "否" }}</span>
</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">
<el-button type="primary" @click="fnView"> </el-button>
<el-button v-print="'#printContent'" type="primary"></el-button>
</div>
</layout-card>
</template>
<script setup>
import { reactive, ref } from "vue";
import { getAdministrationView } from "@/request/security_commitment_pro.js";
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 { PROMISE_ID } = route.query;
const info = ref({});
const FILE_URL = import.meta.env.VITE_FILE_URL;
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({
viewDialog: {
visible: false,
info: {},
form: {
people: [],
file: [],
},
});
const fnGetData = async () => {
const resData = await getAdministrationView({ PROMISE_ID });
const DETAIL = resData.promistDetail.map((item) => ({
value: item.COLLATERAL,
id: item.PROMISEDETAIL_ID,
}));
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"),
const resData = await getSafetyMeetingView({ SAFETY_MEETING_ID });
data.form = {
...resData.pd,
people: resData.people,
};
if (resData.imgs) {
data.form.file = addingPrefixToFile(resData.imgs);
}
};
fnGetData();
const fnView = () => {
data.viewDialog.info = {
...info.value,
FILEPATH: "",
SIGNTIME: "",
COVERPEOPLE: info.value.coverpeople[0].USERNAME[0],
};
data.viewDialog.visible = true;
};
</script>
<style scoped lang="scss"></style>
<style />