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