sale-client 3.6.125 → 3.6.126

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "3.6.125",
3
+ "version": "3.6.126",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -130,7 +130,7 @@ export default {
130
130
  config: {
131
131
  showupload: true, // 显示上传
132
132
  hasPrint: true, // 默认打票
133
- postAsync: false, // 是否异步请求 存完住记录再存明细
133
+ postAsync: false, // 是否异步请求 存完主记录再存明细
134
134
  hasBillManage: false, // 默认不启用发票管理
135
135
  hasfindaReail: true, // 默认开启找零功能
136
136
  billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
@@ -284,50 +284,61 @@ export default {
284
284
  if (this.civill) {
285
285
  param = Object.assign(this.civill, param)
286
286
  }
287
- try {
288
- await this.$resetpost('rs/logic/batchPayment', {data: param}, {resolveMsg: null, rejectMsg: null}, 1000)
289
- } catch (e) {}
290
- // this.$showMessage(`正在批量处理中, 请耐心等待...`, [])
291
- this.show = true
292
- // 启动定时器定时查询处理结果
293
- this.timer = setInterval(async () => {
294
- let res = await this.HttpReset.load('POST', 'rs/logic/getBatchOperaPro', {data: {uuid: uuid}}, {resolveMsg: null, rejectMsg: null})
295
- if (res.data.percent) {
296
- this.percent = res.data.percent
297
- }
298
- if (res.data.msg || res.data.error) {
299
- this.show = false
300
- clearInterval(this.timer)
301
- this.$closeMessage()
302
- if (res.data.error) {
303
- this.$showAlert(`${res.data.error}`, 'danger')
304
- return
287
+ let batchId = ''
288
+ // 如果配置了异步请求
289
+ if (this.config.postAsync) {
290
+ // 插入主收费记录
291
+ let batch = await this.$resetpost('rs/logic/asyncbatchPaymentSellinggas', {data: param}, {resolveMsg: null, rejectMsg: null}, 1000)
292
+ batchId = param.f_batch_id = batch.data.f_batch_id
293
+ // 处理记录明细抄表明细
294
+ await this.$resetpost('rs/logic/async/asyncbatchPaymentFiles', {data: param}, {resolveMsg: null, rejectMsg: null}, 1000)
295
+ } else {
296
+ try {
297
+ await this.$resetpost('rs/logic/batchPayment', {data: param}, {resolveMsg: null, rejectMsg: null}, 1000)
298
+ } catch (e) {}
299
+ // this.$showMessage(`正在批量处理中, 请耐心等待...`, [])
300
+ this.show = true
301
+ // 启动定时器定时查询处理结果
302
+ this.timer = setInterval(async () => {
303
+ let res = await this.HttpReset.load('POST', 'rs/logic/getBatchOperaPro', {data: {uuid: uuid}}, {resolveMsg: null, rejectMsg: null})
304
+ if (res.data.percent) {
305
+ this.percent = res.data.percent
305
306
  }
306
- await this.$showMessage(res.data.msg)
307
- if (this.config.hasPrint) {
308
- if (this.data.f_print.indexOf('电子发票') == -1) {
309
- console.log('this.config.hasBillManage', this.config.hasBillManage)
310
- if (this.config.hasBillManage) {
311
- // 启用发票管理,获取票据管理中的票号并存储记录
312
- this.row.id = res.data.id
313
- this.row.f_bill_type = '物联网收费'
314
- this.row.f_bill_style = this.model.f_print[0]
315
- this.print = true
316
- } else {
317
- this.data.id = res.data.id
318
- this.print = true
319
- }
320
- } else if (this.config.printType === '国税发票') {
321
- // TODO
322
- } else if (this.model.f_print[0] === '电子发票') {
323
- this.eticket_show = true
324
- await this.$refs.eticketbill.openETicket([res.data.id], this.row, this.invoice_show_gas, this.invoice_is_pax, '物联网收费')
307
+ if (res.data.msg || res.data.error) {
308
+ this.show = false
309
+ clearInterval(this.timer)
310
+ this.$closeMessage()
311
+ if (res.data.error) {
312
+ this.$showAlert(`${res.data.error}`, 'danger')
313
+ return
325
314
  }
315
+ await this.$showMessage(res.data.msg)
316
+ batchId = res.data.id
317
+ }
318
+ }, 1500)
319
+ }
320
+ if (this.config.hasPrint) {
321
+ if (this.data.f_print.indexOf('电子发票') == -1) {
322
+ console.log('this.config.hasBillManage', this.config.hasBillManage)
323
+ if (this.config.hasBillManage) {
324
+ // 启用发票管理,获取票据管理中的票号并存储记录
325
+ this.row.id = batchId
326
+ this.row.f_bill_type = '物联网收费'
327
+ this.row.f_bill_style = this.model.f_print[0]
328
+ this.print = true
326
329
  } else {
327
- this.clean()
330
+ this.data.id = batchId
331
+ this.print = true
328
332
  }
333
+ } else if (this.config.printType === '国税发票') {
334
+ // TODO
335
+ } else if (this.model.f_print[0] === '电子发票') {
336
+ this.eticket_show = true
337
+ await this.$refs.eticketbill.openETicket([batchId], this.row, this.invoice_show_gas, this.invoice_is_pax, '物联网收费')
329
338
  }
330
- }, 1500)
339
+ } else {
340
+ this.clean()
341
+ }
331
342
  },
332
343
  clean () {
333
344
  this.$dispatch('success')