sale-client 3.5.16 → 3.5.17
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
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex-row">
|
|
3
|
+
<div class="span" style="overflow-y: scroll">
|
|
4
|
+
<form novalidate class="form-horizontal">
|
|
5
|
+
<p class="bg-info text-center" style="padding: 8px;">上次购气信息</p>
|
|
6
|
+
<div class="row" style="margin-top:6px;">
|
|
7
|
+
<label class=" col-sm-2 control-label">预购气量</label>
|
|
8
|
+
<div class="col-sm-2" >
|
|
9
|
+
<input class="form-control" type="number" v-model="model.f_pregas" placeholder="预购气量" disabled>
|
|
10
|
+
</div>
|
|
11
|
+
<label class=" col-sm-2 control-label">预购金额</label>
|
|
12
|
+
<div class="col-sm-2">
|
|
13
|
+
<input class="form-control" type="number" v-model="model.f_preamount" placeholder="预购金额" disabled>
|
|
14
|
+
</div>
|
|
15
|
+
<label class=" col-sm-2 control-label">撤销类型</label>
|
|
16
|
+
<div class="col-sm-2">
|
|
17
|
+
<input class="form-control" type="text" v-model="model.f_canceltype" placeholder="撤销类型" disabled>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="row" style="margin-top:6px;">
|
|
21
|
+
<label class=" col-sm-2 control-label">上期结余</label>
|
|
22
|
+
<div class="col-sm-2">
|
|
23
|
+
<input class="form-control" type="number" v-model="model.f_balance" placeholder="上期结余" disabled>
|
|
24
|
+
</div>
|
|
25
|
+
<label class="col-sm-2 control-label">本期结余</label>
|
|
26
|
+
<div class="col-sm-2">
|
|
27
|
+
<input class="form-control" type="number" v-model="model.f_curbalance" placeholder="本期结余" disabled>
|
|
28
|
+
</div>
|
|
29
|
+
<label class="col-sm-2 control-label">收款</label>
|
|
30
|
+
<div class="col-sm-2">
|
|
31
|
+
<input class="form-control" type="number" v-model="model.f_collection" placeholder="收款" disabled>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="row" style="margin-top:6px;">
|
|
35
|
+
<label class=" col-sm-2 control-label">售气时间</label>
|
|
36
|
+
<div class="col-sm-2" >
|
|
37
|
+
<input class="form-control" type="text" v-model="model.f_date" disabled>
|
|
38
|
+
</div>
|
|
39
|
+
<label class="col-sm-2 control-label">操作员</label>
|
|
40
|
+
<div class="col-sm-2">
|
|
41
|
+
<input class="form-control" type="text" v-model="model.f_operator" disabled>
|
|
42
|
+
</div>
|
|
43
|
+
<label class="col-sm-2 control-label" title="参数名称:付款方式">收款方式</label>
|
|
44
|
+
<div class="col-sm-2">
|
|
45
|
+
<v-select v-model="f_payment"
|
|
46
|
+
placeholder='请选择'
|
|
47
|
+
:value.sync="model.f_payment"
|
|
48
|
+
:options='paytype' clear-button></v-select>
|
|
49
|
+
</div>
|
|
50
|
+
<!--<label for="f_outlets" class="col-sm-2 control-label" style="width:15%">网点:</label>-->
|
|
51
|
+
<!--<div class="col-sm-2">-->
|
|
52
|
+
<!--<input class="form-control" type="text" v-model="model.f_outlets" disabled>-->
|
|
53
|
+
<!--</div>-->
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<div v-if="model.f_fillgas_id">
|
|
57
|
+
<p class="bg-info text-center" style="padding: 8px;" >相关补气信息</p>
|
|
58
|
+
<div class="row" style="margin-top:6px;">
|
|
59
|
+
<label class=" col-sm-2 control-label">预购气量</label>
|
|
60
|
+
<div class="col-sm-2" >
|
|
61
|
+
<input class="form-control" type="number" v-model="xmodel.f_pregas" placeholder="预购气量" disabled>
|
|
62
|
+
</div>
|
|
63
|
+
<label class=" col-sm-2 control-label">预购金额</label>
|
|
64
|
+
<div class="col-sm-2">
|
|
65
|
+
<input class="form-control" type="number" v-model="xmodel.f_preamount" placeholder="预购金额" disabled>
|
|
66
|
+
</div>
|
|
67
|
+
<label class=" col-sm-2 control-label">撤销类型</label>
|
|
68
|
+
<div class="col-sm-2">
|
|
69
|
+
<input class="form-control" type="text" v-model="xmodel.f_canceltype" placeholder="撤销类型" disabled>
|
|
70
|
+
</div>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="row" style="margin-top:6px;">
|
|
73
|
+
<label class=" col-sm-2 control-label">上期结余</label>
|
|
74
|
+
<div class="col-sm-2">
|
|
75
|
+
<input class="form-control" type="number" v-model="xmodel.f_balance" placeholder="上期结余" disabled>
|
|
76
|
+
</div>
|
|
77
|
+
<label class="col-sm-2 control-label">本期结余</label>
|
|
78
|
+
<div class="col-sm-2">
|
|
79
|
+
<input class="form-control" type="number" v-model="xmodel.f_curbalance" placeholder="本期结余" disabled>
|
|
80
|
+
</div>
|
|
81
|
+
<label class="col-sm-2 control-label">收款</label>
|
|
82
|
+
|
|
83
|
+
<div class="col-sm-2">
|
|
84
|
+
<input class="form-control" type="number" v-model="xmodel.f_collection" placeholder="收款" disabled>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div class="row" style="margin-top:6px;">
|
|
88
|
+
<label class=" col-sm-2 control-label">售气时间</label>
|
|
89
|
+
<div class="col-sm-2" >
|
|
90
|
+
<input class="form-control" type="text" v-model="xmodel.f_date" disabled>
|
|
91
|
+
</div>
|
|
92
|
+
<label class="col-sm-2 control-label">操作员</label>
|
|
93
|
+
<div class="col-sm-2">
|
|
94
|
+
<input class="form-control" type="text" v-model="xmodel.f_operator" disabled>
|
|
95
|
+
</div>
|
|
96
|
+
<!--<label for="f_outlets" class="col-sm-2 control-label" style="width:15%">网点:</label>-->
|
|
97
|
+
<!--<div class="col-sm-2">-->
|
|
98
|
+
<!--<input class="form-control" type="text" v-model="model.f_outlets" disabled>-->
|
|
99
|
+
<!--</div>-->
|
|
100
|
+
</div>
|
|
101
|
+
</div>
|
|
102
|
+
</form>
|
|
103
|
+
<div style="text-align:right;margin-right:50px;height: auto">
|
|
104
|
+
<button class="btn btn-success width-60" @click="cancel()" :disabled="isToday" v-if="jurisdiction.includes('购气撤销')">购气撤销</button>
|
|
105
|
+
<button class="button_clear" @click="clean()">取消</button>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<modal v-if="show" :show.sync="show" v-ref:modal backdrop="false">
|
|
109
|
+
<header slot="modal-header" class="modal-header">
|
|
110
|
+
<h4 class="modal-title">撤销原因</h4>
|
|
111
|
+
</header>
|
|
112
|
+
<article slot="modal-body" class="modal-body">
|
|
113
|
+
<validator name='v'>
|
|
114
|
+
<form class="form-horizontal select-overspread">
|
|
115
|
+
<div class="form-group" v-if="config.hasBillManage && model.f_bill_style">
|
|
116
|
+
<label class=" col-sm-3 control-label">发票撤销类型:</label>
|
|
117
|
+
<div class="col-sm-4">
|
|
118
|
+
<v-select v-model="f_cancel_type"
|
|
119
|
+
placeholder='请选择'
|
|
120
|
+
:value.sync="correctModel.f_cancel_type"
|
|
121
|
+
:options='cancelTypes'
|
|
122
|
+
@change="cancelTypeChange"
|
|
123
|
+
:value-single="true"
|
|
124
|
+
close-on-select clear-button>
|
|
125
|
+
</v-select>
|
|
126
|
+
</div>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="form-group" :class="[$v.f_cancel_reason.required ? 'has-error' : 'has-success']">
|
|
129
|
+
<label class=" col-sm-3 control-label">撤销原因:</label>
|
|
130
|
+
<div class="col-sm-8">
|
|
131
|
+
<textarea class="form-control" v-model="correctModel.f_cancel_reason" rows="3"
|
|
132
|
+
placeholder="请填写原因" v-validate:f_cancel_reason='{required: true}'></textarea>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</form>
|
|
136
|
+
</validator>
|
|
137
|
+
<validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
|
|
138
|
+
</article>
|
|
139
|
+
<footer slot="modal-footer" class="modal-footer">
|
|
140
|
+
<button v-show="show" type="button" class="button_search" @click='confirm()' :disabled="!correctModel.f_cancel_reason">确认</button>
|
|
141
|
+
<button v-show="show" type="button" class="button_clear" @click='close'>取消</button>
|
|
142
|
+
</footer>
|
|
143
|
+
</modal>
|
|
144
|
+
<correct-bill :show="print" :bill-config='config' :bill-data='billData'
|
|
145
|
+
@printok="printok" @toggle="printCancel" :data='printModel' v-ref:printbill ></correct-bill>
|
|
146
|
+
</div>
|
|
147
|
+
</div>
|
|
148
|
+
</template>
|
|
149
|
+
<script>
|
|
150
|
+
import CardService from './CardService'
|
|
151
|
+
|
|
152
|
+
let cardChargeCancelGen = async function (self) {
|
|
153
|
+
// 冲正记录
|
|
154
|
+
self.row.cardInfo = self.cardData
|
|
155
|
+
self.model = Object.assign({}, self.model, self.correctModel)
|
|
156
|
+
let res = null
|
|
157
|
+
if (self.xmodel.id) {
|
|
158
|
+
res = await CardService.cardAndFillGasCancel(self.model, self.xmodel, self.row)
|
|
159
|
+
} else {
|
|
160
|
+
res = await CardService.cardChargeCancel(self.model, self.row)
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
console.log('冲正返回。。', res, self.model, self.config, self.correctModel)
|
|
164
|
+
|
|
165
|
+
if (self.model.f_bill_style.includes('普通收据') && self.config.hasBillManage) {
|
|
166
|
+
// 冲正发票管理数据
|
|
167
|
+
if (self.correctModel.f_cancel_type === 'newBill') {
|
|
168
|
+
// 显示发票信息
|
|
169
|
+
self.printModel.id = res.data.record.id
|
|
170
|
+
self.printModel.f_type = res.data.type
|
|
171
|
+
self.printModel.f_bill_style = res.data.record.f_bill_style
|
|
172
|
+
self.billData.url = self.getBillUrl(res.data.type)
|
|
173
|
+
console.log('普通收据打印。。。', self.printModel, self.billUrl)
|
|
174
|
+
self.print = true
|
|
175
|
+
} else if (self.correctModel.f_cancel_type === 'abort') {
|
|
176
|
+
await self.$CommonService.correctPaperBill(res.data.record.id, res.data.type, null, null, 'abort')
|
|
177
|
+
self.$dispatch('refresh')
|
|
178
|
+
}
|
|
179
|
+
} else if (self.model.f_bill_style.includes('电子发票')) {
|
|
180
|
+
// 冲正电子票
|
|
181
|
+
await self.$CommonService.correctEticket(self.model.id, self.model.f_canceltype)
|
|
182
|
+
self.$dispatch('success')
|
|
183
|
+
} else {
|
|
184
|
+
self.$dispatch('success')
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
let readyGen = async function (self) {
|
|
189
|
+
await self.$getConfig(self, 'RecordCancel')
|
|
190
|
+
console.log('冲正业务config', self.config)
|
|
191
|
+
self.correctModel.f_cancel_type = self.config.cancelType
|
|
192
|
+
|
|
193
|
+
self.model.f_price_id = self.row.f_price_id
|
|
194
|
+
self.model.f_user_id = self.row.f_user_id
|
|
195
|
+
self.model.f_user_name = self.row.f_user_name
|
|
196
|
+
self.model.f_userinfo_id = self.row.f_userinfo_id
|
|
197
|
+
let res = await self.$resetpost('rs/sql/gasCancel', {data: {f_user_id: self.model.f_user_id}}, {resolveMsg: null, rejectMsg: '获取记录失败!!'})
|
|
198
|
+
console.log('GASCANCEL:', res.data)
|
|
199
|
+
self.model.id = res.data[0].id
|
|
200
|
+
self.model.f_pregas = res.data[0].f_pregas
|
|
201
|
+
self.model.f_preamount = res.data[0].f_preamount
|
|
202
|
+
self.model.f_curbalance = res.data[0].f_curbalance
|
|
203
|
+
self.model.f_collection = res.data[0].f_collection
|
|
204
|
+
self.model.f_balance = res.data[0].f_balance
|
|
205
|
+
self.model.f_user_balance = res.data[0].f_user_balance
|
|
206
|
+
self.model.f_canceltype = res.data[0].f_canceltype
|
|
207
|
+
self.model.f_bill_style = res.data[0].f_bill_style
|
|
208
|
+
self.model.f_operator = res.data[0].f_operator
|
|
209
|
+
self.model.f_date = res.data[0].f_date
|
|
210
|
+
self.model.f_payment = [res.data[0].f_payment]
|
|
211
|
+
if (res.data[0].f_fillgas_id && res.data[0].f_fillgas_id.length > 0) {
|
|
212
|
+
self.model.f_fillgas_id = res.data[0].f_fillgas_id
|
|
213
|
+
// 开始给关联购气信息赋值
|
|
214
|
+
for (var i = 0; i < res.data.length; i++) {
|
|
215
|
+
console.log('换表关联信息。。', res.data[0].f_fillgas_id, res.data[i].id)
|
|
216
|
+
if (res.data[0].f_fillgas_id == res.data[i].id) {
|
|
217
|
+
self.$showAlert('此卡存在关联购气信息,请谨慎核对!!!', 'warning', 2000)
|
|
218
|
+
self.xmodel.id = res.data[i].id
|
|
219
|
+
self.xmodel.f_pregas = res.data[i].f_pregas
|
|
220
|
+
self.xmodel.f_preamount = res.data[i].f_preamount
|
|
221
|
+
self.xmodel.f_curbalance = res.data[i].f_curbalance
|
|
222
|
+
self.xmodel.f_collection = res.data[i].f_collection
|
|
223
|
+
self.xmodel.f_balance = res.data[i].f_balance
|
|
224
|
+
self.xmodel.f_user_balance = res.data[i].f_user_balance
|
|
225
|
+
self.xmodel.f_canceltype = res.data[i].f_canceltype
|
|
226
|
+
self.xmodel.f_bill_style = res.data[i].f_bill_style
|
|
227
|
+
self.xmodel.f_operator = res.data[i].f_operator
|
|
228
|
+
self.xmodel.f_date = res.data[i].f_date
|
|
229
|
+
// 跳出循环
|
|
230
|
+
break
|
|
231
|
+
}
|
|
232
|
+
// this.radio[index].$set(i,true)
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
if (self.config.todayLimit) {
|
|
236
|
+
self.isToday = new Date().toDateString() !== new Date(res.data[0].f_date).toDateString()
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (self.config.hasBillManage && self.config.cancelType === 'newBill' && self.model.f_bill_style) {
|
|
240
|
+
// 获取原来收费记录使用的发票类型
|
|
241
|
+
let param = {
|
|
242
|
+
id: res.data[0].id,
|
|
243
|
+
type: res.data[0].f_canceltype
|
|
244
|
+
}
|
|
245
|
+
let oldUseType = await self.$resetpost('rs/logic/sale_getOldUseType', {data: param}, {resolveMsg: null, rejectMsg: '获取原始票据信息出错!!'})
|
|
246
|
+
console.log('获取原始票据信息。。。', oldUseType)
|
|
247
|
+
|
|
248
|
+
self.model.f_use_type = oldUseType.data.f_use_type
|
|
249
|
+
self.model.f_bill_type = [res.data[0].f_bill_style]
|
|
250
|
+
self.hasValidateBill = self.config.hasBillManage
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export default {
|
|
255
|
+
title: '卡表冲正',
|
|
256
|
+
data () {
|
|
257
|
+
return {
|
|
258
|
+
config: {
|
|
259
|
+
cancleother: false, // 默认可以撤销别人的操作
|
|
260
|
+
cancletime: false, // 默认可以冲正今天以前的操作
|
|
261
|
+
hasBillManage: false, // 默认不启用发票管理
|
|
262
|
+
cancelType: 'newBill',
|
|
263
|
+
todayLimit: false // 是否限制当天不能冲正
|
|
264
|
+
},
|
|
265
|
+
model: {
|
|
266
|
+
f_payment: '',
|
|
267
|
+
f_pregas: '',
|
|
268
|
+
f_preamount: '',
|
|
269
|
+
f_totalcost: '',
|
|
270
|
+
f_curbalance: '',
|
|
271
|
+
f_collection: '',
|
|
272
|
+
f_balance: '',
|
|
273
|
+
f_user_balance: '',
|
|
274
|
+
f_canceltype: '',
|
|
275
|
+
f_operator: '',
|
|
276
|
+
f_date: '',
|
|
277
|
+
f_fillgas_id: null
|
|
278
|
+
},
|
|
279
|
+
// 关联购气信息
|
|
280
|
+
xmodel: {
|
|
281
|
+
f_payment: '',
|
|
282
|
+
f_pregas: '',
|
|
283
|
+
f_preamount: '',
|
|
284
|
+
f_totalcost: '',
|
|
285
|
+
f_curbalance: '',
|
|
286
|
+
f_collection: '',
|
|
287
|
+
f_balance: '',
|
|
288
|
+
f_user_balance: '',
|
|
289
|
+
f_canceltype: '',
|
|
290
|
+
f_operator: '',
|
|
291
|
+
f_date: ''
|
|
292
|
+
},
|
|
293
|
+
show: false,
|
|
294
|
+
isToday: false,
|
|
295
|
+
|
|
296
|
+
paytype: this.$appdata.getParam('付款方式'),
|
|
297
|
+
correctModel: {
|
|
298
|
+
f_cancel_type: '',
|
|
299
|
+
f_cancel_reason: ''
|
|
300
|
+
},
|
|
301
|
+
printModel: {},
|
|
302
|
+
print: false,
|
|
303
|
+
billUrl: '',
|
|
304
|
+
billData: {
|
|
305
|
+
url: '',
|
|
306
|
+
bill: ''
|
|
307
|
+
},
|
|
308
|
+
|
|
309
|
+
// 启用发票管理需要对票号进行验证
|
|
310
|
+
hasValidateBill: false,
|
|
311
|
+
validateOk: false,
|
|
312
|
+
|
|
313
|
+
jurisdiction: this.$login.r
|
|
314
|
+
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
props: ['row', 'cardData'],
|
|
318
|
+
ready () {
|
|
319
|
+
readyGen(this)
|
|
320
|
+
},
|
|
321
|
+
watch: {
|
|
322
|
+
'row' (val) {
|
|
323
|
+
this.model.f_price_id = val.f_price_id
|
|
324
|
+
this.model.f_user_id = val.f_user_id
|
|
325
|
+
this.model.f_userinfo_id = val.f_userinfo_id
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
methods: {
|
|
329
|
+
cancel () {
|
|
330
|
+
if (this.config.cancleother) {
|
|
331
|
+
if (this.model.f_operator != this.$login.f.name) {
|
|
332
|
+
this.$showAlert('不能撤销不是自己进行的操作', 'warning', 1500)
|
|
333
|
+
return
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
if (this.config.cancletime) {
|
|
337
|
+
let a = this.$login.toStandardDateString() + ' 00:00:00'
|
|
338
|
+
// console.log('当前时间',row.f_date>a)
|
|
339
|
+
if (this.model.f_date < a) {
|
|
340
|
+
this.$showAlert('不能撤销不是当天的操作', 'warning', 1500)
|
|
341
|
+
return
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
this.show = true
|
|
345
|
+
},
|
|
346
|
+
close () {
|
|
347
|
+
this.show = false
|
|
348
|
+
},
|
|
349
|
+
confirm () {
|
|
350
|
+
// 关闭 modal框
|
|
351
|
+
this.close()
|
|
352
|
+
console.log('看看有没有撤销原因', this.model)
|
|
353
|
+
cardChargeCancelGen(this)
|
|
354
|
+
},
|
|
355
|
+
clean () {
|
|
356
|
+
this.$info('取消操作')
|
|
357
|
+
this.$dispatch('cancelclean', this.row)
|
|
358
|
+
},
|
|
359
|
+
getBillUrl (type) {
|
|
360
|
+
let name = ''
|
|
361
|
+
// 根据type数据 选择调用的Logic
|
|
362
|
+
if (type === '卡表收费') {
|
|
363
|
+
name = 'rs/report/card_bill'
|
|
364
|
+
} else if (type === '发卡售气') {
|
|
365
|
+
name = 'rs/report/sendCard_bill'
|
|
366
|
+
}
|
|
367
|
+
return name
|
|
368
|
+
},
|
|
369
|
+
printok () {
|
|
370
|
+
this.show = false
|
|
371
|
+
this.print = false
|
|
372
|
+
this.$dispatch('success')
|
|
373
|
+
},
|
|
374
|
+
printCancel () {
|
|
375
|
+
this.$dispatch('refresh')
|
|
376
|
+
},
|
|
377
|
+
validateBill (val) {
|
|
378
|
+
this.validateOk = !val.isOk
|
|
379
|
+
this.billData.bill = val.bill
|
|
380
|
+
},
|
|
381
|
+
cancelTypeChange () {
|
|
382
|
+
this.hasValidateBill = this.correctModel.f_cancel_type === 'newBill'
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
computed: {
|
|
386
|
+
cancelTypes () {
|
|
387
|
+
return [{label: '使用新票号', value: 'newBill'}, {label: '旧发票作废', value: 'abort'}]
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
</script>
|
|
392
|
+
|
|
393
|
+
<style>
|
|
394
|
+
</style>
|
|
@@ -16,6 +16,18 @@ let CardService = {
|
|
|
16
16
|
let read = readCard()
|
|
17
17
|
return co(read)
|
|
18
18
|
},
|
|
19
|
+
// 线下写卡
|
|
20
|
+
offlineWrite (row) {
|
|
21
|
+
return offlineWriteGen(row)
|
|
22
|
+
},
|
|
23
|
+
// 撤销换表之后补气+购气的操作
|
|
24
|
+
async cardAndFillGasCancel (model, xmodel, row) {
|
|
25
|
+
return cardAndGasCancelGen(model, xmodel, row)
|
|
26
|
+
},
|
|
27
|
+
// 撤销单独的记录(只有一个补气,或者只有一个购气)
|
|
28
|
+
async cardChargeCancel (model, row) {
|
|
29
|
+
return sellCancelGen(model, row)
|
|
30
|
+
},
|
|
19
31
|
// 开户发卡
|
|
20
32
|
initCard (model, row, allot) {
|
|
21
33
|
// let init = initCardGen(model, row, allot ? this.getallotdata(allot, row, '发卡售气') : null)
|
|
@@ -145,6 +157,349 @@ let CardService = {
|
|
|
145
157
|
return sellgasGen(param, row)
|
|
146
158
|
}
|
|
147
159
|
}
|
|
160
|
+
// 收费加补气撤销
|
|
161
|
+
let cardAndGasCancelGen = async function (model, xmodel, row) {
|
|
162
|
+
let result = null
|
|
163
|
+
try {
|
|
164
|
+
// 发卡售气冲正的时候需要清空卡号,为了回滚写卡将卡号暂时保留
|
|
165
|
+
let tempCard_id = {}
|
|
166
|
+
Object.assign(tempCard_id, tempCard_id, row)
|
|
167
|
+
|
|
168
|
+
let cardParams
|
|
169
|
+
// 判断是否有卡
|
|
170
|
+
let cardState = await Vue.resetpost('http://127.0.0.1:8003/hasCard', {data: {}}, {resolveMsg: null, rejectMsg: '判卡函数出错!!'})
|
|
171
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
172
|
+
// 调用读卡进行校验
|
|
173
|
+
let readCardInfo = await Vue.resetpost('http://127.0.0.1:8003/ReadCard', {kmm: row.f_card_password}, {resolveMsg: null, rejectMsg: '读卡失败!!'})
|
|
174
|
+
// 验证卡上信息和撤销记录的信息是否一致, 气量和厂家验证
|
|
175
|
+
if (readCardInfo.data) {
|
|
176
|
+
console.log('读卡验证', readCardInfo.data, row)
|
|
177
|
+
// 这里把次数校验去掉了,有些卡读出来卡上是没有次数的
|
|
178
|
+
if (row.f_support_purchase == '是') {
|
|
179
|
+
/* if (readCardInfo.data.Money != ((model.f_preamount - 0) + (xmodel.f_preamount - 0))|| readCardInfo.data.Factory !== row.f_alias) {
|
|
180
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
181
|
+
return
|
|
182
|
+
} */
|
|
183
|
+
} else {
|
|
184
|
+
if (row.f_collection_type == '按金额') {
|
|
185
|
+
if (readCardInfo.data.Money != ((model.f_preamount - 0) + (xmodel.f_preamount - 0)) || readCardInfo.data.Factory !== row.f_alias) {
|
|
186
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
if (readCardInfo.data.Gas != (Number((model.f_pregas - 0).toFixed(2)) + (xmodel.f_pregas - 0)) || readCardInfo.data.Factory !== row.f_alias) {
|
|
191
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
192
|
+
return
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// 获取气价和售气情况参数
|
|
198
|
+
cardParams = await getParamGen(tempCard_id.f_card_id, row.f_alias, row.f_user_id)
|
|
199
|
+
// 存库
|
|
200
|
+
result = await cardAndGasGen(model, xmodel, row)
|
|
201
|
+
// 写卡
|
|
202
|
+
let params = {
|
|
203
|
+
factory: row.f_alias, // 气表厂家
|
|
204
|
+
kh: tempCard_id.f_card_id, // 卡号
|
|
205
|
+
yhh: row.cardInfo.yhh, // 用户号,档案中自己输
|
|
206
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
207
|
+
klx: row.f_coding,
|
|
208
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
209
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
210
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
211
|
+
bkcs: model.f_replace_time, // 补卡次数,从补卡表里通过表编号获得
|
|
212
|
+
ql: '0', // 预购气量
|
|
213
|
+
ljgql: (row.f_total_gas - 0) - ((model.f_pregas - 0) + (xmodel.f_pregas - 0)), // 当前累计购气量
|
|
214
|
+
totalmoney: (row.f_total_fee - 0) - ((model.f_preamount - 0) + (xmodel.f_preamount - 0)),
|
|
215
|
+
cs: row.cardInfo.Times - 1, // 求购气次数,先开户为1
|
|
216
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
217
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
218
|
+
money: '0' // 购气金额
|
|
219
|
+
}
|
|
220
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
221
|
+
console.log('写卡参数是啥,。。。', params)
|
|
222
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '冲正卡上气量卡服务错误'})
|
|
223
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
224
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
225
|
+
await rollbackGen(result, model, row)
|
|
226
|
+
} else {
|
|
227
|
+
Vue.showAlert('撤销成功', 'success', 2000)
|
|
228
|
+
return result
|
|
229
|
+
}
|
|
230
|
+
} else {
|
|
231
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 2000)
|
|
232
|
+
}
|
|
233
|
+
} catch (error) {
|
|
234
|
+
await rollbackGen(result, model, row)
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
let cardAndGasGen = async function (model, xmodel, row) {
|
|
238
|
+
console.log('卡表收费冲正,。。。', model, xmodel, row)
|
|
239
|
+
|
|
240
|
+
let data = {
|
|
241
|
+
id_sell: model.id,
|
|
242
|
+
id_fill: xmodel.id,
|
|
243
|
+
type_sell: model.f_canceltype,
|
|
244
|
+
type_fill: xmodel.f_canceltype,
|
|
245
|
+
version: row.version, // 用户更新档案用
|
|
246
|
+
userinfo_version: row.userinfo_version, // 用户更新档案用
|
|
247
|
+
f_times: (row.cardInfo.Times - 1) < 0 ? 0 : (row.cardInfo.Times - 1),
|
|
248
|
+
model: {
|
|
249
|
+
f_cancel_reason: model.f_cancel_reason,
|
|
250
|
+
f_user_id: row.f_user_id,
|
|
251
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
252
|
+
// 这两个值暂定
|
|
253
|
+
f_operator: Vue.$login.f.name,
|
|
254
|
+
f_operatorid: Vue.$login.f.id,
|
|
255
|
+
f_orgid: Vue.$login.f.orgid,
|
|
256
|
+
f_orgname: Vue.$login.f.orgs,
|
|
257
|
+
f_depid: Vue.$login.f.depids,
|
|
258
|
+
f_depname: Vue.$login.f.deps,
|
|
259
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
260
|
+
f_zones: Vue.$login.f.zones
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
console.log('看看这个撤销得参数是什么', data)
|
|
264
|
+
return Vue.resetpost('rs/logic/sale_cardAndFillGasCancel', {data: data}, {resolveMsg: null, rejectMsg: '冲正卡上气量存库失败'})
|
|
265
|
+
}
|
|
266
|
+
// 收费冲正
|
|
267
|
+
let sellCancelGen = async function (model, row) {
|
|
268
|
+
let result = null
|
|
269
|
+
try {
|
|
270
|
+
// 发卡售气冲正的时候需要清空卡号,为了回滚写卡将卡号暂时保留
|
|
271
|
+
let tempCard_id = {}
|
|
272
|
+
Object.assign(tempCard_id, tempCard_id, row)
|
|
273
|
+
|
|
274
|
+
let cardParams
|
|
275
|
+
// 判断是否有卡
|
|
276
|
+
let cardState = await Vue.resetpost('http://127.0.0.1:8003/hasCard', {data: {}}, {resolveMsg: null, rejectMsg: '判卡函数出错!!'})
|
|
277
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
278
|
+
// 调用读卡进行校验
|
|
279
|
+
let readCardInfo = await Vue.resetpost('http://127.0.0.1:8003/ReadCard', {kmm: row.f_card_password}, {resolveMsg: null, rejectMsg: '读卡失败!!'})
|
|
280
|
+
// 验证卡上信息和撤销记录的信息是否一致, 气量和厂家验证
|
|
281
|
+
if (readCardInfo.data) {
|
|
282
|
+
console.log('读卡验证', readCardInfo.data, row)
|
|
283
|
+
// 这里把次数校验去掉了,有些卡读出来卡上是没有次数的
|
|
284
|
+
// 金额卡表校验金额 气量卡表校验气量
|
|
285
|
+
if (row.f_support_purchase == '是') {
|
|
286
|
+
/* if (readCardInfo.data.Money != ((model.f_preamount - 0) + (xmodel.f_preamount - 0))|| readCardInfo.data.Factory !== row.f_alias) {
|
|
287
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
288
|
+
return
|
|
289
|
+
} */
|
|
290
|
+
} else {
|
|
291
|
+
if (row.f_collection_type == '按金额') {
|
|
292
|
+
if (readCardInfo.data.Money != model.f_preamount || readCardInfo.data.Factory !== row.f_alias) {
|
|
293
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
294
|
+
return
|
|
295
|
+
}
|
|
296
|
+
} else {
|
|
297
|
+
if (readCardInfo.data.Gas != Number((model.f_pregas - 0).toFixed(2)) || readCardInfo.data.Factory !== row.f_alias) {
|
|
298
|
+
Vue.showAlert('现有的卡和所撤销的记录不一致,请核实后进行撤销!!', 'warning', 3000)
|
|
299
|
+
return
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
// 获取气价和售气情况参数
|
|
305
|
+
cardParams = await getParamGen(tempCard_id.f_card_id, row.f_alias, row.f_user_id)
|
|
306
|
+
// 存库
|
|
307
|
+
result = await cardChargeCancelGen(model, row)
|
|
308
|
+
// 写卡
|
|
309
|
+
let params = {
|
|
310
|
+
factory: row.f_alias, // 气表厂家
|
|
311
|
+
kh: tempCard_id.f_card_id, // 卡号
|
|
312
|
+
yhh: row.cardInfo.yhh, // 用户号,档案中自己输
|
|
313
|
+
kmm: row.f_card_password, // 卡密码,写卡后返回新密码, 不论补卡还是先开户都没有密码
|
|
314
|
+
klx: row.f_coding,
|
|
315
|
+
bjql: row.f_police_gas, // 报警气量,t_gasbrand表中
|
|
316
|
+
czsx: row.f_topup_ceil, // 充值上线,t_gasbrand表中
|
|
317
|
+
tzed: row.f_overdr_lines, // 透支额度,t_gasbrand表中
|
|
318
|
+
bkcs: model.f_replace_time, // 补卡次数,从补卡表里通过表编号获得
|
|
319
|
+
ql: '0', // 预购气量
|
|
320
|
+
ljgql: (row.f_total_gas - 0) - (model.f_pregas - 0), // 当前累计购气量
|
|
321
|
+
totalmoney: (row.f_total_fee - 0) - (model.f_preamount - 0),
|
|
322
|
+
cs: row.cardInfo.Times - 1, // 求购气次数,先开户为1
|
|
323
|
+
dqdm: row.f_area_code, // 精益工业地区代码
|
|
324
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0, // 表号
|
|
325
|
+
money: '0' // 购气金额
|
|
326
|
+
}
|
|
327
|
+
params = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), params)
|
|
328
|
+
let cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', params, {resolveMsg: null, rejectMsg: '冲正卡上气量卡服务错误'})
|
|
329
|
+
// 卡服务写卡异常,业务逻辑回滚
|
|
330
|
+
if (!cardParams || !result || cardRes.data.Err || cardRes.data.Exception) {
|
|
331
|
+
await rollbackGen(result, model, row)
|
|
332
|
+
} else {
|
|
333
|
+
Vue.showAlert('撤销成功', 'success', 2000)
|
|
334
|
+
return result
|
|
335
|
+
}
|
|
336
|
+
} else {
|
|
337
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
338
|
+
}
|
|
339
|
+
} catch (error) {
|
|
340
|
+
Vue.console.error('出错', error)
|
|
341
|
+
await rollbackGen(result, model, row)
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
// 回滚操作
|
|
345
|
+
let rollbackGen = async function (result) {
|
|
346
|
+
if (result) {
|
|
347
|
+
let data = {
|
|
348
|
+
correct_id: result.data.id,
|
|
349
|
+
correct_data: result.data.record
|
|
350
|
+
}
|
|
351
|
+
await Vue.resetpost('rs/logic/cancelRollback', {data: data}, {resolveMsg: null, rejectMsg: '冲正失败'})
|
|
352
|
+
Vue.showAlert('冲正失败!!', 'danger', 0)
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
// 存库操作
|
|
356
|
+
let cardChargeCancelGen = async function (model, row) {
|
|
357
|
+
console.log('卡表收费冲正,。。。', model, row)
|
|
358
|
+
|
|
359
|
+
let payment = ''
|
|
360
|
+
if (model.f_payment) {
|
|
361
|
+
payment = model.f_payment[0]
|
|
362
|
+
}
|
|
363
|
+
let data = {
|
|
364
|
+
id: model.id,
|
|
365
|
+
type: model.f_canceltype,
|
|
366
|
+
version: row.version, // 用户更新档案用
|
|
367
|
+
userinfo_version: row.userinfo_version, // 用户更新档案用
|
|
368
|
+
model: {
|
|
369
|
+
f_payment: payment,
|
|
370
|
+
f_cancel_reason: model.f_cancel_reason,
|
|
371
|
+
f_user_id: row.f_user_id,
|
|
372
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
373
|
+
// 这两个值暂定
|
|
374
|
+
f_operator: Vue.$login.f.name,
|
|
375
|
+
f_operatorid: Vue.$login.f.id,
|
|
376
|
+
f_orgid: Vue.$login.f.orgid,
|
|
377
|
+
f_orgname: Vue.$login.f.orgs,
|
|
378
|
+
f_depid: Vue.$login.f.depids,
|
|
379
|
+
f_depname: Vue.$login.f.deps,
|
|
380
|
+
f_zoneid: Vue.$login.f.zoneid,
|
|
381
|
+
f_zones: Vue.$login.f.zones
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
console.log('看看这个撤销得参数是什么', data)
|
|
386
|
+
return Vue.resetpost('rs/logic/chargeCancel', {data: data}, {resolveMsg: null, rejectMsg: '冲正卡上气量存库失败'})
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
let offlineWriteGen = async function (row) {
|
|
390
|
+
console.log('线下写卡', row)
|
|
391
|
+
try {
|
|
392
|
+
// 写卡前调用(该为特殊业务逻辑根据需要写到project工程) (有些第三方缴费柜台写卡,用户缴费之后,如果在规定时间内不写卡,就会进行退款。所以写卡前调用第三方锁定订单。写卡成功或失败调用对应的接口告知第三方)
|
|
393
|
+
|
|
394
|
+
let beforeParam = {
|
|
395
|
+
id: row.unWriteSell[0].id,
|
|
396
|
+
f_operatorid: Vue.$login.f.id,
|
|
397
|
+
f_depid: Vue.$login.f.depids
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
await Vue.resetpost('rs/logic/sale_write_before', {data: beforeParam}, {resolveMsg: null, rejectMsg: '线下写卡前调用第三方失败!!'})
|
|
401
|
+
|
|
402
|
+
let cardState = await hasCardGen()
|
|
403
|
+
if (JSON.parse(cardState.data).state === 1) {
|
|
404
|
+
// 获取
|
|
405
|
+
let result = await Vue.resetpost('rs/logic/sale_getLastOper', {data: {f_userfiles_id: row.f_userfiles_id}}, {resolveMsg: null, rejectMsg: '获取最后一次操作失败'})
|
|
406
|
+
console.log('获取最后一次的操作。。', result)
|
|
407
|
+
|
|
408
|
+
let cardid = row.f_card_id
|
|
409
|
+
if (row.f_tag) {
|
|
410
|
+
// 截取用户编号后四位
|
|
411
|
+
cardid = row.f_tag + row.f_card_id
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// 执行写卡操作
|
|
415
|
+
let cardParams = await getParamGen(row.f_card_id, row.f_alias, row.f_user_id, row.f_userfiles_id)
|
|
416
|
+
|
|
417
|
+
let param = {
|
|
418
|
+
factory: row.f_alias,
|
|
419
|
+
kh: cardid,
|
|
420
|
+
|
|
421
|
+
yhh: row.cardInfo.Yhh ? row.cardInfo.Yhh : row.f_meterid,
|
|
422
|
+
meterid: row.f_meternumber ? row.f_meternumber : 0,
|
|
423
|
+
meternumber: row.f_meternumber ? row.f_meternumber : 0,
|
|
424
|
+
kmm: row.f_card_password,
|
|
425
|
+
ljgql: (row.f_write_totalgas - 0), // 当前累计购气量
|
|
426
|
+
ljgqje: (row.f_write_totalfee - 0), // 累计购气金额
|
|
427
|
+
bjql: row.f_police_gas,
|
|
428
|
+
czsx: row.f_topup_ceil,
|
|
429
|
+
tzed: row.f_overdr_lines,
|
|
430
|
+
dqdm: row.f_area_code,
|
|
431
|
+
klx: row.f_coding,
|
|
432
|
+
ql: Number((row.unWriteSell[0].f_pregas = -0).toFixed(2)), // 预购气量
|
|
433
|
+
money: row.unWriteSell[0].f_write_money
|
|
434
|
+
}
|
|
435
|
+
param = Object.assign({}, Vue.CommonService.writeCardParams(cardParams), param)
|
|
436
|
+
let cardRes
|
|
437
|
+
if (result.data.last_oper == null) result.data.last_oper = ''
|
|
438
|
+
if (row.states === '补卡' || result.data.last_oper == '补卡') {
|
|
439
|
+
param.kzt = result.data.ispick === '未过表' && result.data.lastsell_oper === '发卡售气' ? '0' : '1'
|
|
440
|
+
param.cs = row.cardInfo.Times + 1
|
|
441
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
442
|
+
} else if (row.states === '换表') {
|
|
443
|
+
param.kzt = '0'
|
|
444
|
+
param.cs = 1
|
|
445
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteNewCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
446
|
+
} else {
|
|
447
|
+
param.cs = row.cardInfo.Times + 1
|
|
448
|
+
cardRes = await Vue.resetpost('http://127.0.0.1:8003/WriteGasCard', param, {resolveMsg: null, rejectMsg: '写卡失败'})
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (!cardParams || cardRes.data.Err || cardRes.data.Exception) {
|
|
452
|
+
// 写卡失败,通知第三方
|
|
453
|
+
|
|
454
|
+
let failureParam = {
|
|
455
|
+
id: row.unWriteSell[0].id,
|
|
456
|
+
// f_operatorid: Vue.$login.f.id,
|
|
457
|
+
f_depid: Vue.$login.f.depids
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
Vue.resetpost('rs/logic/sale_write_failure', {data: failureParam}, {resolveMsg: null, rejectMsg: '线下写卡前调用第三方失败!!'})
|
|
461
|
+
|
|
462
|
+
// 写卡异常,将异常抛出
|
|
463
|
+
|
|
464
|
+
throw new Error(`卡服务错误:${cardRes.data.Err}${cardRes.data.Exception},请联系开发人员处理!!`)
|
|
465
|
+
} else {
|
|
466
|
+
// 写卡成功 更新收费记录
|
|
467
|
+
let update = {
|
|
468
|
+
id: row.unWriteSell[0].id,
|
|
469
|
+
f_userfiles_id: row.f_userfiles_id,
|
|
470
|
+
f_user_id: row.f_user_id,
|
|
471
|
+
f_card_id: cardid,
|
|
472
|
+
f_times: param.cs,
|
|
473
|
+
f_meterid: param.yhh,
|
|
474
|
+
version: row.version,
|
|
475
|
+
|
|
476
|
+
// f_operatorid: Vue.$login.f.id,
|
|
477
|
+
f_depid: Vue.$login.f.depids,
|
|
478
|
+
f_depname: Vue.$login.f.deps,
|
|
479
|
+
|
|
480
|
+
f_write_comments: row.f_write_comments,
|
|
481
|
+
f_write_operator: Vue.$login.f.name,
|
|
482
|
+
f_write_date: Vue.$login.toStandardTimeString()
|
|
483
|
+
}
|
|
484
|
+
await Vue.resetpost('rs/logic/offlineWrite', update, {resolveMsg: '写卡成功', rejectMsg: '写卡成功,更新数据失败'})
|
|
485
|
+
|
|
486
|
+
// 写卡失败,通知第三方
|
|
487
|
+
|
|
488
|
+
let failureParam = {
|
|
489
|
+
id: row.unWriteSell[0].id,
|
|
490
|
+
f_operatorid: Vue.$login.f.id,
|
|
491
|
+
f_depid: Vue.$login.f.depids
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
Vue.resetpost('rs/logic/sale_write_success', {data: failureParam}, {resolveMsg: null, rejectMsg: '线下写卡前调用第三方失败!!'})
|
|
495
|
+
}
|
|
496
|
+
} else {
|
|
497
|
+
Vue.showAlert('请检查卡是否插好!!', 'danger', 3000)
|
|
498
|
+
}
|
|
499
|
+
} catch (error) {
|
|
500
|
+
throw error
|
|
501
|
+
}
|
|
502
|
+
}
|
|
148
503
|
|
|
149
504
|
let sendCardSaleGasGen = async function (model, row) {
|
|
150
505
|
// 1.存库 2.写卡
|
|
@@ -0,0 +1,112 @@
|
|
|
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">
|
|
7
|
+
<label for="f_paytype" class=" font_normal_body">付款方式:</label>
|
|
8
|
+
<input type="text" class="input_search" style="width: 60%" v-model="model.f_payment" disabled/>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="col-sm-4">
|
|
12
|
+
<label for="f_pregas" class=" font_normal_body">预购气量:</label>
|
|
13
|
+
<input type="number" class="input_search" style="width: 60%" v-model="model.f_pregas" disabled>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div class="col-sm-4">
|
|
17
|
+
<label for="f_preamount" class=" font_normal_body">预购金额:</label>
|
|
18
|
+
<input type="number" class="input_search" style="width: 60%" v-model="model.f_preamount" disabled>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="row" style="margin-top:6px;">
|
|
22
|
+
<div class="col-sm-4">
|
|
23
|
+
<label for="f_print" class="font_normal_body">收 款 人:</label>
|
|
24
|
+
<input type="text" class="input_search" style="width: 60%" v-model="model.f_operator" disabled>
|
|
25
|
+
</div>
|
|
26
|
+
<div class="col-sm-4">
|
|
27
|
+
<label for="f_print" class="font_normal_body">部  门:</label>
|
|
28
|
+
<input type="text" class="input_search" style="width: 60%" v-model="model.f_depname" disabled>
|
|
29
|
+
</div>
|
|
30
|
+
<div class="col-sm-4">
|
|
31
|
+
<label for="f_print" class="font_normal_body">收费时间:</label>
|
|
32
|
+
<input type="text" class="input_search" style="width: 60%" v-model="model.f_operate_date" disabled>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div class="row" style="margin-top:6px;">
|
|
37
|
+
|
|
38
|
+
<div class="col-sm-12">
|
|
39
|
+
<label for="f_comments" class="font_normal_body">备  注</label>
|
|
40
|
+
<input type="text" class="input_search" style="width:87%" v-model="model.f_comments" placeholder="备注"/>
|
|
41
|
+
</div>
|
|
42
|
+
</div>
|
|
43
|
+
</form>
|
|
44
|
+
<print-bill :show="print" :bill-manager='config.hasBillManage' v-ref:printbill :bill-url='billUrl' v-on:toggle="close" @printok="printok" :data='row'></print-bill>
|
|
45
|
+
<div style="text-align:right;margin-top:80px;margin-right:50px;">
|
|
46
|
+
<button class="button_search" @click="confirm()" v-if="jurisdiction.includes('线下写卡')" :disabled='clickConfirm'>写卡</button>
|
|
47
|
+
<button class="button_clear" @click="clean()">取消</button>
|
|
48
|
+
</div>
|
|
49
|
+
</validator>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
<script>
|
|
53
|
+
/**
|
|
54
|
+
*综合业务
|
|
55
|
+
*卡表收费组件
|
|
56
|
+
*/
|
|
57
|
+
import CardService from './CardService'
|
|
58
|
+
|
|
59
|
+
// 执行保存逻辑
|
|
60
|
+
let sellgasGen = async function (self) {
|
|
61
|
+
try {
|
|
62
|
+
self.row.cardInfo = self.cardData
|
|
63
|
+
self.row.f_write_comments = self.model.f_comments
|
|
64
|
+
await CardService.offlineWrite(self.row)
|
|
65
|
+
// 开始打票
|
|
66
|
+
self.clickConfirm = false
|
|
67
|
+
self.$dispatch('success')
|
|
68
|
+
} catch (error) {
|
|
69
|
+
self.$showAlert(error, 'danger', 0)
|
|
70
|
+
self.$dispatch('refresh')
|
|
71
|
+
self.clickConfirm = false
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export default {
|
|
76
|
+
title: '线下写卡',
|
|
77
|
+
data () {
|
|
78
|
+
return {
|
|
79
|
+
model: {},
|
|
80
|
+
clickConfirm: false,
|
|
81
|
+
jurisdiction: this.$login.r
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
props: ['row', 'cardData'],
|
|
85
|
+
ready () {
|
|
86
|
+
if (this.row.unWriteSell) {
|
|
87
|
+
this.model = this.row.unWriteSell[0]
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
confirm () {
|
|
92
|
+
if (!this.cardData) {
|
|
93
|
+
this.$showAlert('请先进行读卡再进行线下写卡', 'warning', 3000)
|
|
94
|
+
return
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
this.clickConfirm = true
|
|
98
|
+
this.$showMessage(`对用户${this.row.f_user_name}进行写卡操作。该操作只做写卡操作。确定要进行该操作吗?`, ['confirm', 'cancel']).then((res) => {
|
|
99
|
+
if (res === 'confirm') {
|
|
100
|
+
sellgasGen(this)
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
},
|
|
104
|
+
clean () {
|
|
105
|
+
this.$dispatch('refresh', this.row)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style>
|
|
112
|
+
</style>
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
let specialComp = {
|
|
3
3
|
'card-meter-center': (resolve) => { require(['./CardMeterCenter'], resolve) },
|
|
4
4
|
// 发卡售气
|
|
5
|
-
'show-card-sell-gas': (resolve) => { require(['./ShowCardSellGas'], resolve) }
|
|
5
|
+
'show-card-sell-gas': (resolve) => { require(['./ShowCardSellGas'], resolve) },
|
|
6
|
+
// 无卡收费
|
|
7
|
+
'card-meter-charge-cancel': (resolve) => { require(['./CardMeterChargeCancel'], resolve) },
|
|
8
|
+
// 线下写卡操作
|
|
9
|
+
'un-write-card-center': (resolve) => { require(['./UnWriteCardCenter'], resolve) }
|
|
6
10
|
}
|
|
7
11
|
exports.specialComp = specialComp
|