invoice.js
4.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const common_hotel = require("../../common/hotel.js");
require("../../common/request.js");
require("../../config.js");
require("../../common/login.js");
require("../../common/api.js");
if (!Array) {
const _easycom_uni_load_more2 = common_vendor.resolveComponent("uni-load-more");
_easycom_uni_load_more2();
}
const _easycom_uni_load_more = () => "../../uni_modules/uni-load-more/components/uni-load-more/uni-load-more.js";
if (!Math) {
_easycom_uni_load_more();
}
const _sfc_main = {
__name: "invoice",
setup(__props) {
const list = common_vendor.ref([]);
common_vendor.ref(null);
const isLoadMore = common_vendor.ref(false);
const remarks = common_vendor.ref("");
const showFirst = common_vendor.ref(true);
const loadStatus = common_vendor.ref("loading");
const contentText = common_vendor.ref({
contentdown: "点击查看更多",
contentrefresh: "正在加载...",
contentnomore: "没有更多数据了"
});
const queryparam = common_vendor.ref({
pageNum: 1,
pageSize: 10
});
const currUser = common_vendor.index.getStorageSync("currUser");
const app = getApp();
common_vendor.onShow(() => {
list.value = [];
getList();
});
let activeId;
let kpType;
common_vendor.onLoad((option) => {
activeId = option.activeId;
remarks.value = JSON.parse(decodeURIComponent(option.remarks));
kpType = option.kpType;
});
function clickLoadMore() {
if (loadStatus.value == "nomore") {
return;
}
queryparam.value.pageNum += 1;
getList();
}
function getList() {
isLoadMore.value = false;
const venueId = app.globalData.venue.id;
common_hotel.getInvoiceByActiveId(activeId, currUser.userId, venueId).then((res) => {
list.value = res.rows;
});
}
function showDetail(b) {
let path = `/pages_hotel/hotel/invoiceDetail?invoiceId=${b.id}`;
common_vendor.index.navigateTo({
url: path
});
}
function editDetail(b) {
let path = `/pages_hotel/hotel/addInvoice?invoiceId=${b.id}&isEdit=true&kpType=${kpType}`;
common_vendor.index.navigateTo({
url: path
});
}
function closeFirst() {
showFirst.value = false;
app.globalData.showFirst = false;
}
function goAdd() {
const obj = encodeURIComponent(JSON.stringify(remarks.value));
let path = `/pages_hotel/hotel/canInvoiceBills?activeId=${activeId}&remarks=${obj}&kpType=${kpType}`;
common_vendor.index.navigateTo({
url: path
});
}
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.f(list.value, (b, k0, i0) => {
return common_vendor.e({
a: common_vendor.t(b.createTime),
b: b.invoiceForm == "1"
}, b.invoiceForm == "1" ? {} : {}, {
c: b.invoiceForm == "2"
}, b.invoiceForm == "2" ? {} : {}, {
d: b.invoiceForm == "3"
}, b.invoiceForm == "3" ? {} : {}, {
e: common_vendor.t(b.total),
f: b.isInvoice == "1"
}, b.isInvoice == "1" ? {} : {}, {
g: b.isInvoice == "0"
}, b.isInvoice == "0" ? {} : {}, {
h: b.isInvoice == "3"
}, b.isInvoice == "3" ? {} : {}, {
i: b.isInvoice == "2"
}, b.isInvoice == "2" ? {} : {}, {
j: b.isInvoice == "0"
}, b.isInvoice == "0" ? {
k: common_vendor.o(($event) => editDetail(b), b.id)
} : {}, {
l: common_vendor.o(($event) => showDetail(b), b.id),
m: b.id
});
}),
b: common_vendor.p({
status: loadStatus.value,
["content-text"]: contentText.value
}),
c: isLoadMore.value,
d: common_vendor.o(clickLoadMore),
e: list.value.length == 0
}, list.value.length == 0 ? {
f: common_assets._imports_0$4
} : {}, {
g: common_assets._imports_1$3,
h: common_vendor.o(goAdd),
i: showFirst.value
}, showFirst.value ? {
j: common_vendor.t(remarks.value),
k: common_vendor.o(closeFirst)
} : {});
};
}
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f05dbde4"], ["__file", "/Users/yangyang/project/j-mini/Venue/pages_hotel/hotel/invoice.vue"]]);
wx.createPage(MiniProgramPage);