2
This commit is contained in:
@@ -37,14 +37,14 @@ const _sfc_main = {
|
||||
showMore: false,
|
||||
SEG_ICONS: {
|
||||
sale: {
|
||||
out: "/static/icons/sale.png",
|
||||
return: "/static/icons/other-pay.png",
|
||||
collect: "/static/icons/report.png"
|
||||
out: "/static/icons/icons8-shopping-cart-100.png",
|
||||
return: "/static/icons/icons8-return-purchase-50.png",
|
||||
collect: "/static/icons/icons8-profit-50.png"
|
||||
},
|
||||
purchase: {
|
||||
in: "/static/icons/purchase.png",
|
||||
return: "/static/icons/other-pay.png",
|
||||
pay: "/static/icons/account.png"
|
||||
in: "/static/icons/icons8-purchase-order-100.png",
|
||||
return: "/static/icons/icons8-return-purchase-50.png",
|
||||
pay: "/static/icons/icons8-dollar-ethereum-exchange-50.png"
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -120,13 +120,33 @@ const _sfc_main = {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
fixMojibake(s) {
|
||||
try {
|
||||
if (!s)
|
||||
return s;
|
||||
const bad = /[ÂÃæåé¼½¢]/.test(s);
|
||||
if (!bad)
|
||||
return s;
|
||||
return decodeURIComponent(escape(s));
|
||||
} catch (_) {
|
||||
return s;
|
||||
}
|
||||
},
|
||||
normalizeCats(list) {
|
||||
if (!Array.isArray(list))
|
||||
return [];
|
||||
return list.map((it) => ({
|
||||
key: it && it.key || "",
|
||||
label: this.fixMojibake(it && it.label || "")
|
||||
})).filter((it) => it.key && it.label);
|
||||
},
|
||||
async fetchCategories() {
|
||||
try {
|
||||
const res = await common_http.get("/api/finance/categories");
|
||||
if (res && Array.isArray(res.incomeCategories))
|
||||
this._incomeCategories = res.incomeCategories;
|
||||
this._incomeCategories = this.normalizeCats(res.incomeCategories);
|
||||
if (res && Array.isArray(res.expenseCategories))
|
||||
this._expenseCategories = res.expenseCategories;
|
||||
this._expenseCategories = this.normalizeCats(res.expenseCategories);
|
||||
this.ensureActiveCategory();
|
||||
} catch (_) {
|
||||
this.ensureActiveCategory();
|
||||
@@ -392,10 +412,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
}, {
|
||||
ag: $data.biz === "sale" || $data.biz === "purchase",
|
||||
aG: !$data.items.length
|
||||
}, !$data.items.length ? {
|
||||
aH: common_assets._imports_0
|
||||
} : {
|
||||
aI: common_vendor.f($data.items, (it, idx, i0) => {
|
||||
}, !$data.items.length ? {} : {
|
||||
aH: common_vendor.f($data.items, (it, idx, i0) => {
|
||||
return {
|
||||
a: common_vendor.t(it.productName),
|
||||
b: common_vendor.o([common_vendor.m(($event) => it.quantity = $event.detail.value, {
|
||||
@@ -411,8 +429,8 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
||||
};
|
||||
})
|
||||
}, {
|
||||
aJ: common_vendor.o((...args) => $options.saveAndReset && $options.saveAndReset(...args)),
|
||||
aK: common_vendor.o((...args) => $options.submit && $options.submit(...args))
|
||||
aI: common_vendor.o((...args) => $options.saveAndReset && $options.saveAndReset(...args)),
|
||||
aJ: common_vendor.o((...args) => $options.submit && $options.submit(...args))
|
||||
});
|
||||
}
|
||||
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
||||
|
||||
Reference in New Issue
Block a user