diff --git a/src/api/system/SdbCashier/index.ts b/src/api/system/SdbCashier/index.ts
index a605128..ed99743 100644
--- a/src/api/system/SdbCashier/index.ts
+++ b/src/api/system/SdbCashier/index.ts
@@ -22,6 +22,8 @@ export const cashQuery = (data: { residentName?: string; queryType: number }): A
};
export type billlistType = {
+ actualAccount: string;
+ singleDiscountAmount: string;
'villageId': string;
'residentId': string;
'houseId': string;
diff --git a/src/components/Holder/house.vue b/src/components/Holder/house.vue
index d0f1f31..ccd4927 100644
--- a/src/components/Holder/house.vue
+++ b/src/components/Holder/house.vue
@@ -15,8 +15,8 @@
@@ -49,11 +49,19 @@
- 查询
+ 查询
重置
-
+
@@ -70,15 +78,15 @@
@@ -176,7 +184,7 @@ const handleUserSelection = () => {
const houseUseTypeList = ref([]);
const isFetching = ref(false);
// 获取列表
-function getlist() {
+function getList() {
isFetching.value = true; // 🔒 加锁:禁止 selection-change 更新数据
loading.value = true;
listBillHouse(queryParams.value)
@@ -195,39 +203,39 @@ function getlist() {
}
/** 楼栋列表 */
-const buildinglist = ref([]);
+const buildingList = ref([]);
/** 房屋列表 */
const unitlist = ref([]);
/** 获取楼栋 列表 */
function handleChangeHouse() {
getBuildinglistAPI().then((res) => {
- buildinglist.value = res.data;
+ buildingList.value = res.data;
});
}
function handleClear() {
queryParams.value.residentName = '';
- getlist();
+ getList();
}
function handleHouseUseChange() {
- getlist();
+ getList();
}
/** 单元列表 */
-function handleChangebuilding(val: string) {
+function handleChangeBuilding(val: string) {
queryParams.value.unitNoId = null;
unitlist.value = [];
if (queryParams.value.buildingId) {
getHouselistAPI(val).then((res) => {
unitlist.value = res.data.units;
- getlist();
+ getList();
});
}
- getlist();
+ getList();
}
function handleChangeUnit() {
- getlist();
+ getList();
}
// ==============================================
@@ -285,11 +293,11 @@ function resetQuery() {
houseNo: '',
residentName: ''
};
- getlist();
+ getList();
}
// 退出
-function conback() {
+function conBack() {
dialog.value.dialogVisible = false;
resetQuery();
}
@@ -338,7 +346,7 @@ defineExpose({
}) as BillHouse
);
}
- getlist();
+ getList();
dialog.value.dialogVisible = true;
listHouseUseType_add_house().then((res) => {
houseUseTypeList.value = res.data;
@@ -356,7 +364,7 @@ defineExpose({
border: 1px solid #ccc;
border-radius: 5px;
padding: 0 10px;
- .defaultbox {
+ .defaultBox {
display: flex;
align-items: center;
justify-content: space-between;
diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue
index 56fb3ab..138b8d2 100644
--- a/src/layout/components/Navbar.vue
+++ b/src/layout/components/Navbar.vue
@@ -34,13 +34,13 @@
-
+
{{ proxy.$t('navbar.community') }}
-
+
{{ proxy.$t('navbar.personalCenter') }}
-
+
{{ proxy.$t('navbar.logout') }}
@@ -109,7 +109,14 @@ const changecommunity = () => {
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 setLayout = () => {
emits('setLayout');
diff --git a/src/main.ts b/src/main.ts
index f3260eb..f810744 100644
--- a/src/main.ts
+++ b/src/main.ts
@@ -9,7 +9,6 @@ import App from './App.vue';
import store from './store';
import router from './router';
-
// 自定义指令
import directive from './directive';
import print from 'vue3-print-nb';
@@ -54,8 +53,8 @@ app.use(router);
app.use(store);
app.use(i18n);
app.use(VXETable);
-app.use(plugins);
app.use(print);
+app.use(plugins);
// 自定义指令
directive(app);
diff --git a/src/utils/money.ts b/src/utils/money.ts
index 3c5be0b..aee33ac 100644
--- a/src/utils/money.ts
+++ b/src/utils/money.ts
@@ -87,7 +87,7 @@ export function convertToChineseCapital(num: number | string): string {
* 标准化为Big实例,空/undefined/null转0
* @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);
return new Big(num);
}
@@ -112,6 +112,12 @@ export function maxMoney(a: string | number, b: string | number): number {
const bigB = toBig(b);
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
*/
@@ -119,6 +125,12 @@ export function sub(a: string | number, b: string | number): number {
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
*/
diff --git a/src/utils/print.ts b/src/utils/print.ts
index da56046..d07df24 100644
--- a/src/utils/print.ts
+++ b/src/utils/print.ts
@@ -275,228 +275,87 @@ export function printTicketDiv(elementId: string, title: string = '票据打印'
}
const win = window.open('', '_blank', 'width=1200,height=1000');
if (!win) return;
-
- // ==============================================
- // 【核心1】复制 全局样式 + Element Plus 样式
- // ==============================================
- const styles = Array.from(document.querySelectorAll('link[rel="stylesheet"], style:not([scoped])'))
- .map((item) => item.outerHTML)
- .join('');
- // ==============================================
- // 【核心2】手动注入打印区域的 scoped 样式(关键!)
- // ==============================================
+ const styles = '';
const printScopeStyle = `
-
-`;
-
- // ==============================================
- // 【核心3】写入新窗口
- // ==============================================
- win.document.write(`
-
-
-
- ${title}
-
- ${styles}
- ${printScopeStyle}
-
-
- ${el.outerHTML}
-
-
- `);
- 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 = `
-
`;
- // 只复制票据内部innerHTML,不带外层el-dialog多余结构
- const printContent = el.innerHTML;
-
- win.document.write(`
+ const html = `
@@ -506,10 +365,12 @@ export function printTicketDiv2(elementId: string, title: string = '票据打印
${printScopeStyle}
- ${printContent}
+ ${el.outerHTML}
- `);
+ `;
+
+ win.document.write(html);
win.document.close();
win.onload = () => {
setTimeout(() => {
diff --git a/src/views/system/Sdb/SdbBill/index.vue b/src/views/system/Sdb/SdbBill/index.vue
index c252866..2aa606e 100644
--- a/src/views/system/Sdb/SdbBill/index.vue
+++ b/src/views/system/Sdb/SdbBill/index.vue
@@ -88,6 +88,23 @@
style="width: 100%"
/>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+