sale-client 3.5.106 → 3.5.108

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.5.106",
3
+ "version": "3.5.108",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -60,13 +60,10 @@
60
60
  close-on-select clear-button v-ref:printstyle>
61
61
  </v-select>
62
62
  </div>
63
- <div class="col-sm-4 form-group"
64
- :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
63
+ <div class="col-sm-4 form-group" >
65
64
  <label for="f_pregas" class=" font_normal_body">写卡气量</label>
66
65
  <input class="input_search" style="width:60%" type="number"
67
- v-model="model.f_pregas"
68
- v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="写卡气量"
69
- v-next-el='sk' disabled>
66
+ v-model="model.f_pregas" placeholder="写卡气量" disabled>
70
67
  </div>
71
68
  <div class="col-sm-4 form-group"
72
69
  :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
@@ -0,0 +1,421 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='v'>
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row" style="margin-top:10px;">
6
+
7
+ <div class="col-sm-4 form-group" :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
8
+ <label for="f_pregas" class=" font_normal_body">*超用气量</label>
9
+ <input class="input_search" style="width:60%" type="number"
10
+ v-validate:f_pregas='{required: true, dctest: [0, ">=" ]}' v-model="model.f_pregas" v-scale = "[model.f_pregas, 4]">
11
+ </div>
12
+
13
+ <div class="col-sm-4 form-group">
14
+ <label for="f_pregas" class=" font_normal_body">单&emsp;&emsp;价</label>
15
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_price" v-scale = "[model.f_price, 4]" @blur="priceChange">
16
+ </div>
17
+
18
+ <div class="col-sm-4 form-group">
19
+ <label for="f_preamount" class=" font_normal_body">超用金额</label>
20
+ <input class="input_search" @blur="calCollection" style="width:60%" type="number" v-model="model.f_preamount" >
21
+ </div>
22
+ </div>
23
+ <div class="row" style="margin-top:10px;">
24
+ <div class="col-sm-4 form-group" :class="[$v.payment.required ? 'select-error' : '']">
25
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
26
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
27
+ <v-select v-model="model.f_payment"
28
+ placeholder='请选择'
29
+ :value.sync="model.f_payment"
30
+ close-on-select
31
+ :options='paytype' clear-button v-ref:payment></v-select>
32
+ </div>
33
+ <div class=" col-sm-4 form-group">
34
+ <label for="f_print" class="font_normal_body">打印格式</label>
35
+ <v-select id="print"
36
+ v-model="f_print"
37
+ placeholder='请选择'
38
+ :multiple="mulPrint"
39
+ :value.sync="model.f_print"
40
+ :options='printstyle'
41
+ close-on-select clear-button>
42
+ </v-select>
43
+ </div>
44
+ <!--<div class="col-sm-4 form-group" v-if="model.f_payment[0].includes('POS')">-->
45
+ <!--<label for="f_voucher_number" class="font_normal_body">凭证号</label>-->
46
+ <!--<input type="text" class="input_search col-sm-2" v-model="model.f_voucher_number" placeholder="凭证号">-->
47
+ <!--</div>-->
48
+ <!--<div class="col-sm-4 form-group" v-if="!model.f_payment[0].includes('POS')">-->
49
+ <!--</div>-->
50
+ <div class="col-sm-4 form-group">
51
+ <label for="f_totalcost" class=" font_normal_body">应交金额</label>
52
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_totalcost.toFixed(4)" disabled>
53
+ </div>
54
+ </div>
55
+ <div class="row" style="margin-top:10px;">
56
+ <div class=" col-sm-4 form-group">
57
+ <label for="f_totalcost" class=" font_normal_body">&nbsp;上期结余</label>
58
+ <input class="input_search" style="width:60%" type="number" v-model="row.f_balance" disabled>
59
+ </div>
60
+ <div class=" col-sm-4 form-group">
61
+ <label for="f_totalcost" class=" font_normal_body">本期结余</label>
62
+ <input class="input_search" style="width:60%" type="number" v-model="f_curbalance" disabled>
63
+ </div>
64
+ <div v-if="collectionreload" class="col-sm-4 form-group" :class="[$v.f_collection.required || $v.f_collection.dctest ? 'has-error' : 'has-success']">
65
+ <label for="f_collection" class="font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
66
+ <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
67
+ v-validate:f_collection='{required: true, dctest: [(model.f_totalcost-0), ">=" ] }'
68
+ v-scale = "[model.f_collection, 4]">
69
+ </div>
70
+ </div>
71
+
72
+ <div class="row" style="margin-top:10px;">
73
+ <div class="col-sm-4 form-group" v-if="!mjshow" >
74
+ <label for="f_serial_number" class="font_normal_body">&nbsp;业务单号</label>
75
+ <input class="input_search" style="width:60%" type="text"
76
+ v-model="model.f_serial_number" placeholder="业务单号">
77
+ </div>
78
+ <div class="col-sm-4 form-group" v-if="mjshow" :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
79
+ <label for="f_serial_number" class="font_normal_body">&nbsp;业务单号</label>
80
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
81
+ v-model="model.f_serial_number" placeholder="业务单号">
82
+ </div>
83
+ <div class=" col-sm-4 form-group" :class="[$v.addtotal.required || $v.addtotal.dctest ? 'has-error' : 'has-success']">
84
+ <label for="f_print" class="font_normal_body">是否累计</label>
85
+ <input class="input_search" style="width:60%" type="text" v-validate:addtotal='{required: true }' v-show="false"
86
+ v-model="model.addtotal" placeholder="是否累计">
87
+ <v-select id="addtotal"
88
+ v-model="model.addtotal"
89
+ placeholder='请选择'
90
+ :search="false"
91
+ :value.sync="model.addtotal"
92
+ :options='addtotals'
93
+ close-on-select clear-button>
94
+ </v-select>
95
+ </div>
96
+ </div>
97
+ <div class="row" style="margin-top:5px;">
98
+ <div class="col-sm-9">
99
+ </div>
100
+ <div class="col-sm-3">
101
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
102
+ </div>
103
+ </div>
104
+ <div class="row" style="padding-top: 0.5em;">
105
+ <div class="col-sm-12 form-group">
106
+ <label for="f_comments" class="font_normal_body">&nbsp;备&emsp;&emsp;注</label>
107
+ <input class="input_search" style="width:87%" v-model="model.f_comments" placeholder="备注"/>
108
+ </div>
109
+ </div>
110
+ <div class="row" style="margin-top:10px;" v-if="!config.notShowFormula && calculatedetail">
111
+ <div class="col-sm-4 form-group col-sm-offset-7">
112
+ <strong>计算公式: {{calculatedetail}}</strong>
113
+ </div>
114
+ </div>
115
+ <div class="row">
116
+ <div class="col-sm-8">
117
+ <strong style="color:blue">温馨提示: 若为阶梯价,只按照一阶进行计算,并不计入阶梯!!</strong>
118
+ </div>
119
+ </div>
120
+ </form>
121
+ <validate-bill v-if="hasValidateBill" :data="model" @validate-bill="validateBill"></validate-bill>
122
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" :data='row' @printok="printok" v-ref:printbill></print-bill>
123
+ <div style="text-align:right;margin-top:30px;margin-right:50px;">
124
+ <payment-code-button :clickable="!$v.valid || validateOk"
125
+ :payment.sync="model.f_payment" :payment-data="paytype"
126
+ @confirm-payment="confirm()">
127
+ </payment-code-button>
128
+ <button class="button_search" @click="confirm()" :disabled='!$v.valid || validateOk'>确认</button>
129
+ <button class="button_clear" @click="clean()" >取消</button>
130
+ </div>
131
+ </validator>
132
+ </div>
133
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_collection"></payment-code>
134
+ <mis-pos-pay v-ref:mispospay :payment="model.f_payment" :row="row" :money="model.f_collection"></mis-pos-pay>
135
+ <upload :blodid="blodid" v-if="config.showupload" isremark="true" fusetype="超用收费"></upload>
136
+ </template>
137
+ <script>
138
+ /**
139
+ *综合业务
140
+ *超用收费组件
141
+ */
142
+
143
+ let getOverUseGen = async function (self) {
144
+ await self.$getConfig(self, 'OverUseCharge')
145
+ console.log('超用config...', self.config)
146
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
147
+ self.model.f_payment = [self.config.payment]
148
+ self.mulPrint = self.config.printType instanceof Array
149
+
150
+ // 验证发票
151
+ self.model.f_use_type = self.config.billType
152
+ self.model.f_bill_type = self.model.f_print
153
+ self.hasValidateBill = self.config.hasBillManage
154
+
155
+ self.model = Object.assign({}, self.model, self.row)
156
+
157
+ // 获取单价(阶梯使用一阶, 固定直接是固定)
158
+ let res = await self.$CommonService.feeCalculate(self.model, 0)
159
+ if (self.row.f_price_type == '固定气价') {
160
+ self.model.f_price = res.data.chargeprice[0].f_price - 0
161
+ } else if (self.row.f_price_type == '阶梯气价') {
162
+ self.model.f_price = res.data.f_stair1price - 0
163
+ }
164
+ }
165
+
166
+ // let overUseGasGen = async function (self) {
167
+ // let res = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
168
+ //
169
+ // if (self.row.f_price_type == '固定气价') {
170
+ // self.model.f_preamount = (res.data.chargenum - 0)
171
+ // self.model.f_totalcost = self.model.f_balance > self.model.f_preamount ? 0 : self.model.f_preamount - self.model.f_balance
172
+ // self.model.f_collection = self.model.f_totalcost
173
+ // self.model.chargeprice = [{
174
+ // f_price: (res.data.chargeprice[0].f_price - 0),
175
+ // f_gas: self.model.f_pregas,
176
+ // f_money: self.model.f_preamount,
177
+ // f_price_name: '固定气价',
178
+ // f_user_id: self.row.f_user_id,
179
+ // f_userfiles_id: self.row.f_userfiles_id,
180
+ // f_operate_date: self.$login.toStandardTimeString(),
181
+ // f_state: '有效',
182
+ // f_type: '超用收费'
183
+ // }]
184
+ // self.calculatedetail = res.data.chargeprice[0].f_price + ' x ' + self.model.f_pregas
185
+ // } else if (self.row.f_price_type == '阶梯气价') {
186
+ // self.model.f_preamount = (res.data.f_stair1price - 0) * (self.model.f_pregas - 0)
187
+ // self.model.f_totalcost = self.model.f_balance > self.model.f_preamount ? 0 : self.model.f_preamount - self.model.f_balance
188
+ // self.model.f_collection = self.model.f_totalcost
189
+ // self.model.chargeprice = [{
190
+ // f_price: (res.data.f_stair1price - 0),
191
+ // f_gas: self.model.f_pregas,
192
+ // f_money: self.model.f_preamount,
193
+ // f_price_name: '阶梯1',
194
+ // f_user_id: self.row.f_user_id,
195
+ // f_userfiles_id: self.row.f_userfiles_id,
196
+ // f_operate_date: self.$login.toStandardTimeString(),
197
+ // f_state: '有效',
198
+ // f_type: '超用收费'
199
+ // }]
200
+ // self.calculatedetail = res.data.f_stair1price + ' x ' + self.model.f_pregas
201
+ // }
202
+ //
203
+ //
204
+ // }
205
+
206
+ let overChargeGen = async function (self) {
207
+ try {
208
+ // 组织价格明细
209
+ self.model.chargeprice = [{
210
+ f_price: (self.model.f_price - 0),
211
+ f_gas: self.model.f_pregas,
212
+ f_money: self.model.f_preamount,
213
+ f_price_name: self.row.f_meter_type == '固定气价' ? '固定气价' : '阶梯1',
214
+ f_user_id: self.row.f_user_id,
215
+ f_userfiles_id: self.row.f_userfiles_id,
216
+ f_operate_date: self.$login.toStandardTimeString(),
217
+ f_state: '有效',
218
+ f_type: '超用收费'
219
+ }]
220
+
221
+ // 加入扫码盒付款码支付流水号
222
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
223
+ self.model.f_serial_id = self.$refs.mispospay.misposReturnData.f_out_trade_no
224
+
225
+ let res = await self.$ChangeMeterService.overCharge(self.model, self.row)
226
+ console.log('超用收费返回id', res)
227
+ if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
228
+ if (self.model.f_print.indexOf('电子发票') == -1) {
229
+ if (self.config.hasBillManage) {
230
+ // 启用发票管理,获取票据管理中的票号并存储记录
231
+ self.row.id = res.data
232
+ self.row.f_bill_type = '超用收费'
233
+ self.row.f_bill_style = self.model.f_print[0]
234
+ self.print = true
235
+ } else {
236
+ self.row.id = res.data
237
+ self.print = true
238
+ }
239
+ } else {
240
+ if (self.model.f_print[0] === '电子发票') {
241
+ self.$CommonService.openEticket(res.data, '超用收费')
242
+ self.$dispatch('success')
243
+ }
244
+ }
245
+ } else {
246
+ self.$dispatch('success')
247
+ }
248
+ } catch (error) {
249
+ console.log('捕获到异常', error)
250
+ if (error instanceof Object) {
251
+ self.$showAlert(error.data, 'danger', 0)
252
+ } else {
253
+ self.$showAlert(error, 'danger', 0)
254
+ }
255
+ self.$showAlert(error, 'danger', 0)
256
+ self.$dispatch('refresh')
257
+ }
258
+ }
259
+
260
+ export default {
261
+ title: '超用收费',
262
+ data () {
263
+ return {
264
+ config: {
265
+ notShowFormula: false, // 不显示计算公式,默认显示
266
+ showupload: true, // 默认不显示附件
267
+ hasPrint: false, // 默认打票
268
+ hasBillManage: false, // 默认不启用发票管理
269
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
270
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
271
+ payment: '现金缴费'
272
+ },
273
+ disable: false,
274
+ total: 0,
275
+ blodid: '',
276
+ collectionreload: true,
277
+ model: {
278
+ f_pregas: '',
279
+ f_price: 0,
280
+ f_preamount: 0,
281
+ f_totalcost: 0,
282
+ f_collection: 0,
283
+ f_balance: '',
284
+ f_curbalance: '',
285
+ f_payment: '现金缴费',
286
+ f_print: [],
287
+ f_voucher_number: '',
288
+ f_comments: '',
289
+ addtotal: '是'
290
+ },
291
+ // 本期结余
292
+ f_curbalance: 0,
293
+ addtotals: [{label: '是', value: '是'}, {label: '否', value: '否'}],
294
+ cal: false,
295
+ calculatedetail: '',
296
+
297
+ oldprice: 0,
298
+
299
+ // 启用发票管理需要对票号进行验证
300
+ hasValidateBill: false,
301
+ validateOk: false,
302
+
303
+ billData: {
304
+ url: 'rs/report/overuse_bill',
305
+ bill: ''
306
+ },
307
+ print: false,
308
+
309
+ mulPrint: false,
310
+ paytype: this.$appdata.getParam('付款方式'),
311
+ printstyle: this.$appdata.getParam('打印格式'),
312
+ mjshow: false
313
+ }
314
+ },
315
+ props: ['row'],
316
+ ready () {
317
+ this.blodid = this.row.f_userinfo_id
318
+ // 获取超用记录并赋值
319
+ getOverUseGen(this)
320
+ },
321
+ methods: {
322
+ confirm () {
323
+ console.log('超用收费11111111111111111111111111111')
324
+ this.model.f_curbalance = this.f_curbalance
325
+ this.$showMessage(`对客户${this.row.f_user_name}进行超用收费,确定要进行该操作吗?`, ['confirm', 'cancel']).then(async (res) => {
326
+ if (res === 'confirm') {
327
+ let ss = await this.$refs.paymentcode.flowPath()
328
+ this.$refs.paymentcode.paymentCodeShow = false
329
+ console.log('付款码操作返回', ss)
330
+ if (!ss.result) return
331
+
332
+ // 调用无线pos支付
333
+ let misposRes = await this.$refs.mispospay.flowPath()
334
+ this.$refs.mispospay.misposShow = false
335
+ console.log('付款码操作返回', misposRes)
336
+ if (!misposRes.result) return
337
+
338
+ this.clickConfirm = true
339
+ this.$dispatch('no-button')
340
+ overChargeGen(this)
341
+ }
342
+ })
343
+ },
344
+ clean () {
345
+ this.$dispatch('refresh')
346
+ },
347
+ close () {
348
+ this.showprint = false
349
+ this.print = false
350
+ this.clean()
351
+ },
352
+ printok () {
353
+ // 收据打完,判断是否还有其他票据进行请求
354
+ for (let i = 0; i < this.model.f_print.length; i++) {
355
+ if (this.model.f_print[i] === '电子发票') {
356
+ this.$CommonService.openEticket(this.row.id, '超用收费')
357
+ }
358
+ }
359
+ this.$dispatch('success')
360
+ },
361
+ validateBill (val) {
362
+ this.validateOk = !val.isOk
363
+ this.billData.bill = val.bill
364
+ },
365
+ async calPreamount () {
366
+ this.collectionreload = false
367
+ this.model.f_preamount = ((this.model.f_pregas - 0) * (this.model.f_price - 0)).toFixed(4)
368
+ this.model.f_totalcost = this.model.f_balance > this.model.f_preamount ? 0 : (this.model.f_preamount - 0) - (this.model.f_balance - 0)
369
+ this.model.f_collection = this.model.f_totalcost - 0
370
+ await this.$nextTick()
371
+ this.collectionreload = true
372
+ },
373
+ async calCollection () {
374
+ this.collectionreload = false
375
+ this.model.f_totalcost = this.model.f_balance > this.model.f_preamount ? 0 : (this.model.f_preamount - 0) - (this.model.f_balance - 0)
376
+ this.model.f_collection = this.model.f_totalcost - 0
377
+ await this.$nextTick()
378
+ this.collectionreload = true
379
+ },
380
+ priceChange () {
381
+ console.log('新旧价格', this.model.f_price, this.oldprice)
382
+ if (this.model.f_price - this.oldprice < 0) {
383
+ // 判断是否有超用价格修改权限
384
+ if (!this.$login.r.includes('超用价格修改')) {
385
+ this.$showAlert('您没有将该价格降低的权限!!', 'warning', 3000)
386
+ this.model.f_price = this.oldprice
387
+ }
388
+ }
389
+ }
390
+ },
391
+ watch: {
392
+ 'model.f_pregas' () {
393
+ this.calPreamount()
394
+ },
395
+ 'model.f_price' (newVal, oldVal) {
396
+ this.oldprice = oldVal
397
+ this.calPreamount()
398
+ },
399
+ 'model.f_payment' (val) {
400
+ // 根据付款方式增加业务单号
401
+ if (val == '免交') {
402
+ this.mjshow = true
403
+ } else {
404
+ this.mjshow = false
405
+ }
406
+ }
407
+ },
408
+ computed: {
409
+ 'f_curbalance' () {
410
+ if (this.model.f_preamount) {
411
+ return ((this.model.f_collection - 0) + (this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
412
+ } else {
413
+ return this.model.f_balance
414
+ }
415
+ }
416
+ }
417
+ }
418
+ </script>
419
+
420
+ <style>
421
+ </style>
@@ -0,0 +1,422 @@
1
+ <template>
2
+ <div class="auto">
3
+ <validator name='v'>
4
+ <form novalidate class="form-horizontal">
5
+ <div class="row" style="margin-top:5px;" v-if="config.isPickTable">
6
+
7
+ <div class="col-sm-3" :class="[$v.pick.required ? 'select-error' : '']">
8
+ <label class=" font_normal_body">是否过表</label>
9
+ <input type="text" v-show="false" v-model="$refs.pick.selectedItems"
10
+ v-validate:pick='{required: true }'>
11
+ <v-select v-model="f_ispick_table"
12
+ placeholder='请选择'
13
+ :value.sync="model.f_ispick_table"
14
+ :options='pickTables'
15
+ :value-single="true"
16
+ close-on-select clear-button v-ref:pick></v-select>
17
+ </div>
18
+ </div>
19
+
20
+ <div class="row" style="margin-top:5px;">
21
+ <label class="radio-inline col-sm-3">
22
+ <input type="radio" value="IC卡丢失或损坏" v-model="model.f_type" class="magic-radio" checked id="type_two">
23
+ <label for="type_two">IC卡丢失或损坏</label>
24
+ <!-- <strong>IC卡丢失或损坏</strong> -->
25
+ </label>
26
+ <label class="radio-inline col-sm-4" v-if="row.f_meter_type !== '机表'">
27
+ <input type="radio" value="IC卡信息错乱" v-model="model.f_type" class="magic-radio" id="type_three">
28
+ <label for="type_three">IC卡信息错乱</label>
29
+ <!-- <strong>IC卡信息错乱</strong> -->
30
+ </label>
31
+ <label class="radio-inline col-sm-3" v-if="row.f_meter_type !== '机表'">
32
+ <input type="radio" value="其他" v-model="model.f_type" class="magic-radio" id="type_four">
33
+ <label for="type_four">其他</label>
34
+ <!-- <strong>其他</strong> -->
35
+ </label>
36
+ </div>
37
+
38
+ <div class="row" style="margin-top:10px;" v-if='lose'>
39
+ <div class="col-sm-4" :class="[$v.payment.required ? 'has-error' : '']">
40
+ <label class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
41
+ <input type="text" v-show="false" v-model="$refs.payment.selectedItems" v-validate:payment='{required: true }'>
42
+ <v-select v-model="model.f_payment"
43
+ placeholder='请选择'
44
+ :value.sync="model.f_payment"
45
+ :options='paytype'
46
+ v-ref:payment
47
+ close-on-select clear-button></v-select>
48
+ </div>
49
+
50
+ <div class="col-sm-4" :class="[$v.printstyle.required ? 'select-error' : '']">
51
+ <label for="f_print" class="font_normal_body">打印格式</label>
52
+ <input type="text" v-show="false" v-model="$refs.printstyle.selectedItems" v-validate:printstyle='{required: true }'>
53
+ <v-select id="print"
54
+ v-model="model.f_print"
55
+ placeholder='请选择'
56
+ :multiple="mulPrint"
57
+ :value.sync="model.f_print"
58
+ :options='printstyle'
59
+ close-on-select clear-button v-ref:printstyle>
60
+ </v-select>
61
+ </div>
62
+ <div class="col-sm-4" :class="[$v.f_cardfees.required ? 'has-error' : '']">
63
+ <label class=" font_normal_body">补&emsp;卡&emsp;费</label>
64
+ <input class="input_search" style="width:60%" v-validate:f_cardfees='{required: true }' type="number" v-model="model.f_cardfees">
65
+ </div>
66
+ </div>
67
+ <div class="row" style="margin-top:5px;">
68
+ <div class="col-sm-4" :class="[$v.f_fill_type.required ? 'select-error' : '']">
69
+ <label for="f_print" title="参数名称:补卡种类" class="font_normal_body">补卡种类</label>
70
+ <input type="text" v-show="false" v-model="model.f_fill_type" v-validate:f_fill_type='{required: true }'>
71
+ <v-select v-model="model.f_fill_type"
72
+ placeholder='请选择'
73
+ :value.sync="model.f_fill_type"
74
+ :options='filltypes'
75
+ v-ref:f_fill_type
76
+ close-on-select clear-button>
77
+ </v-select>
78
+ </div>
79
+ </div>
80
+ <!--<div class="row" style="margin-top:10px;" v-if="model.f_type === '其他'" :class="[$v.f_reason.required ? 'has-error' : 'has-success']">-->
81
+ <!--<label for="f_reason" class=" font_normal_body">*补卡原因</label>-->
82
+ <!--<input class="input_search" style="width:60%" v-model="model.f_reason" v-validate:f_reason='{required: true }'-->
83
+ <!--placeholder="补卡原因" />-->
84
+ <!--</div>-->
85
+
86
+
87
+
88
+ <div class="row" style="margin-top:5px;">
89
+ <label for="f_comments" class="font_normal_body">备&emsp;&emsp;注</label>
90
+ <input class="input_search" style="width:87%" v-model="model.f_comments" placeholder="备注">
91
+ </div>
92
+ </form>
93
+ <accept-bill :show="acceptprint" :bill-url='acceptUrl' v-on:toggle="close" :data='row' :billdata="printData" @closeaccept="closeAccept" v-ref:acceptbill></accept-bill>
94
+ <validate-bill v-if="hasValidateBill && lose" :data="model" @validate-bill="validateBill"></validate-bill>
95
+ <print-bill :show="print" :bill-config='config' :bill-data='billData' v-on:toggle="close" @printok="printok" :data='row' v-ref:printbill></print-bill>
96
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
97
+ <modal :show.sync="eticket_msg" v-ref:modal large backdrop="false" :width="900">
98
+ <header slot="modal-header" class="modal-header">
99
+ <button type="button" class="close" @click="eticket_msg = false"><span>&times;</span></button>
100
+ <h4 class="modal-title">发票信息</h4>
101
+ </header>
102
+ <article slot="modal-body" class="modal-body">
103
+ <div class="auto select-overspread form-horizontal">
104
+ <div class="row auto">
105
+ <div class="col-sm-6 form-group form-input-group" :class="[!row.f_paper_name ? 'has-error' : '']">
106
+ <label class="control-label">开票名称:</label>
107
+ <input class="form-control col-sm-2"
108
+ v-model="row.f_paper_name" placeholder="开票名称">
109
+ </div>
110
+ <div class="col-sm-6 form-group form-input-group">
111
+ <nobr class="col-sm-4"><label class="control-label">是否征税:</label></nobr>
112
+ <v-select v-model="invoice_is_pax"
113
+ placeholder='请选择'
114
+ :value.sync="invoice_is_pax"
115
+ close-on-select
116
+ :width="60"
117
+ :value-single="true"
118
+ :search="false"
119
+ :options='is_pax' clear-button>
120
+ </v-select>
121
+ </div>
122
+ <div class="col-sm-12 form-group form-input-group">
123
+ <label class="control-label">开户行及账号:</label>
124
+ <input class="form-control col-sm-2"
125
+ v-model="row.f_paper_account" placeholder="购方开户行及账号">
126
+ </div>
127
+ <div class="col-sm-12 form-group form-input-group" >
128
+ <label class="control-label">纳税人识别号:</label>
129
+ <input class="form-control col-sm-2"
130
+ v-model="row.f_taxpayer_id" placeholder="纳税人识别号">
131
+ </div>
132
+ <div class="col-sm-12 form-group form-input-group" :class="[!row.f_address_phone ? 'has-error' : '']">
133
+ <label class="control-label">开票地址电话:</label>
134
+ <input class="form-control col-sm-2"
135
+ v-model="row.f_address_phone" placeholder="开票地址">
136
+ </div>
137
+ <div class="col-sm-12 form-group form-input-group">
138
+ <label class="control-label">邮箱推送:</label>
139
+ <input class="form-control col-sm-2"
140
+ v-model="row.f_email" placeholder="邮箱推送">
141
+ </div>
142
+ </div>
143
+ </div>
144
+ </article>
145
+ <footer slot="modal-footer" class="modal-footer">
146
+ <button type="button" class="btn button_search"
147
+ :disabled="!(row.f_paper_name&&row.f_address_phone)"
148
+ @click='confirm'>确认收费
149
+ </button>
150
+ </footer>
151
+ </modal>
152
+ <div style="text-align:right;height:auto;margin-top:30px;margin-right:50px;">
153
+ <button class="button_clear" @click="accept()" v-if="config.hasAcceptance">受理单</button>
154
+ <payment-code-button :clickable="!$v.valid || validateOk"
155
+ :payment.sync="model.f_payment" :payment-data="paytype"
156
+ @confirm-payment="confirm()">
157
+ </payment-code-button>
158
+ <button class="button_search" @click="checkInvoiceMsg()" :disabled='!$v.valid || validateOk'>确认</button>
159
+ <button class="button_clear" @click="clean()" >取消</button>
160
+ </div>
161
+ </validator>
162
+
163
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_cardfees"></payment-code>
164
+ <mis-pos-pay v-ref:mispospay :payment="model.f_payment" :row="row" :money="model.f_cardfees"></mis-pos-pay>
165
+ </div>
166
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" isremark="true" fusetype="补卡"></upload>
167
+
168
+ </template>
169
+ <script>
170
+ import {HttpResetClass} from 'vue-client'
171
+ /**
172
+ *综合业务
173
+ *补卡管理组件
174
+ */
175
+
176
+ let asyncReplaceManage = async function (self) {
177
+ await self.$getConfig(self, 'ReplaceCardManage')
178
+ console.log('补卡config', self.config)
179
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
180
+ self.model.f_payment = [self.config.payment]
181
+ if (self.config.isPickTable) {
182
+ self.model.f_ispick_table = '已过表'
183
+ }
184
+ self.model.f_fill_type = [self.config.filltype]
185
+ self.model.f_use_type = self.config.billType
186
+ self.model.f_bill_type = self.model.f_print
187
+ self.hasValidateBill = self.config.hasBillManage
188
+
189
+ self.fillcardChange(self.model.f_type)
190
+ }
191
+
192
+ export default {
193
+ title: '补卡管理',
194
+ data () {
195
+ return {
196
+ config: {
197
+ showupload: false, // 控制附件显示
198
+ hasPrint: true, // 默认打票
199
+ hasBillManage: false, // 默认不启用发票管理
200
+ billType: '其他费用', // 票据类型(燃气费,其他费用,调用的发票代码不同)
201
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
202
+ payment: '现金缴费',
203
+ filltype: '原卡补卡',
204
+ hasAcceptance: false, // 是否需要打印受理单
205
+ isPickTable: false // 是否添加接表判断(对于那些对次数严格限制的表)
206
+ },
207
+ resid: [], // 存放新增的f_files表中id
208
+ eticket_msg: false,
209
+ eticket_show: false,
210
+ invoice_is_pax: '征税',
211
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
212
+ model: {
213
+ f_comments: '',
214
+ f_type: 'IC卡丢失或损坏',
215
+ f_cardfees: '',
216
+ f_payment: [],
217
+ f_print: [],
218
+ f_fill_type: [],
219
+ f_replace_time: ''
220
+ },
221
+ printData: {
222
+ reason: '',
223
+ cardfee: ''
224
+ },
225
+ cardallot: null,
226
+ lose: false,
227
+ f_payment: [],
228
+ f_ispick_table: '',
229
+ print: false,
230
+ billData: {
231
+ url: 'rs/report/replace_sell',
232
+ bill: ''
233
+ },
234
+ paytype: this.$appdata.getParam('付款方式') ? this.$appdata.getParam('付款方式') : [],
235
+ printstyle: this.$appdata.getParam('打印格式') ? this.$appdata.getParam('打印格式') : [],
236
+ pickTables: [{label: '已过表', value: '已过表'}, {label: '未过表', value: '未过表'}],
237
+ // 启用发票管理需要对票号进行验证
238
+ hasValidateBill: false,
239
+ validateOk: false,
240
+
241
+ acceptprint: false,
242
+ acceptUrl: '',
243
+ filltypes: this.$appdata.getParam('补卡种类') ? this.$appdata.getParam('补卡种类') : []
244
+ }
245
+ },
246
+ props: ['row', 'cardData'],
247
+ ready () {
248
+ asyncReplaceManage(this).then(() => {
249
+ this.$emit(ready())
250
+ }).catch((error) => {
251
+ this.$emit('error', error)
252
+ })
253
+ },
254
+ watch: {
255
+ 'model.f_type' (val) {
256
+ this.fillcardChange(val)
257
+ }
258
+ },
259
+ methods: {
260
+ // 校验发票信息
261
+ checkInvoiceMsg () {
262
+ if (this.model.f_print[0] === '电子发票') {
263
+ if (!this.row.f_taxpayer_id) {
264
+ this.row.f_taxpayer_id = this.row.f_idnumber
265
+ }
266
+ if (!this.row.f_paper_name) {
267
+ this.row.f_paper_name = this.row.f_user_name
268
+ }
269
+ if (!this.row.f_address_phone) {
270
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
271
+ }
272
+ if(!this.row.f_email){
273
+ this.row.f_email = this.row.f_email
274
+ }
275
+ this.eticket_msg = true
276
+ } else {
277
+ this.confirm()
278
+ }
279
+ },
280
+ eticket_toggle () {
281
+ this.eticket_show = false
282
+ this.$dispatch('success')
283
+ },
284
+ confirm () {
285
+ this.eticket_msg = false
286
+ this.$dispatch('no-button')
287
+ // 判断是否接表提示
288
+ if (this.config.isPickTable) {
289
+ this.$showMessage(`您确定客户${this.model.f_ispick_table}了吗?`, ['confirm', 'cancel']).then((res) => {
290
+ if (res === 'confirm') {
291
+ this.writeCard()
292
+ }
293
+ })
294
+ } else if (this.row.f_meter_type.indexOf('卡表') === -1) {
295
+ this.writeCard()
296
+ } else {
297
+ this.$showMessage(`请确保你已经插入了IC卡`, ['confirm', 'cancel']).then((res) => {
298
+ if (res === 'confirm') {
299
+ this.writeCard()
300
+ }
301
+ })
302
+ }
303
+ },
304
+ // 写卡保存数据 迁至此处'
305
+ async writeCard () {
306
+ // 如果是付款码支付则显示界面扫用户付款码收钱
307
+ if (this.model.f_type == 'IC卡丢失或损坏' && this.model.f_cardfees - 0 > 0) {
308
+ // 先调用付款码支付组件流程
309
+ let ss = await this.$refs.paymentcode.flowPath()
310
+ this.$refs.paymentcode.paymentCodeShow = false
311
+ console.log('付款码操作返回', ss)
312
+ if (!ss.result) return
313
+
314
+ // 调用无线pos支付
315
+ let misposRes = await this.$refs.mispospay.flowPath()
316
+ this.$refs.mispospay.misposShow = false
317
+ console.log('付款码操作返回', misposRes)
318
+ if (!misposRes.result) return
319
+ }
320
+ // 加入扫码盒付款码支付流水号
321
+ this.model.f_serial_id = this.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
322
+ this.model.f_serial_id = this.$refs.mispospay.misposReturnData.f_out_trade_no
323
+ this.row.cardInfo = this.cardData
324
+ this.$CardService.replaceCard(this.model, this.row).then(async (res) => {
325
+ if (this.config.showupload) {
326
+ let param = []
327
+ for (let row of this.resid) {
328
+ param.push({id: row.id})
329
+ }
330
+ let data = {
331
+ param: param,
332
+ f_blobid: res.data.id
333
+ }
334
+ let http = new HttpResetClass()
335
+ await http.load('POST', 'rs/logic/updatefiles', data, {resolveMsg: null, rejectMsg: '补卡上传附件失败!!'})
336
+
337
+ }
338
+ console.log('补卡返回。。', res)
339
+ if (this.config.hasPrint && this.lose) {
340
+ if (this.config.hasBillManage) {
341
+ this.row.id = res.data.id
342
+ this.row.f_bill_type = '补卡'
343
+ this.row.f_bill_style = this.model.f_print[0]
344
+ this.print = true
345
+ } else if (this.model.f_print[0] === '电子发票') {
346
+ this.row.id = res.data.id
347
+ this.eticket_show = true
348
+ await this.$refs.eticketbill.openETicket([res.data.id], this.row, '是', this.invoice_is_pax, '补卡费')
349
+ } else {
350
+ console.log('不保存打票记录')
351
+ this.row.id = res.data.id
352
+ this.print = true
353
+ }
354
+ } else {
355
+ console.log('我没走打票')
356
+ this.$dispatch('success', '补卡管理', this.row, res)
357
+ }
358
+ }
359
+ ).catch(
360
+ (error) => {
361
+ if (error.status === 603) {
362
+ this.$error('重复提交')
363
+ return
364
+ }
365
+ this.$dispatch('error', '补卡管理', this.row, error)
366
+ }
367
+ )
368
+ },
369
+ closeAccept () {
370
+ this.acceptprint = false
371
+ },
372
+ accept () {
373
+ // 打印受理单
374
+ console.log('受累单中model', this.model)
375
+ this.printData.reason = this.model.f_comments ? `'${this.model.f_reason}'` : `'${this.model.f_type}'`
376
+ this.printData.cardfee = this.model.f_cardfees ? `'${this.model.f_cardfees}'` : `'${0}'`
377
+ console.log('受累单中printData', this.printData)
378
+ this.acceptUrl = 'rs/report/acceptcard_bill'
379
+ this.acceptprint = true
380
+ },
381
+ clean () {
382
+ this.$dispatch('refresh')
383
+ },
384
+ close () {
385
+ this.print = false
386
+ this.acceptprint = false
387
+ this.clean()
388
+ },
389
+ validateBill (val) {
390
+ this.validateOk = !val.isOk
391
+ this.billData.bill = val.bill
392
+ },
393
+ printok () {
394
+ // 收据打完,判断是否还有其他票据进行请求 TODO
395
+ this.$dispatch('success')
396
+ },
397
+ fillcardChange (val) {
398
+ if (val === 'IC卡丢失或损坏') {
399
+ this.lose = true
400
+ this.model.f_cardfees = this.$appdata.getSingleValue('默认卡费')
401
+ } else {
402
+ this.model.f_cardfees = 0
403
+ this.lose = false
404
+ }
405
+ }
406
+ },
407
+ events: {
408
+ // 删除Resid数组元素
409
+ 'delResid' (val) {
410
+ this.resid.$remove({id: val, f_biobid: ''})
411
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
412
+ },
413
+ // 增加Resid数组元素
414
+ 'resid' (val) {
415
+ this.resid.push({id: val, f_biobid: ''})
416
+ }
417
+ }
418
+ }
419
+ </script>
420
+
421
+ <style>
422
+ </style>
@@ -19,6 +19,10 @@ let specialComp = {
19
19
  // 机表收费
20
20
  'machine-meter-center': (resolve) => { require(['./MachineMeterCenter'], resolve) },
21
21
  // 预存收费
22
- 'deposit-charge': (resolve) => { require(['./DepositCharge'], resolve) }
22
+ 'deposit-charge': (resolve) => { require(['./DepositCharge'], resolve) },
23
+ // 超用收费
24
+ 'over-use-charge': (resolve) => { require(['./OverUseCharge'], resolve) },
25
+ // 补卡管理
26
+ 'replace-card-manage': (resolve) => { require(['./ReplaceCardManage'], resolve) },
23
27
  }
24
28
  exports.specialComp = specialComp