123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467 |
- <template>
- <div>
- <div id="pdfDom" style="font-family: 'msyh'">
- <div style="padding: 60px; font-size: 12px !important; color: black">
- <div style="font-size: 16px; text-align: center; padding: 8px">
- <span
- >采购付款(
- {{ dictValueLabel(printDetails.type, payMethod) }})</span
- >
- </div>
- <div style="padding: 8px 0">
- <span>创建时间: {{ printDetails.createTime }}</span>
- </div>
- <div style="border: 1px solid black">
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="width: 80px; border-right: 1px solid black; padding: 8px"
- >
- 创建人
- </div>
- <div style="width: calc(100% - 80px); padding: 8px">
- {{ dictValueLabel(printDetails.createUser, userList) }}
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="width: 80px; border-right: 1px solid black; padding: 8px"
- >
- 创建人部门
- </div>
- <div style="width: calc(100% - 80px); padding: 8px">
- {{ dictValueLabel(printDetails.deptId, deptList) }}
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 80px;
- border-right: 1px solid black;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- 费用明细
- </div>
- <div style="width: calc(100% - 80px)">
- <div style="border-bottom: 1px solid black; display: flex">
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 采购合同
- </div>
- <div
- style="
- width: calc(100% - 260px);
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 款项说明
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 货币
- </div>
- <div style="width: 80px; padding: 4px 8px; text-align: center">
- 付款金额
- </div>
- </div>
- <template
- v-if="
- printDetails.payDetailVoList &&
- printDetails.payDetailVoList.length > 0
- "
- >
- <div
- v-for="(item, index) in printDetails.payDetailVoList"
- :key="index"
- >
- <div
- :style="
- index + 1 !== printDetails.payDetailVoList.length
- ? 'border-bottom: 1px solid black; display: flex'
- : ' display: flex'
- "
- >
- <div
- style="
- width: 120px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.purchaseCode }}
- </div>
- <div
- style="
- width: calc(100% - 260px);
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ item.remark }}
- </div>
- <div
- style="
- width: 60px;
- padding: 4px 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- 人民币
- </div>
- <div
- style="
- width: 80px;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- {{ item.money }}
- </div>
- </div>
- </div>
- </template>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="width: 80px; border-right: 1px solid black; padding: 8px"
- >
- 总报销金额
- </div>
- <div style="width: calc(100% - 80px); display: flex">
- <div
- style="
- width: calc(100% - 140px);
- padding: 8px;
- border-right: 1px solid black;
- "
- >
- {{ NumberToChinese(computeMoney()) }}
- </div>
- <div style="width: 140px; padding: 8px">{{ computeMoney() }}</div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="width: 80px; border-right: 1px solid black; padding: 8px"
- >
- 单据数量
- </div>
- <div style="width: calc(100% - 80px); padding: 8px">
- {{ printDetails.receiptsNum }}
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="
- width: 80px;
- border-right: 1px solid black;
- padding: 0 8px;
- display: flex;
- align-items: center;
- "
- >
- 收款信息
- </div>
- <div style="width: calc(100% - 80px)">
- <div style="border-bottom: 1px solid black; display: flex">
- <div
- style="
- width: 19%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 支付方式
- </div>
- <div
- style="
- width: 22%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 收款方户名
- </div>
- <div
- style="
- width: 20%;
- padding: 0 8px;
- border-right: 1px solid black;
- text-align: center;
- "
- >
- 开户行
- </div>
- <div style="width: 39%; padding: 0 8px; text-align: center">
- 收款方账号
- </div>
- </div>
- <div style="display: flex">
- <div
- style="
- width: 19%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ dictValueLabel(printDetails.payType, fundsPaymentMethod) }}
- </div>
- <div
- style="
- width: 22%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.name }}
- </div>
- <div
- style="
- width: 20%;
- padding: 0 8px;
- border-right: 1px solid black;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.openingBank }}
- </div>
- <div
- style="
- width: 39%;
- padding: 0 8px;
- display: flex;
- align-items: center;
- "
- >
- {{ printDetails.accountOpening }}
- </div>
- </div>
- </div>
- </div>
- <div style="display: flex; border-bottom: 1px solid black">
- <div
- style="width: 80px; border-right: 1px solid black; padding: 8px"
- >
- 电子发票(PDF/JPG)
- </div>
- <div style="width: calc(100% - 80px); padding: 8px">
- {{ printDetails.electronicInvoiceText }}
- </div>
- </div>
- <div style="display: flex">
- <div
- style="
- width: 80px;
- border-right: 1px solid black;
- padding: 4px 8px;
- display: flex;
- align-items: center;
- "
- >
- 审批流程
- </div>
- <div style="width: calc(100% - 80px)">
- <template
- v-if="
- printDetails.recordList && printDetails.recordList.length > 0
- "
- >
- <div
- v-for="(item, index) in printDetails.recordList"
- :key="index"
- >
- <div
- :style="
- index + 1 !== printDetails.recordList.length
- ? 'border-bottom: 1px solid black; padding: 4px 8px; display: flex'
- : 'padding: 4px 8px; display: flex'
- "
- >
- <div
- style="width: calc(100% - 120px); word-wrap: break-word"
- >
- <span>{{ item.nodeName }}: </span>
- <span style="padding-left: 4px">{{
- item.processedUser
- }}</span>
- <span style="padding-left: 4px"
- >{{ item.remark
- }}<span v-if="item.handleTypeName"
- >({{ item.handleTypeName }})</span
- ></span
- >
- </div>
- <div style="width: 120px">{{ item.processedDate }}</div>
- </div>
- </div>
- </template>
- </div>
- </div>
- </div>
- <div style="padding-top: 16px">
- <span>打印时间: {{ presentTime }}</span>
- <span style="padding-left: 32px"
- >打印人: {{ useUserStore().user.nickName }}</span
- >
- </div>
- </div>
- </div>
- </div>
- </template>
- <script setup>
- import useUserStore from "@/store/modules/user";
- import moment from "moment";
- import { NumberToChinese } from "@/utils/util.js";
- const { proxy } = getCurrentInstance();
- const fundsPaymentMethod = ref([]);
- const payMethod = ref([]);
- const userList = ref([]);
- const deptList = ref([]);
- const getDict = () => {
- proxy.getDictOne(["funds_payment_method", "pay_method"]).then((res) => {
- fundsPaymentMethod.value = res["funds_payment_method"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- payMethod.value = res["pay_method"].map((x) => ({
- label: x.dictValue,
- value: x.dictKey,
- }));
- });
- proxy
- .get("/tenantUser/list", {
- pageNum: 1,
- pageSize: 10000,
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.rows && res.rows.length > 0) {
- userList.value = res.rows.map((item) => {
- return {
- deptId: item.deptId,
- label: item.nickName,
- value: item.userId,
- };
- });
- }
- });
- proxy
- .get("/tenantDept/list", {
- pageNum: 1,
- pageSize: 999,
- tenantId: useUserStore().user.tenantId,
- })
- .then((res) => {
- if (res.data && res.data.length > 0) {
- deptList.value = res.data.map((item) => {
- return {
- label: item.deptName,
- value: item.deptId,
- };
- });
- }
- });
- };
- getDict();
- const printDetails = ref({});
- const presentTime = ref(moment().format("yyyy-MM-DD HH:mm:ss"));
- const computeMoney = () => {
- let money = 0;
- if (
- printDetails.value.payDetailVoList &&
- printDetails.value.payDetailVoList.length > 0
- ) {
- for (let i = 0; i < printDetails.value.payDetailVoList.length; i++) {
- if (printDetails.value.payDetailVoList[i].money) {
- money = Number(
- parseFloat(
- Number(money) + Number(printDetails.value.payDetailVoList[i].money)
- ).toFixed(2)
- );
- }
- }
- }
- return money;
- };
- const props = defineProps({
- rowData: Object,
- });
- onMounted(() => {
- if (props.rowData && props.rowData.id) {
- proxy.post("/pay/detail", { id: props.rowData.id }).then((res) => {
- printDetails.value = res;
- if (printDetails.value.createUser) {
- let data = userList.value.filter(
- (item) => item.value == printDetails.value.createUser
- );
- if (data && data.length > 0) {
- printDetails.value.deptId = data[0].deptId;
- }
- }
- proxy
- .post("/fileInfo/getList", { businessIdList: [props.rowData.id] })
- .then((resFile) => {
- let electronicInvoiceText = "";
- if (
- resFile[props.rowData.id] &&
- resFile[props.rowData.id].length > 0
- ) {
- for (let i = 0; i < resFile[props.rowData.id].length; i++) {
- if (i === 0) {
- electronicInvoiceText = resFile[props.rowData.id][0].fileName;
- } else {
- electronicInvoiceText =
- electronicInvoiceText +
- ", " +
- resFile[props.rowData.id][i].fileName;
- }
- }
- }
- printDetails.value.electronicInvoiceText = electronicInvoiceText;
- });
- if (res.flowExampleId) {
- proxy
- .post("/flowExample/getApprovalRecord", { id: res.flowExampleId })
- .then((record) => {
- printDetails.value.recordList = record.recordList;
- });
- }
- });
- }
- });
- </script>
- <style lang="scss" scoped></style>
|