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,676 +1,676 @@
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
- :value.sync="data.f_payment"
14
- :options='paytype'
15
- v-ref:payment
16
- close-on-select clear-button>
17
- </v-select>
18
-
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" style="color: #CA2C16">上期结余</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" style="color: #CA2C16">本期结余</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" style="color: #CA2C16">收&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" style="color: #CA2C16">收&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
- </form>
135
- <validate-bill v-if="hasValidateBill" :data="data" @validate-bill="validateBill"></validate-bill>
136
- <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" :data='data' @printok="printok" v-ref:printbill></print-bill>
137
- <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
138
- <eticket-modal :show="eticket_msg" @close-modal-show="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
139
- <div class="text-right" style="margin-top: 1%">
140
- <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
141
- <payment-code-button :clickable="!$v.valid || validateOk"
142
- :payment.sync="data.f_payment" :payment-data="paytype"
143
- @confirm-payment="confirm()">
144
- </payment-code-button>
145
- <button class="button_search btn-gn" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk'>确认</button>
146
- <!--<button class="btn btn-success" @click="confirmUserinfo()" :disabled='!$v.valid'>信息保存</button>-->
147
- <button class="button_clear btn-gn" @click="clean()">取消</button>
148
- </div>
149
- </validator>
150
- <!--<modal :show.sync="showOverdueModal" v-ref:modal backdrop="false">-->
151
- <!--<header slot="modal-header" class="modal-header">-->
152
- <!--<button type="button" class="close" @click="closeOverdue"><span>&times;</span></button>-->
153
- <!--<h4 class="modal-title">修改违约金</h4>-->
154
- <!--</header>-->
155
- <!--<article slot="modal-body" class="modal-body">-->
156
- <!--<validator name='m'>-->
157
- <!--<form class="form-horizontal">-->
158
- <!--<div class="row">-->
159
- <!--<div class="col-sm-6">-->
160
- <!--<label for="oldOverdue" class="font_normal_body">原违约金</label>-->
161
- <!--<input type="text" class="input_search" style="width:60%" v-once v-model="overdueModal.f_old_overdue" disabled>-->
162
- <!--</div>-->
163
- <!--</div>-->
164
- <!--<div class="row">-->
165
- <!--<div class="col-sm-6" :class="[$m.f_new_overdue.required ? 'has-error select-error' : '']">-->
166
- <!--<label for="newOverdue" class="font_normal_body">新违约金</label>-->
167
- <!--<input type="text" class="input_search" style="width:60%" v-model="overdueModal.f_new_overdue"-->
168
- <!--v-validate:f_new_overdue='{required: true}'>-->
169
- <!--</div>-->
170
- <!--</div>-->
171
- <!--</form>-->
172
- <!--</validator>-->
173
- <!--</article>-->
174
-
175
- <!--<footer slot="modal-footer" class="modal-footer">-->
176
- <!--<button type="button" class="button_search" :disabled='!$m.valid' @click='confirmOverdue()'>确认</button>-->
177
- <!--<button type="button" class="button_clear" @click='closeOverdue'>取消</button>-->
178
- <!--</footer>-->
179
- <!--</modal>-->
180
- <payment-code v-ref:paymentcode :payment="data.f_payment" :row="row" :money="data.f_after_discount"></payment-code>
181
- </div>
182
- <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="机表收费"></upload>
183
- </template>
184
- <script>
185
- import {HttpResetClass} from 'vue-client'
186
-
187
- /**
188
- *售气收费
189
- *机表收费组件
190
- */
191
-
192
- let asyncMachineMeterCenter = async function (self) {
193
- await self.$getConfig(self, 'MachineMeterCenter')
194
- self.data.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
195
- self.data.f_payment = [self.config.payment]
196
- self.data.f_use_type = self.config.billType
197
- self.data.f_bill_type = self.data.f_print
198
- self.hasValidateBill = self.config.hasBillManage
199
- }
200
-
201
- let machineChargeGen = async function (self) {
202
- try {
203
- if (!self.model) self.model = {}
204
- // 加入扫码盒付款码支付流水号
205
- self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
206
- console.log('查看传过来的数据=====================>', self)
207
- let res = await self.$MachineChargeService.marchineCharge(self.data, self.model, self.row, self.floor)
208
- let localeSustainMoney = window.localStorage.getItem('sustainMoney')
209
- if (localeSustainMoney != null) {
210
- localeSustainMoney = (localeSustainMoney - 0) + (self.data.f_collection - self.data.f_garbage_fee)
211
- window.localStorage.setItem('sustainMoney', localeSustainMoney)
212
- }
213
- let param = []
214
- for (let row of self.resid) {
215
- param.push({id: row.id})
216
- }
217
- let data = {
218
- param: param,
219
- f_blobid: res.data
220
- }
221
-
222
- await self.$resetpost('rs/logic/updatefiles', data)
223
-
224
- // 开始打票
225
- if (self.config.hasPrint) {
226
- if (self.data.f_print.indexOf('电子发票') == -1) {
227
- if (self.config.hasBillManage) {
228
- // 启用发票管理,获取票据管理中的票号并存储记录
229
- self.data.id = res.data
230
- self.data.f_bill_type = '机表收费'
231
- self.data.f_bill_style = self.data.f_print[0]
232
- self.print = true
233
- } else {
234
- // 如果不欠费就用下边的预存收据
235
- // console.log('self.$parent.$children', self.$parent.$children)
236
- if (self.$parent.$children[0].selecteds) {
237
- console.log('1111111', self.$parent.$children[0].selecteds)
238
- if (self.$parent.$children[0].selectedRows === 0) {
239
- console.log('22222222', self.$parent.$children[0].selectedRows)
240
- self.billData.url = 'rs/report/pre_sell'
241
- }
242
- // 获取选中的handplan的id
243
- self.data.handid = ''
244
- self.$parent.$children[0].selecteds.forEach((row, index) => {
245
- self.data.handid = self.data.handid + "','" + row.handplan_id
246
- })
247
- if (self.data.f_preamount > 0) {
248
- self.billData.url = 'rs/report/machine_bill'
249
- }
250
- } else {
251
- console.log('3333333')
252
- self.billData.url = 'rs/report/pre_sell'
253
- self.data.handid = ''
254
- }
255
- self.data.id = res.data
256
- self.print = true
257
- }
258
- } else if (self.data.f_print[0] === '国税发票') {
259
- // TODO
260
- } else if (self.data.f_print[0] === '电子发票') {
261
- self.eticket_show = true
262
- await self.$refs.eticketbill.openETicket([res.data], self.row, '机表收费')
263
- // await self.$CommonService.openEticket(res.data, '售气收费')
264
- // 如果不欠费就用下边的预存收据
265
- // if (self.$parent.$children[0].selecteds) {
266
- // if (self.$parent.$children[0].selectedRows === 0) {
267
- // self.billData.url = 'rs/report/pre_sell'
268
- // }
269
- // // 获取选中的handplan的id
270
- // self.data.handid = ''
271
- // self.$parent.$children[0].selecteds.forEach((row, index) => {
272
- // self.data.handid = self.data.handid + "','" + row.handplan_id
273
- // })
274
- // } else {
275
- // self.billData.url = 'rs/report/pre_sell'
276
- // self.data.handid = ''
277
- // }
278
- // self.data.id = res.data
279
- // self.print = true
280
- }
281
- } else {
282
- self.$dispatch('success', '机表收费确认', self.row, self.data)
283
- }
284
- } catch (error) {
285
- self.$showAlert(error, 'danger', 0)
286
- self.$dispatch('refresh')
287
- }
288
- }
289
-
290
- export default {
291
- title: '收费',
292
- data () {
293
- return {
294
- mjshow: false,
295
- resid: [], // 存放新增的f_files表中id
296
- config: {
297
- showupload: true, // 显示上传
298
- hasPrint: true, // 默认打票
299
- hasBillManage: false, // 默认不启用发票管理
300
- hasfindaReail: true, // 默认开启找零功能
301
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
302
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
303
- payment: '现金缴费'
304
- },
305
- eticket_msg: false,
306
- eticket_show: false,
307
- invoice_is_pax: '征税',
308
- is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
309
- // 垃圾费
310
- f_garbage_fee: 0,
311
- overdueModal: {
312
- f_old_overdue: 0,
313
- f_new_overdue: ''
314
- },
315
- newOverdue: 0,
316
- isBreakOverdue: false,
317
- breakOverdue: {},
318
-
319
- showErrorMsg: false,
320
- print: false,
321
- isConfirm: true,
322
- show: false,
323
- count: 0,
324
- billData: {
325
- url: 'rs/report/machine_bill',
326
- bill: ''
327
- },
328
-
329
- // 启用发票管理需要对票号进行验证
330
- hasValidateBill: false,
331
- validateOk: false,
332
- handid: '',
333
- showOverdueModal: false,
334
- jurisdiction: this.$login.r,
335
- editOverdue: this.$login.r.includes('违约金修改'),
336
- paytype: [],
337
- printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : [],
338
- privilegeList: [{label: '无优惠', value: '0'}],
339
- // 在向下取整时,保存所有的应交金额
340
- totalcost: 0,
341
- serialShow: false
342
- }
343
- },
344
- props: ['data', 'row', 'floor', 'ceil', 'charge'],
345
- ready () {
346
- this.paytype = this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : []
347
- if (!this.$login.r.includes('免交充值付款')) {
348
- this.paytype = this.paytype.filter((item) => {
349
- return item.label != '免交'
350
- })
351
- }
352
- // this.calOverdue()
353
- this.newOverdue = this.overdueModal.f_old_overdue = this.data.f_overdue
354
- if (this.floor || this.ceil) {
355
- this.totalcost = this.data.f_totalcost
356
- }
357
- document.getElementById('f_collection').focus()
358
- asyncMachineMeterCenter(this)
359
- },
360
- events: {
361
- // 删除Resid数组元素
362
- 'delResid' (val) {
363
- this.resid.$remove({id: val, f_biobid: ''})
364
- // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
365
- },
366
- // 增加Resid数组元素
367
- 'resid' (val) {
368
- this.resid.push({id: val, f_biobid: ''})
369
- }
370
- },
371
- modefiy () {
372
- this.overdueModal.f_new_overdue = ''
373
- this.showOverdueModal = true
374
- },
375
- methods: {
376
- // 校验发票信息
377
- checkInvoiceMsg () {
378
- if (this.data.f_print[0] === '电子发票') {
379
- if (!this.row.f_taxpayer_id) {
380
- this.row.f_taxpayer_id = this.row.f_idnumber
381
- }
382
- if (!this.row.f_paper_name) {
383
- this.row.f_paper_name = this.row.f_user_name
384
- }
385
- if (!this.row.f_address_phone) {
386
- this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
387
- }
388
- if (!this.row.f_email) {
389
- this.row.f_email = this.row.f_email
390
- }
391
- this.eticket_msg = true
392
- } else {
393
- this.confirm()
394
- }
395
- },
396
- confirmOverdue () {
397
- this.breakOverdue = {
398
- f_user_id: this.data.f_user_id,
399
- f_userfiles_id: this.data.f_userfiles_id,
400
- f_userinfo_id: this.data.f_userinfo_id,
401
- f_old_overdue: this.overdueModal.f_old_overdue,
402
- f_new_overdue: this.overdueModal.f_new_overdue,
403
- f_operator: this.$login.f.name,
404
- f_operatorid: this.$login.f.id,
405
- f_orgid: this.$login.f.orgid,
406
- f_orgname: this.$login.f.orgs,
407
- f_depid: this.$login.f.depids,
408
- f_depname: this.$login.f.deps,
409
- f_zoneid: this.$login.f.zoneid,
410
- f_zones: this.$login.f.zones
411
- }
412
- this.showOverdueModal = false
413
- this.newOverdue = this.overdueModal.f_new_overdue
414
- this.isBreakOverdue = (this.overdueModal.f_new_overdue - this.overdueModal.f_old_overdue != 0)
415
- },
416
-
417
- closeOverdue () {
418
- this.showOverdueModal = false
419
- this.editOverdue = null
420
- this.showErrorMsg = false
421
- },
422
- /**
423
- * 用来进行小数相加的工具方法
424
- * @param {*} num1
425
- * @param {*} num2
426
- */
427
- addNum (num1, num2) {
428
- let sq1, sq2, multiple
429
- try {
430
- sq1 = num1.toString().split('.')[1].length
431
- } catch (e) {
432
- sq1 = 0
433
- }
434
- try {
435
- sq2 = num2.toString().split('.')[1].length
436
- } catch (e) {
437
- sq2 = 0
438
- }
439
- multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
440
- return (num1 * multiple + num2 * multiple) / multiple
441
- },
442
- /**
443
- * 用来进行小数相减的工具方法
444
- * @param {*} num1
445
- * @param {*} num2
446
- */
447
- subNum (num1, num2) {
448
- let sq1, sq2, multiple
449
- try {
450
- sq1 = num1.toString().split('.')[1].length
451
- } catch (e) {
452
- sq1 = 0
453
- }
454
- try {
455
- sq2 = num2.toString().split('.')[1].length
456
- } catch (e) {
457
- sq2 = 0
458
- }
459
- multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
460
- return (num1 * multiple - num2 * multiple) / multiple
461
- },
462
- confirm () {
463
- this.eticket_msg = false
464
- // 如果有变更原因说明有变更
465
- if (this.data.f_collection < 0) {
466
- this.$showMessage('收款金额不能小于零!!')
467
- return
468
- }
469
- if (this.charge || !this.jurisdiction.includes('单条欠费部分缴费')) {
470
- // console.log('单条欠费部分缴费', this.data.f_collection, this.data.f_balance ,this.data.f_totalcost)
471
- // console.log('单条欠费部分缴费11', this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost))
472
- let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
473
- console.log('===>', inti)
474
- if (this.floor) {
475
- if (inti < -1) {
476
- this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
477
- return
478
- }
479
- } else {
480
- if (inti < 0) {
481
- this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
482
- // this.data.f_collection = this.data.f_totalcost
483
- return
484
- }
485
- }
486
- }
487
- if (this.newOverdue > 0) {
488
- let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
489
- console.log('===>', inti)
490
- if (this.floor) {
491
- if (inti < -1) {
492
- this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
493
- return
494
- }
495
- } else {
496
- if (inti < 0) {
497
- this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
498
- // this.data.f_collection = this.data.f_totalcost
499
- return
500
- }
501
- }
502
- }
503
-
504
- this.data.f_overdue = this.newOverdue
505
- this.data.isBreakOverdue = this.isBreakOverdue
506
- if (this.isBreakOverdue) {
507
- this.data.breakOverdue = this.breakOverdue
508
- }
509
- this.$showMessage(`确定对用户${this.row.f_user_name}进行机表缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
510
- if (res === 'confirm') {
511
- // 先调用付款码支付组件流程
512
- let ss = await this.$refs.paymentcode.flowPath()
513
- this.$refs.paymentcode.paymentCodeShow = false
514
- console.log('付款码操作返回', ss)
515
- if (!ss.result) return
516
- machineChargeGen(this)
517
- }
518
- })
519
- },
520
- calOverdue () {
521
- this.data.f_totalcost = this.data.f_totalcost - (this.data.f_overdue - this.newOverdue)
522
- this.data.f_overdue = this.newOverdue
523
- },
524
- clean () {
525
- this.$dispatch('success', '机表收费', this.data)
526
- this.$info('取消操作')
527
- },
528
- validateBill (val) {
529
- this.validateOk = !val.isOk
530
- this.billData.bill = val.bill
531
- },
532
- printok () {
533
- this.$dispatch('success')
534
- },
535
- checkOverdue () {
536
- this.$nextTick(() => {
537
- this.newOverdue = this.data.f_overdue
538
- this.calOverdue()
539
- })
540
- },
541
- close () {
542
- this.print = false
543
- this.clean()
544
- },
545
- // 根据选择的付款方式 获取优惠列表
546
- async getPrivilegeList () {
547
- // 初始化下拉选择列表
548
- this.privilegeList = [{label: '无优惠', value: '0'}]
549
- // 初始为无优惠
550
- this.data.f_privilege_id = '0'
551
- if (this.data.f_payment && this.data.f_payment.length) {
552
- // 查询条件
553
- let payments = JSON.stringify(this.data.f_payment)
554
- payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
555
- let HttpReset = new HttpResetClass()
556
- let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
557
- data: {
558
- items: 'id,f_privilege_name,f_privilege_type',
559
- tablename: 't_privilege',
560
- 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 = '有效'`,
561
- orderitem: 'id'
562
- }
563
- }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
564
- // 查询结果放到下拉列表
565
- for (let p of privilege.data) {
566
- this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
567
- }
568
- this.privilegeCalculate()
569
- }
570
- },
571
- eticket_toggle () {
572
- this.eticket_show = false
573
- this.$dispatch('success')
574
- },
575
- // 优惠计算
576
- async privilegeCalculate () {
577
- // 初始化减免金额
578
- this.data.f_privilege_money = 0
579
- this.data.f_after_discount = this.data.f_collection
580
- // 判断是否是自定义优惠
581
- if (parseInt(this.data.f_privilege_id)) {
582
- for (let p of this.privilegeList) {
583
- if (p.value == this.data.f_privilege_id && p.type == '自定义') {
584
- this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
585
- if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
586
- this.$showMessage('金额输入格式不正确!')
587
- this.data.f_privilege_money = 0
588
- return
589
- }
590
- if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
591
- this.$showMessage('减免金额不能大于等于收款金额')
592
- this.data.f_privilege_money = 0
593
- return
594
- }
595
- }
596
- }
597
- }
598
- // 优惠方式, 收款 缺一不计算
599
- if (this.data.f_payment && this.data.f_payment.length && parseInt(this.data.f_privilege_id) && this.data.f_collection) {
600
- let c = {
601
- f_privilege_id: this.data.f_privilege_id,
602
- f_collection: this.data.f_collection,
603
- f_privilege_money: this.data.f_privilege_money
604
- }
605
- let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
606
- // 减免金额
607
- this.data.f_privilege_money = privilegeData.data.f_privilege_money
608
- // 减免后收款金额
609
- this.data.f_after_discount = privilegeData.data.f_collection
610
- }
611
- },
612
- async speckText (str) {
613
- var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
614
- await new Audio(url).play()
615
- }
616
- },
617
- watch: {
618
- 'data.f_overdue' (val) {
619
- // this.data.f_last_overdue = this.newOverdue
620
- this.newOverdue = val
621
- },
622
- 'splitAll' (val) {
623
- this.data.f_pregas = this.data.f_pregas - val
624
- },
625
- 'invoice_show_gas' () {
626
- return this.row.f_collection_type === '按气量' ? '是' : '否'
627
- },
628
- 'newOverdue' (val) {
629
- this.data.f_totalcost = (this.data.f_preamount - 0) + (val - 0)
630
- if (this.data.f_totalcost - this.data.f_balance > 0) {
631
- if (this.floor) {
632
- this.data.f_collection = Math.floor(this.data.f_totalcost - this.data.f_balance)
633
- } else if (this.ceil) {
634
- this.data.f_collection = Math.ceil(this.data.f_totalcost - this.data.f_balance)
635
- } else {
636
- this.data.f_collection = this.data.f_totalcost - this.data.f_balance
637
- }
638
- } else {
639
- this.data.f_collection = 0
640
- }
641
- },
642
- 'data.f_payment' (val) {
643
- this.getPrivilegeList()
644
- // 根据付款方式增加业务单号
645
- if (val == '免交') {
646
- this.mjshow = true
647
- } else {
648
- this.mjshow = false
649
- }
650
- },
651
- async 'data.f_collection' (val) {
652
- if ((this.data.f_totalcost - 0) > (val - 0)) {
653
- if (this.authArr.includes('机表收费语音播报')) {
654
- await this.speckText('请注意,当前收款小于欠费')
655
- }
656
- }
657
- // 获取计算优惠
658
- this.getPrivilegeList()
659
- }
660
- },
661
- computed: {
662
- authArr () {
663
- return this.$login.r ? this.$login.r : []
664
- },
665
- curbalance () {
666
- if (((this.data.f_collection - 0) + (this.data.f_balance - 0)) > (this.data.f_totalcost - 0)) {
667
- return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
668
- } else if (this.floor) {
669
- return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
670
- } else {
671
- return 0
672
- }
673
- }
674
- }
675
- }
676
- </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
+ :value.sync="data.f_payment"
14
+ :options='paytype'
15
+ v-ref:payment
16
+ close-on-select clear-button>
17
+ </v-select>
18
+
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" style="color: #CA2C16">上期结余</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" style="color: #CA2C16">本期结余</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" style="color: #CA2C16">收&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" style="color: #CA2C16">收&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
+ </form>
135
+ <validate-bill v-if="hasValidateBill" :data="data" @validate-bill="validateBill"></validate-bill>
136
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" :data='data' @printok="printok" v-ref:printbill></print-bill>
137
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
138
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
139
+ <div class="text-right" style="margin-top: 1%">
140
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
141
+ <payment-code-button :clickable="!$v.valid || validateOk"
142
+ :payment.sync="data.f_payment" :payment-data="paytype"
143
+ @confirm-payment="confirm()">
144
+ </payment-code-button>
145
+ <button class="button_search btn-gn" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk'>确认</button>
146
+ <!--<button class="btn btn-success" @click="confirmUserinfo()" :disabled='!$v.valid'>信息保存</button>-->
147
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
148
+ </div>
149
+ </validator>
150
+ <!--<modal :show.sync="showOverdueModal" v-ref:modal backdrop="false">-->
151
+ <!--<header slot="modal-header" class="modal-header">-->
152
+ <!--<button type="button" class="close" @click="closeOverdue"><span>&times;</span></button>-->
153
+ <!--<h4 class="modal-title">修改违约金</h4>-->
154
+ <!--</header>-->
155
+ <!--<article slot="modal-body" class="modal-body">-->
156
+ <!--<validator name='m'>-->
157
+ <!--<form class="form-horizontal">-->
158
+ <!--<div class="row">-->
159
+ <!--<div class="col-sm-6">-->
160
+ <!--<label for="oldOverdue" class="font_normal_body">原违约金</label>-->
161
+ <!--<input type="text" class="input_search" style="width:60%" v-once v-model="overdueModal.f_old_overdue" disabled>-->
162
+ <!--</div>-->
163
+ <!--</div>-->
164
+ <!--<div class="row">-->
165
+ <!--<div class="col-sm-6" :class="[$m.f_new_overdue.required ? 'has-error select-error' : '']">-->
166
+ <!--<label for="newOverdue" class="font_normal_body">新违约金</label>-->
167
+ <!--<input type="text" class="input_search" style="width:60%" v-model="overdueModal.f_new_overdue"-->
168
+ <!--v-validate:f_new_overdue='{required: true}'>-->
169
+ <!--</div>-->
170
+ <!--</div>-->
171
+ <!--</form>-->
172
+ <!--</validator>-->
173
+ <!--</article>-->
174
+
175
+ <!--<footer slot="modal-footer" class="modal-footer">-->
176
+ <!--<button type="button" class="button_search" :disabled='!$m.valid' @click='confirmOverdue()'>确认</button>-->
177
+ <!--<button type="button" class="button_clear" @click='closeOverdue'>取消</button>-->
178
+ <!--</footer>-->
179
+ <!--</modal>-->
180
+ <payment-code v-ref:paymentcode :payment="data.f_payment" :row="row" :money="data.f_after_discount"></payment-code>
181
+ </div>
182
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="机表收费"></upload>
183
+ </template>
184
+ <script>
185
+ import {HttpResetClass} from 'vue-client'
186
+
187
+ /**
188
+ *售气收费
189
+ *机表收费组件
190
+ */
191
+
192
+ let asyncMachineMeterCenter = async function (self) {
193
+ await self.$getConfig(self, 'MachineMeterCenter')
194
+ self.data.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
195
+ self.data.f_payment = [self.config.payment]
196
+ self.data.f_use_type = self.config.billType
197
+ self.data.f_bill_type = self.data.f_print
198
+ self.hasValidateBill = self.config.hasBillManage
199
+ }
200
+
201
+ let machineChargeGen = async function (self) {
202
+ try {
203
+ if (!self.model) self.model = {}
204
+ // 加入扫码盒付款码支付流水号
205
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
206
+ console.log('查看传过来的数据=====================>', self)
207
+ let res = await self.$MachineChargeService.marchineCharge(self.data, self.model, self.row, self.floor)
208
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
209
+ if (localeSustainMoney != null) {
210
+ localeSustainMoney = (localeSustainMoney - 0) + (self.data.f_collection - self.data.f_garbage_fee)
211
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
212
+ }
213
+ let param = []
214
+ for (let row of self.resid) {
215
+ param.push({id: row.id})
216
+ }
217
+ let data = {
218
+ param: param,
219
+ f_blobid: res.data
220
+ }
221
+
222
+ await self.$resetpost('rs/logic/updatefiles', data)
223
+
224
+ // 开始打票
225
+ if (self.config.hasPrint) {
226
+ if (self.data.f_print.indexOf('电子发票') == -1) {
227
+ if (self.config.hasBillManage) {
228
+ // 启用发票管理,获取票据管理中的票号并存储记录
229
+ self.data.id = res.data
230
+ self.data.f_bill_type = '机表收费'
231
+ self.data.f_bill_style = self.data.f_print[0]
232
+ self.print = true
233
+ } else {
234
+ // 如果不欠费就用下边的预存收据
235
+ // console.log('self.$parent.$children', self.$parent.$children)
236
+ if (self.$parent.$children[0].selecteds) {
237
+ console.log('1111111', self.$parent.$children[0].selecteds)
238
+ if (self.$parent.$children[0].selectedRows === 0) {
239
+ console.log('22222222', self.$parent.$children[0].selectedRows)
240
+ self.billData.url = 'rs/report/pre_sell'
241
+ }
242
+ // 获取选中的handplan的id
243
+ self.data.handid = ''
244
+ self.$parent.$children[0].selecteds.forEach((row, index) => {
245
+ self.data.handid = self.data.handid + "','" + row.handplan_id
246
+ })
247
+ if (self.data.f_preamount > 0) {
248
+ self.billData.url = 'rs/report/machine_bill'
249
+ }
250
+ } else {
251
+ console.log('3333333')
252
+ self.billData.url = 'rs/report/pre_sell'
253
+ self.data.handid = ''
254
+ }
255
+ self.data.id = res.data
256
+ self.print = true
257
+ }
258
+ } else if (self.data.f_print[0] === '国税发票') {
259
+ // TODO
260
+ } else if (self.data.f_print[0] === '电子发票') {
261
+ self.eticket_show = true
262
+ await self.$refs.eticketbill.openETicket([res.data], self.row, '机表收费')
263
+ // await self.$CommonService.openEticket(res.data, '售气收费')
264
+ // 如果不欠费就用下边的预存收据
265
+ // if (self.$parent.$children[0].selecteds) {
266
+ // if (self.$parent.$children[0].selectedRows === 0) {
267
+ // self.billData.url = 'rs/report/pre_sell'
268
+ // }
269
+ // // 获取选中的handplan的id
270
+ // self.data.handid = ''
271
+ // self.$parent.$children[0].selecteds.forEach((row, index) => {
272
+ // self.data.handid = self.data.handid + "','" + row.handplan_id
273
+ // })
274
+ // } else {
275
+ // self.billData.url = 'rs/report/pre_sell'
276
+ // self.data.handid = ''
277
+ // }
278
+ // self.data.id = res.data
279
+ // self.print = true
280
+ }
281
+ } else {
282
+ self.$dispatch('success', '机表收费确认', self.row, self.data)
283
+ }
284
+ } catch (error) {
285
+ self.$showAlert(error, 'danger', 0)
286
+ self.$dispatch('refresh')
287
+ }
288
+ }
289
+
290
+ export default {
291
+ title: '收费',
292
+ data () {
293
+ return {
294
+ mjshow: false,
295
+ resid: [], // 存放新增的f_files表中id
296
+ config: {
297
+ showupload: true, // 显示上传
298
+ hasPrint: true, // 默认打票
299
+ hasBillManage: false, // 默认不启用发票管理
300
+ hasfindaReail: true, // 默认开启找零功能
301
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
302
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
303
+ payment: '现金缴费'
304
+ },
305
+ eticket_msg: false,
306
+ eticket_show: false,
307
+ invoice_is_pax: '征税',
308
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
309
+ // 垃圾费
310
+ f_garbage_fee: 0,
311
+ overdueModal: {
312
+ f_old_overdue: 0,
313
+ f_new_overdue: ''
314
+ },
315
+ newOverdue: 0,
316
+ isBreakOverdue: false,
317
+ breakOverdue: {},
318
+
319
+ showErrorMsg: false,
320
+ print: false,
321
+ isConfirm: true,
322
+ show: false,
323
+ count: 0,
324
+ billData: {
325
+ url: 'rs/report/machine_bill',
326
+ bill: ''
327
+ },
328
+
329
+ // 启用发票管理需要对票号进行验证
330
+ hasValidateBill: false,
331
+ validateOk: false,
332
+ handid: '',
333
+ showOverdueModal: false,
334
+ jurisdiction: this.$login.r,
335
+ editOverdue: this.$login.r.includes('违约金修改'),
336
+ paytype: [],
337
+ printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : [],
338
+ privilegeList: [{label: '无优惠', value: '0'}],
339
+ // 在向下取整时,保存所有的应交金额
340
+ totalcost: 0,
341
+ serialShow: false
342
+ }
343
+ },
344
+ props: ['data', 'row', 'floor', 'ceil', 'charge'],
345
+ ready () {
346
+ this.paytype = this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : []
347
+ if (!this.$login.r.includes('免交充值付款')) {
348
+ this.paytype = this.paytype.filter((item) => {
349
+ return item.label != '免交'
350
+ })
351
+ }
352
+ // this.calOverdue()
353
+ this.newOverdue = this.overdueModal.f_old_overdue = this.data.f_overdue
354
+ if (this.floor || this.ceil) {
355
+ this.totalcost = this.data.f_totalcost
356
+ }
357
+ document.getElementById('f_collection').focus()
358
+ asyncMachineMeterCenter(this)
359
+ },
360
+ events: {
361
+ // 删除Resid数组元素
362
+ 'delResid' (val) {
363
+ this.resid.$remove({id: val, f_biobid: ''})
364
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
365
+ },
366
+ // 增加Resid数组元素
367
+ 'resid' (val) {
368
+ this.resid.push({id: val, f_biobid: ''})
369
+ }
370
+ },
371
+ modefiy () {
372
+ this.overdueModal.f_new_overdue = ''
373
+ this.showOverdueModal = true
374
+ },
375
+ methods: {
376
+ // 校验发票信息
377
+ checkInvoiceMsg () {
378
+ if (this.data.f_print[0] === '电子发票') {
379
+ if (!this.row.f_taxpayer_id) {
380
+ this.row.f_taxpayer_id = this.row.f_idnumber
381
+ }
382
+ if (!this.row.f_paper_name) {
383
+ this.row.f_paper_name = this.row.f_user_name
384
+ }
385
+ if (!this.row.f_address_phone) {
386
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
387
+ }
388
+ if (!this.row.f_email) {
389
+ this.row.f_email = this.row.f_email
390
+ }
391
+ this.eticket_msg = true
392
+ } else {
393
+ this.confirm()
394
+ }
395
+ },
396
+ confirmOverdue () {
397
+ this.breakOverdue = {
398
+ f_user_id: this.data.f_user_id,
399
+ f_userfiles_id: this.data.f_userfiles_id,
400
+ f_userinfo_id: this.data.f_userinfo_id,
401
+ f_old_overdue: this.overdueModal.f_old_overdue,
402
+ f_new_overdue: this.overdueModal.f_new_overdue,
403
+ f_operator: this.$login.f.name,
404
+ f_operatorid: this.$login.f.id,
405
+ f_orgid: this.$login.f.orgid,
406
+ f_orgname: this.$login.f.orgs,
407
+ f_depid: this.$login.f.depids,
408
+ f_depname: this.$login.f.deps,
409
+ f_zoneid: this.$login.f.zoneid,
410
+ f_zones: this.$login.f.zones
411
+ }
412
+ this.showOverdueModal = false
413
+ this.newOverdue = this.overdueModal.f_new_overdue
414
+ this.isBreakOverdue = (this.overdueModal.f_new_overdue - this.overdueModal.f_old_overdue != 0)
415
+ },
416
+
417
+ closeOverdue () {
418
+ this.showOverdueModal = false
419
+ this.editOverdue = null
420
+ this.showErrorMsg = false
421
+ },
422
+ /**
423
+ * 用来进行小数相加的工具方法
424
+ * @param {*} num1
425
+ * @param {*} num2
426
+ */
427
+ addNum (num1, num2) {
428
+ let sq1, sq2, multiple
429
+ try {
430
+ sq1 = num1.toString().split('.')[1].length
431
+ } catch (e) {
432
+ sq1 = 0
433
+ }
434
+ try {
435
+ sq2 = num2.toString().split('.')[1].length
436
+ } catch (e) {
437
+ sq2 = 0
438
+ }
439
+ multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
440
+ return (num1 * multiple + num2 * multiple) / multiple
441
+ },
442
+ /**
443
+ * 用来进行小数相减的工具方法
444
+ * @param {*} num1
445
+ * @param {*} num2
446
+ */
447
+ subNum (num1, num2) {
448
+ let sq1, sq2, multiple
449
+ try {
450
+ sq1 = num1.toString().split('.')[1].length
451
+ } catch (e) {
452
+ sq1 = 0
453
+ }
454
+ try {
455
+ sq2 = num2.toString().split('.')[1].length
456
+ } catch (e) {
457
+ sq2 = 0
458
+ }
459
+ multiple = Math.pow(10, Math.max(sq1, sq2) + 1)
460
+ return (num1 * multiple - num2 * multiple) / multiple
461
+ },
462
+ confirm () {
463
+ this.eticket_msg = false
464
+ // 如果有变更原因说明有变更
465
+ if (this.data.f_collection < 0) {
466
+ this.$showMessage('收款金额不能小于零!!')
467
+ return
468
+ }
469
+ if (this.charge || !this.jurisdiction.includes('单条欠费部分缴费')) {
470
+ // console.log('单条欠费部分缴费', this.data.f_collection, this.data.f_balance ,this.data.f_totalcost)
471
+ // console.log('单条欠费部分缴费11', this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost))
472
+ let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
473
+ console.log('===>', inti)
474
+ if (this.floor) {
475
+ if (inti < -1) {
476
+ this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
477
+ return
478
+ }
479
+ } else {
480
+ if (inti < 0) {
481
+ this.$showMessage('收款金额不足以清缴欠费,请核查,并重新输入收款金额!!')
482
+ // this.data.f_collection = this.data.f_totalcost
483
+ return
484
+ }
485
+ }
486
+ }
487
+ if (this.newOverdue > 0) {
488
+ let inti = this.subNum(this.addNum(this.data.f_collection, this.data.f_balance), this.data.f_totalcost)
489
+ console.log('===>', inti)
490
+ if (this.floor) {
491
+ if (inti < -1) {
492
+ this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
493
+ return
494
+ }
495
+ } else {
496
+ if (inti < 0) {
497
+ this.$showMessage('该户已产生违约金,必须全部进行清缴,请核查,并重新输入收款金额!!')
498
+ // this.data.f_collection = this.data.f_totalcost
499
+ return
500
+ }
501
+ }
502
+ }
503
+
504
+ this.data.f_overdue = this.newOverdue
505
+ this.data.isBreakOverdue = this.isBreakOverdue
506
+ if (this.isBreakOverdue) {
507
+ this.data.breakOverdue = this.breakOverdue
508
+ }
509
+ this.$showMessage(`确定对用户${this.row.f_user_name}进行机表缴费吗?`, ['confirm', 'cancel']).then(async (res) => {
510
+ if (res === 'confirm') {
511
+ // 先调用付款码支付组件流程
512
+ let ss = await this.$refs.paymentcode.flowPath()
513
+ this.$refs.paymentcode.paymentCodeShow = false
514
+ console.log('付款码操作返回', ss)
515
+ if (!ss.result) return
516
+ machineChargeGen(this)
517
+ }
518
+ })
519
+ },
520
+ calOverdue () {
521
+ this.data.f_totalcost = this.data.f_totalcost - (this.data.f_overdue - this.newOverdue)
522
+ this.data.f_overdue = this.newOverdue
523
+ },
524
+ clean () {
525
+ this.$dispatch('success', '机表收费', this.data)
526
+ this.$info('取消操作')
527
+ },
528
+ validateBill (val) {
529
+ this.validateOk = !val.isOk
530
+ this.billData.bill = val.bill
531
+ },
532
+ printok () {
533
+ this.$dispatch('success')
534
+ },
535
+ checkOverdue () {
536
+ this.$nextTick(() => {
537
+ this.newOverdue = this.data.f_overdue
538
+ this.calOverdue()
539
+ })
540
+ },
541
+ close () {
542
+ this.print = false
543
+ this.clean()
544
+ },
545
+ // 根据选择的付款方式 获取优惠列表
546
+ async getPrivilegeList () {
547
+ // 初始化下拉选择列表
548
+ this.privilegeList = [{label: '无优惠', value: '0'}]
549
+ // 初始为无优惠
550
+ this.data.f_privilege_id = '0'
551
+ if (this.data.f_payment && this.data.f_payment.length) {
552
+ // 查询条件
553
+ let payments = JSON.stringify(this.data.f_payment)
554
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
555
+ let HttpReset = new HttpResetClass()
556
+ let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
557
+ data: {
558
+ items: 'id,f_privilege_name,f_privilege_type',
559
+ tablename: 't_privilege',
560
+ 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 = '有效'`,
561
+ orderitem: 'id'
562
+ }
563
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
564
+ // 查询结果放到下拉列表
565
+ for (let p of privilege.data) {
566
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
567
+ }
568
+ this.privilegeCalculate()
569
+ }
570
+ },
571
+ eticket_toggle () {
572
+ this.eticket_show = false
573
+ this.$dispatch('success')
574
+ },
575
+ // 优惠计算
576
+ async privilegeCalculate () {
577
+ // 初始化减免金额
578
+ this.data.f_privilege_money = 0
579
+ this.data.f_after_discount = this.data.f_collection
580
+ // 判断是否是自定义优惠
581
+ if (parseInt(this.data.f_privilege_id)) {
582
+ for (let p of this.privilegeList) {
583
+ if (p.value == this.data.f_privilege_id && p.type == '自定义') {
584
+ this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
585
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
586
+ this.$showMessage('金额输入格式不正确!')
587
+ this.data.f_privilege_money = 0
588
+ return
589
+ }
590
+ if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
591
+ this.$showMessage('减免金额不能大于等于收款金额')
592
+ this.data.f_privilege_money = 0
593
+ return
594
+ }
595
+ }
596
+ }
597
+ }
598
+ // 优惠方式, 收款 缺一不计算
599
+ if (this.data.f_payment && this.data.f_payment.length && parseInt(this.data.f_privilege_id) && this.data.f_collection) {
600
+ let c = {
601
+ f_privilege_id: this.data.f_privilege_id,
602
+ f_collection: this.data.f_collection,
603
+ f_privilege_money: this.data.f_privilege_money
604
+ }
605
+ let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
606
+ // 减免金额
607
+ this.data.f_privilege_money = privilegeData.data.f_privilege_money
608
+ // 减免后收款金额
609
+ this.data.f_after_discount = privilegeData.data.f_collection
610
+ }
611
+ },
612
+ async speckText (str) {
613
+ var url = 'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=6&text=' + encodeURI(str)
614
+ await new Audio(url).play()
615
+ }
616
+ },
617
+ watch: {
618
+ 'data.f_overdue' (val) {
619
+ // this.data.f_last_overdue = this.newOverdue
620
+ this.newOverdue = val
621
+ },
622
+ 'splitAll' (val) {
623
+ this.data.f_pregas = this.data.f_pregas - val
624
+ },
625
+ 'invoice_show_gas' () {
626
+ return this.row.f_collection_type === '按气量' ? '是' : '否'
627
+ },
628
+ 'newOverdue' (val) {
629
+ this.data.f_totalcost = (this.data.f_preamount - 0) + (val - 0)
630
+ if (this.data.f_totalcost - this.data.f_balance > 0) {
631
+ if (this.floor) {
632
+ this.data.f_collection = Math.floor(this.data.f_totalcost - this.data.f_balance)
633
+ } else if (this.ceil) {
634
+ this.data.f_collection = Math.ceil(this.data.f_totalcost - this.data.f_balance)
635
+ } else {
636
+ this.data.f_collection = this.data.f_totalcost - this.data.f_balance
637
+ }
638
+ } else {
639
+ this.data.f_collection = 0
640
+ }
641
+ },
642
+ 'data.f_payment' (val) {
643
+ this.getPrivilegeList()
644
+ // 根据付款方式增加业务单号
645
+ if (val == '免交') {
646
+ this.mjshow = true
647
+ } else {
648
+ this.mjshow = false
649
+ }
650
+ },
651
+ async 'data.f_collection' (val) {
652
+ if ((this.data.f_totalcost - 0) > (val - 0)) {
653
+ if (this.authArr.includes('机表收费语音播报')) {
654
+ await this.speckText('请注意,当前收款小于欠费')
655
+ }
656
+ }
657
+ // 获取计算优惠
658
+ this.getPrivilegeList()
659
+ }
660
+ },
661
+ computed: {
662
+ authArr () {
663
+ return this.$login.r ? this.$login.r : []
664
+ },
665
+ curbalance () {
666
+ if (((this.data.f_collection - 0) + (this.data.f_balance - 0)) > (this.data.f_totalcost - 0)) {
667
+ return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
668
+ } else if (this.floor) {
669
+ return ((this.data.f_collection - 0) + (this.data.f_balance - 0) - (this.data.f_totalcost - 0)).toFixed(4)
670
+ } else {
671
+ return 0
672
+ }
673
+ }
674
+ }
675
+ }
676
+ </script>