sale-client 3.6.214 → 3.6.216

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.214",
3
+ "version": "3.6.216",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -73,6 +73,15 @@
73
73
  close-on-select v-ref:slice>
74
74
  </v-select>
75
75
  </div>
76
+ <div class="col-sm-6 form-group " v-if="!usertype">
77
+ <label class="font_normal_body">地区类型</label>
78
+ <v-select
79
+ :value.sync="model.f_iscity" :value-single="true"
80
+ :options='iscity' placeholder='请选择'
81
+ @change="changecity"
82
+ close-on-select>
83
+ </v-select>
84
+ </div>
76
85
  <div v-if="!usertype" class="col-sm-6 form-group ">
77
86
  <label for="f_address" class="font_normal_body">楼&emsp;&emsp;号</label>
78
87
  <input type="text" style="width:40%" v-model="model.f_building" class="input_search"
@@ -299,6 +308,7 @@
299
308
  f_floor_suffix: '层',
300
309
  f_room_suffix: '室'
301
310
  },
311
+ iscity:[{label:'市区',value:'市区'},{label:'乡镇',value:'乡镇'},{label:'全部',value:''}],
302
312
  model: {
303
313
  f_pcd_id: '',
304
314
  f_street_id: '',
@@ -350,6 +360,27 @@
350
360
  getAreaConfig(this)
351
361
  },
352
362
  methods: {
363
+ async changecity(){
364
+ this.areaslist = []
365
+ // this.model.f_residential_area_id = null
366
+ // this.model.f_residential_area = null
367
+ let condition = `isnull(f_iscity,'') = isnull('${this.model.f_iscity}','') and a.f_orgid = '${this.$login.f.orgid}'`
368
+ let req = await this.$resetpost('rs/sql/address_getresidential', {
369
+ data: {
370
+ condition: condition
371
+ }
372
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
373
+ let redata = []
374
+ req.data.forEach((row) => {
375
+ redata.push({
376
+ label: row.f_residential_area,
377
+ value: row.id,
378
+ data: row,
379
+ id: row.id
380
+ })
381
+ })
382
+ this.areaslist=redata
383
+ },
353
384
  async initdata () {
354
385
  this.model.f_address_state = '未通气'
355
386
  this.initAreas(this.f_filialeids)
@@ -151,7 +151,7 @@
151
151
  <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_phone ? 'has-error' : '']">
152
152
  <label class="control-label">开票电话:</label>
153
153
  <input class="form-control col-sm-2"
154
- v-model="row.f_buy_phone" placeholder="开票地址">
154
+ v-model="row.f_buy_phone" placeholder="开票电话">
155
155
  </div>
156
156
  <div class="col-sm-12 form-group form-input-group">
157
157
  <label class="control-label">邮箱推送:</label>
@@ -162,7 +162,7 @@
162
162
  <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_phone ? 'has-error' : '']">
163
163
  <label class="control-label">开票电话:</label>
164
164
  <input class="form-control col-sm-2"
165
- v-model="row.f_buy_phone" placeholder="开票地址">
165
+ v-model="row.f_buy_phone" placeholder="开票电话">
166
166
  </div>
167
167
  <div class="col-sm-12 form-group form-input-group">
168
168
  <label class="control-label">邮箱推送:</label>
@@ -233,7 +233,7 @@
233
233
  <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_phone ? 'has-error' : '']">
234
234
  <label class="control-label">开票电话:</label>
235
235
  <input class="form-control col-sm-2"
236
- v-model="row.f_buy_phone" placeholder="开票地址">
236
+ v-model="row.f_buy_phone" placeholder="开票电话">
237
237
  </div>
238
238
  <div class="col-sm-12 form-group form-input-group">
239
239
  <label class="control-label">邮箱推送:</label>
@@ -207,7 +207,7 @@
207
207
  <label class="control-label">开票电话:</label>
208
208
  <input class="form-control col-sm-2"
209
209
  :disabled="diytick"
210
- v-model="row.f_buy_phone" placeholder="开票地址">
210
+ v-model="row.f_buy_phone" placeholder="开票电话">
211
211
  </div>
212
212
  <div class="col-sm-12 form-group form-input-group">
213
213
  <label class="control-label">邮箱推送:</label>
@@ -43,7 +43,7 @@
43
43
  <div class="col-sm-12 form-group form-input-group" :class="[!row.f_buy_phone ? 'has-error' : '']">
44
44
  <label class="control-label">开票电话:</label>
45
45
  <input class="form-control col-sm-2"
46
- v-model="row.f_buy_phone" placeholder="开票地址">
46
+ v-model="row.f_buy_phone" placeholder="开票电话">
47
47
  </div>
48
48
  <div class="col-sm-12 form-group form-input-group">
49
49
  <label class="control-label">邮箱推送:</label>
@@ -58,7 +58,7 @@ export default {
58
58
  async openETicket (sellId, row, show_gas, is_pax, type, invoice_kind = '电子发票', retry = false) {
59
59
  try {
60
60
  let model = {
61
- id: sellId[0],
61
+ id: sellId,
62
62
  charge_item: type,
63
63
  invoice_type: 0,
64
64
  invoice_kind,
@@ -124,7 +124,7 @@ export default {
124
124
  }
125
125
  // TODO 组织开票数据并保存
126
126
  const res = await this.$resetpost('/invoice/rs/logic/getInvoice', model, {resolveMsg: null, rejectMsg: '开票请求失败'})
127
- if (res.data.code == '0000') {
127
+ if (res.data.code === 200 && res.data.data.code == '0000') {
128
128
  this.return_msg = '发票开具成功,请稍后到发票管理页面查看或打印'
129
129
  } else {
130
130
  this.return_msg = '发票开具失败,请稍后到发票管理页面补打或重开'
@@ -0,0 +1,260 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='v'>
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row">
6
+ <div class="col-sm-4 form-group">
7
+ <label class="font_normal_body">用户编号</label>
8
+ <input class="input_search" style="width:60%" type="text" placeholder='目标用户编号'
9
+ v-model="model.f_userinfo_code" @blur="getuser(model.f_userinfo_code)">
10
+ </div>
11
+ <div class="col-sm-4 form-group" >
12
+ <label for="f_user_name" class="font_normal_body">用户姓名</label>
13
+ <input class="input_search" style="width:60%" type="text" placeholder='目标用户姓名'
14
+ v-model="model.f_user_name" readonly >
15
+ </div>
16
+
17
+ <div class="col-sm-4 form-group" >
18
+ <label class="font_normal_body">气表类型</label>
19
+ <input class="input_search" style="width:60%" type="text" placeholder='目标用户气表类型'
20
+ v-model="model.f_meter_type" readonly >
21
+ </div>
22
+ </div>
23
+ <div class="row">
24
+
25
+ <div class="col-sm-4 form-group" v-if="row.f_meter_type =='机表'" >
26
+ <label class="font_normal_body">当前余额</label>
27
+ <input class="input_search" style="width:60%" type="text" placeholder='当前余额'
28
+ v-model="row.f_balance" readonly >
29
+ </div>
30
+ <div class="col-sm-4 form-group" v-if="row.f_meter_type =='物联网表'" >
31
+ <label class="font_normal_body">当前余额</label>
32
+ <input class="input_search" style="width:60%" type="text" placeholder='当前余额'
33
+ v-model="row.f_balance_amount" readonly >
34
+ </div>
35
+ <div class="col-sm-4 form-group" v-if="row.f_meter_type == '气量卡表' || row.f_meter_type == '金额卡表'"
36
+ :class="[$v.f_meter_base.required || $v.f_meter_base.dctest ? 'has-error' : 'has-success']">
37
+ <label class="font_normal_body">当前底数</label>
38
+ <input class="input_search" style="width:60%" type="text" placeholder='当前表已用气量'
39
+ @blur="meterBaseChange()"
40
+ v-validate:f_meter_base='{required: true}' v-model="model.f_meter_base" >
41
+ </div>
42
+ <div class="col-sm-4 form-group" v-if="model.f_meter_type!='' && model.f_meter_type!='气量卡表'"
43
+ :class="[$v.f_move_fee.required || $v.f_move_fee.dctest ? 'has-error' : 'has-success']">
44
+ <label class="font_normal_body">转气金额</label>
45
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_move_fee"
46
+ @blur="preamount()"
47
+ v-validate:f_move_fee='{required: true}' placeholder="转气金额">
48
+ </div>
49
+ <div class="col-sm-4 form-group" v-if="model.f_meter_type!='' && model.f_meter_type=='气量卡表'"
50
+ :class="[$v.f_move_fee.required || $v.f_move_fee.dctest ? 'has-error' : 'has-success']">
51
+ <label class="font_normal_body">转气金额</label>
52
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_move_fee"
53
+
54
+ v-validate:f_move_fee='{required: true}' placeholder="转气金额">
55
+ </div>
56
+ <div class="col-sm-4 form-group" v-if="model.f_meter_type!='' && model.f_meter_type=='气量卡表'"
57
+ :class="[$v.f_move_gas.required || $v.f_move_gas.dctest ? 'has-error' : 'has-success']">
58
+ <label class="font_normal_body">转气气量</label>
59
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_move_gas"
60
+ @blur="pregas()"
61
+ v-validate:f_move_gas='{required: true}' placeholder="转气气量">
62
+ </div>
63
+ <div class="col-sm-4 form-group" v-if="model.f_meter_type!='' && model.f_meter_type!='气量卡表'"
64
+ :class="[$v.f_move_gas.required || $v.f_move_gas.dctest ? 'has-error' : 'has-success']">
65
+ <label class="font_normal_body">转气气量</label>
66
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_move_gas"
67
+ v-validate:f_move_gas='{required: true}' placeholder="转气气量">
68
+ </div>
69
+ </div>
70
+
71
+ <div class="row">
72
+ <div class="col-sm-8">
73
+ <label for="f_paper_account" class="font_normal_body ">&nbsp;&nbsp;&nbsp;备注&nbsp;&nbsp;&nbsp;</label>
74
+ <input class="input_search" style="width:80%" v-model="model.f_comments">
75
+ </div>
76
+
77
+ </div>
78
+ </form>
79
+ <div style="text-align:right;">
80
+ <button class="button_search btn-gn" @click="confirm()" :disabled='!$v.valid'>确认</button>
81
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
82
+ </div>
83
+ </validator>
84
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" :businessid="randomBusinessId" isremark="true" fusetype="转气"></upload>
85
+ <!--<print-bill :show="print" :bill-manager='config.hasBillManage' v-ref:printbill :bill-url='billUrl' v-on:toggle="clean" @printok="printok" :data='printModel'></print-bill>-->
86
+ </div>
87
+ </template>
88
+
89
+
90
+ <script>
91
+ let preamountGen = async function (self) {
92
+ let calFee = self.model.f_move_fee
93
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
94
+ if (getGas.data.gas) {
95
+ self.model.f_move_gas = (getGas.data.gas - 0).toFixed(2)
96
+ }
97
+ }
98
+ let pregasGen = async function (self) {
99
+ self.model.f_move_gas = (self.model.f_move_gas - 0).toFixed(2)
100
+ self.model.f_reverse = self.model.f_move_gas
101
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_move_gas)
102
+ self.model.f_move_fee = getAmount.data.chargenum
103
+ }
104
+ export default {
105
+ title: '转气',
106
+ data () {
107
+ return {
108
+ model: {
109
+ f_refund_fee: '',
110
+ f_comments: '',
111
+ f_meter_type: '',
112
+ f_user_name: '',
113
+ f_userfiles_id: '',
114
+ f_move_fee: 0,
115
+ f_move_gas: 0
116
+ },
117
+ config: {
118
+ showupload: true // 默认显示附件上传组件
119
+ },
120
+ blodid: '',
121
+ randomBusinessId: '',
122
+ hasValidateBill: false,
123
+ validateOk: false,
124
+
125
+ printModel: {},
126
+ print: false,
127
+ billUrl: '',
128
+ billData: {
129
+ url: 'rs/report/refund_sell',
130
+ bill: ''
131
+ },
132
+
133
+ // 下拉框值
134
+ paytype: this.$appdata.getParam('付款方式'),
135
+ printstyle: this.$appdata.getParam('打印格式')
136
+ }
137
+ },
138
+ props: ['row'],
139
+ ready () {
140
+ this.getRandomId()
141
+ },
142
+ methods: {
143
+ getRandomId () {
144
+ this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
145
+ let res = Math.random() * 16 | 0
146
+ let v = c == 'x' ? res : (res & 0x3 | 0x8)
147
+ return v.toString(16)
148
+ })
149
+ },
150
+ meterBaseChange () {
151
+ if (this.model.f_meter_base && this.model.f_meter_base > 0 && this.model.f_meter_base <= this.row.f_total_gas) {
152
+ this.model.f_move_gas = (this.row.f_total_gas - this.model.f_meter_base).toFixed(2)
153
+ }
154
+ if (this.model.f_meter_base > this.row.f_total_gas) {
155
+ this.$showAlert('转气底数不能大于总购气量', 'warning', 1500)
156
+ this.model.f_meter_base = ''
157
+ return
158
+ }
159
+ if (this.model.f_move_gas && this.model.f_move_gas > 0) {
160
+ try {
161
+ pregasGen(this)
162
+ } catch (error) {
163
+ this.$showAlert(`划价错误,错误类型:${error}`, 'danger', 0)
164
+ }
165
+ } else {
166
+ this.model.f_move_gas = 0
167
+ }
168
+ },
169
+ preamount () {
170
+ try {
171
+ preamountGen(this)
172
+ } catch (error) {
173
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
174
+ }
175
+ },
176
+ pregas () {
177
+ if (this.model.f_move_gas && this.model.f_move_gas > 0) {
178
+ try {
179
+ pregasGen(this)
180
+ } catch (error) {
181
+ this.$showAlert(`划价错误,错误类型:${error}`, 'danger', 0)
182
+ }
183
+ } else {
184
+ this.model.f_move_gas = 0
185
+ }
186
+ },
187
+ async getuser (val) {
188
+ if (val == this.row.f_userinfo_code) {
189
+ this.$showAlert('不能给自己转气', 'warning', 1500)
190
+ return
191
+ }
192
+ let res = await this.$resetpost('rs/sql/sale_getUser',
193
+ {data: {condition: `i.f_userinfo_code='${val}' and i.f_orgid='${this.$login.f.orgid}'`}}, {resolveMsg: null, rejectMsg: null})
194
+ console.log(res.data)
195
+ if (res.data.length > 0) {
196
+ this.model.f_user_name = res.data[0].f_user_name
197
+ this.model.f_meter_type = res.data[0].f_meter_type
198
+ this.model.f_userfiles_id = res.data[0].f_userfiles_id
199
+ } else {
200
+ this.$showAlert('输入的用户编号不正确', 'warning', 1500)
201
+ }
202
+ },
203
+ async confirm () {
204
+ if (this.model.f_move_fee <= 0) {
205
+ this.$showAlert('转气金额和气量不能为0或小于0', 'warning', 1500)
206
+ return
207
+ }
208
+ if (this.row.f_meter_type == '机表' && this.row.f_balance < this.model.f_move_fee) {
209
+ this.$showAlert('转气金额不能大于余额', 'warning', 1500)
210
+ return
211
+ }
212
+ if (this.row.f_meter_type == '物联网表' && this.row.f_balance_amount < this.model.f_move_fee) {
213
+ this.$showAlert('转气金额不能大于余额', 'warning', 1500)
214
+ return
215
+ }
216
+ if (!this.model.f_meter_type) {
217
+ this.$showAlert('请先输入目标用户信息', 'warning', 1500)
218
+ return
219
+ }
220
+
221
+ let param = {
222
+ f_user_id: this.row.f_user_id,
223
+ f_userfiles_id: this.row.f_userfiles_id,
224
+ userfilesid: this.model.f_userfiles_id,
225
+ version: this.row.version,
226
+ f_move_fee: this.model.f_move_fee,
227
+ f_meter_base: this.model.f_meter_base,
228
+ f_move_gas: this.model.f_move_gas,
229
+ f_comments: this.model.f_comments,
230
+ f_billing: this.row.f_billing,
231
+ f_userinfo_code: this.model.f_userinfo_code,
232
+ f_price_id: this.row.f_price_id,
233
+ f_orgid: this.$login.f.orgid,
234
+ f_stairprice_id: this.row.f_stairprice_id,
235
+ operInfo: {
236
+ f_operator: this.$login.f.name,
237
+ f_operatorid: this.$login.f.id,
238
+ f_orgid: this.$login.f.orgid,
239
+ f_orgname: this.$login.f.orgs,
240
+ f_depid: this.$login.f.depids,
241
+ f_depname: this.$login.f.deps
242
+ }
243
+ }
244
+
245
+ let res = await this.$resetpost('rs/logic/movegas', {data: param}, {warnMsg: `确定要进行转气吗?`, resolveMsg: '转气成功!!', rejectMsg: '转气失败!!请重试!!'})
246
+ this.$dispatch('success')
247
+ },
248
+ clean () {
249
+ this.$dispatch('refresh')
250
+ },
251
+ printok () {
252
+ this.$dispatch('success')
253
+ },
254
+ validateBill (val) {
255
+ this.validateOk = !val.isOk
256
+ this.billData.bill = val.bill
257
+ }
258
+ }
259
+ }
260
+ </script>
@@ -30,4 +30,6 @@ export default function () {
30
30
  Vue.component('card-list', (resolve) => { require(['./CardList'], resolve) })
31
31
  // 机表抄表审核
32
32
  Vue.component('machine-hand-audit', (resolve) => { require(['./machineHandAudit'], resolve) })
33
+ // 转气
34
+ Vue.component('gas-move', (resolve) => { require(['./gasmove'], resolve) })
33
35
  }
@@ -691,7 +691,7 @@ let sendCardSaleGasGenremanent = async function (model, row) {
691
691
  let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
692
692
  resolveMsg: null,
693
693
  rejectMsg: '开户卡服务错误'
694
- })
694
+ },80000)
695
695
  if (!cardParams || ((model.f_pregas > model.f_remanent_gas) && !result) || cardRes.data.Err || cardRes.data.Exception) {
696
696
  // 写卡异常
697
697
  // 数据回滚操作
@@ -798,7 +798,7 @@ let resetsendCardSaleGasGen = async function (model, row) {
798
798
  let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
799
799
  resolveMsg: null,
800
800
  rejectMsg: '重开户卡服务错误'
801
- })
801
+ },80000)
802
802
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
803
803
  // 写卡异常
804
804
  // 数据回滚操作
@@ -907,7 +907,7 @@ let sendCardSaleGasGen = async function (model, row) {
907
907
  let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
908
908
  resolveMsg: null,
909
909
  rejectMsg: '开户卡服务错误'
910
- })
910
+ },80000)
911
911
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
912
912
  // 写卡异常
913
913
  // 数据回滚操作
@@ -1116,7 +1116,7 @@ let replaceCardGenJB = function * (model, row) {
1116
1116
  let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
1117
1117
  resolveMsg: null,
1118
1118
  rejectMsg: '补卡卡服务错误'
1119
- }))
1119
+ },80000))
1120
1120
  // 卡服务写卡异常,业务逻辑回滚
1121
1121
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
1122
1122
  Vue.$showAlert('机表补卡失败!!', 'danger', 0)
@@ -1204,7 +1204,7 @@ let replaceXq = function * (model, row) {
1204
1204
  let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
1205
1205
  resolveMsg: null,
1206
1206
  rejectMsg: '擦虚气服务错误'
1207
- }))
1207
+ },80000))
1208
1208
  if (cardRes.data.Err || cardRes.data.Exception) {
1209
1209
  return {status: 1}
1210
1210
  } else {
@@ -1290,7 +1290,7 @@ let replaceCardGen = function * (model, row, allot) {
1290
1290
  let cardRes = yield co(Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params, {
1291
1291
  resolveMsg: null,
1292
1292
  rejectMsg: '补卡卡服务错误'
1293
- }))
1293
+ },80000))
1294
1294
  // 卡服务写卡异常,业务逻辑回滚
1295
1295
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
1296
1296
  Vue.$showAlert('补卡失败!!', 'danger', 0)
@@ -1424,14 +1424,14 @@ let offlineWriteGen = async function (row) {
1424
1424
  param.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
1425
1425
  param.cs = row.cardInfo.Times + 1
1426
1426
  param.bkcs = param.bkcs + 1
1427
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
1427
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'},80000)
1428
1428
  } else if (row.states === '换表') {
1429
1429
  param.kzt = '0'
1430
1430
  param.bkcs = param.bkcs + 1
1431
1431
  param.cs = 1
1432
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
1432
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'},80000)
1433
1433
  } else {
1434
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
1434
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', param, {resolveMsg: null, rejectMsg: '写卡失败'},80000)
1435
1435
  }
1436
1436
  if (!cardParams || cardRes.data.Err || cardRes.data.Exception) {
1437
1437
  let sql = `update t_sellinggas set
@@ -1706,27 +1706,57 @@ let marginGen = async function (model, row) {
1706
1706
  params2.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
1707
1707
  cardparam = JSON.stringify(params2)
1708
1708
  cardpost = 'WriteNewCard'
1709
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1709
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1710
1710
  } else if (result.data.last_oper === '换表') {
1711
1711
  console.log('我走的是写新卡换表')
1712
1712
  cardparam = JSON.stringify(params3)
1713
1713
  cardpost = 'WriteNewCard'
1714
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1714
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1715
1715
  } else if (result.data.last_oper === '换表补气') {
1716
1716
  // 累购金额需要将上次购气金额加上
1717
1717
  console.log('我走的是正常的收费', params)
1718
1718
  cardparam = JSON.stringify(params)
1719
1719
  cardpost = 'WriteGasCard'
1720
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1720
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1721
1721
  } else {
1722
1722
  console.log('我走的是正常的收费', params)
1723
1723
  cardparam = JSON.stringify(params)
1724
1724
  cardpost = 'WriteGasCard'
1725
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1725
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1726
1726
  }
1727
1727
  console.log('卡表收费返回写卡参数值', cardRes)
1728
1728
  // 卡服务写卡异常,业务逻辑回滚
1729
1729
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
1730
+ if (result) {
1731
+ let data = {
1732
+ cardparam: cardparam,
1733
+ cardpost: cardpost,
1734
+ id: result.data.id,
1735
+ userinfo: {
1736
+ f_userinfo_id: row.f_userinfo_id,
1737
+ version: row.userinfo_version + 1,
1738
+ f_balance: row.f_balance,
1739
+ userfiles: {
1740
+ f_user_id: model.f_user_id,
1741
+ f_userfiles_id: row.f_userfiles_id,
1742
+ f_total_gas: row.f_total_gas,
1743
+ f_write_totalgas: row.f_write_totalgas,
1744
+ f_write_totalfee: row.f_write_totalfee,
1745
+ f_total_fee: row.f_total_fee,
1746
+ f_card_id: row.f_card_id,
1747
+ f_times: row.cardInfo.Times,
1748
+ version: row.version + 1
1749
+ }
1750
+ }
1751
+ }
1752
+ if (row.f_tag) {
1753
+ data.userinfo.userfiles.f_tag = row.f_tag
1754
+ }
1755
+ if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
1756
+ data.userinfo.userfiles.f_times = row.f_times
1757
+ }
1758
+ await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
1759
+ }
1730
1760
  throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
1731
1761
  } else {
1732
1762
  // 调用读卡进行校验
@@ -1754,36 +1784,6 @@ let marginGen = async function (model, row) {
1754
1784
  throw new Error(`请检查卡是否插好!!`)
1755
1785
  }
1756
1786
  } catch (error) {
1757
- if (result) {
1758
- let data = {
1759
- cardparam: cardparam,
1760
- cardpost: cardpost,
1761
- id: result.data.id,
1762
- userinfo: {
1763
- f_userinfo_id: row.f_userinfo_id,
1764
- version: row.userinfo_version + 1,
1765
- f_balance: row.f_balance,
1766
- userfiles: {
1767
- f_user_id: model.f_user_id,
1768
- f_userfiles_id: row.f_userfiles_id,
1769
- f_total_gas: row.f_total_gas,
1770
- f_write_totalgas: row.f_write_totalgas,
1771
- f_write_totalfee: row.f_write_totalfee,
1772
- f_total_fee: row.f_total_fee,
1773
- f_card_id: row.f_card_id,
1774
- f_times: row.cardInfo.Times,
1775
- version: row.version + 1
1776
- }
1777
- }
1778
- }
1779
- if (row.f_tag) {
1780
- data.userinfo.userfiles.f_tag = row.f_tag
1781
- }
1782
- if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
1783
- data.userinfo.userfiles.f_times = row.f_times
1784
- }
1785
- await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
1786
- }
1787
1787
  throw error
1788
1788
  }
1789
1789
  }
@@ -1902,27 +1902,57 @@ let sellgasGen = async function (model, row) {
1902
1902
  params2.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
1903
1903
  cardparam = JSON.stringify(params2)
1904
1904
  cardpost = 'WriteNewCard'
1905
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1905
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params2, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1906
1906
  } else if (result.data.last_oper === '换表') {
1907
1907
  console.log('我走的是写新卡换表')
1908
1908
  cardparam = JSON.stringify(params3)
1909
1909
  cardpost = 'WriteNewCard'
1910
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1910
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', params3, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1911
1911
  } else if (result.data.last_oper === '换表补气') {
1912
1912
  // 累购金额需要将上次购气金额加上
1913
1913
  console.log('我走的是正常的收费', params)
1914
1914
  cardparam = JSON.stringify(params)
1915
1915
  cardpost = 'WriteGasCard'
1916
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1916
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1917
1917
  } else {
1918
1918
  console.log('我走的是正常的收费', params)
1919
1919
  cardparam = JSON.stringify(params)
1920
1920
  cardpost = 'WriteGasCard'
1921
- cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'})
1921
+ cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '卡表收费失败'},80000)
1922
1922
  }
1923
1923
  console.log('卡表收费返回写卡参数值', cardRes)
1924
1924
  // 卡服务写卡异常,业务逻辑回滚
1925
1925
  if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
1926
+ if (result) {
1927
+ let data = {
1928
+ cardparam: cardparam,
1929
+ cardpost: cardpost,
1930
+ id: result.data.id,
1931
+ userinfo: {
1932
+ f_userinfo_id: row.f_userinfo_id,
1933
+ version: row.userinfo_version + 1,
1934
+ f_balance: row.f_balance,
1935
+ userfiles: {
1936
+ f_user_id: model.f_user_id,
1937
+ f_userfiles_id: row.f_userfiles_id,
1938
+ f_total_gas: row.f_total_gas,
1939
+ f_write_totalgas: row.f_write_totalgas,
1940
+ f_write_totalfee: row.f_write_totalfee,
1941
+ f_total_fee: row.f_total_fee,
1942
+ f_card_id: row.f_card_id,
1943
+ f_times: row.cardInfo.Times,
1944
+ version: row.version + 1
1945
+ }
1946
+ }
1947
+ }
1948
+ if (row.f_tag) {
1949
+ data.userinfo.userfiles.f_tag = row.f_tag
1950
+ }
1951
+ if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
1952
+ data.userinfo.userfiles.f_times = row.f_times
1953
+ }
1954
+ await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
1955
+ }
1926
1956
  throw `卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`
1927
1957
  } else {
1928
1958
  // 调用读卡进行校验
@@ -1950,36 +1980,6 @@ let sellgasGen = async function (model, row) {
1950
1980
  throw new Error(`请检查卡是否插好!!`)
1951
1981
  }
1952
1982
  } catch (error) {
1953
- if (result) {
1954
- let data = {
1955
- cardparam: cardparam,
1956
- cardpost: cardpost,
1957
- id: result.data.id,
1958
- userinfo: {
1959
- f_userinfo_id: row.f_userinfo_id,
1960
- version: row.userinfo_version + 1,
1961
- f_balance: row.f_balance,
1962
- userfiles: {
1963
- f_user_id: model.f_user_id,
1964
- f_userfiles_id: row.f_userfiles_id,
1965
- f_total_gas: row.f_total_gas,
1966
- f_write_totalgas: row.f_write_totalgas,
1967
- f_write_totalfee: row.f_write_totalfee,
1968
- f_total_fee: row.f_total_fee,
1969
- f_card_id: row.f_card_id,
1970
- f_times: row.cardInfo.Times,
1971
- version: row.version + 1
1972
- }
1973
- }
1974
- }
1975
- if (row.f_tag) {
1976
- data.userinfo.userfiles.f_tag = row.f_tag
1977
- }
1978
- if (!(row.f_hascard == null) && !(row.f_share_times == null) && row.f_meter_type === '物联网表' && row.f_hascard === '是' && row.f_share_times === '是') {
1979
- data.userinfo.userfiles.f_times = row.f_times
1980
- }
1981
- await Vue.resetpost('rs/logic/cardChargeRollback', {data: data}, {resolveMsg: '卡表收费失败', rejectMsg: '卡表收费失败'})
1982
- }
1983
1983
  throw error
1984
1984
  }
1985
1985
  }