sale-client 3.6.21 → 3.6.23

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 (88) hide show
  1. package/build/dev-server.js +1 -1
  2. package/package.json +2 -2
  3. package/src/components/FilesManage/FileUserFiles.vue +1014 -1014
  4. package/src/components/FilesManage/FileUserMerge.vue +203 -203
  5. package/src/components/FilesManage/UserPaperInfoTest.vue +58 -51
  6. package/src/components/FilesManageNew/FileUserFiles.vue +756 -756
  7. package/src/components/FilesManageNew/FileUserMerge.vue +202 -202
  8. package/src/components/charge/business/CardMeterCenter.vue +944 -944
  9. package/src/components/charge/business/IOTMeterCenter.vue +793 -793
  10. package/src/components/charge/business/OtherChargeNew.vue +550 -550
  11. package/src/components/charge/business/machine/MachineMeterCenter.vue +676 -676
  12. package/src/components/charge/gasloss/gasLossOperate.vue +383 -383
  13. package/src/components/newBill/CardMeterCenter.vue +902 -902
  14. package/src/components/newBill/IOTMeterCenter.vue +797 -797
  15. package/src/components/revenue/Common/EticketModal.vue +95 -90
  16. package/src/components/revenue/comprehen/Maintenance/T+MoneyDocking/moneyDocking.vue +202 -202
  17. package/src/components/revenue/comprehen/SpecialUser/BasicLiving/BasicLivingList.vue +280 -280
  18. package/src/filiale/alashan/business/CardMeterCenter.vue +897 -897
  19. package/src/filiale/ancheng/FilesManage/FileUserFiles.vue +1010 -1010
  20. package/src/filiale/ancheng/FilesManageNew/FileUserFiles.vue +763 -763
  21. package/src/filiale/chengtou/components/FilesManage/FileUserFiles.vue +1019 -1019
  22. package/src/filiale/chengtou/components/OtherChargeNew.vue +549 -549
  23. package/src/filiale/dongguan/components/FilesManage/FileUserFiles.vue +1037 -1037
  24. package/src/filiale/gaomi/components/FilesManage/FileUserFiles.vue +934 -934
  25. package/src/filiale/gehua/CardMeterCenter.vue +898 -898
  26. package/src/filiale/gehua/FileManageNew/FileUserFiles.vue +769 -769
  27. package/src/filiale/gehua/FileUserFiles.vue +1007 -1007
  28. package/src/filiale/gehua/IOTMeterCenter.vue +791 -791
  29. package/src/filiale/gehua/MachineMeterCenter.vue +685 -685
  30. package/src/filiale/gehua/OtherChargeNew.vue +558 -558
  31. package/src/filiale/guangxi/CardMeterCenter.vue +891 -891
  32. package/src/filiale/guangxi/IOTMeterCenter.vue +774 -774
  33. package/src/filiale/guangxi/MachineMeterCenter.vue +622 -622
  34. package/src/filiale/haile/MachineMeterCenter.vue +762 -762
  35. package/src/filiale/huayin/CardMeterCenter.vue +903 -903
  36. package/src/filiale/huayin/FileUserFiles.vue +1007 -1007
  37. package/src/filiale/huayin/IOTMeterCenter.vue +796 -796
  38. package/src/filiale/huayin/MachineMeterCenter.vue +680 -680
  39. package/src/filiale/jingwei/CardMeterCenter.vue +870 -870
  40. package/src/filiale/jingwei/FileUserFiles.vue +905 -905
  41. package/src/filiale/jingwei/ShowCardSellGas.vue +903 -903
  42. package/src/filiale/kelai/CardMeterCenter.vue +934 -934
  43. package/src/filiale/kelai/FileUserFiles.vue +762 -762
  44. package/src/filiale/kelai/IOTMeterCenter.vue +833 -833
  45. package/src/filiale/kelai/MachineMeterCenter.vue +705 -705
  46. package/src/filiale/konggang/FileUserFiles.vue +990 -990
  47. package/src/filiale/liaoyuan/FileUserFiles.vue +844 -844
  48. package/src/filiale/macheng/CardMeterCenter.vue +939 -939
  49. package/src/filiale/macheng/FileUserFiles.vue +930 -930
  50. package/src/filiale/meihekou/FileUserFiles.vue +995 -995
  51. package/src/filiale/ningjin/FileUserFiles.vue +1020 -1020
  52. package/src/filiale/qianneng/OtherChargeNew.vue +544 -544
  53. package/src/filiale/qianneng/eticket/EticketModal.vue +96 -91
  54. package/src/filiale/qianneng/eticket/EticketPrint.vue +377 -376
  55. package/src/filiale/qianneng/eticket/EticketRecordList.vue +309 -289
  56. package/src/filiale/qianneng/machine/MachineMeterCenter.vue +676 -676
  57. package/src/filiale/rizhao/FileUserFiles.vue +984 -984
  58. package/src/filiale/rizhao/IOTMeterCenter.vue +795 -795
  59. package/src/filiale/rongcheng/FileUserFiles.vue +881 -881
  60. package/src/filiale/rongcheng/FilesManageNew/FileUserFiles.vue +732 -732
  61. package/src/filiale/rongcheng/FilesManageNew/FileUserMerge.vue +202 -202
  62. package/src/filiale/shanggao/FileUserFiles.vue +995 -995
  63. package/src/filiale/shangluo/CardMeterCenter.vue +892 -892
  64. package/src/filiale/shangluo/IOTMeterCenter.vue +797 -797
  65. package/src/filiale/shangluo/MachineMeterCenter.vue +734 -734
  66. package/src/filiale/shanxian/OtherChargeNew.vue +561 -561
  67. package/src/filiale/shanxian/components/FilesManage/FileUserFiles.vue +1004 -1004
  68. package/src/filiale/shanxian/components/FilesManageNew/FileUserFiles.vue +756 -756
  69. package/src/filiale/shanxian/components/revenue/CardMeterCenter.vue +944 -944
  70. package/src/filiale/shaoguan/FilesManage/FileUserFiles.vue +881 -881
  71. package/src/filiale/shaoguan/FilesManageNew/FileUserFiles.vue +734 -734
  72. package/src/filiale/shexian/FilesManage/FileUserFiles.vue +991 -991
  73. package/src/filiale/tongchuan/BasicLivingList.vue +253 -253
  74. package/src/filiale/tongchuan/CardMeterCenter.vue +923 -923
  75. package/src/filiale/tongchuan/FileUserFiles.vue +1206 -1206
  76. package/src/filiale/tongchuan/bill/EticketModal.vue +90 -90
  77. package/src/filiale/tongchuan/filemanagenew/FileUserFiles.vue +842 -842
  78. package/src/filiale/wenxi/CardMeterCenter.vue +942 -942
  79. package/src/filiale/wenxi/FileUserFiles.vue +1032 -1032
  80. package/src/filiale/wenxi/IOTMeterCenter.vue +774 -774
  81. package/src/filiale/wuan/FileUserFiles.vue +1006 -1006
  82. package/src/filiale/wuhai/CardMeterCenter.vue +945 -945
  83. package/src/filiale/wuhai/IOTMeterCenter.vue +757 -757
  84. package/src/filiale/yuansheng/CardMeterCenter.vue +950 -950
  85. package/src/filiale/yuansheng/IOTMeterCenter.vue +788 -788
  86. package/src/filiale/zhongsheng/FilesManage/FileUserFiles.vue +1038 -1038
  87. package/src/filiale/zhongyi/FileUserFiles.vue +1020 -1020
  88. package/src/main.js +27 -27
@@ -1,923 +1,923 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="span" style="overflow-y: hidden">
4
- <validator name='v'>
5
- <form novalidate class="form-horizontal">
6
- <div class="row">
7
- <div class="col-sm-4" :class="[$v.payment.required ? 'has-error' : '']">
8
- <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
- <input type="text" v-show="false" v-model="$refs.payment.selectedItems"
10
- v-validate:payment='{required: true }'>
11
- <v-select v-model="f_payment"
12
- placeholder='请选择'
13
- :value.sync="model.f_payment"
14
- :options='paytype' clear-button v-ref:payment></v-select>
15
- </div>
16
-
17
- <div class="col-sm-4" v-if="row.f_collection_type == '按气量'"
18
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
- <label for="f_pregas" class=" font_normal_body">*预购气量</label>
20
- <input class="input_search" style="width:60%" type="number"
21
- @blur="pregas()" v-model="model.f_pregas" v-el:fpregas
22
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
- v-next-el='fcollection'>
24
- </div>
25
- <div class="col-sm-4" v-if="row.f_collection_type == '按金额'">
26
- <label for="f_pregas" class=" font_normal_body">*预购气量</label>
27
- <input class="input_search" style="width:60%" type="number" v-el:fpregas
28
- @blur="pregas()" v-model="model.f_pregas" placeholder="预购气量"
29
- v-next-el='fcollection'>
30
- </div>
31
- <div class="col-sm-4"
32
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
33
- <label for="f_pregas" class=" font_normal_body">*预购金额</label>
34
- <input class="input_search" style="width:60%" type="number"
35
- @blur="preamount()" v-model="model.f_preamount"
36
- v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ],dctest: [0, ">"]}'
37
- placeholder="预购金额"
38
- v-next-el='fcollection'>
39
- </div><!--
40
- <div class="col-sm-4" v-if="row.f_collection_type == '按气量'">
41
- <label for="f_preamount" class=" font_normal_body">&nbsp;预购金额</label>
42
- <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
43
- v-scale="[model.f_preamount, 4]" placeholder="预购金额" disabled>
44
- </div>-->
45
-
46
- </div>
47
- <div class="row" style="margin-top:6px;">
48
- <div class="col-sm-4" :class="[$v.printstyle.required ? 'has-error' : '']">
49
- <label for="f_print" class="font_normal_body">打印格式</label>
50
- <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems"
51
- v-validate:printstyle='{required: true }'>
52
- <v-select id="print"
53
- v-model="f_print"
54
- placeholder='请选择'
55
- :multiple="mulPrint"
56
- :value.sync="model.f_print"
57
- :options='printstyle'
58
- close-on-select clear-button v-ref:printstyle>
59
- </v-select>
60
- </div>
61
- <div class="col-sm-4 " v-if="hasLimit&&limitgas">
62
- <label class="font_normal_body">&ensp;购气上限</label>
63
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
64
- v-scale="[maxgas, 4]" placeholder='限购余气' disabled>
65
- </div>
66
- <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
67
- <label class="font_normal_body">金额上限</label>
68
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
69
- v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
70
- </div>
71
- <div class="col-sm-4" v-if="!hasLimit">
72
- </div>
73
-
74
- <div class="col-sm-4"
75
- :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
76
- <label for="f_temp_amount"
77
- class=" font_normal_body">&nbsp;应收金额</label>
78
- <input class="input_search" style="width:60%" type="number"
79
- @blur="preamount()" v-model="model.f_totalcost"
80
- v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
81
- v-next-el='fcollection' v-scale="[model.f_totalcost, 4]" disabled>
82
- </div>
83
- </div>
84
- <div class="row">
85
-
86
- <div class="col-sm-4">
87
- <label for="f_balance" class="font_normal_body">上期结余</label>
88
- <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
89
- v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
90
- </div>
91
-
92
- <div class="col-sm-4">
93
- <label for="f_curbalance" class="font_normal_body">&nbsp;本期结余</label>
94
- <input class="input_search" style="width:60%" type="number" v-model="curbalance"
95
- v-scale="[curbalance, 4]" placeholder="本期结余" disabled>
96
- </div>
97
- <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气' && row.f_meter_type.includes('卡表')"
98
- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
99
- <label for="f_collection" class=" font_normal_body">*收&emsp;&emsp;款</label>
100
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
101
- v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'
102
- v-el:fcollection
103
- @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
104
- v-scale="[model.f_totalcost, 4]" :disabled="$refs.givechange.promptText != ''">
105
- </div>
106
- <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气' && row.f_meter_type.includes('卡表')"
107
- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
108
- <label for="f_collection" class=" font_normal_body"><font size="4px"
109
- style="font-weight:bold">*收&emsp;款</font></label>
110
- <input id="f_collection" class="input_search" style="width:60%;font-size: 18px;font-weight:bold;"
111
- type="number" v-model="model.f_collection"
112
- v-el:fcollection
113
- @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
114
- v-scale="[model.f_totalcost, 4]" :disabled="$refs.givechange.promptText != ''">
115
- </div>
116
- <div class="col-sm-3" v-if="row.f_collection_type === '按金额'&&row.f_meter_type.includes('卡表')">
117
- <label for="f_collection" class=" font_normal_body"><font size="4px"
118
- style="font-weight:bold">*收&emsp;款</font></label>
119
- <input id="f_collection" class="input_search" style="width:50%;font-size: 18px;font-weight:bold;"
120
- type="number" v-model="model.f_collection"
121
- v-el:fcollection
122
- @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
123
- v-scale="[model.f_collection, 4]" :disabled="$refs.givechange.promptText != ''">
124
- </div>
125
- <div class="col-sm-4" v-if="!row.f_meter_type.includes('卡表')">
126
- <label for="f_collection" class=" font_normal_body"><font size="4px"
127
- style="font-weight:bold">*收&emsp;款</font></label>
128
- <input id="f_collection" class="input_search" style="width:60%;font-size: 18px;font-weight:bold;"
129
- type="number" v-model="model.f_collection"
130
- v-el:fcollection
131
- @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
132
- v-scale="[model.f_collection, 4]" disabled>
133
- </div>
134
- <div class="col-sm-1 form-group" v-show="row.f_meter_type.includes('卡表')">
135
- <give-change :curbalance="curbalance" :collection.sync="model.f_collection"
136
- v-ref:givechange></give-change>
137
- </div>
138
- </div>
139
- <div class="row" style="margin-top:5px;">
140
- <div class="col-sm-9">
141
- </div>
142
- <div class="col-sm-3">
143
- <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
144
- </div>
145
- </div>
146
-
147
- <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
148
- <div class="col-sm-4">
149
- <label class="font_normal_body">优惠方式</label>
150
- <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
151
- placeholder='请选择'
152
- :value.sync="model.f_privilege_id"
153
- :options='privilegeList' clear-button value-single>
154
- </v-select>
155
- </div>
156
- <div class="col-sm-4">
157
- <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
158
- <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
159
- v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
160
- </div>
161
- <div class="col-sm-4">
162
- <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
163
- <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
164
- v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
165
- </div>
166
- </div>
167
-
168
- <div class="row" v-if="model.f_payment[0].includes('POS')">
169
- <div class="col-sm-4">
170
- <label for="f_voucher_number" class="font_normal_body">凭证号</label>
171
- <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number"
172
- placeholder="凭证号">
173
- </div>
174
- </div>
175
- <div class="row" style="padding-top: 0.5em;">
176
- <div class="col-sm-4" v-if="!mjshow">
177
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
178
- <input class="input_search" style="width:60%" type="text"
179
- v-model="model.f_serial_number" placeholder="业务单号">
180
- </div>
181
- <div class="col-sm-4" v-if="mjshow"
182
- :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
183
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
184
- <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
185
- v-model="model.f_serial_number" placeholder="业务单号">
186
- </div>
187
-
188
-
189
- <div class="col-sm-8">
190
- <label for="f_comments" class="font_normal_body">&nbsp;备&emsp;&emsp;注</label>
191
- <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
192
- </div>
193
- </div>
194
-
195
- <div v-if="paymentModel.length >1">
196
- <div class="row" style="margin-top:10px;">
197
- <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../static/juxing.png"/><strong
198
- style="margin-left: 4%">付款明细</strong></p>
199
- </div>
200
- <div class="row" style="margin-top:10px;">
201
- <div class="col-sm-4 " v-for="pay in paymentModel">
202
- <label class="font_normal_body">{{ pay.f_payment }}:</label>
203
- <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
204
- </div>
205
- <div class="col-sm-4 ">
206
- <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
207
- </div>
208
- </div>
209
- </div>
210
- </form>
211
- <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
212
- <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close"
213
- @printok="printok" v-ref:printbill></print-bill>
214
- <div style="text-align:right; height: 25%">
215
- <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
216
- <strong style="font-size: large"
217
- v-if="!config.notShowFormula">计算公式:{{ calculatedetail ? calculatedetail : ' 暂无' }}</strong><br/>
218
- <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
219
- :payment.sync="model.f_payment" :payment-data="paytype"
220
- @confirm-payment="confirm()">
221
- </payment-code-button>
222
- <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()"
223
- :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认
224
- </button>
225
- <button class="button_clear btn-gn" @click="clean()">取消</button>
226
- </div>
227
- </validator>
228
- <eticket-modal :show="eticket_msg" @close-modal-show="eticket_msg = false" :row="row"
229
- @confirm="confirm"></eticket-modal>
230
- <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
231
- <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row"
232
- :money="model.f_after_discount"></payment-code>
233
- </div>
234
- </div>
235
- <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="卡表收费"></upload>
236
- </template>
237
- <script>
238
- import {HttpResetClass} from 'vue-client'
239
- import XML from './plugins/ObjTree'
240
-
241
- /**
242
- *综合业务
243
- *卡表收费组件
244
- */
245
-
246
- // 输入金额,换算气量
247
- let preamountGen = async function (self) {
248
- let calFee = ((self.model.f_preamount - 0)).toFixed(4)
249
- if (self.model.f_payment == '赠气') {
250
- calFee = (self.model.f_preamount - 0).toFixed(4)
251
- }
252
- // 通过金额进行划价
253
- let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
254
- if (getGas.data.gas) {
255
- if (self.row.f_isdecimal === '是') {
256
- if (self.row.f_alias === 'QiaoSong') {
257
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
258
- } else {
259
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
260
- }
261
- if (self.row.f_collection_type === '按金额') {
262
- self.dymoney = 0
263
- } else {
264
- let dymoney2 = await self.$CommonService.gasCalculate(self.model, (getGas.data.gas).toFixed(4))
265
- self.dymoney = (getGas.data.chargenum - 0).toFixed(4) - (dymoney2.data.chargenum - 0).toFixed(4)
266
- }
267
- } else {
268
- // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
269
- let tempnum = Math.floor(getGas.data.gas - 0)
270
- let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
271
- self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(2)
272
- self.model.f_pregas = Math.floor(getGas.data.gas - 0)
273
- }
274
- }
275
- self.model.f_totalcost = ((self.row.f_balance - 0) >= (self.model.f_preamount - 0) ? 0 : (self.model.f_preamount - 0 - self.row.f_balance))
276
-
277
- self.model.chargeprice = getGas.data.chargeprice
278
- Object.assign(self.model, self.model, getGas.data)
279
- if (self.model.f_payment == '赠气') {
280
- self.model.f_totalcost = self.model.f_preamount
281
- self.model.f_collection = 0
282
- } else {
283
- self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
284
- self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(4)
285
- }
286
- self.model.f_preamount = (calFee - (self.dymoney - 0)).toFixed(4)
287
- self.calText(getGas.data.chargeprice)
288
- }
289
-
290
- // 输入气量,换算金额
291
- let pregasGen = async function (self) {
292
- if (self.row.f_isdecimal === '是') {
293
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
294
- } else {
295
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
296
- }
297
- if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
298
- self.model.f_meter_type = self.row.f_meter_type
299
- let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
300
- self.model.f_preamount = getAmount.data.chargenum
301
- self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4))
302
- Object.assign(self.model, self.model, getAmount.data)
303
- self.model.chargeprice = getAmount.data.chargeprice
304
- if (self.model.f_payment == '赠气') {
305
- self.model.f_totalcost = getAmount.data.chargenum
306
- self.model.f_collection = 0
307
- } else {
308
- self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
309
- if (self.config.floor) {
310
- self.model.f_collection = Math.ceil(self.model.f_collection)
311
- }
312
- }
313
- self.calText(getAmount.data.chargeprice)
314
- }
315
- }
316
- // 执行保存逻辑
317
- let sellgasGen = async function (self) {
318
- try {
319
- self.row.cardInfo = self.cardData
320
-
321
- if (self.paymentModel.length === 0) {
322
- self.paymentModel = [{
323
- f_payment: self.model.f_payment[0],
324
- f_money: self.model.f_preamount
325
- }]
326
- }
327
- self.model.xiekamoney = self.model.f_preamount
328
- if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否' && self.row.f_collection_type == '按金额') {
329
- self.model.xiekamoney = (self.model.f_pregas * self.model.chargeprice[0].f_price)
330
- self.model.xiekamoney = self.model.xiekamoney.toFixed(4)
331
- }
332
-
333
- self.model.payments = self.paymentModel
334
- // 加入扫码盒付款码支付流水号
335
- self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
336
- let res = await self.$CardService.sellgas(self.model, self.row)
337
- let localeSustainMoney = window.localStorage.getItem('sustainMoney')
338
- if (localeSustainMoney != null) {
339
- localeSustainMoney = (localeSustainMoney - 0) + (self.model.f_collection - 0)
340
- window.localStorage.setItem('sustainMoney', localeSustainMoney)
341
- }
342
- let param = []
343
- for (let row of self.resid) {
344
- param.push({id: row.id})
345
- }
346
- let writeid
347
- if (res.data && res.data.id) {
348
- writeid = res.data.id
349
- } else {
350
- writeid = res
351
- }
352
- let data = {
353
- param: param,
354
- f_blobid: writeid
355
- }
356
-
357
- await self.$resetpost('rs/logic/updatefiles', data)
358
- console.log(self.config, self.config.hasPrint && !self.$login.r.includes('不打印发票'))
359
- // 开始打票
360
- if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
361
- if (self.model.f_print.indexOf('电子发票') == -1) {
362
- if (self.$login.r.includes('非民用纸质票据拆分')) {
363
- if (self.row.f_user_type === '非民用') {
364
- self.billData.url = 'rs/report/fmy_card_bill'
365
- }
366
- }
367
- if (self.config.hasBillManage) {
368
- // 启用发票管理,获取票据管理中的票号并存储记录
369
- self.row.id = res
370
- self.row.f_bill_type = '卡表收费'
371
- self.row.f_bill_style = self.model.f_print[0]
372
- self.print = true
373
- } else {
374
- self.row.id = res
375
- self.print = true
376
- }
377
- } else {
378
- if (self.model.f_print[0] === '电子发票') {
379
- self.row.id = res
380
- self.eticket_show = true
381
- // 应铜川需要卡表显示
382
- await self.$refs.eticketbill.openETicket([res], self.row, '是', self.invoice_is_pax, '卡表收费')
383
- // await self.$CommonService.openEticket(res, '售气收费')
384
- // self.print = true
385
- }
386
- }
387
- } else {
388
- self.$dispatch('success')
389
- }
390
- self.clickConfirm = false
391
- } catch (error) {
392
- console.log('捕获到异常', error)
393
- if (error instanceof Object) {
394
- self.$showAlert(error.data, 'danger', 0)
395
- } else {
396
- self.$showAlert(error, 'danger', 0)
397
- }
398
- self.$dispatch('refresh')
399
- self.clickConfirm = false
400
- }
401
- }
402
-
403
- let asyncCardMeterCenter = async function (self) {
404
- await self.$getConfig(self, 'CardMeterCenter')
405
- console.log('卡表收费config', self.config)
406
-
407
- // 添加 “系统余额透支” 付款方式
408
- let i = -1
409
- for (const index in self.paytype) {
410
- if (self.paytype[index].value == '系统余额透支') {
411
- i = index
412
- break
413
- }
414
- }
415
- if (self.canOverdraftBalance()) {
416
- if (i == -1) {
417
- self.paytype.push({
418
- label: '系统余额透支',
419
- value: '系统余额透支'
420
- })
421
- }
422
- } else {
423
- if (i != -1) {
424
- self.paytype.splice(i, 1)
425
- }
426
- }
427
-
428
- // 默认打印格式
429
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
430
- self.model.f_payment = [self.config.payment]
431
- self.mulPrint = self.config.printType instanceof Array
432
-
433
- // 获取当前票号用
434
- self.model.f_use_type = self.config.billType
435
- self.model.f_bill_type = self.model.f_print
436
- self.hasValidateBill = self.config.hasBillManage
437
-
438
- // 判断限购
439
- let limit_param = {
440
- f_userinfo_id: self.row.f_userinfo_id,
441
- f_user_id: self.row.f_user_id,
442
- f_stairprice_id: self.row.f_stairprice_id
443
- }
444
- let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {
445
- resolveMsg: null,
446
- rejectMsg: '获取限购值失败!!'
447
- })
448
- console.log('获取限购值', getLimit)
449
- self.hasLimit = getLimit.data.hasLimit
450
- if (self.hasLimit) {
451
- if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
452
- if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
453
- self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
454
- self.$dispatch('refresh')
455
- } else {
456
- if (getLimit.data.f_limit_value) {
457
- self.maxgas = (getLimit.data.f_limit_value - 0)
458
- self.limitgas = true
459
- }
460
- if (getLimit.data.f_limit_amount) {
461
- self.maxmoney = (getLimit.data.f_limit_amount - 0)
462
- self.limitmoney = true
463
- }
464
- }
465
- }
466
- }
467
- let nowrite_param = {
468
- f_userfiles_id: self.row.f_userfiles_id
469
- }
470
- let getNoWriteCard = await self.$resetpost('rs/sql/getnowritecard', {data: nowrite_param}, {
471
- resolveMsg: null,
472
- rejectMsg: '获取最近卡表收费记录失败!!'
473
- })
474
- if (getNoWriteCard.data.length > 0) {
475
- self.$showMessage(`三小时内存在写卡失败的记录,是否重新写卡?`, ['confirm', 'cancel']).then(async (res) => {
476
- if (res === 'confirm') {
477
- let url = 'http://127.0.0.1:8003/' + getNoWriteCard.data[0].f_cardpost
478
- let param = JSON.parse(getNoWriteCard.data[0].f_cardparam)
479
- let cardRes = await self.$resetpost(url, param, {resolveMsg: null, rejectMsg: '重新写卡失败'})
480
- if (cardRes.data.Err || cardRes.data.Exception) {
481
- self.$showAlert(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`, 'danger', 3000)
482
- self.$dispatch('refresh', self.row)
483
- } else {
484
- self.$resetpost('rs/logic/writeCardAgin', getNoWriteCard.data[0], {
485
- resolveMsg: '重新写卡成功',
486
- rejectMsg: '重新写卡失败'
487
- })
488
- self.$dispatch('success')
489
- }
490
- } else {
491
- self.$dispatch('refresh', self.row)
492
- }
493
- })
494
- }
495
- }
496
- export default {
497
- title: '卡表收费',
498
- data () {
499
- return {
500
- mjshow: false,
501
- serialShow: false,
502
- resid: [], // 存放新增的f_files表中id
503
- config: {
504
- notShowFormula: false, // 不显示计算公式,默认显示
505
- autoCollection: true, // 自动填写收款
506
- showupload: true, // 显示上传
507
- hasPrint: true, // 默认打票
508
- hasBillManage: false, // 默认不启用发票管理
509
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
510
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
511
- payment: '现金缴费',
512
- floor: false,
513
- overdraftBalance: false // 是否支持系统余额透支
514
- },
515
- eticket_msg: false,
516
- eticket_show: false,
517
- invoice_is_pax: '不征税',
518
- is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
519
- model: {
520
- f_purchase: 0,
521
- f_payment: [],
522
- f_pregas: '',
523
- f_preamount: 0,
524
- f_totalcost: 0,
525
- f_curbalance: 0,
526
- f_collection: '',
527
- f_balance: 0,
528
- f_print: [],
529
- f_meter_type: '',
530
- f_voucher_number: '',
531
- f_banktransfer_person: '',
532
- f_banktransfer_date: '',
533
- f_privilege_id: 0,
534
- f_privilege_money: 0,
535
- f_after_discount: 0
536
- },
537
- calculatedetail: '',
538
-
539
- // 启用发票管理需要对票号进行验证
540
- hasValidateBill: false,
541
- validateOk: false,
542
-
543
- print: false,
544
- billData: {
545
- url: 'rs/report/card_bill',
546
- billnumber: ''
547
- },
548
- hasLimit: false,
549
- maxgas: 99999999, // 限购
550
- maxmoney: 99999999,
551
- limitmoney: false,
552
- limitgas: false,
553
-
554
- paymentModel: [], // 多笔付款方式
555
-
556
- mulPrint: false,
557
- clickConfirm: false, // 控制确认按钮只能点击一次
558
- // 下拉框值
559
- paytype: [],
560
- printstyle: this.$appdata.getParam('打印格式'),
561
- privilegeList: [{label: '无优惠', value: '0'}],
562
- BankTransfer: false,
563
- // 小数是否支持,导致划价产生的多余气量,金额
564
- dymoney: 0
565
- }
566
- },
567
- props: ['row', 'cardData'],
568
- async ready () {
569
- if (this.authArr.includes('余额写卡限定')) {
570
- this.paytype = [{label: '余额写卡', value: '余额写卡'}]
571
- } else {
572
- this.paytype = await this.$appdata.getParam('付款方式') ? await this.$appdata.getParam('付款方式') : []
573
- if (!this.$login.r.includes('免交充值付款')) {
574
- this.paytype = this.paytype.filter((item) => {
575
- return item.label != '免交'
576
- })
577
- }
578
- }
579
- // this.getPurchase()
580
- this.model.f_price_id = this.row.f_price_id
581
- this.model.f_user_id = this.row.f_user_id
582
- this.model.f_userfiles_id = this.row.f_userfiles_id
583
- this.model.f_userinfo_id = this.row.f_userinfo_id
584
- this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
585
- if (this.row.f_collection_type == '按金额') {
586
- this.model.f_preamount = ''
587
- this.model.f_pregas = 0
588
- }
589
- this.$els.fpregas.focus()
590
- asyncCardMeterCenter(this)
591
- },
592
- watch: {
593
- 'model.f_payment.length' (val) {
594
- console.log('付款方式多选。。', val)
595
- if (val > 1 && !this.model.f_preamount) {
596
- this.model.f_payment = ['现金缴费']
597
- this.$showAlert('请先计算付款金额', 'warning', 2000)
598
- } else {
599
- this.paymentModel = []
600
-
601
- this.model.f_payment.forEach((res) => {
602
- let temp = {
603
- f_payment: res,
604
- f_money: 0
605
- }
606
- this.paymentModel.push(temp)
607
- })
608
- this.$resetValidation()
609
-
610
- // 获取计算优惠
611
- this.getPrivilegeList()
612
- }
613
- },
614
- 'model.f_payment' (val) {
615
- if (val == '免交') {
616
- this.mjshow = true
617
- } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
618
- if (this.row.f_collection_type == '按气量') {
619
- this.pregas()
620
- } else {
621
- this.preamount()
622
- }
623
- } else {
624
- this.mjshow = false
625
- }
626
- // if(this.row.f_collection_type == '按气量'){
627
- // this.pregas();
628
- // }else{
629
- // this.preamount();
630
- // }
631
- },
632
- 'model.f_collection' (val) {
633
- // 获取计算优惠
634
- this.getPrivilegeList()
635
- }
636
- },
637
- events: {
638
- // 删除Resid数组元素
639
- 'delResid' (val) {
640
- this.resid.$remove({id: val, f_biobid: ''})
641
- // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
642
- },
643
- // 增加Resid数组元素
644
- 'resid' (val) {
645
- this.resid.push({id: val, f_biobid: ''})
646
- }
647
- },
648
- methods: {
649
- // 校验发票信息
650
- checkInvoiceMsg (flag) {
651
- // 校验是否超出最大透支余额
652
- if (this.model.f_payment == '系统余额透支') {
653
- const maxOverdraftBalance = -(this.$appdata.getSingleValue('最大透支余额') - 0)
654
- const curSysBalance = (this.row.f_sys_balance - 0) - (this.model.f_totalcost - 0)
655
- if (curSysBalance < maxOverdraftBalance) {
656
- this.$showAlert('您的系统余额将超出最大透支余额,请使用别的付款方式!', 'danger', 5000)
657
- return
658
- }
659
- this.model.f_sys_balance = curSysBalance
660
- }
661
-
662
- // 收款回车时, 如果确认按钮是灰色不进行任何操作
663
- if (flag) return
664
- console.log(this.model.f_print[0])
665
- if (this.model.f_print[0] === '电子发票') {
666
- if (!this.row.f_taxpayer_id) {
667
- this.row.f_taxpayer_id = this.row.f_idnumber
668
- }
669
- if (!this.row.f_paper_name) {
670
- this.row.f_paper_name = this.row.f_user_name
671
- }
672
- if (!this.row.f_address_phone) {
673
- this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
674
- }
675
- if (!this.row.f_email) {
676
- this.row.f_email = this.row.f_email
677
- }
678
- this.eticket_msg = true
679
- } else {
680
- this.confirm()
681
- }
682
- },
683
- async confirm () {
684
- // 铜川要先验证插得卡是不是系统页面上的卡号
685
- let res = await this.$resetpost('http://127.0.0.1:8003/ReadCard', {},
686
- {resolveMsg: null, rejectMsg: '获取卡信息出错!!'})
687
- if (res.data.CardID !== this.cardData.CardID) {
688
- this.$showAlert('请注意!校验卡号出错,请检查卡以及用户后重试', 'warning', 2000)
689
- return
690
- }
691
- this.eticket_msg = false
692
- if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
693
- if (this.model.f_collection > this.row.f_balance) {
694
- this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
695
- }
696
-
697
- if (this.model.f_collection > 0) {
698
- this.$showAlert('请注意!进行余额写卡,收款不能大于0', 'warning', 1000)
699
- }
700
- }
701
- this.$showMessage(`确定对用户${this.row.f_user_name}进行卡表收费吗?`, ['confirm', 'cancel']).then(async (res) => {
702
- if (res === 'confirm') {
703
- // 先调用付款码支付组件流程
704
- let ss = await this.$refs.paymentcode.flowPath()
705
- this.$refs.paymentcode.paymentCodeShow = false
706
- console.log('付款码操作返回', ss)
707
- if (!ss.result) return
708
-
709
- this.clickConfirm = true
710
- this.model.f_curbalance = this.curbalance
711
- this.$dispatch('no-button')
712
- sellgasGen(this)
713
- }
714
- })
715
- },
716
- eticket_toggle () {
717
- this.eticket_show = false
718
- this.$dispatch('success')
719
- },
720
- clean () {
721
- this.$info('取消操作')
722
- this.$dispatch('refresh', this.row)
723
- },
724
- validateBill (val) {
725
- this.validateOk = !val.isOk
726
- this.billData.bill = val.bill
727
- },
728
- printok () {
729
- // 收据打完,判断是否还有其他票据进行请求
730
- for (let i = 0; i < this.model.f_print.length; i++) {
731
- if (this.model.f_print[i] === '电子发票') {
732
- this.$CommonService.openEticket(this.row.id, '售气收费')
733
- }
734
- }
735
- this.$dispatch('success')
736
- },
737
- pregas () {
738
- this.dymoney = 0
739
- if (this.model.f_pregas && this.model.f_pregas > 0) {
740
- try {
741
- // 对气量进行验证
742
- if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
743
- this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
744
- this.model.f_pregas = null
745
- } else {
746
- pregasGen(this)
747
- }
748
- } catch (error) {
749
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
750
- this.$dispatch('error', '发卡售气', this.model, error)
751
- }
752
- } else {
753
- this.model.f_pregas = null
754
- }
755
- },
756
- preamount () {
757
- this.dymoney = 0
758
- this.model.f_price_id = this.row.f_price_id
759
- this.model.f_user_id = this.row.f_user_id
760
- this.model.f_userfiles_id = this.row.f_userfiles_id
761
- this.model.f_userinfo_id = this.row.f_userinfo_id
762
- try {
763
- preamountGen(this)
764
- } catch (error) {
765
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
766
- this.$dispatch('error', '发卡售气', this.model, error)
767
- }
768
- },
769
- calText (val) {
770
- let str = ''
771
- let num = 0
772
- val.forEach((item) => {
773
- if (item.f_gas > 0) {
774
- num = num + 1
775
- }
776
- if (this.row.f_isdecimal === '是') {
777
- str = str + item.f_price + ' x ' + item.f_gas + '+'
778
- } else {
779
- str = str + item.f_price + ' x ' + Math.floor(item.f_gas) + '+'
780
- }
781
- })
782
- str = str.slice(0, str.length - 1)
783
- this.calculatedetail = str
784
- if (num > 1) {
785
- if (this.$login.r.find(item => item == '阶梯提示无按钮')) {
786
- this.$showAlert('友好提示:本次购气已跨阶梯', 'warning', 3000)
787
- } else {
788
- this.$showMessage('友好提示:本次购气已跨阶梯', ['confirm', 'cancel'])
789
- }
790
- }
791
- },
792
- close () {
793
- this.print = false
794
- this.clean()
795
- },
796
- paymentchange () {
797
- console.log('model.f_payment', this.model.f_payment[0])
798
- if (JSON.stringify(this.model.f_payment).indexOf('转账') !== -1) {
799
- // 进入转账筛选条件
800
- this.model.f_banktransfer_person = ''
801
- this.model.f_banktransfer_date = ''
802
- this.BankTransfer = true
803
- } else {
804
- this.model.f_banktransfer_person = ''
805
- this.model.f_banktransfer_date = ''
806
- this.BankTransfer = false
807
- }
808
- },
809
- // 根据选择的付款方式 获取优惠列表
810
- async getPrivilegeList () {
811
- // 初始化下拉选择列表
812
- this.privilegeList = [{label: '无优惠', value: '0'}]
813
- // 初始为无优惠
814
- this.model.f_privilege_id = '0'
815
- if (this.model.f_payment && this.model.f_payment.length) {
816
- // 查询条件
817
- let payments = JSON.stringify(this.model.f_payment)
818
- payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
819
- let HttpReset = new HttpResetClass()
820
- let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
821
- data: {
822
- items: 'id,f_privilege_name,f_privilege_type',
823
- tablename: 't_privilege',
824
- condition: `f_payment in ${payments} and f_gasproperties = '${this.row.f_gasproperties}' and f_user_type = '${this.row.f_user_type}' and f_perform_date <= GETDATE() and f_end_date >= GETDATE() and f_state = '有效'`,
825
- orderitem: 'id'
826
- }
827
- }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
828
- // 查询结果放到下拉列表
829
- for (let p of privilege.data) {
830
- this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
831
- }
832
- this.privilegeCalculate()
833
- }
834
- },
835
- // 优惠计算
836
- async privilegeCalculate () {
837
- // 初始化减免金额
838
- this.model.f_privilege_money = 0
839
- this.model.f_after_discount = this.model.f_collection
840
- // 判断是否是自定义优惠
841
- if (this.model.f_privilege_id != null && parseInt(this.model.f_privilege_id)) {
842
- for (let p of this.privilegeList) {
843
- if (p.value == this.model.f_privilege_id && p.type == '自定义') {
844
- this.model.f_privilege_money = window.prompt('请输入你想优惠的金额')
845
- if (!(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money)) {
846
- this.$showMessage('金额输入格式不正确!')
847
- this.model.f_privilege_money = 0
848
- return
849
- }
850
- if ((this.model.f_privilege_money - 0) >= this.model.f_collection) {
851
- this.$showMessage('减免金额不能大于等于收款金额')
852
- this.model.f_privilege_money = 0
853
- return
854
- }
855
- }
856
- }
857
- }
858
- // 优惠方式, 收款 缺一不计算
859
- if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
860
- let c = {
861
- f_privilege_id: this.model.f_privilege_id,
862
- f_collection: this.model.f_collection,
863
- f_privilege_money: this.data.f_privilege_money
864
- }
865
- let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {
866
- resolveMsg: null,
867
- rejectMsg: '计算优惠金额出错'
868
- })
869
- // 减免金额
870
- this.model.f_privilege_money = privilegeData.data.f_privilege_money
871
- // 减免后收款金额
872
- this.model.f_after_discount = privilegeData.data.f_collection
873
- }
874
- },
875
- // 判断当前用户是否可以使用系统余额透支
876
- canOverdraftBalance () {
877
- return this.config.overdraftBalance && this.row.f_user_type != '民用'
878
- }
879
- },
880
- computed: {
881
- authArr () {
882
- return this.$login.r ? this.$login.r : []
883
- },
884
- 'curbalance' () {
885
- if (this.model.f_payment == '赠气') {
886
- return this.model.f_balance
887
- }
888
- if (this.model.f_preamount) {
889
- // if (this.row.f_collection_type === '按金额') {
890
- // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
891
- // } else {
892
- if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
893
- return ((this.row.f_balance - 0) - (this.model.f_preamount - 0) + (this.model.f_collection - 0)).toFixed(4)
894
- } else {
895
- return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
896
- }
897
- // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
898
- // }
899
- } else {
900
- return this.row.f_balance
901
- }
902
- },
903
- 'invoice_show_gas' () {
904
- return this.row.f_collection_type === '按气量' ? '是' : '否'
905
- },
906
- 'islegal' () {
907
- console.log('支付分离。。。', this.paymentModel.length, this.model.f_collection)
908
- if (this.paymentModel.length > 1 && this.model.f_collection) {
909
- let sum = 0
910
- this.paymentModel.forEach((res) => {
911
- sum += (res.f_money - 0)
912
- })
913
- return (this.model.f_collection - 0) === (sum - 0)
914
- } else {
915
- return true
916
- }
917
- }
918
- }
919
- }
920
- </script>
921
-
922
- <style>
923
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="span" style="overflow-y: hidden">
4
+ <validator name='v'>
5
+ <form novalidate class="form-horizontal">
6
+ <div class="row">
7
+ <div class="col-sm-4" :class="[$v.payment.required ? 'has-error' : '']">
8
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems"
10
+ v-validate:payment='{required: true }'>
11
+ <v-select v-model="f_payment"
12
+ placeholder='请选择'
13
+ :value.sync="model.f_payment"
14
+ :options='paytype' clear-button v-ref:payment></v-select>
15
+ </div>
16
+
17
+ <div class="col-sm-4" v-if="row.f_collection_type == '按气量'"
18
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
+ <label for="f_pregas" class=" font_normal_body">*预购气量</label>
20
+ <input class="input_search" style="width:60%" type="number"
21
+ @blur="pregas()" v-model="model.f_pregas" v-el:fpregas
22
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
+ v-next-el='fcollection'>
24
+ </div>
25
+ <div class="col-sm-4" v-if="row.f_collection_type == '按金额'">
26
+ <label for="f_pregas" class=" font_normal_body">*预购气量</label>
27
+ <input class="input_search" style="width:60%" type="number" v-el:fpregas
28
+ @blur="pregas()" v-model="model.f_pregas" placeholder="预购气量"
29
+ v-next-el='fcollection'>
30
+ </div>
31
+ <div class="col-sm-4"
32
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
33
+ <label for="f_pregas" class=" font_normal_body">*预购金额</label>
34
+ <input class="input_search" style="width:60%" type="number"
35
+ @blur="preamount()" v-model="model.f_preamount"
36
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ],dctest: [0, ">"]}'
37
+ placeholder="预购金额"
38
+ v-next-el='fcollection'>
39
+ </div><!--
40
+ <div class="col-sm-4" v-if="row.f_collection_type == '按气量'">
41
+ <label for="f_preamount" class=" font_normal_body">&nbsp;预购金额</label>
42
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
43
+ v-scale="[model.f_preamount, 4]" placeholder="预购金额" disabled>
44
+ </div>-->
45
+
46
+ </div>
47
+ <div class="row" style="margin-top:6px;">
48
+ <div class="col-sm-4" :class="[$v.printstyle.required ? 'has-error' : '']">
49
+ <label for="f_print" class="font_normal_body">打印格式</label>
50
+ <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems"
51
+ v-validate:printstyle='{required: true }'>
52
+ <v-select id="print"
53
+ v-model="f_print"
54
+ placeholder='请选择'
55
+ :multiple="mulPrint"
56
+ :value.sync="model.f_print"
57
+ :options='printstyle'
58
+ close-on-select clear-button v-ref:printstyle>
59
+ </v-select>
60
+ </div>
61
+ <div class="col-sm-4 " v-if="hasLimit&&limitgas">
62
+ <label class="font_normal_body">&ensp;购气上限</label>
63
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
64
+ v-scale="[maxgas, 4]" placeholder='限购余气' disabled>
65
+ </div>
66
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
67
+ <label class="font_normal_body">金额上限</label>
68
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
69
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
70
+ </div>
71
+ <div class="col-sm-4" v-if="!hasLimit">
72
+ </div>
73
+
74
+ <div class="col-sm-4"
75
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
76
+ <label for="f_temp_amount"
77
+ class=" font_normal_body">&nbsp;应收金额</label>
78
+ <input class="input_search" style="width:60%" type="number"
79
+ @blur="preamount()" v-model="model.f_totalcost"
80
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
81
+ v-next-el='fcollection' v-scale="[model.f_totalcost, 4]" disabled>
82
+ </div>
83
+ </div>
84
+ <div class="row">
85
+
86
+ <div class="col-sm-4">
87
+ <label for="f_balance" class="font_normal_body">上期结余</label>
88
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
89
+ v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
90
+ </div>
91
+
92
+ <div class="col-sm-4">
93
+ <label for="f_curbalance" class="font_normal_body">&nbsp;本期结余</label>
94
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
95
+ v-scale="[curbalance, 4]" placeholder="本期结余" disabled>
96
+ </div>
97
+ <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气' && row.f_meter_type.includes('卡表')"
98
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
99
+ <label for="f_collection" class=" font_normal_body">*收&emsp;&emsp;款</label>
100
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
101
+ v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'
102
+ v-el:fcollection
103
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
104
+ v-scale="[model.f_totalcost, 4]" :disabled="$refs.givechange.promptText != ''">
105
+ </div>
106
+ <div class="col-sm-3" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气' && row.f_meter_type.includes('卡表')"
107
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
108
+ <label for="f_collection" class=" font_normal_body"><font size="4px"
109
+ style="font-weight:bold">*收&emsp;款</font></label>
110
+ <input id="f_collection" class="input_search" style="width:60%;font-size: 18px;font-weight:bold;"
111
+ type="number" v-model="model.f_collection"
112
+ v-el:fcollection
113
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
114
+ v-scale="[model.f_totalcost, 4]" :disabled="$refs.givechange.promptText != ''">
115
+ </div>
116
+ <div class="col-sm-3" v-if="row.f_collection_type === '按金额'&&row.f_meter_type.includes('卡表')">
117
+ <label for="f_collection" class=" font_normal_body"><font size="4px"
118
+ style="font-weight:bold">*收&emsp;款</font></label>
119
+ <input id="f_collection" class="input_search" style="width:50%;font-size: 18px;font-weight:bold;"
120
+ type="number" v-model="model.f_collection"
121
+ v-el:fcollection
122
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
123
+ v-scale="[model.f_collection, 4]" :disabled="$refs.givechange.promptText != ''">
124
+ </div>
125
+ <div class="col-sm-4" v-if="!row.f_meter_type.includes('卡表')">
126
+ <label for="f_collection" class=" font_normal_body"><font size="4px"
127
+ style="font-weight:bold">*收&emsp;款</font></label>
128
+ <input id="f_collection" class="input_search" style="width:60%;font-size: 18px;font-weight:bold;"
129
+ type="number" v-model="model.f_collection"
130
+ v-el:fcollection
131
+ @keyup.enter="checkInvoiceMsg((!$v.valid || validateOk || !islegal || clickConfirm))"
132
+ v-scale="[model.f_collection, 4]" disabled>
133
+ </div>
134
+ <div class="col-sm-1 form-group" v-show="row.f_meter_type.includes('卡表')">
135
+ <give-change :curbalance="curbalance" :collection.sync="model.f_collection"
136
+ v-ref:givechange></give-change>
137
+ </div>
138
+ </div>
139
+ <div class="row" style="margin-top:5px;">
140
+ <div class="col-sm-9">
141
+ </div>
142
+ <div class="col-sm-3">
143
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
144
+ </div>
145
+ </div>
146
+
147
+ <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
148
+ <div class="col-sm-4">
149
+ <label class="font_normal_body">优惠方式</label>
150
+ <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
151
+ placeholder='请选择'
152
+ :value.sync="model.f_privilege_id"
153
+ :options='privilegeList' clear-button value-single>
154
+ </v-select>
155
+ </div>
156
+ <div class="col-sm-4">
157
+ <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
158
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
159
+ v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
160
+ </div>
161
+ <div class="col-sm-4">
162
+ <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
163
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
164
+ v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
165
+ </div>
166
+ </div>
167
+
168
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
169
+ <div class="col-sm-4">
170
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
171
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number"
172
+ placeholder="凭证号">
173
+ </div>
174
+ </div>
175
+ <div class="row" style="padding-top: 0.5em;">
176
+ <div class="col-sm-4" v-if="!mjshow">
177
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
178
+ <input class="input_search" style="width:60%" type="text"
179
+ v-model="model.f_serial_number" placeholder="业务单号">
180
+ </div>
181
+ <div class="col-sm-4" v-if="mjshow"
182
+ :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
183
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
184
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
185
+ v-model="model.f_serial_number" placeholder="业务单号">
186
+ </div>
187
+
188
+
189
+ <div class="col-sm-8">
190
+ <label for="f_comments" class="font_normal_body">&nbsp;备&emsp;&emsp;注</label>
191
+ <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
192
+ </div>
193
+ </div>
194
+
195
+ <div v-if="paymentModel.length >1">
196
+ <div class="row" style="margin-top:10px;">
197
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../static/juxing.png"/><strong
198
+ style="margin-left: 4%">付款明细</strong></p>
199
+ </div>
200
+ <div class="row" style="margin-top:10px;">
201
+ <div class="col-sm-4 " v-for="pay in paymentModel">
202
+ <label class="font_normal_body">{{ pay.f_payment }}:</label>
203
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
204
+ </div>
205
+ <div class="col-sm-4 ">
206
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
207
+ </div>
208
+ </div>
209
+ </div>
210
+ </form>
211
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
212
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close"
213
+ @printok="printok" v-ref:printbill></print-bill>
214
+ <div style="text-align:right; height: 25%">
215
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
216
+ <strong style="font-size: large"
217
+ v-if="!config.notShowFormula">计算公式:{{ calculatedetail ? calculatedetail : ' 暂无' }}</strong><br/>
218
+ <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
219
+ :payment.sync="model.f_payment" :payment-data="paytype"
220
+ @confirm-payment="confirm()">
221
+ </payment-code-button>
222
+ <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()"
223
+ :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认
224
+ </button>
225
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
226
+ </div>
227
+ </validator>
228
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row"
229
+ @confirm="confirm"></eticket-modal>
230
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
231
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row"
232
+ :money="model.f_after_discount"></payment-code>
233
+ </div>
234
+ </div>
235
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="卡表收费"></upload>
236
+ </template>
237
+ <script>
238
+ import {HttpResetClass} from 'vue-client'
239
+ import XML from './plugins/ObjTree'
240
+
241
+ /**
242
+ *综合业务
243
+ *卡表收费组件
244
+ */
245
+
246
+ // 输入金额,换算气量
247
+ let preamountGen = async function (self) {
248
+ let calFee = ((self.model.f_preamount - 0)).toFixed(4)
249
+ if (self.model.f_payment == '赠气') {
250
+ calFee = (self.model.f_preamount - 0).toFixed(4)
251
+ }
252
+ // 通过金额进行划价
253
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
254
+ if (getGas.data.gas) {
255
+ if (self.row.f_isdecimal === '是') {
256
+ if (self.row.f_alias === 'QiaoSong') {
257
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
258
+ } else {
259
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
260
+ }
261
+ if (self.row.f_collection_type === '按金额') {
262
+ self.dymoney = 0
263
+ } else {
264
+ let dymoney2 = await self.$CommonService.gasCalculate(self.model, (getGas.data.gas).toFixed(4))
265
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(4) - (dymoney2.data.chargenum - 0).toFixed(4)
266
+ }
267
+ } else {
268
+ // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
269
+ let tempnum = Math.floor(getGas.data.gas - 0)
270
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
271
+ self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(2)
272
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
273
+ }
274
+ }
275
+ self.model.f_totalcost = ((self.row.f_balance - 0) >= (self.model.f_preamount - 0) ? 0 : (self.model.f_preamount - 0 - self.row.f_balance))
276
+
277
+ self.model.chargeprice = getGas.data.chargeprice
278
+ Object.assign(self.model, self.model, getGas.data)
279
+ if (self.model.f_payment == '赠气') {
280
+ self.model.f_totalcost = self.model.f_preamount
281
+ self.model.f_collection = 0
282
+ } else {
283
+ self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
284
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(4)
285
+ }
286
+ self.model.f_preamount = (calFee - (self.dymoney - 0)).toFixed(4)
287
+ self.calText(getGas.data.chargeprice)
288
+ }
289
+
290
+ // 输入气量,换算金额
291
+ let pregasGen = async function (self) {
292
+ if (self.row.f_isdecimal === '是') {
293
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
294
+ } else {
295
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
296
+ }
297
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
298
+ self.model.f_meter_type = self.row.f_meter_type
299
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
300
+ self.model.f_preamount = getAmount.data.chargenum
301
+ self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4))
302
+ Object.assign(self.model, self.model, getAmount.data)
303
+ self.model.chargeprice = getAmount.data.chargeprice
304
+ if (self.model.f_payment == '赠气') {
305
+ self.model.f_totalcost = getAmount.data.chargenum
306
+ self.model.f_collection = 0
307
+ } else {
308
+ self.model.f_collection = self.config.autoCollection ? self.model.f_totalcost : 0
309
+ if (self.config.floor) {
310
+ self.model.f_collection = Math.ceil(self.model.f_collection)
311
+ }
312
+ }
313
+ self.calText(getAmount.data.chargeprice)
314
+ }
315
+ }
316
+ // 执行保存逻辑
317
+ let sellgasGen = async function (self) {
318
+ try {
319
+ self.row.cardInfo = self.cardData
320
+
321
+ if (self.paymentModel.length === 0) {
322
+ self.paymentModel = [{
323
+ f_payment: self.model.f_payment[0],
324
+ f_money: self.model.f_preamount
325
+ }]
326
+ }
327
+ self.model.xiekamoney = self.model.f_preamount
328
+ if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否' && self.row.f_collection_type == '按金额') {
329
+ self.model.xiekamoney = (self.model.f_pregas * self.model.chargeprice[0].f_price)
330
+ self.model.xiekamoney = self.model.xiekamoney.toFixed(4)
331
+ }
332
+
333
+ self.model.payments = self.paymentModel
334
+ // 加入扫码盒付款码支付流水号
335
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
336
+ let res = await self.$CardService.sellgas(self.model, self.row)
337
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
338
+ if (localeSustainMoney != null) {
339
+ localeSustainMoney = (localeSustainMoney - 0) + (self.model.f_collection - 0)
340
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
341
+ }
342
+ let param = []
343
+ for (let row of self.resid) {
344
+ param.push({id: row.id})
345
+ }
346
+ let writeid
347
+ if (res.data && res.data.id) {
348
+ writeid = res.data.id
349
+ } else {
350
+ writeid = res
351
+ }
352
+ let data = {
353
+ param: param,
354
+ f_blobid: writeid
355
+ }
356
+
357
+ await self.$resetpost('rs/logic/updatefiles', data)
358
+ console.log(self.config, self.config.hasPrint && !self.$login.r.includes('不打印发票'))
359
+ // 开始打票
360
+ if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
361
+ if (self.model.f_print.indexOf('电子发票') == -1) {
362
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
363
+ if (self.row.f_user_type === '非民用') {
364
+ self.billData.url = 'rs/report/fmy_card_bill'
365
+ }
366
+ }
367
+ if (self.config.hasBillManage) {
368
+ // 启用发票管理,获取票据管理中的票号并存储记录
369
+ self.row.id = res
370
+ self.row.f_bill_type = '卡表收费'
371
+ self.row.f_bill_style = self.model.f_print[0]
372
+ self.print = true
373
+ } else {
374
+ self.row.id = res
375
+ self.print = true
376
+ }
377
+ } else {
378
+ if (self.model.f_print[0] === '电子发票') {
379
+ self.row.id = res
380
+ self.eticket_show = true
381
+ // 应铜川需要卡表显示
382
+ await self.$refs.eticketbill.openETicket([res], self.row, '是', self.invoice_is_pax, '卡表收费')
383
+ // await self.$CommonService.openEticket(res, '售气收费')
384
+ // self.print = true
385
+ }
386
+ }
387
+ } else {
388
+ self.$dispatch('success')
389
+ }
390
+ self.clickConfirm = false
391
+ } catch (error) {
392
+ console.log('捕获到异常', error)
393
+ if (error instanceof Object) {
394
+ self.$showAlert(error.data, 'danger', 0)
395
+ } else {
396
+ self.$showAlert(error, 'danger', 0)
397
+ }
398
+ self.$dispatch('refresh')
399
+ self.clickConfirm = false
400
+ }
401
+ }
402
+
403
+ let asyncCardMeterCenter = async function (self) {
404
+ await self.$getConfig(self, 'CardMeterCenter')
405
+ console.log('卡表收费config', self.config)
406
+
407
+ // 添加 “系统余额透支” 付款方式
408
+ let i = -1
409
+ for (const index in self.paytype) {
410
+ if (self.paytype[index].value == '系统余额透支') {
411
+ i = index
412
+ break
413
+ }
414
+ }
415
+ if (self.canOverdraftBalance()) {
416
+ if (i == -1) {
417
+ self.paytype.push({
418
+ label: '系统余额透支',
419
+ value: '系统余额透支'
420
+ })
421
+ }
422
+ } else {
423
+ if (i != -1) {
424
+ self.paytype.splice(i, 1)
425
+ }
426
+ }
427
+
428
+ // 默认打印格式
429
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
430
+ self.model.f_payment = [self.config.payment]
431
+ self.mulPrint = self.config.printType instanceof Array
432
+
433
+ // 获取当前票号用
434
+ self.model.f_use_type = self.config.billType
435
+ self.model.f_bill_type = self.model.f_print
436
+ self.hasValidateBill = self.config.hasBillManage
437
+
438
+ // 判断限购
439
+ let limit_param = {
440
+ f_userinfo_id: self.row.f_userinfo_id,
441
+ f_user_id: self.row.f_user_id,
442
+ f_stairprice_id: self.row.f_stairprice_id
443
+ }
444
+ let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {
445
+ resolveMsg: null,
446
+ rejectMsg: '获取限购值失败!!'
447
+ })
448
+ console.log('获取限购值', getLimit)
449
+ self.hasLimit = getLimit.data.hasLimit
450
+ if (self.hasLimit) {
451
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
452
+ if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
453
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
454
+ self.$dispatch('refresh')
455
+ } else {
456
+ if (getLimit.data.f_limit_value) {
457
+ self.maxgas = (getLimit.data.f_limit_value - 0)
458
+ self.limitgas = true
459
+ }
460
+ if (getLimit.data.f_limit_amount) {
461
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
462
+ self.limitmoney = true
463
+ }
464
+ }
465
+ }
466
+ }
467
+ let nowrite_param = {
468
+ f_userfiles_id: self.row.f_userfiles_id
469
+ }
470
+ let getNoWriteCard = await self.$resetpost('rs/sql/getnowritecard', {data: nowrite_param}, {
471
+ resolveMsg: null,
472
+ rejectMsg: '获取最近卡表收费记录失败!!'
473
+ })
474
+ if (getNoWriteCard.data.length > 0) {
475
+ self.$showMessage(`三小时内存在写卡失败的记录,是否重新写卡?`, ['confirm', 'cancel']).then(async (res) => {
476
+ if (res === 'confirm') {
477
+ let url = 'http://127.0.0.1:8003/' + getNoWriteCard.data[0].f_cardpost
478
+ let param = JSON.parse(getNoWriteCard.data[0].f_cardparam)
479
+ let cardRes = await self.$resetpost(url, param, {resolveMsg: null, rejectMsg: '重新写卡失败'})
480
+ if (cardRes.data.Err || cardRes.data.Exception) {
481
+ self.$showAlert(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`, 'danger', 3000)
482
+ self.$dispatch('refresh', self.row)
483
+ } else {
484
+ self.$resetpost('rs/logic/writeCardAgin', getNoWriteCard.data[0], {
485
+ resolveMsg: '重新写卡成功',
486
+ rejectMsg: '重新写卡失败'
487
+ })
488
+ self.$dispatch('success')
489
+ }
490
+ } else {
491
+ self.$dispatch('refresh', self.row)
492
+ }
493
+ })
494
+ }
495
+ }
496
+ export default {
497
+ title: '卡表收费',
498
+ data () {
499
+ return {
500
+ mjshow: false,
501
+ serialShow: false,
502
+ resid: [], // 存放新增的f_files表中id
503
+ config: {
504
+ notShowFormula: false, // 不显示计算公式,默认显示
505
+ autoCollection: true, // 自动填写收款
506
+ showupload: true, // 显示上传
507
+ hasPrint: true, // 默认打票
508
+ hasBillManage: false, // 默认不启用发票管理
509
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
510
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
511
+ payment: '现金缴费',
512
+ floor: false,
513
+ overdraftBalance: false // 是否支持系统余额透支
514
+ },
515
+ eticket_msg: false,
516
+ eticket_show: false,
517
+ invoice_is_pax: '不征税',
518
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
519
+ model: {
520
+ f_purchase: 0,
521
+ f_payment: [],
522
+ f_pregas: '',
523
+ f_preamount: 0,
524
+ f_totalcost: 0,
525
+ f_curbalance: 0,
526
+ f_collection: '',
527
+ f_balance: 0,
528
+ f_print: [],
529
+ f_meter_type: '',
530
+ f_voucher_number: '',
531
+ f_banktransfer_person: '',
532
+ f_banktransfer_date: '',
533
+ f_privilege_id: 0,
534
+ f_privilege_money: 0,
535
+ f_after_discount: 0
536
+ },
537
+ calculatedetail: '',
538
+
539
+ // 启用发票管理需要对票号进行验证
540
+ hasValidateBill: false,
541
+ validateOk: false,
542
+
543
+ print: false,
544
+ billData: {
545
+ url: 'rs/report/card_bill',
546
+ billnumber: ''
547
+ },
548
+ hasLimit: false,
549
+ maxgas: 99999999, // 限购
550
+ maxmoney: 99999999,
551
+ limitmoney: false,
552
+ limitgas: false,
553
+
554
+ paymentModel: [], // 多笔付款方式
555
+
556
+ mulPrint: false,
557
+ clickConfirm: false, // 控制确认按钮只能点击一次
558
+ // 下拉框值
559
+ paytype: [],
560
+ printstyle: this.$appdata.getParam('打印格式'),
561
+ privilegeList: [{label: '无优惠', value: '0'}],
562
+ BankTransfer: false,
563
+ // 小数是否支持,导致划价产生的多余气量,金额
564
+ dymoney: 0
565
+ }
566
+ },
567
+ props: ['row', 'cardData'],
568
+ async ready () {
569
+ if (this.authArr.includes('余额写卡限定')) {
570
+ this.paytype = [{label: '余额写卡', value: '余额写卡'}]
571
+ } else {
572
+ this.paytype = await this.$appdata.getParam('付款方式') ? await this.$appdata.getParam('付款方式') : []
573
+ if (!this.$login.r.includes('免交充值付款')) {
574
+ this.paytype = this.paytype.filter((item) => {
575
+ return item.label != '免交'
576
+ })
577
+ }
578
+ }
579
+ // this.getPurchase()
580
+ this.model.f_price_id = this.row.f_price_id
581
+ this.model.f_user_id = this.row.f_user_id
582
+ this.model.f_userfiles_id = this.row.f_userfiles_id
583
+ this.model.f_userinfo_id = this.row.f_userinfo_id
584
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
585
+ if (this.row.f_collection_type == '按金额') {
586
+ this.model.f_preamount = ''
587
+ this.model.f_pregas = 0
588
+ }
589
+ this.$els.fpregas.focus()
590
+ asyncCardMeterCenter(this)
591
+ },
592
+ watch: {
593
+ 'model.f_payment.length' (val) {
594
+ console.log('付款方式多选。。', val)
595
+ if (val > 1 && !this.model.f_preamount) {
596
+ this.model.f_payment = ['现金缴费']
597
+ this.$showAlert('请先计算付款金额', 'warning', 2000)
598
+ } else {
599
+ this.paymentModel = []
600
+
601
+ this.model.f_payment.forEach((res) => {
602
+ let temp = {
603
+ f_payment: res,
604
+ f_money: 0
605
+ }
606
+ this.paymentModel.push(temp)
607
+ })
608
+ this.$resetValidation()
609
+
610
+ // 获取计算优惠
611
+ this.getPrivilegeList()
612
+ }
613
+ },
614
+ 'model.f_payment' (val) {
615
+ if (val == '免交') {
616
+ this.mjshow = true
617
+ } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
618
+ if (this.row.f_collection_type == '按气量') {
619
+ this.pregas()
620
+ } else {
621
+ this.preamount()
622
+ }
623
+ } else {
624
+ this.mjshow = false
625
+ }
626
+ // if(this.row.f_collection_type == '按气量'){
627
+ // this.pregas();
628
+ // }else{
629
+ // this.preamount();
630
+ // }
631
+ },
632
+ 'model.f_collection' (val) {
633
+ // 获取计算优惠
634
+ this.getPrivilegeList()
635
+ }
636
+ },
637
+ events: {
638
+ // 删除Resid数组元素
639
+ 'delResid' (val) {
640
+ this.resid.$remove({id: val, f_biobid: ''})
641
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
642
+ },
643
+ // 增加Resid数组元素
644
+ 'resid' (val) {
645
+ this.resid.push({id: val, f_biobid: ''})
646
+ }
647
+ },
648
+ methods: {
649
+ // 校验发票信息
650
+ checkInvoiceMsg (flag) {
651
+ // 校验是否超出最大透支余额
652
+ if (this.model.f_payment == '系统余额透支') {
653
+ const maxOverdraftBalance = -(this.$appdata.getSingleValue('最大透支余额') - 0)
654
+ const curSysBalance = (this.row.f_sys_balance - 0) - (this.model.f_totalcost - 0)
655
+ if (curSysBalance < maxOverdraftBalance) {
656
+ this.$showAlert('您的系统余额将超出最大透支余额,请使用别的付款方式!', 'danger', 5000)
657
+ return
658
+ }
659
+ this.model.f_sys_balance = curSysBalance
660
+ }
661
+
662
+ // 收款回车时, 如果确认按钮是灰色不进行任何操作
663
+ if (flag) return
664
+ console.log(this.model.f_print[0])
665
+ if (this.model.f_print[0] === '电子发票') {
666
+ if (!this.row.f_taxpayer_id) {
667
+ this.row.f_taxpayer_id = this.row.f_idnumber
668
+ }
669
+ if (!this.row.f_paper_name) {
670
+ this.row.f_paper_name = this.row.f_user_name
671
+ }
672
+ if (!this.row.f_address_phone) {
673
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
674
+ }
675
+ if (!this.row.f_email) {
676
+ this.row.f_email = this.row.f_email
677
+ }
678
+ this.eticket_msg = true
679
+ } else {
680
+ this.confirm()
681
+ }
682
+ },
683
+ async confirm () {
684
+ // 铜川要先验证插得卡是不是系统页面上的卡号
685
+ let res = await this.$resetpost('http://127.0.0.1:8003/ReadCard', {},
686
+ {resolveMsg: null, rejectMsg: '获取卡信息出错!!'})
687
+ if (res.data.CardID !== this.cardData.CardID) {
688
+ this.$showAlert('请注意!校验卡号出错,请检查卡以及用户后重试', 'warning', 2000)
689
+ return
690
+ }
691
+ this.eticket_msg = false
692
+ if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
693
+ if (this.model.f_collection > this.row.f_balance) {
694
+ this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
695
+ }
696
+
697
+ if (this.model.f_collection > 0) {
698
+ this.$showAlert('请注意!进行余额写卡,收款不能大于0', 'warning', 1000)
699
+ }
700
+ }
701
+ this.$showMessage(`确定对用户${this.row.f_user_name}进行卡表收费吗?`, ['confirm', 'cancel']).then(async (res) => {
702
+ if (res === 'confirm') {
703
+ // 先调用付款码支付组件流程
704
+ let ss = await this.$refs.paymentcode.flowPath()
705
+ this.$refs.paymentcode.paymentCodeShow = false
706
+ console.log('付款码操作返回', ss)
707
+ if (!ss.result) return
708
+
709
+ this.clickConfirm = true
710
+ this.model.f_curbalance = this.curbalance
711
+ this.$dispatch('no-button')
712
+ sellgasGen(this)
713
+ }
714
+ })
715
+ },
716
+ eticket_toggle () {
717
+ this.eticket_show = false
718
+ this.$dispatch('success')
719
+ },
720
+ clean () {
721
+ this.$info('取消操作')
722
+ this.$dispatch('refresh', this.row)
723
+ },
724
+ validateBill (val) {
725
+ this.validateOk = !val.isOk
726
+ this.billData.bill = val.bill
727
+ },
728
+ printok () {
729
+ // 收据打完,判断是否还有其他票据进行请求
730
+ for (let i = 0; i < this.model.f_print.length; i++) {
731
+ if (this.model.f_print[i] === '电子发票') {
732
+ this.$CommonService.openEticket(this.row.id, '售气收费')
733
+ }
734
+ }
735
+ this.$dispatch('success')
736
+ },
737
+ pregas () {
738
+ this.dymoney = 0
739
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
740
+ try {
741
+ // 对气量进行验证
742
+ if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
743
+ this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
744
+ this.model.f_pregas = null
745
+ } else {
746
+ pregasGen(this)
747
+ }
748
+ } catch (error) {
749
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
750
+ this.$dispatch('error', '发卡售气', this.model, error)
751
+ }
752
+ } else {
753
+ this.model.f_pregas = null
754
+ }
755
+ },
756
+ preamount () {
757
+ this.dymoney = 0
758
+ this.model.f_price_id = this.row.f_price_id
759
+ this.model.f_user_id = this.row.f_user_id
760
+ this.model.f_userfiles_id = this.row.f_userfiles_id
761
+ this.model.f_userinfo_id = this.row.f_userinfo_id
762
+ try {
763
+ preamountGen(this)
764
+ } catch (error) {
765
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
766
+ this.$dispatch('error', '发卡售气', this.model, error)
767
+ }
768
+ },
769
+ calText (val) {
770
+ let str = ''
771
+ let num = 0
772
+ val.forEach((item) => {
773
+ if (item.f_gas > 0) {
774
+ num = num + 1
775
+ }
776
+ if (this.row.f_isdecimal === '是') {
777
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
778
+ } else {
779
+ str = str + item.f_price + ' x ' + Math.floor(item.f_gas) + '+'
780
+ }
781
+ })
782
+ str = str.slice(0, str.length - 1)
783
+ this.calculatedetail = str
784
+ if (num > 1) {
785
+ if (this.$login.r.find(item => item == '阶梯提示无按钮')) {
786
+ this.$showAlert('友好提示:本次购气已跨阶梯', 'warning', 3000)
787
+ } else {
788
+ this.$showMessage('友好提示:本次购气已跨阶梯', ['confirm', 'cancel'])
789
+ }
790
+ }
791
+ },
792
+ close () {
793
+ this.print = false
794
+ this.clean()
795
+ },
796
+ paymentchange () {
797
+ console.log('model.f_payment', this.model.f_payment[0])
798
+ if (JSON.stringify(this.model.f_payment).indexOf('转账') !== -1) {
799
+ // 进入转账筛选条件
800
+ this.model.f_banktransfer_person = ''
801
+ this.model.f_banktransfer_date = ''
802
+ this.BankTransfer = true
803
+ } else {
804
+ this.model.f_banktransfer_person = ''
805
+ this.model.f_banktransfer_date = ''
806
+ this.BankTransfer = false
807
+ }
808
+ },
809
+ // 根据选择的付款方式 获取优惠列表
810
+ async getPrivilegeList () {
811
+ // 初始化下拉选择列表
812
+ this.privilegeList = [{label: '无优惠', value: '0'}]
813
+ // 初始为无优惠
814
+ this.model.f_privilege_id = '0'
815
+ if (this.model.f_payment && this.model.f_payment.length) {
816
+ // 查询条件
817
+ let payments = JSON.stringify(this.model.f_payment)
818
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
819
+ let HttpReset = new HttpResetClass()
820
+ let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
821
+ data: {
822
+ items: 'id,f_privilege_name,f_privilege_type',
823
+ tablename: 't_privilege',
824
+ condition: `f_payment in ${payments} and f_gasproperties = '${this.row.f_gasproperties}' and f_user_type = '${this.row.f_user_type}' and f_perform_date <= GETDATE() and f_end_date >= GETDATE() and f_state = '有效'`,
825
+ orderitem: 'id'
826
+ }
827
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
828
+ // 查询结果放到下拉列表
829
+ for (let p of privilege.data) {
830
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
831
+ }
832
+ this.privilegeCalculate()
833
+ }
834
+ },
835
+ // 优惠计算
836
+ async privilegeCalculate () {
837
+ // 初始化减免金额
838
+ this.model.f_privilege_money = 0
839
+ this.model.f_after_discount = this.model.f_collection
840
+ // 判断是否是自定义优惠
841
+ if (this.model.f_privilege_id != null && parseInt(this.model.f_privilege_id)) {
842
+ for (let p of this.privilegeList) {
843
+ if (p.value == this.model.f_privilege_id && p.type == '自定义') {
844
+ this.model.f_privilege_money = window.prompt('请输入你想优惠的金额')
845
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money)) {
846
+ this.$showMessage('金额输入格式不正确!')
847
+ this.model.f_privilege_money = 0
848
+ return
849
+ }
850
+ if ((this.model.f_privilege_money - 0) >= this.model.f_collection) {
851
+ this.$showMessage('减免金额不能大于等于收款金额')
852
+ this.model.f_privilege_money = 0
853
+ return
854
+ }
855
+ }
856
+ }
857
+ }
858
+ // 优惠方式, 收款 缺一不计算
859
+ if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
860
+ let c = {
861
+ f_privilege_id: this.model.f_privilege_id,
862
+ f_collection: this.model.f_collection,
863
+ f_privilege_money: this.data.f_privilege_money
864
+ }
865
+ let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {
866
+ resolveMsg: null,
867
+ rejectMsg: '计算优惠金额出错'
868
+ })
869
+ // 减免金额
870
+ this.model.f_privilege_money = privilegeData.data.f_privilege_money
871
+ // 减免后收款金额
872
+ this.model.f_after_discount = privilegeData.data.f_collection
873
+ }
874
+ },
875
+ // 判断当前用户是否可以使用系统余额透支
876
+ canOverdraftBalance () {
877
+ return this.config.overdraftBalance && this.row.f_user_type != '民用'
878
+ }
879
+ },
880
+ computed: {
881
+ authArr () {
882
+ return this.$login.r ? this.$login.r : []
883
+ },
884
+ 'curbalance' () {
885
+ if (this.model.f_payment == '赠气') {
886
+ return this.model.f_balance
887
+ }
888
+ if (this.model.f_preamount) {
889
+ // if (this.row.f_collection_type === '按金额') {
890
+ // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
891
+ // } else {
892
+ if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
893
+ return ((this.row.f_balance - 0) - (this.model.f_preamount - 0) + (this.model.f_collection - 0)).toFixed(4)
894
+ } else {
895
+ return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
896
+ }
897
+ // return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
898
+ // }
899
+ } else {
900
+ return this.row.f_balance
901
+ }
902
+ },
903
+ 'invoice_show_gas' () {
904
+ return this.row.f_collection_type === '按气量' ? '是' : '否'
905
+ },
906
+ 'islegal' () {
907
+ console.log('支付分离。。。', this.paymentModel.length, this.model.f_collection)
908
+ if (this.paymentModel.length > 1 && this.model.f_collection) {
909
+ let sum = 0
910
+ this.paymentModel.forEach((res) => {
911
+ sum += (res.f_money - 0)
912
+ })
913
+ return (this.model.f_collection - 0) === (sum - 0)
914
+ } else {
915
+ return true
916
+ }
917
+ }
918
+ }
919
+ }
920
+ </script>
921
+
922
+ <style>
923
+ </style>