sale-client 3.6.289 → 3.6.290

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.
@@ -1,25 +1,26 @@
1
- function isVersionGreaterThan(version1, version2) {
1
+ function isVersionGreaterThan (version1, version2) {
2
2
  const v1parts = version1.split('.')
3
3
  const v2parts = version2.split('.')
4
-
4
+ let flag = false
5
5
  for (let i = 0; i < v1parts.length; ++i) {
6
- if (v2parts.length === i) {
7
- return true
6
+ if (v1parts[i] > v2parts[i]) {
7
+ flag = true
8
+ break
8
9
  }
9
- return v1parts[i] >= v2parts[i]
10
10
  }
11
11
 
12
- return v1parts.length !== v2parts.length
12
+ return flag
13
13
  }
14
14
 
15
15
  const pkg = require('../package.json')
16
16
  const checkVersion = () => {
17
17
  const {devDependencies} = pkg
18
18
  if (devDependencies && devDependencies['system-clients']) {
19
- if (isVersionGreaterThan(devDependencies['system-clients'], '3.2.93')) {
19
+ if (isVersionGreaterThan(devDependencies['system-clients'], '3.2.87')) {
20
20
  console.log('\x1b[41m\x1b[30m%s\x1b[0m', '请注意:当前使用的 systemClients 版本不兼容旧版登录')
21
21
  console.log('\x1b[41m\x1b[30m%s\x1b[0m', '登录是会发送 api/af-auth 请求')
22
22
  console.log('\x1b[41m\x1b[30m%s\x1b[0m', '请转发到公司 v4 测试地址或者客户 v4 网关')
23
+ console.log('\x1b[41m\x1b[30m%s\x1b[0m', '如不使用新版登录,请降级 system-clients 版本到 3.2.87')
23
24
  console.log('\x1b[41m\x1b[30m%s\x1b[0m', '请查看营收后台升级日志:http://aote-office.8866.org:31467/sale-doc-web/V4Product/%E8%90%A5%E6%94%B6%E5%90%8E%E5%8F%B0%E6%94%B9%E9%80%A0%E8%AF%B4%E6%98%8E')
24
25
  }
25
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "3.6.289",
3
+ "version": "3.6.290",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -696,12 +696,12 @@
696
696
  'f_user_name': '客户姓名',
697
697
  'f_residential_area': '小区名称',
698
698
  'f_address': '客户地址',
699
- 'f_zones' : '片区',
699
+ 'f_zones': '片区',
700
700
  'f_user_phone': '客户电话',
701
701
  'f_meternumber': '表号',
702
702
  'f_meter_base': '上期底数',
703
703
  'avggas': '平均用气量',
704
- 'f_adjustable_name': '本期底数'
704
+ 'f_table_base': '本期底数'
705
705
  },
706
706
  config: {
707
707
  // 导出列要和查询列相同
@@ -716,7 +716,7 @@
716
716
  'f_meternumber': '表号',
717
717
  'avggas': '平均用气量',
718
718
  'f_meter_base': '上期底数',
719
- 'f_adjustable_name': '本期底数',
719
+ 'f_table_base': '本期底数',
720
720
  'f_inputtor': '抄表员',
721
721
  'f_balacne': '上期结余',
722
722
  'f_last_input_date': '上次抄表',
@@ -172,8 +172,6 @@
172
172
  <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
173
173
  v-model="model.f_serial_number" placeholder="业务单号">
174
174
  </div>
175
-
176
-
177
175
  <div class="col-sm-8">
178
176
  <label for="f_comments" class="font_normal_body">&nbsp;备&emsp;&emsp;注</label>
179
177
  <input class="input_search" style="width:77%" v-model="model.f_comments" rows="1" placeholder="备注">
@@ -213,7 +211,7 @@
213
211
  </div>
214
212
  <upload :blodid="blodid" v-if="config.showupload" isremark="true" fusetype="卡表收费"></upload>
215
213
  <eticket-modal :show="eticket_msg" :row="row" @confirm="confirm"></eticket-modal>
216
- <eticket-print-async :show="eticket_show" @toggle="eticket_toggle" v-ref:asynceticket></eticket-print-async>
214
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:asynceticket></ticket-print>
217
215
  </template>
218
216
  <script>
219
217
  import {HttpResetClass} from 'vue-client'
@@ -334,7 +332,7 @@
334
332
  await self.$resetpost('rs/logic/updatefiles', data)
335
333
  // 开始打票
336
334
  if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
337
- if (self.model.f_print.indexOf('电子发票') == -1) {
335
+ if (!['电子发票', '数电普票', '数电专票'].includes(self.model.f_print[0])) {
338
336
  if (self.config.hasBillManage) {
339
337
  // 启用发票管理,获取票据管理中的票号并存储记录
340
338
  self.row.id = res
@@ -346,9 +344,39 @@
346
344
  self.print = true
347
345
  }
348
346
  } else {
349
- if (self.model.f_print[0] === '电子发票') {
350
- self.eticket_show=true
351
- await self.$refs.asynceticket.openEticket(res, self.row,'卡表收费')
347
+ if (['电子发票', '数电普票', '数电专票'].includes(self.model.f_print[0])) {
348
+ // self.eticket_show = true
349
+ self.$refs.asynceticket.openETicketNoModal(res, self.row, '卡表收费').then(
350
+ (_res) => {
351
+ if (self.config.hasBillManage) {
352
+ // 启用发票管理,获取票据管理中的票号并存储记录
353
+ self.row.id = res
354
+ self.row.f_bill_type = '卡表收费'
355
+ self.row.f_bill_style = self.model.f_print[0]
356
+ self.print = true
357
+ } else {
358
+ self.row.id = res
359
+ self.print = true
360
+ }
361
+ }
362
+ ).catch((error) => {
363
+ console.log('捕获到异常', error)
364
+ if (error instanceof Object) {
365
+ self.$showAlert(error.data, 'danger', 0)
366
+ } else {
367
+ self.$showAlert('收费成功,电子票开具失败,' + error + ',请在自定义开票页面补开发票。', 'danger', 0)
368
+ }
369
+ if (self.config.hasBillManage) {
370
+ // 启用发票管理,获取票据管理中的票号并存储记录
371
+ self.row.id = res
372
+ self.row.f_bill_type = '卡表收费'
373
+ self.row.f_bill_style = self.model.f_print[0]
374
+ self.print = true
375
+ } else {
376
+ self.row.id = res
377
+ self.print = true
378
+ }
379
+ })
352
380
  }
353
381
  }
354
382
  } else {
@@ -372,10 +400,10 @@
372
400
  console.log('卡表收费config', self.config)
373
401
  console.log('row', self.row)
374
402
  // 默认打印格式
375
- if(self.row.f_paper_type){
376
- self.model.f_print=self.row.f_paper_type instanceof Array ? self.row.f_paper_type : [self.row.f_paper_type ]
377
- }else{
378
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
403
+ if (self.row.f_paper_type) {
404
+ self.model.f_print = self.row.f_paper_type instanceof Array ? self.row.f_paper_type : [self.row.f_paper_type ]
405
+ } else {
406
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
379
407
  }
380
408
  // self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
381
409
  self.model.f_payment = [self.config.payment]
@@ -416,16 +444,16 @@
416
444
  }
417
445
  }
418
446
  let nowrite_param = {
419
- f_userfiles_id: self.row.f_userfiles_id,
447
+ f_userfiles_id: self.row.f_userfiles_id
420
448
  }
421
449
  let getNoWriteCard = await self.$resetpost('rs/sql/getnowritecard', {data: nowrite_param}, {
422
450
  resolveMsg: null,
423
451
  rejectMsg: '获取限购值失败!!'
424
452
  })
425
- if(getNoWriteCard.data.length >0){
453
+ if (getNoWriteCard.data.length > 0) {
426
454
  self.$showMessage(`三小时内存在写卡失败的记录,是否重新写卡?`, ['confirm', 'cancel']).then(async (res) => {
427
455
  if (res === 'confirm') {
428
- let url = 'http://127.0.0.1:8003/'+ getNoWriteCard.data[0].f_cardpost
456
+ let url = 'http://127.0.0.1:8003/' + getNoWriteCard.data[0].f_cardpost
429
457
  let param = JSON.parse(getNoWriteCard.data[0].f_cardparam)
430
458
  let cardRes = await self.$resetpost(url, param, {resolveMsg: null, rejectMsg: '重新写卡失败'})
431
459
  if (cardRes.data.Err || cardRes.data.Exception) {
@@ -435,19 +463,18 @@
435
463
  self.$resetpost('rs/logic/writeCardAgin', getNoWriteCard.data[0], {resolveMsg: '重新写卡成功', rejectMsg: '重新写卡失败'})
436
464
  self.$dispatch('success')
437
465
  }
438
- }else{
466
+ } else {
439
467
  self.$dispatch('refresh', self.row)
440
468
  }
441
469
  })
442
470
  }
443
-
444
471
  }
445
472
  export default {
446
473
  title: '卡表收费',
447
474
  data () {
448
475
  return {
449
- //发票相关
450
- eticket_msg:false,
476
+ // 发票相关
477
+ eticket_msg: false,
451
478
  eticket_show: false,
452
479
  mjshow: false,
453
480
  serialShow: false,
@@ -592,13 +619,13 @@
592
619
  }
593
620
  },
594
621
  methods: {
595
- onHoverOut(){
622
+ onHoverOut () {
596
623
  this.resetShow = false
597
624
  },
598
- onHover(){
625
+ onHover () {
599
626
  this.resetShow = true
600
627
  },
601
- resetParam(){
628
+ resetParam () {
602
629
  this.model.f_preamount = 0
603
630
  this.model.f_pregas = 0
604
631
  this.model.f_collection = 0
@@ -609,7 +636,7 @@
609
636
  this.preamount()
610
637
  },
611
638
  checkInvoiceMsg () {
612
- if (this.model.f_print[0] === '电子发票') {
639
+ if (['电子发票', '数电普票', '数电专票'].includes(this.model.f_print[0])) {
613
640
  if (!this.row.f_taxpayer_id) {
614
641
  this.row.f_taxpayer_id = this.row.f_idnumber
615
642
  }
@@ -619,6 +646,9 @@
619
646
  if (!this.row.f_address_phone) {
620
647
  this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
621
648
  }
649
+ if (!this.row.f_buy_phone) {
650
+ this.row.f_buy_phone = this.row.f_user_phone
651
+ }
622
652
  this.confirm()
623
653
  } else {
624
654
  this.confirm()
@@ -629,7 +659,7 @@
629
659
  this.$dispatch('success')
630
660
  },
631
661
  confirm () {
632
- this.eticket_msg=false
662
+ this.eticket_msg = false
633
663
  if (this.model.f_payment.length > 0 && this.model.f_payment.includes('余额写卡')) {
634
664
  if (this.model.f_collection > this.row.f_balance) {
635
665
  this.$showAlert('请注意!您的账户余额小于当前写卡金额,无法进行余额写卡,请修改后重试', 'warning', 2000)
@@ -700,8 +730,8 @@
700
730
  this.model.f_userinfo_id = this.row.f_userinfo_id
701
731
  try {
702
732
  preamountGen(this)
703
- if (this.model.f_preamount>0&&this.model.f_preamount){
704
- this.preDisable = true
733
+ if (this.model.f_preamount > 0 && this.model.f_preamount) {
734
+ this.preDisable = true
705
735
  }
706
736
  } catch (error) {
707
737
  this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
@@ -101,6 +101,52 @@ export default {
101
101
  this.$showAlert(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`, 'danger', 0)
102
102
  }
103
103
  },
104
+ async openETicketNoModal (sellId, row, type, retry = false) {
105
+ let model = {
106
+ id: sellId,
107
+ f_charge_type: type,
108
+ f_invoice_type: 0,
109
+ invoice_kind: row.f_paper_type,
110
+ org_id: this.$login.f.orgid,
111
+ retry,
112
+ isTax: row.invoice_is_pax === '征税' ? 1 : 0,
113
+ f_paper_name: row.f_paper_name,
114
+ f_buy_name: row.f_paper_name,
115
+ f_taxpayer_id: row.f_taxpayer_id,
116
+ f_address_phone: row.f_address_phone,
117
+ f_buy_phone: row.f_buy_phone,
118
+ f_buy_openbank: row.f_paper_account,
119
+ f_email: row.f_email,
120
+ remarks: row.f_eticket_reason || null,
121
+ loginInfo: {
122
+ operator: this.$login.f.name,
123
+ operator_id: this.$login.f.id,
124
+ org_id: this.$login.f.orgid,
125
+ orgname: this.$login.f.orgs,
126
+ dep_id: this.$login.f.depids,
127
+ depname: this.$login.f.deps
128
+ }
129
+ }
130
+ return new Promise(async (resolve, reject) => {
131
+ try {
132
+ const res = await this.$resetpost('/invoice/rs/logic/getInvoice', model, {
133
+ resolveMsg: null,
134
+ rejectMsg: '开票请求失败',
135
+ aoteEncrypt: '无',
136
+ encryKey: '无'
137
+ })
138
+ if (res.data.code === 200 && res.data.data.code === '0000') {
139
+ resolve('请求成功')
140
+ } else if (res.data.code === 200 && res.data.data.code === '9999') {
141
+ reject(res.data.data.msg)
142
+ } else {
143
+ reject(new Error('请求失败'))
144
+ }
145
+ } catch (error) {
146
+ reject(new Error(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`))
147
+ }
148
+ })
149
+ },
104
150
  async rushRedInvoice (eticket_id) {
105
151
  try {
106
152
  let model = {
@@ -198,7 +198,7 @@
198
198
  </modal>
199
199
  <!--文件上传按钮-->
200
200
  <eticket-modal :show="eticket_msg" :row="row" @confirm="confirm"></eticket-modal>
201
- <eticket-print-async :show="eticket_show" @toggle="eticket_toggle" v-ref:asynceticket></eticket-print-async>
201
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:asynceticket></ticket-print>
202
202
  </template>
203
203
  <script>
204
204
  /**
@@ -253,7 +253,7 @@
253
253
  if (self.model.f_payment == '赠气') {
254
254
  self.model.f_totalcost = self.model.f_preamount
255
255
  self.model.f_collection = 0
256
- }
256
+ }
257
257
  self.calText(getGas.data.chargeprice)
258
258
  }
259
259
  // 输入气量,换算金额
@@ -319,10 +319,10 @@
319
319
  await self.$resetpost('rs/logic/updatefiles', data)
320
320
  console.log('物联网收费返回。。。', res.data.id)
321
321
  // 开始打票
322
- console.log('开始打票', self.config,self.model.f_print)
322
+ console.log('开始打票', self.config, self.model.f_print)
323
323
 
324
324
  if (self.config.hasPrint) {
325
- if (self.model.f_print.indexOf('电子发票') == -1) {
325
+ if (!['电子发票', '数电普票', '数电专票'].includes(self.model.f_print[0])) {
326
326
  console.log('self.config.hasBillManage', self.config.hasBillManage)
327
327
  if (self.config.hasBillManage) {
328
328
  // 启用发票管理,获取票据管理中的票号并存储记录
@@ -336,9 +336,40 @@
336
336
  }
337
337
  } else if (self.config.printType === '国税发票') {
338
338
  // TODO
339
- } else if (self.model.f_print[0] === '电子发票') {
340
- self.eticket_show=true
341
- await self.$refs.asynceticket.openEticket(res.data.id, self.row,'物联网收费')
339
+ } else if (['电子发票', '数电普票', '数电专票'].includes(self.model.f_print[0])) {
340
+ // self.eticket_show = true
341
+ await self.$refs.asynceticket.openETicketNoModal(res.data.id, self.row, '物联网收费').then(
342
+ (_res) => {
343
+ if (self.config.hasBillManage) {
344
+ // 启用发票管理,获取票据管理中的票号并存储记录
345
+ self.row.id = res.data.id
346
+ self.row.f_bill_type = '物联网收费'
347
+ self.row.f_bill_style = self.model.f_print
348
+ self.print = true
349
+ } else {
350
+ self.row.id = res.data.id
351
+ self.print = true
352
+ }
353
+ }
354
+ ).catch((error) => {
355
+ if (error.status === 301) {
356
+ self.$dispatch('refresh')
357
+ } else {
358
+ if (error) {
359
+ self.$showAlert('收费成功,电子票开具失败,' + error + ',请在自定义开票页面补开发票。', 'danger', 0)
360
+ }
361
+ }
362
+ if (self.config.hasBillManage) {
363
+ // 启用发票管理,获取票据管理中的票号并存储记录
364
+ self.row.id = res.data.id
365
+ self.row.f_bill_type = '物联网收费'
366
+ self.row.f_bill_style = self.model.f_print
367
+ self.print = true
368
+ } else {
369
+ self.row.id = res.data.id
370
+ self.print = true
371
+ }
372
+ })
342
373
  }
343
374
  } else {
344
375
  self.$dispatch('success')
@@ -360,11 +391,10 @@
360
391
  console.log('卡表收费config', self.config)
361
392
  // 默认打印格式
362
393
  // 默认打印格式
363
- if(self.row.f_paper_type){
364
- self.model.f_print=self.row.f_paper_type instanceof Array ? self.row.f_paper_type : [self.row.f_paper_type ]
365
-
366
- }else{
367
- self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
394
+ if (self.row.f_paper_type) {
395
+ self.model.f_print = self.row.f_paper_type instanceof Array ? self.row.f_paper_type : [self.row.f_paper_type ]
396
+ } else {
397
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
368
398
  }
369
399
  // self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
370
400
  self.model.f_payment = [self.config.payment]
@@ -406,8 +436,8 @@
406
436
  title: '卡表收费',
407
437
  data () {
408
438
  return {
409
- //发票相关
410
- eticket_msg:false,
439
+ // 发票相关
440
+ eticket_msg: false,
411
441
  eticket_show: false,
412
442
  resid: [], // 存放新增的f_files表中id
413
443
  config: {
@@ -544,7 +574,8 @@
544
574
  },
545
575
  methods: {
546
576
  checkInvoiceMsg () {
547
- if (this.model.f_print[0] === '电子发票') {
577
+ console.debug('checkInvoiceMsg', this.model.f_print[0])
578
+ if (['电子发票', '数电普票', '数电专票'].includes(this.model.f_print[0])) {
548
579
  if (!this.row.f_taxpayer_id) {
549
580
  this.row.f_taxpayer_id = this.row.f_idnumber
550
581
  }
@@ -554,6 +585,9 @@
554
585
  if (!this.row.f_address_phone) {
555
586
  this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
556
587
  }
588
+ if (!this.row.f_buy_phone) {
589
+ this.row.f_buy_phone = this.row.f_user_phone
590
+ }
557
591
  this.confirm()
558
592
  } else {
559
593
  this.confirm()
@@ -567,7 +601,7 @@
567
601
  this.showfiles = !this.showfiles
568
602
  },
569
603
  confirm () {
570
- this.eticket_msg=false
604
+ this.eticket_msg = false
571
605
  this.clickConfirm = true
572
606
  this.model.f_curbalance = this.curbalance
573
607
  this.$dispatch('no-button')