sale-client 3.4.121 → 3.4.122

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.4.121",
3
+ "version": "3.4.122",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -336,6 +336,11 @@
336
336
  f_money: self.model.f_preamount
337
337
  }]
338
338
  }
339
+ self.model.xiekamoney = self.model.f_preamount
340
+ if (self.row.f_price_type == '阶梯气价' && self.row.f_is_step == '否' && self.row.f_collection_type == '按金额') {
341
+ self.model.xiekamoney = (self.model.f_pregas * self.model.chargeprice[0].f_price)
342
+ self.model.xiekamoney = self.model.xiekamoney.toFixed(4)
343
+ }
339
344
 
340
345
  self.model.payments = self.paymentModel
341
346
  // 加入扫码盒付款码支付流水号
@@ -29,12 +29,12 @@ export default {
29
29
  eticket_src: '',
30
30
  return_msg: '正在开票中,请稍后',
31
31
  show: true,
32
- print:false,
32
+ print: false,
33
33
  billData: {
34
34
  url: '',
35
35
  billnumber: ''
36
36
  },
37
- config:{
37
+ config: {
38
38
  priceCalculation: false, // 划气量控制
39
39
  showupload: true, // 默认不显示附件上传组件
40
40
  hasPrint: true, // 默认打票
@@ -43,7 +43,7 @@ export default {
43
43
  printType: '普通收据', // 收据/电子票/专用发票/国税发票
44
44
  payment: '现金缴费'
45
45
  },
46
- row:{}
46
+ row: {}
47
47
  }
48
48
  },
49
49
  props: ['show'],
@@ -51,8 +51,8 @@ export default {
51
51
  },
52
52
  methods: {
53
53
  cancel () {
54
- console.log("电子哈哈哈,你走了没")
55
- this.show= !this.show
54
+ console.log('电子哈哈哈,你走了没')
55
+ this.show = !this.show
56
56
  this.eticket_src = ''
57
57
  this.return_msg = '正在开票中,请稍后'
58
58
  this.$dispatch('toggle')
@@ -63,81 +63,93 @@ export default {
63
63
  watch_ch (src) {
64
64
  this.eticket_src = src
65
65
  },
66
- //正常收费开票
67
- async openEticket (sellid,row,type) {
66
+ // 正常收费开票
67
+ async openEticket (sellid, row, type) {
68
68
  try {
69
- let data={
70
- id:sellid,
71
- hsbs:row.f_whether_pay=='征税'?1:0,
72
- f_whether_pay:row.invoice_is_pax?row.invoice_is_pax.toString():'征税',
73
- bz:row.f_eticket_reason?row.f_eticket_reason:null,
74
- f_charge_type:type,
75
- f_dept_id: this.$login.f.depids,
76
- f_operator: this.$login.f.name,
77
- f_orgid: this.$login.f.orgid,
78
- f_orgname: this.$login.f.orgs,
79
- f_depname: this.$login.f.deps,
80
- f_operatorid: this.$login.f.id,
81
- f_buy_name: row.f_paper_name,
82
- f_pay_id: row.f_taxpayer_id,
83
- f_buy_address: row.f_address_phone,
84
- f_buy_openbank: row.f_paper_account
85
- }
69
+ let data = {
70
+ id: sellid,
71
+ hsbs: row.f_whether_pay == '征税' ? 1 : 0,
72
+ f_whether_pay: row.invoice_is_pax ? row.invoice_is_pax.toString() : '征税',
73
+ bz: row.f_eticket_reason ? row.f_eticket_reason : null,
74
+ f_charge_type: type,
75
+ f_dept_id: this.$login.f.depids,
76
+ f_operator: this.$login.f.name,
77
+ f_orgid: this.$login.f.orgid,
78
+ f_orgname: this.$login.f.orgs,
79
+ f_depname: this.$login.f.deps,
80
+ f_operatorid: this.$login.f.id,
81
+ f_buy_name: row.f_paper_name,
82
+ f_pay_id: row.f_taxpayer_id,
83
+ f_buy_address: row.f_address_phone,
84
+ f_buy_openbank: row.f_paper_account
85
+ }
86
86
  let getEticket = await Vue.resetpost('rs/logic/combineData', data, {resolveMsg: null, rejectMsg: '组织发票数据出错'})
87
87
  // 请求电子票
88
- console.log("getEtocket",getEticket)
89
- let res= await Vue.resetpost('rs/logic/openEticket', {id: getEticket.data.eticketid}, {resolveMsg: '开票成功', rejectMsg: '开具电子票出错, 请到票据管理重新开具'})
88
+ console.log('getEtocket', getEticket)
89
+ // 请求失败继续请求, 最多三次
90
+ let res = ''
91
+ for (let i = 0; i < 3; i++) {
92
+ try {
93
+ res = await Vue.resetpost('rs/logic/openEticket', {id: getEticket.data.eticketid}, {resolveMsg: '开票成功', rejectMsg: null})
94
+ } catch (error) {
95
+ console.log(i + '次开票失败', error)
96
+ if (i == 2) Vue.showAlert(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`, 'danger', 0)
97
+ }
98
+ if (res.data.code == 200 && res.data.f_bill_url != '') {
99
+ break
100
+ }
101
+ }
90
102
  console.log(res)
91
- if(res.data.code==200&&res.data.f_bill_url!=''){
92
- this.show=false
93
- this.billData.url=this.getBillUrl(type)
103
+ if (res.data.code == 200 && res.data.f_bill_url != '') {
104
+ this.show = false
105
+ this.billData.url = this.getBillUrl(type)
94
106
  this.row.id = sellid
95
107
  this.row.f_bill_type = type
96
- this.print=true
97
- }else{
98
- this.show= !this.show
108
+ this.print = true
109
+ } else {
110
+ this.show = !this.show
99
111
  }
100
- console.log("返回发票地址",res.data.f_bill_url)
112
+ console.log('返回发票地址', res.data.f_bill_url)
101
113
  } catch (error) {
102
114
  console.log('电子发票开票失败', JSON.stringify(error))
103
115
  Vue.showAlert(`电子发票开票失败!!请到发票管理重新开票。错误原因: ${JSON.stringify(error)}。`, 'danger', 0)
104
116
  }
105
117
  },
106
- //冲红开票
118
+ // 冲红开票
107
119
  async redOpenEticket (row) {
108
- this.show= !this.show
109
- console.log("resdata",row)
110
- row.f_dept_id= this.$login.f.depids
111
- row.f_operator= this.$login.f.name
112
- row.f_orgid= this.$login.f.orgid
113
- row.f_orgname= this.$login.f.orgs
114
- row.f_depname= this.$login.f.deps
115
- row.f_operatorid= this.$login.f.id
116
- let result= await Vue.resetpost('rs/logic/correctEticket',{data:row},{resolveMsg:null,rejectMsg:'组织冲红数据失败'})
117
- try{
118
- if(result){
119
- console.log("res",result)
120
- let rest=await Vue.resetpost('rs/logic/redEticket',{data:{eticket_id:result.data.eticket_id,org_eticket_id:result.data.f_red_info_code}},{resolveMsg:'',rejectMsg:'冲红失败'})
121
- console.log("???",rest)
122
- if(rest.data.status==200&&rest.data.f_bill_url!=''){
123
- this.eticket_src=rest.data.f_bill_url!=''?rest.data.f_bill_url:rest.data.msg
124
- }else{
125
- let rollback={
126
- id:result.data.eticket_id,//此id为冲红记录id
127
- f_eticket_id:row.f_eticket_id //为原发票id
120
+ this.show = !this.show
121
+ console.log('resdata', row)
122
+ row.f_dept_id = this.$login.f.depids
123
+ row.f_operator = this.$login.f.name
124
+ row.f_orgid = this.$login.f.orgid
125
+ row.f_orgname = this.$login.f.orgs
126
+ row.f_depname = this.$login.f.deps
127
+ row.f_operatorid = this.$login.f.id
128
+ let result = await Vue.resetpost('rs/logic/correctEticket', {data: row}, {resolveMsg: null, rejectMsg: '组织冲红数据失败'})
129
+ try {
130
+ if (result) {
131
+ console.log('res', result)
132
+ let rest = await Vue.resetpost('rs/logic/redEticket', {data: {eticket_id: result.data.eticket_id, org_eticket_id: result.data.f_red_info_code}}, {resolveMsg: '', rejectMsg: '冲红失败'})
133
+ console.log('???', rest)
134
+ if (rest.data.status == 200 && rest.data.f_bill_url != '') {
135
+ this.eticket_src = rest.data.f_bill_url != '' ? rest.data.f_bill_url : rest.data.msg
136
+ } else {
137
+ let rollback = {
138
+ id: result.data.eticket_id, // 此id为冲红记录id
139
+ f_eticket_id: row.f_eticket_id // 为原发票id
128
140
  }
129
- await Vue.resetpost('rs/logic/rollBackEticket',{data:rollback},{resolveMsg:'',rejectMsg:'冲红异常请求异常回滚失败'})
130
- this.return_msg=`冲红失败,原因:${rest.data.msg}`
141
+ await Vue.resetpost('rs/logic/rollBackEticket', {data: rollback}, {resolveMsg: '', rejectMsg: '冲红异常请求异常回滚失败'})
142
+ this.return_msg = `冲红失败,原因:${rest.data.msg}`
131
143
  }
132
- console.log("返回发票地址",this.eticket_src,this.return_msg)
144
+ console.log('返回发票地址', this.eticket_src, this.return_msg)
133
145
  }
134
146
  } catch (e) {
135
- console.log("异常处理一下,需要删除冲红记录,修改原发票桩体")
136
- let rollback={
137
- id:result.data.eticket_id,//此id为冲红记录id
138
- f_eticket_id:row.f_eticket_id //为原发票id
147
+ console.log('异常处理一下,需要删除冲红记录,修改原发票桩体')
148
+ let rollback = {
149
+ id: result.data.eticket_id, // 此id为冲红记录id
150
+ f_eticket_id: row.f_eticket_id // 为原发票id
139
151
  }
140
- await Vue.resetpost('rs/logic/rollBackEticket',{data:rollback},{resolveMsg:'',rejectMsg:'冲红异常请求异常回滚失败'})
152
+ await Vue.resetpost('rs/logic/rollBackEticket', {data: rollback}, {resolveMsg: '', rejectMsg: '冲红异常请求异常回滚失败'})
141
153
  }
142
154
  },
143
155
  getBillUrl (type) {
@@ -150,7 +162,7 @@ export default {
150
162
  name = 'rs/report/machine_bill'
151
163
  } else if (type === '物联网收费') {
152
164
  name = 'rs/report/iot_bill'
153
- }else if (type === '超用收费') {
165
+ } else if (type === '超用收费') {
154
166
  name = 'rs/report/overuse_bill'
155
167
  } else if (type === '其他收费') {
156
168
  name = 'rs/report/otherCharge_bill'
@@ -174,7 +186,7 @@ export default {
174
186
  },
175
187
  clean () {
176
188
  this.$dispatch('refresh', this.row)
177
- },
189
+ }
178
190
  },
179
191
  watch: {},
180
192
  events: {}