cnhis-design-vue 2.1.98 → 2.1.100

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +25 -10
  2. package/README.md +5 -8
  3. package/es/affix/index.js +8 -8
  4. package/es/age/index.js +10 -10
  5. package/es/alert/index.js +8 -8
  6. package/es/anchor/index.js +8 -8
  7. package/es/auto-complete/index.js +8 -8
  8. package/es/avatar/index.js +8 -8
  9. package/es/back-top/index.js +8 -8
  10. package/es/badge/index.js +8 -8
  11. package/es/base/index.js +8 -8
  12. package/es/big-table/index.js +68 -68
  13. package/es/breadcrumb/index.js +8 -8
  14. package/es/button/index.js +22 -22
  15. package/es/calendar/index.js +8 -8
  16. package/es/captcha/index.js +3 -3
  17. package/es/card/index.js +8 -8
  18. package/es/card-reader-sdk/index.js +604 -665
  19. package/es/carousel/index.js +8 -8
  20. package/es/cascader/index.js +8 -8
  21. package/es/checkbox/index.js +9 -9
  22. package/es/col/index.js +8 -8
  23. package/es/collapse/index.js +8 -8
  24. package/es/color-picker/index.js +1 -1
  25. package/es/comment/index.js +8 -8
  26. package/es/config-provider/index.js +8 -8
  27. package/es/date-picker/index.js +8 -8
  28. package/es/descriptions/index.js +8 -8
  29. package/es/divider/index.js +8 -8
  30. package/es/drag-layout/index.js +3 -3
  31. package/es/drawer/index.js +8 -8
  32. package/es/dropdown/index.js +8 -8
  33. package/es/editor/index.js +1 -1
  34. package/es/ellipsis/index.js +1 -1
  35. package/es/empty/index.js +8 -8
  36. package/es/fabric-chart/index.js +96 -59
  37. package/es/form/index.js +8 -8
  38. package/es/form-model/index.js +8 -8
  39. package/es/form-table/index.js +66 -66
  40. package/es/index/index.js +1355 -713
  41. package/es/index/style.css +1 -1
  42. package/es/input/index.js +9 -9
  43. package/es/input-number/index.js +8 -8
  44. package/es/layout/index.js +8 -8
  45. package/es/list/index.js +8 -8
  46. package/es/locale-provider/index.js +8 -8
  47. package/es/map/index.js +9 -9
  48. package/es/mentions/index.js +8 -8
  49. package/es/menu/index.js +8 -8
  50. package/es/message/index.js +8 -8
  51. package/es/multi-chat/index.js +76 -76
  52. package/es/multi-chat-client/index.js +70 -70
  53. package/es/multi-chat-history/index.js +4 -4
  54. package/es/multi-chat-record/index.js +14 -14
  55. package/es/multi-chat-setting/index.js +22 -22
  56. package/es/multi-chat-sip/index.js +1 -1
  57. package/es/notification/index.js +8 -8
  58. package/es/page-header/index.js +8 -8
  59. package/es/pagination/index.js +8 -8
  60. package/es/popconfirm/index.js +8 -8
  61. package/es/popover/index.js +8 -8
  62. package/es/progress/index.js +8 -8
  63. package/es/radio/index.js +9 -9
  64. package/es/rate/index.js +8 -8
  65. package/es/result/index.js +8 -8
  66. package/es/row/index.js +8 -8
  67. package/es/scale-container/index.js +1 -1
  68. package/es/scale-view/index.js +27 -27
  69. package/es/select/index.js +12 -12
  70. package/es/select-label/index.js +11 -11
  71. package/es/select-person/index.js +185 -152
  72. package/es/select-person/style.css +1 -1
  73. package/es/select-tag/index.js +4 -4
  74. package/es/shortcut-provider/index.js +4030 -0
  75. package/es/shortcut-provider/style.css +0 -0
  76. package/es/shortcut-setter/index.js +31 -15
  77. package/es/skeleton/index.js +8 -8
  78. package/es/slider/index.js +8 -8
  79. package/es/space/index.js +8 -8
  80. package/es/spin/index.js +8 -8
  81. package/es/statistic/index.js +8 -8
  82. package/es/steps/index.js +8 -8
  83. package/es/switch/index.js +8 -8
  84. package/es/table-filter/index.js +206 -159
  85. package/es/table-filter/style.css +1 -1
  86. package/es/tabs/index.js +8 -8
  87. package/es/tag/index.js +9 -9
  88. package/es/time-picker/index.js +8 -8
  89. package/es/timeline/index.js +8 -8
  90. package/es/tooltip/index.js +8 -8
  91. package/es/transfer/index.js +8 -8
  92. package/es/tree/index.js +8 -8
  93. package/es/tree-select/index.js +8 -8
  94. package/es/upload/index.js +8 -8
  95. package/es/utils/index.js +14 -1
  96. package/es/verification-code/index.js +2 -2
  97. package/lib/cui.common.js +9842 -7652
  98. package/lib/cui.umd.js +9842 -7652
  99. package/lib/cui.umd.min.js +70 -70
  100. package/package.json +3 -3
  101. package/packages/card-reader-sdk/index.js +1 -1
  102. package/packages/card-reader-sdk/src/cardReaderSDK.js +62 -21
  103. package/packages/card-reader-sdk/src/components/readCardDialog.vue +48 -0
  104. package/packages/card-reader-sdk/src/constants/index.js +66 -173
  105. package/packages/card-reader-sdk/src/insuranceSDK.js +15 -89
  106. package/packages/card-reader-sdk/src/utils/readHealthCard.jsx +57 -0
  107. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +42 -22
  108. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +2 -0
  109. package/packages/index.js +5 -2
  110. package/packages/select-person/select-person.vue +2 -2
  111. package/packages/shortcut-provider/index.js +10 -0
  112. package/packages/shortcut-provider/src/ShortcutProvider.vue +33 -0
  113. package/packages/shortcut-provider/src/constants/index.js +4 -0
  114. package/packages/shortcut-provider/src/hooks/index.js +1 -0
  115. package/packages/shortcut-provider/src/hooks/useShortcuts.js +129 -0
  116. package/packages/shortcut-provider/src/utils/index.js +107 -0
  117. package/packages/shortcut-setter/src/ShortcutSetterItem.vue +13 -1
  118. package/packages/table-filter/src/base-search-com/BaseSearch.vue +29 -1
  119. package/src/utils/index.js +10 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.98",
3
+ "version": "2.1.100",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -19,9 +19,9 @@
19
19
  "main": "lib/cui.umd.js",
20
20
  "module": "es/index/index.js",
21
21
  "scripts": {
22
- "serve": "vue-cli-service serve",
22
+ "serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --host 0.0.0.0",
23
23
  "build:utils": "cross-env BABEL_ENV=utils babel src/utils --config-file ./build/babel.component.js --out-dir es/utils",
24
- "build:docs": "vue-cli-service build --mode docs",
24
+ "build:docs": " set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build --mode docs",
25
25
  "build:es": "vue-cli-service build --mode component && npm run build:utils",
26
26
  "postbuild:es": "node ./build/build.component.js",
27
27
  "build:umd": "vue-cli-service build --mode library --target lib --name cui --dest lib packages/index.js",
@@ -1,4 +1,4 @@
1
1
  import InsuranceSDK from './src/insuranceSDK';
2
2
  import CardReaderSDK from './src/cardReaderSDK';
3
3
 
4
- export { InsuranceSDK as CInsuranceSDK, CardReaderSDK as CCardReaderSDK };
4
+ export default { InsuranceSDK, CardReaderSDK };
@@ -1,14 +1,26 @@
1
1
  import InsuranceSDK from './insuranceSDK';
2
- import { CARD_TYPE } from './constants';
2
+ import { TRANS_CMD } from './constants';
3
3
  import { isFunction } from 'xe-utils';
4
+ import { ReadHealthCard } from './utils/readHealthCard';
5
+
6
+ let instance = null;
4
7
 
5
8
  export default class CardReaderSDK {
9
+ static version = 1;
10
+
11
+ static TRANS_CMD = TRANS_CMD;
12
+
6
13
  loading = false;
7
14
 
8
- insurance = new InsuranceSDK();
15
+ insurance = null;
16
+ readHealthCardDialog = null;
9
17
 
10
18
  constructor(options) {
11
19
  this.options = options;
20
+ if (instance) return instance;
21
+ instance = this;
22
+ this.insurance = new InsuranceSDK();
23
+ this.readHealthCardDialog = new ReadHealthCard();
12
24
  }
13
25
 
14
26
  get basicParamsRes() {
@@ -21,49 +33,78 @@ export default class CardReaderSDK {
21
33
 
22
34
  destroy() {
23
35
  this.insurance.destroy();
36
+ this.readHealthCardDialog.destroy();
37
+ instance = null;
24
38
  }
25
39
 
26
40
  async readIdCard(params = {}) {
27
41
  await this.checkLoading();
28
42
 
29
- const readParams = this.createBasicParams(CARD_TYPE.ID_CARD, params);
43
+ const requestParams = this.createParams(TRANS_CMD.ID_CARD_READ, params, {
44
+ transtype: 'IDCARD',
45
+ interfaceid: '0',
46
+ transdata: { readtype: '2' }
47
+ });
48
+
49
+ return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(requestParams));
50
+ }
51
+
52
+ async readMemberCard(params = {}) {
53
+ await this.checkLoading();
54
+
55
+ const requestParams = this.createParams(TRANS_CMD.MEMBER_CARD_READ, params, {
56
+ transsystem: '10',
57
+ transtype: 'IDCARD',
58
+ interfaceid: '0',
59
+ transdata: { readtype: '1' }
60
+ });
30
61
 
31
- return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(readParams));
62
+ return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(requestParams));
32
63
  }
33
64
 
34
- async readVisitCard(params = {}) {
65
+ async writeMemberCard(params = {}) {
35
66
  await this.checkLoading();
36
67
 
37
- const readParams = this.createBasicParams(CARD_TYPE.VISIT_CARD, params, {
68
+ const requestParams = this.createParams(TRANS_CMD.MEMBER_CARD_WRITE, params, {
38
69
  transsystem: '10',
39
- transdata: { readtype: 1 }
70
+ transtype: 'IDCARD',
71
+ interfaceid: '0'
40
72
  });
41
73
 
42
- return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(readParams));
74
+ return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(requestParams));
43
75
  }
44
76
 
45
- async readHospitalCard(params = {}) {
77
+ async readInsuranceCard(params = {}) {
46
78
  await this.checkLoading();
47
79
 
48
- const readParams = this.createBasicParams(CARD_TYPE.HOSPITAL_CARD, params, {
49
- iar1Json: {
50
- iaa01: params.interfaceid,
51
- iai03: params.iai03 || '',
52
- bdp02: params.bdp02 || ''
53
- },
54
- personinfo: { location: 0, ptname: params.vaa05 || '' },
80
+ const requestParams = this.createParams(TRANS_CMD.NS_GETPERSONALINFO, params, {
55
81
  transchannel: '101',
56
82
  interfaceid: params.interfaceid,
57
- transtype: 'YB0000'
83
+ transtype: 'YB0000',
84
+ transdata: {
85
+ ...params.transdata,
86
+ iar1: {
87
+ ...(params.transdata?.iar1 || { acf01: '0', iak22: '0' })
88
+ },
89
+ personinfo: {
90
+ ...(params.transdata?.personinfo || { location: 0, ownpay: '0' })
91
+ }
92
+ }
58
93
  });
59
94
 
60
- return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(readParams));
95
+ return this.checkResCodeAndLoading(this.insurance.getInsuranceInfoPromise(requestParams));
96
+ }
97
+
98
+ async readHealthCard(options) {
99
+ await this.checkLoading();
100
+
101
+ return this.readHealthCardDialog.show(options);
61
102
  }
62
103
 
63
- createBasicParams(type, params, otherParams) {
104
+ createParams(transcmd, params, otherParams) {
64
105
  const { operatorname, operatorcode, ...otherBasicParams } = this.basicParamsRes || {};
65
106
  return {
66
- type,
107
+ transcmd,
67
108
  operatorname: params.operatorname ?? operatorname,
68
109
  operatorcode: params.operatorcode ?? operatorcode,
69
110
  ...otherBasicParams,
@@ -79,7 +120,7 @@ export default class CardReaderSDK {
79
120
  try {
80
121
  this.loading = true;
81
122
  const res = await req;
82
- if (res.returncode === 3) {
123
+ if (res.returncode == 3) {
83
124
  return Promise.reject(`${res.returnmsg || '读卡失败'}`);
84
125
  }
85
126
  return res.returndata;
@@ -0,0 +1,48 @@
1
+ <template>
2
+ <a-modal centered title="扫码电子健康卡" v-model="visible" :keyboard="false" okText="确认" v-bind="modalProps" @cancel="onClose" @ok="onConfirm">
3
+ <a-input v-bind="inputProps" v-model="value" ref="inputRef" placeholder="请输入健康卡号" @keydown.prevent.enter="onConfirm" />
4
+ </a-modal>
5
+ </template>
6
+
7
+ <script>
8
+ import { Input, Modal } from 'ant-design-vue';
9
+
10
+ export default {
11
+ name: 'readCardDialog',
12
+ props: {
13
+ inputProps: {
14
+ type: Object,
15
+ default: () => ({})
16
+ },
17
+ modalProps: {
18
+ type: Object,
19
+ default: () => ({})
20
+ },
21
+ onConfirm: {
22
+ type: Function
23
+ },
24
+ onClose: {
25
+ type: Function
26
+ }
27
+ },
28
+ components: {
29
+ AModal: Modal,
30
+ AInput: Input
31
+ },
32
+ data() {
33
+ return {
34
+ value: '',
35
+ visible: false
36
+ };
37
+ },
38
+ methods: {
39
+ async init() {
40
+ this.visible = true;
41
+ this.value = '';
42
+ await this.$nextTick();
43
+ this.$refs.inputRef.focus();
44
+ }
45
+ }
46
+ };
47
+ </script>
48
+ <style lang="less" scoped></style>
@@ -1,183 +1,76 @@
1
1
  /**
2
- * 交易命令映射
2
+ * 交易命令枚举
3
3
  */
4
- export const transcmdMapping = Object.freeze({
5
- sk: 100210, // 医保刷卡
6
- ghdj: 100401, // 挂号登记
7
- ghqx: 100403, // 挂号取消
8
- mzjs: 100407, // 门诊结算
9
- beforemzjs: 100406, // 门诊结算前调用
10
- mztf: 100408, // 门诊退费
11
- zyjs: 100613, // 住院结算
12
- qxzyjs: 100614, // 取消住院结算
13
- zydj: 100601, // 住院登记
14
- qxzydj: 100603, // 取消住院登记
15
- zydjzzf: 100605, // 住院登记转自费
16
- mzghconfirm: 100415, // 医保支付确认事件
17
- ghdjcg: 100411, // 挂号登记成功
18
- ghdjsb: 100412, // 挂号登记失败
19
- mzjscg: 100409, // 门诊收费结帐本地成功
20
- mzjssb: 100410, // 门诊收费结帐本地失败
21
- mztfcg: 100413, // 本地门诊退费成功
22
- mztfsb: 100414, // 本地门诊退费失败
23
- newdhyk: 110021, // 读会员卡
24
- newdsfz: 110041, // 读身份证
25
- fastReport: 100000, // fastReport 打印
26
- pos: 100000, // pos
27
- yjjrefund: 100622, // 住院预交金退费
28
- ybxxcx: 100212, // 医保信息查询
29
- ybdz: 100209 // 住院预交金退费
30
- });
4
+ export const TRANS_CMD = Object.freeze({
5
+ NS_OUT_CHECKOUT_MODE: 100003, // 获取接口支持的门诊结帐模式
6
+ NS_TEST_TIME: 100005, // 获取接口当前时间
7
+ NS_DOWNLOAD_CATELOG: 100203, // 下载医保目录
8
+ NS_UPLOAD_MATCH_INFO: 100204, // 上传对码信息
9
+ NS_UPLOAD_MATCH_INFO_UNDO: 100205, // 撤销上传对码信息
10
+ NS_DOWNLOAD_MATCH_INFO: 100206, // 下载中心对码审核结果
11
+ NS_DOWNLOAD_DIS: 100207, // 下载医保疾病目录
12
+ NS_DOWNLOAD_DICT: 100208, // 下载医保基础字典
13
+ NS_VERIFICATION_OF_ACCOUNT: 100209, // 医保对账 操作员缴款界面新增按钮触发
14
+ NS_UPLOAD_HOSITEM: 100201, // 上报医院收费项目
15
+ NS_UPLOAD_HOSITEM_UNDO: 100202, // 撤销上报医院收费项目
16
+ NS_GETPERSONALINFO: 100210, // 医保读卡
17
+ NS_CUSTOMSEARCH_CENTERINFO: 100211, // 对码界面自定义检索中心目录
18
+ NS_YBINFOQIERUMGR: 100212, // 医保信息查询管理,入院登记界面新增按钮触发
19
+
20
+ NS_OUTPT_REGISTER: 100401, // 门诊挂号
21
+ NS_OUTPT_REGISTER_UNDO: 100403, // 门诊退号
22
+ NS_OUTPT_REGISTER_SUCCESS: 100411, // 门诊挂号结帐本地成功
23
+ NS_OUTPT_REGISTER_ERROR: 100412, // 门诊挂号本地结帐失败
24
+ NS_OUTPT_CHECKOUT_BEFORE: 100406, // 门诊结算前调用,参数控制
25
+ NS_OUTPT_CHECKOUT: 100407, // 门诊单据结算
26
+ NS_OUTPT_REFUND: 100408, // 门诊单据退费
27
+ NS_OUTPT_CHECKOUT_SUCCESS: 100409, // 门诊收费结帐本地成功
28
+ NS_OUTPT_CHECKOUT_ERROR: 100410, // 门诊收费结帐本地失败
29
+ NS_OUTPT_REFUND_SUCCESS: 100413, // 本地门诊退费成功
30
+ NS_OUTPT_REFUND_ERROR: 100414, // 本地门诊退费失败
31
+ NS_OUTPT_CHECKOUT_PAY_CONFIRM: 100415, // 医保结账后弹出支付确认窗口,前台通过此命令通知后台,操作员是点击了确认还是取消按钮
32
+ NS_OUT_UNPOST_CHECKOUT_REC_HANDLE: 100416, // 门诊结账过程中产生的未提交的门诊结账记录处理事件
33
+
34
+ NS_INPT_REGISTER: 100601, // 住院登记或住院登记修改
35
+ NS_INPT_REGISTER_UNDO: 100603, // 撤销住院登记
36
+ NS_INPT_UPLOAD_FEEITEM: 100604, // 住院费用明细上传
37
+ NS_INPT_TO_OWNPAY: 100605, // 住院医保转自费
38
+ NS_INPT_PRECHECKOUT: 100606, // 住院预算
39
+ NS_INPT_REUPLOAD_FEEITEM: 100607, // 住院费用明细重传
40
+ NS_INPT_DOWNLOAD_FEEITEM: 100608, // 下载已上传中心费用明细
41
+ NS_INPT_DELETE_FEEITEM: 100609, // 用户从中心下载住院费用明细后,选择多条进行删除
42
+ NS_INPT_CLEAR_FEEITEM: 100610, // 撤销所有已上传中心费用明细
43
+ NS_INPT_CHECKOUT: 100613, // 出院结算
44
+ NS_INPT_CHECKOUT_CANCEL: 100614, // 取消出院结算
45
+ NS_INPT_UPLOAD_ORDERS: 100611, // 上传住院医嘱
46
+ NS_INPT_UPLOAD_FRONTSHEET_OF_MEDICALRECORD: 100612, // 上传住院病案信息
47
+ NS_GET_INPT_MANAGE_EXTEND_METHOD_LIST: 100616, // 获取社保病人住院公共管理窗口扩展功能定义列表
48
+ NS_INPT_MANAGE_EXTEND_METHOD: 100617, // 调用社保病人住院公共管理窗口扩展功能
49
+ NS_INPT_UPLOAD_MEDICALRECORD_UNDO: 100618, // 撤销已上传住院病案信息
50
+ NS_INPT_PREPAYMEN: 100619, // 住院预交金收费
51
+ NS_INPT_PREPAYMEN_SUCCESS: 100620, // 住院预交金收费HIS本地成功
52
+ NS_INPT_PREPAYMEN_ERROR: 100621, // 住院预交金收费HIS本地失败
53
+ NS_INPT_PREPAYMEN_REFUND: 100622, // 住院预交金退费
54
+ NS_INPT_PREPAYMEN_REFUND_SUCCESS: 100623, // 住院预交金退费HIS本地成功
55
+ NS_INPT_PREPAYMEN_REFUND_ERROR: 100624, // 住院预交金退费HIS本地失败
31
56
 
32
- // 调用HO本地服务参数
33
- export const HIS_INSURANCE_PARAMS = Object.freeze({
34
- msgindex: '',
35
- checkoutinfo: '',
36
- parmsJson: {
37
- transtime: '', // 交易时间
38
- transtype: 'YB0000', // 交易类型
39
- interfaceid: '0', // 接口ID
40
- serialnumber: '', // 交易流水号
41
- operatorcode: '10086', // 操作员编码
42
- operatorname: '赵', // 操作员姓名 欧阳测试
43
- transcmd: '', // 交易命令
44
- transdata: {
45
- iar1: {
46
- acf01: '0', // 业务类型 挂号0,门诊1,住院2
47
- iar01: '',
48
- vaa01: '',
49
- vaa07: '',
50
- iaa01: '', // 接口ID iaa01 测试
51
- iab02: '', // 分管机构
52
- iak04: '',
53
- iak05: '',
54
- iak06: '',
55
- iar10: '',
56
- iar11: '',
57
- iar12: '',
58
- iar13: '',
59
- iar14: '',
60
- iar15: '',
61
- iar16: '',
62
- iar17: '',
63
- iar18: '',
64
- iar19: '',
65
- iar20: '',
66
- iar21: '',
67
- iar22: '',
68
- iai03: '', // 医疗类别
69
- iar24: '',
70
- iar25: '',
71
- iar26: '',
72
- iar27: '',
73
- iar28: '',
74
- iar29: '',
75
- iar30: '',
76
- iar31: '',
77
- iar32: '',
78
- iar33: '',
79
- iar34: '',
80
- iar35: '',
81
- iac02: '',
82
- iac03: '',
83
- iad03: '', // 诊断
84
- iad04: '',
85
- iar40: '',
86
- iar41: '',
87
- iak22: '0',
88
- iar43: '',
89
- iar44: '',
90
- iar45: '',
91
- cli_iai03: '',
92
- iar46: '',
93
- iar47: '',
94
- iar48: '',
95
- iar49: '',
96
- iar50: '',
97
- iar51: '',
98
- iar52: '',
99
- iar53: '',
100
- iar54: '',
101
- iar55: '',
102
- iar56: '',
103
- iar57: '',
104
- iar58: '',
105
- iar59: '',
106
- iar60: '',
107
- iar61: '',
108
- iar62: '',
109
- iar63: '',
110
- iar64: '',
111
- iar65: '',
112
- iar66: '',
113
- iar67: '',
114
- iar68: '',
115
- iar69: '',
116
- iar70: '',
117
- iar71: '',
118
- iar72: '',
119
- iar73: '',
120
- iar74: '',
121
- iar75: ''
122
- },
123
- personinfo: {
124
- location: 0, // 读卡类型 0 门诊挂号 1 门诊收费 2 住院
125
- ptname: '',
126
- sex: '',
127
- birthday: '',
128
- age: '',
129
- idnumber: '', // "440522196105131723", //身份证号,目前只有这个可用
130
- folk: '',
131
- address: '',
132
- pttype: '', // 患者类别
133
- ownpay: '0'
134
- }
135
- },
136
- transsystem: '12', // 交易系统
137
- transchannel: '100', // 交易渠道
138
- verifycode: '' // 交易验证码
139
- },
140
- error: true,
141
- catch: true,
142
- loading: false
57
+ MEMBER_CARD_READ: 110021, // 会员卡读卡
58
+ MEMBER_CARD_WRITE: 110022, // 会员卡写卡
59
+ MEMBER_CARD_READER_RESET: 110023, // 会员卡读卡器重置
60
+ ID_CARD_READ: 110041, // 身份证(港澳台居住证)读卡
61
+ ID_CARD_READER_RESET: 110042, // 身份证读卡器重置
62
+
63
+ FAST_REPORT_OR_POS: 100000 // fastReport 打印
143
64
  });
144
65
 
145
- // 传入的config默认值,可选传入config覆盖
146
66
  export const CONFIG_MAP = Object.freeze({
147
- type: 'sk', // 判断传过来类型是否是刷卡
148
- location: null, // 读卡类型 0 门诊挂号 1 门诊收费 2 住院
149
- // iaa01: "", //医保接口id
150
- vaa01: '', // 病人id
151
- vaa07: '', // 接诊id
152
- iaa01: null, //
153
- iar1Json: {}, // 外部传入iar1Json值
154
- personinfo: {}, // 外部传入personinfo值
155
- parmsKey: 'VAC01',
156
- money: '',
157
- interfaceid: '0', // 医保接口id, 同iaa01
158
- operatorname: '', // 操作员姓名
159
- operatorcode: '', // 操作员编码
160
- newhoinsurance: '',
161
- message: '', // 外部传入消息提示语
162
- transdata: {}, // 外部传入transdata
163
- transtype: 'SYSTEM', // 交易类型
164
- transchannel: '100', // 交易渠道
165
- transsystem: '12',
166
- loginCode: '7777',
167
- needLogin: false, // 默认不需要登录
168
- returncodes: ['0', '1'] // 状态码默认判断0和1
67
+ interfaceid: '0', // 医保接口id, 同iaa01
68
+ transcmd: TRANS_CMD.NS_GETPERSONALINFO, // 交易命令
69
+ transtype: 'YB0000', // 交易类型
70
+ transchannel: '101', // 交易渠道
71
+ transsystem: '10',
72
+ loginCode: '7777'
169
73
  });
170
74
 
171
75
  const INSURANCE_ORIGIN = 'http://127.0.0.1:8031';
172
76
  export const INSURANCE_URL = `${INSURANCE_ORIGIN}/HOInterfaceSvr`;
173
-
174
- export const CARD_TYPE = {
175
- // 身份证
176
- ID_CARD: 'newdsfz',
177
- // 医保卡
178
- HOSPITAL_CARD: 'sk',
179
- // 健康卡
180
- HEALTH_CARD: 'djkk',
181
- // 就诊卡
182
- VISIT_CARD: 'newdhyk'
183
- };
@@ -1,5 +1,5 @@
1
1
  import { getDataMessageByData, getErrorMessageByType, getSerialNumber, getTranstime, insuranceLog } from './utils';
2
- import { transcmdMapping, INSURANCE_URL, HIS_INSURANCE_PARAMS, CONFIG_MAP } from './constants';
2
+ import { TRANS_CMD, INSURANCE_URL, CONFIG_MAP } from './constants';
3
3
  import axios from 'axios';
4
4
  import { isString } from 'xe-utils';
5
5
 
@@ -7,12 +7,7 @@ import { isString } from 'xe-utils';
7
7
  export default class InsuranceSDK {
8
8
  webview = window.chrome?.webview;
9
9
 
10
- configMap = null;
11
-
12
- initParamsMap = new Map([
13
- [['newdhyk', 'newdsfz'], params => this.getDhykParams(params)],
14
- [['sk'], params => this.getSkParams(params)]
15
- ]);
10
+ requestParams = null;
16
11
 
17
12
  currentMessageHandler = null;
18
13
 
@@ -65,115 +60,46 @@ export default class InsuranceSDK {
65
60
  }
66
61
 
67
62
  login() {
68
- const { loginCode = '' } = this.configMap || {};
69
63
  return this.postMessage({
70
64
  exec: 'login',
71
- data: loginCode // sys_users.code
65
+ data: this.requestParams?.loginCode ?? ''
72
66
  });
73
67
  }
74
68
 
75
- async HOInterfaceSvr(insuranceParams) {
76
- const { type, needLogin } = this.configMap || {};
69
+ async HOInterfaceSvr(params) {
70
+ const { transcmd, needLogin } = this.requestParams || {};
77
71
  try {
78
72
  if (this.webview) {
79
73
  if (needLogin) await this.login();
80
74
 
81
- const res = await this.postMessage({ exec: 'hisyb', data: JSON.stringify(insuranceParams.parmsJson) });
75
+ const res = await this.postMessage({ exec: 'hisyb', data: JSON.stringify(params) });
82
76
 
83
77
  return res.res;
84
78
  }
85
- const res = await axios.post(INSURANCE_URL, JSON.stringify(insuranceParams.parmsJson));
79
+ const res = await axios.post(INSURANCE_URL, JSON.stringify(params));
86
80
  return getDataMessageByData(res.data);
87
81
  } catch (error) {
88
- return Promise.reject(getErrorMessageByType(type));
82
+ return Promise.reject(getErrorMessageByType(transcmd));
89
83
  }
90
84
  }
91
85
 
92
86
  initConfig(config) {
93
- this.configMap = Object.assign({}, CONFIG_MAP, config);
87
+ this.requestParams = Object.assign({}, CONFIG_MAP, config);
94
88
  }
95
89
 
96
90
  initParams() {
97
- const { type, transtype, interfaceid } = this.configMap || {};
98
-
99
- const insuranceParams = this.getHisInsuranceParams();
100
- Object.assign(insuranceParams.parmsJson, {
101
- transcmd: (type && transcmdMapping[type]) || type,
102
- interfaceid,
103
- transtype
104
- });
105
-
106
- const info = [...this.initParamsMap].find(([key]) => key.includes(type));
107
- if (info) {
108
- const [, value] = info;
109
- value(insuranceParams);
110
- } else {
111
- Object.assign(insuranceParams.parmsJson, {
112
- transdata: this.configMap && this.configMap.transdata
113
- });
114
- }
115
- return insuranceParams;
91
+ return {
92
+ ...this.requestParams,
93
+ transcmd: this.requestParams?.transcmd ?? TRANS_CMD.NS_GETPERSONALINFO,
94
+ transtime: getTranstime(),
95
+ serialnumber: getSerialNumber()
96
+ };
116
97
  }
117
98
 
118
99
  getInsuranceInfoPromise(config) {
119
100
  this.initConfig(config);
120
101
  return this.HOInterfaceSvr(this.initParams());
121
102
  }
122
- getInsuranceInfo(config, successFn, failureFn) {
123
- this.getInsuranceInfoPromise(config).then(
124
- payload => successFn && successFn(payload),
125
- error => failureFn && failureFn(error)
126
- );
127
- }
128
-
129
- getDhykParams(insuranceParams) {
130
- const { type } = this.configMap || {};
131
- insuranceParams.parmsJson = {
132
- ...insuranceParams.parmsJson,
133
- transtype: 'IDCARD',
134
- interfaceid: '0',
135
- transdata: {
136
- ...insuranceParams.parmsJson.transdata,
137
- readtype: type === 'newdhyk' ? '1' : '2'
138
- }
139
- };
140
- }
141
-
142
- getSkParams(insuranceParams) {
143
- const { iar1Json, personinfo } = this.configMap || {};
144
- insuranceParams.parmsJson = {
145
- ...insuranceParams.parmsJson,
146
- transdata: {
147
- ...insuranceParams.parmsJson.transdata,
148
- iar1: {
149
- ...insuranceParams.parmsJson.transdata.iar1,
150
- ...iar1Json
151
- },
152
- personinfo: {
153
- ...insuranceParams.parmsJson.transdata.personinfo,
154
- ...personinfo
155
- }
156
- }
157
- };
158
- }
159
-
160
- getHisInsuranceParams() {
161
- const { operatorcode, operatorname, location, transchannel, transsystem } = this.configMap || {};
162
-
163
- return {
164
- ...HIS_INSURANCE_PARAMS,
165
- parmsJson: {
166
- ...HIS_INSURANCE_PARAMS.parmsJson,
167
- transtime: getTranstime(),
168
- serialnumber: getSerialNumber(),
169
- operatorcode,
170
- operatorname,
171
- location,
172
- transchannel,
173
- transsystem
174
- }
175
- };
176
- }
177
103
  }
178
104
 
179
105
  function jsonParse(str) {
@@ -0,0 +1,57 @@
1
+ import Vue from 'vue';
2
+ import ReadCardDialog from '../components/readCardDialog.vue';
3
+ const DialogConstructor = Vue.extend(ReadCardDialog);
4
+ export class ReadHealthCard {
5
+
6
+ dialogInstance = null;
7
+
8
+ static createMsg(message) {
9
+ return `[ReadHealthCardDialog] ${message}`;
10
+ }
11
+
12
+ show({
13
+ inputProps,
14
+ modalProps
15
+ }) {
16
+ if (this.dialogInstance?.visible) return Promise.reject(ReadHealthCard.createMsg('请勿重复打开弹窗'));
17
+ return new Promise((resolve, reject) => {
18
+ const that = this;
19
+
20
+ if (!this.dialogInstance) {
21
+ this.dialogInstance = new DialogConstructor({
22
+ propsData: {
23
+ inputProps,
24
+ modalProps,
25
+ onConfirm: onConfirm,
26
+ onClose: onClose
27
+ },
28
+ });
29
+ mount();
30
+ }
31
+
32
+ this.dialogInstance.init()
33
+
34
+ function onClose() {
35
+ reject(ReadHealthCard.createMsg('弹窗关闭'));
36
+ }
37
+
38
+ function onConfirm() {
39
+ resolve(that.dialogInstance.value);
40
+ that.dialogInstance.visible = false
41
+ }
42
+
43
+ function mount() {
44
+ // 挂载实例到 DOM 上
45
+ that.dialogInstance.$mount();
46
+ document.body.appendChild(that.dialogInstance.$el);
47
+ }
48
+
49
+ });
50
+ }
51
+
52
+ destroy() {
53
+ if (!this.dialogInstance?.$el) return;
54
+ this.dialogInstance.$destroy();
55
+ this.dialogInstance = null;
56
+ }
57
+ }