sun-biz 0.0.4-beta.61 → 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.
@@ -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 })=>[
@@ -6040,13 +6041,14 @@ const createPrint = ()=>{
6040
6041
  /**
6041
6042
  * 2.1 是否为不打印(2025-9-22 任务号【25720】)
6042
6043
  */ const whetherPrint = ()=>{
6043
- const { receiptPrintRuleCode, receiptPrintCategCode, menuXReceiptList } = defaultContext.receiptInfo || {};
6044
+ const { receiptPrintRuleCode, receiptPrintCategCode, menuXReceiptList, redPrintCategCode } = defaultContext.receiptInfo || {};
6044
6045
  if (!receiptPrintRuleCode) return;
6045
6046
  let code = receiptPrintCategCode;
6046
6047
  if (receiptPrintRuleCode === constant_RECEIPT_PRINT_RULE_CODE.MENU) {
6047
6048
  const menuReceiptInfo = menuXReceiptList?.find((item)=>item.menuId === defaultContext.printParams?.menuId);
6048
6049
  code = menuReceiptInfo?.receiptPrintCategCode || receiptPrintCategCode;
6049
6050
  } else code = receiptPrintCategCode;
6051
+ if (defaultContext?.printParams?.invoiceInfo?.invOperateTypeCode === constant_INV_OPERATE_TYPE_CODE.RED) code = redPrintCategCode;
6050
6052
  if (code === constant_RECEIPT_PRINT_CATEG_CODE.NO_PRINT) {
6051
6053
  breakPrint = true; // 如果是不打印则取消打印
6052
6054
  return;
@@ -6072,7 +6074,7 @@ const createPrint = ()=>{
6072
6074
  /**
6073
6075
  * 2.弹窗询问判断方法
6074
6076
  */ const messageBoxAskJudge = async (receiptPrintCategCode, receiptNameDisplay)=>{
6075
- if (receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_ISSUE_NO_PRINT) return await messageBoxAsk(receiptPrintCategCode, receiptNameDisplay);
6077
+ if (receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_ISSUE_NO_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ONLY_ISSUE_NO_PRINT) return await messageBoxAsk(receiptPrintCategCode, receiptNameDisplay);
6076
6078
  return true;
6077
6079
  };
6078
6080
  /**
@@ -6290,50 +6292,64 @@ const createPrint = ()=>{
6290
6292
  * 7.单据打印
6291
6293
  */ const printReceiptFn = async (item)=>{
6292
6294
  if (defaultContext?.receiptInfo?.printInterfaceId) {
6293
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持打印接口");
6294
- throw new Error("暂不支持打印接口");
6295
- }
6296
- if (defaultContext?.printParams?.dataSourceContent) {
6297
- defaultContext.dataSourceContentItem = defaultContext?.printParams?.dataSourceContent;
6298
- defaultContext.dataSourceContentTypeCodeItem = defaultContext?.printParams?.dataSourceContentTypeCode;
6299
- }
6300
- if (!defaultContext?.printParams?.dataSourceContent) {
6301
- if (defaultContext?.printParams?.insurInterfaceId) {
6302
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持医保单据内容获取!");
6303
- throw new Error("暂不支持医保单据内容获取!");
6304
- }
6305
- if ([
6306
- constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_REGISTRATION,
6307
- constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_CHARGE,
6308
- constant_ELECTRONIC_INVOICE_CODE.HOSPITALIZATION_SETTLEMENT,
6309
- constant_ELECTRONIC_INVOICE_CODE.PREPAYMENT
6310
- ].includes(defaultContext?.receiptInfo?.receiptId)) {
6311
- const [, res] = await queryInvoiceBizNos({
6312
- invoiceUsageCode: defaultContext?.printParams?.invoiceInfo?.invoiceUsageCode,
6295
+ const [err, res] = await (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.interfaceInvoke)({
6296
+ tradeCode: 'PRINT001',
6297
+ interfaceId: defaultContext?.receiptInfo?.printInterfaceId,
6298
+ menuId: defaultContext?.printParams?.menuId,
6299
+ params: {
6300
+ receiptId: defaultContext?.receiptInfo?.receiptId,
6313
6301
  bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6314
- bizIds: defaultContext?.printParams?.bizIds,
6315
- onlyLastFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO,
6316
- receiptSplitResultId: item.receiptSplitResultId
6317
- });
6318
- if (res?.success) {
6319
- defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
6320
- defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
6302
+ bizIds: defaultContext?.printParams?.bizIds
6321
6303
  }
6322
- } else // 如果单据信息的数据源类型为JSON,则不调用接口
6323
- if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
6324
- defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
6325
- defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6326
- } else {
6327
- const [, res] = await queryReceiptDataSource({
6328
- receiptId: defaultContext?.printParams?.receiptId,
6329
- designFlag: defaultContext?.printParams?.designFlag,
6330
- bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6331
- bizIds: defaultContext?.printParams?.bizIds,
6332
- receiptSplitResultId: item.receiptSplitResultId
6333
- });
6334
- if (res?.success) {
6335
- defaultContext.dataSourceContentItem = res.data?.dataSourceContent;
6304
+ });
6305
+ if (res?.success) {
6306
+ if (res?.data.printFinishFlag !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) return await Promise.resolve();
6307
+ defaultContext.dataSourceContentItem = res?.data?.dataSourceContent;
6308
+ defaultContext.dataSourceContentTypeCodeItem = res?.data?.dataSourceContentTypeCode;
6309
+ }
6310
+ } else {
6311
+ if (defaultContext?.printParams?.dataSourceContent) {
6312
+ defaultContext.dataSourceContentItem = defaultContext?.printParams?.dataSourceContent;
6313
+ defaultContext.dataSourceContentTypeCodeItem = defaultContext?.printParams?.dataSourceContentTypeCode;
6314
+ }
6315
+ if (!defaultContext?.printParams?.dataSourceContent) {
6316
+ if (defaultContext?.printParams?.insurInterfaceId) {
6317
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持医保单据内容获取!");
6318
+ throw new Error("暂不支持医保单据内容获取!");
6319
+ }
6320
+ if ([
6321
+ constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_REGISTRATION,
6322
+ constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_CHARGE,
6323
+ constant_ELECTRONIC_INVOICE_CODE.HOSPITALIZATION_SETTLEMENT,
6324
+ constant_ELECTRONIC_INVOICE_CODE.PREPAYMENT
6325
+ ].includes(defaultContext?.receiptInfo?.receiptId)) {
6326
+ const [, res] = await queryInvoiceBizNos({
6327
+ invoiceUsageCode: defaultContext?.printParams?.invoiceInfo?.invoiceUsageCode,
6328
+ bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6329
+ bizIds: defaultContext?.printParams?.bizIds,
6330
+ onlyLastFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO,
6331
+ receiptSplitResultId: item.receiptSplitResultId
6332
+ });
6333
+ if (res?.success) {
6334
+ defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
6335
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
6336
+ }
6337
+ } else // 如果单据信息的数据源类型为JSON,则不调用接口
6338
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
6339
+ defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
6336
6340
  defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6341
+ } else {
6342
+ const [, res] = await queryReceiptDataSource({
6343
+ receiptId: defaultContext?.printParams?.receiptId,
6344
+ designFlag: defaultContext?.printParams?.designFlag,
6345
+ bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6346
+ bizIds: defaultContext?.printParams?.bizIds,
6347
+ receiptSplitResultId: item.receiptSplitResultId
6348
+ });
6349
+ if (res?.success) {
6350
+ defaultContext.dataSourceContentItem = res.data?.dataSourceContent;
6351
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6352
+ }
6337
6353
  }
6338
6354
  }
6339
6355
  }
@@ -8120,9 +8136,11 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8120
8136
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
8121
8137
  const instance = (0, __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance)();
8122
8138
  const componentId = instance?.uid || Math.random(); // 唯一标识当前组件实例
8123
- const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
8124
- const selectRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
8125
- const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
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)();
8126
8144
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
8127
8145
  const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
8128
8146
  const currentRowIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
@@ -8218,48 +8236,60 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8218
8236
  };
8219
8237
  const getBizUnitList = async (data)=>{
8220
8238
  loading.value = true;
8221
- const [, res] = await queryBizUnitList({
8222
- ...data,
8223
- hospitalId: props.hospitalId,
8224
- orgTypeCodes: props.orgTypeCodes,
8225
- enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
8226
- encounterTypeCode: props.encounterTypeCode,
8227
- deptId: props.deptId,
8228
- orgLocationId: props.orgLocationId
8229
- });
8230
- loading.value = false;
8231
- if (res?.success) {
8232
- let defaultList = [];
8233
- if (attrs.modelValue && Array.isArray(props.defaultValue) && props.defaultValue.length && !data?.keyWord) defaultList = props.defaultValue.map((item)=>({
8234
- ...item,
8235
- orgId: item.value || item.orgId,
8236
- orgNameDisplay: item.label || item.orgNameDisplay,
8237
- value: item.value || item.orgId,
8238
- label: item.label || item.orgNameDisplay
8239
- }));
8240
- let list = (res.data ?? []).map((item)=>({
8241
- ...item,
8242
- label: item.orgNameDisplay,
8243
- value: item.orgId
8244
- }));
8245
- if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
8246
- ...list,
8247
- ...defaultList
8248
- ], 'orgId');
8249
- bizUnitList.value = list;
8250
- currentRowIndex.value = -1;
8251
- tableRef.value?.eleTable?.setCurrentRow?.(void 0);
8252
- if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
8253
- const list = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
8254
- tableRef.value?.eleTable?.clearSelection();
8255
- bizUnitList.value.forEach((item)=>{
8256
- if (list.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
8257
- });
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;
8258
8253
  }
8259
- defaultSetTableSelected.value = true;
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;
8260
8292
  }
8261
- const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
8262
- if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
8263
8293
  };
8264
8294
  const handleChange = ()=>{
8265
8295
  let value = selectedRows.value.map((item)=>item.value || item.orgId);
@@ -8506,10 +8536,9 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8506
8536
  handleBlur();
8507
8537
  };
8508
8538
  const visibleChange = (val)=>{
8509
- if (val) {
8510
- loading.value = true;
8511
- handleFocus();
8512
- }
8539
+ if (val) // loading 状态完全由 getBizUnitList 函数控制
8540
+ // 如果在这里设置 loading = true,但不触发数据加载,会导致 loading 状态不会被重置
8541
+ handleFocus();
8513
8542
  };
8514
8543
  __expose({
8515
8544
  popoverRef,
@@ -10155,6 +10184,17 @@ function useConfigData_useFormConfig(options) {
10155
10184
  });
10156
10185
  const charge_order_dialog_table_select_exports_ = table_selectvue_type_script_setup_true_lang_ts;
10157
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 组件实例
10158
10198
  function useChargeTableConfig() {
10159
10199
  const data = useColumnConfig({
10160
10200
  getData: (t)=>[
@@ -10224,8 +10264,8 @@ function useFeeColumnConfig(options) {
10224
10264
  ],
10225
10265
  render: (row)=>row.commodityNo ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
10226
10266
  row.commodityNameDisplay
10227
- ]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(charge_order_dialog_table_select, {
10228
- ref: (el)=>row.tabSelectRef = el,
10267
+ ]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableSelect, {
10268
+ ref: (el)=>setTableSelectRef(row.key, el),
10229
10269
  classOptions: "",
10230
10270
  clearable: false,
10231
10271
  filterable: true,
@@ -10246,11 +10286,11 @@ function useFeeColumnConfig(options) {
10246
10286
  const chargeItem = chargeItemList?.value?.find((item)=>item.commodityId === currentRow.commodityId);
10247
10287
  if (!chargeItem?.price && chargeItem?.price !== 0) {
10248
10288
  __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('添加失败!当前项目缺少价格信息,请联系管理员进行维护!');
10249
- row.tabSelectRef?.clear();
10289
+ getTableSelectRef(row.key)?.clear();
10250
10290
  return;
10251
10291
  }
10252
10292
  row.selectLabel = chargeItem.commodityNameDisplay;
10253
- row.tabSelectRef?.setCurrentRow(chargeItem);
10293
+ getTableSelectRef(row.key)?.setCurrentRow(chargeItem);
10254
10294
  row.commodityId = chargeItem.commodityId;
10255
10295
  row.commodityNo = chargeItem.commodityNo;
10256
10296
  row.commoditySpec = chargeItem.commoditySpec;
@@ -12745,6 +12785,12 @@ const THE_OTHER_REASON_ID = "1633928410185179136";
12745
12785
  * @param code
12746
12786
  * @returns
12747
12787
  */ const updateCurrentNoById = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.basicRequest)("/invoicemanagement/updateCurrentNoById", params);
12788
+ /**
12789
+ * [1-10195-1]根据条件查询票据配置
12790
+ * 1、查询DICT_INVOICE_SETTING(票据配置)
12791
+ * @param params
12792
+ * @returns
12793
+ */ const queryInvoiceSettingList = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/invoicesetting/queryInvoiceSettingByExample', params);
12748
12794
  function useInvoiceInfoFormConfig() {
12749
12795
  const data = useFormConfig({
12750
12796
  getData: ()=>[
@@ -13056,6 +13102,20 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
13056
13102
  /** 点击外部 */ const handleClickOutside = ()=>{
13057
13103
  if (isClickOut.value) handleHide();
13058
13104
  };
13105
+ //获取标记阈值
13106
+ const getInvoiceSettingList = async (val)=>{
13107
+ if (!val?.invoiceMediaTypeCode || !val?.invoiceUsageCode) return;
13108
+ const [, res] = await queryInvoiceSettingList({
13109
+ invoiceMediaTypeCode: val.invoiceMediaTypeCode,
13110
+ invoiceUsageCodes: [
13111
+ val.invoiceUsageCode
13112
+ ]
13113
+ });
13114
+ if (res?.success) {
13115
+ const [data] = res?.data || [];
13116
+ if (data?.warningThreshold !== void 0 && data?.warningThreshold !== null && data?.warningThreshold > val?.residueCount) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.warning(`剩余发票[${val?.residueCount}]张,请及时领用票据!`);
13117
+ }
13118
+ };
13059
13119
  // 获取票据列表
13060
13120
  const getInvoiceList = async ()=>{
13061
13121
  loading.value = true;
@@ -13072,6 +13132,7 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
13072
13132
  if (tableData.value && 0 === tableData.value.length) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.warning("未查询到票据相关信息!");
13073
13133
  if (tableData.value && tableData.value.length > 1) currentRow.value = tableData.value.find((item)=>item.invoiceMediaTypeCode === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.INVOICE_MEDIA_TYPE_CODE.ELECTRONIC);
13074
13134
  else currentRow.value = (tableData.value ?? [])[0];
13135
+ getInvoiceSettingList(currentRow.value);
13075
13136
  emit("change", {
13076
13137
  currentRow: currentRow.value,
13077
13138
  invoiceListData: tableData.value
@@ -13079,7 +13140,10 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
13079
13140
  };
13080
13141
  // 刷新
13081
13142
  const refresh = async ()=>{
13143
+ isRefreshing.value = true //刷新动画
13144
+ ;
13082
13145
  await getInvoiceList();
13146
+ isRefreshing.value = false;
13083
13147
  };
13084
13148
  // 设置选中的currentRow
13085
13149
  const setCurrentRow = (row)=>{
@@ -1,5 +1,5 @@
1
1
  import { REASON_USE_SCOPE_CODE } from "../constant";
2
- import { ReasonItem, UpdateCurrentNoParams } from "../types";
2
+ import { InvoiceSettingInfoItem, QueryInvoiceSettingListParams, ReasonItem, UpdateCurrentNoParams } from "../types";
3
3
  /**
4
4
  * 1-10100-1 根据条件查询原因
5
5
  * @param code
@@ -12,3 +12,10 @@ export declare const queryReasonList: (code: REASON_USE_SCOPE_CODE) => Promise<[
12
12
  * @returns
13
13
  */
14
14
  export declare const updateCurrentNoById: (params: UpdateCurrentNoParams) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<unknown> | undefined]>;
15
+ /**
16
+ * [1-10195-1]根据条件查询票据配置
17
+ * 1、查询DICT_INVOICE_SETTING(票据配置)
18
+ * @param params
19
+ * @returns
20
+ */
21
+ export declare const queryInvoiceSettingList: (params: QueryInvoiceSettingListParams) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<InvoiceSettingInfoItem[]> | undefined]>;
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 icon_combine_script = {};
4452
- const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(icon_combine_script, [
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
@@ -6438,13 +6439,14 @@ const createPrint = ()=>{
6438
6439
  /**
6439
6440
  * 2.1 是否为不打印(2025-9-22 任务号【25720】)
6440
6441
  */ const whetherPrint = ()=>{
6441
- const { receiptPrintRuleCode, receiptPrintCategCode, menuXReceiptList } = defaultContext.receiptInfo || {};
6442
+ const { receiptPrintRuleCode, receiptPrintCategCode, menuXReceiptList, redPrintCategCode } = defaultContext.receiptInfo || {};
6442
6443
  if (!receiptPrintRuleCode) return;
6443
6444
  let code = receiptPrintCategCode;
6444
6445
  if (receiptPrintRuleCode === constant_RECEIPT_PRINT_RULE_CODE.MENU) {
6445
6446
  const menuReceiptInfo = menuXReceiptList?.find((item)=>item.menuId === defaultContext.printParams?.menuId);
6446
6447
  code = menuReceiptInfo?.receiptPrintCategCode || receiptPrintCategCode;
6447
6448
  } else code = receiptPrintCategCode;
6449
+ if (defaultContext?.printParams?.invoiceInfo?.invOperateTypeCode === constant_INV_OPERATE_TYPE_CODE.RED) code = redPrintCategCode;
6448
6450
  if (code === constant_RECEIPT_PRINT_CATEG_CODE.NO_PRINT) {
6449
6451
  breakPrint = true; // 如果是不打印则取消打印
6450
6452
  return;
@@ -6470,7 +6472,7 @@ const createPrint = ()=>{
6470
6472
  /**
6471
6473
  * 2.弹窗询问判断方法
6472
6474
  */ const messageBoxAskJudge = async (receiptPrintCategCode, receiptNameDisplay)=>{
6473
- if (receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_ISSUE_NO_PRINT) return await messageBoxAsk(receiptPrintCategCode, receiptNameDisplay);
6475
+ if (receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ASK_ISSUE_NO_PRINT || receiptPrintCategCode === constant_RECEIPT_PRINT_CATEG_CODE.ONLY_ISSUE_NO_PRINT) return await messageBoxAsk(receiptPrintCategCode, receiptNameDisplay);
6474
6476
  return true;
6475
6477
  };
6476
6478
  /**
@@ -6688,50 +6690,64 @@ const createPrint = ()=>{
6688
6690
  * 7.单据打印
6689
6691
  */ const printReceiptFn = async (item)=>{
6690
6692
  if (defaultContext?.receiptInfo?.printInterfaceId) {
6691
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持打印接口");
6692
- throw new Error("暂不支持打印接口");
6693
- }
6694
- if (defaultContext?.printParams?.dataSourceContent) {
6695
- defaultContext.dataSourceContentItem = defaultContext?.printParams?.dataSourceContent;
6696
- defaultContext.dataSourceContentTypeCodeItem = defaultContext?.printParams?.dataSourceContentTypeCode;
6697
- }
6698
- if (!defaultContext?.printParams?.dataSourceContent) {
6699
- if (defaultContext?.printParams?.insurInterfaceId) {
6700
- __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持医保单据内容获取!");
6701
- throw new Error("暂不支持医保单据内容获取!");
6702
- }
6703
- if ([
6704
- constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_REGISTRATION,
6705
- constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_CHARGE,
6706
- constant_ELECTRONIC_INVOICE_CODE.HOSPITALIZATION_SETTLEMENT,
6707
- constant_ELECTRONIC_INVOICE_CODE.PREPAYMENT
6708
- ].includes(defaultContext?.receiptInfo?.receiptId)) {
6709
- const [, res] = await queryInvoiceBizNos({
6710
- invoiceUsageCode: defaultContext?.printParams?.invoiceInfo?.invoiceUsageCode,
6693
+ const [err, res] = await (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.interfaceInvoke)({
6694
+ tradeCode: 'PRINT001',
6695
+ interfaceId: defaultContext?.receiptInfo?.printInterfaceId,
6696
+ menuId: defaultContext?.printParams?.menuId,
6697
+ params: {
6698
+ receiptId: defaultContext?.receiptInfo?.receiptId,
6711
6699
  bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6712
- bizIds: defaultContext?.printParams?.bizIds,
6713
- onlyLastFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO,
6714
- receiptSplitResultId: item.receiptSplitResultId
6715
- });
6716
- if (res?.success) {
6717
- defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
6718
- defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
6700
+ bizIds: defaultContext?.printParams?.bizIds
6719
6701
  }
6720
- } else // 如果单据信息的数据源类型为JSON,则不调用接口
6721
- if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
6722
- defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
6723
- defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6724
- } else {
6725
- const [, res] = await queryReceiptDataSource({
6726
- receiptId: defaultContext?.printParams?.receiptId,
6727
- designFlag: defaultContext?.printParams?.designFlag,
6728
- bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6729
- bizIds: defaultContext?.printParams?.bizIds,
6730
- receiptSplitResultId: item.receiptSplitResultId
6731
- });
6732
- if (res?.success) {
6733
- defaultContext.dataSourceContentItem = res.data?.dataSourceContent;
6702
+ });
6703
+ if (res?.success) {
6704
+ if (res?.data.printFinishFlag !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO) return await Promise.resolve();
6705
+ defaultContext.dataSourceContentItem = res?.data?.dataSourceContent;
6706
+ defaultContext.dataSourceContentTypeCodeItem = res?.data?.dataSourceContentTypeCode;
6707
+ }
6708
+ } else {
6709
+ if (defaultContext?.printParams?.dataSourceContent) {
6710
+ defaultContext.dataSourceContentItem = defaultContext?.printParams?.dataSourceContent;
6711
+ defaultContext.dataSourceContentTypeCodeItem = defaultContext?.printParams?.dataSourceContentTypeCode;
6712
+ }
6713
+ if (!defaultContext?.printParams?.dataSourceContent) {
6714
+ if (defaultContext?.printParams?.insurInterfaceId) {
6715
+ __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error("暂不支持医保单据内容获取!");
6716
+ throw new Error("暂不支持医保单据内容获取!");
6717
+ }
6718
+ if ([
6719
+ constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_REGISTRATION,
6720
+ constant_ELECTRONIC_INVOICE_CODE.OUTPATIENT_CHARGE,
6721
+ constant_ELECTRONIC_INVOICE_CODE.HOSPITALIZATION_SETTLEMENT,
6722
+ constant_ELECTRONIC_INVOICE_CODE.PREPAYMENT
6723
+ ].includes(defaultContext?.receiptInfo?.receiptId)) {
6724
+ const [, res] = await queryInvoiceBizNos({
6725
+ invoiceUsageCode: defaultContext?.printParams?.invoiceInfo?.invoiceUsageCode,
6726
+ bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6727
+ bizIds: defaultContext?.printParams?.bizIds,
6728
+ onlyLastFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.NO,
6729
+ receiptSplitResultId: item.receiptSplitResultId
6730
+ });
6731
+ if (res?.success) {
6732
+ defaultContext.dataSourceContentItem = ((res.data?.bizIssueList ?? [])[0].invoiceList ?? [])[0].eInvoiceH5Url;
6733
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5;
6734
+ }
6735
+ } else // 如果单据信息的数据源类型为JSON,则不调用接口
6736
+ if (defaultContext?.receiptInfo?.dataSourceTypeCode === constant_DATA_SOURCE_TYPE_CODE.JSON) {
6737
+ defaultContext.dataSourceContentItem = defaultContext?.receiptInfo?.designJson;
6734
6738
  defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6739
+ } else {
6740
+ const [, res] = await queryReceiptDataSource({
6741
+ receiptId: defaultContext?.printParams?.receiptId,
6742
+ designFlag: defaultContext?.printParams?.designFlag,
6743
+ bizIdTypeCode: defaultContext?.printParams?.bizIdTypeCode,
6744
+ bizIds: defaultContext?.printParams?.bizIds,
6745
+ receiptSplitResultId: item.receiptSplitResultId
6746
+ });
6747
+ if (res?.success) {
6748
+ defaultContext.dataSourceContentItem = res.data?.dataSourceContent;
6749
+ defaultContext.dataSourceContentTypeCodeItem = constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON;
6750
+ }
6735
6751
  }
6736
6752
  }
6737
6753
  }
@@ -6949,6 +6965,12 @@ const THE_OTHER_REASON_ID = "1633928410185179136";
6949
6965
  * @param code
6950
6966
  * @returns
6951
6967
  */ const updateCurrentNoById = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.basicRequest)("/invoicemanagement/updateCurrentNoById", params);
6968
+ /**
6969
+ * [1-10195-1]根据条件查询票据配置
6970
+ * 1、查询DICT_INVOICE_SETTING(票据配置)
6971
+ * @param params
6972
+ * @returns
6973
+ */ const queryInvoiceSettingList = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/invoicesetting/queryInvoiceSettingByExample', params);
6952
6974
  function useInvoiceInfoFormConfig() {
6953
6975
  const data = useFormConfig({
6954
6976
  getData: ()=>[
@@ -8602,9 +8624,11 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8602
8624
  const { t } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
8603
8625
  const instance = (0, __WEBPACK_EXTERNAL_MODULE_vue__.getCurrentInstance)();
8604
8626
  const componentId = instance?.uid || Math.random(); // 唯一标识当前组件实例
8605
- const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
8606
- const selectRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
8607
- const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
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)();
8608
8632
  const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
8609
8633
  const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
8610
8634
  const currentRowIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(0);
@@ -8700,48 +8724,60 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8700
8724
  };
8701
8725
  const getBizUnitList = async (data)=>{
8702
8726
  loading.value = true;
8703
- const [, res] = await queryBizUnitList({
8704
- ...data,
8705
- hospitalId: props.hospitalId,
8706
- orgTypeCodes: props.orgTypeCodes,
8707
- enabledFlag: __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES,
8708
- encounterTypeCode: props.encounterTypeCode,
8709
- deptId: props.deptId,
8710
- orgLocationId: props.orgLocationId
8711
- });
8712
- loading.value = false;
8713
- if (res?.success) {
8714
- let defaultList = [];
8715
- if (attrs.modelValue && Array.isArray(props.defaultValue) && props.defaultValue.length && !data?.keyWord) defaultList = props.defaultValue.map((item)=>({
8716
- ...item,
8717
- orgId: item.value || item.orgId,
8718
- orgNameDisplay: item.label || item.orgNameDisplay,
8719
- value: item.value || item.orgId,
8720
- label: item.label || item.orgNameDisplay
8721
- }));
8722
- let list = (res.data ?? []).map((item)=>({
8723
- ...item,
8724
- label: item.orgNameDisplay,
8725
- value: item.orgId
8726
- }));
8727
- if (defaultList.length) list = (0, __WEBPACK_EXTERNAL_MODULE_lodash__.uniqBy)([
8728
- ...list,
8729
- ...defaultList
8730
- ], 'orgId');
8731
- bizUnitList.value = list;
8732
- currentRowIndex.value = -1;
8733
- tableRef.value?.eleTable?.setCurrentRow?.(void 0);
8734
- if (bizUnitList.value.length && props.multiSelectFlag && selectedRows.value?.length && !defaultSetTableSelected.value) {
8735
- const list = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)(selectedRows.value);
8736
- tableRef.value?.eleTable?.clearSelection();
8737
- bizUnitList.value.forEach((item)=>{
8738
- if (list.some((row)=>row.orgId === item.value || row.value === item.value)) tableRef.value?.eleTable?.toggleRowSelection(item, true);
8739
- });
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;
8740
8741
  }
8741
- defaultSetTableSelected.value = true;
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;
8742
8780
  }
8743
- const tableSelectedRows = tableRef.value?.eleTable?.getSelectionRows();
8744
- if (props.multiSelectFlag && !selectedRows.value?.length && tableSelectedRows?.length) tableRef.value?.eleTable?.clearSelection();
8745
8781
  };
8746
8782
  const handleChange = ()=>{
8747
8783
  let value = selectedRows.value.map((item)=>item.value || item.orgId);
@@ -8988,10 +9024,9 @@ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true_CLOS
8988
9024
  handleBlur();
8989
9025
  };
8990
9026
  const visibleChange = (val)=>{
8991
- if (val) {
8992
- loading.value = true;
8993
- handleFocus();
8994
- }
9027
+ if (val) // loading 状态完全由 getBizUnitList 函数控制
9028
+ // 如果在这里设置 loading = true,但不触发数据加载,会导致 loading 状态不会被重置
9029
+ handleFocus();
8995
9030
  };
8996
9031
  __expose({
8997
9032
  popoverRef,
@@ -10021,28 +10056,409 @@ const hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalCha
10021
10056
  };
10022
10057
  // 全局事件:用于关闭其他实例的 popover
10023
10058
  const hospital_charge_selectvue_type_script_setup_true_lang_tsx_name_HospitalChargeSelect_CLOSE_OTHER_POPOVERS_EVENT = 'hospital-charge-select:close-others';
10024
- /* ESM default export */ ({
10025
- hospitalId: {},
10026
- encounterTypeCode: {},
10027
- priceAt: {},
10028
- size: {
10029
- default: 'default'
10030
- },
10031
- immediate: {
10032
- type: Boolean,
10033
- default: false
10034
- },
10035
- popoverWidth: {
10036
- default: 1000
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
+ ]));
10037
10453
  }
10038
- }), ({
10039
- modelValue: {},
10040
- modelModifiers: {}
10041
- }), [
10042
- "change"
10043
- ], [
10044
- "update:modelValue"
10045
- ];
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_;
10046
10462
  const FormUnitvue_type_script_setup_true_lang_ts_name_formUnit_hoisted_1 = {
10047
10463
  key: 1,
10048
10464
  class: "overflow-hidden"
@@ -10621,6 +11037,20 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
10621
11037
  /** 点击外部 */ const handleClickOutside = ()=>{
10622
11038
  if (isClickOut.value) handleHide();
10623
11039
  };
11040
+ //获取标记阈值
11041
+ const getInvoiceSettingList = async (val)=>{
11042
+ if (!val?.invoiceMediaTypeCode || !val?.invoiceUsageCode) return;
11043
+ const [, res] = await queryInvoiceSettingList({
11044
+ invoiceMediaTypeCode: val.invoiceMediaTypeCode,
11045
+ invoiceUsageCodes: [
11046
+ val.invoiceUsageCode
11047
+ ]
11048
+ });
11049
+ if (res?.success) {
11050
+ const [data] = res?.data || [];
11051
+ if (data?.warningThreshold !== void 0 && data?.warningThreshold !== null && data?.warningThreshold > val?.residueCount) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.warning(`剩余发票[${val?.residueCount}]张,请及时领用票据!`);
11052
+ }
11053
+ };
10624
11054
  // 获取票据列表
10625
11055
  const getInvoiceList = async ()=>{
10626
11056
  loading.value = true;
@@ -10637,6 +11067,7 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
10637
11067
  if (tableData.value && 0 === tableData.value.length) __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.warning("未查询到票据相关信息!");
10638
11068
  if (tableData.value && tableData.value.length > 1) currentRow.value = tableData.value.find((item)=>item.invoiceMediaTypeCode === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.INVOICE_MEDIA_TYPE_CODE.ELECTRONIC);
10639
11069
  else currentRow.value = (tableData.value ?? [])[0];
11070
+ getInvoiceSettingList(currentRow.value);
10640
11071
  emit("change", {
10641
11072
  currentRow: currentRow.value,
10642
11073
  invoiceListData: tableData.value
@@ -10644,7 +11075,10 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
10644
11075
  };
10645
11076
  // 刷新
10646
11077
  const refresh = async ()=>{
11078
+ isRefreshing.value = true //刷新动画
11079
+ ;
10647
11080
  await getInvoiceList();
11081
+ isRefreshing.value = false;
10648
11082
  };
10649
11083
  // 设置选中的currentRow
10650
11084
  const setCurrentRow = (row)=>{
@@ -11565,6 +11999,17 @@ function useConfigData_useFormConfig(options) {
11565
11999
  });
11566
12000
  const charge_order_dialog_table_select_exports_ = table_selectvue_type_script_setup_true_lang_ts;
11567
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 组件实例
11568
12013
  function useChargeTableConfig() {
11569
12014
  const data = useColumnConfig({
11570
12015
  getData: (t)=>[
@@ -11634,8 +12079,8 @@ function useFeeColumnConfig(options) {
11634
12079
  ],
11635
12080
  render: (row)=>row.commodityNo ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
11636
12081
  row.commodityNameDisplay
11637
- ]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(charge_order_dialog_table_select, {
11638
- ref: (el)=>row.tabSelectRef = el,
12082
+ ]) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableSelect, {
12083
+ ref: (el)=>setTableSelectRef(row.key, el),
11639
12084
  classOptions: "",
11640
12085
  clearable: false,
11641
12086
  filterable: true,
@@ -11656,11 +12101,11 @@ function useFeeColumnConfig(options) {
11656
12101
  const chargeItem = chargeItemList?.value?.find((item)=>item.commodityId === currentRow.commodityId);
11657
12102
  if (!chargeItem?.price && chargeItem?.price !== 0) {
11658
12103
  __WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessage.error('添加失败!当前项目缺少价格信息,请联系管理员进行维护!');
11659
- row.tabSelectRef?.clear();
12104
+ getTableSelectRef(row.key)?.clear();
11660
12105
  return;
11661
12106
  }
11662
12107
  row.selectLabel = chargeItem.commodityNameDisplay;
11663
- row.tabSelectRef?.setCurrentRow(chargeItem);
12108
+ getTableSelectRef(row.key)?.setCurrentRow(chargeItem);
11664
12109
  row.commodityId = chargeItem.commodityId;
11665
12110
  row.commodityNo = chargeItem.commodityNo;
11666
12111
  row.commoditySpec = chargeItem.commoditySpec;
@@ -14146,4 +14591,4 @@ const form_design_render_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(f
14146
14591
  ]);
14147
14592
  /* ESM default export */ const form_design_render = form_design_render_exports_;
14148
14593
  /** components **/ /** hooks ** */ var __webpack_exports__COMPONENT_CODE = __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.COMPONENT_CODE;
14149
- 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.4-beta.61",
3
+ "version": "0.0.4-beta.63",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "src/*",