|
@@ -64,6 +64,10 @@
|
|
|
<span>出纳:{{ dataForm.createdBy }}</span>
|
|
<span>出纳:{{ dataForm.createdBy }}</span>
|
|
|
<span>操作人:{{ user.nickname }}</span>
|
|
<span>操作人:{{ user.nickname }}</span>
|
|
|
</p>
|
|
</p>
|
|
|
|
|
+ <!-- 机构签章:叠在表格右下角,旋转 -45° -->
|
|
|
|
|
+ <div v-if="sealUrl" class="seal-overlay">
|
|
|
|
|
+ <img :src="sealUrl" class="seal-img" alt="机构公章" />
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<el-button @click="handleClosed">取消</el-button>
|
|
<el-button @click="handleClosed">取消</el-button>
|
|
@@ -80,6 +84,8 @@ import { getDictLabel, DICT_TYPE } from '@/utils/dict'
|
|
|
import { getDepositDetail } from '@/api/elderly/fee/deposit'
|
|
import { getDepositDetail } from '@/api/elderly/fee/deposit'
|
|
|
import { fmtDict } from '@/utils'
|
|
import { fmtDict } from '@/utils'
|
|
|
import { getOverheadListByType } from '@/api/elderly/fee/overheadCharge'
|
|
import { getOverheadListByType } from '@/api/elderly/fee/overheadCharge'
|
|
|
|
|
+import { getTenant } from '@/api/system/tenant'
|
|
|
|
|
+import { getTenantId } from '@/utils/auth'
|
|
|
defineOptions({ name: 'DepositPrint' })
|
|
defineOptions({ name: 'DepositPrint' })
|
|
|
|
|
|
|
|
const tenantName = useUserStore().getTenantName // 当前登录的编号
|
|
const tenantName = useUserStore().getTenantName // 当前登录的编号
|
|
@@ -119,10 +125,20 @@ const pageTitle = ref('')
|
|
|
const pageType = ref(0)
|
|
const pageType = ref(0)
|
|
|
const payText = ref('')
|
|
const payText = ref('')
|
|
|
const singleType = ref(true)
|
|
const singleType = ref(true)
|
|
|
|
|
+// 当前机构公章(来自租户接口 expenseCachetUrl);为空字符串时签章区不渲染
|
|
|
|
|
+const sealUrl = ref('')
|
|
|
|
|
|
|
|
/** 打开弹窗 */
|
|
/** 打开弹窗 */
|
|
|
const open = async (elderId, id, type = 1, single = true) => {
|
|
const open = async (elderId, id, type = 1, single = true) => {
|
|
|
dialogVisible.value = true
|
|
dialogVisible.value = true
|
|
|
|
|
+ // 并行拉取机构公章(容错,租户接口失败不影响打印主流程)
|
|
|
|
|
+ getTenant(getTenantId() as number)
|
|
|
|
|
+ .then((tenant) => {
|
|
|
|
|
+ sealUrl.value = tenant?.expenseCachetUrl || ''
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {
|
|
|
|
|
+ sealUrl.value = ''
|
|
|
|
|
+ })
|
|
|
pageType.value = type
|
|
pageType.value = type
|
|
|
singleType.value = single
|
|
singleType.value = single
|
|
|
/** 押金 */
|
|
/** 押金 */
|
|
@@ -209,6 +225,7 @@ const handleClosed = () => {
|
|
|
dialogVisible.value = false
|
|
dialogVisible.value = false
|
|
|
total.value = 0
|
|
total.value = 0
|
|
|
payText.value = ''
|
|
payText.value = ''
|
|
|
|
|
+ sealUrl.value = ''
|
|
|
dataForm.value = {
|
|
dataForm.value = {
|
|
|
orderNumber: '',
|
|
orderNumber: '',
|
|
|
createdTime: '',
|
|
createdTime: '',
|
|
@@ -225,12 +242,21 @@ const getList = async () => {
|
|
|
list.value = res
|
|
list.value = res
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+// 打印样式:与预览保持一致
|
|
|
|
|
+// - #printArea 加 padding-bottom 给签章留出空间,否则签章会贴到纸张边缘或被裁掉
|
|
|
|
|
+// - 同步印章定位(打印 iframe 不会继承 scoped 样式,需在此重新声明)
|
|
|
|
|
+const printExtraCss = `
|
|
|
|
|
+ html, body { height: auto !important; overflow: visible !important; }
|
|
|
|
|
+ #printArea { height: auto !important; overflow: visible !important; padding-bottom: 12mm !important; }
|
|
|
|
|
+ .seal-overlay { right: 5mm !important; bottom: 0mm !important; }
|
|
|
|
|
+`
|
|
|
|
|
+
|
|
|
// 打印
|
|
// 打印
|
|
|
const print = {
|
|
const print = {
|
|
|
id: 'printArea',
|
|
id: 'printArea',
|
|
|
extraCss: '',
|
|
extraCss: '',
|
|
|
popTitle: '', // 打印配置页上方的标题
|
|
popTitle: '', // 打印配置页上方的标题
|
|
|
- extraHead: '', // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
|
|
|
|
|
|
|
+ extraHead: `<style>${printExtraCss}</style>`, // 最上方的头部文字,附加在head标签上的额外标签,使用逗号分割
|
|
|
preview: false, // 是否启动预览模式,默认是false
|
|
preview: false, // 是否启动预览模式,默认是false
|
|
|
previewTitle: '对账单预览', // 打印预览的标题
|
|
previewTitle: '对账单预览', // 打印预览的标题
|
|
|
previewPrintBtnLabel: '预览结束,开始打印', // 打印预览的标题下方的按钮文本,点击可进入打印
|
|
previewPrintBtnLabel: '预览结束,开始打印', // 打印预览的标题下方的按钮文本,点击可进入打印
|
|
@@ -258,6 +284,8 @@ const print = {
|
|
|
</script>
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
.deposit-print {
|
|
.deposit-print {
|
|
|
|
|
+ position: relative; // 让 .seal-overlay 相对本容器定位
|
|
|
|
|
+ padding-bottom: 12mm; // 给印章留出空间,避免被 dialog 滚动容器或打印纸张裁切
|
|
|
.wrap {
|
|
.wrap {
|
|
|
position: relative;
|
|
position: relative;
|
|
|
.title {
|
|
.title {
|
|
@@ -288,5 +316,27 @@ const print = {
|
|
|
.fr {
|
|
.fr {
|
|
|
float: right;
|
|
float: right;
|
|
|
}
|
|
}
|
|
|
|
|
+ // 机构签章:绝对定位叠在表格右下角,旋转 -45°
|
|
|
|
|
+ // - right: 5mm / bottom: 0mm,让印章落在容器右下角的留白区域内完整可见
|
|
|
|
|
+ // - z-index: 20 保证印章叠在表格之上;pointer-events: none 不挡表格交互
|
|
|
|
|
+ // - opacity: 0.85 略透,不完全遮住底部文字
|
|
|
|
|
+ .seal-overlay {
|
|
|
|
|
+ position: absolute;
|
|
|
|
|
+ right: 15mm;
|
|
|
|
|
+ bottom: 16mm;
|
|
|
|
|
+ width: 30mm;
|
|
|
|
|
+ height: 30mm;
|
|
|
|
|
+ z-index: 20;
|
|
|
|
|
+ pointer-events: none;
|
|
|
|
|
+
|
|
|
|
|
+ .seal-img {
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ height: 100%;
|
|
|
|
|
+ object-fit: contain;
|
|
|
|
|
+ // transform: rotate(-45deg);
|
|
|
|
|
+ transform-origin: 100% 100%;
|
|
|
|
|
+ opacity: 0.85;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|