sale-client 3.6.21 → 3.6.22

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 (45) hide show
  1. package/package.json +1 -1
  2. package/src/components/charge/business/CardMeterCenter.vue +944 -944
  3. package/src/components/charge/business/IOTMeterCenter.vue +793 -793
  4. package/src/components/charge/business/OtherChargeNew.vue +550 -550
  5. package/src/components/charge/business/machine/MachineMeterCenter.vue +676 -676
  6. package/src/components/charge/gasloss/gasLossOperate.vue +383 -383
  7. package/src/components/newBill/CardMeterCenter.vue +902 -902
  8. package/src/components/newBill/IOTMeterCenter.vue +797 -797
  9. package/src/components/revenue/Common/EticketModal.vue +90 -90
  10. package/src/filiale/alashan/business/CardMeterCenter.vue +897 -897
  11. package/src/filiale/chengtou/components/OtherChargeNew.vue +549 -549
  12. package/src/filiale/gehua/CardMeterCenter.vue +898 -898
  13. package/src/filiale/gehua/IOTMeterCenter.vue +791 -791
  14. package/src/filiale/gehua/MachineMeterCenter.vue +685 -685
  15. package/src/filiale/gehua/OtherChargeNew.vue +558 -558
  16. package/src/filiale/guangxi/CardMeterCenter.vue +891 -891
  17. package/src/filiale/guangxi/IOTMeterCenter.vue +774 -774
  18. package/src/filiale/guangxi/MachineMeterCenter.vue +622 -622
  19. package/src/filiale/haile/MachineMeterCenter.vue +762 -762
  20. package/src/filiale/huayin/CardMeterCenter.vue +903 -903
  21. package/src/filiale/huayin/IOTMeterCenter.vue +796 -796
  22. package/src/filiale/huayin/MachineMeterCenter.vue +680 -680
  23. package/src/filiale/jingwei/CardMeterCenter.vue +870 -870
  24. package/src/filiale/jingwei/ShowCardSellGas.vue +903 -903
  25. package/src/filiale/kelai/CardMeterCenter.vue +934 -934
  26. package/src/filiale/kelai/IOTMeterCenter.vue +833 -833
  27. package/src/filiale/kelai/MachineMeterCenter.vue +705 -705
  28. package/src/filiale/macheng/CardMeterCenter.vue +939 -939
  29. package/src/filiale/qianneng/OtherChargeNew.vue +544 -544
  30. package/src/filiale/qianneng/eticket/EticketModal.vue +91 -91
  31. package/src/filiale/qianneng/machine/MachineMeterCenter.vue +676 -676
  32. package/src/filiale/rizhao/IOTMeterCenter.vue +795 -795
  33. package/src/filiale/shangluo/CardMeterCenter.vue +892 -892
  34. package/src/filiale/shangluo/IOTMeterCenter.vue +797 -797
  35. package/src/filiale/shangluo/MachineMeterCenter.vue +734 -734
  36. package/src/filiale/shanxian/OtherChargeNew.vue +561 -561
  37. package/src/filiale/shanxian/components/revenue/CardMeterCenter.vue +944 -944
  38. package/src/filiale/tongchuan/CardMeterCenter.vue +923 -923
  39. package/src/filiale/tongchuan/bill/EticketModal.vue +90 -90
  40. package/src/filiale/wenxi/CardMeterCenter.vue +942 -942
  41. package/src/filiale/wenxi/IOTMeterCenter.vue +774 -774
  42. package/src/filiale/wuhai/CardMeterCenter.vue +945 -945
  43. package/src/filiale/wuhai/IOTMeterCenter.vue +757 -757
  44. package/src/filiale/yuansheng/CardMeterCenter.vue +950 -950
  45. package/src/filiale/yuansheng/IOTMeterCenter.vue +788 -788
@@ -1,734 +1,734 @@
1
- <template>
2
- <div class="span" style="overflow-y: auto !important;">
3
- <validator name='v'>
4
- <form class="form-horizontal">
5
- <div class="row" style="padding-top: 0.5em;">
6
- <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'has-error select-error' : '']">
7
- <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
8
- <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
9
- <v-select id="f_payment"
10
- v-model="f_payment"
11
- style="width:60%"
12
- placeholder='请选择'
13
- multiple
14
- :value.sync="data.f_payment"
15
- :options='paytype'
16
- clear-button
17
- v-ref:payment>
18
- </v-select>
19
- </div>
20
- <div class="col-sm-4 form-group">
21
- <label for="f_print" class="font_normal_body">打印格式</label>
22
-
23
- <v-select id="print"
24
- v-model="data.f_print"
25
- placeholder='请选择'
26
- style="width:60%"
27
- :value.sync="data.f_print"
28
- :options='printstyle'
29
- close-on-select clear-button>
30
- </v-select>
31
-
32
- </div>
33
- <div class="col-sm-4 form-group">
34
- <label for="f_overdue" class="font_normal_body">违&ensp;约&ensp;金</label>
35
- <input class="input_search" style="width:60%" type="number" v-model="newOverdue"
36
- v-scale="[newOverdue,2]" placeholder="违约金"
37
- disabled>
38
- <!--<button type="button" name="button" class="btn btn-link" @click="modefiy()" v-if="authArr.includes('滞纳金修改')">修改</button>-->
39
- </div>
40
- </div>
41
- <div class="row" style="padding-top: 0.5em;" >
42
-
43
- <div class="col-sm-4 form-group">
44
- <label for="f_pregas" class=" font_normal_body">用&ensp;气&ensp;量</label>
45
- <input class="input_search" style="width:60%" type="number"
46
- v-model="data.f_pregas" placeholder="用气量"
47
- v-scale = "[data.f_pregas, 2]" disabled>
48
- </div>
49
- <div class="col-sm-4 form-group">
50
- <label for="f_preamount" class="font_normal_body">实欠气费</label>
51
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="data.f_preamount"
52
- v-scale = "[data.f_preamount, 2]"
53
- placeholder="实欠气费" disabled>
54
- </div>
55
-
56
- <div class="col-sm-4 form-group">
57
- <label for="f_totalcost" class=" font_normal_body">应收金额</label>
58
- <input class="input_search" style="width:60%" type="number" v-model="data.f_totalcost"
59
- v-scale = "[data.f_totalcost, 2]" placeholder="应收金额" disabled>
60
- </div>
61
- </div>
62
-
63
- <div class="row" style="padding-top: 0.5em;">
64
- <div class="col-sm-4 form-group">
65
- <label for="f_balance" class="font_normal_body">上期结余</label>
66
- <input class="input_search" style="width:60%" type="number" v-model="data.f_balance"
67
- v-scale="[data.f_balance,4]" placeholder="上期结余" disabled>
68
- </div>
69
- <div class="col-sm-4 form-group">
70
- <label for="f_overdue" class="font_normal_body">本期结余</label>
71
- <input class="input_search" style="width:60%" type="number" v-model="curbalance" disabled>
72
- </div>
73
- <div class="col-sm-3 form-group" v-if="config.hasfindaReail" :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error select-error' : '']">
74
- <label for="f_collection" class="font_normal_body">收&emsp;&emsp;款</label>
75
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="data.f_collection"
76
- v-validate:f_collection='{required: true, dctest: [0, ">=" ]}' v-scale = "[data.f_collection, 2]"
77
- @mousewheel.native.prevent @keyup.enter="confirm()" :disabled="$refs.givechange.promptText != ''">
78
- </div>
79
- <div class="col-sm-4 form-group" v-if="!config.hasfindaReail" :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error select-error' : '']">
80
- <label for="f_collection" class="font_normal_body">收&emsp;&emsp;款</label>
81
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="data.f_collection"
82
- v-validate:f_collection='{required: true, dctest: [0, ">=" ]}' v-scale = "[data.f_collection, 2]"
83
- @mousewheel.native.prevent @keyup.enter="confirm()" :disabled="$refs.givechange.promptText != ''">
84
- </div>
85
- <div class="col-sm-1 form-group" v-if="config.hasfindaReail">
86
- <give-change :curbalance="curbalance" :collection.sync="data.f_collection" v-ref:givechange></give-change>
87
- </div>
88
- </div>
89
-
90
- <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
91
- <div class="col-sm-4 form-group">
92
- <label class="font_normal_body">优惠方式</label>
93
- <v-select v-model="data.f_privilege_id" @blur.native.capture="privilegeCalculate"
94
- placeholder='请选择'
95
- :value.sync="data.f_privilege_id"
96
- :options='privilegeList' clear-button value-single>
97
- </v-select>
98
- </div>
99
- <div class="col-sm-4 form-group">
100
- <label for="f_preamount" class=" font_normal_body">优惠金额</label>
101
- <input class="input_search" style="width:60%" type="number" v-model="data.f_privilege_money"
102
- v-scale="[data.f_privilege_money, 2]" placeholder="优惠金额" disabled>
103
- </div>
104
- <div class="col-sm-4 form-group">
105
- <label for="f_preamount" class=" font_normal_body">实际收款</label>
106
- <input class="input_search" style="width:60%" type="number" v-model="data.f_after_discount"
107
- v-scale="[data.f_after_discount, 2]" placeholder="优惠后收款" disabled>
108
- </div>
109
- </div>
110
-
111
- <div class="row" style="padding-top: 0.5em;">
112
- <div class="col-sm-4 form-group" v-show="row.f_garbage_fee === '是'">
113
- <label for="f_garbage_fee" class="font_normal_body">垃&ensp;圾&ensp;费</label>
114
- <input class="input_search" style="width:60%" type="number" v-model="data.f_garbage_fee" disabled>
115
- </div>
116
- </div>
117
-
118
- <div class="row" style="padding-top: 0.5em;">
119
- <div class="col-sm-4" v-if="!mjshow" >
120
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
121
- <input class="input_search" style="width:60%" type="text"
122
- v-model="data.f_serial_number" placeholder="业务单号">
123
- </div>
124
- <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
125
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
126
- <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
127
- v-model="data.f_serial_number" placeholder="业务单号">
128
- </div>
129
- <div class="col-sm-8">
130
- <label for="f_comments" class="font_normal_body">备&emsp;&emsp;注</label>
131
- <input class="input_search" style="width:87%" v-model="data.f_comments" placeholder="备注">
132
- </div>
133
- </div>
134
- <div v-if="paymentModel.length >1">
135
- <div class="row" style="margin-top:10px;">
136
- <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../static/juxing.png"/><strong
137
- style="margin-left: 4%">付款明细</strong></p>
138
- </div>
139
- <div class="row" style="margin-top:10px;">
140
- <div class="col-sm-4 " v-for="pay in paymentModel">
141
- <label class="font_normal_body">{{pay.f_payment}}:</label>
142
- <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
143
- </div>
144
- <div class="col-sm-4 ">
145
- <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
146
- </div>
147
- </div>
148
- </div>
149
- </form>
150
- <validate-bill v-if="hasValidateBill" :data="data" @validate-bill="validateBill"></validate-bill>
151
- <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" :data='data' @printok="printok" v-ref:printbill></print-bill>
152
- <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
153
- <eticket-modal :show="eticket_msg" @close-modal-show="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
154
- <div class="text-right" style="margin-top: 1%">
155
- <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
156
- <payment-code-button :clickable="!$v.valid || validateOk"
157
- :payment.sync="data.f_payment" :payment-data="paytype"
158
- @confirm-payment="confirm()">
159
- </payment-code-button>
160
- <button class="button_search btn-gn" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk'>确认</button>
161
- <!--<button class="btn btn-success" @click="confirmUserinfo()" :disabled='!$v.valid'>信息保存</button>-->
162
- <button class="button_clear btn-gn" @click="clean()">取消</button>
163
- </div>
164
- </validator>
165
- <!--<modal :show.sync="showOverdueModal" v-ref:modal backdrop="false">-->
166
- <!--<header slot="modal-header" class="modal-header">-->
167
- <!--<button type="button" class="close" @click="closeOverdue"><span>&times;</span></button>-->
168
- <!--<h4 class="modal-title">修改滞纳金</h4>-->
169
- <!--</header>-->
170
- <!--<article slot="modal-body" class="modal-body">-->
171
- <!--<validator name='m'>-->
172
- <!--<form class="form-horizontal">-->
173
- <!--<div class="row">-->
174
- <!--<div class="col-sm-6">-->
175
- <!--<label for="oldOverdue" class="font_normal_body">原违约金</label>-->
176
- <!--<input type="text" class="input_search" style="width:60%" v-once v-model="overdueModal.f_old_overdue" disabled>-->
177
- <!--</div>-->
178
- <!--</div>-->
179
- <!--<div class="row">-->
180
- <!--<div class="col-sm-6" :class="[$m.f_new_overdue.required ? 'has-error select-error' : '']">-->
181
- <!--<label for="newOverdue" class="font_normal_body">新违约金</label>-->
182
- <!--<input type="text" class="input_search" style="width:60%" v-model="overdueModal.f_new_overdue"-->
183
- <!--v-validate:f_new_overdue='{required: true}'>-->
184
- <!--</div>-->
185
- <!--</div>-->
186
- <!--</form>-->
187
- <!--</validator>-->
188
- <!--</article>-->
189
-
190
- <!--<footer slot="modal-footer" class="modal-footer">-->
191
- <!--<button type="button" class="button_search" :disabled='!$m.valid' @click='confirmOverdue()'>确认</button>-->
192
- <!--<button type="button" class="button_clear" @click='closeOverdue'>取消</button>-->
193
- <!--</footer>-->
194
- <!--</modal>-->
195
- <payment-code v-ref:paymentcode :payment="data.f_payment" :row="row" :money="data.f_after_discount"></payment-code>
196
- </div>
197
- <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="机表收费"></upload>
198
- </template>
199
- <script>
200
- import {HttpResetClass} from 'vue-client'
201
- import MachineChargeService from './plugins/MachineChargeService'
202
- /**
203
- *售气收费
204
- *机表收费组件
205
- */
206
-
207
- let asyncMachineMeterCenter = async function (self) {
208
- await self.$getConfig(self, 'MachineMeterCenter')
209
- self.data.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
210
- self.data.f_payment = [self.config.payment]
211
- self.data.f_use_type = self.config.billType
212
- self.data.f_bill_type = self.data.f_print
213
- self.hasValidateBill = self.config.hasBillManage
214
- }
215
-
216
- let machineChargeGen = async function (self) {
217
- try {
218
- if (!self.model) self.model = {}
219
- if (self.paymentModel.length === 0) {
220
- self.paymentModel = [{
221
- f_payment: self.data.f_payment[0],
222
- f_money: self.data.f_collection
223
- }]
224
- }
225
-
226
- self.data.payments = self.paymentModel
227
- console.log("付款多选列表结果:",self.data.payments)
228
- // 加入扫码盒付款码支付流水号
229
- self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
230
- console.log('查看传过来的数据=====================>', self)
231
- let res = await MachineChargeService.marchineCharge(self.data, self.model, self.row, self.floor)
232
- let localeSustainMoney = window.localStorage.getItem('sustainMoney')
233
- if (localeSustainMoney != null) {
234
- localeSustainMoney = (localeSustainMoney - 0) + (self.data.f_collection - self.data.f_garbage_fee)
235
- window.localStorage.setItem('sustainMoney', localeSustainMoney)
236
- }
237
- let param = []
238
- for (let row of self.resid) {
239
- param.push({id: row.id})
240
- }
241
- let data = {
242
- param: param,
243
- f_blobid: res.data
244
- }
245
-
246
- await self.$resetpost('rs/logic/updatefiles', data)
247
-
248
- // 开始打票
249
- if (self.config.hasPrint) {
250
- if (self.data.f_print.indexOf('电子发票') == -1) {
251
- if (self.$login.r.includes('非民用纸质票据拆分')) {
252
- if (self.row.f_user_type === '非民用') {
253
- self.billData.url = 'rs/report/fmy_machine_bill'
254
- }
255
- }
256
- if (self.config.hasBillManage) {
257
- // 启用发票管理,获取票据管理中的票号并存储记录
258
- self.data.id = res.data
259
- self.data.f_bill_type = '机表收费'
260
- self.data.f_bill_style = self.data.f_print[0]
261
- self.print = true
262
- } else {
263
- // 如果不欠费就用下边的预存收据
264
- if (self.$parent.$children[0].selecteds) {
265
- console.log('1111111', self.$parent.$children[0].selecteds)
266
- if (self.$parent.$children[0].selectedRows === 0) {
267
- console.log('22222222', self.$parent.$children[0].selectedRows)
268
- self.billData.url = 'rs/report/pre_sell'
269
- }
270
- // 获取选中的handplan的id
271
- self.data.handid = ''
272
- self.$parent.$children[0].selecteds.forEach((row, index) => {
273
- self.data.handid = self.data.handid + "','" + row.handplan_id
274
- })
275
- } else {
276
- console.log('3333333')
277
- self.billData.url = 'rs/report/pre_sell'
278
- self.data.handid = ''
279
- }
280
- self.data.id = res.data
281
- self.print = true
282
- }
283
- } else if (self.data.f_print[0] === '国税发票') {
284
- // TODO
285
- } else if (self.data.f_print[0] === '电子发票') {
286
- self.eticket_show = true
287
- await self.$refs.eticketbill.openETicket([res.data], self.row, '是', self.invoice_is_pax, '机表收费')
288
- // await self.$CommonService.openEticket(res.data, '售气收费')
289
- // 如果不欠费就用下边的预存收据
290
- // if (self.$parent.$children[0].selecteds) {
291
- // if (self.$parent.$children[0].selectedRows === 0) {
292
- // self.billData.url = 'rs/report/pre_sell'
293
- // }
294
- // // 获取选中的handplan的id
295
- // self.data.handid = ''
296
- // self.$parent.$children[0].selecteds.forEach((row, index) => {
297
- // self.data.handid = self.data.handid + "','" + row.handplan_id
298
- // })
299
- // } else {
300
- // self.billData.url = 'rs/report/pre_sell'
301
- // self.data.handid = ''
302
- // }
303
- // self.data.id = res.data
304
- // self.print = true
305
- }
306
- } else {
307
- self.$dispatch('success', '机表收费确认', self.row, self.data)
308
- }
309
- } catch (error) {
310
- self.$showAlert(error, 'danger', 0)
311
- self.$dispatch('refresh')
312
- }
313
- }
314
-
315
- export default {
316
- title: '收费',
317
- data () {
318
- return {
319
- mjshow: false,
320
- resid: [], // 存放新增的f_files表中id
321
- config: {
322
- showupload: true, // 显示上传
323
- hasPrint: true, // 默认打票
324
- hasBillManage: false, // 默认不启用发票管理
325
- hasfindaReail: true, // 默认开启找零功能
326
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
327
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
328
- payment: '现金缴费'
329
- },
330
- paymentModel: [], // 多笔付款方式
331
- eticket_msg: false,
332
- eticket_show: false,
333
- invoice_is_pax: '征税',
334
- is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
335
- // 垃圾费
336
- f_garbage_fee: 0,
337
- overdueModal: {
338
- f_old_overdue: 0,
339
- f_new_overdue: ''
340
- },
341
- newOverdue: 0,
342
- isBreakOverdue: false,
343
- breakOverdue: {},
344
-
345
- showErrorMsg: false,
346
- print: false,
347
- isConfirm: true,
348
- show: false,
349
- count: 0,
350
- billData: {
351
- url: 'rs/report/machine_bill',
352
- bill: ''
353
- },
354
-
355
- // 启用发票管理需要对票号进行验证
356
- hasValidateBill: false,
357
- validateOk: false,
358
- handid: '',
359
- showOverdueModal: false,
360
- editOverdue: this.$login.r.includes('滞纳金修改'),
361
- paytype: [],
362
- printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : [],
363
- privilegeList: [{label: '无优惠', value: '0'}],
364
- // 在向下取整时,保存所有的应交金额
365
- totalcost: 0,
366
- serialShow: false
367
- }
368
- },
369
- props: ['data', 'row', 'floor', 'ceil', 'charge'],
370
- ready () {
371
- this.paytype = this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : []
372
- if (!this.$login.r.includes('免交充值付款')) {
373
- this.paytype = this.paytype.filter((item) => {
374
- return item.label != '免交'
375
- })
376
- }
377
- // this.calOverdue()
378
- this.newOverdue = this.overdueModal.f_old_overdue = this.data.f_overdue
379
- if (this.floor) {
380
- this.totalcost = this.data.f_totalcost
381
- }
382
- document.getElementById('f_collection').focus()
383
- asyncMachineMeterCenter(this)
384
- },
385
- events: {
386
- // 删除Resid数组元素
387
- 'delResid' (val) {
388
- this.resid.$remove({id: val, f_biobid: ''})
389
- // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
390
- },
391
- // 增加Resid数组元素
392
- 'resid' (val) {
393
- this.resid.push({id: val, f_biobid: ''})
394
- }
395
- },
396
- modefiy () {
397
- this.overdueModal.f_new_overdue = ''
398
- this.showOverdueModal = true
399
- },
400
- methods: {
401
- // 校验发票信息
402
- checkInvoiceMsg () {
403
- if (this.data.f_print[0] === '电子发票') {
404
- if (!this.row.f_taxpayer_id) {
405
- this.row.f_taxpayer_id = this.row.f_idnumber
406
- }
407
- if (!this.row.f_paper_name) {
408
- this.row.f_paper_name = this.row.f_user_name
409
- }
410
- if (!this.row.f_address_phone) {
411
- this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
412
- }
413
- if (!this.row.f_email) {
414
- this.row.f_email = this.row.f_email
415
- }
416
- this.eticket_msg = true
417
- } else {
418
- this.confirm()
419
- }
420
- },
421
- confirmOverdue () {
422
- this.breakOverdue = {
423
- f_user_id: this.data.f_user_id,
424
- f_userfiles_id: this.data.f_userfiles_id,
425
- f_userinfo_id: this.data.f_userinfo_id,
426
- f_old_overdue: this.overdueModal.f_old_overdue,
427
- f_new_overdue: this.overdueModal.f_new_overdue,
428
- f_operator: this.$login.f.name,
429
- f_operatorid: this.$login.f.id,
430
- f_orgid: this.$login.f.orgid,
431
- f_orgname: this.$login.f.orgs,
432
- f_depid: this.$login.f.depids,
433
- f_depname: this.$login.f.deps,
434
- f_zoneid: this.$login.f.zoneid,
435
- f_zones: this.$login.f.zones
436
- }
437
- this.showOverdueModal = false
438
- this.newOverdue = this.overdueModal.f_new_overdue
439
- this.isBreakOverdue = (this.overdueModal.f_new_overdue - this.overdueModal.f_old_overdue != 0)
440
- },
441
-
442
- closeOverdue () {
443
- this.showOverdueModal = false
444
- this.editOverdue = null
445
- this.showErrorMsg = false
446
- },
447
- /**
448
- * 用来进行小数相加的工具方法
449
- * @param {*} num1
450
- * @param {*} num2
451
- */
452
- addNum (num1, num2) {
453
- let sq1, sq2, multiple
454
- try {
455
- sq1 = num1.toString().split('.')[1].length
456
- } catch (e) {
457
- sq1 = 0
458
- }
459
- try {
460
- sq2 = num2.toString().split('.')[1].length
461
- } catch (e) {
462
- sq2 = 0
463
- }
464
- multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
465
- return (num1 * multiple + num2 * multiple) / multiple
466
- },
467
- /**
468
- * 用来进行小数相减的工具方法
469
- * @param {*} num1
470
- * @param {*} num2
471
- */
472
- subNum (num1, num2) {
473
- let sq1, sq2, multiple
474
- try {
475
- sq1 = num1.toString().split('.')[1].length
476
- } catch (e) {
477
- sq1 = 0
478
- }
479
- try {
480
- sq2 = num2.toString().split('.')[1].length
481
- } catch (e) {
482
- sq2 = 0
483
- }
484
- multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
485
- return (num1 * multiple - num2 * multiple) / multiple
486
- },
487
- confirm () {
488
- this.eticket_msg = false
489
- // 如果有变更原因说明有变更
490
- if (this.data.f_collection < 0) {
491
- this.$showMessage('收款金额不能小于零!!')
492
- return
493
- }
494
- if (this.charge) {
495
- let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
496
- console.log('===>', inti)
497
- if (this.floor) {
498
- if (inti < -1) {
499
- this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
500
- return
501
- }
502
- } else {
503
- if (inti < 0) {
504
- this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
505
- // this.data.f_collection = this.data.f_totalcost
506
- return
507
- }
508
- }
509
- }
510
- if (this.newOverdue > 0) {
511
- let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
512
- console.log('===>', inti)
513
- if (this.floor) {
514
- if (inti < -1) {
515
- this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
516
- return
517
- }
518
- } else {
519
- if (inti < 0) {
520
- this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
521
- // this.data.f_collection = this.data.f_totalcost
522
- return
523
- }
524
- }
525
- }
526
-
527
- this.data.f_overdue = this.newOverdue
528
- this.data.isBreakOverdue = this.isBreakOverdue
529
- if (this.isBreakOverdue) {
530
- this.data.breakOverdue = this.breakOverdue
531
- }
532
- this.$showMessage(`确定对用户${this.row.f_user_name}进行机表缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
533
- if (res === 'confirm') {
534
- // 先调用付款码支付组件流程
535
- let ss = await this.$refs.paymentcode.flowPath()
536
- this.$refs.paymentcode.paymentCodeShow = false
537
- console.log('付款码操作返回', ss)
538
- if (!ss.result) return
539
- machineChargeGen(this)
540
- }
541
- })
542
- },
543
- calOverdue () {
544
- this.data.f_totalcost = this.data.f_totalcost - (this.data.f_overdue - this.newOverdue)
545
- this.data.f_overdue = this.newOverdue
546
- },
547
- clean () {
548
- this.$dispatch('success', '机表收费', this.data)
549
- this.$info('取消操作')
550
- },
551
- validateBill (val) {
552
- this.validateOk = !val.isOk
553
- this.billData.bill = val.bill
554
- },
555
- printok () {
556
- this.$dispatch('success')
557
- },
558
- checkOverdue () {
559
- this.$nextTick(() => {
560
- this.newOverdue = this.data.f_overdue
561
- this.calOverdue()
562
- })
563
- },
564
- close () {
565
- this.print = false
566
- this.clean()
567
- },
568
- // 根据选择的付款方式 获取优惠列表
569
- async getPrivilegeList () {
570
- // 初始化下拉选择列表
571
- this.privilegeList = [{label: '无优惠', value: '0'}]
572
- // 初始为无优惠
573
- this.data.f_privilege_id = '0'
574
- if (this.data.f_payment && this.data.f_payment.length) {
575
- // 查询条件
576
- let payments = JSON.stringify(this.data.f_payment)
577
- payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
578
- let HttpReset = new HttpResetClass()
579
- let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
580
- data: {
581
- items: 'id,f_privilege_name,f_privilege_type',
582
- tablename: 't_privilege',
583
- 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 = '有效'`,
584
- orderitem: 'id'
585
- }
586
- }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
587
- // 查询结果放到下拉列表
588
- for (let p of privilege.data) {
589
- this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
590
- }
591
- this.privilegeCalculate()
592
- }
593
- },
594
- eticket_toggle () {
595
- this.eticket_show = false
596
- this.$dispatch('success')
597
- },
598
- // 优惠计算
599
- async privilegeCalculate () {
600
- // 初始化减免金额
601
- this.data.f_privilege_money = 0
602
- this.data.f_after_discount = this.data.f_collection
603
- // 判断是否是自定义优惠
604
- if (parseInt(this.data.f_privilege_id)) {
605
- for (let p of this.privilegeList) {
606
- if (p.value == this.data.f_privilege_id && p.type == '自定义') {
607
- this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
608
- if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
609
- this.$showMessage('金额输入格式不正确!')
610
- this.data.f_privilege_money = 0
611
- return
612
- }
613
- if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
614
- this.$showMessage('减免金额不能大于等于收款金额')
615
- this.data.f_privilege_money = 0
616
- return
617
- }
618
- }
619
- }
620
- }
621
- // 优惠方式, 收款 缺一不计算
622
- if (this.data.f_payment && this.data.f_payment.length && parseInt(this.data.f_privilege_id) && this.data.f_collection) {
623
- let c = {
624
- f_privilege_id: this.data.f_privilege_id,
625
- f_collection: this.data.f_collection,
626
- f_privilege_money: this.data.f_privilege_money
627
- }
628
- let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
629
- // 减免金额
630
- this.data.f_privilege_money = privilegeData.data.f_privilege_money
631
- // 减免后收款金额
632
- this.data.f_after_discount = privilegeData.data.f_collection
633
- }
634
- },
635
- async speckText (str) {
636
- var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
637
- await new Audio(url).play()
638
- }
639
- },
640
- watch: {
641
- 'data.f_overdue' (val) {
642
- // this.data.f_last_overdue = this.newOverdue
643
- this.newOverdue = val
644
- },
645
- 'splitAll' (val) {
646
- this.data.f_pregas = this.data.f_pregas - val
647
- },
648
- 'invoice_show_gas' () {
649
- return this.row.f_collection_type === '按气量' ? '是' : '否'
650
- },
651
- 'newOverdue' (val) {
652
- this.data.f_totalcost = (this.data.f_preamount - 0) + (val - 0)
653
- if (this.data.f_totalcost - this.data.f_balance > 0) {
654
- if (this.floor) {
655
- this.data.f_collection = Math.floor(this.data.f_totalcost - this.data.f_balance)
656
- } else if (this.ceil) {
657
- this.data.f_collection = Math.ceil(this.data.f_totalcost - this.data.f_balance)
658
- } else {
659
- this.data.f_collection = this.data.f_totalcost - this.data.f_balance
660
- }
661
- } else {
662
- this.data.f_collection = 0
663
- }
664
- },
665
- 'data.f_payment' (val) {
666
- this.getPrivilegeList()
667
- // 根据付款方式增加业务单号
668
- if (val == '免交') {
669
- this.mjshow = true
670
- } else {
671
- this.mjshow = false
672
- }
673
- },
674
- 'data.f_payment.length' (val) {
675
- console.log('收款方式多选。。', val)
676
- console.log("收款金额",this.data.f_after_discount)
677
- if (val > 1 && !this.data.f_after_discount) {
678
- this.data.f_payment = ['现金缴费']
679
- this.$showAlert('请先输入收款金额', 'warning', 2000)
680
- } else {
681
- this.paymentModel = []
682
-
683
- this.data.f_payment.forEach((res) => {
684
- let temp = {
685
- f_payment: res,
686
- f_money: 0
687
- }
688
- this.paymentModel.push(temp)
689
- })
690
- this.$resetValidation()
691
-
692
- // 获取计算优惠
693
- this.getPrivilegeList()
694
- }
695
- },
696
- async 'data.f_collection' (val) {
697
- if ((this.data.f_totalcost - 0) > (val - 0)) {
698
- if (this.authArr.includes('机表收费语音播报')) {
699
- await this.speckText('请注意,当前收款小于欠费')
700
- }
701
- }
702
- // 没获取优惠之前默认和收款一样,防止获取优惠太慢导致收款金额与实际收款不符
703
- this.data.f_after_discount = this.data.f_collection
704
- // 获取计算优惠
705
- this.getPrivilegeList()
706
- }
707
- },
708
- computed: {
709
- 'islegal' () {
710
- if (this.paymentModel.length > 1 && this.data.f_after_discount) {
711
- let sum = 0
712
- this.paymentModel.forEach((res) => {
713
- sum += (res.f_money - 0)
714
- })
715
- return (this.data.f_after_discount - 0) === (sum - 0)
716
- } else {
717
- return true
718
- }
719
- },
720
- authArr () {
721
- return this.$login.r ? this.$login.r : []
722
- },
723
- curbalance () {
724
- if (((this.data.f_collection - 0) + (this.data.f_balance - 0)) > (this.data.f_totalcost - 0)) {
725
- return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
726
- } else if (this.floor) {
727
- return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
728
- } else {
729
- return 0
730
- }
731
- }
732
- }
733
- }
734
- </script>
1
+ <template>
2
+ <div class="span" style="overflow-y: auto !important;">
3
+ <validator name='v'>
4
+ <form class="form-horizontal">
5
+ <div class="row" style="padding-top: 0.5em;">
6
+ <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'has-error select-error' : '']">
7
+ <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
8
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
9
+ <v-select id="f_payment"
10
+ v-model="f_payment"
11
+ style="width:60%"
12
+ placeholder='请选择'
13
+ multiple
14
+ :value.sync="data.f_payment"
15
+ :options='paytype'
16
+ clear-button
17
+ v-ref:payment>
18
+ </v-select>
19
+ </div>
20
+ <div class="col-sm-4 form-group">
21
+ <label for="f_print" class="font_normal_body">打印格式</label>
22
+
23
+ <v-select id="print"
24
+ v-model="data.f_print"
25
+ placeholder='请选择'
26
+ style="width:60%"
27
+ :value.sync="data.f_print"
28
+ :options='printstyle'
29
+ close-on-select clear-button>
30
+ </v-select>
31
+
32
+ </div>
33
+ <div class="col-sm-4 form-group">
34
+ <label for="f_overdue" class="font_normal_body">违&ensp;约&ensp;金</label>
35
+ <input class="input_search" style="width:60%" type="number" v-model="newOverdue"
36
+ v-scale="[newOverdue,2]" placeholder="违约金"
37
+ disabled>
38
+ <!--<button type="button" name="button" class="btn btn-link" @click="modefiy()" v-if="authArr.includes('滞纳金修改')">修改</button>-->
39
+ </div>
40
+ </div>
41
+ <div class="row" style="padding-top: 0.5em;" >
42
+
43
+ <div class="col-sm-4 form-group">
44
+ <label for="f_pregas" class=" font_normal_body">用&ensp;气&ensp;量</label>
45
+ <input class="input_search" style="width:60%" type="number"
46
+ v-model="data.f_pregas" placeholder="用气量"
47
+ v-scale = "[data.f_pregas, 2]" disabled>
48
+ </div>
49
+ <div class="col-sm-4 form-group">
50
+ <label for="f_preamount" class="font_normal_body">实欠气费</label>
51
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="data.f_preamount"
52
+ v-scale = "[data.f_preamount, 2]"
53
+ placeholder="实欠气费" disabled>
54
+ </div>
55
+
56
+ <div class="col-sm-4 form-group">
57
+ <label for="f_totalcost" class=" font_normal_body">应收金额</label>
58
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_totalcost"
59
+ v-scale = "[data.f_totalcost, 2]" placeholder="应收金额" disabled>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="row" style="padding-top: 0.5em;">
64
+ <div class="col-sm-4 form-group">
65
+ <label for="f_balance" class="font_normal_body">上期结余</label>
66
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_balance"
67
+ v-scale="[data.f_balance,4]" placeholder="上期结余" disabled>
68
+ </div>
69
+ <div class="col-sm-4 form-group">
70
+ <label for="f_overdue" class="font_normal_body">本期结余</label>
71
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance" disabled>
72
+ </div>
73
+ <div class="col-sm-3 form-group" v-if="config.hasfindaReail" :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error select-error' : '']">
74
+ <label for="f_collection" class="font_normal_body">收&emsp;&emsp;款</label>
75
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="data.f_collection"
76
+ v-validate:f_collection='{required: true, dctest: [0, ">=" ]}' v-scale = "[data.f_collection, 2]"
77
+ @mousewheel.native.prevent @keyup.enter="confirm()" :disabled="$refs.givechange.promptText != ''">
78
+ </div>
79
+ <div class="col-sm-4 form-group" v-if="!config.hasfindaReail" :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error select-error' : '']">
80
+ <label for="f_collection" class="font_normal_body">收&emsp;&emsp;款</label>
81
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="data.f_collection"
82
+ v-validate:f_collection='{required: true, dctest: [0, ">=" ]}' v-scale = "[data.f_collection, 2]"
83
+ @mousewheel.native.prevent @keyup.enter="confirm()" :disabled="$refs.givechange.promptText != ''">
84
+ </div>
85
+ <div class="col-sm-1 form-group" v-if="config.hasfindaReail">
86
+ <give-change :curbalance="curbalance" :collection.sync="data.f_collection" v-ref:givechange></give-change>
87
+ </div>
88
+ </div>
89
+
90
+ <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
91
+ <div class="col-sm-4 form-group">
92
+ <label class="font_normal_body">优惠方式</label>
93
+ <v-select v-model="data.f_privilege_id" @blur.native.capture="privilegeCalculate"
94
+ placeholder='请选择'
95
+ :value.sync="data.f_privilege_id"
96
+ :options='privilegeList' clear-button value-single>
97
+ </v-select>
98
+ </div>
99
+ <div class="col-sm-4 form-group">
100
+ <label for="f_preamount" class=" font_normal_body">优惠金额</label>
101
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_privilege_money"
102
+ v-scale="[data.f_privilege_money, 2]" placeholder="优惠金额" disabled>
103
+ </div>
104
+ <div class="col-sm-4 form-group">
105
+ <label for="f_preamount" class=" font_normal_body">实际收款</label>
106
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_after_discount"
107
+ v-scale="[data.f_after_discount, 2]" placeholder="优惠后收款" disabled>
108
+ </div>
109
+ </div>
110
+
111
+ <div class="row" style="padding-top: 0.5em;">
112
+ <div class="col-sm-4 form-group" v-show="row.f_garbage_fee === '是'">
113
+ <label for="f_garbage_fee" class="font_normal_body">垃&ensp;圾&ensp;费</label>
114
+ <input class="input_search" style="width:60%" type="number" v-model="data.f_garbage_fee" disabled>
115
+ </div>
116
+ </div>
117
+
118
+ <div class="row" style="padding-top: 0.5em;">
119
+ <div class="col-sm-4" v-if="!mjshow" >
120
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
121
+ <input class="input_search" style="width:60%" type="text"
122
+ v-model="data.f_serial_number" placeholder="业务单号">
123
+ </div>
124
+ <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
125
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
126
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
127
+ v-model="data.f_serial_number" placeholder="业务单号">
128
+ </div>
129
+ <div class="col-sm-8">
130
+ <label for="f_comments" class="font_normal_body">备&emsp;&emsp;注</label>
131
+ <input class="input_search" style="width:87%" v-model="data.f_comments" placeholder="备注">
132
+ </div>
133
+ </div>
134
+ <div v-if="paymentModel.length >1">
135
+ <div class="row" style="margin-top:10px;">
136
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../static/juxing.png"/><strong
137
+ style="margin-left: 4%">付款明细</strong></p>
138
+ </div>
139
+ <div class="row" style="margin-top:10px;">
140
+ <div class="col-sm-4 " v-for="pay in paymentModel">
141
+ <label class="font_normal_body">{{pay.f_payment}}:</label>
142
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
143
+ </div>
144
+ <div class="col-sm-4 ">
145
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
146
+ </div>
147
+ </div>
148
+ </div>
149
+ </form>
150
+ <validate-bill v-if="hasValidateBill" :data="data" @validate-bill="validateBill"></validate-bill>
151
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" :data='data' @printok="printok" v-ref:printbill></print-bill>
152
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
153
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
154
+ <div class="text-right" style="margin-top: 1%">
155
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
156
+ <payment-code-button :clickable="!$v.valid || validateOk"
157
+ :payment.sync="data.f_payment" :payment-data="paytype"
158
+ @confirm-payment="confirm()">
159
+ </payment-code-button>
160
+ <button class="button_search btn-gn" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk'>确认</button>
161
+ <!--<button class="btn btn-success" @click="confirmUserinfo()" :disabled='!$v.valid'>信息保存</button>-->
162
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
163
+ </div>
164
+ </validator>
165
+ <!--<modal :show.sync="showOverdueModal" v-ref:modal backdrop="false">-->
166
+ <!--<header slot="modal-header" class="modal-header">-->
167
+ <!--<button type="button" class="close" @click="closeOverdue"><span>&times;</span></button>-->
168
+ <!--<h4 class="modal-title">修改滞纳金</h4>-->
169
+ <!--</header>-->
170
+ <!--<article slot="modal-body" class="modal-body">-->
171
+ <!--<validator name='m'>-->
172
+ <!--<form class="form-horizontal">-->
173
+ <!--<div class="row">-->
174
+ <!--<div class="col-sm-6">-->
175
+ <!--<label for="oldOverdue" class="font_normal_body">原违约金</label>-->
176
+ <!--<input type="text" class="input_search" style="width:60%" v-once v-model="overdueModal.f_old_overdue" disabled>-->
177
+ <!--</div>-->
178
+ <!--</div>-->
179
+ <!--<div class="row">-->
180
+ <!--<div class="col-sm-6" :class="[$m.f_new_overdue.required ? 'has-error select-error' : '']">-->
181
+ <!--<label for="newOverdue" class="font_normal_body">新违约金</label>-->
182
+ <!--<input type="text" class="input_search" style="width:60%" v-model="overdueModal.f_new_overdue"-->
183
+ <!--v-validate:f_new_overdue='{required: true}'>-->
184
+ <!--</div>-->
185
+ <!--</div>-->
186
+ <!--</form>-->
187
+ <!--</validator>-->
188
+ <!--</article>-->
189
+
190
+ <!--<footer slot="modal-footer" class="modal-footer">-->
191
+ <!--<button type="button" class="button_search" :disabled='!$m.valid' @click='confirmOverdue()'>确认</button>-->
192
+ <!--<button type="button" class="button_clear" @click='closeOverdue'>取消</button>-->
193
+ <!--</footer>-->
194
+ <!--</modal>-->
195
+ <payment-code v-ref:paymentcode :payment="data.f_payment" :row="row" :money="data.f_after_discount"></payment-code>
196
+ </div>
197
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="机表收费"></upload>
198
+ </template>
199
+ <script>
200
+ import {HttpResetClass} from 'vue-client'
201
+ import MachineChargeService from './plugins/MachineChargeService'
202
+ /**
203
+ *售气收费
204
+ *机表收费组件
205
+ */
206
+
207
+ let asyncMachineMeterCenter = async function (self) {
208
+ await self.$getConfig(self, 'MachineMeterCenter')
209
+ self.data.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
210
+ self.data.f_payment = [self.config.payment]
211
+ self.data.f_use_type = self.config.billType
212
+ self.data.f_bill_type = self.data.f_print
213
+ self.hasValidateBill = self.config.hasBillManage
214
+ }
215
+
216
+ let machineChargeGen = async function (self) {
217
+ try {
218
+ if (!self.model) self.model = {}
219
+ if (self.paymentModel.length === 0) {
220
+ self.paymentModel = [{
221
+ f_payment: self.data.f_payment[0],
222
+ f_money: self.data.f_collection
223
+ }]
224
+ }
225
+
226
+ self.data.payments = self.paymentModel
227
+ console.log("付款多选列表结果:",self.data.payments)
228
+ // 加入扫码盒付款码支付流水号
229
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
230
+ console.log('查看传过来的数据=====================>', self)
231
+ let res = await MachineChargeService.marchineCharge(self.data, self.model, self.row, self.floor)
232
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
233
+ if (localeSustainMoney != null) {
234
+ localeSustainMoney = (localeSustainMoney - 0) + (self.data.f_collection - self.data.f_garbage_fee)
235
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
236
+ }
237
+ let param = []
238
+ for (let row of self.resid) {
239
+ param.push({id: row.id})
240
+ }
241
+ let data = {
242
+ param: param,
243
+ f_blobid: res.data
244
+ }
245
+
246
+ await self.$resetpost('rs/logic/updatefiles', data)
247
+
248
+ // 开始打票
249
+ if (self.config.hasPrint) {
250
+ if (self.data.f_print.indexOf('电子发票') == -1) {
251
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
252
+ if (self.row.f_user_type === '非民用') {
253
+ self.billData.url = 'rs/report/fmy_machine_bill'
254
+ }
255
+ }
256
+ if (self.config.hasBillManage) {
257
+ // 启用发票管理,获取票据管理中的票号并存储记录
258
+ self.data.id = res.data
259
+ self.data.f_bill_type = '机表收费'
260
+ self.data.f_bill_style = self.data.f_print[0]
261
+ self.print = true
262
+ } else {
263
+ // 如果不欠费就用下边的预存收据
264
+ if (self.$parent.$children[0].selecteds) {
265
+ console.log('1111111', self.$parent.$children[0].selecteds)
266
+ if (self.$parent.$children[0].selectedRows === 0) {
267
+ console.log('22222222', self.$parent.$children[0].selectedRows)
268
+ self.billData.url = 'rs/report/pre_sell'
269
+ }
270
+ // 获取选中的handplan的id
271
+ self.data.handid = ''
272
+ self.$parent.$children[0].selecteds.forEach((row, index) => {
273
+ self.data.handid = self.data.handid + "','" + row.handplan_id
274
+ })
275
+ } else {
276
+ console.log('3333333')
277
+ self.billData.url = 'rs/report/pre_sell'
278
+ self.data.handid = ''
279
+ }
280
+ self.data.id = res.data
281
+ self.print = true
282
+ }
283
+ } else if (self.data.f_print[0] === '国税发票') {
284
+ // TODO
285
+ } else if (self.data.f_print[0] === '电子发票') {
286
+ self.eticket_show = true
287
+ await self.$refs.eticketbill.openETicket([res.data], self.row, '是', self.invoice_is_pax, '机表收费')
288
+ // await self.$CommonService.openEticket(res.data, '售气收费')
289
+ // 如果不欠费就用下边的预存收据
290
+ // if (self.$parent.$children[0].selecteds) {
291
+ // if (self.$parent.$children[0].selectedRows === 0) {
292
+ // self.billData.url = 'rs/report/pre_sell'
293
+ // }
294
+ // // 获取选中的handplan的id
295
+ // self.data.handid = ''
296
+ // self.$parent.$children[0].selecteds.forEach((row, index) => {
297
+ // self.data.handid = self.data.handid + "','" + row.handplan_id
298
+ // })
299
+ // } else {
300
+ // self.billData.url = 'rs/report/pre_sell'
301
+ // self.data.handid = ''
302
+ // }
303
+ // self.data.id = res.data
304
+ // self.print = true
305
+ }
306
+ } else {
307
+ self.$dispatch('success', '机表收费确认', self.row, self.data)
308
+ }
309
+ } catch (error) {
310
+ self.$showAlert(error, 'danger', 0)
311
+ self.$dispatch('refresh')
312
+ }
313
+ }
314
+
315
+ export default {
316
+ title: '收费',
317
+ data () {
318
+ return {
319
+ mjshow: false,
320
+ resid: [], // 存放新增的f_files表中id
321
+ config: {
322
+ showupload: true, // 显示上传
323
+ hasPrint: true, // 默认打票
324
+ hasBillManage: false, // 默认不启用发票管理
325
+ hasfindaReail: true, // 默认开启找零功能
326
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
327
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
328
+ payment: '现金缴费'
329
+ },
330
+ paymentModel: [], // 多笔付款方式
331
+ eticket_msg: false,
332
+ eticket_show: false,
333
+ invoice_is_pax: '征税',
334
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
335
+ // 垃圾费
336
+ f_garbage_fee: 0,
337
+ overdueModal: {
338
+ f_old_overdue: 0,
339
+ f_new_overdue: ''
340
+ },
341
+ newOverdue: 0,
342
+ isBreakOverdue: false,
343
+ breakOverdue: {},
344
+
345
+ showErrorMsg: false,
346
+ print: false,
347
+ isConfirm: true,
348
+ show: false,
349
+ count: 0,
350
+ billData: {
351
+ url: 'rs/report/machine_bill',
352
+ bill: ''
353
+ },
354
+
355
+ // 启用发票管理需要对票号进行验证
356
+ hasValidateBill: false,
357
+ validateOk: false,
358
+ handid: '',
359
+ showOverdueModal: false,
360
+ editOverdue: this.$login.r.includes('滞纳金修改'),
361
+ paytype: [],
362
+ printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : [],
363
+ privilegeList: [{label: '无优惠', value: '0'}],
364
+ // 在向下取整时,保存所有的应交金额
365
+ totalcost: 0,
366
+ serialShow: false
367
+ }
368
+ },
369
+ props: ['data', 'row', 'floor', 'ceil', 'charge'],
370
+ ready () {
371
+ this.paytype = this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : []
372
+ if (!this.$login.r.includes('免交充值付款')) {
373
+ this.paytype = this.paytype.filter((item) => {
374
+ return item.label != '免交'
375
+ })
376
+ }
377
+ // this.calOverdue()
378
+ this.newOverdue = this.overdueModal.f_old_overdue = this.data.f_overdue
379
+ if (this.floor) {
380
+ this.totalcost = this.data.f_totalcost
381
+ }
382
+ document.getElementById('f_collection').focus()
383
+ asyncMachineMeterCenter(this)
384
+ },
385
+ events: {
386
+ // 删除Resid数组元素
387
+ 'delResid' (val) {
388
+ this.resid.$remove({id: val, f_biobid: ''})
389
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
390
+ },
391
+ // 增加Resid数组元素
392
+ 'resid' (val) {
393
+ this.resid.push({id: val, f_biobid: ''})
394
+ }
395
+ },
396
+ modefiy () {
397
+ this.overdueModal.f_new_overdue = ''
398
+ this.showOverdueModal = true
399
+ },
400
+ methods: {
401
+ // 校验发票信息
402
+ checkInvoiceMsg () {
403
+ if (this.data.f_print[0] === '电子发票') {
404
+ if (!this.row.f_taxpayer_id) {
405
+ this.row.f_taxpayer_id = this.row.f_idnumber
406
+ }
407
+ if (!this.row.f_paper_name) {
408
+ this.row.f_paper_name = this.row.f_user_name
409
+ }
410
+ if (!this.row.f_address_phone) {
411
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
412
+ }
413
+ if (!this.row.f_email) {
414
+ this.row.f_email = this.row.f_email
415
+ }
416
+ this.eticket_msg = true
417
+ } else {
418
+ this.confirm()
419
+ }
420
+ },
421
+ confirmOverdue () {
422
+ this.breakOverdue = {
423
+ f_user_id: this.data.f_user_id,
424
+ f_userfiles_id: this.data.f_userfiles_id,
425
+ f_userinfo_id: this.data.f_userinfo_id,
426
+ f_old_overdue: this.overdueModal.f_old_overdue,
427
+ f_new_overdue: this.overdueModal.f_new_overdue,
428
+ f_operator: this.$login.f.name,
429
+ f_operatorid: this.$login.f.id,
430
+ f_orgid: this.$login.f.orgid,
431
+ f_orgname: this.$login.f.orgs,
432
+ f_depid: this.$login.f.depids,
433
+ f_depname: this.$login.f.deps,
434
+ f_zoneid: this.$login.f.zoneid,
435
+ f_zones: this.$login.f.zones
436
+ }
437
+ this.showOverdueModal = false
438
+ this.newOverdue = this.overdueModal.f_new_overdue
439
+ this.isBreakOverdue = (this.overdueModal.f_new_overdue - this.overdueModal.f_old_overdue != 0)
440
+ },
441
+
442
+ closeOverdue () {
443
+ this.showOverdueModal = false
444
+ this.editOverdue = null
445
+ this.showErrorMsg = false
446
+ },
447
+ /**
448
+ * 用来进行小数相加的工具方法
449
+ * @param {*} num1
450
+ * @param {*} num2
451
+ */
452
+ addNum (num1, num2) {
453
+ let sq1, sq2, multiple
454
+ try {
455
+ sq1 = num1.toString().split('.')[1].length
456
+ } catch (e) {
457
+ sq1 = 0
458
+ }
459
+ try {
460
+ sq2 = num2.toString().split('.')[1].length
461
+ } catch (e) {
462
+ sq2 = 0
463
+ }
464
+ multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
465
+ return (num1 * multiple + num2 * multiple) / multiple
466
+ },
467
+ /**
468
+ * 用来进行小数相减的工具方法
469
+ * @param {*} num1
470
+ * @param {*} num2
471
+ */
472
+ subNum (num1, num2) {
473
+ let sq1, sq2, multiple
474
+ try {
475
+ sq1 = num1.toString().split('.')[1].length
476
+ } catch (e) {
477
+ sq1 = 0
478
+ }
479
+ try {
480
+ sq2 = num2.toString().split('.')[1].length
481
+ } catch (e) {
482
+ sq2 = 0
483
+ }
484
+ multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
485
+ return (num1 * multiple - num2 * multiple) / multiple
486
+ },
487
+ confirm () {
488
+ this.eticket_msg = false
489
+ // 如果有变更原因说明有变更
490
+ if (this.data.f_collection < 0) {
491
+ this.$showMessage('收款金额不能小于零!!')
492
+ return
493
+ }
494
+ if (this.charge) {
495
+ let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
496
+ console.log('===>', inti)
497
+ if (this.floor) {
498
+ if (inti < -1) {
499
+ this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
500
+ return
501
+ }
502
+ } else {
503
+ if (inti < 0) {
504
+ this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
505
+ // this.data.f_collection = this.data.f_totalcost
506
+ return
507
+ }
508
+ }
509
+ }
510
+ if (this.newOverdue > 0) {
511
+ let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
512
+ console.log('===>', inti)
513
+ if (this.floor) {
514
+ if (inti < -1) {
515
+ this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
516
+ return
517
+ }
518
+ } else {
519
+ if (inti < 0) {
520
+ this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
521
+ // this.data.f_collection = this.data.f_totalcost
522
+ return
523
+ }
524
+ }
525
+ }
526
+
527
+ this.data.f_overdue = this.newOverdue
528
+ this.data.isBreakOverdue = this.isBreakOverdue
529
+ if (this.isBreakOverdue) {
530
+ this.data.breakOverdue = this.breakOverdue
531
+ }
532
+ this.$showMessage(`确定对用户${this.row.f_user_name}进行机表缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
533
+ if (res === 'confirm') {
534
+ // 先调用付款码支付组件流程
535
+ let ss = await this.$refs.paymentcode.flowPath()
536
+ this.$refs.paymentcode.paymentCodeShow = false
537
+ console.log('付款码操作返回', ss)
538
+ if (!ss.result) return
539
+ machineChargeGen(this)
540
+ }
541
+ })
542
+ },
543
+ calOverdue () {
544
+ this.data.f_totalcost = this.data.f_totalcost - (this.data.f_overdue - this.newOverdue)
545
+ this.data.f_overdue = this.newOverdue
546
+ },
547
+ clean () {
548
+ this.$dispatch('success', '机表收费', this.data)
549
+ this.$info('取消操作')
550
+ },
551
+ validateBill (val) {
552
+ this.validateOk = !val.isOk
553
+ this.billData.bill = val.bill
554
+ },
555
+ printok () {
556
+ this.$dispatch('success')
557
+ },
558
+ checkOverdue () {
559
+ this.$nextTick(() => {
560
+ this.newOverdue = this.data.f_overdue
561
+ this.calOverdue()
562
+ })
563
+ },
564
+ close () {
565
+ this.print = false
566
+ this.clean()
567
+ },
568
+ // 根据选择的付款方式 获取优惠列表
569
+ async getPrivilegeList () {
570
+ // 初始化下拉选择列表
571
+ this.privilegeList = [{label: '无优惠', value: '0'}]
572
+ // 初始为无优惠
573
+ this.data.f_privilege_id = '0'
574
+ if (this.data.f_payment && this.data.f_payment.length) {
575
+ // 查询条件
576
+ let payments = JSON.stringify(this.data.f_payment)
577
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
578
+ let HttpReset = new HttpResetClass()
579
+ let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
580
+ data: {
581
+ items: 'id,f_privilege_name,f_privilege_type',
582
+ tablename: 't_privilege',
583
+ 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 = '有效'`,
584
+ orderitem: 'id'
585
+ }
586
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
587
+ // 查询结果放到下拉列表
588
+ for (let p of privilege.data) {
589
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
590
+ }
591
+ this.privilegeCalculate()
592
+ }
593
+ },
594
+ eticket_toggle () {
595
+ this.eticket_show = false
596
+ this.$dispatch('success')
597
+ },
598
+ // 优惠计算
599
+ async privilegeCalculate () {
600
+ // 初始化减免金额
601
+ this.data.f_privilege_money = 0
602
+ this.data.f_after_discount = this.data.f_collection
603
+ // 判断是否是自定义优惠
604
+ if (parseInt(this.data.f_privilege_id)) {
605
+ for (let p of this.privilegeList) {
606
+ if (p.value == this.data.f_privilege_id && p.type == '自定义') {
607
+ this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
608
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
609
+ this.$showMessage('金额输入格式不正确!')
610
+ this.data.f_privilege_money = 0
611
+ return
612
+ }
613
+ if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
614
+ this.$showMessage('减免金额不能大于等于收款金额')
615
+ this.data.f_privilege_money = 0
616
+ return
617
+ }
618
+ }
619
+ }
620
+ }
621
+ // 优惠方式, 收款 缺一不计算
622
+ if (this.data.f_payment && this.data.f_payment.length && parseInt(this.data.f_privilege_id) && this.data.f_collection) {
623
+ let c = {
624
+ f_privilege_id: this.data.f_privilege_id,
625
+ f_collection: this.data.f_collection,
626
+ f_privilege_money: this.data.f_privilege_money
627
+ }
628
+ let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
629
+ // 减免金额
630
+ this.data.f_privilege_money = privilegeData.data.f_privilege_money
631
+ // 减免后收款金额
632
+ this.data.f_after_discount = privilegeData.data.f_collection
633
+ }
634
+ },
635
+ async speckText (str) {
636
+ var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
637
+ await new Audio(url).play()
638
+ }
639
+ },
640
+ watch: {
641
+ 'data.f_overdue' (val) {
642
+ // this.data.f_last_overdue = this.newOverdue
643
+ this.newOverdue = val
644
+ },
645
+ 'splitAll' (val) {
646
+ this.data.f_pregas = this.data.f_pregas - val
647
+ },
648
+ 'invoice_show_gas' () {
649
+ return this.row.f_collection_type === '按气量' ? '是' : '否'
650
+ },
651
+ 'newOverdue' (val) {
652
+ this.data.f_totalcost = (this.data.f_preamount - 0) + (val - 0)
653
+ if (this.data.f_totalcost - this.data.f_balance > 0) {
654
+ if (this.floor) {
655
+ this.data.f_collection = Math.floor(this.data.f_totalcost - this.data.f_balance)
656
+ } else if (this.ceil) {
657
+ this.data.f_collection = Math.ceil(this.data.f_totalcost - this.data.f_balance)
658
+ } else {
659
+ this.data.f_collection = this.data.f_totalcost - this.data.f_balance
660
+ }
661
+ } else {
662
+ this.data.f_collection = 0
663
+ }
664
+ },
665
+ 'data.f_payment' (val) {
666
+ this.getPrivilegeList()
667
+ // 根据付款方式增加业务单号
668
+ if (val == '免交') {
669
+ this.mjshow = true
670
+ } else {
671
+ this.mjshow = false
672
+ }
673
+ },
674
+ 'data.f_payment.length' (val) {
675
+ console.log('收款方式多选。。', val)
676
+ console.log("收款金额",this.data.f_after_discount)
677
+ if (val > 1 && !this.data.f_after_discount) {
678
+ this.data.f_payment = ['现金缴费']
679
+ this.$showAlert('请先输入收款金额', 'warning', 2000)
680
+ } else {
681
+ this.paymentModel = []
682
+
683
+ this.data.f_payment.forEach((res) => {
684
+ let temp = {
685
+ f_payment: res,
686
+ f_money: 0
687
+ }
688
+ this.paymentModel.push(temp)
689
+ })
690
+ this.$resetValidation()
691
+
692
+ // 获取计算优惠
693
+ this.getPrivilegeList()
694
+ }
695
+ },
696
+ async 'data.f_collection' (val) {
697
+ if ((this.data.f_totalcost - 0) > (val - 0)) {
698
+ if (this.authArr.includes('机表收费语音播报')) {
699
+ await this.speckText('请注意,当前收款小于欠费')
700
+ }
701
+ }
702
+ // 没获取优惠之前默认和收款一样,防止获取优惠太慢导致收款金额与实际收款不符
703
+ this.data.f_after_discount = this.data.f_collection
704
+ // 获取计算优惠
705
+ this.getPrivilegeList()
706
+ }
707
+ },
708
+ computed: {
709
+ 'islegal' () {
710
+ if (this.paymentModel.length > 1 && this.data.f_after_discount) {
711
+ let sum = 0
712
+ this.paymentModel.forEach((res) => {
713
+ sum += (res.f_money - 0)
714
+ })
715
+ return (this.data.f_after_discount - 0) === (sum - 0)
716
+ } else {
717
+ return true
718
+ }
719
+ },
720
+ authArr () {
721
+ return this.$login.r ? this.$login.r : []
722
+ },
723
+ curbalance () {
724
+ if (((this.data.f_collection - 0) + (this.data.f_balance - 0)) > (this.data.f_totalcost - 0)) {
725
+ return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
726
+ } else if (this.floor) {
727
+ return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
728
+ } else {
729
+ return 0
730
+ }
731
+ }
732
+ }
733
+ }
734
+ </script>