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,793 +1,793 @@
1
- <template>
2
- <div class="flex-row">
3
- <div class="span" style="overflow-y: auto;">
4
- <validator name='v'>
5
- <form novalidate class="form-horizontal">
6
- <div class="row">
7
- <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
8
- <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
- <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
10
- <v-select v-model="f_payment"
11
- placeholder='请选择'
12
- :value.sync="model.f_payment"
13
- close-on-select
14
- :options='paytype' clear-button v-ref:payment></v-select>
15
- </div>
16
-
17
- <div class="col-sm-4 form-group"
18
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
- <label for="f_pregas" class=" font_normal_body">预购气量</label>
20
- <input class="input_search" style="width:60%" type="number" id="pregasFocue"
21
- @blur="pregas()" v-model="model.f_pregas"
22
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
- v-next-el='sk' >
24
- </div>
25
- <!-- <div class="col-sm-4 form-group" v-if="row.f_collection_type == '按金额'">
26
- <label for="f_pregas" class=" font_normal_body">预购气量</label>
27
- <input class="input_search" style="width:60%" type="number" v-model="model.f_pregas" placeholder="预购气量" disabled>
28
- </div>-->
29
-
30
- <div class="col-sm-4 form-group"
31
- :class="[$v.f_preamount.required || $v.f_preamount.dctest? 'has-error' : 'has-success']">
32
- <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
- <input class="input_search" style="width:60%" @blur="preamount()" type="number" v-model="model.f_preamount"
34
- v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
- v-scale="[model.f_preamount, 2]" placeholder="预购金额" >
36
- </div>
37
- </div>
38
- <div class="row" style="margin-top:6px;">
39
- <div class="col-sm-4 form-group" :class="[$v.printstyle.required ? 'select-error' : '']">
40
- <label for="f_print" class="font_normal_body">打印格式</label>
41
- <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems" v-validate:printstyle='{required: true }'>
42
- <v-select id="print"
43
- v-model="f_print"
44
- placeholder='请选择'
45
- :multiple="false"
46
- :value.sync="model.f_print"
47
- :options='printstyle'
48
- close-on-select clear-button v-ref:printstyle>
49
- </v-select>
50
- </div>
51
- <div class="col-sm-4 form-group" v-if="hasLimit&&limitgas">
52
- <label class="font_normal_body">购气上限</label>
53
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
54
- v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
55
- </div>
56
- <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
57
- <label class="font_normal_body">金额上限</label>
58
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
59
- v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
60
- </div>
61
- <div class="col-sm-4 form-group" v-if="!hasLimit">
62
- </div>
63
-
64
- <div class="col-sm-4 form-group"
65
- :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
66
- <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
67
- class=" font_normal_body">应收金额</label>
68
- <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
69
- class=" font_normal_body">本次缴费</label>
70
- <input class="input_search" style="width:60%" type="number"
71
- @blur="preamount()" v-model="model.f_totalcost"
72
- v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
73
- v-next-el='sk' v-scale="[model.f_totalcost, 2]" disabled>
74
- </div>
75
- </div>
76
- <div class="row">
77
- <div class="col-sm-4 form-group">
78
- <label for="f_balance" class="font_normal_body">上期结余</label>
79
- <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
80
- v-scale="[model.f_balance, 2]" placeholder="上期结余" disabled>
81
- </div>
82
-
83
- <div class="col-sm-4 form-group">
84
- <label for="f_curbalance" class="font_normal_body">本期结余</label>
85
- <input class="input_search" style="width:60%" type="number" v-model="curbalance"
86
- v-scale="[model.f_curbalance, 2]" placeholder="本期结余" disabled>
87
- </div>
88
-
89
- <!-- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气'"-->
90
- <!-- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">-->
91
- <!-- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>-->
92
- <!-- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"-->
93
- <!-- v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'-->
94
- <!-- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">-->
95
- <!-- </div>-->
96
- <!-- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气'"-->
97
- <!-- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">-->
98
- <!-- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>-->
99
- <!-- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"-->
100
- <!-- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">-->
101
- <!-- </div>-->
102
- <div class="col-sm-3 form-group">
103
- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
104
- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
105
- v-el:sk v-scale="[model.f_collection, 2]" disabled>
106
- </div>
107
- <div class="col-sm-1 form-group">
108
- <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
109
- </div>
110
- </div>
111
- <div class="row" style="margin-top:5px;">
112
- <div class="col-sm-9">
113
- </div>
114
- <div class="col-sm-3">
115
- <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
116
- </div>
117
- </div>
118
- <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
119
- <div class="col-sm-4 form-group">
120
- <label class="font_normal_body">优惠方式</label>
121
- <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
122
- placeholder='请选择'
123
- :value.sync="model.f_privilege_id"
124
- :options='privilegeList' clear-button value-single>
125
- </v-select>
126
- </div>
127
- <div class="col-sm-4 form-group">
128
- <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
129
- <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
130
- v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
131
- </div>
132
- <div class="col-sm-4 form-group">
133
- <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
134
- <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
135
- v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
136
- </div>
137
- </div>
138
- <div class="row" v-if="model.f_payment[0].includes('POS')">
139
- <div class="col-sm-4 form-group">
140
- <label for="f_voucher_number" class="font_normal_body">凭证号</label>
141
- <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
142
- </div>
143
- </div>
144
- <div class="row" style="padding-top: 0.5em;">
145
- <div class="col-sm-4" v-if="!mjshow" >
146
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
147
- <input class="input_search" style="width:60%" type="text"
148
- v-model="model.f_serial_number" placeholder="业务单号">
149
- </div>
150
- <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
151
- <label for="f_serial_number" class=" font_normal_body">业务单号</label>
152
- <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
153
- v-model="model.f_serial_number" placeholder="业务单号">
154
- </div>
155
-
156
- <div class="col-sm-8">
157
- <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备&nbsp;注&nbsp;&nbsp;&nbsp;</label>
158
- <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
159
- </div>
160
- </div>
161
-
162
- <div v-if="paymentModel.length >1">
163
- <div class="row" style="margin-top:10px;" >
164
- <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
165
- </div>
166
- <div class="row" style="margin-top:10px;" >
167
- <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
168
- <label class="font_normal_body">{{pay.f_payment}}:</label>
169
- <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
170
- </div>
171
- <div class="col-sm-4 form-group ">
172
- <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
173
- </div>
174
- </div>
175
- </div>
176
- </form>
177
- <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
178
- <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close" @printok="printok" v-ref:printbill></print-bill>
179
- <div style="text-align:right; height: 25%">
180
- <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
181
- <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
182
- <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
183
- :payment.sync="model.f_payment" :payment-data="paytype"
184
- @confirm-payment="confirm()">
185
- </payment-code-button>
186
- <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认</button>
187
- <button class="button_clear btn-gn" @click="clean()">取消</button>
188
- </div>
189
- </validator>
190
- </div>
191
- <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_after_discount"></payment-code>
192
- </div>
193
- <eticket-modal :show="eticket_msg" @close-modal-show="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
194
- <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
195
- <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="物联网表收费"></upload>
196
- <!-- <modal :show.sync="showfiles" width="80%"style="width:auto;" v-ref:modal middle backdrop="false">-->
197
- <!-- <article slot="modal-body">-->
198
- <!-- <upload :blodid="row.f_userinfo_id" v-ref:upload :fusetype="uploadText" isremark="true" style="width:auto" ></upload>-->
199
- <!-- </article>-->
200
- <!-- <footer slot="modal-footer" class="modal-footer">-->
201
- <!-- </footer>-->
202
- <!-- </modal>-->
203
-
204
- </template>
205
- <script>
206
- /**
207
- *综合业务
208
- *卡表收费组件
209
- */
210
-
211
- import {HttpResetClass} from 'vue-client'
212
-
213
- // 输入金额,换算气量
214
- /* let preamountGen = async function (self) {
215
- let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
216
- self.model.f_preamount = calFee
217
- self.model.f_collection = self.model.f_totalcost
218
- } */
219
- let preamountGen = async function (self) {
220
- let calFee = self.model.f_preamount
221
- let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
222
- if (getGas.data.gas) {
223
- if (self.row.f_isdecimal === '是') {
224
- if (self.row.f_alias === 'QiaoSong') {
225
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
226
- } else {
227
- self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
228
- }
229
- self.dymoney = 0
230
- } else {
231
- // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
232
- let tempnum = Math.floor(getGas.data.gas - 0)
233
- if (getGas.data.gas > tempnum) { // getGas.data.gas-tempnum-0
234
- let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
235
- if (dymoney1.data.money) {
236
- self.dymoney = (getGas.data.money - 0).toFixed(2) - (dymoney1.data.money - 0).toFixed(2)
237
- }
238
- } else {
239
- self.dymoney = 0
240
- }
241
- self.model.f_pregas = Math.floor(getGas.data.gas - 0)
242
- }
243
- }
244
- // 不划气量,归零
245
- if (self.config.priceCalculation) {
246
- self.model.f_pregas = 0
247
- }
248
- self.model.f_totalcost = ((self.row.f_balance - 0) > (self.model.f_preamount - 0) ? 0 : ((self.model.f_preamount - 0) - (self.row.f_balance - 0)).toFixed(4))
249
-
250
- self.model.chargeprice = getGas.data.chargeprice
251
- Object.assign(self.model, self.model, getGas.data)
252
- self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(2)
253
- if (self.config.floor) {
254
- self.model.f_totalcost = Math.ceil(self.model.f_totalcost)
255
- }
256
- // self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
257
- self.model.f_collection = self.model.f_totalcost
258
- self.model.f_preamount = ((getGas.data.chargenum - 0) - (self.dymoney - 0))
259
- if (self.model.f_payment == '赠气') {
260
- self.model.f_totalcost = self.model.f_preamount
261
- self.model.f_collection = 0
262
- }
263
- self.calText(getGas.data.chargeprice)
264
- }
265
- // 输入气量,换算金额
266
- let pregasGen = async function (self) {
267
- if (self.row.f_isdecimal === '是') {
268
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
269
- } else {
270
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
271
- }
272
- if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
273
- self.model.f_meter_type = self.row.f_meter_type
274
- let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
275
- self.model.f_preamount = getAmount.data.chargenum
276
- self.model.f_totalcost = (self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4)
277
- Object.assign(self.model, self.model, getAmount.data)
278
- self.model.chargeprice = getAmount.data.chargeprice
279
- if (self.config.floor) {
280
- self.model.f_totalcost = Math.ceil(self.model.f_totalcost)
281
- }
282
- self.model.f_collection = self.model.f_totalcost
283
- if (self.model.f_payment == '赠气') {
284
- self.model.f_totalcost = getAmount.data.chargenum
285
- self.model.f_collection = 0
286
- }
287
- self.calText(getAmount.data.chargeprice)
288
- }
289
- }
290
-
291
- let IOTChargeGen = async function (self) {
292
- try {
293
- if (self.paymentModel.length === 0) {
294
- self.paymentModel = [{
295
- f_payment: self.model.f_payment[0],
296
- f_money: self.model.f_preamount
297
- }]
298
- }
299
-
300
- self.model.payments = self.paymentModel
301
-
302
- let param = Object.assign({}, {}, self.model)
303
- param.f_payment = self.model.f_payment.toString()
304
- param.f_print = self.model.f_print.toString()
305
- param.f_serial_number = self.model.f_serial_number ? self.model.f_serial_number : ''
306
- // 加入扫码盒付款码支付流水号
307
- param.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
308
- let res = await self.$resetpost('rs/logic/sale_IOTCharge_logic', {data: param}, {
309
- resolveMsg: '物联网收费成功!!',
310
- rejectMsg: '物联网收费出错!!!'
311
- })
312
- let localeSustainMoney = window.localStorage.getItem('sustainMoney')
313
- if (localeSustainMoney != null) {
314
- localeSustainMoney = (localeSustainMoney - 0) + (param.f_collection - 0)
315
- window.localStorage.setItem('sustainMoney', localeSustainMoney)
316
- }
317
- let param1 = []
318
- for (let row of self.resid) {
319
- param1.push({id: row.id})
320
- }
321
- let data = {
322
- param: param1,
323
- f_blobid: res.data.id
324
- }
325
- await self.$resetpost('rs/logic/updatefiles', data)
326
- console.log('物联网收费返回。。。', res.data.id)
327
- // 开始打票
328
- console.log('开始打票', self.config)
329
- if (self.config.hasPrint) {
330
- if (self.model.f_print.indexOf('电子发票') == -1) {
331
- console.log('self.config.hasBillManage', self.config.hasBillManage)
332
- if (self.$login.r.includes('非民用纸质票据拆分')) {
333
- if (self.row.f_user_type === '非民用') {
334
- self.billData.url = 'rs/report/fmy_iot_bill'
335
- }
336
- }
337
- if (self.config.hasBillManage) {
338
- // 启用发票管理,获取票据管理中的票号并存储记录
339
- self.row.id = res.data.id
340
- self.row.f_bill_type = '物联网收费'
341
- self.row.f_bill_style = self.model.f_print[0]
342
- self.print = true
343
- } else {
344
- self.row.id = res.data.id
345
- self.print = true
346
- }
347
- } else if (self.config.printType === '国税发票') {
348
- // TODO
349
- } else if (self.model.f_print[0] === '电子发票') {
350
- self.eticket_show = true
351
- await self.$refs.eticketbill.openETicket(res.data.id, self.row, '物联网收费')
352
- // self.$CommonService.openEticket(res.data.id, '其他收费')
353
- // self.$dispatch('success')
354
- }
355
- } else {
356
- self.$dispatch('success', '物联网收费')
357
- }
358
- } catch (error) {
359
- if (error.status === 301) {
360
- self.$dispatch('refresh')
361
- } else {
362
- if (error) {
363
- self.$showAlert(error, 'danger', 0)
364
- }
365
- }
366
-
367
- self.$dispatch('refresh')
368
- }
369
- }
370
- let asyncCardMeterCenter = async function (self) {
371
- await self.$getConfig(self, 'IOTMeterCenter')
372
- console.log('卡表收费config', self.config)
373
-
374
- // 添加 “系统余额透支” 付款方式
375
- let i = -1
376
- for (const index in self.paytype) {
377
- if (self.paytype[index].value == '系统余额透支') {
378
- i = index
379
- break
380
- }
381
- }
382
- if (self.canOverdraftBalance()) {
383
- if (i == -1) {
384
- self.paytype.push({
385
- label: '系统余额透支',
386
- value: '系统余额透支'
387
- })
388
- }
389
- } else {
390
- if (i != -1) {
391
- self.paytype.splice(i, 1)
392
- }
393
- }
394
-
395
- // 默认打印格式
396
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
397
- self.model.f_payment = [self.config.payment]
398
- self.mulPrint = self.config.printType instanceof Array
399
-
400
- // 获取当前票号用
401
- self.model.f_use_type = self.config.billType
402
- self.model.f_bill_type = self.model.f_print
403
- self.hasValidateBill = self.config.hasBillManage
404
-
405
- // 判断限购
406
- let limit_param = {
407
- f_userinfo_id: self.row.f_userinfo_id,
408
- f_user_id: self.row.f_user_id,
409
- f_stairprice_id: self.row.f_stairprice_id
410
- }
411
- let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
412
- console.log('获取限购值', getLimit)
413
- self.hasLimit = getLimit.data.hasLimit
414
- if (self.hasLimit) {
415
- if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
416
- if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
417
- self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
418
- self.$dispatch('refresh')
419
- } else {
420
- if (getLimit.data.f_limit_value) {
421
- self.maxgas = (getLimit.data.f_limit_value - 0)
422
- self.limitgas = true
423
- }
424
- if (getLimit.data.f_limit_amount) {
425
- self.maxmoney = (getLimit.data.f_limit_amount - 0)
426
- self.limitmoney = true
427
- }
428
- }
429
- }
430
- }
431
- }
432
- export default {
433
- title: '物联网收费',
434
- data () {
435
- return {
436
- resid: [], // 存放新增的f_files表中id
437
- config: {
438
- notShowFormula: false, // 不显示计算公式,默认显示
439
- priceCalculation: false, // 划气量控制
440
- showupload: true, // 默认显示附件上传组件
441
- hasPrint: false, // 默认打票
442
- floor: true, // 是否取整收费
443
- hasBillManage: false, // 默认不启用发票管理
444
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
445
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
446
- payment: '',
447
- overdraftBalance: false // 是否支持系统余额透支
448
- },
449
- model: {
450
- f_purchase: 0,
451
- f_payment: [],
452
- f_pregas: 0,
453
- f_preamount: 0,
454
- f_totalcost: 0,
455
- f_curbalance: 0,
456
- f_collection: '',
457
- f_balance: 0,
458
- f_print: [],
459
- f_meter_type: '',
460
- f_voucher_number: '',
461
- f_privilege_id: 0,
462
- f_privilege_money: 0,
463
- f_after_discount: 0,
464
- f_sys_balance: 0
465
- },
466
- eticket_msg: false,
467
- eticket_show: false,
468
- invoice_is_pax: '不征税',
469
- is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
470
-
471
- calculatedetail: '',
472
- // 启用发票管理需要对票号进行验证
473
- hasValidateBill: false,
474
- validateOk: false,
475
-
476
- print: false,
477
- billData: {
478
- url: 'rs/report/iot_bill',
479
- operator: this.$login.f.name,
480
- billnumber: ''
481
- },
482
- hasLimit: false,
483
- maxgas: 99999999, // 限购
484
- maxmoney: 99999999,
485
- limitmoney: false,
486
- limitgas: false,
487
- paymentModel: [], // 多笔付款方式
488
-
489
- mulPrint: false,
490
- clickConfirm: false, // 控制确认按钮只能点击一次
491
- // 下拉框值
492
- paytype: this.$appdata.getParam('付款方式'),
493
- printstyle: this.$appdata.getParam('打印格式'),
494
- privilegeList: [{label: '无优惠', value: '0'}],
495
- showfiles: false,
496
- serialShow: false,
497
- mjshow: false,
498
- dymoney: 0
499
- }
500
- },
501
- props: ['row'],
502
- mounted () {
503
- this.$refs.email.focus()
504
- },
505
- ready () {
506
- this.paytype = this.$appdata.getParam('付款方式')
507
- if (!this.$login.r.includes('免交充值付款')) {
508
- this.paytype = this.paytype.filter((item) => {
509
- return item.label != '免交'
510
- })
511
- }
512
- // this.getPurchase()
513
- this.model.f_price_id = this.row.f_price_id
514
- this.model.f_user_id = this.row.f_user_id
515
- this.model.f_userfiles_id = this.row.f_userfiles_id
516
- this.model.f_userinfo_id = this.row.f_userinfo_id
517
- this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
518
- this.model.f_preamount = ''
519
- this.model.f_pregas = ''
520
- document.getElementById('pregasFocue').focus()
521
- asyncCardMeterCenter(this)
522
- },
523
- watch: {
524
- 'model.f_payment.length' (val) {
525
- console.log('付款方式多选。。', val)
526
- if (val > 1 && !this.model.f_preamount) {
527
- this.model.f_payment = ['现金缴费']
528
- this.$showAlert('请先计算付款金额', 'warning', 2000)
529
- } else {
530
- this.paymentModel = []
531
-
532
- this.model.f_payment.forEach((res) => {
533
- let temp = {
534
- f_payment: res,
535
- f_money: 0
536
- }
537
- this.paymentModel.push(temp)
538
- })
539
- this.$resetValidation()
540
-
541
- // 获取计算优惠
542
- this.getPrivilegeList()
543
- }
544
- },
545
- 'model.f_collection' (val) {
546
- // 获取计算优惠
547
- this.getPrivilegeList()
548
- },
549
- 'model.f_payment' (val) {
550
- if (val == '免交') {
551
- this.mjshow = true
552
- } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
553
- if (this.row.f_collection_type == '按气量') {
554
- this.pregas()
555
- } else {
556
- this.preamount()
557
- }
558
- } else {
559
- this.mjshow = false
560
- }
561
- if (this.row.f_collection_type == '按气量') {
562
- this.pregas()
563
- } else {
564
- this.preamount()
565
- }
566
- }
567
- },
568
- events: {
569
- // 删除Resid数组元素
570
- 'delResid' (val) {
571
- this.resid.$remove({id: val, f_biobid: ''})
572
- // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
573
- },
574
- // 增加Resid数组元素
575
- 'resid' (val) {
576
- console.log('-=', val)
577
- this.resid.push({id: val, f_biobid: ''})
578
- }
579
- },
580
- methods: {
581
- // 校验发票信息
582
- checkInvoiceMsg () {
583
- // 校验是否超出最大透支余额
584
- if (this.model.f_payment == '系统余额透支') {
585
- const maxOverdraftBalance = -(((this.$appdata.getSingleValue('最大透支余额') - 0) || 1000) - 0)
586
- const curSysBalance = ((this.row.f_sys_balance || 0) - 0) - (this.model.f_totalcost - 0)
587
- if (curSysBalance < maxOverdraftBalance) {
588
- this.$showAlert('您的系统余额将超出最大透支余额,请使用别的付款方式!', 'danger', 5000)
589
- return
590
- }
591
- this.model.f_sys_balance = curSysBalance
592
- }
593
-
594
- if (this.model.f_print[0] === '电子发票') {
595
- if (!this.row.f_taxpayer_id) {
596
- this.row.f_taxpayer_id = this.row.f_idnumber
597
- }
598
- if (!this.row.f_paper_name) {
599
- this.row.f_paper_name = this.row.f_user_name
600
- }
601
- if (!this.row.f_address_phone) {
602
- this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
603
- }
604
- this.eticket_msg = true
605
- } else {
606
- this.confirm()
607
- }
608
- },
609
- eticket_toggle () {
610
- this.eticket_show = false
611
- this.$dispatch('success', '物联网收费')
612
- },
613
- async confirm () {
614
- let res = await this.$showMessage(`确定对客户${this.row.f_user_name}进行物联网表缴费吗?`, ['confirm', 'cancel'])
615
- if (res != 'confirm') return
616
- // 先调用付款码支付组件流程
617
- let ss = await this.$refs.paymentcode.flowPath()
618
- this.$refs.paymentcode.paymentCodeShow = false
619
- console.log('付款码操作返回', ss)
620
- if (!ss.result) return
621
- this.eticket_msg = false
622
- this.clickConfirm = true
623
- this.model.f_curbalance = this.curbalance
624
- this.$dispatch('no-button')
625
- console.log('model and row', this.model, this.row)
626
- this.model.f_userinfo_id = this.row.f_userinfo_id
627
- this.model.f_userfiles_id = this.row.f_userfiles_id
628
- this.model.f_user_id = this.row.f_user_id
629
- this.model.userinfo_version = this.row.userinfo_version
630
- this.model.version = this.row.version
631
- this.model.f_total_fee = (this.row.f_total_fee - 0) + (this.model.f_preamount - 0)
632
- this.model.f_total_gas = (this.row.f_total_gas - 0) + (this.model.f_pregas - 0)
633
- this.model.f_operator = this.$login.f.name
634
- this.model.f_operatorid = this.$login.f.id
635
- this.model.f_orgid = this.$login.f.orgid
636
- this.model.f_orgname = this.$login.f.orgs
637
- this.model.f_depid = this.$login.f.depids
638
- this.model.f_depname = this.$login.f.deps
639
- IOTChargeGen(this)
640
- },
641
- clean () {
642
- this.$info('取消操作')
643
- this.$dispatch('refresh', this.row)
644
- },
645
- validateBill (val) {
646
- this.validateOk = !val.isOk
647
- this.billData.bill = val.bill
648
- },
649
- printok () {
650
- // 收据打完,判断是否还有其他票据进行请求
651
- for (let i = 0; i < this.model.f_print.length; i++) {
652
- if (this.model.f_print[i] === '电子发票') {
653
- this.$CommonService.openEticket(this.row.id, '售气收费')
654
- }
655
- }
656
- this.$dispatch('success', '物联网收费')
657
- },
658
- pregas () {
659
- this.dymoney = 0
660
- if (this.model.f_pregas && this.model.f_pregas > 0) {
661
- try {
662
- pregasGen(this)
663
- } catch (error) {
664
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
665
- this.$dispatch('error', '发卡售气', this.model, error)
666
- }
667
- } else {
668
- this.model.f_pregas = null
669
- }
670
- },
671
- preamount () {
672
- if (this.model.f_preamount && this.model.f_preamount > 0) {
673
- try {
674
- preamountGen(this)
675
- } catch (error) {
676
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
677
- this.$dispatch('error', '发卡售气', this.model, error)
678
- }
679
- } else {
680
- this.model.f_preamount = null
681
- }
682
- },
683
- calText (val) {
684
- let str = ''
685
- val.forEach((item) => {
686
- str = str + item.f_price + ' x ' + item.f_gas + '+'
687
- })
688
- str = str.slice(0, str.length - 1)
689
- this.calculatedetail = str
690
- },
691
- close () {
692
- this.print = false
693
- this.clean()
694
- },
695
- // 根据选择的付款方式 获取优惠列表
696
- async getPrivilegeList () {
697
- // 初始化下拉选择列表
698
- this.privilegeList = [{label: '无优惠', value: '0'}]
699
- // 初始为无优惠
700
- this.model.f_privilege_id = '0'
701
- if (this.model.f_payment && this.model.f_payment.length) {
702
- // 查询条件
703
- let payments = JSON.stringify(this.model.f_payment)
704
- payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
705
- let HttpReset = new HttpResetClass()
706
- let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
707
- data: {
708
- items: 'id,f_privilege_name,f_privilege_type',
709
- tablename: 't_privilege',
710
- 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 = '有效'`,
711
- orderitem: 'id'
712
- }
713
- }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
714
- // 查询结果放到下拉列表
715
- for (let p of privilege.data) {
716
- this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
717
- }
718
- this.privilegeCalculate()
719
- }
720
- },
721
- // 优惠计算
722
- async privilegeCalculate () {
723
- // 初始化减免金额
724
- this.model.f_privilege_money = 0
725
- this.model.f_after_discount = this.model.f_collection
726
- // 判断是否是自定义优惠
727
- if (parseInt(this.data.f_privilege_id)) {
728
- for (let p of this.privilegeList) {
729
- if (p.value == this.data.f_privilege_id && p.type == '自定义') {
730
- this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
731
- if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
732
- this.$showMessage('金额输入格式不正确!')
733
- this.data.f_privilege_money = 0
734
- return
735
- }
736
- if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
737
- this.$showMessage('减免金额不能大于等于收款金额')
738
- this.data.f_privilege_money = 0
739
- return
740
- }
741
- }
742
- }
743
- }
744
- // 优惠方式, 收款 缺一不计算
745
- if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
746
- let c = {
747
- f_privilege_id: this.model.f_privilege_id,
748
- f_collection: this.model.f_collection,
749
- f_privilege_money: this.data.f_privilege_money
750
- }
751
- let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
752
- // 减免金额
753
- this.model.f_privilege_money = privilegeData.data.f_privilege_money
754
- // 减免后收款金额
755
- this.model.f_after_discount = privilegeData.data.f_collection
756
- }
757
- },
758
- // 判断当前用户是否可以使用系统余额透支
759
- canOverdraftBalance () {
760
- return this.config.overdraftBalance && this.row.f_user_type != '民用'
761
- }
762
- },
763
- computed: {
764
- authArr () {
765
- return this.$login.r ? this.$login.r : []
766
- },
767
- 'curbalance' () {
768
- if (this.model.f_payment == '赠气') {
769
- return this.row.f_balance
770
- }
771
- if (this.model.f_preamount) {
772
- return ((this.model.f_collection - 0) - (this.model.f_preamount - 0) + (this.row.f_balance - 0)).toFixed(2) - 0
773
- } else {
774
- return 0
775
- }
776
- },
777
- 'islegal' () {
778
- if (this.paymentModel.length > 1 && this.model.f_collection) {
779
- let sum = 0
780
- this.paymentModel.forEach((res) => {
781
- sum += (res.f_money - 0)
782
- })
783
- return (this.model.f_collection - 0) === (sum - 0)
784
- } else {
785
- return true
786
- }
787
- }
788
- }
789
- }
790
- </script>
791
-
792
- <style>
793
- </style>
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="span" style="overflow-y: auto;">
4
+ <validator name='v'>
5
+ <form novalidate class="form-horizontal">
6
+ <div class="row">
7
+ <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
8
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
10
+ <v-select v-model="f_payment"
11
+ placeholder='请选择'
12
+ :value.sync="model.f_payment"
13
+ close-on-select
14
+ :options='paytype' clear-button v-ref:payment></v-select>
15
+ </div>
16
+
17
+ <div class="col-sm-4 form-group"
18
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
19
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
20
+ <input class="input_search" style="width:60%" type="number" id="pregasFocue"
21
+ @blur="pregas()" v-model="model.f_pregas"
22
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
23
+ v-next-el='sk' >
24
+ </div>
25
+ <!-- <div class="col-sm-4 form-group" v-if="row.f_collection_type == '按金额'">
26
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
27
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_pregas" placeholder="预购气量" disabled>
28
+ </div>-->
29
+
30
+ <div class="col-sm-4 form-group"
31
+ :class="[$v.f_preamount.required || $v.f_preamount.dctest? 'has-error' : 'has-success']">
32
+ <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
+ <input class="input_search" style="width:60%" @blur="preamount()" type="number" v-model="model.f_preamount"
34
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
+ v-scale="[model.f_preamount, 2]" placeholder="预购金额" >
36
+ </div>
37
+ </div>
38
+ <div class="row" style="margin-top:6px;">
39
+ <div class="col-sm-4 form-group" :class="[$v.printstyle.required ? 'select-error' : '']">
40
+ <label for="f_print" class="font_normal_body">打印格式</label>
41
+ <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems" v-validate:printstyle='{required: true }'>
42
+ <v-select id="print"
43
+ v-model="f_print"
44
+ placeholder='请选择'
45
+ :multiple="false"
46
+ :value.sync="model.f_print"
47
+ :options='printstyle'
48
+ close-on-select clear-button v-ref:printstyle>
49
+ </v-select>
50
+ </div>
51
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitgas">
52
+ <label class="font_normal_body">购气上限</label>
53
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
54
+ v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
55
+ </div>
56
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
57
+ <label class="font_normal_body">金额上限</label>
58
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxmoney"
59
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
60
+ </div>
61
+ <div class="col-sm-4 form-group" v-if="!hasLimit">
62
+ </div>
63
+
64
+ <div class="col-sm-4 form-group"
65
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
66
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
67
+ class=" font_normal_body">应收金额</label>
68
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
69
+ class=" font_normal_body">本次缴费</label>
70
+ <input class="input_search" style="width:60%" type="number"
71
+ @blur="preamount()" v-model="model.f_totalcost"
72
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
73
+ v-next-el='sk' v-scale="[model.f_totalcost, 2]" disabled>
74
+ </div>
75
+ </div>
76
+ <div class="row">
77
+ <div class="col-sm-4 form-group">
78
+ <label for="f_balance" class="font_normal_body">上期结余</label>
79
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
80
+ v-scale="[model.f_balance, 2]" placeholder="上期结余" disabled>
81
+ </div>
82
+
83
+ <div class="col-sm-4 form-group">
84
+ <label for="f_curbalance" class="font_normal_body">本期结余</label>
85
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
86
+ v-scale="[model.f_curbalance, 2]" placeholder="本期结余" disabled>
87
+ </div>
88
+
89
+ <!-- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment!='赠气'"-->
90
+ <!-- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">-->
91
+ <!-- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>-->
92
+ <!-- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"-->
93
+ <!-- v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0), ">=" ] }'-->
94
+ <!-- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">-->
95
+ <!-- </div>-->
96
+ <!-- <div class="col-sm-3 form-group" v-if="row.f_collection_type === '按气量' && model.f_payment=='赠气'"-->
97
+ <!-- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">-->
98
+ <!-- <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>-->
99
+ <!-- <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"-->
100
+ <!-- v-el:sk v-scale="[model.f_totalcost, 2]" :disabled="$refs.givechange.promptText != ''">-->
101
+ <!-- </div>-->
102
+ <div class="col-sm-3 form-group">
103
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
104
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
105
+ v-el:sk v-scale="[model.f_collection, 2]" disabled>
106
+ </div>
107
+ <div class="col-sm-1 form-group">
108
+ <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
109
+ </div>
110
+ </div>
111
+ <div class="row" style="margin-top:5px;">
112
+ <div class="col-sm-9">
113
+ </div>
114
+ <div class="col-sm-3">
115
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
116
+ </div>
117
+ </div>
118
+ <div class="row" style="margin-top:5px;" v-show="authArr.includes('优惠权限')">
119
+ <div class="col-sm-4 form-group">
120
+ <label class="font_normal_body">优惠方式</label>
121
+ <v-select v-model="model.f_privilege_id" @blur.native.capture="privilegeCalculate"
122
+ placeholder='请选择'
123
+ :value.sync="model.f_privilege_id"
124
+ :options='privilegeList' clear-button value-single>
125
+ </v-select>
126
+ </div>
127
+ <div class="col-sm-4 form-group">
128
+ <label for="f_preamount" class=" font_normal_body">&nbsp;优惠金额</label>
129
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_privilege_money"
130
+ v-scale="[model.f_privilege_money, 2]" placeholder="优惠金额" disabled>
131
+ </div>
132
+ <div class="col-sm-4 form-group">
133
+ <label for="f_preamount" class=" font_normal_body">&nbsp;实际收款</label>
134
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_after_discount"
135
+ v-scale="[model.f_after_discount, 2]" placeholder="优惠后收款" disabled>
136
+ </div>
137
+ </div>
138
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
139
+ <div class="col-sm-4 form-group">
140
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
141
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
142
+ </div>
143
+ </div>
144
+ <div class="row" style="padding-top: 0.5em;">
145
+ <div class="col-sm-4" v-if="!mjshow" >
146
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
147
+ <input class="input_search" style="width:60%" type="text"
148
+ v-model="model.f_serial_number" placeholder="业务单号">
149
+ </div>
150
+ <div class="col-sm-4" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
151
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
152
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
153
+ v-model="model.f_serial_number" placeholder="业务单号">
154
+ </div>
155
+
156
+ <div class="col-sm-8">
157
+ <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备&nbsp;注&nbsp;&nbsp;&nbsp;</label>
158
+ <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
159
+ </div>
160
+ </div>
161
+
162
+ <div v-if="paymentModel.length >1">
163
+ <div class="row" style="margin-top:10px;" >
164
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
165
+ </div>
166
+ <div class="row" style="margin-top:10px;" >
167
+ <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
168
+ <label class="font_normal_body">{{pay.f_payment}}:</label>
169
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
170
+ </div>
171
+ <div class="col-sm-4 form-group ">
172
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
173
+ </div>
174
+ </div>
175
+ </div>
176
+ </form>
177
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
178
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' :data='row' @toggle="close" @printok="printok" v-ref:printbill></print-bill>
179
+ <div style="text-align:right; height: 25%">
180
+ <strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
181
+ <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
182
+ <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
183
+ :payment.sync="model.f_payment" :payment-data="paytype"
184
+ @confirm-payment="confirm()">
185
+ </payment-code-button>
186
+ <button class="button_search btn-gn" type="submit" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认</button>
187
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
188
+ </div>
189
+ </validator>
190
+ </div>
191
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_after_discount"></payment-code>
192
+ </div>
193
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row" @confirm="confirm"></eticket-modal>
194
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
195
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="物联网表收费"></upload>
196
+ <!-- <modal :show.sync="showfiles" width="80%"style="width:auto;" v-ref:modal middle backdrop="false">-->
197
+ <!-- <article slot="modal-body">-->
198
+ <!-- <upload :blodid="row.f_userinfo_id" v-ref:upload :fusetype="uploadText" isremark="true" style="width:auto" ></upload>-->
199
+ <!-- </article>-->
200
+ <!-- <footer slot="modal-footer" class="modal-footer">-->
201
+ <!-- </footer>-->
202
+ <!-- </modal>-->
203
+
204
+ </template>
205
+ <script>
206
+ /**
207
+ *综合业务
208
+ *卡表收费组件
209
+ */
210
+
211
+ import {HttpResetClass} from 'vue-client'
212
+
213
+ // 输入金额,换算气量
214
+ /* let preamountGen = async function (self) {
215
+ let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
216
+ self.model.f_preamount = calFee
217
+ self.model.f_collection = self.model.f_totalcost
218
+ } */
219
+ let preamountGen = async function (self) {
220
+ let calFee = self.model.f_preamount
221
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
222
+ if (getGas.data.gas) {
223
+ if (self.row.f_isdecimal === '是') {
224
+ if (self.row.f_alias === 'QiaoSong') {
225
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
226
+ } else {
227
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
228
+ }
229
+ self.dymoney = 0
230
+ } else {
231
+ // 如果不支持小数,将划价出的多余非整数气量进行划价为金额
232
+ let tempnum = Math.floor(getGas.data.gas - 0)
233
+ if (getGas.data.gas > tempnum) { // getGas.data.gas-tempnum-0
234
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
235
+ if (dymoney1.data.money) {
236
+ self.dymoney = (getGas.data.money - 0).toFixed(2) - (dymoney1.data.money - 0).toFixed(2)
237
+ }
238
+ } else {
239
+ self.dymoney = 0
240
+ }
241
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
242
+ }
243
+ }
244
+ // 不划气量,归零
245
+ if (self.config.priceCalculation) {
246
+ self.model.f_pregas = 0
247
+ }
248
+ self.model.f_totalcost = ((self.row.f_balance - 0) > (self.model.f_preamount - 0) ? 0 : ((self.model.f_preamount - 0) - (self.row.f_balance - 0)).toFixed(4))
249
+
250
+ self.model.chargeprice = getGas.data.chargeprice
251
+ Object.assign(self.model, self.model, getGas.data)
252
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (self.dymoney - 0)).toFixed(2)
253
+ if (self.config.floor) {
254
+ self.model.f_totalcost = Math.ceil(self.model.f_totalcost)
255
+ }
256
+ // self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
257
+ self.model.f_collection = self.model.f_totalcost
258
+ self.model.f_preamount = ((getGas.data.chargenum - 0) - (self.dymoney - 0))
259
+ if (self.model.f_payment == '赠气') {
260
+ self.model.f_totalcost = self.model.f_preamount
261
+ self.model.f_collection = 0
262
+ }
263
+ self.calText(getGas.data.chargeprice)
264
+ }
265
+ // 输入气量,换算金额
266
+ let pregasGen = async function (self) {
267
+ if (self.row.f_isdecimal === '是') {
268
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
269
+ } else {
270
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
271
+ }
272
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
273
+ self.model.f_meter_type = self.row.f_meter_type
274
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
275
+ self.model.f_preamount = getAmount.data.chargenum
276
+ self.model.f_totalcost = (self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4)
277
+ Object.assign(self.model, self.model, getAmount.data)
278
+ self.model.chargeprice = getAmount.data.chargeprice
279
+ if (self.config.floor) {
280
+ self.model.f_totalcost = Math.ceil(self.model.f_totalcost)
281
+ }
282
+ self.model.f_collection = self.model.f_totalcost
283
+ if (self.model.f_payment == '赠气') {
284
+ self.model.f_totalcost = getAmount.data.chargenum
285
+ self.model.f_collection = 0
286
+ }
287
+ self.calText(getAmount.data.chargeprice)
288
+ }
289
+ }
290
+
291
+ let IOTChargeGen = async function (self) {
292
+ try {
293
+ if (self.paymentModel.length === 0) {
294
+ self.paymentModel = [{
295
+ f_payment: self.model.f_payment[0],
296
+ f_money: self.model.f_preamount
297
+ }]
298
+ }
299
+
300
+ self.model.payments = self.paymentModel
301
+
302
+ let param = Object.assign({}, {}, self.model)
303
+ param.f_payment = self.model.f_payment.toString()
304
+ param.f_print = self.model.f_print.toString()
305
+ param.f_serial_number = self.model.f_serial_number ? self.model.f_serial_number : ''
306
+ // 加入扫码盒付款码支付流水号
307
+ param.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
308
+ let res = await self.$resetpost('rs/logic/sale_IOTCharge_logic', {data: param}, {
309
+ resolveMsg: '物联网收费成功!!',
310
+ rejectMsg: '物联网收费出错!!!'
311
+ })
312
+ let localeSustainMoney = window.localStorage.getItem('sustainMoney')
313
+ if (localeSustainMoney != null) {
314
+ localeSustainMoney = (localeSustainMoney - 0) + (param.f_collection - 0)
315
+ window.localStorage.setItem('sustainMoney', localeSustainMoney)
316
+ }
317
+ let param1 = []
318
+ for (let row of self.resid) {
319
+ param1.push({id: row.id})
320
+ }
321
+ let data = {
322
+ param: param1,
323
+ f_blobid: res.data.id
324
+ }
325
+ await self.$resetpost('rs/logic/updatefiles', data)
326
+ console.log('物联网收费返回。。。', res.data.id)
327
+ // 开始打票
328
+ console.log('开始打票', self.config)
329
+ if (self.config.hasPrint) {
330
+ if (self.model.f_print.indexOf('电子发票') == -1) {
331
+ console.log('self.config.hasBillManage', self.config.hasBillManage)
332
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
333
+ if (self.row.f_user_type === '非民用') {
334
+ self.billData.url = 'rs/report/fmy_iot_bill'
335
+ }
336
+ }
337
+ if (self.config.hasBillManage) {
338
+ // 启用发票管理,获取票据管理中的票号并存储记录
339
+ self.row.id = res.data.id
340
+ self.row.f_bill_type = '物联网收费'
341
+ self.row.f_bill_style = self.model.f_print[0]
342
+ self.print = true
343
+ } else {
344
+ self.row.id = res.data.id
345
+ self.print = true
346
+ }
347
+ } else if (self.config.printType === '国税发票') {
348
+ // TODO
349
+ } else if (self.model.f_print[0] === '电子发票') {
350
+ self.eticket_show = true
351
+ await self.$refs.eticketbill.openETicket(res.data.id, self.row, '物联网收费')
352
+ // self.$CommonService.openEticket(res.data.id, '其他收费')
353
+ // self.$dispatch('success')
354
+ }
355
+ } else {
356
+ self.$dispatch('success', '物联网收费')
357
+ }
358
+ } catch (error) {
359
+ if (error.status === 301) {
360
+ self.$dispatch('refresh')
361
+ } else {
362
+ if (error) {
363
+ self.$showAlert(error, 'danger', 0)
364
+ }
365
+ }
366
+
367
+ self.$dispatch('refresh')
368
+ }
369
+ }
370
+ let asyncCardMeterCenter = async function (self) {
371
+ await self.$getConfig(self, 'IOTMeterCenter')
372
+ console.log('卡表收费config', self.config)
373
+
374
+ // 添加 “系统余额透支” 付款方式
375
+ let i = -1
376
+ for (const index in self.paytype) {
377
+ if (self.paytype[index].value == '系统余额透支') {
378
+ i = index
379
+ break
380
+ }
381
+ }
382
+ if (self.canOverdraftBalance()) {
383
+ if (i == -1) {
384
+ self.paytype.push({
385
+ label: '系统余额透支',
386
+ value: '系统余额透支'
387
+ })
388
+ }
389
+ } else {
390
+ if (i != -1) {
391
+ self.paytype.splice(i, 1)
392
+ }
393
+ }
394
+
395
+ // 默认打印格式
396
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
397
+ self.model.f_payment = [self.config.payment]
398
+ self.mulPrint = self.config.printType instanceof Array
399
+
400
+ // 获取当前票号用
401
+ self.model.f_use_type = self.config.billType
402
+ self.model.f_bill_type = self.model.f_print
403
+ self.hasValidateBill = self.config.hasBillManage
404
+
405
+ // 判断限购
406
+ let limit_param = {
407
+ f_userinfo_id: self.row.f_userinfo_id,
408
+ f_user_id: self.row.f_user_id,
409
+ f_stairprice_id: self.row.f_stairprice_id
410
+ }
411
+ let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
412
+ console.log('获取限购值', getLimit)
413
+ self.hasLimit = getLimit.data.hasLimit
414
+ if (self.hasLimit) {
415
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
416
+ if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
417
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
418
+ self.$dispatch('refresh')
419
+ } else {
420
+ if (getLimit.data.f_limit_value) {
421
+ self.maxgas = (getLimit.data.f_limit_value - 0)
422
+ self.limitgas = true
423
+ }
424
+ if (getLimit.data.f_limit_amount) {
425
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
426
+ self.limitmoney = true
427
+ }
428
+ }
429
+ }
430
+ }
431
+ }
432
+ export default {
433
+ title: '物联网收费',
434
+ data () {
435
+ return {
436
+ resid: [], // 存放新增的f_files表中id
437
+ config: {
438
+ notShowFormula: false, // 不显示计算公式,默认显示
439
+ priceCalculation: false, // 划气量控制
440
+ showupload: true, // 默认显示附件上传组件
441
+ hasPrint: false, // 默认打票
442
+ floor: true, // 是否取整收费
443
+ hasBillManage: false, // 默认不启用发票管理
444
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
445
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
446
+ payment: '',
447
+ overdraftBalance: false // 是否支持系统余额透支
448
+ },
449
+ model: {
450
+ f_purchase: 0,
451
+ f_payment: [],
452
+ f_pregas: 0,
453
+ f_preamount: 0,
454
+ f_totalcost: 0,
455
+ f_curbalance: 0,
456
+ f_collection: '',
457
+ f_balance: 0,
458
+ f_print: [],
459
+ f_meter_type: '',
460
+ f_voucher_number: '',
461
+ f_privilege_id: 0,
462
+ f_privilege_money: 0,
463
+ f_after_discount: 0,
464
+ f_sys_balance: 0
465
+ },
466
+ eticket_msg: false,
467
+ eticket_show: false,
468
+ invoice_is_pax: '不征税',
469
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
470
+
471
+ calculatedetail: '',
472
+ // 启用发票管理需要对票号进行验证
473
+ hasValidateBill: false,
474
+ validateOk: false,
475
+
476
+ print: false,
477
+ billData: {
478
+ url: 'rs/report/iot_bill',
479
+ operator: this.$login.f.name,
480
+ billnumber: ''
481
+ },
482
+ hasLimit: false,
483
+ maxgas: 99999999, // 限购
484
+ maxmoney: 99999999,
485
+ limitmoney: false,
486
+ limitgas: false,
487
+ paymentModel: [], // 多笔付款方式
488
+
489
+ mulPrint: false,
490
+ clickConfirm: false, // 控制确认按钮只能点击一次
491
+ // 下拉框值
492
+ paytype: this.$appdata.getParam('付款方式'),
493
+ printstyle: this.$appdata.getParam('打印格式'),
494
+ privilegeList: [{label: '无优惠', value: '0'}],
495
+ showfiles: false,
496
+ serialShow: false,
497
+ mjshow: false,
498
+ dymoney: 0
499
+ }
500
+ },
501
+ props: ['row'],
502
+ mounted () {
503
+ this.$refs.email.focus()
504
+ },
505
+ ready () {
506
+ this.paytype = this.$appdata.getParam('付款方式')
507
+ if (!this.$login.r.includes('免交充值付款')) {
508
+ this.paytype = this.paytype.filter((item) => {
509
+ return item.label != '免交'
510
+ })
511
+ }
512
+ // this.getPurchase()
513
+ this.model.f_price_id = this.row.f_price_id
514
+ this.model.f_user_id = this.row.f_user_id
515
+ this.model.f_userfiles_id = this.row.f_userfiles_id
516
+ this.model.f_userinfo_id = this.row.f_userinfo_id
517
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
518
+ this.model.f_preamount = ''
519
+ this.model.f_pregas = ''
520
+ document.getElementById('pregasFocue').focus()
521
+ asyncCardMeterCenter(this)
522
+ },
523
+ watch: {
524
+ 'model.f_payment.length' (val) {
525
+ console.log('付款方式多选。。', val)
526
+ if (val > 1 && !this.model.f_preamount) {
527
+ this.model.f_payment = ['现金缴费']
528
+ this.$showAlert('请先计算付款金额', 'warning', 2000)
529
+ } else {
530
+ this.paymentModel = []
531
+
532
+ this.model.f_payment.forEach((res) => {
533
+ let temp = {
534
+ f_payment: res,
535
+ f_money: 0
536
+ }
537
+ this.paymentModel.push(temp)
538
+ })
539
+ this.$resetValidation()
540
+
541
+ // 获取计算优惠
542
+ this.getPrivilegeList()
543
+ }
544
+ },
545
+ 'model.f_collection' (val) {
546
+ // 获取计算优惠
547
+ this.getPrivilegeList()
548
+ },
549
+ 'model.f_payment' (val) {
550
+ if (val == '免交') {
551
+ this.mjshow = true
552
+ } else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
553
+ if (this.row.f_collection_type == '按气量') {
554
+ this.pregas()
555
+ } else {
556
+ this.preamount()
557
+ }
558
+ } else {
559
+ this.mjshow = false
560
+ }
561
+ if (this.row.f_collection_type == '按气量') {
562
+ this.pregas()
563
+ } else {
564
+ this.preamount()
565
+ }
566
+ }
567
+ },
568
+ events: {
569
+ // 删除Resid数组元素
570
+ 'delResid' (val) {
571
+ this.resid.$remove({id: val, f_biobid: ''})
572
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
573
+ },
574
+ // 增加Resid数组元素
575
+ 'resid' (val) {
576
+ console.log('-=', val)
577
+ this.resid.push({id: val, f_biobid: ''})
578
+ }
579
+ },
580
+ methods: {
581
+ // 校验发票信息
582
+ checkInvoiceMsg () {
583
+ // 校验是否超出最大透支余额
584
+ if (this.model.f_payment == '系统余额透支') {
585
+ const maxOverdraftBalance = -(((this.$appdata.getSingleValue('最大透支余额') - 0) || 1000) - 0)
586
+ const curSysBalance = ((this.row.f_sys_balance || 0) - 0) - (this.model.f_totalcost - 0)
587
+ if (curSysBalance < maxOverdraftBalance) {
588
+ this.$showAlert('您的系统余额将超出最大透支余额,请使用别的付款方式!', 'danger', 5000)
589
+ return
590
+ }
591
+ this.model.f_sys_balance = curSysBalance
592
+ }
593
+
594
+ if (this.model.f_print[0] === '电子发票') {
595
+ if (!this.row.f_taxpayer_id) {
596
+ this.row.f_taxpayer_id = this.row.f_idnumber
597
+ }
598
+ if (!this.row.f_paper_name) {
599
+ this.row.f_paper_name = this.row.f_user_name
600
+ }
601
+ if (!this.row.f_address_phone) {
602
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
603
+ }
604
+ this.eticket_msg = true
605
+ } else {
606
+ this.confirm()
607
+ }
608
+ },
609
+ eticket_toggle () {
610
+ this.eticket_show = false
611
+ this.$dispatch('success', '物联网收费')
612
+ },
613
+ async confirm () {
614
+ let res = await this.$showMessage(`确定对客户${this.row.f_user_name}进行物联网表缴费吗?`, ['confirm', 'cancel'])
615
+ if (res != 'confirm') return
616
+ // 先调用付款码支付组件流程
617
+ let ss = await this.$refs.paymentcode.flowPath()
618
+ this.$refs.paymentcode.paymentCodeShow = false
619
+ console.log('付款码操作返回', ss)
620
+ if (!ss.result) return
621
+ this.eticket_msg = false
622
+ this.clickConfirm = true
623
+ this.model.f_curbalance = this.curbalance
624
+ this.$dispatch('no-button')
625
+ console.log('model and row', this.model, this.row)
626
+ this.model.f_userinfo_id = this.row.f_userinfo_id
627
+ this.model.f_userfiles_id = this.row.f_userfiles_id
628
+ this.model.f_user_id = this.row.f_user_id
629
+ this.model.userinfo_version = this.row.userinfo_version
630
+ this.model.version = this.row.version
631
+ this.model.f_total_fee = (this.row.f_total_fee - 0) + (this.model.f_preamount - 0)
632
+ this.model.f_total_gas = (this.row.f_total_gas - 0) + (this.model.f_pregas - 0)
633
+ this.model.f_operator = this.$login.f.name
634
+ this.model.f_operatorid = this.$login.f.id
635
+ this.model.f_orgid = this.$login.f.orgid
636
+ this.model.f_orgname = this.$login.f.orgs
637
+ this.model.f_depid = this.$login.f.depids
638
+ this.model.f_depname = this.$login.f.deps
639
+ IOTChargeGen(this)
640
+ },
641
+ clean () {
642
+ this.$info('取消操作')
643
+ this.$dispatch('refresh', this.row)
644
+ },
645
+ validateBill (val) {
646
+ this.validateOk = !val.isOk
647
+ this.billData.bill = val.bill
648
+ },
649
+ printok () {
650
+ // 收据打完,判断是否还有其他票据进行请求
651
+ for (let i = 0; i < this.model.f_print.length; i++) {
652
+ if (this.model.f_print[i] === '电子发票') {
653
+ this.$CommonService.openEticket(this.row.id, '售气收费')
654
+ }
655
+ }
656
+ this.$dispatch('success', '物联网收费')
657
+ },
658
+ pregas () {
659
+ this.dymoney = 0
660
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
661
+ try {
662
+ pregasGen(this)
663
+ } catch (error) {
664
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
665
+ this.$dispatch('error', '发卡售气', this.model, error)
666
+ }
667
+ } else {
668
+ this.model.f_pregas = null
669
+ }
670
+ },
671
+ preamount () {
672
+ if (this.model.f_preamount && this.model.f_preamount > 0) {
673
+ try {
674
+ preamountGen(this)
675
+ } catch (error) {
676
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
677
+ this.$dispatch('error', '发卡售气', this.model, error)
678
+ }
679
+ } else {
680
+ this.model.f_preamount = null
681
+ }
682
+ },
683
+ calText (val) {
684
+ let str = ''
685
+ val.forEach((item) => {
686
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
687
+ })
688
+ str = str.slice(0, str.length - 1)
689
+ this.calculatedetail = str
690
+ },
691
+ close () {
692
+ this.print = false
693
+ this.clean()
694
+ },
695
+ // 根据选择的付款方式 获取优惠列表
696
+ async getPrivilegeList () {
697
+ // 初始化下拉选择列表
698
+ this.privilegeList = [{label: '无优惠', value: '0'}]
699
+ // 初始为无优惠
700
+ this.model.f_privilege_id = '0'
701
+ if (this.model.f_payment && this.model.f_payment.length) {
702
+ // 查询条件
703
+ let payments = JSON.stringify(this.model.f_payment)
704
+ payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
705
+ let HttpReset = new HttpResetClass()
706
+ let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
707
+ data: {
708
+ items: 'id,f_privilege_name,f_privilege_type',
709
+ tablename: 't_privilege',
710
+ 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 = '有效'`,
711
+ orderitem: 'id'
712
+ }
713
+ }, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
714
+ // 查询结果放到下拉列表
715
+ for (let p of privilege.data) {
716
+ this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
717
+ }
718
+ this.privilegeCalculate()
719
+ }
720
+ },
721
+ // 优惠计算
722
+ async privilegeCalculate () {
723
+ // 初始化减免金额
724
+ this.model.f_privilege_money = 0
725
+ this.model.f_after_discount = this.model.f_collection
726
+ // 判断是否是自定义优惠
727
+ if (parseInt(this.data.f_privilege_id)) {
728
+ for (let p of this.privilegeList) {
729
+ if (p.value == this.data.f_privilege_id && p.type == '自定义') {
730
+ this.data.f_privilege_money = window.prompt('请输入你想优惠的金额')
731
+ if (!(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.data.f_privilege_money)) {
732
+ this.$showMessage('金额输入格式不正确!')
733
+ this.data.f_privilege_money = 0
734
+ return
735
+ }
736
+ if ((this.data.f_privilege_money - 0) >= this.data.f_collection) {
737
+ this.$showMessage('减免金额不能大于等于收款金额')
738
+ this.data.f_privilege_money = 0
739
+ return
740
+ }
741
+ }
742
+ }
743
+ }
744
+ // 优惠方式, 收款 缺一不计算
745
+ if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
746
+ let c = {
747
+ f_privilege_id: this.model.f_privilege_id,
748
+ f_collection: this.model.f_collection,
749
+ f_privilege_money: this.data.f_privilege_money
750
+ }
751
+ let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {resolveMsg: null, rejectMsg: '计算优惠金额出错'})
752
+ // 减免金额
753
+ this.model.f_privilege_money = privilegeData.data.f_privilege_money
754
+ // 减免后收款金额
755
+ this.model.f_after_discount = privilegeData.data.f_collection
756
+ }
757
+ },
758
+ // 判断当前用户是否可以使用系统余额透支
759
+ canOverdraftBalance () {
760
+ return this.config.overdraftBalance && this.row.f_user_type != '民用'
761
+ }
762
+ },
763
+ computed: {
764
+ authArr () {
765
+ return this.$login.r ? this.$login.r : []
766
+ },
767
+ 'curbalance' () {
768
+ if (this.model.f_payment == '赠气') {
769
+ return this.row.f_balance
770
+ }
771
+ if (this.model.f_preamount) {
772
+ return ((this.model.f_collection - 0) - (this.model.f_preamount - 0) + (this.row.f_balance - 0)).toFixed(2) - 0
773
+ } else {
774
+ return 0
775
+ }
776
+ },
777
+ 'islegal' () {
778
+ if (this.paymentModel.length > 1 && this.model.f_collection) {
779
+ let sum = 0
780
+ this.paymentModel.forEach((res) => {
781
+ sum += (res.f_money - 0)
782
+ })
783
+ return (this.model.f_collection - 0) === (sum - 0)
784
+ } else {
785
+ return true
786
+ }
787
+ }
788
+ }
789
+ }
790
+ </script>
791
+
792
+ <style>
793
+ </style>