sun-biz 0.0.3-beta.4 → 0.0.3-beta.6
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 +193 -50
- package/dist/components/print/api/index.d.ts +6 -0
- package/dist/components/print/hooks/index.d.ts +14 -0
- package/dist/components/pro-table/utils.d.ts +17 -2
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/use-app-config/index.d.ts +2 -0
- package/dist/hooks/use-app-config/types.d.ts +4 -1
- package/dist/index.js +193 -50
- package/package.json +6 -6
package/dist/components/index.js
CHANGED
|
@@ -269,8 +269,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
269
269
|
* @returns {String}
|
|
270
270
|
* */ function formatValue(callValue) {
|
|
271
271
|
// 如果当前值为数组,使用 / 拼接(根据需求自定义)
|
|
272
|
-
if (isArray(callValue)) return callValue.length ? callValue.join(
|
|
273
|
-
return callValue ??
|
|
272
|
+
if (isArray(callValue)) return callValue.length ? callValue.join(" / ") : "--";
|
|
273
|
+
return callValue ?? "--";
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
|
|
@@ -278,8 +278,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
278
278
|
* @param {String} prop 当前 prop
|
|
279
279
|
* @returns {*}
|
|
280
280
|
* */ function handleRowAccordingToProp(row, prop) {
|
|
281
|
-
if (!prop?.includes(
|
|
282
|
-
prop.split(
|
|
281
|
+
if (!prop?.includes(".")) return row[prop] ?? "--";
|
|
282
|
+
prop.split(".").forEach((item)=>row = row[item] ?? "--");
|
|
283
283
|
return row;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
@@ -287,7 +287,7 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
287
287
|
* @param {String} prop 当前 prop
|
|
288
288
|
* @returns {String}
|
|
289
289
|
* */ function handleProp(prop) {
|
|
290
|
-
const propArr = prop.split(
|
|
290
|
+
const propArr = prop.split(".");
|
|
291
291
|
if (1 == propArr.length) return prop;
|
|
292
292
|
return propArr[propArr.length - 1];
|
|
293
293
|
}
|
|
@@ -308,15 +308,15 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
308
308
|
* @param {String} type 过滤类型(目前只有 tag)
|
|
309
309
|
* @returns {String}
|
|
310
310
|
* */ function filterEnum(callValue, enumData, fieldNames, type) {
|
|
311
|
-
const value = fieldNames?.value ??
|
|
312
|
-
const label = fieldNames?.label ??
|
|
313
|
-
const children = fieldNames?.children ??
|
|
311
|
+
const value = fieldNames?.value ?? "value";
|
|
312
|
+
const label = fieldNames?.label ?? "label";
|
|
313
|
+
const children = fieldNames?.children ?? "children";
|
|
314
314
|
let filterData = {};
|
|
315
315
|
// 判断 enumData 是否为数组
|
|
316
316
|
if (Array.isArray(enumData)) filterData = findItemNested(enumData, callValue, value, children);
|
|
317
317
|
// 判断是否输出的结果为 tag 类型
|
|
318
|
-
if (
|
|
319
|
-
return filterData ? filterData[label] :
|
|
318
|
+
if ("tag" == type) return filterData?.tagType ? filterData.tagType : "";
|
|
319
|
+
return filterData ? filterData[label] : "--";
|
|
320
320
|
}
|
|
321
321
|
function _isSlot(s) {
|
|
322
322
|
return 'function' == typeof s || '[object Object]' === Object.prototype.toString.call(s) && !(0, __WEBPACK_EXTERNAL_MODULE_vue__.isVNode)(s);
|
|
@@ -618,6 +618,7 @@ const DbgridTableConfig_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(Db
|
|
|
618
618
|
/**
|
|
619
619
|
* 是否为 sass 模式
|
|
620
620
|
*/ MAIN_APP_CONFIG["IS_SASS_MODE"] = "isSassMode";
|
|
621
|
+
/** 是否使用本地打印 */ MAIN_APP_CONFIG["IS_LOCAL_PRINT"] = "isLocalPrint";
|
|
621
622
|
/**用户信息 */ MAIN_APP_CONFIG["USER_INFO"] = "userInfo";
|
|
622
623
|
/** 用户偏好 */ MAIN_APP_CONFIG["PREFERENCE_LIST"] = "preferenceList";
|
|
623
624
|
return MAIN_APP_CONFIG;
|
|
@@ -1414,7 +1415,7 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
|
|
|
1414
1415
|
class: "relative flex flex-1 flex-col overflow-hidden"
|
|
1415
1416
|
};
|
|
1416
1417
|
const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
1417
|
-
key:
|
|
1418
|
+
key: 1,
|
|
1418
1419
|
class: "mt-5 flex justify-between items-center"
|
|
1419
1420
|
};
|
|
1420
1421
|
// 接受父组件参数,配置默认值
|
|
@@ -1473,7 +1474,20 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
|
1473
1474
|
default: ()=>({})
|
|
1474
1475
|
},
|
|
1475
1476
|
layout: {
|
|
1476
|
-
default:
|
|
1477
|
+
default: "total, sizes, prev, pager, next"
|
|
1478
|
+
},
|
|
1479
|
+
dragTips: {
|
|
1480
|
+
default: "温馨提示:您可通过拖动进行排序"
|
|
1481
|
+
},
|
|
1482
|
+
isShowDragTips: {
|
|
1483
|
+
type: Boolean,
|
|
1484
|
+
default: false
|
|
1485
|
+
},
|
|
1486
|
+
dragTipsCustomStyle: {
|
|
1487
|
+
default: {}
|
|
1488
|
+
},
|
|
1489
|
+
dragTipsClassName: {
|
|
1490
|
+
default: ""
|
|
1477
1491
|
}
|
|
1478
1492
|
},
|
|
1479
1493
|
emits: [
|
|
@@ -1718,6 +1732,18 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
|
1718
1732
|
return (_ctx, _cache)=>{
|
|
1719
1733
|
const _directive_loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective)("loading");
|
|
1720
1734
|
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1, [
|
|
1735
|
+
props?.draggable || props?.isShowDragTips ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
|
|
1736
|
+
key: 0,
|
|
1737
|
+
style: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeStyle)({
|
|
1738
|
+
color: '#f7ba2a',
|
|
1739
|
+
...props.dragTipsCustomStyle
|
|
1740
|
+
}),
|
|
1741
|
+
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)([
|
|
1742
|
+
'text-base',
|
|
1743
|
+
'mb-2',
|
|
1744
|
+
props.dragTipsClassName
|
|
1745
|
+
])
|
|
1746
|
+
}, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(props.dragTips), 7)) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
|
|
1721
1747
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableContainer, {
|
|
1722
1748
|
ref_key: "formRef",
|
|
1723
1749
|
ref: formRef,
|
|
@@ -2828,16 +2854,6 @@ const _hoisted_12 = {
|
|
|
2828
2854
|
};
|
|
2829
2855
|
// 计算实际布局列数
|
|
2830
2856
|
const layoutColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>parseLayoutColumns(bannerInfo.value?.layoutTypeCode));
|
|
2831
|
-
/** 如果是住院就诊,返回就诊状态和天数 */ const encounterInfo = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
|
|
2832
|
-
if (BANNER_COMPONENT_CONFIG[__props.code].bizIdTypeCode !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE.IENC_ENCOUNTER) return null;
|
|
2833
|
-
const bannerItems = bannerInfo.value?.bannerItemList ?? [];
|
|
2834
|
-
const statusItem = bannerItems.find((item)=>"inEncStatusDesc" === item.bindingFieldNo);
|
|
2835
|
-
const daysItem = bannerItems.find((item)=>"inpatientDays" === item.bindingFieldNo);
|
|
2836
|
-
return {
|
|
2837
|
-
inEncStatusDesc: statusItem?.dataValue ?? "--",
|
|
2838
|
-
inpatientDays: daysItem?.dataValue ? `(${daysItem.dataValue})` : "--"
|
|
2839
|
-
};
|
|
2840
|
-
});
|
|
2841
2857
|
/** 获取banner配置 */ const queryBannerConfig = async ()=>{
|
|
2842
2858
|
loading.value = true;
|
|
2843
2859
|
if (!__props.bizId && initBannerInfo.value) {
|
|
@@ -2852,7 +2868,7 @@ const _hoisted_12 = {
|
|
|
2852
2868
|
});
|
|
2853
2869
|
loading.value = false;
|
|
2854
2870
|
if (res?.success) {
|
|
2855
|
-
res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item.
|
|
2871
|
+
res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item?.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES);
|
|
2856
2872
|
if (!__props.bizId) initBannerInfo.value = res?.data;
|
|
2857
2873
|
bannerInfo.value = res?.data;
|
|
2858
2874
|
}
|
|
@@ -2930,8 +2946,8 @@ const _hoisted_12 = {
|
|
|
2930
2946
|
]),
|
|
2931
2947
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", _hoisted_8, [
|
|
2932
2948
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BANNER_COMPONENT_CONFIG)[_ctx.code].bizIdTypeCode === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE).IENC_ENCOUNTER ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", _hoisted_9, [
|
|
2933
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(
|
|
2934
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(
|
|
2949
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientStatusDesc ?? "--"), 1),
|
|
2950
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientDays ?? "--"), 1)
|
|
2935
2951
|
])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
2936
2952
|
])
|
|
2937
2953
|
]),
|
|
@@ -2953,7 +2969,7 @@ const _hoisted_12 = {
|
|
|
2953
2969
|
class: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
|
|
2954
2970
|
onMouseenter: checkTextOverflow
|
|
2955
2971
|
}, [
|
|
2956
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + "
|
|
2972
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + ":", 1),
|
|
2957
2973
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_tooltip, {
|
|
2958
2974
|
disabled: !isTextOverflowing.value,
|
|
2959
2975
|
content: item.dataValue
|
|
@@ -3219,6 +3235,11 @@ const pluginMainRequest = async (methodName, params)=>{
|
|
|
3219
3235
|
* @param params
|
|
3220
3236
|
* @returns
|
|
3221
3237
|
*/ const designPreviewPrintReceipt = (params)=>pluginMainRequest("designPreviewPrintReceipt", params);
|
|
3238
|
+
/**
|
|
3239
|
+
* [97-10005-1]web单据打印
|
|
3240
|
+
* @param params
|
|
3241
|
+
* @returns
|
|
3242
|
+
*/ const designPreviewPrintReceiptWeb = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.baseRequest)("/report/designPreviewPrintReceipt", params);
|
|
3222
3243
|
/**
|
|
3223
3244
|
* 分单方式代码
|
|
3224
3245
|
*/ var constant_RECEIPT_SPLIT_TYPE_CODE = /*#__PURE__*/ function(RECEIPT_SPLIT_TYPE_CODE) {
|
|
@@ -3325,6 +3346,129 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
|
|
|
3325
3346
|
*/ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
|
|
3326
3347
|
return DATA_SOURCE_CONTENT_TYPE_CODE;
|
|
3327
3348
|
}({});
|
|
3349
|
+
/** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
|
|
3350
|
+
const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
|
|
3351
|
+
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
3352
|
+
const getMenuXReceiptList = async (params)=>{
|
|
3353
|
+
loading.value = true;
|
|
3354
|
+
const [, res] = await queryMenuXReceiptBySysMenuId(params);
|
|
3355
|
+
loading.value = false;
|
|
3356
|
+
if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
|
|
3357
|
+
};
|
|
3358
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
|
|
3359
|
+
if (isInit) getMenuXReceiptList(params);
|
|
3360
|
+
});
|
|
3361
|
+
return {
|
|
3362
|
+
menuXReceiptList,
|
|
3363
|
+
loading,
|
|
3364
|
+
getMenuXReceiptList
|
|
3365
|
+
};
|
|
3366
|
+
};
|
|
3367
|
+
/** web打印弹出打印框 类型默认是BASE64的格式
|
|
3368
|
+
* type 数据源格式类型代码
|
|
3369
|
+
* @param [type='BASE64']
|
|
3370
|
+
*/ function useWebPrint(content, type = constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
|
|
3371
|
+
// 创建隐藏的iframe
|
|
3372
|
+
const iframe = document.createElement("iframe");
|
|
3373
|
+
iframe.style.position = "fixed";
|
|
3374
|
+
iframe.style.right = "0";
|
|
3375
|
+
iframe.style.bottom = "0";
|
|
3376
|
+
iframe.style.width = "0";
|
|
3377
|
+
iframe.style.height = "0";
|
|
3378
|
+
iframe.style.border = "0";
|
|
3379
|
+
iframe.style.visibility = "hidden"; // 添加这行确保iframe完全隐藏
|
|
3380
|
+
document.body.appendChild(iframe);
|
|
3381
|
+
// 等待iframe加载完成
|
|
3382
|
+
iframe.onload = async ()=>{
|
|
3383
|
+
const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
|
|
3384
|
+
// 根据类型处理内容
|
|
3385
|
+
if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5 || type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
|
|
3386
|
+
iframeDoc.body.innerHTML = content;
|
|
3387
|
+
return; // 不再执行打印操作
|
|
3388
|
+
}
|
|
3389
|
+
if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
|
|
3390
|
+
const img = new Image();
|
|
3391
|
+
// 处理Base64图片
|
|
3392
|
+
if (content.startsWith("data:image")) img.src = content;
|
|
3393
|
+
else // 如果不是完整的data URL,添加前缀
|
|
3394
|
+
img.src = `data:image/png;base64,${content}`;
|
|
3395
|
+
iframeDoc.body.appendChild(img);
|
|
3396
|
+
img.onerror = (error)=>{
|
|
3397
|
+
console.error("加载失败:", error);
|
|
3398
|
+
iframeDoc.body.innerHTML = "<p>加载失败,请检查数据</p>";
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3401
|
+
/** 返回二进制文件时候的解析 */ // else if (type === "FILE") {
|
|
3402
|
+
// const blob = new Blob([content], { type: "application/pdf" });
|
|
3403
|
+
// const url = URL.createObjectURL(blob);
|
|
3404
|
+
// iframeDoc.body.innerHTML = `<embed src="${url}" type="application/pdf" width="100%" height="100%">`;
|
|
3405
|
+
// }
|
|
3406
|
+
await iframe.contentWindow?.focus();
|
|
3407
|
+
await iframe.contentWindow?.print();
|
|
3408
|
+
// 打印完成后移除iframe
|
|
3409
|
+
await document.body.removeChild(iframe);
|
|
3410
|
+
};
|
|
3411
|
+
// 最后添加到DOM
|
|
3412
|
+
document.body.appendChild(iframe);
|
|
3413
|
+
// 强制触发加载
|
|
3414
|
+
iframe.src = "about:blank";
|
|
3415
|
+
}
|
|
3416
|
+
/** 设计或预览 */ function useDesignAndPreview(htmlContent, title = "设计", options = {}) {
|
|
3417
|
+
// 创建一个容器元素
|
|
3418
|
+
const container = document.createElement("div");
|
|
3419
|
+
// 关闭弹窗的函数
|
|
3420
|
+
const closeDialog = ()=>{
|
|
3421
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(null, container); // 卸载组件
|
|
3422
|
+
document.body.removeChild(container); // 移除容器
|
|
3423
|
+
document.head.removeChild(style); // 移除样式
|
|
3424
|
+
};
|
|
3425
|
+
// 在渲染前动态创建并插入样式
|
|
3426
|
+
const style = document.createElement("style");
|
|
3427
|
+
style.innerHTML = `
|
|
3428
|
+
.custom-dialog .el-dialog__headerbtn .el-icon {
|
|
3429
|
+
width: 48px; /* 设置图标的宽度 */
|
|
3430
|
+
height: 48px; /* 设置图标的高度 */
|
|
3431
|
+
}
|
|
3432
|
+
`;
|
|
3433
|
+
document.head.appendChild(style);
|
|
3434
|
+
// 使用 h 函数创建弹窗组件
|
|
3435
|
+
const dialog = (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElDialog, {
|
|
3436
|
+
modelValue: true,
|
|
3437
|
+
title: title,
|
|
3438
|
+
width: "50%",
|
|
3439
|
+
onClose: ()=>{
|
|
3440
|
+
options.onCancel?.(); // 触发取消回调
|
|
3441
|
+
closeDialog();
|
|
3442
|
+
},
|
|
3443
|
+
class: "custom-dialog"
|
|
3444
|
+
}, {
|
|
3445
|
+
default: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElScrollbar, {
|
|
3446
|
+
style: {
|
|
3447
|
+
height: "400px",
|
|
3448
|
+
paddingRight: "10px"
|
|
3449
|
+
}
|
|
3450
|
+
}, ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
|
|
3451
|
+
style: {
|
|
3452
|
+
padding: "10px"
|
|
3453
|
+
},
|
|
3454
|
+
innerHTML: htmlContent
|
|
3455
|
+
})),
|
|
3456
|
+
footer: options.footer ? options.footer : ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
|
|
3457
|
+
class: "dialog-footer"
|
|
3458
|
+
}, [
|
|
3459
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElButton, {
|
|
3460
|
+
onClick: ()=>{
|
|
3461
|
+
options.onCancel?.(); // 触发取消回调
|
|
3462
|
+
closeDialog();
|
|
3463
|
+
}
|
|
3464
|
+
}, ()=>"取消")
|
|
3465
|
+
])
|
|
3466
|
+
});
|
|
3467
|
+
// 将弹窗渲染到容器中
|
|
3468
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(dialog, container);
|
|
3469
|
+
// 将容器添加到 body
|
|
3470
|
+
document.body.appendChild(container);
|
|
3471
|
+
}
|
|
3328
3472
|
let defaultContext = {
|
|
3329
3473
|
printParams: void 0,
|
|
3330
3474
|
receiptInfo: void 0,
|
|
@@ -3620,7 +3764,7 @@ const printStart = async (params)=>{
|
|
|
3620
3764
|
throw new Error("暂不支持该方式打印");
|
|
3621
3765
|
}
|
|
3622
3766
|
if (defaultContext?.dataSourceContentTypeCodeItem === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
|
|
3623
|
-
const
|
|
3767
|
+
const params = {
|
|
3624
3768
|
formOperationType: defaultContext?.printParams?.formOperationType,
|
|
3625
3769
|
printType: defaultContext?.printParams?.printType,
|
|
3626
3770
|
receiptId: defaultContext?.printParams?.receiptId,
|
|
@@ -3629,31 +3773,25 @@ const printStart = async (params)=>{
|
|
|
3629
3773
|
dataSourceContentTypeCode: defaultContext?.dataSourceContentTypeCodeItem,
|
|
3630
3774
|
dataSourceContent: defaultContext?.dataSourceContentItem,
|
|
3631
3775
|
printQty: defaultContext?.receiptInfo?.printQty
|
|
3632
|
-
}
|
|
3633
|
-
|
|
3776
|
+
};
|
|
3777
|
+
/** 判断是否客户端打印 */ const { isLocalPrint } = use_app_config([
|
|
3778
|
+
use_app_config_MAIN_APP_CONFIG.IS_LOCAL_PRINT
|
|
3779
|
+
]);
|
|
3780
|
+
if (isLocalPrint) {
|
|
3781
|
+
const [, res] = await designPreviewPrintReceipt(params);
|
|
3782
|
+
if (res?.success) return res.data ?? [];
|
|
3783
|
+
} else {
|
|
3784
|
+
/** 调用接口 */ const [, res] = await designPreviewPrintReceiptWeb(params);
|
|
3785
|
+
if (res?.success) {
|
|
3786
|
+
if (defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.PRINT) useWebPrint(res?.data);
|
|
3787
|
+
else useDesignAndPreview(res?.data, defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.DESIGN ? "设计" : "预览");
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3634
3790
|
}
|
|
3635
3791
|
};
|
|
3636
3792
|
const print = async (params)=>{
|
|
3637
3793
|
await printStart(params);
|
|
3638
3794
|
};
|
|
3639
|
-
const usePrintReceipt = (params, isInit = true)=>{
|
|
3640
|
-
const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
|
|
3641
|
-
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
3642
|
-
const getMenuXReceiptList = async (params)=>{
|
|
3643
|
-
loading.value = true;
|
|
3644
|
-
const [, res] = await queryMenuXReceiptBySysMenuId(params);
|
|
3645
|
-
loading.value = false;
|
|
3646
|
-
if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
|
|
3647
|
-
};
|
|
3648
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
|
|
3649
|
-
if (isInit) getMenuXReceiptList(params);
|
|
3650
|
-
});
|
|
3651
|
-
return {
|
|
3652
|
-
menuXReceiptList,
|
|
3653
|
-
loading,
|
|
3654
|
-
getMenuXReceiptList
|
|
3655
|
-
};
|
|
3656
|
-
};
|
|
3657
3795
|
/* ESM default export */ const printReceiptBtnvue_type_script_setup_true_lang_ts_name_printReceipt = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
3658
3796
|
__name: 'printReceiptBtn',
|
|
3659
3797
|
props: {
|
|
@@ -4133,6 +4271,8 @@ const DICT_SELECT = 'dictSelect';
|
|
|
4133
4271
|
const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
|
|
4134
4272
|
return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
4135
4273
|
key: 0,
|
|
4274
|
+
ref_key: "componentRef",
|
|
4275
|
+
ref: componentRef,
|
|
4136
4276
|
filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false,
|
|
4137
4277
|
clearable: true
|
|
4138
4278
|
}, {
|
|
@@ -5355,6 +5495,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
|
|
|
5355
5495
|
/* ESM default export */ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
5356
5496
|
__name: 'index',
|
|
5357
5497
|
props: {
|
|
5498
|
+
btnTitle: {
|
|
5499
|
+
default: "新患者"
|
|
5500
|
+
},
|
|
5358
5501
|
code: {},
|
|
5359
5502
|
menuId: {},
|
|
5360
5503
|
clearBtn: {
|
|
@@ -5441,9 +5584,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
|
|
|
5441
5584
|
plain: "",
|
|
5442
5585
|
onClick: clearFn
|
|
5443
5586
|
}, {
|
|
5444
|
-
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>
|
|
5445
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)(
|
|
5446
|
-
])
|
|
5587
|
+
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
5588
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
|
|
5589
|
+
]),
|
|
5447
5590
|
_: 1
|
|
5448
5591
|
})) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
5449
5592
|
])
|
|
@@ -35,3 +35,9 @@ export declare const splitReceipt: (params: SplitReceiptReqParams) => Promise<[i
|
|
|
35
35
|
* @returns
|
|
36
36
|
*/
|
|
37
37
|
export declare const designPreviewPrintReceipt: (params: DesignPreviewPrintReceiptResParams) => Promise<any[]>;
|
|
38
|
+
/**
|
|
39
|
+
* [97-10005-1]web单据打印
|
|
40
|
+
* @param params
|
|
41
|
+
* @returns
|
|
42
|
+
*/
|
|
43
|
+
export declare const designPreviewPrintReceiptWeb: (params: DesignPreviewPrintReceiptResParams) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<unknown> | undefined]>;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { VNode } from "vue";
|
|
2
|
+
import { DATA_SOURCE_CONTENT_TYPE_CODE } from "../constant";
|
|
1
3
|
import type { MenuXReceiptReqParams, MenuXReceiptListReqItem } from "../types";
|
|
4
|
+
/** 用于获取单据 */
|
|
2
5
|
export declare const usePrintReceipt: (params: MenuXReceiptReqParams, isInit?: boolean) => {
|
|
3
6
|
menuXReceiptList: import("vue").Ref<{
|
|
4
7
|
menuXReceiptId: string;
|
|
@@ -20,3 +23,14 @@ export declare const usePrintReceipt: (params: MenuXReceiptReqParams, isInit?: b
|
|
|
20
23
|
loading: import("vue").Ref<boolean, boolean>;
|
|
21
24
|
getMenuXReceiptList: (params: MenuXReceiptReqParams) => Promise<void>;
|
|
22
25
|
};
|
|
26
|
+
/** web打印弹出打印框 类型默认是BASE64的格式
|
|
27
|
+
* type 数据源格式类型代码
|
|
28
|
+
* @param [type='BASE64']
|
|
29
|
+
*/
|
|
30
|
+
export declare function useWebPrint(content: string, type?: DATA_SOURCE_CONTENT_TYPE_CODE): void;
|
|
31
|
+
/** 设计或预览 */
|
|
32
|
+
export declare function useDesignAndPreview(htmlContent: string | undefined, title?: string, options?: {
|
|
33
|
+
footer?: () => VNode;
|
|
34
|
+
onConfirm?: () => void;
|
|
35
|
+
onCancel?: () => void;
|
|
36
|
+
}): void;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import { FieldNamesProps } from
|
|
1
|
+
import { FieldNamesProps } from "./interface";
|
|
2
2
|
/**
|
|
3
3
|
* @description: 是否为数组
|
|
4
4
|
*/
|
|
5
5
|
export declare function isArray(val: any): val is Array<any>;
|
|
6
|
+
/**
|
|
7
|
+
* @description 生成随机数
|
|
8
|
+
* @param {Number} min 最小值
|
|
9
|
+
* @param {Number} max 最大值
|
|
10
|
+
* @returns {Number}
|
|
11
|
+
*/
|
|
12
|
+
export declare function randomNum(min: number, max: number): number;
|
|
13
|
+
/**
|
|
14
|
+
* @description 格式化表格单元格默认值 (el-table-column)
|
|
15
|
+
* @param {Number} row 行
|
|
16
|
+
* @param {Number} col 列
|
|
17
|
+
* @param {*} callValue 当前单元格值
|
|
18
|
+
* @returns {String}
|
|
19
|
+
* */
|
|
20
|
+
export declare function formatTableColumn(row: number, col: number, callValue: unknown): {};
|
|
6
21
|
/**
|
|
7
22
|
* @description 处理 ProTable 值为数组 || 无数据
|
|
8
23
|
* @param {*} callValue 需要处理的值
|
|
@@ -36,4 +51,4 @@ export declare function findItemNested(enumData: any, callValue: any, value: str
|
|
|
36
51
|
* @param {String} type 过滤类型(目前只有 tag)
|
|
37
52
|
* @returns {String}
|
|
38
53
|
* */
|
|
39
|
-
export declare function filterEnum(callValue: unknown, enumData?: unknown, fieldNames?: FieldNamesProps, type?:
|
|
54
|
+
export declare function filterEnum(callValue: unknown, enumData?: unknown, fieldNames?: FieldNamesProps, type?: "tag"): any;
|
package/dist/hooks/index.js
CHANGED
|
@@ -356,6 +356,7 @@ function useRequest_useRequest(service, options, plugins) {
|
|
|
356
356
|
/**
|
|
357
357
|
* 是否为 sass 模式
|
|
358
358
|
*/ MAIN_APP_CONFIG["IS_SASS_MODE"] = "isSassMode";
|
|
359
|
+
/** 是否使用本地打印 */ MAIN_APP_CONFIG["IS_LOCAL_PRINT"] = "isLocalPrint";
|
|
359
360
|
/**用户信息 */ MAIN_APP_CONFIG["USER_INFO"] = "userInfo";
|
|
360
361
|
/** 用户偏好 */ MAIN_APP_CONFIG["PREFERENCE_LIST"] = "preferenceList";
|
|
361
362
|
return MAIN_APP_CONFIG;
|
|
@@ -15,6 +15,7 @@ export type UserInfo = {
|
|
|
15
15
|
userNo: string;
|
|
16
16
|
userId: string;
|
|
17
17
|
userName: string;
|
|
18
|
+
adminFlag: 0 | 1;
|
|
18
19
|
};
|
|
19
20
|
export type PreferenceData = {
|
|
20
21
|
preferId?: string;
|
|
@@ -29,12 +30,14 @@ export interface AppConfigType {
|
|
|
29
30
|
* 系统菜单ID
|
|
30
31
|
*/
|
|
31
32
|
menuId: string;
|
|
32
|
-
|
|
33
|
+
/**>
|
|
33
34
|
* 是否为云环境
|
|
34
35
|
*/
|
|
35
36
|
isCloudEnv: boolean;
|
|
36
37
|
/** 是否为sass模式 */
|
|
37
38
|
isSassMode: boolean;
|
|
39
|
+
/** 是否使用本地打印 */
|
|
40
|
+
isLocalPrint: boolean;
|
|
38
41
|
/**
|
|
39
42
|
* 当前组织信息
|
|
40
43
|
*/
|
package/dist/index.js
CHANGED
|
@@ -269,8 +269,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
269
269
|
* @returns {String}
|
|
270
270
|
* */ function formatValue(callValue) {
|
|
271
271
|
// 如果当前值为数组,使用 / 拼接(根据需求自定义)
|
|
272
|
-
if (isArray(callValue)) return callValue.length ? callValue.join(
|
|
273
|
-
return callValue ??
|
|
272
|
+
if (isArray(callValue)) return callValue.length ? callValue.join(" / ") : "--";
|
|
273
|
+
return callValue ?? "--";
|
|
274
274
|
}
|
|
275
275
|
/**
|
|
276
276
|
* @description 处理 prop 为多级嵌套的情况,返回的数据 (列如: prop: user.name)
|
|
@@ -278,8 +278,8 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
278
278
|
* @param {String} prop 当前 prop
|
|
279
279
|
* @returns {*}
|
|
280
280
|
* */ function handleRowAccordingToProp(row, prop) {
|
|
281
|
-
if (!prop?.includes(
|
|
282
|
-
prop.split(
|
|
281
|
+
if (!prop?.includes(".")) return row[prop] ?? "--";
|
|
282
|
+
prop.split(".").forEach((item)=>row = row[item] ?? "--");
|
|
283
283
|
return row;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
@@ -287,7 +287,7 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
287
287
|
* @param {String} prop 当前 prop
|
|
288
288
|
* @returns {String}
|
|
289
289
|
* */ function handleProp(prop) {
|
|
290
|
-
const propArr = prop.split(
|
|
290
|
+
const propArr = prop.split(".");
|
|
291
291
|
if (1 == propArr.length) return prop;
|
|
292
292
|
return propArr[propArr.length - 1];
|
|
293
293
|
}
|
|
@@ -308,15 +308,15 @@ const copy_text_with_tooltip_exports_ = /*#__PURE__*/ (0, exportHelper["default"
|
|
|
308
308
|
* @param {String} type 过滤类型(目前只有 tag)
|
|
309
309
|
* @returns {String}
|
|
310
310
|
* */ function filterEnum(callValue, enumData, fieldNames, type) {
|
|
311
|
-
const value = fieldNames?.value ??
|
|
312
|
-
const label = fieldNames?.label ??
|
|
313
|
-
const children = fieldNames?.children ??
|
|
311
|
+
const value = fieldNames?.value ?? "value";
|
|
312
|
+
const label = fieldNames?.label ?? "label";
|
|
313
|
+
const children = fieldNames?.children ?? "children";
|
|
314
314
|
let filterData = {};
|
|
315
315
|
// 判断 enumData 是否为数组
|
|
316
316
|
if (Array.isArray(enumData)) filterData = findItemNested(enumData, callValue, value, children);
|
|
317
317
|
// 判断是否输出的结果为 tag 类型
|
|
318
|
-
if (
|
|
319
|
-
return filterData ? filterData[label] :
|
|
318
|
+
if ("tag" == type) return filterData?.tagType ? filterData.tagType : "";
|
|
319
|
+
return filterData ? filterData[label] : "--";
|
|
320
320
|
}
|
|
321
321
|
function _isSlot(s) {
|
|
322
322
|
return 'function' == typeof s || '[object Object]' === Object.prototype.toString.call(s) && !(0, __WEBPACK_EXTERNAL_MODULE_vue__.isVNode)(s);
|
|
@@ -619,6 +619,7 @@ const DbgridTableConfig_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(Db
|
|
|
619
619
|
/**
|
|
620
620
|
* 是否为 sass 模式
|
|
621
621
|
*/ MAIN_APP_CONFIG["IS_SASS_MODE"] = "isSassMode";
|
|
622
|
+
/** 是否使用本地打印 */ MAIN_APP_CONFIG["IS_LOCAL_PRINT"] = "isLocalPrint";
|
|
622
623
|
/**用户信息 */ MAIN_APP_CONFIG["USER_INFO"] = "userInfo";
|
|
623
624
|
/** 用户偏好 */ MAIN_APP_CONFIG["PREFERENCE_LIST"] = "preferenceList";
|
|
624
625
|
return MAIN_APP_CONFIG;
|
|
@@ -1415,7 +1416,7 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1 = {
|
|
|
1415
1416
|
class: "relative flex flex-1 flex-col overflow-hidden"
|
|
1416
1417
|
};
|
|
1417
1418
|
const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
1418
|
-
key:
|
|
1419
|
+
key: 1,
|
|
1419
1420
|
class: "mt-5 flex justify-between items-center"
|
|
1420
1421
|
};
|
|
1421
1422
|
// 接受父组件参数,配置默认值
|
|
@@ -1474,7 +1475,20 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
|
1474
1475
|
default: ()=>({})
|
|
1475
1476
|
},
|
|
1476
1477
|
layout: {
|
|
1477
|
-
default:
|
|
1478
|
+
default: "total, sizes, prev, pager, next"
|
|
1479
|
+
},
|
|
1480
|
+
dragTips: {
|
|
1481
|
+
default: "温馨提示:您可通过拖动进行排序"
|
|
1482
|
+
},
|
|
1483
|
+
isShowDragTips: {
|
|
1484
|
+
type: Boolean,
|
|
1485
|
+
default: false
|
|
1486
|
+
},
|
|
1487
|
+
dragTipsCustomStyle: {
|
|
1488
|
+
default: {}
|
|
1489
|
+
},
|
|
1490
|
+
dragTipsClassName: {
|
|
1491
|
+
default: ""
|
|
1478
1492
|
}
|
|
1479
1493
|
},
|
|
1480
1494
|
emits: [
|
|
@@ -1719,6 +1733,18 @@ const pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_2 = {
|
|
|
1719
1733
|
return (_ctx, _cache)=>{
|
|
1720
1734
|
const _directive_loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective)("loading");
|
|
1721
1735
|
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", pro_tablevue_type_script_lang_ts_setup_true_name_ProTable_hoisted_1, [
|
|
1736
|
+
props?.draggable || props?.isShowDragTips ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", {
|
|
1737
|
+
key: 0,
|
|
1738
|
+
style: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeStyle)({
|
|
1739
|
+
color: '#f7ba2a',
|
|
1740
|
+
...props.dragTipsCustomStyle
|
|
1741
|
+
}),
|
|
1742
|
+
class: (0, __WEBPACK_EXTERNAL_MODULE_vue__.normalizeClass)([
|
|
1743
|
+
'text-base',
|
|
1744
|
+
'mb-2',
|
|
1745
|
+
props.dragTipsClassName
|
|
1746
|
+
])
|
|
1747
|
+
}, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(props.dragTips), 7)) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
|
|
1722
1748
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(TableContainer, {
|
|
1723
1749
|
ref_key: "formRef",
|
|
1724
1750
|
ref: formRef,
|
|
@@ -3226,16 +3252,6 @@ const _hoisted_12 = {
|
|
|
3226
3252
|
};
|
|
3227
3253
|
// 计算实际布局列数
|
|
3228
3254
|
const layoutColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>parseLayoutColumns(bannerInfo.value?.layoutTypeCode));
|
|
3229
|
-
/** 如果是住院就诊,返回就诊状态和天数 */ const encounterInfo = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
|
|
3230
|
-
if (BANNER_COMPONENT_CONFIG[__props.code].bizIdTypeCode !== __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE.IENC_ENCOUNTER) return null;
|
|
3231
|
-
const bannerItems = bannerInfo.value?.bannerItemList ?? [];
|
|
3232
|
-
const statusItem = bannerItems.find((item)=>"inEncStatusDesc" === item.bindingFieldNo);
|
|
3233
|
-
const daysItem = bannerItems.find((item)=>"inpatientDays" === item.bindingFieldNo);
|
|
3234
|
-
return {
|
|
3235
|
-
inEncStatusDesc: statusItem?.dataValue ?? "--",
|
|
3236
|
-
inpatientDays: daysItem?.dataValue ? `(${daysItem.dataValue})` : "--"
|
|
3237
|
-
};
|
|
3238
|
-
});
|
|
3239
3255
|
/** 获取banner配置 */ const queryBannerConfig = async ()=>{
|
|
3240
3256
|
loading.value = true;
|
|
3241
3257
|
if (!__props.bizId && initBannerInfo.value) {
|
|
@@ -3250,7 +3266,7 @@ const _hoisted_12 = {
|
|
|
3250
3266
|
});
|
|
3251
3267
|
loading.value = false;
|
|
3252
3268
|
if (res?.success) {
|
|
3253
|
-
res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item.
|
|
3269
|
+
res.data.bannerItemList = (res?.data?.bannerItemList ?? [])?.filter((item)=>item?.displayFlag === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG.YES);
|
|
3254
3270
|
if (!__props.bizId) initBannerInfo.value = res?.data;
|
|
3255
3271
|
bannerInfo.value = res?.data;
|
|
3256
3272
|
}
|
|
@@ -3328,8 +3344,8 @@ const _hoisted_12 = {
|
|
|
3328
3344
|
]),
|
|
3329
3345
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", _hoisted_8, [
|
|
3330
3346
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(BANNER_COMPONENT_CONFIG)[_ctx.code].bizIdTypeCode === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.BIZ_ID_TYPE_CODE).IENC_ENCOUNTER ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", _hoisted_9, [
|
|
3331
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(
|
|
3332
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(
|
|
3347
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_10, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientStatusDesc ?? "--"), 1),
|
|
3348
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(bannerInfo.value?.inpatientDays ?? "--"), 1)
|
|
3333
3349
|
])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
3334
3350
|
])
|
|
3335
3351
|
]),
|
|
@@ -3351,7 +3367,7 @@ const _hoisted_12 = {
|
|
|
3351
3367
|
class: "w-full overflow-hidden text-ellipsis whitespace-nowrap",
|
|
3352
3368
|
onMouseenter: checkTextOverflow
|
|
3353
3369
|
}, [
|
|
3354
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + "
|
|
3370
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("span", _hoisted_11, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item.labelNameDisplay) + ":", 1),
|
|
3355
3371
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_tooltip, {
|
|
3356
3372
|
disabled: !isTextOverflowing.value,
|
|
3357
3373
|
content: item.dataValue
|
|
@@ -3617,6 +3633,11 @@ const pluginMainRequest = async (methodName, params)=>{
|
|
|
3617
3633
|
* @param params
|
|
3618
3634
|
* @returns
|
|
3619
3635
|
*/ const designPreviewPrintReceipt = (params)=>pluginMainRequest("designPreviewPrintReceipt", params);
|
|
3636
|
+
/**
|
|
3637
|
+
* [97-10005-1]web单据打印
|
|
3638
|
+
* @param params
|
|
3639
|
+
* @returns
|
|
3640
|
+
*/ const designPreviewPrintReceiptWeb = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.baseRequest)("/report/designPreviewPrintReceipt", params);
|
|
3620
3641
|
/**
|
|
3621
3642
|
* 分单方式代码
|
|
3622
3643
|
*/ var constant_RECEIPT_SPLIT_TYPE_CODE = /*#__PURE__*/ function(RECEIPT_SPLIT_TYPE_CODE) {
|
|
@@ -3723,6 +3744,129 @@ var constant_DATA_SOURCE_CONTENT_TYPE_CODE = /*#__PURE__*/ function(DATA_SOURCE_
|
|
|
3723
3744
|
*/ DATA_SOURCE_CONTENT_TYPE_CODE["BASE64"] = "BASE64";
|
|
3724
3745
|
return DATA_SOURCE_CONTENT_TYPE_CODE;
|
|
3725
3746
|
}({});
|
|
3747
|
+
/** 用于获取单据 */ const usePrintReceipt = (params, isInit = true)=>{
|
|
3748
|
+
const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
|
|
3749
|
+
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
3750
|
+
const getMenuXReceiptList = async (params)=>{
|
|
3751
|
+
loading.value = true;
|
|
3752
|
+
const [, res] = await queryMenuXReceiptBySysMenuId(params);
|
|
3753
|
+
loading.value = false;
|
|
3754
|
+
if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
|
|
3755
|
+
};
|
|
3756
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
|
|
3757
|
+
if (isInit) getMenuXReceiptList(params);
|
|
3758
|
+
});
|
|
3759
|
+
return {
|
|
3760
|
+
menuXReceiptList,
|
|
3761
|
+
loading,
|
|
3762
|
+
getMenuXReceiptList
|
|
3763
|
+
};
|
|
3764
|
+
};
|
|
3765
|
+
/** web打印弹出打印框 类型默认是BASE64的格式
|
|
3766
|
+
* type 数据源格式类型代码
|
|
3767
|
+
* @param [type='BASE64']
|
|
3768
|
+
*/ function useWebPrint(content, type = constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
|
|
3769
|
+
// 创建隐藏的iframe
|
|
3770
|
+
const iframe = document.createElement("iframe");
|
|
3771
|
+
iframe.style.position = "fixed";
|
|
3772
|
+
iframe.style.right = "0";
|
|
3773
|
+
iframe.style.bottom = "0";
|
|
3774
|
+
iframe.style.width = "0";
|
|
3775
|
+
iframe.style.height = "0";
|
|
3776
|
+
iframe.style.border = "0";
|
|
3777
|
+
iframe.style.visibility = "hidden"; // 添加这行确保iframe完全隐藏
|
|
3778
|
+
document.body.appendChild(iframe);
|
|
3779
|
+
// 等待iframe加载完成
|
|
3780
|
+
iframe.onload = async ()=>{
|
|
3781
|
+
const iframeDoc = iframe.contentDocument || iframe.contentWindow?.document;
|
|
3782
|
+
// 根据类型处理内容
|
|
3783
|
+
if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.H5 || type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
|
|
3784
|
+
iframeDoc.body.innerHTML = content;
|
|
3785
|
+
return; // 不再执行打印操作
|
|
3786
|
+
}
|
|
3787
|
+
if (type === constant_DATA_SOURCE_CONTENT_TYPE_CODE.BASE64) {
|
|
3788
|
+
const img = new Image();
|
|
3789
|
+
// 处理Base64图片
|
|
3790
|
+
if (content.startsWith("data:image")) img.src = content;
|
|
3791
|
+
else // 如果不是完整的data URL,添加前缀
|
|
3792
|
+
img.src = `data:image/png;base64,${content}`;
|
|
3793
|
+
iframeDoc.body.appendChild(img);
|
|
3794
|
+
img.onerror = (error)=>{
|
|
3795
|
+
console.error("加载失败:", error);
|
|
3796
|
+
iframeDoc.body.innerHTML = "<p>加载失败,请检查数据</p>";
|
|
3797
|
+
};
|
|
3798
|
+
}
|
|
3799
|
+
/** 返回二进制文件时候的解析 */ // else if (type === "FILE") {
|
|
3800
|
+
// const blob = new Blob([content], { type: "application/pdf" });
|
|
3801
|
+
// const url = URL.createObjectURL(blob);
|
|
3802
|
+
// iframeDoc.body.innerHTML = `<embed src="${url}" type="application/pdf" width="100%" height="100%">`;
|
|
3803
|
+
// }
|
|
3804
|
+
await iframe.contentWindow?.focus();
|
|
3805
|
+
await iframe.contentWindow?.print();
|
|
3806
|
+
// 打印完成后移除iframe
|
|
3807
|
+
await document.body.removeChild(iframe);
|
|
3808
|
+
};
|
|
3809
|
+
// 最后添加到DOM
|
|
3810
|
+
document.body.appendChild(iframe);
|
|
3811
|
+
// 强制触发加载
|
|
3812
|
+
iframe.src = "about:blank";
|
|
3813
|
+
}
|
|
3814
|
+
/** 设计或预览 */ function useDesignAndPreview(htmlContent, title = "设计", options = {}) {
|
|
3815
|
+
// 创建一个容器元素
|
|
3816
|
+
const container = document.createElement("div");
|
|
3817
|
+
// 关闭弹窗的函数
|
|
3818
|
+
const closeDialog = ()=>{
|
|
3819
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(null, container); // 卸载组件
|
|
3820
|
+
document.body.removeChild(container); // 移除容器
|
|
3821
|
+
document.head.removeChild(style); // 移除样式
|
|
3822
|
+
};
|
|
3823
|
+
// 在渲染前动态创建并插入样式
|
|
3824
|
+
const style = document.createElement("style");
|
|
3825
|
+
style.innerHTML = `
|
|
3826
|
+
.custom-dialog .el-dialog__headerbtn .el-icon {
|
|
3827
|
+
width: 48px; /* 设置图标的宽度 */
|
|
3828
|
+
height: 48px; /* 设置图标的高度 */
|
|
3829
|
+
}
|
|
3830
|
+
`;
|
|
3831
|
+
document.head.appendChild(style);
|
|
3832
|
+
// 使用 h 函数创建弹窗组件
|
|
3833
|
+
const dialog = (0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElDialog, {
|
|
3834
|
+
modelValue: true,
|
|
3835
|
+
title: title,
|
|
3836
|
+
width: "50%",
|
|
3837
|
+
onClose: ()=>{
|
|
3838
|
+
options.onCancel?.(); // 触发取消回调
|
|
3839
|
+
closeDialog();
|
|
3840
|
+
},
|
|
3841
|
+
class: "custom-dialog"
|
|
3842
|
+
}, {
|
|
3843
|
+
default: ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElScrollbar, {
|
|
3844
|
+
style: {
|
|
3845
|
+
height: "400px",
|
|
3846
|
+
paddingRight: "10px"
|
|
3847
|
+
}
|
|
3848
|
+
}, ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
|
|
3849
|
+
style: {
|
|
3850
|
+
padding: "10px"
|
|
3851
|
+
},
|
|
3852
|
+
innerHTML: htmlContent
|
|
3853
|
+
})),
|
|
3854
|
+
footer: options.footer ? options.footer : ()=>(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)("div", {
|
|
3855
|
+
class: "dialog-footer"
|
|
3856
|
+
}, [
|
|
3857
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.h)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElButton, {
|
|
3858
|
+
onClick: ()=>{
|
|
3859
|
+
options.onCancel?.(); // 触发取消回调
|
|
3860
|
+
closeDialog();
|
|
3861
|
+
}
|
|
3862
|
+
}, ()=>"取消")
|
|
3863
|
+
])
|
|
3864
|
+
});
|
|
3865
|
+
// 将弹窗渲染到容器中
|
|
3866
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.render)(dialog, container);
|
|
3867
|
+
// 将容器添加到 body
|
|
3868
|
+
document.body.appendChild(container);
|
|
3869
|
+
}
|
|
3726
3870
|
let defaultContext = {
|
|
3727
3871
|
printParams: void 0,
|
|
3728
3872
|
receiptInfo: void 0,
|
|
@@ -4018,7 +4162,7 @@ const printStart = async (params)=>{
|
|
|
4018
4162
|
throw new Error("暂不支持该方式打印");
|
|
4019
4163
|
}
|
|
4020
4164
|
if (defaultContext?.dataSourceContentTypeCodeItem === constant_DATA_SOURCE_CONTENT_TYPE_CODE.JSON) {
|
|
4021
|
-
const
|
|
4165
|
+
const params = {
|
|
4022
4166
|
formOperationType: defaultContext?.printParams?.formOperationType,
|
|
4023
4167
|
printType: defaultContext?.printParams?.printType,
|
|
4024
4168
|
receiptId: defaultContext?.printParams?.receiptId,
|
|
@@ -4027,31 +4171,25 @@ const printStart = async (params)=>{
|
|
|
4027
4171
|
dataSourceContentTypeCode: defaultContext?.dataSourceContentTypeCodeItem,
|
|
4028
4172
|
dataSourceContent: defaultContext?.dataSourceContentItem,
|
|
4029
4173
|
printQty: defaultContext?.receiptInfo?.printQty
|
|
4030
|
-
}
|
|
4031
|
-
|
|
4174
|
+
};
|
|
4175
|
+
/** 判断是否客户端打印 */ const { isLocalPrint } = use_app_config([
|
|
4176
|
+
use_app_config_MAIN_APP_CONFIG.IS_LOCAL_PRINT
|
|
4177
|
+
]);
|
|
4178
|
+
if (isLocalPrint) {
|
|
4179
|
+
const [, res] = await designPreviewPrintReceipt(params);
|
|
4180
|
+
if (res?.success) return res.data ?? [];
|
|
4181
|
+
} else {
|
|
4182
|
+
/** 调用接口 */ const [, res] = await designPreviewPrintReceiptWeb(params);
|
|
4183
|
+
if (res?.success) {
|
|
4184
|
+
if (defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.PRINT) useWebPrint(res?.data);
|
|
4185
|
+
else useDesignAndPreview(res?.data, defaultContext?.printParams?.formOperationType === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FORM_OPERATION_TYPE.DESIGN ? "设计" : "预览");
|
|
4186
|
+
}
|
|
4187
|
+
}
|
|
4032
4188
|
}
|
|
4033
4189
|
};
|
|
4034
4190
|
const print = async (params)=>{
|
|
4035
4191
|
await printStart(params);
|
|
4036
4192
|
};
|
|
4037
|
-
const usePrintReceipt = (params, isInit = true)=>{
|
|
4038
|
-
const menuXReceiptList = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)([]);
|
|
4039
|
-
const loading = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
4040
|
-
const getMenuXReceiptList = async (params)=>{
|
|
4041
|
-
loading.value = true;
|
|
4042
|
-
const [, res] = await queryMenuXReceiptBySysMenuId(params);
|
|
4043
|
-
loading.value = false;
|
|
4044
|
-
if (res?.success) menuXReceiptList.value = res.data?.menuXReceiptList || [];
|
|
4045
|
-
};
|
|
4046
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
|
|
4047
|
-
if (isInit) getMenuXReceiptList(params);
|
|
4048
|
-
});
|
|
4049
|
-
return {
|
|
4050
|
-
menuXReceiptList,
|
|
4051
|
-
loading,
|
|
4052
|
-
getMenuXReceiptList
|
|
4053
|
-
};
|
|
4054
|
-
};
|
|
4055
4193
|
/* ESM default export */ const printReceiptBtnvue_type_script_setup_true_lang_ts_name_printReceipt = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
4056
4194
|
__name: 'printReceiptBtn',
|
|
4057
4195
|
props: {
|
|
@@ -4747,6 +4885,8 @@ const DICT_SELECT = 'dictSelect';
|
|
|
4747
4885
|
const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
|
|
4748
4886
|
return 'select' === (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)((0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveDynamicComponent)(`el-${(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(attrs).component}`), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
4749
4887
|
key: 0,
|
|
4888
|
+
ref_key: "componentRef",
|
|
4889
|
+
ref: componentRef,
|
|
4750
4890
|
filterable: !!(__WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.filterable || __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length && __WEBPACK_EXTERNAL_MODULE_vue__.unref(attrs)?.options?.length > 5) || false,
|
|
4751
4891
|
clearable: true
|
|
4752
4892
|
}, {
|
|
@@ -5233,6 +5373,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
|
|
|
5233
5373
|
/* ESM default export */ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
5234
5374
|
__name: 'index',
|
|
5235
5375
|
props: {
|
|
5376
|
+
btnTitle: {
|
|
5377
|
+
default: "新患者"
|
|
5378
|
+
},
|
|
5236
5379
|
code: {},
|
|
5237
5380
|
menuId: {},
|
|
5238
5381
|
clearBtn: {
|
|
@@ -5319,9 +5462,9 @@ const access_infovue_type_script_setup_true_lang_ts_name_accessInfo_hoisted_3 =
|
|
|
5319
5462
|
plain: "",
|
|
5320
5463
|
onClick: clearFn
|
|
5321
5464
|
}, {
|
|
5322
|
-
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>
|
|
5323
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)(
|
|
5324
|
-
])
|
|
5465
|
+
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
5466
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(_ctx.btnTitle), 1)
|
|
5467
|
+
]),
|
|
5325
5468
|
_: 1
|
|
5326
5469
|
})) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
|
|
5327
5470
|
])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sun-biz",
|
|
3
|
-
"version": "0.0.3-beta.
|
|
3
|
+
"version": "0.0.3-beta.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"vue": "^3.2.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@element-sun/icons-vue": "^1.0.
|
|
60
|
-
"@sun-toolkit/enums": "1.0.0-beta.
|
|
61
|
-
"@sun-toolkit/request": "1.0.0-beta.
|
|
62
|
-
"@sun-toolkit/shared": "0.0.1-beta.
|
|
59
|
+
"@element-sun/icons-vue": "^1.0.6",
|
|
60
|
+
"@sun-toolkit/enums": "1.0.0-beta.12",
|
|
61
|
+
"@sun-toolkit/request": "1.0.0-beta.10",
|
|
62
|
+
"@sun-toolkit/shared": "0.0.1-beta.4",
|
|
63
63
|
"axios": "^1.8.1",
|
|
64
|
-
"element-sun": "0.0.0-dev.
|
|
64
|
+
"element-sun": "0.0.0-dev.4",
|
|
65
65
|
"i18next": "^23.16.8",
|
|
66
66
|
"i18next-vue": "^5.2.0",
|
|
67
67
|
"js-pinyin": "^0.2.7",
|