vue2-client 1.16.13 → 1.16.15

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.
@@ -1,32 +1,50 @@
1
1
  <script>
2
2
  import XCharge from './XCharge.vue'
3
+
3
4
  export default {
4
- name: 'XChargeDemo',
5
- components: {
6
- XCharge,
7
- },
5
+ name: 'XChargeSimpleDemo',
6
+ components: { XCharge },
8
7
  data () {
9
8
  return {
10
- queryParamsName: '收费组件Config'
9
+ queryParamsName: 'chargeConfig',
10
+ methods: [],
11
+ total: 0,
12
+ lastAmountChange: null,
13
+ lastAction: null
11
14
  }
12
15
  },
13
16
  methods: {
14
- change1 (e, item) {
15
- console.log(e, item)
16
- },
17
- method (value) {
18
- console.log(value)
19
- }
17
+ onMethod (value) { console.log('【事件】单选支付方式(method):', value) },
18
+ onMethods (values) { console.log('【事件】多选支付方式(methods):', values); this.methods = values },
19
+ onTotal (total) { console.log('【事件】合计金额变更(totalPaymentAmount):', total); this.total = total },
20
+ onAmountChange (payload) { console.log('【事件】单个方式金额变更(paymentAmountChange):', payload, '→ 方式:', payload.method, ' 金额:', payload.amount); this.lastAmountChange = payload },
21
+ onAction (payload) { console.log('【事件】操作(action):', payload); this.lastAction = payload }
20
22
  }
21
23
  }
22
24
  </script>
23
25
 
24
26
  <template>
25
- <x-charge :queryParamsName="queryParamsName" @method="method" @change="change1"></x-charge>
27
+ <div class="demo">
28
+ <x-charge
29
+ :queryParamsName="queryParamsName"
30
+ @method="onMethod"
31
+ @methods="onMethods"
32
+ @totalPaymentAmount="onTotal"
33
+ @paymentAmountChange="onAmountChange"
34
+ @action="onAction"
35
+ />
36
+
37
+ <div class="info">
38
+ <p>已选方式:{{ methods.join('、') || '无' }}</p>
39
+ <p>合计金额:{{ total }}</p>
40
+ <p v-if="lastAmountChange">最近金额变更:{{ lastAmountChange.method }} -> {{ lastAmountChange.amount }}</p>
41
+ </div>
42
+ </div>
26
43
  </template>
27
44
 
28
45
  <style scoped>
29
- .test{
30
- margin-right: 10px;
31
- }
46
+ .demo { padding: 16px; }
47
+ .info { margin-top: 16px; color: #333; }
48
+ .info p { margin: 6px 0; }
32
49
  </style>
50
+
@@ -0,0 +1,149 @@
1
+ // 测试配置 - 用于演示混合支付功能
2
+ export const testChargeConfig = {
3
+ "amountFields": [
4
+ {
5
+ "field": 'f_amount',
6
+ "disabled": false,
7
+ "label": '费用总额'
8
+ },
9
+ {
10
+ "field": 'f_insurance_amount',
11
+ "disabled": true,
12
+ "label": '医保支付'
13
+ },
14
+ {
15
+ "field": 'f_self_amount',
16
+ "disabled": true,
17
+ "label": '自费金额'
18
+ },
19
+ {
20
+ "field": 'out_of_pocket_amount',
21
+ "disabled": true,
22
+ "label": '自付金额'
23
+ },
24
+ {
25
+ "field": 'biscount_amount',
26
+ "disabled": true,
27
+ "label": '折扣金额'
28
+ },
29
+ {
30
+ "field": 'billing_amount',
31
+ "disabled": true,
32
+ "label": '记账金额'
33
+ }
34
+ ],
35
+ "paymentMethods": [
36
+ {
37
+ "key": '医保卡',
38
+ "label": '医保卡'
39
+ },
40
+ {
41
+ "key": '微信/支付宝',
42
+ "label": '微信/支付宝'
43
+ },
44
+ {
45
+ "key": '银行卡',
46
+ "label": '银行卡'
47
+ },
48
+ {
49
+ "key": '现金',
50
+ "label": '现金'
51
+ }
52
+ ],
53
+ "bottomFields": [
54
+ {
55
+ "field": 'f_balance',
56
+ "label": '账户余额',
57
+ "disabled": false
58
+ },
59
+ {
60
+ "field": 'received',
61
+ "label": '实收',
62
+ "disabled": false
63
+ },
64
+ {
65
+ "field": 'change',
66
+ "label": '找零',
67
+ "disabled": false
68
+ }
69
+ ],
70
+ "actionButtons": [
71
+ {
72
+ "key": 'charge',
73
+ "label": '收费',
74
+ "icon": 'check'
75
+ },
76
+ {
77
+ "key": 'refund',
78
+ "label": '退费',
79
+ "icon": 'undo'
80
+ },
81
+ {
82
+ "key": 'print',
83
+ "label": '打印',
84
+ "icon": 'printer'
85
+ }
86
+ ],
87
+ "enableMixedPayment": true, // 启用混合支付
88
+ // 可配置事件名,参考 fronImport 风格
89
+ "eventNames": {
90
+ "method": 'method',
91
+ "methods": 'methods',
92
+ "totalPaymentAmount": 'totalPaymentAmount',
93
+ "action": 'action'
94
+ },
95
+ "dataSourceConfig": 'testChargeLogic'
96
+ }
97
+
98
+ // 单选模式测试配置
99
+ export const testSingleChargeConfig = {
100
+ "amountFields": [
101
+ {
102
+ "field": 'f_amount',
103
+ "disabled": false,
104
+ "label": '费用总额'
105
+ },
106
+ {
107
+ "field": 'f_insurance_amount',
108
+ "disabled": true,
109
+ "label": '医保支付'
110
+ }
111
+ ],
112
+ "paymentMethods": [
113
+ {
114
+ "key": '医保卡',
115
+ "label": '医保卡'
116
+ },
117
+ {
118
+ "key": '现金',
119
+ "label": '现金'
120
+ }
121
+ ],
122
+ "bottomFields": [
123
+ {
124
+ "field": 'received',
125
+ "label": '实收',
126
+ "disabled": false
127
+ },
128
+ {
129
+ "field": 'change',
130
+ "label": '找零',
131
+ "disabled": false
132
+ }
133
+ ],
134
+ "actionButtons": [
135
+ {
136
+ "key": 'charge',
137
+ "label": '收费',
138
+ "icon": 'check'
139
+ }
140
+ ],
141
+ "enableMixedPayment": false, // 禁用混合支付(单选模式)
142
+ "eventNames": {
143
+ "method": 'method',
144
+ "methods": 'methods',
145
+ "totalPaymentAmount": 'totalPaymentAmount',
146
+ "action": 'action'
147
+ },
148
+ "dataSourceConfig": 'testChargeLogic'
149
+ }
@@ -60,12 +60,13 @@ path: 'example',
60
60
  // component: () => import('@vue2-client/base-client/components/common/XAddNativeForm/demo.vue'),
61
61
  // component: () => import('@vue2-client/base-client/components/common/XFormGroup/demo.vue'),
62
62
  // component: () => import('@vue2-client/base-client/components/common/XReport/XReportDemo.vue'),
63
- component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
63
+ // component: () => import('@vue2-client/base-client/components/common/XFormTable/demo.vue'),
64
64
  // component: () => import('@vue2-client/base-client/components/common/XDatePicker/demo.vue'),
65
65
  // component: () => import('@vue2-client/base-client/components/common/XTab/XTabDemo.vue'),
66
66
  // component: () => import('@vue2-client/base-client/components/common/XRate/demo.vue'),
67
67
  // component: () => import('@vue2-client/base-client/components/common/XForm/demo.vue'),
68
68
  // component: () => import('@vue2-client/base-client/components/his/XTimeSelect/XTimeSelectDemo.vue'),
69
+ component: () => import('@vue2-client/base-client/components/his/XCharge/XChargeDemo.vue'),
69
70
  // component: () => import('@vue2-client/base-client/components/his/XImportExcelButton/XFrontImportExcelDemo.vue'),
70
71
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
71
72
  // component: () => import('@vue2-client/pages/WorkflowDetail/WorkFlowDemo.vue'),
@@ -79,6 +79,7 @@ export function getConfig (content, configName, serviceName = process.env.VUE_AP
79
79
  apiPre = '/devApi/'
80
80
  }
81
81
  const getConfigUrl = apiPre + serviceName + '/' + commonApi.getConfig
82
+ console.log('getConfigUrl', getConfigUrl)
82
83
  indexedDB.getByWeb(configName, getConfigUrl, { configName: configName }, callback)
83
84
  }
84
85