7/24 收银台 日期筛选,合计
This commit is contained in:
@@ -22,6 +22,8 @@ export const cashQuery = (data: { residentName?: string; queryType: number }): A
|
|||||||
};
|
};
|
||||||
|
|
||||||
export type billlistType = {
|
export type billlistType = {
|
||||||
|
actualAccount: string;
|
||||||
|
singleDiscountAmount: string;
|
||||||
'villageId': string;
|
'villageId': string;
|
||||||
'residentId': string;
|
'residentId': string;
|
||||||
'houseId': string;
|
'houseId': string;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
<div class="flex flex-items-center">
|
<div class="flex flex-items-center">
|
||||||
<div style="width: 50px; text-align: right; padding-right: 10px">楼栋</div>
|
<div style="width: 50px; text-align: right; padding-right: 10px">楼栋</div>
|
||||||
<div class="flex-1"></div>
|
<div class="flex-1"></div>
|
||||||
<el-select @change="handleChangebuilding" clearable style="width: 120px" v-model="queryParams.buildingId">
|
<el-select @change="handleChangeBuilding" clearable style="width: 120px" v-model="queryParams.buildingId">
|
||||||
<el-option v-for="(item, index) in buildinglist" :key="index" :label="item.buildingName" :value="item.id"></el-option>
|
<el-option v-for="(item, index) in buildingList" :key="index" :label="item.buildingName" :value="item.id"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-items-center mr-20px">
|
<div class="flex flex-items-center mr-20px">
|
||||||
@@ -49,11 +49,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" @click="getlist">查询</el-button>
|
<el-button type="primary" @click="getList">查询</el-button>
|
||||||
<el-button @click="resetQuery">重置</el-button>
|
<el-button @click="resetQuery">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
<el-table row-key="houseId" v-loading="loading" ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
|
<el-table
|
||||||
|
style="height: 500px"
|
||||||
|
row-key="houseId"
|
||||||
|
v-loading="loading"
|
||||||
|
ref="multipleTableRef"
|
||||||
|
:data="tableData"
|
||||||
|
border
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
<el-table-column label="序号" align="center" width="55" type="index" />
|
<el-table-column label="序号" align="center" width="55" type="index" />
|
||||||
<el-table-column label="小区" align="center" prop="villageName" />
|
<el-table-column label="小区" align="center" prop="villageName" />
|
||||||
@@ -70,15 +78,15 @@
|
|||||||
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
<div class="dialog-footer flex flex-items-center flex-justify-between">
|
||||||
<pagination
|
<pagination
|
||||||
style="margin-top: 0"
|
style="margin-top: 0"
|
||||||
layout="total, prev, pager, next, jumper"
|
layout="total, prev, sizes, pager, next, jumper"
|
||||||
v-show="total > 0"
|
v-show="total > 0"
|
||||||
:total="total"
|
:total="total"
|
||||||
v-model:page="queryParams.pageNum"
|
v-model:page="queryParams.pageNum"
|
||||||
v-model:limit="queryParams.pageSize"
|
v-model:limit="queryParams.pageSize"
|
||||||
@pagination="getlist"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
<div>
|
<div>
|
||||||
<el-button @click="conback">退出</el-button>
|
<el-button @click="conBack">退出</el-button>
|
||||||
<el-button type="primary" @click="confirm"> 确定 </el-button>
|
<el-button type="primary" @click="confirm"> 确定 </el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -176,7 +184,7 @@ const handleUserSelection = () => {
|
|||||||
const houseUseTypeList = ref([]);
|
const houseUseTypeList = ref([]);
|
||||||
const isFetching = ref(false);
|
const isFetching = ref(false);
|
||||||
// 获取列表
|
// 获取列表
|
||||||
function getlist() {
|
function getList() {
|
||||||
isFetching.value = true; // 🔒 加锁:禁止 selection-change 更新数据
|
isFetching.value = true; // 🔒 加锁:禁止 selection-change 更新数据
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
listBillHouse(queryParams.value)
|
listBillHouse(queryParams.value)
|
||||||
@@ -195,39 +203,39 @@ function getlist() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** 楼栋列表 */
|
/** 楼栋列表 */
|
||||||
const buildinglist = ref([]);
|
const buildingList = ref([]);
|
||||||
/** 房屋列表 */
|
/** 房屋列表 */
|
||||||
const unitlist = ref([]);
|
const unitlist = ref([]);
|
||||||
|
|
||||||
/** 获取楼栋 列表 */
|
/** 获取楼栋 列表 */
|
||||||
function handleChangeHouse() {
|
function handleChangeHouse() {
|
||||||
getBuildinglistAPI().then((res) => {
|
getBuildinglistAPI().then((res) => {
|
||||||
buildinglist.value = res.data;
|
buildingList.value = res.data;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleClear() {
|
function handleClear() {
|
||||||
queryParams.value.residentName = '';
|
queryParams.value.residentName = '';
|
||||||
getlist();
|
getList();
|
||||||
}
|
}
|
||||||
function handleHouseUseChange() {
|
function handleHouseUseChange() {
|
||||||
getlist();
|
getList();
|
||||||
}
|
}
|
||||||
/** 单元列表 */
|
/** 单元列表 */
|
||||||
function handleChangebuilding(val: string) {
|
function handleChangeBuilding(val: string) {
|
||||||
queryParams.value.unitNoId = null;
|
queryParams.value.unitNoId = null;
|
||||||
unitlist.value = [];
|
unitlist.value = [];
|
||||||
|
|
||||||
if (queryParams.value.buildingId) {
|
if (queryParams.value.buildingId) {
|
||||||
getHouselistAPI(val).then((res) => {
|
getHouselistAPI(val).then((res) => {
|
||||||
unitlist.value = res.data.units;
|
unitlist.value = res.data.units;
|
||||||
getlist();
|
getList();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getlist();
|
getList();
|
||||||
}
|
}
|
||||||
function handleChangeUnit() {
|
function handleChangeUnit() {
|
||||||
getlist();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==============================================
|
// ==============================================
|
||||||
@@ -285,11 +293,11 @@ function resetQuery() {
|
|||||||
houseNo: '',
|
houseNo: '',
|
||||||
residentName: ''
|
residentName: ''
|
||||||
};
|
};
|
||||||
getlist();
|
getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
// 退出
|
// 退出
|
||||||
function conback() {
|
function conBack() {
|
||||||
dialog.value.dialogVisible = false;
|
dialog.value.dialogVisible = false;
|
||||||
resetQuery();
|
resetQuery();
|
||||||
}
|
}
|
||||||
@@ -338,7 +346,7 @@ defineExpose({
|
|||||||
}) as BillHouse
|
}) as BillHouse
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
getlist();
|
getList();
|
||||||
dialog.value.dialogVisible = true;
|
dialog.value.dialogVisible = true;
|
||||||
listHouseUseType_add_house().then((res) => {
|
listHouseUseType_add_house().then((res) => {
|
||||||
houseUseTypeList.value = res.data;
|
houseUseTypeList.value = res.data;
|
||||||
@@ -356,7 +364,7 @@ defineExpose({
|
|||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
padding: 0 10px;
|
padding: 0 10px;
|
||||||
.defaultbox {
|
.defaultBox {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|||||||
@@ -34,13 +34,13 @@
|
|||||||
</div>
|
</div>
|
||||||
<template #dropdown>
|
<template #dropdown>
|
||||||
<el-dropdown-menu>
|
<el-dropdown-menu>
|
||||||
<el-dropdown-item divided command="changecommunity">
|
<el-dropdown-item divided command="changecommunity" v-if="isShow">
|
||||||
<span>{{ proxy.$t('navbar.community') }}</span>
|
<span>{{ proxy.$t('navbar.community') }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<router-link to="/system/user/profile">
|
<router-link to="/system/user/profile" v-if="isShow">
|
||||||
<el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item>
|
<el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item>
|
||||||
</router-link>
|
</router-link>
|
||||||
<el-dropdown-item divided command="logout">
|
<el-dropdown-item :divided="isShow" command="logout">
|
||||||
<span>{{ proxy.$t('navbar.logout') }}</span>
|
<span>{{ proxy.$t('navbar.logout') }}</span>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
</el-dropdown-menu>
|
</el-dropdown-menu>
|
||||||
@@ -109,7 +109,14 @@ const changecommunity = () => {
|
|||||||
path: '/community'
|
path: '/community'
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
const route = useRoute();
|
||||||
|
const isShow = ref(true);
|
||||||
|
const hiddenAction = ['communitylist'];
|
||||||
|
onMounted(() => {
|
||||||
|
if (hiddenAction.includes(typeof route.name === 'string' ? route.name : '')) {
|
||||||
|
isShow.value = false;
|
||||||
|
}
|
||||||
|
});
|
||||||
const emits = defineEmits(['setLayout']);
|
const emits = defineEmits(['setLayout']);
|
||||||
const setLayout = () => {
|
const setLayout = () => {
|
||||||
emits('setLayout');
|
emits('setLayout');
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import App from './App.vue';
|
|||||||
import store from './store';
|
import store from './store';
|
||||||
|
|
||||||
import router from './router';
|
import router from './router';
|
||||||
|
|
||||||
// 自定义指令
|
// 自定义指令
|
||||||
import directive from './directive';
|
import directive from './directive';
|
||||||
import print from 'vue3-print-nb';
|
import print from 'vue3-print-nb';
|
||||||
@@ -54,8 +53,8 @@ app.use(router);
|
|||||||
app.use(store);
|
app.use(store);
|
||||||
app.use(i18n);
|
app.use(i18n);
|
||||||
app.use(VXETable);
|
app.use(VXETable);
|
||||||
app.use(plugins);
|
|
||||||
app.use(print);
|
app.use(print);
|
||||||
|
app.use(plugins);
|
||||||
|
|
||||||
// 自定义指令
|
// 自定义指令
|
||||||
directive(app);
|
directive(app);
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ export function convertToChineseCapital(num: number | string): string {
|
|||||||
* 标准化为Big实例,空/undefined/null转0
|
* 标准化为Big实例,空/undefined/null转0
|
||||||
* @param num 数字 | 数字字符串
|
* @param num 数字 | 数字字符串
|
||||||
*/
|
*/
|
||||||
function toBig(num: string | number | undefined | null): Big {
|
export function toBig(num: string | number | undefined | null): Big {
|
||||||
if (num === null || num === undefined || num === '') return new Big(0);
|
if (num === null || num === undefined || num === '') return new Big(0);
|
||||||
return new Big(num);
|
return new Big(num);
|
||||||
}
|
}
|
||||||
@@ -112,6 +112,12 @@ export function maxMoney(a: string | number, b: string | number): number {
|
|||||||
const bigB = toBig(b);
|
const bigB = toBig(b);
|
||||||
return Number(bigA.gt(bigB) ? bigA : bigB);
|
return Number(bigA.gt(bigB) ? bigA : bigB);
|
||||||
}
|
}
|
||||||
|
// 取较小值
|
||||||
|
export function minMoney(a: string | number, b: string | number): number {
|
||||||
|
const bigA = toBig(a);
|
||||||
|
const bigB = toBig(b);
|
||||||
|
return Number(bigA.lt(bigB) ? bigA : bigB);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 减法 a - b
|
* 减法 a - b
|
||||||
*/
|
*/
|
||||||
@@ -119,6 +125,12 @@ export function sub(a: string | number, b: string | number): number {
|
|||||||
return Number(toBig(a).minus(toBig(b)));
|
return Number(toBig(a).minus(toBig(b)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 加法 a + b
|
||||||
|
*/
|
||||||
|
export function add(a: string | number, b: string | number): number {
|
||||||
|
return Number(toBig(a).plus(toBig(b)));
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 乘法 a * b
|
* 乘法 a * b
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -275,26 +275,17 @@ export function printTicketDiv(elementId: string, title: string = '票据打印'
|
|||||||
}
|
}
|
||||||
const win = window.open('', '_blank', 'width=1200,height=1000');
|
const win = window.open('', '_blank', 'width=1200,height=1000');
|
||||||
if (!win) return;
|
if (!win) return;
|
||||||
|
const styles = '';
|
||||||
// ==============================================
|
|
||||||
// 【核心1】复制 全局样式 + Element Plus 样式
|
|
||||||
// ==============================================
|
|
||||||
const styles = Array.from(document.querySelectorAll('link[rel="stylesheet"], style:not([scoped])'))
|
|
||||||
.map((item) => item.outerHTML)
|
|
||||||
.join('');
|
|
||||||
// ==============================================
|
|
||||||
// 【核心2】手动注入打印区域的 scoped 样式(关键!)
|
|
||||||
// ==============================================
|
|
||||||
const printScopeStyle = `
|
const printScopeStyle = `
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
margin: 0;
|
margin: 0 !important;
|
||||||
padding: 0;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
body {
|
html, body {
|
||||||
margin: 0;
|
width: 100%;
|
||||||
padding: 0.3cm;
|
height: 100%;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-family: "Microsoft YaHei", sans-serif;
|
font-family: "Microsoft YaHei", sans-serif;
|
||||||
@@ -304,199 +295,67 @@ export function printTicketDiv(elementId: string, title: string = '票据打印'
|
|||||||
.el-container, .el-aside, .el-header, .el-footer {
|
.el-container, .el-aside, .el-header, .el-footer {
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
|
/* ✅ @page 提升到外层,不要嵌套在 @media print 内部!修复不生效BUG */
|
||||||
/* ========== 核心:强制 宽25cm 高10cm 无边距 ========== */
|
|
||||||
@page {
|
@page {
|
||||||
size: 25cm 10cm;
|
size: 25cm 10cm !important;
|
||||||
margin: 0;
|
margin: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 打印容器:固定尺寸,限制单页 */
|
/* 自定义纸张 25cm × 10cm 无边距 */
|
||||||
|
@media print {
|
||||||
|
html {
|
||||||
|
height: 10cm !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
body {
|
||||||
|
|
||||||
|
/* 强制内容左上角对齐,禁止浏览器自动居中 */
|
||||||
|
transform-origin: top left !important;
|
||||||
|
position: absolute !important;
|
||||||
|
left: 0 !important;
|
||||||
|
top: 0 !important;
|
||||||
|
height: 10cm !important;
|
||||||
|
overflow: hidden !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========票据容器:贴左上角,不再居中========= */
|
||||||
#${elementId} {
|
#${elementId} {
|
||||||
width: 25cm !important;
|
width: 25cm !important;
|
||||||
height: 10cm !important;
|
height: 10cm !important;
|
||||||
margin: 0 auto;
|
box-sizing: border-box;
|
||||||
overflow: hidden;
|
|
||||||
page-break-after: avoid !important;
|
|
||||||
page-break-inside: avoid !important;
|
page-break-inside: avoid !important;
|
||||||
|
page-break-before: avoid !important;
|
||||||
|
page-break-after: avoid !important;
|
||||||
|
break-inside: avoid;
|
||||||
|
break-before: avoid;
|
||||||
|
break-after: avoid;
|
||||||
|
padding: 8mm; /* 内部留白,模拟页边距 */
|
||||||
|
}
|
||||||
|
.title{
|
||||||
|
font-weight: 800;
|
||||||
}
|
}
|
||||||
/* ========== 表格:压缩高度 + 禁止拆分 ========== */
|
|
||||||
table {
|
table {
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
table-layout: fixed;
|
|
||||||
margin: 0.1cm 0;
|
|
||||||
page-break-inside: avoid !important;
|
page-break-inside: avoid !important;
|
||||||
transform-origin: top left;
|
break-inside: avoid;
|
||||||
/* 初始不缩放,由JS动态控制 */
|
table-layout: auto;
|
||||||
page-break-after: avoid !important;
|
|
||||||
}
|
}
|
||||||
table th, table td {
|
table th, table td {
|
||||||
border: 1px solid #333;
|
border: 1px solid #333;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
height:40px;
|
height:40px;
|
||||||
min-width:80px;
|
|
||||||
text-align: center;
|
|
||||||
padding: 1px 2px; /* 缩小内边距,减少高度 */
|
|
||||||
line-height: 1.1;
|
|
||||||
white-space: normal;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
`;
|
|
||||||
|
|
||||||
// ==============================================
|
|
||||||
// 【核心3】写入新窗口
|
|
||||||
// ==============================================
|
|
||||||
win.document.write(`
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>${title}</title>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
${styles}
|
|
||||||
${printScopeStyle}
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
${el.outerHTML} <!-- 直接用innerHTML复制完整结构 -->
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
`);
|
|
||||||
win.document.close();
|
|
||||||
win.onload = () => {
|
|
||||||
const printContainer = win.document.getElementById(elementId);
|
|
||||||
if (!printContainer) {
|
|
||||||
win.close();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(() => {
|
|
||||||
const containerHeightPx = printContainer.clientHeight;
|
|
||||||
const contentHeightPx = printContainer.scrollHeight;
|
|
||||||
const containerWidthPx = printContainer.clientWidth;
|
|
||||||
const contentWidthPx = printContainer.scrollWidth;
|
|
||||||
|
|
||||||
// 固定顶部偏移量(约0.2cm),确保打印边缘不裁切内容╬D2╬╬2Σ╬╬╬╬2╬2222╬╬2╬22╬22╬22╬2╬╬2╬╬
|
|
||||||
const offsetPx = 20; // 可根据实际效果调整
|
|
||||||
|
|
||||||
// 计算可用高度(减去偏移)
|
|
||||||
const availableHeight = containerHeightPx - offsetPx;
|
|
||||||
|
|
||||||
// 如果内容高度超过可用高度,或宽度超过容器宽度,则等比缩放
|
|
||||||
let scale = 1;
|
|
||||||
let needScale = false;
|
|
||||||
|
|
||||||
if (contentHeightPx > availableHeight) {
|
|
||||||
scale = availableHeight / contentHeightPx;
|
|
||||||
needScale = true;
|
|
||||||
}
|
|
||||||
if (contentWidthPx > containerWidthPx) {
|
|
||||||
const scaleW = containerWidthPx / contentWidthPx;
|
|
||||||
if (scaleW < scale) {
|
|
||||||
scale = scaleW;
|
|
||||||
needScale = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 应用 transform:先缩放(如果需要),再整体下移固定偏移
|
|
||||||
if (needScale) {
|
|
||||||
printContainer.style.transform = `translateY(${offsetPx}px) scale(${scale})`;
|
|
||||||
} else {
|
|
||||||
// 即使不缩放,也下移避免顶部贴边
|
|
||||||
printContainer.style.transform = `translateY(${offsetPx}px)`;
|
|
||||||
}
|
|
||||||
// 确保缩放原点在左上,保证缩放后位置正确
|
|
||||||
printContainer.style.transformOrigin = 'top left';
|
|
||||||
|
|
||||||
// 执行打印
|
|
||||||
win.print();
|
|
||||||
win.close();
|
|
||||||
callback && callback();
|
|
||||||
}, 300); // 等待渲染完成
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function printTicketDiv2(elementId: string, title: string = '票据打印', callback?: () => void) {
|
|
||||||
const el = document.getElementById(elementId);
|
|
||||||
if (!el) {
|
|
||||||
console.error('未找到打印元素');
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const win = window.open('', '_blank', 'width=1200,height=1000');
|
|
||||||
if (!win) return;
|
|
||||||
|
|
||||||
// 复制全局非scoped样式(Element Plus、全局公共样式)
|
|
||||||
const styles = Array.from(document.querySelectorAll('link[rel="stylesheet"], style:not([scoped])'))
|
|
||||||
.map((item) => item.outerHTML)
|
|
||||||
.join('');
|
|
||||||
|
|
||||||
// 专属打印样式,根治空白第二页
|
|
||||||
const printScopeStyle = `
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
box-sizing: border-box;
|
|
||||||
margin: 0 !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
html, body {
|
|
||||||
height: auto !important;
|
|
||||||
min-height: auto !important;
|
|
||||||
margin: 0 !important;
|
|
||||||
padding: 0 !important;
|
|
||||||
background: #fff;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: "Microsoft YaHei", sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 隐藏弹窗无关组件:输入框、按钮、弹窗头部 */
|
|
||||||
.el-input {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 纸张自适应宽高,无边距 */
|
|
||||||
@page {
|
|
||||||
size: auto auto;
|
|
||||||
margin: 0mm !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 打印容器核心禁止分页 */
|
|
||||||
#${elementId} {
|
|
||||||
margin: 0 auto !important;
|
|
||||||
overflow: visible;
|
|
||||||
page-break-inside: avoid !important;
|
|
||||||
page-break-after: avoid !important;
|
|
||||||
break-inside: avoid !important;
|
|
||||||
break-after: avoid !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 表格禁止截断、压缩高度 */
|
|
||||||
table {
|
|
||||||
border-collapse: collapse;
|
|
||||||
width: 100% !important;
|
|
||||||
table-layout: fixed;
|
|
||||||
margin: 0.1cm 0;
|
|
||||||
page-break-inside: avoid !important;
|
|
||||||
break-inside: avoid !important;
|
|
||||||
}
|
|
||||||
table th, table td {
|
|
||||||
border: 1px solid #333;
|
|
||||||
font-size: 10px;
|
|
||||||
height:32px; /* 缩小行高减少整体高度 */
|
|
||||||
min-width:80px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 1px 2px;
|
padding: 1px 2px;
|
||||||
line-height: 1.1;
|
line-height: 1.1;
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow: hidden;
|
|
||||||
page-break-inside: avoid !important;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
// 只复制票据内部innerHTML,不带外层el-dialog多余结构
|
const html = `
|
||||||
const printContent = el.innerHTML;
|
|
||||||
|
|
||||||
win.document.write(`
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -506,10 +365,12 @@ export function printTicketDiv2(elementId: string, title: string = '票据打印
|
|||||||
${printScopeStyle}
|
${printScopeStyle}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="${elementId}">${printContent}</div>
|
${el.outerHTML}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
`);
|
`;
|
||||||
|
|
||||||
|
win.document.write(html);
|
||||||
win.document.close();
|
win.document.close();
|
||||||
win.onload = () => {
|
win.onload = () => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
@@ -88,6 +88,23 @@
|
|||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="选择生成账单的房屋">-->
|
||||||
|
<!-- <div class="flex flex-col">-->
|
||||||
|
<!-- <div>-->
|
||||||
|
<!-- <el-radio-group v-model="BillForm.chargeScope">-->
|
||||||
|
<!-- <el-radio v-for="(item, index) in com_bill_charge_scope_house" :key="index" :value="item.value" :label="item.label"></el-radio>-->
|
||||||
|
<!-- </el-radio-group>-->
|
||||||
|
<!-- <div style="height: 32px" v-if="BillForm.chargeScope === '1'">-->
|
||||||
|
<!-- <el-button @click="OpenUseTablesFun" link type="primary" class="ml-10px">请选择房屋</el-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
<!-- <el-form-item v-if="BillForm.chargeScope === '1'">-->
|
||||||
|
<!-- <div class="residentBox">-->
|
||||||
|
<!-- <House returnvalue="houseId" ref="HolderRef" :isMultiple="true" @change="handleSelect"> </House>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@@ -107,6 +124,10 @@ import { listBill, manualGenerateApi } from '@/api/system/SdbBill';
|
|||||||
import { BillVO, BillQuery, BillForm } from '@/api/system/SdbBill/type';
|
import { BillVO, BillQuery, BillForm } from '@/api/system/SdbBill/type';
|
||||||
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
import { listChargeItem } from '@/api/system/SdbChargeItem';
|
||||||
import { checkPermi } from '@/utils/permission';
|
import { checkPermi } from '@/utils/permission';
|
||||||
|
// import House from '@/components/Holder/house.vue';
|
||||||
|
import { ref } from 'vue';
|
||||||
|
// import UserHolder from '@/components/Holder/user.vue';
|
||||||
|
// import CarUser from '@/components/Holder/CarUser.vue';
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
|
||||||
@@ -220,13 +241,26 @@ const BillForm = ref<{
|
|||||||
title: string;
|
title: string;
|
||||||
billId: string;
|
billId: string;
|
||||||
chargePeriod: string;
|
chargePeriod: string;
|
||||||
|
chargeScope: string;
|
||||||
yearMonths?: string[];
|
yearMonths?: string[];
|
||||||
|
houseId: string[];
|
||||||
year?: string[];
|
year?: string[];
|
||||||
}>({
|
}>({
|
||||||
title: '',
|
title: '',
|
||||||
billId: '',
|
billId: '',
|
||||||
chargePeriod: '1'
|
chargePeriod: '1', // 账单类型
|
||||||
|
chargeScope: '0',
|
||||||
|
houseId: []
|
||||||
});
|
});
|
||||||
|
// const HolderRef = ref<InstanceType<typeof House>>();
|
||||||
|
// // 打开模态框
|
||||||
|
// function OpenUseTablesFun() {
|
||||||
|
// HolderRef.value.open(BillForm.value.houseId);
|
||||||
|
// }
|
||||||
|
// // 接受选择的房屋id
|
||||||
|
// function handleSelect(val: string[]) {
|
||||||
|
// BillForm.value.houseId = val;
|
||||||
|
// }
|
||||||
function handleChange(row: BillVO) {
|
function handleChange(row: BillVO) {
|
||||||
clearChangeBillForm();
|
clearChangeBillForm();
|
||||||
BillVisible.value = true;
|
BillVisible.value = true;
|
||||||
@@ -250,7 +284,9 @@ function clearChangeBillForm() {
|
|||||||
BillForm.value = {
|
BillForm.value = {
|
||||||
title: '',
|
title: '',
|
||||||
billId: '',
|
billId: '',
|
||||||
chargePeriod: '1'
|
chargePeriod: '1',
|
||||||
|
chargeScope: '0',
|
||||||
|
houseId: []
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -149,7 +149,6 @@ const form = ref({
|
|||||||
|
|
||||||
const rules = ref({
|
const rules = ref({
|
||||||
areaId: [{ required: true, message: '请选择区域', trigger: 'blur' }],
|
areaId: [{ required: true, message: '请选择区域', trigger: 'blur' }],
|
||||||
residentId: [{ required: true, message: '请选择', trigger: 'blur' }],
|
|
||||||
carNum: [
|
carNum: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -157,7 +156,7 @@ const rules = ref({
|
|||||||
trigger: ['blur']
|
trigger: ['blur']
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
carBrand: [{ required: true, message: '请输入车辆品牌', trigger: 'blur' }]
|
carBrand: [{ required: false, message: '请输入车辆品牌', trigger: 'blur' }]
|
||||||
});
|
});
|
||||||
function handleValidate() {
|
function handleValidate() {
|
||||||
formRef.value.validateField('carNum');
|
formRef.value.validateField('carNum');
|
||||||
|
|||||||
Reference in New Issue
Block a user