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