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