sale-client 4.2.33 → 4.2.35
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.
|
@@ -194,10 +194,10 @@
|
|
|
194
194
|
<div style="text-align:right; height: 25%">
|
|
195
195
|
<strong style="color:red;margin-right: 5px">{{ $refs.givechange.promptText }}</strong>
|
|
196
196
|
<strong style="font-size: large">计算公式:{{calculatedetail ? calculatedetail : ' 暂无'}}</strong><br/>
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
197
|
+
<!-- <payment-code-button :clickable="!$v.valid || validateOk || !islegal || clickConfirm"-->
|
|
198
|
+
<!-- :payment.sync="model.f_payment" :payment-data="paytype"-->
|
|
199
|
+
<!-- @confirm-payment="confirm()">-->
|
|
200
|
+
<!-- </payment-code-button>-->
|
|
201
201
|
<button class="button_search btn-gn" type="submit" @click="confirm()"
|
|
202
202
|
:disabled='!$v.valid || validateOk || !islegal || clickConfirm'>确认
|
|
203
203
|
</button>
|
|
@@ -211,21 +211,21 @@
|
|
|
211
211
|
<upload :blodid="blodid" v-if="config.showupload" isremark="true" fusetype="卡表收费"></upload>
|
|
212
212
|
</template>
|
|
213
213
|
<script>
|
|
214
|
-
import {HttpResetClass} from 'vue-client'
|
|
215
|
-
import XML from '../../../plugins/ObjTree'
|
|
214
|
+
import {HttpResetClass} from 'vue-client'
|
|
215
|
+
import XML from '../../../plugins/ObjTree'
|
|
216
216
|
|
|
217
|
-
/**
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
/**
|
|
218
|
+
*综合业务
|
|
219
|
+
*卡表收费组件
|
|
220
|
+
*/
|
|
221
221
|
|
|
222
|
-
|
|
223
|
-
let preamountGen = async function (self) {
|
|
222
|
+
// 输入金额,换算气量
|
|
223
|
+
let preamountGen = async function (self) {
|
|
224
224
|
let calFee = ((self.model.f_preamount - 0) + (self.model.f_balance - 0)).toFixed(4)
|
|
225
225
|
if (self.model.f_payment == '赠气') {
|
|
226
226
|
calFee = (self.model.f_preamount - 0).toFixed(4)
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
// 通过金额进行划价
|
|
229
229
|
let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
|
|
230
230
|
if (getGas.data.gas) {
|
|
231
231
|
if (self.row.f_isdecimal === '是') {
|
|
@@ -241,7 +241,7 @@ let preamountGen = async function (self) {
|
|
|
241
241
|
self.dymoney = (getGas.data.chargenum - 0).toFixed(4) - (dymoney2.data.chargenum - 0).toFixed(4)
|
|
242
242
|
}
|
|
243
243
|
} else {
|
|
244
|
-
|
|
244
|
+
// 如果不支持小数,将划价出的多余非整数气量进行划价为金额
|
|
245
245
|
let tempnum = Math.floor(getGas.data.gas - 0)
|
|
246
246
|
let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
|
|
247
247
|
self.dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(2)
|
|
@@ -263,506 +263,506 @@ let preamountGen = async function (self) {
|
|
|
263
263
|
self.calText(getGas.data.chargeprice)
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
-
// 输入气量,换算金额
|
|
267
|
-
let pregasGen = async function (self) {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
} else {
|
|
271
|
-
self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
|
|
272
|
-
}
|
|
273
|
-
if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
|
|
274
|
-
self.model.f_meter_type = self.row.f_meter_type
|
|
275
|
-
let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
|
|
276
|
-
self.model.f_preamount = getAmount.data.chargenum
|
|
277
|
-
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))
|
|
278
|
-
Object.assign(self.model, self.model, getAmount.data)
|
|
279
|
-
self.model.chargeprice = getAmount.data.chargeprice
|
|
280
|
-
if (self.model.f_payment == '赠气') {
|
|
281
|
-
self.model.f_totalcost = getAmount.data.chargenum
|
|
282
|
-
self.model.f_collection = 0
|
|
266
|
+
// 输入气量,换算金额
|
|
267
|
+
let pregasGen = async function (self) {
|
|
268
|
+
if (self.row.f_isdecimal === '是') {
|
|
269
|
+
self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
|
|
283
270
|
} else {
|
|
284
|
-
self.model.
|
|
271
|
+
self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
|
|
272
|
+
}
|
|
273
|
+
if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
|
|
274
|
+
self.model.f_meter_type = self.row.f_meter_type
|
|
275
|
+
let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
|
|
276
|
+
self.model.f_preamount = getAmount.data.chargenum
|
|
277
|
+
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))
|
|
278
|
+
Object.assign(self.model, self.model, getAmount.data)
|
|
279
|
+
self.model.chargeprice = getAmount.data.chargeprice
|
|
280
|
+
if (self.model.f_payment == '赠气') {
|
|
281
|
+
self.model.f_totalcost = getAmount.data.chargenum
|
|
282
|
+
self.model.f_collection = 0
|
|
283
|
+
} else {
|
|
284
|
+
self.model.f_collection = self.model.f_totalcost
|
|
285
|
+
}
|
|
286
|
+
self.calText(getAmount.data.chargeprice)
|
|
285
287
|
}
|
|
286
|
-
self.calText(getAmount.data.chargeprice)
|
|
287
288
|
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
self.row.cardInfo = self.cardData
|
|
289
|
+
// 执行保存逻辑
|
|
290
|
+
let sellgasGen = async function (self) {
|
|
291
|
+
try {
|
|
292
|
+
self.row.cardInfo = self.cardData
|
|
293
293
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
294
|
+
if (self.paymentModel.length === 0) {
|
|
295
|
+
self.paymentModel = [{
|
|
296
|
+
f_payment: self.model.f_payment[0],
|
|
297
|
+
f_money: self.model.f_preamount
|
|
298
|
+
}]
|
|
299
|
+
}
|
|
300
|
+
self.model.xiekamoney = self.model.f_preamount
|
|
301
|
+
if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否') {
|
|
302
|
+
self.model.xiekamoney = (self.model.f_pregas * self.model.chargeprice[0].f_price)
|
|
303
|
+
self.model.xiekamoney = self.model.xiekamoney.toFixed(4)
|
|
304
|
+
}
|
|
305
305
|
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
306
|
+
self.model.payments = self.paymentModel
|
|
307
|
+
// 加入扫码盒付款码支付流水号
|
|
308
|
+
self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
|
|
309
|
+
let res = await self.$CardService.sellgas(self.model, self.row)
|
|
310
|
+
console.log('----------------->卡表收费返回id', res)
|
|
311
|
+
let param = []
|
|
312
|
+
for (let row of self.resid) {
|
|
313
|
+
param.push({id: row.id})
|
|
314
|
+
}
|
|
315
|
+
let writeid
|
|
316
|
+
if (res.data && res.data.id) {
|
|
317
|
+
writeid = res.data.id
|
|
318
|
+
} else {
|
|
319
|
+
writeid = res
|
|
320
|
+
}
|
|
321
|
+
let data = {
|
|
322
|
+
param: param,
|
|
323
|
+
f_blobid: writeid
|
|
324
|
+
}
|
|
325
325
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
326
|
+
await self.$resetpost('api/af-revenue/logic/updatefiles', data)
|
|
327
|
+
// 开始打票
|
|
328
|
+
if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
|
|
329
|
+
if (self.model.f_print.indexOf('电子发票') == -1) {
|
|
330
|
+
if (self.config.hasBillManage) {
|
|
331
|
+
// 启用发票管理,获取票据管理中的票号并存储记录
|
|
332
|
+
self.row.id = res
|
|
333
|
+
self.row.f_bill_type = '卡表收费'
|
|
334
|
+
self.row.f_bill_style = self.model.f_print[0]
|
|
335
|
+
self.print = true
|
|
336
|
+
} else {
|
|
337
|
+
self.row.id = res
|
|
338
|
+
self.print = true
|
|
339
|
+
}
|
|
336
340
|
} else {
|
|
337
|
-
self.
|
|
338
|
-
|
|
341
|
+
if (self.model.f_print[0] === '电子发票') {
|
|
342
|
+
await self.$CommonService.openEticket(res, '售气收费')
|
|
343
|
+
self.row.id = res
|
|
344
|
+
self.print = true
|
|
345
|
+
}
|
|
339
346
|
}
|
|
340
347
|
} else {
|
|
341
|
-
|
|
342
|
-
await self.$CommonService.openEticket(res, '售气收费')
|
|
343
|
-
self.row.id = res
|
|
344
|
-
self.print = true
|
|
345
|
-
}
|
|
348
|
+
self.$dispatch('success')
|
|
346
349
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
self
|
|
350
|
+
self.clickConfirm = false
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.log('捕获到异常', error)
|
|
353
|
+
if (error instanceof Object) {
|
|
354
|
+
self.$showAlert(error.data, 'danger', 0)
|
|
355
|
+
} else {
|
|
356
|
+
self.$showAlert(error, 'danger', 0)
|
|
357
|
+
}
|
|
358
|
+
self.$dispatch('refresh')
|
|
359
|
+
self.clickConfirm = false
|
|
357
360
|
}
|
|
358
|
-
self.$dispatch('refresh')
|
|
359
|
-
self.clickConfirm = false
|
|
360
361
|
}
|
|
361
|
-
}
|
|
362
362
|
|
|
363
|
-
let asyncCardMeterCenter = async function (self) {
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
363
|
+
let asyncCardMeterCenter = async function (self) {
|
|
364
|
+
await self.$getConfig(self, 'CardMeterCenter')
|
|
365
|
+
console.log('卡表收费config', self.config)
|
|
366
|
+
// 默认打印格式
|
|
367
|
+
self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
|
|
368
|
+
self.model.f_payment = [self.config.payment]
|
|
369
|
+
self.mulPrint = self.config.printType instanceof Array
|
|
370
370
|
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
371
|
+
// 获取当前票号用
|
|
372
|
+
self.model.f_use_type = self.config.billType
|
|
373
|
+
self.model.f_bill_type = self.model.f_print
|
|
374
|
+
self.hasValidateBill = self.config.hasBillManage
|
|
375
375
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
376
|
+
// 判断限购
|
|
377
|
+
let limit_param = {
|
|
378
|
+
f_userinfo_id: self.row.f_userinfo_id,
|
|
379
|
+
f_user_id: self.row.f_user_id,
|
|
380
|
+
f_stairprice_id: self.row.f_stairprice_id
|
|
381
|
+
}
|
|
382
|
+
let getLimit = await self.$resetpost('api/af-revenue/logic/sale_getLimitGas', {data: limit_param}, {
|
|
383
|
+
resolveMsg: null,
|
|
384
|
+
rejectMsg: '获取限购值失败!!'
|
|
385
|
+
})
|
|
386
|
+
console.log('获取限购值', getLimit)
|
|
387
|
+
self.hasLimit = getLimit.data.hasLimit
|
|
388
|
+
if (self.hasLimit) {
|
|
389
|
+
if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
|
|
390
|
+
if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
|
|
391
|
+
self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
|
|
392
|
+
self.$dispatch('refresh')
|
|
393
|
+
} else {
|
|
394
|
+
if (getLimit.data.f_limit_value) {
|
|
395
|
+
self.maxgas = (getLimit.data.f_limit_value - 0)
|
|
396
|
+
self.limitgas = true
|
|
397
|
+
}
|
|
398
|
+
if (getLimit.data.f_limit_amount) {
|
|
399
|
+
self.maxmoney = (getLimit.data.f_limit_amount - 0)
|
|
400
|
+
self.limitmoney = true
|
|
401
|
+
}
|
|
401
402
|
}
|
|
402
403
|
}
|
|
403
404
|
}
|
|
404
405
|
}
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
calculatedetail: '',
|
|
406
|
+
export default {
|
|
407
|
+
title: '卡表收费',
|
|
408
|
+
data () {
|
|
409
|
+
return {
|
|
410
|
+
mjshow: false,
|
|
411
|
+
serialShow: false,
|
|
412
|
+
resid: [], // 存放新增的f_files表中id
|
|
413
|
+
config: {
|
|
414
|
+
showupload: true, // 显示上传
|
|
415
|
+
hasPrint: false, // 默认打票
|
|
416
|
+
hasBillManage: false, // 默认不启用发票管理
|
|
417
|
+
billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
|
|
418
|
+
printType: '普通收据', // 收据/电子票/专用发票/国税发票
|
|
419
|
+
payment: '现金缴费'
|
|
420
|
+
},
|
|
421
|
+
model: {
|
|
422
|
+
f_purchase: 0,
|
|
423
|
+
f_payment: [],
|
|
424
|
+
f_pregas: '',
|
|
425
|
+
f_preamount: 0,
|
|
426
|
+
f_totalcost: 0,
|
|
427
|
+
f_curbalance: 0,
|
|
428
|
+
f_collection: '',
|
|
429
|
+
f_balance: 0,
|
|
430
|
+
f_print: [],
|
|
431
|
+
f_meter_type: '',
|
|
432
|
+
f_voucher_number: '',
|
|
433
|
+
f_banktransfer_person: '',
|
|
434
|
+
f_banktransfer_date: '',
|
|
435
|
+
f_privilege_id: 0,
|
|
436
|
+
f_privilege_money: 0,
|
|
437
|
+
f_after_discount: 0
|
|
438
|
+
},
|
|
439
|
+
calculatedetail: '',
|
|
440
440
|
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
441
|
+
// 启用发票管理需要对票号进行验证
|
|
442
|
+
hasValidateBill: false,
|
|
443
|
+
validateOk: false,
|
|
444
444
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
445
|
+
print: false,
|
|
446
|
+
billData: {
|
|
447
|
+
url: 'api/af-revenue/report/card_bill',
|
|
448
|
+
billnumber: ''
|
|
449
|
+
},
|
|
450
|
+
hasLimit: false,
|
|
451
|
+
maxgas: 99999999, // 限购
|
|
452
|
+
maxmoney: 99999999,
|
|
453
|
+
limitmoney: false,
|
|
454
|
+
limitgas: false,
|
|
455
455
|
|
|
456
|
-
|
|
456
|
+
paymentModel: [], // 多笔付款方式
|
|
457
457
|
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
},
|
|
469
|
-
props: ['row', 'cardData'],
|
|
470
|
-
async ready () {
|
|
471
|
-
if (this.authArr.includes('余额写卡限定')) {
|
|
472
|
-
this.paytype = [{label: '余额写卡', value: '余额写卡'}]
|
|
473
|
-
} else {
|
|
474
|
-
this.paytype = await this.$appdata.getParam('付款方式') ? await this.$appdata.getParam('付款方式') : []
|
|
475
|
-
if (!this.$login.r.includes('免交充值付款')) {
|
|
476
|
-
this.paytype = this.paytype.filter((item) => {
|
|
477
|
-
return item.label != '免交'
|
|
478
|
-
})
|
|
458
|
+
mulPrint: false,
|
|
459
|
+
clickConfirm: false, // 控制确认按钮只能点击一次
|
|
460
|
+
// 下拉框值
|
|
461
|
+
paytype: [],
|
|
462
|
+
printstyle: this.$appdata.getParam('打印格式'),
|
|
463
|
+
privilegeList: [{label: '无优惠', value: '0'}],
|
|
464
|
+
BankTransfer: false,
|
|
465
|
+
// 小数是否支持,导致划价产生的多余气量,金额
|
|
466
|
+
dymoney: 0
|
|
479
467
|
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
this.model.f_userinfo_id = this.row.f_userinfo_id
|
|
486
|
-
this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
|
|
487
|
-
if (this.row.f_collection_type == '按金额') {
|
|
488
|
-
this.model.f_preamount = ''
|
|
489
|
-
this.model.f_pregas = 0
|
|
490
|
-
}
|
|
491
|
-
asyncCardMeterCenter(this)
|
|
492
|
-
},
|
|
493
|
-
watch: {
|
|
494
|
-
'model.f_payment.length' (val) {
|
|
495
|
-
console.log('付款方式多选。。', val)
|
|
496
|
-
if (val > 1 && !this.model.f_preamount) {
|
|
497
|
-
this.model.f_payment = ['现金缴费']
|
|
498
|
-
this.$showAlert('请先计算付款金额', 'warning', 2000)
|
|
468
|
+
},
|
|
469
|
+
props: ['row', 'cardData'],
|
|
470
|
+
async ready () {
|
|
471
|
+
if (this.authArr.includes('余额写卡限定')) {
|
|
472
|
+
this.paytype = [{label: '余额写卡', value: '余额写卡'}]
|
|
499
473
|
} else {
|
|
500
|
-
this.
|
|
474
|
+
this.paytype = await this.$appdata.getParam('付款方式') ? await this.$appdata.getParam('付款方式') : []
|
|
475
|
+
if (!this.$login.r.includes('免交充值付款')) {
|
|
476
|
+
this.paytype = this.paytype.filter((item) => {
|
|
477
|
+
return item.label != '免交'
|
|
478
|
+
})
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
// this.getPurchase()
|
|
482
|
+
this.model.f_price_id = this.row.f_price_id
|
|
483
|
+
this.model.f_user_id = this.row.f_user_id
|
|
484
|
+
this.model.f_userfiles_id = this.row.f_userfiles_id
|
|
485
|
+
this.model.f_userinfo_id = this.row.f_userinfo_id
|
|
486
|
+
this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
|
|
487
|
+
if (this.row.f_collection_type == '按金额') {
|
|
488
|
+
this.model.f_preamount = ''
|
|
489
|
+
this.model.f_pregas = 0
|
|
490
|
+
}
|
|
491
|
+
asyncCardMeterCenter(this)
|
|
492
|
+
},
|
|
493
|
+
watch: {
|
|
494
|
+
'model.f_payment.length' (val) {
|
|
495
|
+
console.log('付款方式多选。。', val)
|
|
496
|
+
if (val > 1 && !this.model.f_preamount) {
|
|
497
|
+
this.model.f_payment = ['现金缴费']
|
|
498
|
+
this.$showAlert('请先计算付款金额', 'warning', 2000)
|
|
499
|
+
} else {
|
|
500
|
+
this.paymentModel = []
|
|
501
501
|
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
502
|
+
this.model.f_payment.forEach((res) => {
|
|
503
|
+
let temp = {
|
|
504
|
+
f_payment: res,
|
|
505
|
+
f_money: 0
|
|
506
|
+
}
|
|
507
|
+
this.paymentModel.push(temp)
|
|
508
|
+
})
|
|
509
|
+
this.$resetValidation()
|
|
510
510
|
|
|
511
|
+
// 获取计算优惠
|
|
512
|
+
this.getPrivilegeList()
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
'model.f_payment' (val) {
|
|
516
|
+
if (val == '免交') {
|
|
517
|
+
this.mjshow = true
|
|
518
|
+
} else if (val == '赠气' && (this.model.f_preamount || this.model.f_preamount != '')) {
|
|
519
|
+
if (this.row.f_collection_type == '按气量') {
|
|
520
|
+
this.pregas()
|
|
521
|
+
} else {
|
|
522
|
+
this.preamount()
|
|
523
|
+
}
|
|
524
|
+
} else {
|
|
525
|
+
this.mjshow = false
|
|
526
|
+
}
|
|
527
|
+
// if(this.row.f_collection_type == '按气量'){
|
|
528
|
+
// this.pregas();
|
|
529
|
+
// }else{
|
|
530
|
+
// this.preamount();
|
|
531
|
+
// }
|
|
532
|
+
},
|
|
533
|
+
'model.f_collection' (val) {
|
|
511
534
|
// 获取计算优惠
|
|
512
535
|
this.getPrivilegeList()
|
|
513
536
|
}
|
|
514
537
|
},
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
}
|
|
524
|
-
} else {
|
|
525
|
-
this.mjshow = false
|
|
538
|
+
events: {
|
|
539
|
+
// 删除Resid数组元素
|
|
540
|
+
'delResid' (val) {
|
|
541
|
+
this.resid.$remove({id: val, f_biobid: ''})
|
|
542
|
+
// this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
|
|
543
|
+
},
|
|
544
|
+
// 增加Resid数组元素
|
|
545
|
+
'resid' (val) {
|
|
546
|
+
this.resid.push({id: val, f_biobid: ''})
|
|
526
547
|
}
|
|
527
|
-
// if(this.row.f_collection_type == '按气量'){
|
|
528
|
-
// this.pregas();
|
|
529
|
-
// }else{
|
|
530
|
-
// this.preamount();
|
|
531
|
-
// }
|
|
532
|
-
},
|
|
533
|
-
'model.f_collection' (val) {
|
|
534
|
-
// 获取计算优惠
|
|
535
|
-
this.getPrivilegeList()
|
|
536
|
-
}
|
|
537
|
-
},
|
|
538
|
-
events: {
|
|
539
|
-
// 删除Resid数组元素
|
|
540
|
-
'delResid' (val) {
|
|
541
|
-
this.resid.$remove({id: val, f_biobid: ''})
|
|
542
|
-
// this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
|
|
543
548
|
},
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
|
|
552
|
-
if (this.model.f_collection > this.row.f_balance) {
|
|
553
|
-
this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
|
|
554
|
-
return
|
|
555
|
-
}
|
|
549
|
+
methods: {
|
|
550
|
+
confirm () {
|
|
551
|
+
if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
|
|
552
|
+
if (this.model.f_collection > this.row.f_balance) {
|
|
553
|
+
this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
|
|
554
|
+
return
|
|
555
|
+
}
|
|
556
556
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
557
|
+
if (this.model.f_collection > 0) {
|
|
558
|
+
this.$showAlert('请注意!进行余额写卡,收款不能大于0', 'warning', 1000)
|
|
559
|
+
return
|
|
560
|
+
}
|
|
560
561
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
if (!ss.result) return
|
|
562
|
+
this.$showMessage(`确定对用户${this.row.f_user_name}进行卡表收费吗?`, ['confirm', 'cancel']).then(async (res) => {
|
|
563
|
+
if (res === 'confirm') {
|
|
564
|
+
// 先调用付款码支付组件流程
|
|
565
|
+
let ss = await this.$refs.paymentcode.flowPath()
|
|
566
|
+
this.$refs.paymentcode.paymentCodeShow = false
|
|
567
|
+
console.log('付款码操作返回', ss)
|
|
568
|
+
if (!ss.result) return
|
|
569
569
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
570
|
+
this.clickConfirm = true
|
|
571
|
+
this.model.f_curbalance = this.curbalance
|
|
572
|
+
this.$dispatch('no-button')
|
|
573
|
+
sellgasGen(this)
|
|
574
|
+
}
|
|
575
|
+
})
|
|
576
|
+
},
|
|
577
|
+
clean () {
|
|
578
|
+
this.$info('取消操作')
|
|
579
|
+
this.$dispatch('refresh', this.row)
|
|
580
|
+
},
|
|
581
|
+
validateBill (val) {
|
|
582
|
+
this.validateOk = !val.isOk
|
|
583
|
+
this.billData.bill = val.bill
|
|
584
|
+
},
|
|
585
|
+
printok () {
|
|
586
|
+
// 收据打完,判断是否还有其他票据进行请求
|
|
587
|
+
for (let i = 0; i < this.model.f_print.length; i++) {
|
|
588
|
+
if (this.model.f_print[i] === '电子发票') {
|
|
589
|
+
this.$CommonService.openEticket(this.row.id, '售气收费')
|
|
590
|
+
}
|
|
574
591
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
592
|
+
this.$dispatch('success')
|
|
593
|
+
},
|
|
594
|
+
pregas () {
|
|
595
|
+
this.dymoney = 0
|
|
596
|
+
if (this.model.f_pregas && this.model.f_pregas > 0) {
|
|
597
|
+
try {
|
|
598
|
+
// 对气量进行验证
|
|
599
|
+
if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
|
|
600
|
+
this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
|
|
601
|
+
this.model.f_pregas = null
|
|
602
|
+
} else {
|
|
603
|
+
pregasGen(this)
|
|
604
|
+
}
|
|
605
|
+
} catch (error) {
|
|
606
|
+
this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
|
|
607
|
+
this.$dispatch('error', '发卡售气', this.model, error)
|
|
608
|
+
}
|
|
609
|
+
} else {
|
|
610
|
+
this.model.f_pregas = null
|
|
590
611
|
}
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
612
|
+
},
|
|
613
|
+
preamount () {
|
|
614
|
+
this.dymoney = 0
|
|
615
|
+
this.model.f_price_id = this.row.f_price_id
|
|
616
|
+
this.model.f_user_id = this.row.f_user_id
|
|
617
|
+
this.model.f_userfiles_id = this.row.f_userfiles_id
|
|
618
|
+
this.model.f_userinfo_id = this.row.f_userinfo_id
|
|
597
619
|
try {
|
|
598
|
-
|
|
599
|
-
if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
|
|
600
|
-
this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
|
|
601
|
-
this.model.f_pregas = null
|
|
602
|
-
} else {
|
|
603
|
-
pregasGen(this)
|
|
604
|
-
}
|
|
620
|
+
preamountGen(this)
|
|
605
621
|
} catch (error) {
|
|
606
622
|
this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
|
|
607
623
|
this.$dispatch('error', '发卡售气', this.model, error)
|
|
608
624
|
}
|
|
609
|
-
}
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
let str = ''
|
|
628
|
-
let num = 0
|
|
629
|
-
val.forEach((item) => {
|
|
630
|
-
if (item.f_gas > 0) {
|
|
631
|
-
num = num + 1
|
|
625
|
+
},
|
|
626
|
+
calText (val) {
|
|
627
|
+
let str = ''
|
|
628
|
+
let num = 0
|
|
629
|
+
val.forEach((item) => {
|
|
630
|
+
if (item.f_gas > 0) {
|
|
631
|
+
num = num + 1
|
|
632
|
+
}
|
|
633
|
+
if (this.row.f_isdecimal === '是') {
|
|
634
|
+
str = str + item.f_price + ' x ' + item.f_gas + '+'
|
|
635
|
+
} else {
|
|
636
|
+
str = str + item.f_price + ' x ' + Math.floor(item.f_gas) + '+'
|
|
637
|
+
}
|
|
638
|
+
})
|
|
639
|
+
str = str.slice(0, str.length - 1)
|
|
640
|
+
this.calculatedetail = str
|
|
641
|
+
if (num > 1) {
|
|
642
|
+
this.$showAlert('友好提示:本次购气已跨阶梯', 'warning', 3000)
|
|
632
643
|
}
|
|
633
|
-
|
|
634
|
-
|
|
644
|
+
},
|
|
645
|
+
close () {
|
|
646
|
+
this.print = false
|
|
647
|
+
this.clean()
|
|
648
|
+
},
|
|
649
|
+
paymentchange () {
|
|
650
|
+
console.log('model.f_payment', this.model.f_payment[0])
|
|
651
|
+
if (JSON.stringify(this.model.f_payment).indexOf('转账') !== -1) {
|
|
652
|
+
// 进入转账筛选条件
|
|
653
|
+
this.model.f_banktransfer_person = ''
|
|
654
|
+
this.model.f_banktransfer_date = ''
|
|
655
|
+
this.BankTransfer = true
|
|
635
656
|
} else {
|
|
636
|
-
|
|
657
|
+
this.model.f_banktransfer_person = ''
|
|
658
|
+
this.model.f_banktransfer_date = ''
|
|
659
|
+
this.BankTransfer = false
|
|
637
660
|
}
|
|
638
|
-
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
this
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
},
|
|
662
|
-
// 根据选择的付款方式 获取优惠列表
|
|
663
|
-
async getPrivilegeList () {
|
|
664
|
-
// 初始化下拉选择列表
|
|
665
|
-
this.privilegeList = [{label: '无优惠', value: '0'}]
|
|
666
|
-
// 初始为无优惠
|
|
667
|
-
this.model.f_privilege_id = '0'
|
|
668
|
-
if (this.model.f_payment && this.model.f_payment.length) {
|
|
669
|
-
// 查询条件
|
|
670
|
-
let payments = JSON.stringify(this.model.f_payment)
|
|
671
|
-
payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
|
|
672
|
-
let HttpReset = new HttpResetClass()
|
|
673
|
-
let privilege = await HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
|
|
674
|
-
data: {
|
|
675
|
-
items: 'id,f_privilege_name,f_privilege_type',
|
|
676
|
-
tablename: 't_privilege',
|
|
677
|
-
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 = '有效'`,
|
|
678
|
-
orderitem: 'id'
|
|
661
|
+
},
|
|
662
|
+
// 根据选择的付款方式 获取优惠列表
|
|
663
|
+
async getPrivilegeList () {
|
|
664
|
+
// 初始化下拉选择列表
|
|
665
|
+
this.privilegeList = [{label: '无优惠', value: '0'}]
|
|
666
|
+
// 初始为无优惠
|
|
667
|
+
this.model.f_privilege_id = '0'
|
|
668
|
+
if (this.model.f_payment && this.model.f_payment.length) {
|
|
669
|
+
// 查询条件
|
|
670
|
+
let payments = JSON.stringify(this.model.f_payment)
|
|
671
|
+
payments = payments.replace('[', '(').replace(']', ')').replace(/"/g, '\'')
|
|
672
|
+
let HttpReset = new HttpResetClass()
|
|
673
|
+
let privilege = await HttpReset.load('POST', 'api/af-revenue/sql/singleTable_OrderBy', {
|
|
674
|
+
data: {
|
|
675
|
+
items: 'id,f_privilege_name,f_privilege_type',
|
|
676
|
+
tablename: 't_privilege',
|
|
677
|
+
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 = '有效'`,
|
|
678
|
+
orderitem: 'id'
|
|
679
|
+
}
|
|
680
|
+
}, {resolveMsg: null, rejectMsg: '查询优惠信息失败'})
|
|
681
|
+
// 查询结果放到下拉列表
|
|
682
|
+
for (let p of privilege.data) {
|
|
683
|
+
this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
|
|
679
684
|
}
|
|
680
|
-
|
|
681
|
-
// 查询结果放到下拉列表
|
|
682
|
-
for (let p of privilege.data) {
|
|
683
|
-
this.privilegeList.push({label: p.f_privilege_name, value: p.id, type: p.f_privilege_type})
|
|
685
|
+
this.privilegeCalculate()
|
|
684
686
|
}
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
return
|
|
687
|
+
},
|
|
688
|
+
// 优惠计算
|
|
689
|
+
async privilegeCalculate () {
|
|
690
|
+
// 初始化减免金额
|
|
691
|
+
this.model.f_privilege_money = 0
|
|
692
|
+
this.model.f_after_discount = this.model.f_collection
|
|
693
|
+
// 判断是否是自定义优惠
|
|
694
|
+
if (this.model.f_privilege_id != null && parseInt(this.model.f_privilege_id)) {
|
|
695
|
+
for (let p of this.privilegeList) {
|
|
696
|
+
if (p.value == this.model.f_privilege_id && p.type == '自定义') {
|
|
697
|
+
this.model.f_privilege_money = window.prompt('请输入你想优惠的金额')
|
|
698
|
+
if (!(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money) || !(/^[1-9]\d*(\.\d+)?$/).test(this.model.f_privilege_money)) {
|
|
699
|
+
this.$showMessage('金额输入格式不正确!')
|
|
700
|
+
this.model.f_privilege_money = 0
|
|
701
|
+
return
|
|
702
|
+
}
|
|
703
|
+
if ((this.model.f_privilege_money - 0) >= this.model.f_collection) {
|
|
704
|
+
this.$showMessage('减免金额不能大于等于收款金额')
|
|
705
|
+
this.model.f_privilege_money = 0
|
|
706
|
+
return
|
|
707
|
+
}
|
|
707
708
|
}
|
|
708
709
|
}
|
|
709
710
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
711
|
+
// 优惠方式, 收款 缺一不计算
|
|
712
|
+
if (this.model.f_payment && this.model.f_payment.length && parseInt(this.model.f_privilege_id) && this.model.f_collection) {
|
|
713
|
+
let c = {
|
|
714
|
+
f_privilege_id: this.model.f_privilege_id,
|
|
715
|
+
f_collection: this.model.f_collection,
|
|
716
|
+
f_privilege_money: this.data.f_privilege_money
|
|
717
|
+
}
|
|
718
|
+
let privilegeData = await this.$resetpost('api/af-revenue/logic/calculatePrivilege', c, {
|
|
719
|
+
resolveMsg: null,
|
|
720
|
+
rejectMsg: '计算优惠金额出错'
|
|
721
|
+
})
|
|
722
|
+
// 减免金额
|
|
723
|
+
this.model.f_privilege_money = privilegeData.data.f_privilege_money
|
|
724
|
+
// 减免后收款金额
|
|
725
|
+
this.model.f_after_discount = privilegeData.data.f_collection
|
|
717
726
|
}
|
|
718
|
-
let privilegeData = await this.$resetpost('rs/logic/calculatePrivilege', c, {
|
|
719
|
-
resolveMsg: null,
|
|
720
|
-
rejectMsg: '计算优惠金额出错'
|
|
721
|
-
})
|
|
722
|
-
// 减免金额
|
|
723
|
-
this.model.f_privilege_money = privilegeData.data.f_privilege_money
|
|
724
|
-
// 减免后收款金额
|
|
725
|
-
this.model.f_after_discount = privilegeData.data.f_collection
|
|
726
727
|
}
|
|
727
|
-
}
|
|
728
|
-
},
|
|
729
|
-
computed: {
|
|
730
|
-
authArr () {
|
|
731
|
-
return this.$login.r ? this.$login.r : []
|
|
732
728
|
},
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
return this.
|
|
736
|
-
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
if (
|
|
742
|
-
|
|
729
|
+
computed: {
|
|
730
|
+
authArr () {
|
|
731
|
+
return this.$login.r ? this.$login.r : []
|
|
732
|
+
},
|
|
733
|
+
'curbalance' () {
|
|
734
|
+
if (this.model.f_payment == '赠气') {
|
|
735
|
+
return this.model.f_balance
|
|
736
|
+
}
|
|
737
|
+
if (this.model.f_preamount) {
|
|
738
|
+
if (this.row.f_collection_type === '按金额') {
|
|
739
|
+
return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
|
|
740
|
+
} else {
|
|
741
|
+
// if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
|
|
742
|
+
// return ((this.row.f_balance - 0) - (this.model.f_preamount - 0) + (this.model.f_collection - 0) ).toFixed(4)
|
|
743
|
+
// } else {
|
|
744
|
+
// return ((this.model.f_collection - 0) + (this.row.f_balance - 0) - (this.model.f_totalcost - 0)).toFixed(4)
|
|
745
|
+
// }
|
|
746
|
+
return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
|
|
747
|
+
}
|
|
743
748
|
} else {
|
|
744
|
-
return
|
|
749
|
+
return 0
|
|
750
|
+
}
|
|
751
|
+
},
|
|
752
|
+
'islegal' () {
|
|
753
|
+
console.log('支付分离。。。', this.paymentModel.length, this.model.f_collection)
|
|
754
|
+
if (this.paymentModel.length > 1 && this.model.f_collection) {
|
|
755
|
+
let sum = 0
|
|
756
|
+
this.paymentModel.forEach((res) => {
|
|
757
|
+
sum += (res.f_money - 0)
|
|
758
|
+
})
|
|
759
|
+
return (this.model.f_collection - 0) === (sum - 0)
|
|
760
|
+
} else {
|
|
761
|
+
return true
|
|
745
762
|
}
|
|
746
|
-
// return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
|
|
747
|
-
// }
|
|
748
|
-
} else {
|
|
749
|
-
return 0
|
|
750
|
-
}
|
|
751
|
-
},
|
|
752
|
-
'islegal' () {
|
|
753
|
-
console.log('支付分离。。。', this.paymentModel.length, this.model.f_collection)
|
|
754
|
-
if (this.paymentModel.length > 1 && this.model.f_collection) {
|
|
755
|
-
let sum = 0
|
|
756
|
-
this.paymentModel.forEach((res) => {
|
|
757
|
-
sum += (res.f_money - 0)
|
|
758
|
-
})
|
|
759
|
-
return (this.model.f_collection - 0) === (sum - 0)
|
|
760
|
-
} else {
|
|
761
|
-
return true
|
|
762
763
|
}
|
|
763
764
|
}
|
|
764
765
|
}
|
|
765
|
-
}
|
|
766
766
|
</script>
|
|
767
767
|
|
|
768
768
|
<style>
|