sale-client 3.4.112 → 3.4.113

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 (93) hide show
  1. package/.gradle/{5.2.1 → 4.4}/fileChanges/last-build.bin +0 -0
  2. package/.gradle/{6.1.1 → 4.4}/fileHashes/fileHashes.bin +0 -0
  3. package/.gradle/4.4/fileHashes/fileHashes.lock +0 -0
  4. package/build/dev-server.js +3 -3
  5. package/{.gradle/5.2.1/gc.properties → npm} +0 -0
  6. package/package.json +1 -1
  7. package/src/components/FilesManage/MeterinfoTest.vue +904 -905
  8. package/src/components/FilesManage/TemplateManage.vue +167 -167
  9. package/src/components/FilesManage/UserGeneralInfoTest.vue +642 -640
  10. package/src/components/charge/business/CardChangeFill.vue +612 -612
  11. package/src/components/charge/business/CardMeterCenter.vue +899 -899
  12. package/src/components/charge/business/FilesComplete.vue +253 -253
  13. package/src/components/charge/business/refund/IOTRefund.vue +236 -236
  14. package/src/components/charge/business/refund/RefundManage.vue +28 -28
  15. package/src/components/charge/gasloss/gasLossOperate.vue +357 -357
  16. package/src/components/chargeNew/thirdSurplus.vue +2 -0
  17. package/src/components/revenue/Common/MeterMessage.vue +184 -184
  18. package/src/components/revenue/HandManager/MeterBookManage.vue +153 -153
  19. package/src/components/revenue/base/leftview/MixPriceInfo.vue +60 -60
  20. package/src/components/revenue/base/leftview/Mulitinfo.vue +74 -74
  21. package/src/components/revenue/base/leftview/SafeCheck.vue +311 -311
  22. package/src/components/revenue/base/leftview/Stairinfo.vue +156 -156
  23. package/src/components/revenue/base/leftview/meterinfodetail.vue +195 -195
  24. package/src/components/revenue/base/rightview/CardList.vue +477 -477
  25. package/src/components/revenue/comprehen/ComprehenOperation/MeterDisable/DisableManage.vue +93 -93
  26. package/src/components/revenue/comprehen/ComprehenOperation/MeterEnable/EnableManage.vue +184 -184
  27. package/src/components/revenue/comprehen/ComprehenOperation/OtherGas/OtherGas.vue +5 -1
  28. package/src/components/revenue/comprehen/ComprehenOperation/removeTable.vue +1 -1
  29. package/src/components/revenue/comprehen/Maintenance/hand/handListMaintain.vue +638 -638
  30. package/src/components/revenue/comprehen/Maintenance/revenue/StockListmain.vue +7 -7
  31. package/src/components/revenue/comprehen/Message/MessageList.vue +587 -587
  32. package/src/components/revenue/comprehen/SpecialUser/BlackList/BlackList.vue +1 -1
  33. package/src/components/revenue/comprehen/SpecialUser/BlackList/BlackListManage.vue +1 -1
  34. package/src/components/revenue/comprehen/StairPrice/GasPriceList.vue +303 -303
  35. package/src/components/revenue/comprehen/replacement/replacementHandInfoRecord.vue +155 -155
  36. package/src/components/revenue/comprehen/wechatpay/WeChat.vue +62 -62
  37. package/src/components/webMeter/MeterManage/WebMeterBatchOperationValve.vue +8 -4
  38. package/src/filiale/alashan/PrintBill.vue +116 -116
  39. package/src/filiale/jingwei/CardHand.vue +742 -742
  40. package/src/filiale/macheng/FilesManageNew/FileUserFiles.vue +743 -0
  41. package/src/filiale/macheng/FilesManageNew/UserEssentialInfoTest.vue +371 -371
  42. package/src/filiale/macheng/FilesManageNew/UserGeneralInfoTest.vue +596 -596
  43. package/src/filiale/macheng/UserEssentialInfoTest.vue +368 -366
  44. package/src/filiale/meihekou/MeterinfoTest.vue +0 -1
  45. package/src/filiale/meihekou/PrintBill.vue +140 -140
  46. package/src/filiale/meihekou/ReissueBill.vue +322 -322
  47. package/src/filiale/qianneng/FilesManage/MeterinfoTest.vue +0 -1
  48. package/src/filiale/qianneng/GasPriceList.vue +330 -330
  49. package/src/filiale/qianneng/HandManager.vue +1838 -1838
  50. package/src/filiale/qianneng/OtherChargeNew.vue +6 -2
  51. package/src/filiale/qianneng/sale.js +30 -32
  52. package/src/filiale/qingtongxia/UserGeneralInfoTest.vue +538 -533
  53. package/src/filiale/rongcheng/FilesManageNew/UserGeneralInfoTest.vue +608 -608
  54. package/src/filiale/rongchuang/OtherGas.vue +329 -329
  55. package/src/filiale/tongchuan/CardList.vue +482 -482
  56. package/src/filiale/tongchuan/MeterinfoTest.vue +892 -892
  57. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/AutomaticPurse.vue +298 -298
  58. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/CardHandRecord.vue +267 -267
  59. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/ChangeMeterQueryUser.vue +240 -240
  60. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/ChangeRecord.vue +235 -235
  61. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/ChargeQueryUser.vue +372 -372
  62. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/DeveiceRecord.vue +251 -251
  63. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/FillCardQueryUser.vue +209 -209
  64. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/HandQueryUser.vue +365 -365
  65. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/MachineRecordQuery.vue +252 -252
  66. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/OtherChargeQueryUser.vue +250 -250
  67. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/RecordQueryUser.vue +249 -249
  68. package/src/filiale/tongchuan/common/userinfo_detail/ic_detail/TransferQueryUser.vue +222 -222
  69. package/src/filiale/tongchuan/sale.js +107 -107
  70. package/src/filiale/zhongsheng/rightview/CardList.vue +492 -492
  71. package/src/filiale/zhongsheng/wechatpay/WeChatPayDetail.vue +469 -469
  72. package/src/main.js +1 -1
  73. package/src/plugins/CardService.js +1798 -1798
  74. package/src/plugins/ChangeMeterService.js +756 -756
  75. package/src/plugins/FileManageService.js +366 -366
  76. package/.gradle/5.2.1/fileHashes/fileHashes.lock +0 -0
  77. package/.gradle/6.1.1/executionHistory/executionHistory.bin +0 -0
  78. package/.gradle/6.1.1/executionHistory/executionHistory.lock +0 -0
  79. package/.gradle/6.1.1/fileChanges/last-build.bin +0 -0
  80. package/.gradle/6.1.1/fileHashes/fileHashes.lock +0 -0
  81. package/.gradle/6.1.1/gc.properties +0 -0
  82. package/.gradle/7.1/dependencies-accessors/dependencies-accessors.lock +0 -0
  83. package/.gradle/7.1/dependencies-accessors/gc.properties +0 -0
  84. package/.gradle/7.1/executionHistory/executionHistory.bin +0 -0
  85. package/.gradle/7.1/executionHistory/executionHistory.lock +0 -0
  86. package/.gradle/7.1/fileChanges/last-build.bin +0 -0
  87. package/.gradle/7.1/fileHashes/fileHashes.bin +0 -0
  88. package/.gradle/7.1/fileHashes/fileHashes.lock +0 -0
  89. package/.gradle/7.1/gc.properties +0 -0
  90. package/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
  91. package/.gradle/buildOutputCleanup/cache.properties +0 -2
  92. package/.gradle/checksums/checksums.lock +0 -0
  93. package/.gradle/vcs-1/gc.properties +0 -0
@@ -1,612 +1,612 @@
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" v-if="model.f_fill_gas > 0 || model.f_fill_money > 0">
7
- <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按气量'">
8
- <label for="f_pregas" class=" font_normal_body">应补气量</label>
9
- <input class="input_search" style="width:60%" type="number"
10
- v-model="model.f_fill_gas"
11
- placeholder="应补气量" disabled>
12
- </div>
13
- <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按金额'">
14
- <label for="f_pregas" class=" font_normal_body">应补金额</label>
15
- <input class="input_search" style="width:60%" type="number"
16
- v-model="model.f_fill_money"
17
- placeholder="应补金额" disabled>
18
- </div>
19
- </div>
20
- <!--<div v-show="remanentfalg">-->
21
- <!--<strong style="font-size: large" >【补气提示】:{{remanentstr}}</strong><br/>-->
22
- <!--</div>-->
23
- <div class="row" style="margin-top:10px;">
24
- <div class="col-sm-4 form-group">
25
- <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
26
- <v-select id="f_payment"
27
- v-model="f_payment"
28
- placeholder='请选择'
29
- :value.sync="model.f_payment"
30
- :options='paytype' clear-button></v-select>
31
- </div>
32
-
33
- <div class="col-sm-4 form-group"
34
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? '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="pregasBuy()" v-model="model.f_pregasBuy"
38
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
39
- v-next-el='sk' :disabled="row.f_collection_type !== '按气量'">
40
- </div>
41
-
42
- <div class="col-sm-4 form-group">
43
- <label for="f_preamount" class=" font_normal_body">预购金额</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
- </div>
48
- <div class="row" style="margin-top:6px;">
49
- <div class="col-sm-4 form-group">
50
- <!-- <print-style :print.sync='model.f_print'></print-style> -->
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 form-group"
64
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
65
- <label for="f_pregas" class=" font_normal_body">写卡气量</label>
66
- <input class="input_search" style="width:60%" type="number"
67
- v-model="model.f_pregas"
68
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="写卡气量"
69
- v-next-el='sk' disabled>
70
- </div>
71
- <div class="col-sm-4 form-group"
72
- :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
73
- <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
74
- class=" font_normal_body">应收金额</label>
75
- <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
76
- class=" font_normal_body">本次缴费</label>
77
- <input class="input_search" style="width:60%" type="number"
78
- @blur="preamount()" v-model="model.f_totalcost"
79
- v-validate:f_totalcost='{required: true, dctest: [(openFee - 0), ">=" ] }' placeholder="应收金额"
80
- v-next-el='sk' v-scale="[model.f_totalcost, 4]" :disabled="row.f_collection_type !== '按金额'">
81
- </div>
82
- <div class="col-sm-4 form-group" v-if="hasLimit">
83
- <label class="font_normal_body">购气上限</label>
84
- <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
85
- v-scale="[maxgas, 4]" placeholder='限购余气' disabled>
86
- </div>
87
- <!--<div class="col-sm-4 form-group" v-if="!hasLimit">-->
88
- <!--</div>-->
89
- <div class="row">
90
- <div class="col-sm-4 form-group">
91
- <label for="f_balance" class="font_normal_body">上期结余</label>
92
- <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
93
- v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
94
- </div>
95
- <div class="col-sm-4 form-group">
96
- <label for="f_curbalance" class="font_normal_body">本期结余</label>
97
- <input class="input_search" style="width:60%" type="number" v-model="curbalance"
98
- v-scale="[model.f_curbalance, 4]" placeholder="本期结余" disabled>
99
- </div>
100
-
101
- <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按气量'"
102
- :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
103
- <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&nbsp;&nbsp;款</font></label>
104
- <input class="input_search" style="width:60%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
105
- v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0) + (openFee - 0), ">=" ] }'
106
- v-el:sk v-scale="[model.f_collection, 4]">
107
- </div>
108
- <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按金额'">
109
- <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&nbsp;&nbsp;款</font></label>
110
- <input class="input_search" style="width:60%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
111
- v-el:sk v-scale="[model.f_collection, 4]" :disabled='true'>
112
- </div>
113
- </div>
114
- <!--<div class="row" v-if="openFee > 0">-->
115
- <!--<div class="col-sm-4 form-group">-->
116
- <!--<label class="font_normal_body">&nbsp;&nbsp;&nbsp;开卡费</label>-->
117
- <!--<input class="input_search" style="width:60%" style="width:60%" type="number" v-model="openFee" placeholder='开卡费' disabled>-->
118
- <!--</div>-->
119
- <!--</div>-->
120
- <div class="row" style="margin-top:5px;">
121
- <div class="col-sm-9">
122
- </div>
123
- <div class="col-sm-3">
124
- <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
125
- </div>
126
- </div>
127
- <div class="row" v-if="model.f_payment[0].includes('POS')">
128
- <div class="col-sm-4 form-group">
129
- <label for="f_voucher_number" class="font_normal_body">&nbsp;&nbsp;&nbsp;凭证号</label>
130
- <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
131
- </div>
132
- </div>
133
-
134
- <div class="row">
135
- <div class="col-sm-12">
136
- <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
137
- <input type="text" class="input_search" style="width:87%" v-model="model.f_comments" placeholder="备注"/>
138
- </div>
139
- </div>
140
- <div v-if="paymentModel.length >1">
141
- <div class="row" style="margin-top:10px;" >
142
- <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
143
- </div>
144
- <div class="row" style="margin-top:10px;" >
145
- <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
146
- <label class="font_normal_body">{{pay.f_payment}}:</label>
147
- <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
148
- </div>
149
- <div class="col-sm-4 form-group ">
150
- <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
151
- </div>
152
- </div>
153
- </div>
154
- </div>
155
- </form>
156
- <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
157
- <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close"
158
- :data='row' @printok="printok" v-ref:printbill></print-bill>
159
- <div style="text-align:right; height: 25%;">
160
- <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
161
- <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
162
- :payment.sync="model.f_payment" :payment-data="paytype"
163
- @confirm-payment="confirm()">
164
- </payment-code-button>
165
- <button class="button_search btn-gn" v-if="row.f_meter_type == '气量卡表' ? (model.f_pregas - 0) <= (model.f_fill_gas - 0) : (model.f_totalcost - 0) <= (model.f_fill_money - 0)" @click="confirm()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>补气</button>
166
- <button class="button_search btn-gn" v-if="row.f_meter_type == '气量卡表' ? (model.f_pregas - 0) > (model.f_fill_gas - 0) : (model.f_totalcost - 0) > (model.f_fill_money - 0)" style="min-width: max-content;" @click="confirm()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>补气并购气</button>
167
- <button class="button_clear btn-gn" @click="clean()" >取消</button>
168
- </div>
169
- </validator>
170
- </div>
171
-
172
- <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_collection"></payment-code>
173
- </div>
174
- <upload :blodid="blodid" v-if="config.showupload" isremark="true" fusetype="补气购气"></upload>
175
- </template>
176
- <script>
177
- /**
178
- *综合业务
179
- *发卡售气组件
180
- */
181
-
182
- import {HttpResetClass} from 'vue-client'
183
- import XML from '../../../plugins/ObjTree'
184
-
185
- let preamountGen = async function (self) {
186
- let calFee = (self.model.f_totalcost - 0) + (self.model.f_fill_money - 0)
187
- let getAmount = null
188
- if (((self.model.f_fill_money - 0)) < (calFee)) {
189
- let fee = calFee - (self.model.f_fill_money - 0)
190
- getAmount = await self.$CommonService.feeCalculate(self.model, fee)
191
- if (getAmount.data.gas) {
192
- if (self.row.f_isdecimal === '是') {
193
- if (self.row.f_alias === 'QiaoSong') {
194
- self.model.f_pregas = (getAmount.data.gas - 0).toFixed(1)
195
- } else {
196
- self.model.f_pregas = (getAmount.data.gas - 0).toFixed(4)
197
- }
198
- } else {
199
- self.model.f_pregas = parseInt(getAmount.data.gas - 0)
200
- }
201
- }
202
- self.model.f_preamount = calFee
203
- self.model.chargeprice = getAmount.data.chargeprice
204
- Object.assign(self.model, self.model, getAmount.data)
205
- self.model.f_collection = self.model.f_totalcost
206
- self.calText(getAmount.data.chargeprice)
207
- } else {
208
- self.model.f_pregas = 0
209
- self.model.f_totalcost = 0
210
- self.model.f_collection = 0
211
- }
212
- self.remstrgas()
213
- }
214
-
215
- let pregasGen = async function (self) {
216
- if (self.row.f_isdecimal === '是') {
217
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
218
- } else {
219
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
220
- }
221
- self.model.f_meter_type = self.row.f_meter_type
222
- // 判断限购
223
- if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
224
- if ((self.model.f_fill_gas - 0) < (self.model.f_pregas - 0)) {
225
- // 超出【补气气量不符】部分走划价
226
- let gas = self.model.f_pregas - self.model.f_fill_gas
227
- let getAmount = await self.$CommonService.gasCalculate(self.model, gas)
228
- console.log('划价返回', getAmount, self.openFee, self.row.f_balance)
229
- self.model.f_preamount = getAmount.data.chargenum
230
- // 计算气费和其他费用(暂时只有开卡费,之后有其他费在加)
231
- let total = (getAmount.data.chargenum - 0) + (self.openFee - 0)
232
- self.model.f_totalcost = (self.row.f_balance - 0) > (total - 0) ? 0 : ((total - 0) - (self.row.f_balance - 0)).toFixed(4)
233
- Object.assign(self.model, self.model, getAmount.data)
234
- self.model.chargeprice = getAmount.data.chargeprice
235
- self.model.f_collection = self.model.f_totalcost
236
- self.calText(getAmount.data.chargeprice)
237
- } else {
238
- // 否则不走划价
239
- self.model.f_preamount = 0
240
- self.model.f_totalcost = 0
241
- self.model.f_collection = 0
242
- }
243
- self.remstrgas()
244
- }
245
- }
246
-
247
- // 写卡操作
248
- let initCardGen = async function (self) {
249
- try {
250
- if (self.paymentModel.length === 0) {
251
- self.paymentModel = [{
252
- f_payment: self.model.f_payment[0],
253
- f_money: self.model.f_preamount
254
- }]
255
- }
256
- self.model.payments = self.paymentModel
257
- // 加入扫码盒付款码支付流水号
258
- self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
259
- let res = await self.$CardService.remanentinitCard(self.model, self.row, self.cardallot)
260
- console.log('换表发卡数据返回', res.data.sellid, res.data.fillgasid, res, self.model)
261
-
262
- // 开始打票
263
- if (self.config.hasPrint && res.data.sellid && res.data.fillgasid) {
264
- if (self.model.f_print.indexOf('电子发票') == -1) {
265
- if (self.config.hasBillManage) {
266
- // 启用发票管理,获取票据管理中的票号并存储记录
267
- console.log('进入票据之前。。', res.data.sellid)
268
- self.row.id = res.data.sellid
269
- self.row.fillgasid = res.data.fillgasid
270
- self.row.f_bill_type = '卡表收费'
271
- self.row.f_bill_style = self.model.f_print[0]
272
- self.print = true
273
- } else {
274
- self.row.id = res.data.sellid
275
- self.row.fillgasid = res.data.fillgasid
276
- self.print = true
277
- }
278
- } else {
279
- if (self.model.f_print[0] === '电子发票') {
280
- self.$CommonService.openEticket(res.data.id, '售气收费')
281
- self.$dispatch('success')
282
- }
283
- }
284
- } else if (self.config.hasPrint && res.data.sellid && !res.data.fillgasid) {
285
- self.billData.url = 'rs/report/card_bill'
286
- if (self.model.f_print.indexOf('电子发票') == -1) {
287
- if (self.config.hasBillManage) {
288
- // 启用发票管理,获取票据管理中的票号并存储记录
289
- self.row.id = res.data.sellid
290
- self.row.f_bill_type = '卡表收费'
291
- self.row.f_bill_style = self.model.f_print[0]
292
- self.print = true
293
- } else {
294
- self.row.id = res.data.sellid
295
- self.print = true
296
- }
297
- } else {
298
- if (self.model.f_print[0] === '电子发票') {
299
- self.$CommonService.openEticket(res.data.id, '售气收费')
300
- self.$dispatch('success')
301
- }
302
- }
303
- } else {
304
- self.$showAlert('补气购气成功', 'success', 2000)
305
- self.$dispatch('success')
306
- }
307
- self.clickConfirm = false
308
- } catch (error) {
309
- console.log('抛出的错误。。', error)
310
- self.$showAlert(error, 'danger', 0)
311
- self.$dispatch('refresh')
312
- self.clickConfirm = false
313
- }
314
- }
315
-
316
- let asyncShowCardSellGas = async function (self) {
317
- await self.$getConfig(self, 'CardMeterCenter')
318
- console.log('换表发卡config', self.config)
319
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
320
- self.model.f_payment = [self.config.payment]
321
- self.mulPrint = self.config.printType instanceof Array
322
-
323
- self.model.f_use_type = self.config.billType
324
- self.model.f_bill_type = self.model.f_print
325
- self.hasValidateBill = self.config.hasBillManage
326
-
327
- // 判断限购
328
- // 获取限购值
329
- let limit_param = {
330
- f_userinfo_id: self.row.f_userinfo_id,
331
- f_user_id: self.row.f_user_id,
332
- f_stairprice_id: self.row.f_stairprice_id
333
- }
334
- let http = new HttpResetClass()
335
- let getLimit = await http.load('POST', 'rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
336
- console.log('获取限购值', getLimit)
337
- self.hasLimit = getLimit.data.hasLimit
338
- if (self.hasLimit) {
339
- if (getLimit.data.f_limit_value < 0) {
340
- self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
341
- self.$dispatch('refresh')
342
- } else {
343
- self.maxgas = getLimit.data.f_limit_value
344
- }
345
- }
346
- }
347
-
348
- export default {
349
- title: '换表补气',
350
- data () {
351
- return {
352
- config: {
353
- notShowFormula: false, // 不显示计算公式,默认显示
354
- hasPrint: false, // 默认打票
355
- hasBillManage: false, // 默认不启用发票管理
356
- billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
357
- printType: '普通收据', // 收据/电子票/专用发票/国税发票
358
- payment: '现金缴费',
359
- showupload: false // 默认不显示上传附件
360
- },
361
- model: {
362
- // 真实补气量
363
- f_fill_gas: 0,
364
- f_fill_money: 0,
365
- f_stairprice_id: '',
366
- f_payment: '现金缴费',
367
- f_pregas: '',
368
- f_preamount: 0,
369
- f_totalcost: 0,
370
- f_balance: 0,
371
- f_curbalance: 0,
372
- f_collection: '',
373
- chargeprice: [],
374
- f_print: [],
375
- f_meter_type: '',
376
- f_voucher_number: ''
377
- },
378
- cardallot: null,
379
- calculatedetail: '',
380
- blodid: '',
381
- billData: {
382
- url: 'rs/report/card_gas_bill',
383
- bill: ''
384
- },
385
- print: false,
386
-
387
- // 是否有限购
388
- hasLimit: false,
389
- // 补气提示开关
390
- remanentfalg: false,
391
- // 补气提示
392
- remanentstr: '',
393
- // 启用发票管理需要对票号进行验证
394
- hasValidateBill: false,
395
- validateOk: false,
396
-
397
- maxgas: 99999999,
398
-
399
- clickConfirm: false,
400
-
401
- mulPrint: false, // 控制打印格式是否可以多选
402
- openFee: 0, // 是否有开卡费
403
- paymentModel: [], // 多笔付款方式
404
- paytype: this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : [],
405
- printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : []
406
- }
407
- },
408
-
409
- props: ['row'],
410
- async ready () {
411
- this.blodid = this.row.f_userinfo_id
412
- this.model.f_price_id = this.row.f_price_id
413
- this.model.f_user_id = this.row.f_user_id
414
- this.model.f_userfiles_id = this.row.f_userfiles_id
415
- this.model.f_userinfo_id = this.row.f_userinfo_id
416
- // 补气信息
417
- this.model.f_balance = this.row.f_balance
418
-
419
- let getResult = this.$CommonService.calRemanentMoney(this.row)
420
- if (this.row.f_collection_type === '按气量') {
421
- if (getResult > 0) {
422
- this.model.f_pregas = this.model.f_fill_gas = getResult
423
- this.model.f_preamount = 0
424
- } else {
425
- this.model.f_pregas = ''
426
- }
427
- } else {
428
- this.model.f_fill_money = getResult
429
- this.model.f_preamount = (this.model.f_fill_money - 0) + (this.row.f_balance - 0)
430
- if (this.row.f_meter_type.includes('金额')) {
431
- this.model.f_pregas = 0
432
- this.model.f_totalcost = 0
433
- }
434
- await preamountGen(this)
435
- }
436
-
437
- this.model.f_collection = 0
438
-
439
- await asyncShowCardSellGas(this)
440
- },
441
- watch: {
442
- 'row' (val) {
443
- this.model.f_balance = val.f_balance
444
- },
445
- 'model.f_payment.length' (val) {
446
- console.log('付款方式多选。。', val)
447
- if (val > 3) {
448
- this.$showAlert('目前只支持三种支付方式', 'warning', 2000)
449
- return
450
- }
451
- if (val > 1 && !this.model.f_preamount) {
452
- this.model.f_payment = ['现金缴费']
453
- this.$showAlert('请先计算付款金额', 'warning', 2000)
454
- } else {
455
- this.paymentModel = []
456
- this.model.f_payment.forEach((res) => {
457
- let temp = {
458
- f_payment: res,
459
- f_money: 0
460
- }
461
- this.paymentModel.push(temp)
462
- })
463
- this.$resetValidation()
464
- }
465
- }
466
- },
467
- methods: {
468
- confirm () {
469
- this.$dispatch('no-button')
470
- this.clickConfirm = true
471
- // 用于获取卡号
472
- console.log('开始换表发卡。。', this.model, this.row)
473
- this.$showMessage(`对客户${this.row.f_user_name}进行补气购气操作。请确保你已经插入了${this.row.f_meter_brand}的卡?`, ['confirm', 'cancel']).then(async (res) => {
474
- if (res === 'confirm') {
475
- // 先调用付款码支付组件流程
476
- let ss = await this.$refs.paymentcode.flowPath()
477
- this.$refs.paymentcode.paymentCodeShow = false
478
- console.log('付款码操作返回', ss)
479
- if (!ss.result) return
480
-
481
- initCardGen(this)
482
- } else {
483
- this.clickConfirm = false
484
- }
485
- })
486
- },
487
- clean () {
488
- this.$info('取消操作')
489
- this.$dispatch('refresh', this.row)
490
- },
491
- pregasBuy () {
492
- if (this.model.f_pregasBuy < 0) {
493
- this.model.f_pregasBuy = 0
494
- return
495
- }
496
- this.model.f_pregas = (this.model.f_fill_gas - 0 + (this.model.f_pregasBuy - 0)).toFixed(4) - 0
497
- this.pregas()
498
- },
499
- pregas () {
500
- if (this.model.f_pregas && this.model.f_pregas >= 0) {
501
- try {
502
- pregasGen(this)
503
- } catch (error) {
504
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
505
- this.$dispatch('error', '发卡售气', this.model, error)
506
- }
507
- } else {
508
- this.model.f_pregas = null
509
- }
510
- },
511
- preamount () {
512
- if (this.model.f_totalcost && this.model.f_totalcost > 0) {
513
- try {
514
- preamountGen(this)
515
- } catch (error) {
516
- this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
517
- this.$dispatch('error', '发卡售气', this.model, error)
518
- }
519
- } else {
520
- this.model.f_totalcost = null
521
- }
522
- },
523
-
524
- validateBill (val) {
525
- this.validateOk = !val.isOk
526
- this.billData.bill = val.bill
527
- },
528
- printok () {
529
- // 收据打完,判断是否还有其他票据进行请求
530
- for (let i = 0; i < this.model.f_print.length; i++) {
531
- if (this.model.f_print[i] === '电子发票') {
532
- this.$CommonService.openEticket(this.row.id, '售气收费')
533
- }
534
- }
535
- this.$dispatch('success')
536
- },
537
- remstrgas () {
538
- if (this.row.f_collection_type == '按气量') {
539
- if ((this.model.f_fill_gas - 0) > (this.model.f_pregas - 0) && this.model.f_pregas > 0) {
540
- this.remanentstr = '您已经成功抵扣' + this.model.f_pregas + '补气量!!,该气量不会产生任何费用'
541
- this.remanentfalg = true
542
- } else if ((this.model.f_fill_gas - 0) < (this.model.f_pregas - 0) && this.model.f_fill_gas > 0) {
543
- this.remanentstr = '您已经成功抵扣' + this.model.f_fill_gas + '补气量!!!,该气量不会产生任何费用,并且超出购买' + (this.model.f_pregas - this.model.f_fill_gas) +
544
- '方气量,超出部分产生费用!'
545
- this.remanentfalg = true
546
- } else {
547
- this.remanentfalg = false
548
- this.remanentstr = ''
549
- }
550
- } else {
551
- if ((this.model.f_fill_money - 0) > (this.model.f_preamount - 0) && this.model.f_preamount > 0) {
552
- this.remanentstr = '您已经成功抵扣' + this.model.f_preamount + '元!!!,本次不收取费用!!'
553
- this.remanentfalg = true
554
- } else if ((this.model.f_fill_money - 0) < (this.model.f_preamount - 0) && this.model.f_fill_money > 0) {
555
- this.remanentstr = '您已经成功抵扣' + this.model.f_fill_money + '元!!!,本次将收取' + ((this.model.f_preamount - 0) - (this.model.f_fill_money - 0) - (this.row.f_balance - 0)).toFixed(4) + '元!!!'
556
- this.remanentfalg = true
557
- } else {
558
- this.remanentfalg = false
559
- this.remanentstr = ''
560
- }
561
- }
562
- },
563
- calText (val) {
564
- let str = ''
565
- val.forEach((item) => {
566
- str = str + item.f_price + ' x ' + item.f_gas + '+'
567
- })
568
- str = str.slice(0, str.length - 1)
569
- this.calculatedetail = str
570
- },
571
- close () {
572
- this.showprint = false
573
- this.print = false
574
- this.clean()
575
- }
576
- },
577
- computed: {
578
- 'curbalance' () {
579
- console.log('查看model', this.model.f_preamount)
580
- if (this.model.f_preamount >= 0) {
581
- if (this.row.f_collection_type === '按金额') {
582
- return ((this.model.f_totalcost - 0) + (this.row.f_balance - 0) + (this.model.f_fill_money - 0) - (this.model.f_preamount - 0)).toFixed(4)
583
- } else {
584
- if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
585
- return ((this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
586
- } else {
587
- return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
588
- }
589
- }
590
- } else {
591
- console.log('走0了?')
592
- return 0
593
- }
594
- },
595
- 'islegal' () {
596
- if (this.paymentModel.length > 1 && this.model.f_collection) {
597
- let sum = 0
598
- this.paymentModel.forEach((res) => {
599
- sum += (res.f_money - 0)
600
- })
601
-
602
- return (this.model.f_collection - 0) === (sum - 0)
603
- } else {
604
- return true
605
- }
606
- }
607
- }
608
- }
609
- </script>
610
-
611
- <style>
612
- </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" v-if="model.f_fill_gas > 0 || model.f_fill_money > 0">
7
+ <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按气量'">
8
+ <label for="f_pregas" class=" font_normal_body">应补气量</label>
9
+ <input class="input_search" style="width:60%" type="number"
10
+ v-model="model.f_fill_gas"
11
+ placeholder="应补气量" disabled>
12
+ </div>
13
+ <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按金额'">
14
+ <label for="f_pregas" class=" font_normal_body">应补金额</label>
15
+ <input class="input_search" style="width:60%" type="number"
16
+ v-model="model.f_fill_money"
17
+ placeholder="应补金额" disabled>
18
+ </div>
19
+ </div>
20
+ <!--<div v-show="remanentfalg">-->
21
+ <!--<strong style="font-size: large" >【补气提示】:{{remanentstr}}</strong><br/>-->
22
+ <!--</div>-->
23
+ <div class="row" style="margin-top:10px;">
24
+ <div class="col-sm-4 form-group">
25
+ <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
26
+ <v-select id="f_payment"
27
+ v-model="f_payment"
28
+ placeholder='请选择'
29
+ :value.sync="model.f_payment"
30
+ :options='paytype' clear-button></v-select>
31
+ </div>
32
+
33
+ <div class="col-sm-4 form-group"
34
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? '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="pregasBuy()" v-model="model.f_pregasBuy"
38
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
39
+ v-next-el='sk' :disabled="row.f_collection_type !== '按气量'">
40
+ </div>
41
+
42
+ <div class="col-sm-4 form-group">
43
+ <label for="f_preamount" class=" font_normal_body">预购金额</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
+ </div>
48
+ <div class="row" style="margin-top:6px;">
49
+ <div class="col-sm-4 form-group">
50
+ <!-- <print-style :print.sync='model.f_print'></print-style> -->
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 form-group"
64
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
65
+ <label for="f_pregas" class=" font_normal_body">写卡气量</label>
66
+ <input class="input_search" style="width:60%" type="number"
67
+ v-model="model.f_pregas"
68
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="写卡气量"
69
+ v-next-el='sk' disabled>
70
+ </div>
71
+ <div class="col-sm-4 form-group"
72
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
73
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
74
+ class=" font_normal_body">应收金额</label>
75
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
76
+ class=" font_normal_body">本次缴费</label>
77
+ <input class="input_search" style="width:60%" type="number"
78
+ @blur="preamount()" v-model="model.f_totalcost"
79
+ v-validate:f_totalcost='{required: true, dctest: [(openFee - 0), ">=" ] }' placeholder="应收金额"
80
+ v-next-el='sk' v-scale="[model.f_totalcost, 4]" :disabled="row.f_collection_type !== '按金额'">
81
+ </div>
82
+ <div class="col-sm-4 form-group" v-if="hasLimit">
83
+ <label class="font_normal_body">购气上限</label>
84
+ <input class="input_search" style="width:60%" style="width:60%" type="number" v-model="maxgas"
85
+ v-scale="[maxgas, 4]" placeholder='限购余气' disabled>
86
+ </div>
87
+ <!--<div class="col-sm-4 form-group" v-if="!hasLimit">-->
88
+ <!--</div>-->
89
+ <div class="row">
90
+ <div class="col-sm-4 form-group">
91
+ <label for="f_balance" class="font_normal_body">上期结余</label>
92
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
93
+ v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
94
+ </div>
95
+ <div class="col-sm-4 form-group">
96
+ <label for="f_curbalance" class="font_normal_body">本期结余</label>
97
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
98
+ v-scale="[model.f_curbalance, 4]" placeholder="本期结余" disabled>
99
+ </div>
100
+
101
+ <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按气量'"
102
+ :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
103
+ <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&nbsp;&nbsp;款</font></label>
104
+ <input class="input_search" style="width:60%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
105
+ v-validate:f_collection='{required: true, dctest: [(model.f_totalcost - 0) + (openFee - 0), ">=" ] }'
106
+ v-el:sk v-scale="[model.f_collection, 4]">
107
+ </div>
108
+ <div class="col-sm-4 form-group" v-if="row.f_collection_type === '按金额'">
109
+ <label for="f_collection" class=" font_normal_body"><font size="4px" style="font-weight:bold">*收&nbsp;&nbsp;款</font></label>
110
+ <input class="input_search" style="width:60%;font-size: 18px;font-weight:bold;" type="number" v-model="model.f_collection"
111
+ v-el:sk v-scale="[model.f_collection, 4]" :disabled='true'>
112
+ </div>
113
+ </div>
114
+ <!--<div class="row" v-if="openFee > 0">-->
115
+ <!--<div class="col-sm-4 form-group">-->
116
+ <!--<label class="font_normal_body">&nbsp;&nbsp;&nbsp;开卡费</label>-->
117
+ <!--<input class="input_search" style="width:60%" style="width:60%" type="number" v-model="openFee" placeholder='开卡费' disabled>-->
118
+ <!--</div>-->
119
+ <!--</div>-->
120
+ <div class="row" style="margin-top:5px;">
121
+ <div class="col-sm-9">
122
+ </div>
123
+ <div class="col-sm-3">
124
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
125
+ </div>
126
+ </div>
127
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
128
+ <div class="col-sm-4 form-group">
129
+ <label for="f_voucher_number" class="font_normal_body">&nbsp;&nbsp;&nbsp;凭证号</label>
130
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number" placeholder="凭证号">
131
+ </div>
132
+ </div>
133
+
134
+ <div class="row">
135
+ <div class="col-sm-12">
136
+ <label for="f_comments" class="font_normal_body">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
137
+ <input type="text" class="input_search" style="width:87%" v-model="model.f_comments" placeholder="备注"/>
138
+ </div>
139
+ </div>
140
+ <div v-if="paymentModel.length >1">
141
+ <div class="row" style="margin-top:10px;" >
142
+ <p class="col-sm-2 text-left" style="padding: 10px;"><img src="../../../../static/juxing.png"/><strong style="margin-left: 4%">付款明细</strong></p>
143
+ </div>
144
+ <div class="row" style="margin-top:10px;" >
145
+ <div class="col-sm-4 form-group " v-for="pay in paymentModel" >
146
+ <label class="font_normal_body">{{pay.f_payment}}:</label>
147
+ <input id="f_money" type="text" class="input_search" style="width:60%" v-model="pay.f_money">
148
+ </div>
149
+ <div class="col-sm-4 form-group ">
150
+ <strong v-if="!islegal" style="color: red">所输入的金额必须等于收款金额</strong>
151
+ </div>
152
+ </div>
153
+ </div>
154
+ </div>
155
+ </form>
156
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
157
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close"
158
+ :data='row' @printok="printok" v-ref:printbill></print-bill>
159
+ <div style="text-align:right; height: 25%;">
160
+ <strong style="font-size: large" v-if="!config.notShowFormula">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
161
+ <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"
162
+ :payment.sync="model.f_payment" :payment-data="paytype"
163
+ @confirm-payment="confirm()">
164
+ </payment-code-button>
165
+ <button class="button_search btn-gn" v-if="row.f_meter_type == '气量卡表' ? (model.f_pregas - 0) <= (model.f_fill_gas - 0) : (model.f_totalcost - 0) <= (model.f_fill_money - 0)" @click="confirm()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>补气</button>
166
+ <button class="button_search btn-gn" v-if="row.f_meter_type == '气量卡表' ? (model.f_pregas - 0) > (model.f_fill_gas - 0) : (model.f_totalcost - 0) > (model.f_fill_money - 0)" style="min-width: max-content;" @click="confirm()" :disabled='!$v.valid || validateOk || !islegal || clickConfirm'>补气并购气</button>
167
+ <button class="button_clear btn-gn" @click="clean()" >取消</button>
168
+ </div>
169
+ </validator>
170
+ </div>
171
+
172
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_collection"></payment-code>
173
+ </div>
174
+ <upload :blodid="blodid" v-if="config.showupload" isremark="true" fusetype="补气购气"></upload>
175
+ </template>
176
+ <script>
177
+ /**
178
+ *综合业务
179
+ *发卡售气组件
180
+ */
181
+
182
+ import {HttpResetClass} from 'vue-client'
183
+ import XML from '../../../plugins/ObjTree'
184
+
185
+ let preamountGen = async function (self) {
186
+ let calFee = (self.model.f_totalcost - 0) + (self.model.f_fill_money - 0)
187
+ let getAmount = null
188
+ if (((self.model.f_fill_money - 0)) < (calFee)) {
189
+ let fee = calFee - (self.model.f_fill_money - 0)
190
+ getAmount = await self.$CommonService.feeCalculate(self.model, fee)
191
+ if (getAmount.data.gas) {
192
+ if (self.row.f_isdecimal === '是') {
193
+ if (self.row.f_alias === 'QiaoSong') {
194
+ self.model.f_pregas = (getAmount.data.gas - 0).toFixed(1)
195
+ } else {
196
+ self.model.f_pregas = (getAmount.data.gas - 0).toFixed(4)
197
+ }
198
+ } else {
199
+ self.model.f_pregas = parseInt(getAmount.data.gas - 0)
200
+ }
201
+ }
202
+ self.model.f_preamount = calFee
203
+ self.model.chargeprice = getAmount.data.chargeprice
204
+ Object.assign(self.model, self.model, getAmount.data)
205
+ self.model.f_collection = self.model.f_totalcost
206
+ self.calText(getAmount.data.chargeprice)
207
+ } else {
208
+ self.model.f_pregas = 0
209
+ self.model.f_totalcost = 0
210
+ self.model.f_collection = 0
211
+ }
212
+ self.remstrgas()
213
+ }
214
+
215
+ let pregasGen = async function (self) {
216
+ if (self.row.f_isdecimal === '是') {
217
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
218
+ } else {
219
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
220
+ }
221
+ self.model.f_meter_type = self.row.f_meter_type
222
+ // 判断限购
223
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
224
+ if ((self.model.f_fill_gas - 0) < (self.model.f_pregas - 0)) {
225
+ // 超出【补气气量不符】部分走划价
226
+ let gas = self.model.f_pregas - self.model.f_fill_gas
227
+ let getAmount = await self.$CommonService.gasCalculate(self.model, gas)
228
+ console.log('划价返回', getAmount, self.openFee, self.row.f_balance)
229
+ self.model.f_preamount = getAmount.data.chargenum
230
+ // 计算气费和其他费用(暂时只有开卡费,之后有其他费在加)
231
+ let total = (getAmount.data.chargenum - 0) + (self.openFee - 0)
232
+ self.model.f_totalcost = (self.row.f_balance - 0) > (total - 0) ? 0 : ((total - 0) - (self.row.f_balance - 0)).toFixed(4)
233
+ Object.assign(self.model, self.model, getAmount.data)
234
+ self.model.chargeprice = getAmount.data.chargeprice
235
+ self.model.f_collection = self.model.f_totalcost
236
+ self.calText(getAmount.data.chargeprice)
237
+ } else {
238
+ // 否则不走划价
239
+ self.model.f_preamount = 0
240
+ self.model.f_totalcost = 0
241
+ self.model.f_collection = 0
242
+ }
243
+ self.remstrgas()
244
+ }
245
+ }
246
+
247
+ // 写卡操作
248
+ let initCardGen = async function (self) {
249
+ try {
250
+ if (self.paymentModel.length === 0) {
251
+ self.paymentModel = [{
252
+ f_payment: self.model.f_payment[0],
253
+ f_money: self.model.f_preamount
254
+ }]
255
+ }
256
+ self.model.payments = self.paymentModel
257
+ // 加入扫码盒付款码支付流水号
258
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
259
+ let res = await self.$CardService.remanentinitCard(self.model, self.row, self.cardallot)
260
+ console.log('换表发卡数据返回', res.data.sellid, res.data.fillgasid, res, self.model)
261
+
262
+ // 开始打票
263
+ if (self.config.hasPrint && res.data.sellid && res.data.fillgasid) {
264
+ if (self.model.f_print.indexOf('电子发票') == -1) {
265
+ if (self.config.hasBillManage) {
266
+ // 启用发票管理,获取票据管理中的票号并存储记录
267
+ console.log('进入票据之前。。', res.data.sellid)
268
+ self.row.id = res.data.sellid
269
+ self.row.fillgasid = res.data.fillgasid
270
+ self.row.f_bill_type = '卡表收费'
271
+ self.row.f_bill_style = self.model.f_print[0]
272
+ self.print = true
273
+ } else {
274
+ self.row.id = res.data.sellid
275
+ self.row.fillgasid = res.data.fillgasid
276
+ self.print = true
277
+ }
278
+ } else {
279
+ if (self.model.f_print[0] === '电子发票') {
280
+ self.$CommonService.openEticket(res.data.id, '售气收费')
281
+ self.$dispatch('success')
282
+ }
283
+ }
284
+ } else if (self.config.hasPrint && res.data.sellid && !res.data.fillgasid) {
285
+ self.billData.url = 'rs/report/card_bill'
286
+ if (self.model.f_print.indexOf('电子发票') == -1) {
287
+ if (self.config.hasBillManage) {
288
+ // 启用发票管理,获取票据管理中的票号并存储记录
289
+ self.row.id = res.data.sellid
290
+ self.row.f_bill_type = '卡表收费'
291
+ self.row.f_bill_style = self.model.f_print[0]
292
+ self.print = true
293
+ } else {
294
+ self.row.id = res.data.sellid
295
+ self.print = true
296
+ }
297
+ } else {
298
+ if (self.model.f_print[0] === '电子发票') {
299
+ self.$CommonService.openEticket(res.data.id, '售气收费')
300
+ self.$dispatch('success')
301
+ }
302
+ }
303
+ } else {
304
+ self.$showAlert('补气购气成功', 'success', 2000)
305
+ self.$dispatch('success')
306
+ }
307
+ self.clickConfirm = false
308
+ } catch (error) {
309
+ console.log('抛出的错误。。', error)
310
+ self.$showAlert(error, 'danger', 0)
311
+ self.$dispatch('refresh')
312
+ self.clickConfirm = false
313
+ }
314
+ }
315
+
316
+ let asyncShowCardSellGas = async function (self) {
317
+ await self.$getConfig(self, 'CardMeterCenter')
318
+ console.log('换表发卡config', self.config)
319
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
320
+ self.model.f_payment = [self.config.payment]
321
+ self.mulPrint = self.config.printType instanceof Array
322
+
323
+ self.model.f_use_type = self.config.billType
324
+ self.model.f_bill_type = self.model.f_print
325
+ self.hasValidateBill = self.config.hasBillManage
326
+
327
+ // 判断限购
328
+ // 获取限购值
329
+ let limit_param = {
330
+ f_userinfo_id: self.row.f_userinfo_id,
331
+ f_user_id: self.row.f_user_id,
332
+ f_stairprice_id: self.row.f_stairprice_id
333
+ }
334
+ let http = new HttpResetClass()
335
+ let getLimit = await http.load('POST', 'rs/logic/sale_getLimitGas', {data: limit_param}, {resolveMsg: null, rejectMsg: '获取限购值失败!!'})
336
+ console.log('获取限购值', getLimit)
337
+ self.hasLimit = getLimit.data.hasLimit
338
+ if (self.hasLimit) {
339
+ if (getLimit.data.f_limit_value < 0) {
340
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
341
+ self.$dispatch('refresh')
342
+ } else {
343
+ self.maxgas = getLimit.data.f_limit_value
344
+ }
345
+ }
346
+ }
347
+
348
+ export default {
349
+ title: '换表补气',
350
+ data () {
351
+ return {
352
+ config: {
353
+ notShowFormula: false, // 不显示计算公式,默认显示
354
+ hasPrint: false, // 默认打票
355
+ hasBillManage: false, // 默认不启用发票管理
356
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
357
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
358
+ payment: '现金缴费',
359
+ showupload: false // 默认不显示上传附件
360
+ },
361
+ model: {
362
+ // 真实补气量
363
+ f_fill_gas: 0,
364
+ f_fill_money: 0,
365
+ f_stairprice_id: '',
366
+ f_payment: '现金缴费',
367
+ f_pregas: '',
368
+ f_preamount: 0,
369
+ f_totalcost: 0,
370
+ f_balance: 0,
371
+ f_curbalance: 0,
372
+ f_collection: '',
373
+ chargeprice: [],
374
+ f_print: [],
375
+ f_meter_type: '',
376
+ f_voucher_number: ''
377
+ },
378
+ cardallot: null,
379
+ calculatedetail: '',
380
+ blodid: '',
381
+ billData: {
382
+ url: 'rs/report/card_gas_bill',
383
+ bill: ''
384
+ },
385
+ print: false,
386
+
387
+ // 是否有限购
388
+ hasLimit: false,
389
+ // 补气提示开关
390
+ remanentfalg: false,
391
+ // 补气提示
392
+ remanentstr: '',
393
+ // 启用发票管理需要对票号进行验证
394
+ hasValidateBill: false,
395
+ validateOk: false,
396
+
397
+ maxgas: 99999999,
398
+
399
+ clickConfirm: false,
400
+
401
+ mulPrint: false, // 控制打印格式是否可以多选
402
+ openFee: 0, // 是否有开卡费
403
+ paymentModel: [], // 多笔付款方式
404
+ paytype: this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : [],
405
+ printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : []
406
+ }
407
+ },
408
+
409
+ props: ['row'],
410
+ async ready () {
411
+ this.blodid = this.row.f_userinfo_id
412
+ this.model.f_price_id = this.row.f_price_id
413
+ this.model.f_user_id = this.row.f_user_id
414
+ this.model.f_userfiles_id = this.row.f_userfiles_id
415
+ this.model.f_userinfo_id = this.row.f_userinfo_id
416
+ // 补气信息
417
+ this.model.f_balance = this.row.f_balance
418
+
419
+ let getResult = this.$CommonService.calRemanentMoney(this.row)
420
+ if (this.row.f_collection_type === '按气量') {
421
+ if (getResult > 0) {
422
+ this.model.f_pregas = this.model.f_fill_gas = getResult
423
+ this.model.f_preamount = 0
424
+ } else {
425
+ this.model.f_pregas = ''
426
+ }
427
+ } else {
428
+ this.model.f_fill_money = getResult
429
+ this.model.f_preamount = (this.model.f_fill_money - 0) + (this.row.f_balance - 0)
430
+ if (this.row.f_meter_type.includes('金额')) {
431
+ this.model.f_pregas = 0
432
+ this.model.f_totalcost = 0
433
+ }
434
+ await preamountGen(this)
435
+ }
436
+
437
+ this.model.f_collection = 0
438
+
439
+ await asyncShowCardSellGas(this)
440
+ },
441
+ watch: {
442
+ 'row' (val) {
443
+ this.model.f_balance = val.f_balance
444
+ },
445
+ 'model.f_payment.length' (val) {
446
+ console.log('付款方式多选。。', val)
447
+ if (val > 3) {
448
+ this.$showAlert('目前只支持三种支付方式', 'warning', 2000)
449
+ return
450
+ }
451
+ if (val > 1 && !this.model.f_preamount) {
452
+ this.model.f_payment = ['现金缴费']
453
+ this.$showAlert('请先计算付款金额', 'warning', 2000)
454
+ } else {
455
+ this.paymentModel = []
456
+ this.model.f_payment.forEach((res) => {
457
+ let temp = {
458
+ f_payment: res,
459
+ f_money: 0
460
+ }
461
+ this.paymentModel.push(temp)
462
+ })
463
+ this.$resetValidation()
464
+ }
465
+ }
466
+ },
467
+ methods: {
468
+ confirm () {
469
+ this.$dispatch('no-button')
470
+ this.clickConfirm = true
471
+ // 用于获取卡号
472
+ console.log('开始换表发卡。。', this.model, this.row)
473
+ this.$showMessage(`对客户${this.row.f_user_name}进行补气购气操作。请确保你已经插入了${this.row.f_meter_brand}的卡?`, ['confirm', 'cancel']).then(async (res) => {
474
+ if (res === 'confirm') {
475
+ // 先调用付款码支付组件流程
476
+ let ss = await this.$refs.paymentcode.flowPath()
477
+ this.$refs.paymentcode.paymentCodeShow = false
478
+ console.log('付款码操作返回', ss)
479
+ if (!ss.result) return
480
+
481
+ initCardGen(this)
482
+ } else {
483
+ this.clickConfirm = false
484
+ }
485
+ })
486
+ },
487
+ clean () {
488
+ this.$info('取消操作')
489
+ this.$dispatch('refresh', this.row)
490
+ },
491
+ pregasBuy () {
492
+ if (this.model.f_pregasBuy < 0) {
493
+ this.model.f_pregasBuy = 0
494
+ return
495
+ }
496
+ this.model.f_pregas = (this.model.f_fill_gas - 0 + (this.model.f_pregasBuy - 0)).toFixed(4) - 0
497
+ this.pregas()
498
+ },
499
+ pregas () {
500
+ if (this.model.f_pregas && this.model.f_pregas >= 0) {
501
+ try {
502
+ pregasGen(this)
503
+ } catch (error) {
504
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
505
+ this.$dispatch('error', '发卡售气', this.model, error)
506
+ }
507
+ } else {
508
+ this.model.f_pregas = null
509
+ }
510
+ },
511
+ preamount () {
512
+ if (this.model.f_totalcost && this.model.f_totalcost > 0) {
513
+ try {
514
+ preamountGen(this)
515
+ } catch (error) {
516
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
517
+ this.$dispatch('error', '发卡售气', this.model, error)
518
+ }
519
+ } else {
520
+ this.model.f_totalcost = null
521
+ }
522
+ },
523
+
524
+ validateBill (val) {
525
+ this.validateOk = !val.isOk
526
+ this.billData.bill = val.bill
527
+ },
528
+ printok () {
529
+ // 收据打完,判断是否还有其他票据进行请求
530
+ for (let i = 0; i < this.model.f_print.length; i++) {
531
+ if (this.model.f_print[i] === '电子发票') {
532
+ this.$CommonService.openEticket(this.row.id, '售气收费')
533
+ }
534
+ }
535
+ this.$dispatch('success')
536
+ },
537
+ remstrgas () {
538
+ if (this.row.f_collection_type == '按气量') {
539
+ if ((this.model.f_fill_gas - 0) > (this.model.f_pregas - 0) && this.model.f_pregas > 0) {
540
+ this.remanentstr = '您已经成功抵扣' + this.model.f_pregas + '补气量!!,该气量不会产生任何费用'
541
+ this.remanentfalg = true
542
+ } else if ((this.model.f_fill_gas - 0) < (this.model.f_pregas - 0) && this.model.f_fill_gas > 0) {
543
+ this.remanentstr = '您已经成功抵扣' + this.model.f_fill_gas + '补气量!!!,该气量不会产生任何费用,并且超出购买' + (this.model.f_pregas - this.model.f_fill_gas) +
544
+ '方气量,超出部分产生费用!'
545
+ this.remanentfalg = true
546
+ } else {
547
+ this.remanentfalg = false
548
+ this.remanentstr = ''
549
+ }
550
+ } else {
551
+ if ((this.model.f_fill_money - 0) > (this.model.f_preamount - 0) && this.model.f_preamount > 0) {
552
+ this.remanentstr = '您已经成功抵扣' + this.model.f_preamount + '元!!!,本次不收取费用!!'
553
+ this.remanentfalg = true
554
+ } else if ((this.model.f_fill_money - 0) < (this.model.f_preamount - 0) && this.model.f_fill_money > 0) {
555
+ this.remanentstr = '您已经成功抵扣' + this.model.f_fill_money + '元!!!,本次将收取' + ((this.model.f_preamount - 0) - (this.model.f_fill_money - 0) - (this.row.f_balance - 0)).toFixed(4) + '元!!!'
556
+ this.remanentfalg = true
557
+ } else {
558
+ this.remanentfalg = false
559
+ this.remanentstr = ''
560
+ }
561
+ }
562
+ },
563
+ calText (val) {
564
+ let str = ''
565
+ val.forEach((item) => {
566
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
567
+ })
568
+ str = str.slice(0, str.length - 1)
569
+ this.calculatedetail = str
570
+ },
571
+ close () {
572
+ this.showprint = false
573
+ this.print = false
574
+ this.clean()
575
+ }
576
+ },
577
+ computed: {
578
+ 'curbalance' () {
579
+ console.log('查看model', this.model.f_preamount)
580
+ if (this.model.f_preamount >= 0) {
581
+ if (this.row.f_collection_type === '按金额') {
582
+ return ((this.model.f_totalcost - 0) + (this.row.f_balance - 0) + (this.model.f_fill_money - 0) - (this.model.f_preamount - 0)).toFixed(4)
583
+ } else {
584
+ if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
585
+ return ((this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
586
+ } else {
587
+ return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
588
+ }
589
+ }
590
+ } else {
591
+ console.log('走0了?')
592
+ return 0
593
+ }
594
+ },
595
+ 'islegal' () {
596
+ if (this.paymentModel.length > 1 && this.model.f_collection) {
597
+ let sum = 0
598
+ this.paymentModel.forEach((res) => {
599
+ sum += (res.f_money - 0)
600
+ })
601
+
602
+ return (this.model.f_collection - 0) === (sum - 0)
603
+ } else {
604
+ return true
605
+ }
606
+ }
607
+ }
608
+ }
609
+ </script>
610
+
611
+ <style>
612
+ </style>