sun-biz 0.0.4-beta.62 → 0.0.4-beta.63
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +76 -51
- package/dist/index.d.ts +1 -1
- package/dist/index.js +481 -75
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -1228,6 +1228,7 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
|
|
|
1228
1228
|
"close-on-click-modal": _ctx.closeOnClickModal,
|
|
1229
1229
|
modelValue: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(visible),
|
|
1230
1230
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event)=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.isRef)(visible) ? visible.value = $event : null),
|
|
1231
|
+
"append-to-body": "",
|
|
1231
1232
|
onClose: justCloseDialog
|
|
1232
1233
|
}), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
|
|
1233
1234
|
header: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(({ titleClass })=>[
|
|
@@ -8135,9 +8136,11 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
8135
8136
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
|
|
8136
8137
|
const instance = (0, __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance)();
|
|
8137
8138
|
const componentId = instance?.uid || Math.random(); // 唯一标识当前组件实例
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
const
|
|
8139
|
+
// 使用 shallowRef 存储组件引用,避免 Vue 深度代理组件实例
|
|
8140
|
+
// 这可以防止生产环境中 emitsOptions 为 null 的问题
|
|
8141
|
+
const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8142
|
+
const selectRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8143
|
+
const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8141
8144
|
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
8142
8145
|
const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
8143
8146
|
const currentRowIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
|
|
@@ -8233,48 +8236,60 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
8233
8236
|
};
|
|
8234
8237
|
const getBizUnitList = async (data)=>{
|
|
8235
8238
|
loading.value = true;
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
|
|
8250
|
-
orgId: item.value || item.orgId,
|
|
8251
|
-
orgNameDisplay: item.label || item.orgNameDisplay,
|
|
8252
|
-
value: item.value || item.orgId,
|
|
8253
|
-
label: item.label || item.orgNameDisplay
|
|
8254
|
-
}));
|
|
8255
|
-
let list = (res.data ?? []).map((item)=>({
|
|
8256
|
-
...item,
|
|
8257
|
-
label: item.orgNameDisplay,
|
|
8258
|
-
value: item.orgId
|
|
8259
|
-
}));
|
|
8260
|
-
if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
|
|
8261
|
-
...list,
|
|
8262
|
-
...defaultList
|
|
8263
|
-
], 'orgId');
|
|
8264
|
-
bizUnitList.value = list;
|
|
8265
|
-
currentRowIndex.value = -1;
|
|
8266
|
-
tableRef.value?.eleTable?.setCurrentRow?.(void 0);
|
|
8267
|
-
if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
|
|
8268
|
-
const list = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
|
|
8269
|
-
tableRef.value?.eleTable?.clearSelection();
|
|
8270
|
-
bizUnitList.value.forEach((item)=>{
|
|
8271
|
-
if (list.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
|
|
8272
|
-
});
|
|
8239
|
+
try {
|
|
8240
|
+
const [err, res] = await queryBizUnitList({
|
|
8241
|
+
...data,
|
|
8242
|
+
hospitalId: props.hospitalId,
|
|
8243
|
+
orgTypeCodes: props.orgTypeCodes,
|
|
8244
|
+
enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
|
|
8245
|
+
encounterTypeCode: props.encounterTypeCode,
|
|
8246
|
+
deptId: props.deptId,
|
|
8247
|
+
orgLocationId: props.orgLocationId
|
|
8248
|
+
});
|
|
8249
|
+
loading.value = false; // 处理请求错误或响应异常的情况
|
|
8250
|
+
if (err || !res) {
|
|
8251
|
+
console.warn('[BizUnitSelect] 获取业务单元列表失败:', err);
|
|
8252
|
+
return;
|
|
8273
8253
|
}
|
|
8274
|
-
|
|
8254
|
+
if (res?.success) {
|
|
8255
|
+
let defaultList = [];
|
|
8256
|
+
if (attrs.modelValue && Array.isArray(props.defaultValue) && props.defaultValue.length && !data?.keyWord) defaultList = props.defaultValue.map((item)=>({
|
|
8257
|
+
...item,
|
|
8258
|
+
orgId: item.value || item.orgId,
|
|
8259
|
+
orgNameDisplay: item.label || item.orgNameDisplay,
|
|
8260
|
+
value: item.value || item.orgId,
|
|
8261
|
+
label: item.label || item.orgNameDisplay
|
|
8262
|
+
}));
|
|
8263
|
+
// 确保 res.data 是数组,处理 null/undefined 的情况
|
|
8264
|
+
const responseData = Array.isArray(res.data) ? res.data : [];
|
|
8265
|
+
let list = responseData.map((item)=>({
|
|
8266
|
+
...item,
|
|
8267
|
+
label: item.orgNameDisplay,
|
|
8268
|
+
value: item.orgId
|
|
8269
|
+
}));
|
|
8270
|
+
if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
|
|
8271
|
+
...list,
|
|
8272
|
+
...defaultList
|
|
8273
|
+
], 'orgId');
|
|
8274
|
+
bizUnitList.value = list;
|
|
8275
|
+
currentRowIndex.value = -1;
|
|
8276
|
+
tableRef.value?.eleTable?.setCurrentRow?.(void 0);
|
|
8277
|
+
if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
|
|
8278
|
+
const selectedList = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
|
|
8279
|
+
tableRef.value?.eleTable?.clearSelection();
|
|
8280
|
+
bizUnitList.value.forEach((item)=>{
|
|
8281
|
+
if (selectedList.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
|
|
8282
|
+
});
|
|
8283
|
+
}
|
|
8284
|
+
defaultSetTableSelected.value = true;
|
|
8285
|
+
}
|
|
8286
|
+
const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
|
|
8287
|
+
if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
|
|
8288
|
+
} catch (error) {
|
|
8289
|
+
console.error('[BizUnitSelect] 获取业务单元列表异常:', error);
|
|
8290
|
+
} finally{
|
|
8291
|
+
loading.value = false;
|
|
8275
8292
|
}
|
|
8276
|
-
const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
|
|
8277
|
-
if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
|
|
8278
8293
|
};
|
|
8279
8294
|
const handleChange = ()=>{
|
|
8280
8295
|
let value = selectedRows.value.map((item)=>item.value || item.orgId);
|
|
@@ -8521,10 +8536,9 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
8521
8536
|
handleBlur();
|
|
8522
8537
|
};
|
|
8523
8538
|
const visibleChange = (val)=>{
|
|
8524
|
-
if (val)
|
|
8525
|
-
|
|
8526
|
-
|
|
8527
|
-
}
|
|
8539
|
+
if (val) // loading 状态完全由 getBizUnitList 函数控制
|
|
8540
|
+
// 如果在这里设置 loading = true,但不触发数据加载,会导致 loading 状态不会被重置
|
|
8541
|
+
handleFocus();
|
|
8528
8542
|
};
|
|
8529
8543
|
__expose({
|
|
8530
8544
|
popoverRef,
|
|
@@ -10170,6 +10184,17 @@ function useConfigData_useFormConfig(options) {
|
|
|
10170
10184
|
});
|
|
10171
10185
|
const charge_order_dialog_table_select_exports_ = table_selectvue_type_script_setup_true_lang_ts;
|
|
10172
10186
|
/* ESM default export */ const charge_order_dialog_table_select = charge_order_dialog_table_select_exports_;
|
|
10187
|
+
// 使用 markRaw 包装组件,防止 Vue 对组件进行响应式代理
|
|
10188
|
+
// 这可以解决生产环境中 emitsOptions 为 null 的问题
|
|
10189
|
+
const TableSelect = (0, __WEBPACK_EXTERNAL_MODULE_vue__.markRaw)(charge_order_dialog_table_select); // 用于存储 TableSelect 组件实例的 Map,避免在 JSX 中使用 ref 回调函数
|
|
10190
|
+
const tableSelectRefMap = new Map(); // 获取 TableSelect 组件实例
|
|
10191
|
+
function getTableSelectRef(key) {
|
|
10192
|
+
return tableSelectRefMap.get(key);
|
|
10193
|
+
} // 设置 TableSelect 组件实例
|
|
10194
|
+
function setTableSelectRef(key, el) {
|
|
10195
|
+
if (el) tableSelectRefMap.set(key, el);
|
|
10196
|
+
else tableSelectRefMap.delete(key);
|
|
10197
|
+
} // 清除 TableSelect 组件实例
|
|
10173
10198
|
function useChargeTableConfig() {
|
|
10174
10199
|
const data = useColumnConfig({
|
|
10175
10200
|
getData: (t)=>[
|
|
@@ -10239,8 +10264,8 @@ function useFeeColumnConfig(options) {
|
|
|
10239
10264
|
],
|
|
10240
10265
|
render: (row)=>row.commodityNo ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
|
|
10241
10266
|
row.commodityNameDisplay
|
|
10242
|
-
]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(
|
|
10243
|
-
ref: (el)=>row.
|
|
10267
|
+
]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableSelect, {
|
|
10268
|
+
ref: (el)=>setTableSelectRef(row.key, el),
|
|
10244
10269
|
classOptions: "",
|
|
10245
10270
|
clearable: false,
|
|
10246
10271
|
filterable: true,
|
|
@@ -10261,11 +10286,11 @@ function useFeeColumnConfig(options) {
|
|
|
10261
10286
|
const chargeItem = chargeItemList?.value?.find((item)=>item.commodityId === currentRow.commodityId);
|
|
10262
10287
|
if (!chargeItem?.price && chargeItem?.price !== 0) {
|
|
10263
10288
|
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('添加失败!当前项目缺少价格信息,请联系管理员进行维护!');
|
|
10264
|
-
row.
|
|
10289
|
+
getTableSelectRef(row.key)?.clear();
|
|
10265
10290
|
return;
|
|
10266
10291
|
}
|
|
10267
10292
|
row.selectLabel = chargeItem.commodityNameDisplay;
|
|
10268
|
-
row.
|
|
10293
|
+
getTableSelectRef(row.key)?.setCurrentRow(chargeItem);
|
|
10269
10294
|
row.commodityId = chargeItem.commodityId;
|
|
10270
10295
|
row.commodityNo = chargeItem.commodityNo;
|
|
10271
10296
|
row.commoditySpec = chargeItem.commoditySpec;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export * from './components/invoice/index.ts';
|
|
|
7
7
|
export * from './components/table-select';
|
|
8
8
|
export * from './components/charge-order-dialog';
|
|
9
9
|
export { Title } from './components/title';
|
|
10
|
-
export { DictSelect, FlagSelect, HospitalSelect, TagSelect, UserSelect, BizUnitSelect, DepartmentSelect, WardSelect, } from './components/biz-select';
|
|
10
|
+
export { DictSelect, FlagSelect, HospitalSelect, TagSelect, UserSelect, BizUnitSelect, DepartmentSelect, HospitalChargeSelect, WardSelect, } from './components/biz-select';
|
|
11
11
|
export type { TagGroupInfo } from './components/biz-select';
|
|
12
12
|
export { CopyTextWithTooltip } from './components/copy-text-with-tooltip';
|
|
13
13
|
export { FormDesignRender } from './components/form-design-render';
|
package/dist/index.js
CHANGED
|
@@ -1264,6 +1264,7 @@ const pro_dialogvue_type_script_setup_true_lang_ts_name_ProDialog_hoisted_2 = {
|
|
|
1264
1264
|
"close-on-click-modal": _ctx.closeOnClickModal,
|
|
1265
1265
|
modelValue: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(visible),
|
|
1266
1266
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event)=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.isRef)(visible) ? visible.value = $event : null),
|
|
1267
|
+
"append-to-body": "",
|
|
1267
1268
|
onClose: justCloseDialog
|
|
1268
1269
|
}), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
|
|
1269
1270
|
header: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(({ titleClass })=>[
|
|
@@ -4448,8 +4449,8 @@ function icon_combinevue_type_template_id_80fc0d0e_render(_ctx, _cache) {
|
|
|
4448
4449
|
], -1)
|
|
4449
4450
|
]));
|
|
4450
4451
|
}
|
|
4451
|
-
const
|
|
4452
|
-
const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(
|
|
4452
|
+
const script = {};
|
|
4453
|
+
const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(script, [
|
|
4453
4454
|
[
|
|
4454
4455
|
'render',
|
|
4455
4456
|
icon_combinevue_type_template_id_80fc0d0e_render
|
|
@@ -8623,9 +8624,11 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
8623
8624
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
|
|
8624
8625
|
const instance = (0, __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance)();
|
|
8625
8626
|
const componentId = instance?.uid || Math.random(); // 唯一标识当前组件实例
|
|
8626
|
-
|
|
8627
|
-
|
|
8628
|
-
const
|
|
8627
|
+
// 使用 shallowRef 存储组件引用,避免 Vue 深度代理组件实例
|
|
8628
|
+
// 这可以防止生产环境中 emitsOptions 为 null 的问题
|
|
8629
|
+
const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8630
|
+
const selectRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8631
|
+
const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef)();
|
|
8629
8632
|
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
8630
8633
|
const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
8631
8634
|
const currentRowIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
|
|
@@ -8721,48 +8724,60 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
8721
8724
|
};
|
|
8722
8725
|
const getBizUnitList = async (data)=>{
|
|
8723
8726
|
loading.value = true;
|
|
8724
|
-
|
|
8725
|
-
|
|
8726
|
-
|
|
8727
|
-
|
|
8728
|
-
|
|
8729
|
-
|
|
8730
|
-
|
|
8731
|
-
|
|
8732
|
-
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
orgId: item.value || item.orgId,
|
|
8739
|
-
orgNameDisplay: item.label || item.orgNameDisplay,
|
|
8740
|
-
value: item.value || item.orgId,
|
|
8741
|
-
label: item.label || item.orgNameDisplay
|
|
8742
|
-
}));
|
|
8743
|
-
let list = (res.data ?? []).map((item)=>({
|
|
8744
|
-
...item,
|
|
8745
|
-
label: item.orgNameDisplay,
|
|
8746
|
-
value: item.orgId
|
|
8747
|
-
}));
|
|
8748
|
-
if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
|
|
8749
|
-
...list,
|
|
8750
|
-
...defaultList
|
|
8751
|
-
], 'orgId');
|
|
8752
|
-
bizUnitList.value = list;
|
|
8753
|
-
currentRowIndex.value = -1;
|
|
8754
|
-
tableRef.value?.eleTable?.setCurrentRow?.(void 0);
|
|
8755
|
-
if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
|
|
8756
|
-
const list = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
|
|
8757
|
-
tableRef.value?.eleTable?.clearSelection();
|
|
8758
|
-
bizUnitList.value.forEach((item)=>{
|
|
8759
|
-
if (list.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
|
|
8760
|
-
});
|
|
8727
|
+
try {
|
|
8728
|
+
const [err, res] = await queryBizUnitList({
|
|
8729
|
+
...data,
|
|
8730
|
+
hospitalId: props.hospitalId,
|
|
8731
|
+
orgTypeCodes: props.orgTypeCodes,
|
|
8732
|
+
enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
|
|
8733
|
+
encounterTypeCode: props.encounterTypeCode,
|
|
8734
|
+
deptId: props.deptId,
|
|
8735
|
+
orgLocationId: props.orgLocationId
|
|
8736
|
+
});
|
|
8737
|
+
loading.value = false; // 处理请求错误或响应异常的情况
|
|
8738
|
+
if (err || !res) {
|
|
8739
|
+
console.warn('[BizUnitSelect] 获取业务单元列表失败:', err);
|
|
8740
|
+
return;
|
|
8761
8741
|
}
|
|
8762
|
-
|
|
8742
|
+
if (res?.success) {
|
|
8743
|
+
let defaultList = [];
|
|
8744
|
+
if (attrs.modelValue && Array.isArray(props.defaultValue) && props.defaultValue.length && !data?.keyWord) defaultList = props.defaultValue.map((item)=>({
|
|
8745
|
+
...item,
|
|
8746
|
+
orgId: item.value || item.orgId,
|
|
8747
|
+
orgNameDisplay: item.label || item.orgNameDisplay,
|
|
8748
|
+
value: item.value || item.orgId,
|
|
8749
|
+
label: item.label || item.orgNameDisplay
|
|
8750
|
+
}));
|
|
8751
|
+
// 确保 res.data 是数组,处理 null/undefined 的情况
|
|
8752
|
+
const responseData = Array.isArray(res.data) ? res.data : [];
|
|
8753
|
+
let list = responseData.map((item)=>({
|
|
8754
|
+
...item,
|
|
8755
|
+
label: item.orgNameDisplay,
|
|
8756
|
+
value: item.orgId
|
|
8757
|
+
}));
|
|
8758
|
+
if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
|
|
8759
|
+
...list,
|
|
8760
|
+
...defaultList
|
|
8761
|
+
], 'orgId');
|
|
8762
|
+
bizUnitList.value = list;
|
|
8763
|
+
currentRowIndex.value = -1;
|
|
8764
|
+
tableRef.value?.eleTable?.setCurrentRow?.(void 0);
|
|
8765
|
+
if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
|
|
8766
|
+
const selectedList = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
|
|
8767
|
+
tableRef.value?.eleTable?.clearSelection();
|
|
8768
|
+
bizUnitList.value.forEach((item)=>{
|
|
8769
|
+
if (selectedList.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
|
|
8770
|
+
});
|
|
8771
|
+
}
|
|
8772
|
+
defaultSetTableSelected.value = true;
|
|
8773
|
+
}
|
|
8774
|
+
const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
|
|
8775
|
+
if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
|
|
8776
|
+
} catch (error) {
|
|
8777
|
+
console.error('[BizUnitSelect] 获取业务单元列表异常:', error);
|
|
8778
|
+
} finally{
|
|
8779
|
+
loading.value = false;
|
|
8763
8780
|
}
|
|
8764
|
-
const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
|
|
8765
|
-
if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
|
|
8766
8781
|
};
|
|
8767
8782
|
const handleChange = ()=>{
|
|
8768
8783
|
let value = selectedRows.value.map((item)=>item.value || item.orgId);
|
|
@@ -9009,10 +9024,9 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
|
|
|
9009
9024
|
handleBlur();
|
|
9010
9025
|
};
|
|
9011
9026
|
const visibleChange = (val)=>{
|
|
9012
|
-
if (val)
|
|
9013
|
-
|
|
9014
|
-
|
|
9015
|
-
}
|
|
9027
|
+
if (val) // loading 状态完全由 getBizUnitList 函数控制
|
|
9028
|
+
// 如果在这里设置 loading = true,但不触发数据加载,会导致 loading 状态不会被重置
|
|
9029
|
+
handleFocus();
|
|
9016
9030
|
};
|
|
9017
9031
|
__expose({
|
|
9018
9032
|
popoverRef,
|
|
@@ -10042,28 +10056,409 @@ const hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalCha
|
|
|
10042
10056
|
};
|
|
10043
10057
|
// 全局事件:用于关闭其他实例的 popover
|
|
10044
10058
|
const hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_CLOSE_OTHER_POPOVERS_EVENT = 'hospital-charge-select:close-others';
|
|
10045
|
-
/* ESM default export */ ({
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10059
|
+
/* ESM default export */ const hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
10060
|
+
__name: 'index',
|
|
10061
|
+
props: /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeModels)({
|
|
10062
|
+
hospitalId: {},
|
|
10063
|
+
encounterTypeCode: {},
|
|
10064
|
+
priceAt: {},
|
|
10065
|
+
size: {
|
|
10066
|
+
default: 'default'
|
|
10067
|
+
},
|
|
10068
|
+
immediate: {
|
|
10069
|
+
type: Boolean,
|
|
10070
|
+
default: false
|
|
10071
|
+
},
|
|
10072
|
+
popoverWidth: {
|
|
10073
|
+
default: 1000
|
|
10074
|
+
}
|
|
10075
|
+
}, {
|
|
10076
|
+
modelValue: {},
|
|
10077
|
+
modelModifiers: {}
|
|
10078
|
+
}),
|
|
10079
|
+
emits: /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeModels)([
|
|
10080
|
+
"change"
|
|
10081
|
+
], [
|
|
10082
|
+
"update:modelValue"
|
|
10083
|
+
]),
|
|
10084
|
+
setup (__props, { expose: __expose, emit: __emit }) {
|
|
10085
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.useCssVars)((_ctx)=>({
|
|
10086
|
+
"2f25a0af": dynamicMaxHeight.value + "px"
|
|
10087
|
+
}));
|
|
10088
|
+
const model = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useModel)(__props, "modelValue");
|
|
10089
|
+
const props = __props;
|
|
10090
|
+
const emit = __emit;
|
|
10091
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
|
|
10092
|
+
const instance = (0, __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance)();
|
|
10093
|
+
const componentId = instance?.uid || Math.random(); // 唯一标识当前组件实例
|
|
10094
|
+
const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
10095
|
+
const inputSearchRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
10096
|
+
const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
10097
|
+
const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
10098
|
+
const inputValue = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('');
|
|
10099
|
+
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
10100
|
+
const tableData = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
|
|
10101
|
+
const currentRow = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
10102
|
+
const currentRowIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
|
|
10103
|
+
const dynamicMaxHeight = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(300); // 表格列配置
|
|
10104
|
+
const columns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>[
|
|
10105
|
+
{
|
|
10106
|
+
type: 'index',
|
|
10107
|
+
label: '序号',
|
|
10108
|
+
width: 60,
|
|
10109
|
+
align: 'center'
|
|
10110
|
+
},
|
|
10111
|
+
{
|
|
10112
|
+
prop: 'commodityNo',
|
|
10113
|
+
label: '编码',
|
|
10114
|
+
width: 120,
|
|
10115
|
+
showOverflowTooltip: true
|
|
10116
|
+
},
|
|
10117
|
+
{
|
|
10118
|
+
prop: 'commodityNameDisplay',
|
|
10119
|
+
label: '名称',
|
|
10120
|
+
minWidth: 350,
|
|
10121
|
+
showOverflowTooltip: true,
|
|
10122
|
+
render: (row)=>{
|
|
10123
|
+
const hasPrice = null !== row.price && void 0 !== row.price;
|
|
10124
|
+
if (!hasPrice) return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("div", null, [
|
|
10125
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
|
|
10126
|
+
row.commodityNameDisplay
|
|
10127
|
+
]),
|
|
10128
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-text"), {
|
|
10129
|
+
type: "danger",
|
|
10130
|
+
style: "margin-left: 8px;"
|
|
10131
|
+
}, {
|
|
10132
|
+
default: ()=>[
|
|
10133
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-icon"), null, {
|
|
10134
|
+
default: ()=>[
|
|
10135
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(__WEBPACK_EXTERNAL_MODULE__element_sun_icons_vue__.InfoFilled, null, null)
|
|
10136
|
+
]
|
|
10137
|
+
}),
|
|
10138
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("\u5F53\u524D\u6536\u8D39\u9879\u76EE\u7684\u4EF7\u683C\u6709\u8BEF\uFF0C\u65E0\u6CD5\u9009\u62E9\uFF01")
|
|
10139
|
+
],
|
|
10140
|
+
_: 1
|
|
10141
|
+
})
|
|
10142
|
+
]);
|
|
10143
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
|
|
10144
|
+
row.commodityNameDisplay
|
|
10145
|
+
]);
|
|
10146
|
+
}
|
|
10147
|
+
},
|
|
10148
|
+
{
|
|
10149
|
+
prop: 'commoditySpec',
|
|
10150
|
+
label: '规格',
|
|
10151
|
+
width: 100,
|
|
10152
|
+
showOverflowTooltip: true,
|
|
10153
|
+
render: (row)=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
|
|
10154
|
+
row.commoditySpec || '--'
|
|
10155
|
+
])
|
|
10156
|
+
},
|
|
10157
|
+
{
|
|
10158
|
+
prop: 'price',
|
|
10159
|
+
label: '价格',
|
|
10160
|
+
minWidth: 80,
|
|
10161
|
+
render: (row)=>{
|
|
10162
|
+
const hasPrice = null !== row.price && void 0 !== row.price;
|
|
10163
|
+
if (hasPrice) return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
|
|
10164
|
+
row.price.toFixed(2)
|
|
10165
|
+
]);
|
|
10166
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("span", null, [
|
|
10167
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)("--")
|
|
10168
|
+
]);
|
|
10169
|
+
}
|
|
10170
|
+
},
|
|
10171
|
+
{
|
|
10172
|
+
prop: 'unitName',
|
|
10173
|
+
label: '单位',
|
|
10174
|
+
width: 60,
|
|
10175
|
+
align: 'center'
|
|
10176
|
+
}
|
|
10177
|
+
]); // 判断行是否可选择(价格有效才能选择)
|
|
10178
|
+
const isRowSelectable = (row)=>null !== row.price && void 0 !== row.price; // 获取行的class名称(用于置灰不可选择的行)
|
|
10179
|
+
const getRowClassName = ({ row })=>{
|
|
10180
|
+
if (!isRowSelectable(row)) return 'cursor-not-allowed !bg-gray-100 text-gray-300';
|
|
10181
|
+
return 'cursor-pointer';
|
|
10182
|
+
}; // 查询收费项目列表
|
|
10183
|
+
const fetchChargeItems = async (keyword)=>{
|
|
10184
|
+
if (!props.hospitalId || !props.priceAt) {
|
|
10185
|
+
console.warn('hospitalId and priceAt are required');
|
|
10186
|
+
return;
|
|
10187
|
+
}
|
|
10188
|
+
loading.value = true;
|
|
10189
|
+
try {
|
|
10190
|
+
const params = {
|
|
10191
|
+
hospitalId: props.hospitalId,
|
|
10192
|
+
priceAt: props.priceAt,
|
|
10193
|
+
keyWord: keyword || void 0,
|
|
10194
|
+
encounterTypeCode: props.encounterTypeCode
|
|
10195
|
+
};
|
|
10196
|
+
const [error, result] = await queryHospitalChargeItemListByExample(params);
|
|
10197
|
+
if (!error && result) {
|
|
10198
|
+
tableData.value = result.data || [];
|
|
10199
|
+
currentRowIndex.value = -1;
|
|
10200
|
+
tableRef.value?.proTableRef?.setCurrentRow?.(void 0);
|
|
10201
|
+
} else tableData.value = [];
|
|
10202
|
+
} catch (error) {
|
|
10203
|
+
console.error('Failed to fetch hospital charge items:', error);
|
|
10204
|
+
tableData.value = [];
|
|
10205
|
+
} finally{
|
|
10206
|
+
loading.value = false;
|
|
10207
|
+
}
|
|
10208
|
+
}; // 处理输入框输入
|
|
10209
|
+
const handleInput = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(async function(v) {
|
|
10210
|
+
await fetchChargeItems(v);
|
|
10211
|
+
popoverVisible.value = true;
|
|
10212
|
+
}, 500); // 处理行点击
|
|
10213
|
+
const handleRowClick = (row)=>{
|
|
10214
|
+
if (!isRowSelectable(row)) {
|
|
10215
|
+
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.warning('当前收费项目价格有误,无法选择!');
|
|
10216
|
+
return;
|
|
10217
|
+
} // 如果点击的是当前已选中的行,则取消选择
|
|
10218
|
+
if (currentRow.value && row.hospitalCommodityId === currentRow.value.hospitalCommodityId) {
|
|
10219
|
+
currentRow.value = void 0;
|
|
10220
|
+
model.value = void 0;
|
|
10221
|
+
tableRef.value?.proTableRef?.setCurrentRow(void 0); // 清空时,先 emit 事件再关闭 popover
|
|
10222
|
+
emit('change', void 0);
|
|
10223
|
+
} else {
|
|
10224
|
+
currentRow.value = row;
|
|
10225
|
+
model.value = row; // 选择时,先 emit 事件再关闭 popover
|
|
10226
|
+
emit('change', row);
|
|
10227
|
+
} // 单选模式下选择后关闭popover
|
|
10228
|
+
popoverVisible.value = false;
|
|
10229
|
+
}; // 计算动态最大高度
|
|
10230
|
+
const calculateDynamicMaxHeight = ()=>{
|
|
10231
|
+
const input = inputSearchRef.value?.$el;
|
|
10232
|
+
if (!input) return 300;
|
|
10233
|
+
const inputRect = input.getBoundingClientRect();
|
|
10234
|
+
const viewportHeight = window.innerHeight;
|
|
10235
|
+
const padding = 32; // 上下padding总和
|
|
10236
|
+
// 计算下方和上方的可用空间
|
|
10237
|
+
const spaceBelow = viewportHeight - inputRect.bottom - padding;
|
|
10238
|
+
const spaceAbove = inputRect.top - padding; // 取两者中较大的一个,但不超过400px,不小于200px
|
|
10239
|
+
const availableSpace = Math.max(spaceBelow, spaceAbove);
|
|
10240
|
+
const maxHeight = Math.min(Math.max(availableSpace, 200), 400);
|
|
10241
|
+
dynamicMaxHeight.value = Math.floor(maxHeight);
|
|
10242
|
+
}; // 切换popover显示
|
|
10243
|
+
const toggleVisible = ()=>{
|
|
10244
|
+
window.dispatchEvent(new CustomEvent(hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_CLOSE_OTHER_POPOVERS_EVENT, {
|
|
10245
|
+
detail: {
|
|
10246
|
+
componentId
|
|
10247
|
+
}
|
|
10248
|
+
})); // 计算动态高度
|
|
10249
|
+
calculateDynamicMaxHeight();
|
|
10250
|
+
popoverVisible.value = true;
|
|
10251
|
+
if (popoverVisible.value) fetchChargeItems(inputValue.value);
|
|
10252
|
+
}; // 点击外部关闭popover
|
|
10253
|
+
const handleClickOutside = (e)=>{
|
|
10254
|
+
if (e.target === inputSearchRef.value?.$el) return;
|
|
10255
|
+
popoverVisible.value = false;
|
|
10256
|
+
}; // 重置
|
|
10257
|
+
const reset = ()=>{
|
|
10258
|
+
inputValue.value = '';
|
|
10259
|
+
model.value = void 0;
|
|
10260
|
+
currentRow.value = void 0;
|
|
10261
|
+
tableData.value = [];
|
|
10262
|
+
}; // 清空输入
|
|
10263
|
+
const handleClear = ()=>{
|
|
10264
|
+
reset();
|
|
10265
|
+
emit('change', void 0);
|
|
10266
|
+
}; // 滚动到当前选中行
|
|
10267
|
+
const scrollToCurrentRow = ()=>{
|
|
10268
|
+
setTimeout(()=>{
|
|
10269
|
+
if (currentRowIndex.value < 0) return;
|
|
10270
|
+
try {
|
|
10271
|
+
const tableElement = tableRef.value?.proTableRef?.$el;
|
|
10272
|
+
if (!tableElement) return; // 查找当前高亮的行
|
|
10273
|
+
const currentRowElement = tableElement.querySelector('.el-table__body tr.current-row');
|
|
10274
|
+
if (!currentRowElement) return; // 使用 scrollIntoView 方法滚动到当前行
|
|
10275
|
+
currentRowElement.scrollIntoView({
|
|
10276
|
+
block: 'nearest',
|
|
10277
|
+
behavior: 'smooth'
|
|
10278
|
+
});
|
|
10279
|
+
} catch (error) {
|
|
10280
|
+
console.error('Error scrolling to current row:', error);
|
|
10281
|
+
}
|
|
10282
|
+
}, 100);
|
|
10283
|
+
}; // 键盘事件
|
|
10284
|
+
const handleKeydown = (e)=>{
|
|
10285
|
+
if (!tableData.value.length || !popoverVisible.value) return;
|
|
10286
|
+
if ('ArrowDown' === e.key) {
|
|
10287
|
+
e.preventDefault(); // 向下查找下一个可选择的行
|
|
10288
|
+
let nextIndex = currentRowIndex.value + 1;
|
|
10289
|
+
while(nextIndex < tableData.value.length){
|
|
10290
|
+
if (isRowSelectable(tableData.value[nextIndex])) {
|
|
10291
|
+
currentRowIndex.value = nextIndex;
|
|
10292
|
+
tableRef.value?.proTableRef?.setCurrentRow(tableData.value[nextIndex]);
|
|
10293
|
+
scrollToCurrentRow();
|
|
10294
|
+
break;
|
|
10295
|
+
}
|
|
10296
|
+
nextIndex++;
|
|
10297
|
+
}
|
|
10298
|
+
} else if ('ArrowUp' === e.key) {
|
|
10299
|
+
e.preventDefault(); // 向上查找上一个可选择的行
|
|
10300
|
+
let prevIndex = currentRowIndex.value - 1;
|
|
10301
|
+
while(prevIndex >= 0){
|
|
10302
|
+
if (isRowSelectable(tableData.value[prevIndex])) {
|
|
10303
|
+
currentRowIndex.value = prevIndex;
|
|
10304
|
+
tableRef.value?.proTableRef?.setCurrentRow(tableData.value[prevIndex]);
|
|
10305
|
+
scrollToCurrentRow();
|
|
10306
|
+
break;
|
|
10307
|
+
}
|
|
10308
|
+
prevIndex--;
|
|
10309
|
+
}
|
|
10310
|
+
} else if ('Enter' === e.key && currentRowIndex.value >= 0) {
|
|
10311
|
+
e.preventDefault();
|
|
10312
|
+
const row = tableData.value[currentRowIndex.value];
|
|
10313
|
+
handleRowClick(row);
|
|
10314
|
+
}
|
|
10315
|
+
}; // 监听popover显示状态,管理键盘事件监听器
|
|
10316
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>popoverVisible.value, (val)=>{
|
|
10317
|
+
if (val) document.addEventListener('keydown', handleKeydown, true);
|
|
10318
|
+
else document.removeEventListener('keydown', handleKeydown, true);
|
|
10319
|
+
}); // 监听其他实例的关闭事件
|
|
10320
|
+
const handleCloseOtherPopovers = (event)=>{
|
|
10321
|
+
const customEvent = event;
|
|
10322
|
+
if (customEvent.detail?.componentId !== componentId) popoverVisible.value = false;
|
|
10323
|
+
}; // 根据ID获取收费项目详情(用于回显)
|
|
10324
|
+
const fetchItemById = async (hospitalCommodityId)=>{
|
|
10325
|
+
if (!props.hospitalId || !props.priceAt) {
|
|
10326
|
+
console.warn('hospitalId and priceAt are required for fetching item details');
|
|
10327
|
+
return;
|
|
10328
|
+
}
|
|
10329
|
+
try {
|
|
10330
|
+
const params = {
|
|
10331
|
+
hospitalId: props.hospitalId,
|
|
10332
|
+
priceAt: props.priceAt,
|
|
10333
|
+
hospitalCommodityIds: [
|
|
10334
|
+
hospitalCommodityId
|
|
10335
|
+
],
|
|
10336
|
+
encounterTypeCode: props.encounterTypeCode
|
|
10337
|
+
};
|
|
10338
|
+
const [error, result] = await queryHospitalChargeItemListByExample(params);
|
|
10339
|
+
if (!error && result?.data && result.data.length > 0) {
|
|
10340
|
+
const item = result.data[0]; // 更新model为完整数据
|
|
10341
|
+
model.value = item;
|
|
10342
|
+
currentRow.value = item;
|
|
10343
|
+
inputValue.value = item.commodityNameDisplay || '';
|
|
10344
|
+
}
|
|
10345
|
+
} catch (error) {
|
|
10346
|
+
console.error('Failed to fetch hospital charge item by id:', error);
|
|
10347
|
+
}
|
|
10348
|
+
}; // 监听model变化,更新输入框显示
|
|
10349
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>model.value, (newValue)=>{
|
|
10350
|
+
if (newValue) {
|
|
10351
|
+
if (newValue.commodityNameDisplay) {
|
|
10352
|
+
inputValue.value = newValue.commodityNameDisplay;
|
|
10353
|
+
currentRow.value = newValue;
|
|
10354
|
+
} else if (newValue.hospitalCommodityId) fetchItemById(newValue.hospitalCommodityId);
|
|
10355
|
+
} else {
|
|
10356
|
+
inputValue.value = '';
|
|
10357
|
+
currentRow.value = void 0;
|
|
10358
|
+
}
|
|
10359
|
+
}, {
|
|
10360
|
+
immediate: true
|
|
10361
|
+
}); // 监听窗口大小变化和滚动事件,重新计算动态高度
|
|
10362
|
+
const handleResize = ()=>{
|
|
10363
|
+
if (popoverVisible.value) calculateDynamicMaxHeight();
|
|
10364
|
+
}; // 组件挂载时如果immediate为true则立即查询
|
|
10365
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
|
|
10366
|
+
window.addEventListener(hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_CLOSE_OTHER_POPOVERS_EVENT, handleCloseOtherPopovers); // 监听窗口大小变化和滚动
|
|
10367
|
+
window.addEventListener('resize', handleResize);
|
|
10368
|
+
window.addEventListener('scroll', handleResize, true);
|
|
10369
|
+
if (props.immediate) fetchChargeItems();
|
|
10370
|
+
});
|
|
10371
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
|
|
10372
|
+
document.removeEventListener('keydown', handleKeydown, true);
|
|
10373
|
+
window.removeEventListener(hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_CLOSE_OTHER_POPOVERS_EVENT, handleCloseOtherPopovers);
|
|
10374
|
+
window.removeEventListener('resize', handleResize);
|
|
10375
|
+
window.removeEventListener('scroll', handleResize, true);
|
|
10376
|
+
});
|
|
10377
|
+
__expose({
|
|
10378
|
+
reset,
|
|
10379
|
+
fetchChargeItems,
|
|
10380
|
+
tableRef,
|
|
10381
|
+
popoverRef
|
|
10382
|
+
});
|
|
10383
|
+
return (_ctx, _cache)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_hoisted_1, [
|
|
10384
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElInput), {
|
|
10385
|
+
ref_key: "inputSearchRef",
|
|
10386
|
+
ref: inputSearchRef,
|
|
10387
|
+
modelValue: inputValue.value,
|
|
10388
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>inputValue.value = $event),
|
|
10389
|
+
class: "input",
|
|
10390
|
+
"prefix-icon": "Search",
|
|
10391
|
+
size: _ctx.size,
|
|
10392
|
+
placeholder: "请输入搜索内容",
|
|
10393
|
+
clearable: "",
|
|
10394
|
+
onKeydownCapture: _cache[1] || (_cache[1] = (0, __WEBPACK_EXTERNAL_MODULE_vue__.withKeys)((0, __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers)(()=>{}, [
|
|
10395
|
+
"prevent"
|
|
10396
|
+
]), [
|
|
10397
|
+
"enter"
|
|
10398
|
+
])),
|
|
10399
|
+
onClickCapture: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers)(toggleVisible, [
|
|
10400
|
+
"prevent"
|
|
10401
|
+
]),
|
|
10402
|
+
onInput: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(handleInput),
|
|
10403
|
+
onClear: handleClear
|
|
10404
|
+
}, null, 8, [
|
|
10405
|
+
"modelValue",
|
|
10406
|
+
"size",
|
|
10407
|
+
"onInput"
|
|
10408
|
+
]),
|
|
10409
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
|
|
10410
|
+
ref_key: "popoverRef",
|
|
10411
|
+
ref: popoverRef,
|
|
10412
|
+
width: _ctx.popoverWidth,
|
|
10413
|
+
visible: popoverVisible.value,
|
|
10414
|
+
"virtual-ref": inputSearchRef.value,
|
|
10415
|
+
"virtual-triggering": "",
|
|
10416
|
+
teleported: true,
|
|
10417
|
+
"popper-class": "hospital-charge-select-popover",
|
|
10418
|
+
placement: "top"
|
|
10419
|
+
}, {
|
|
10420
|
+
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
10421
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)(((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_hoisted_2, [
|
|
10422
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
|
|
10423
|
+
ref_key: "tableRef",
|
|
10424
|
+
ref: tableRef,
|
|
10425
|
+
columns: columns.value,
|
|
10426
|
+
data: tableData.value,
|
|
10427
|
+
loading: loading.value,
|
|
10428
|
+
"max-height": dynamicMaxHeight.value,
|
|
10429
|
+
"row-key": 'hospitalCommodityId',
|
|
10430
|
+
"highlight-current-row": true,
|
|
10431
|
+
"row-class-name": getRowClassName,
|
|
10432
|
+
onRowClick: handleRowClick
|
|
10433
|
+
}, null, 8, [
|
|
10434
|
+
"columns",
|
|
10435
|
+
"data",
|
|
10436
|
+
"loading",
|
|
10437
|
+
"max-height"
|
|
10438
|
+
])
|
|
10439
|
+
])), [
|
|
10440
|
+
[
|
|
10441
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
|
|
10442
|
+
handleClickOutside
|
|
10443
|
+
]
|
|
10444
|
+
])
|
|
10445
|
+
]),
|
|
10446
|
+
_: 1
|
|
10447
|
+
}, 8, [
|
|
10448
|
+
"width",
|
|
10449
|
+
"visible",
|
|
10450
|
+
"virtual-ref"
|
|
10451
|
+
])
|
|
10452
|
+
]));
|
|
10058
10453
|
}
|
|
10059
|
-
})
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
|
|
10064
|
-
]
|
|
10065
|
-
|
|
10066
|
-
|
|
10454
|
+
});
|
|
10455
|
+
const hospital_charge_select_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect, [
|
|
10456
|
+
[
|
|
10457
|
+
'__scopeId',
|
|
10458
|
+
"data-v-ffb2d000"
|
|
10459
|
+
]
|
|
10460
|
+
]);
|
|
10461
|
+
/* ESM default export */ const hospital_charge_select = hospital_charge_select_exports_;
|
|
10067
10462
|
const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_1 = {
|
|
10068
10463
|
key: 1,
|
|
10069
10464
|
class: "overflow-hidden"
|
|
@@ -11604,6 +11999,17 @@ function useConfigData_useFormConfig(options) {
|
|
|
11604
11999
|
});
|
|
11605
12000
|
const charge_order_dialog_table_select_exports_ = table_selectvue_type_script_setup_true_lang_ts;
|
|
11606
12001
|
/* ESM default export */ const charge_order_dialog_table_select = charge_order_dialog_table_select_exports_;
|
|
12002
|
+
// 使用 markRaw 包装组件,防止 Vue 对组件进行响应式代理
|
|
12003
|
+
// 这可以解决生产环境中 emitsOptions 为 null 的问题
|
|
12004
|
+
const TableSelect = (0, __WEBPACK_EXTERNAL_MODULE_vue__.markRaw)(charge_order_dialog_table_select); // 用于存储 TableSelect 组件实例的 Map,避免在 JSX 中使用 ref 回调函数
|
|
12005
|
+
const tableSelectRefMap = new Map(); // 获取 TableSelect 组件实例
|
|
12006
|
+
function getTableSelectRef(key) {
|
|
12007
|
+
return tableSelectRefMap.get(key);
|
|
12008
|
+
} // 设置 TableSelect 组件实例
|
|
12009
|
+
function setTableSelectRef(key, el) {
|
|
12010
|
+
if (el) tableSelectRefMap.set(key, el);
|
|
12011
|
+
else tableSelectRefMap.delete(key);
|
|
12012
|
+
} // 清除 TableSelect 组件实例
|
|
11607
12013
|
function useChargeTableConfig() {
|
|
11608
12014
|
const data = useColumnConfig({
|
|
11609
12015
|
getData: (t)=>[
|
|
@@ -11673,8 +12079,8 @@ function useFeeColumnConfig(options) {
|
|
|
11673
12079
|
],
|
|
11674
12080
|
render: (row)=>row.commodityNo ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
|
|
11675
12081
|
row.commodityNameDisplay
|
|
11676
|
-
]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(
|
|
11677
|
-
ref: (el)=>row.
|
|
12082
|
+
]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableSelect, {
|
|
12083
|
+
ref: (el)=>setTableSelectRef(row.key, el),
|
|
11678
12084
|
classOptions: "",
|
|
11679
12085
|
clearable: false,
|
|
11680
12086
|
filterable: true,
|
|
@@ -11695,11 +12101,11 @@ function useFeeColumnConfig(options) {
|
|
|
11695
12101
|
const chargeItem = chargeItemList?.value?.find((item)=>item.commodityId === currentRow.commodityId);
|
|
11696
12102
|
if (!chargeItem?.price && chargeItem?.price !== 0) {
|
|
11697
12103
|
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('添加失败!当前项目缺少价格信息,请联系管理员进行维护!');
|
|
11698
|
-
row.
|
|
12104
|
+
getTableSelectRef(row.key)?.clear();
|
|
11699
12105
|
return;
|
|
11700
12106
|
}
|
|
11701
12107
|
row.selectLabel = chargeItem.commodityNameDisplay;
|
|
11702
|
-
row.
|
|
12108
|
+
getTableSelectRef(row.key)?.setCurrentRow(chargeItem);
|
|
11703
12109
|
row.commodityId = chargeItem.commodityId;
|
|
11704
12110
|
row.commodityNo = chargeItem.commodityNo;
|
|
11705
12111
|
row.commoditySpec = chargeItem.commoditySpec;
|
|
@@ -14185,4 +14591,4 @@ const form_design_render_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(f
|
|
|
14185
14591
|
]);
|
|
14186
14592
|
/* ESM default export */ const form_design_render = form_design_render_exports_;
|
|
14187
14593
|
/** components **/ /** hooks ** */ var __webpack_exports__COMPONENT_CODE = __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.COMPONENT_CODE;
|
|
14188
|
-
export { utils_AVATAR_TYPE_CODE as AVATAR_TYPE_CODE, access_info as AccessInfo, BANNER_COMPONENT_CONFIG, BannerInfo, biz_unit_select as BizUnitSelect, charge_order_dialog as ChargeOrderDialog, copy_text_with_tooltip as CopyTextWithTooltip, constant_DATA_SOURCE_CONTENT_TYPE_CODE as DATA_SOURCE_CONTENT_TYPE_CODE, dbgrid_component_setting as DbgridComponentSetting, department_select as DepartmentSelect, dict_select as DictSelect, dml_button as DmlButton, flag_select as FlagSelect, form_design_render as FormDesignRender, FormUnit, hospital_select as HospitalSelect, keyboard_value as KeyboardValue, use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, patient_access as PatientAccess, PatientInfo, printReceiptBtn as PrintReceiptBtn, pro_avatar as ProAvatar, pro_dialog as ProDialog, pro_form as ProForm, invoice as ProInvoice, pro_table as ProTable, pro_table_v2 as ProTableV2, table_select as TableSelect, types_TableSelectMode as TableSelectMode, tag_select as TagSelect, Title, user_select as UserSelect, ward_select as WardSelect, convertToSpellNo, convertToWbNo, createShortcutDirective, debounce, decimalCount, findKeyCommandConfig, formatDecimalNumber, getSystemTime, isNumber, print, queryDataSetByCodeSystemCodes, queryParamListByNos, use_app_config as useAppConfigData, useColumnConfig, useDataChangeDetector, useDirectionKey, use_direction_select as useDirectionSelect, useEditableTable, use_fetch_dataset as useFetchDataset, useFetchParams, useFetchSystemTime, useFormConfig, usePrintReceipt, use_request as useRequest, __webpack_exports__COMPONENT_CODE as COMPONENT_CODE };
|
|
14594
|
+
export { utils_AVATAR_TYPE_CODE as AVATAR_TYPE_CODE, access_info as AccessInfo, BANNER_COMPONENT_CONFIG, BannerInfo, biz_unit_select as BizUnitSelect, charge_order_dialog as ChargeOrderDialog, copy_text_with_tooltip as CopyTextWithTooltip, constant_DATA_SOURCE_CONTENT_TYPE_CODE as DATA_SOURCE_CONTENT_TYPE_CODE, dbgrid_component_setting as DbgridComponentSetting, department_select as DepartmentSelect, dict_select as DictSelect, dml_button as DmlButton, flag_select as FlagSelect, form_design_render as FormDesignRender, FormUnit, hospital_charge_select as HospitalChargeSelect, hospital_select as HospitalSelect, keyboard_value as KeyboardValue, use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, patient_access as PatientAccess, PatientInfo, printReceiptBtn as PrintReceiptBtn, pro_avatar as ProAvatar, pro_dialog as ProDialog, pro_form as ProForm, invoice as ProInvoice, pro_table as ProTable, pro_table_v2 as ProTableV2, table_select as TableSelect, types_TableSelectMode as TableSelectMode, tag_select as TagSelect, Title, user_select as UserSelect, ward_select as WardSelect, convertToSpellNo, convertToWbNo, createShortcutDirective, debounce, decimalCount, findKeyCommandConfig, formatDecimalNumber, getSystemTime, isNumber, print, queryDataSetByCodeSystemCodes, queryParamListByNos, use_app_config as useAppConfigData, useColumnConfig, useDataChangeDetector, useDirectionKey, use_direction_select as useDirectionSelect, useEditableTable, use_fetch_dataset as useFetchDataset, useFetchParams, useFetchSystemTime, useFormConfig, usePrintReceipt, use_request as useRequest, __webpack_exports__COMPONENT_CODE as COMPONENT_CODE };
|