94 lines
3.7 KiB
JavaScript
Raw Permalink Normal View History

2026-01-30 09:54:46 +08:00
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_libraries_apiLoading = require("../../common/libraries/apiLoading.js");
const gen_Apis = require("../../gen/Apis.js");
require("../../common/libraries/request.js");
require("../../common/store/useWeAppAuthStore.js");
require("../../common/store/useWatermarkStore.js");
require("../../common/store/useWorkStore.js");
if (!Array) {
const _easycom_uni_icons2 = common_vendor.resolveComponent("uni-icons");
_easycom_uni_icons2();
}
const _easycom_uni_icons = () => "../../uni_modules/uni-icons/components/uni-icons/uni-icons.js";
if (!Math) {
_easycom_uni_icons();
}
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
__name: "hs-radio-picker-accounts",
props: [
"title",
"required",
"borderTop",
"isLink",
"tip",
"value",
"url",
"isPlaceholder",
"padding",
"des",
"rightStyle",
"titleStyle",
"disabled",
"key",
"placeholder",
"params"
],
emits: ["change", "update:valueModel"],
setup(__props, { emit }) {
const props = __props;
const borderStyle = "1rpx solid #eee";
const paddingStyle = "15rpx 0";
const pickerList = common_vendor.ref([]);
const selectValue = common_vendor.ref("");
const onChange = (e) => {
let selectData = pickerList.value[e == null ? void 0 : e.detail.value];
selectValue.value = selectData == null ? void 0 : selectData.name;
emit("update:valueModel", (selectData == null ? void 0 : selectData.id) || "");
emit("change", selectData);
};
const getPickerList = () => {
common_libraries_apiLoading.getApiLoading(gen_Apis.Apis.Company.CompanyProjectReceiptAccounts.List, (props == null ? void 0 : props.params) || {}).then((res) => {
var _a;
(_a = res == null ? void 0 : res.data) == null ? void 0 : _a.map((i) => {
var _a2, _b, _c, _d, _e;
i.name = `${(_a2 = i == null ? void 0 : i.receipt_account) == null ? void 0 : _a2.company_name}/${(_b = i == null ? void 0 : i.receipt_account) == null ? void 0 : _b.company_bank}/${((_c = i == null ? void 0 : i.receipt_account) == null ? void 0 : _c.company_account) ? (_e = (_d = i == null ? void 0 : i.receipt_account) == null ? void 0 : _d.company_account) == null ? void 0 : _e.slice(-4) : ""}`;
});
pickerList.value = res == null ? void 0 : res.data;
console.log(res);
});
};
common_vendor.onMounted(() => {
getPickerList();
});
return (_ctx, _cache) => {
return common_vendor.e({
a: common_vendor.t((props == null ? void 0 : props.title) || "标题"),
b: __props.required
}, __props.required ? {} : {}, {
c: common_vendor.s(props.titleStyle),
d: selectValue.value
}, selectValue.value ? {
e: common_vendor.t(selectValue.value)
} : {
f: common_vendor.t((props == null ? void 0 : props.placeholder) || "请选择")
}, {
g: common_vendor.p({
type: "right",
color: "#333",
size: "12"
}),
h: common_vendor.s(props.rightStyle),
i: props.borderTop ? borderStyle : "",
j: (props == null ? void 0 : props.padding) || paddingStyle,
k: pickerList.value,
l: (props == null ? void 0 : props.key) || "name",
m: props == null ? void 0 : props.disabled,
n: common_vendor.o(onChange)
});
};
}
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-7c4bf5a2"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-radio-picker-accounts/hs-radio-picker-accounts.vue"]]);
wx.createComponent(Component);