sale-client 3.6.339 → 3.6.340

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.339",
3
+ "version": "3.6.340",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <div class="auto">
3
+ <validator name="v">
3
4
  <form class="form-horizontal select-overspread ">
4
5
  <div class="row">
5
6
  <div class="col-sm-8 form-group">
@@ -19,12 +20,15 @@
19
20
  <input class="input_search" placeholder="地址-电话" style="width:70%" type="text" v-el:addressphone
20
21
  v-model="baseinfo.base.f_address_phone" v-next-el="papername">
21
22
  </div>
22
- <div class="col-sm-4 form-group">
23
- <label class="font_normal_body" for="f_paper_type">票据类型</label>
23
+ <div class="col-sm-4 form-group" :class="[$v.pty.required ? 'has-error' : '']">
24
+ <label class="font_normal_body" for="f_paper_type">*票据类型</label>
25
+ <input type="text" class="input_search" style="width:60%" v-show="false" v-model="$refs.pty.selectedItems"
26
+ v-validate:pty='{required: true }'>
24
27
  <v-select :options='papertype'
25
28
  :value-single="true"
26
29
  :value.sync="baseinfo.base.f_paper_type" close-on-select
27
- placeholder='票据类型'></v-select>
30
+ placeholder='票据类型'
31
+ v-ref:pty></v-select>
28
32
  </div>
29
33
  </div>
30
34
  <div class="row">
@@ -48,6 +52,7 @@
48
52
  </div>
49
53
 
50
54
  </form>
55
+ </validator>
51
56
  </div>
52
57
  </template>
53
58
  <script>
@@ -377,39 +377,42 @@
377
377
  }
378
378
  console.log(self.config, self.config.hasPrint && !self.$login.r.includes('不打印发票'))
379
379
  // 开始打票
380
+ console.warn('电子票打印类型:', self.printInvoiceType)
380
381
  if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
381
- if (self.printInvoiceType.indexOf(self.model.f_print) === -1) {
382
- if (self.$login.r.includes('非民用纸质票据拆分')) {
383
- if (self.row.f_user_type === '非民用') {
384
- self.billData.url = 'rs/report/fmy_card_bill'
385
- }
386
- }
387
- if (self.row.f_meter_type === '金额卡表' && self.$appdata.getSingleValue('金额气量区分卡表票据')) {
388
- self.billData.url = 'rs/report/fee_card_bill'
389
- }
390
- if (self.config.hasBillManage) {
391
- // 启用发票管理,获取票据管理中的票号并存储记录
392
- self.row.id = res
393
- self.row.f_bill_type = '卡表收费'
394
- self.row.f_bill_style = self.model.f_print[0]
395
- self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
396
- self.print = true
397
- } else {
398
- self.row.id = res
399
- self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
400
- self.print = true
382
+ // if (self.printInvoiceType.indexOf(self.model.f_print) === -1) {
383
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
384
+ if (self.row.f_user_type === '非民用') {
385
+ self.billData.url = 'rs/report/fmy_card_bill'
401
386
  }
387
+ }
388
+ if (self.row.f_meter_type === '金额卡表' && self.$appdata.getSingleValue('金额气量区分卡表票据')) {
389
+ self.billData.url = 'rs/report/fee_card_bill'
390
+ }
391
+ if (self.config.hasBillManage) {
392
+ // 启用发票管理,获取票据管理中的票号并存储记录
393
+ self.row.id = res
394
+ self.row.f_bill_type = '卡表收费'
395
+ self.row.f_bill_style = self.model.f_print[0]
396
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
397
+ self.print = true
402
398
  } else {
403
- if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
404
- self.row.id = res
405
- self.eticket_show = true
406
- self.row.f_print = self.model.f_print[0]
407
- // 应铜川需要卡表显示
408
- await self.$refs.eticketbill.openETicket(res, self.row, '卡表收费', self.row.f_print)
409
- // await self.$CommonService.openEticket(res, '售气收费')
410
- // self.print = true
411
- }
399
+ self.row.id = res
400
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
401
+ self.print = true
402
+ }
403
+ // } else {
404
+ console.log('电子票打印类型1', self.printInvoiceType)
405
+ console.log('电子票打印类型2', self.model.f_print[0])
406
+ if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
407
+ self.row.id = res
408
+ self.eticket_show = true
409
+ self.row.f_print = self.model.f_print[0]
410
+ // 应铜川需要卡表显示
411
+ await self.$refs.eticketbill.openETicket(res, self.row, '卡表收费', self.row.f_print, false, self.row.invoice_is_pax)
412
+ // await self.$CommonService.openEticket(res, '售气收费')
413
+ self.print = true
412
414
  }
415
+ // }
413
416
  } else {
414
417
  self.$dispatch('success', '卡表收费', self.row)
415
418
  }
@@ -776,7 +779,8 @@
776
779
  },
777
780
  eticket_toggle () {
778
781
  this.eticket_show = false
779
- this.$dispatch('success', '卡表收费')
782
+ this.eticket_msg = false
783
+ // this.$dispatch('success', '卡表收费')
780
784
  },
781
785
  clean () {
782
786
  this.$info('取消操作')
@@ -16,17 +16,6 @@
16
16
  condition="tu.f_user_name = '{}'" placeholder="用户姓名"
17
17
  >
18
18
  </div>
19
- <div class="form-group col-sm-2">
20
- <label class="font_normal_body">是否有票</label>
21
- <v-select
22
- v-model="model.mid"
23
- placeholder='是否有票'
24
- :search="false"
25
- condition="mid.count {} "
26
- :value.sync="model.mid"
27
- :options='$parent.$parent.mid'
28
- close-on-select></v-select>
29
- </div>
30
19
  <div class="row" width="100%">
31
20
  <div class="col-sm-4 col-sm-2">
32
21
  <label class="font_normal_body">&nbsp;开始时间</label>
@@ -66,13 +55,12 @@
66
55
  <th>客户编号</th>
67
56
  <th>客户姓名</th>
68
57
  <th>客户电话</th>
69
- <th>缴费类型</th>
70
- <th>应交金额</th>
71
- <th>应交气量</th>
72
- <th>上期底数</th>
73
- <th>本期底数</th>
74
- <th>是否开过票</th>
75
- <th>结算时间</th>
58
+ <th>纳税人识别号码</th>
59
+ <th>气量</th>
60
+ <th>金额</th>
61
+ <th>用户类型</th>
62
+ <th>用气性质</th>
63
+ <th>气表类型</th>
76
64
  <th>操作</th>
77
65
  </tr>
78
66
  </template>
@@ -85,13 +73,12 @@
85
73
  <th style="text-align:center">{{ row.f_userinfo_code }}</th>
86
74
  <th style="text-align:center">{{ row.f_user_name }}</th>
87
75
  <th style="text-align:center">{{ row.f_user_phone }}</th>
76
+ <th style="text-align:center">{{ row.f_taxpayer_id }}</th>
77
+ <th style="text-align:center">{{ row.gas }}</th>
78
+ <th style="text-align:center">{{ row.money }}</th>
79
+ <th style="text-align:center">{{ row.f_user_type }}</th>
80
+ <th style="text-align:center">{{ row.f_gasproperties }}</th>
88
81
  <th style="text-align:center">{{ row.f_meter_classify }}</th>
89
- <th style="text-align:center">{{ row.f_oughtfee }}</th>
90
- <th style="text-align:center">{{ row.f_oughtamount }}</th>
91
- <th style="text-align:center">{{ row.f_last_tablebase }}</th>
92
- <th style="text-align:center">{{ row.f_tablebase }}</th>
93
- <th style="text-align:center">{{ row.is_bill }}</th>
94
- <th style="text-align:center">{{ row.f_hand_date }}</th>
95
82
  <th>
96
83
  <button class="btn btn-link" @click="$parent.$parent.$parent.kp(row)">开具发票</button>
97
84
  </th>
@@ -214,7 +201,8 @@ export default {
214
201
  invoice_show_gas: '否',
215
202
  show_gas: [{label: '是', value: '是'}, {label: '否', value: '否'}],
216
203
  row: {},
217
- mid: [{label: '全部', value: ''}, {label: '是', value: '是'}, {label: '否', value: '否'}]
204
+ mid: [{label: '全部', value: ''}, {label: '是', value: '是'}, {label: '否', value: '否'}],
205
+ condition: ''
218
206
  }
219
207
  },
220
208
  ready () {
@@ -275,10 +263,25 @@ export default {
275
263
  }
276
264
  this.eticket_msg = true
277
265
  },
278
- confirm () {
266
+ async confirm () {
267
+ console.log('确认开票')
279
268
  this.eticket_msg = false
280
269
  this.eticket_show = true
281
- this.$refs.eticketbill.openETicket(this.selecteds.length === 0 ? this.row.id : this.selecteds.map(item => item.id), this.row, '物联网结算', this.row.f_paper_type, false, this.invoice_is_pax, 't_web_handplan')
270
+
271
+ // this.row = row.data[0]
272
+
273
+ console.log('选中的: ', this.model.condition)
274
+ console.log('先看下条件是啥: ', this.model.condition)
275
+
276
+ // 因为需要合并,所以这里需要根据查询结算记录
277
+ let HttpReset = new HttpResetClass()
278
+ let row = await HttpReset.load('POST', 'rs/sql/OpenETicketQueryDetailed', {
279
+ data: {
280
+ condition: `tu.f_userinfo_code = '${this.row.f_userinfo_code}' and ${this.model.condition}`
281
+ }
282
+ }, {resolveMsg: null, rejectMsg: '获取地址失败!'})
283
+ console.log('查询到的记录:', row)
284
+ this.$refs.eticketbill.openETicket(row.data.map(item => item.id), this.row, '物联网结算', this.row.f_paper_type, false, this.invoice_is_pax, 't_web_handplan')
282
285
  },
283
286
  selfSearch (args) {
284
287
  this.selecteds = []
@@ -231,45 +231,44 @@ let asyncMachineMeterCenter = async function (self) {
231
231
 
232
232
  // 开始打票
233
233
  if (self.config.hasPrint) {
234
- if (self.printInvoiceType.indexOf(self.data.f_print) === -1) {
235
- if (self.$login.r.includes('非民用纸质票据拆分')) {
236
- if (self.row.f_user_type === '非民用') {
237
- self.billData.url = 'rs/report/fmy_machine_bill'
238
- }
234
+ // if (self.printInvoiceType.indexOf(self.data.f_print) === -1) {
235
+ if (self.$login.r.includes('非民用纸质票据拆分')) {
236
+ if (self.row.f_user_type === '非民用') {
237
+ self.billData.url = 'rs/report/fmy_machine_bill'
239
238
  }
240
- if (self.config.hasBillManage) {
241
- // 启用发票管理,获取票据管理中的票号并存储记录
242
- self.data.id = res.data
243
- self.data.f_bill_type = '机表收费'
244
- self.data.f_bill_style = self.data.f_print[0]
245
- self.print = true
246
- } else {
247
- // 如果不欠费就用下边的预存收据
248
- if (self.$parent.$children[0].selecteds) {
249
- console.log('1111111', self.$parent.$children[0].selecteds)
250
- if (self.$parent.$children[0].selectedRows === 0) {
251
- console.log('22222222', self.$parent.$children[0].selectedRows)
252
- self.billData.url = 'rs/report/pre_sell'
253
- }
254
- // 获取选中的handplan的id
255
- self.data.handid = ''
256
- self.$parent.$children[0].selecteds.forEach((row, index) => {
257
- self.data.handid = self.data.handid + "','" + row.handplan_id
258
- })
259
- } else {
260
- console.log('3333333')
239
+ }
240
+ if (self.config.hasBillManage) {
241
+ // 启用发票管理,获取票据管理中的票号并存储记录
242
+ self.data.id = res.data
243
+ self.data.f_bill_type = '机表收费'
244
+ self.data.f_bill_style = self.data.f_print[0]
245
+ self.print = true
246
+ } else {
247
+ // 如果不欠费就用下边的预存收据
248
+ if (self.$parent.$children[0].selecteds) {
249
+ console.log('1111111', self.$parent.$children[0].selecteds)
250
+ if (self.$parent.$children[0].selectedRows === 0) {
251
+ console.log('22222222', self.$parent.$children[0].selectedRows)
261
252
  self.billData.url = 'rs/report/pre_sell'
262
- self.data.handid = ''
263
253
  }
264
- self.data.id = res.data
265
- self.print = true
254
+ // 获取选中的handplan的id
255
+ self.data.handid = ''
256
+ self.$parent.$children[0].selecteds.forEach((row, index) => {
257
+ self.data.handid = self.data.handid + "','" + row.handplan_id
258
+ })
259
+ } else {
260
+ console.log('3333333')
261
+ self.billData.url = 'rs/report/pre_sell'
262
+ self.data.handid = ''
266
263
  }
267
- } else if (self.data.f_print[0] === '国税发票') {
268
- // TODO
269
- } else if (self.printInvoiceType.indexOf(self.data.f_print[0]) !== -1) {
264
+ self.data.id = res.data
265
+ self.print = true
266
+ }
267
+ // }
268
+ if (self.printInvoiceType.indexOf(self.data.f_print[0]) !== -1) {
270
269
  self.eticket_show = true
271
270
  self.row.f_print = self.data.f_print[0]
272
- await self.$refs.eticketbill.openETicket(res.data, self.row, '机表收费')
271
+ await self.$refs.eticketbill.openETicket(res.data, self.row, '机表收费', self.row.f_print, false, self.row.invoice_is_pax)
273
272
  // await self.$CommonService.openEticket(res.data, '售气收费')
274
273
  // 如果不欠费就用下边的预存收据
275
274
  // if (self.$parent.$children[0].selecteds) {
@@ -588,7 +587,8 @@ let asyncMachineMeterCenter = async function (self) {
588
587
  },
589
588
  eticket_toggle () {
590
589
  this.eticket_show = false
591
- this.$dispatch('success')
590
+ this.eticket_msg = false
591
+ // this.$dispatch('success')
592
592
  },
593
593
  // 优惠计算
594
594
  async privilegeCalculate () {
@@ -0,0 +1,528 @@
1
+ <template>
2
+ <div class="flex-row">
3
+ <div class="span" style="overflow-y: auto;">
4
+ <validator name='v'>
5
+ <form novalidate class="form-horizontal">
6
+ <div class="row">
7
+ <div class="col-sm-4">
8
+ <label for="f_paytype" class=" font_normal_body" title="参数名称:付款方式">收款方式</label>
9
+ <v-select id="f_payment"
10
+ v-model="f_payment"
11
+ placeholder='请选择'
12
+ :value.sync="model.f_payment"
13
+ :options='paytype'
14
+ close-on-select clear-button></v-select>
15
+ </div>
16
+ <div class="col-sm-4"
17
+ :class="[$v.f_pregas.required || $v.f_pregas.dctest? 'has-error' : 'has-success']">
18
+ <label for="f_pregas" class=" font_normal_body">预购气量</label>
19
+ <input class="input_search" style="width:60%" type="number"
20
+ @blur="pregas()" v-model="model.f_pregas" id="fpregas"
21
+ v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
22
+ v-next-el='sk'>
23
+ </div>
24
+ <div class="col-sm-4">
25
+ <label for="f_preamount" class=" font_normal_body">预购金额</label>
26
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
27
+ v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
28
+ v-scale="[model.f_preamount, 4]" placeholder="预购金额" disabled>
29
+ </div>
30
+ </div>
31
+ <div class="row" style="margin-top:6px;">
32
+
33
+ <div class="col-sm-4">
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></v-select>
42
+ </div>
43
+ <div class="col-sm-4" v-if="hasLimit&&limitgas">
44
+ <label class="font_normal_body">购气上限</label>
45
+ <input class="input_search" style="width:60%" type="number" v-model="maxgas"
46
+ v-scale="[maxgas, 2]" placeholder='限购余气' disabled>
47
+ </div>
48
+ <div class="col-sm-4 form-group" v-if="hasLimit&&limitmoney">
49
+ <label class="font_normal_body">金额上限</label>
50
+ <input class="input_search" style="width:60%" type="number" v-model="maxmoney"
51
+ v-scale="[maxmoney, 2]" placeholder='限购金额' disabled>
52
+ </div>
53
+ <div class="col-sm-4" v-if="!hasLimit">
54
+ </div>
55
+
56
+ <div class="col-sm-4"
57
+ :class="[$v.f_totalcost.required || $v.f_totalcost.dctest ? 'has-error' : 'has-success']">
58
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按气量'"
59
+ class=" font_normal_body">应收金额</label>
60
+ <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
61
+ class=" font_normal_body">本次缴费</label>
62
+ <input class="input_search" style="width:60%" type="number"
63
+ @blur="preamount()" v-model="model.f_totalcost"
64
+ v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
65
+ v-next-el='sk' v-scale="[model.f_totalcost, 4]">
66
+ </div>
67
+ </div>
68
+ <div class="row">
69
+ <div class="col-sm-4">
70
+ <label for="f_balance" class="font_normal_body">上期结余</label>
71
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_balance"
72
+ v-scale="[model.f_balance, 4]" placeholder="上期结余" disabled>
73
+ </div>
74
+ <div class="col-sm-4">
75
+ <label for="f_curbalance" class="font_normal_body">本期结余</label>
76
+ <input class="input_search" style="width:60%" type="number" v-model="curbalance"
77
+ v-scale="[model.f_curbalance, 4]" placeholder="本期结余" disabled>
78
+ </div>
79
+
80
+ <div class="col-sm-4" v-if="row.f_collection_type === '按气量'"
81
+ :class="[$v.f_collection.required ? 'has-error' : 'has-success']">
82
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
83
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
84
+ v-validate:f_collection='{required: true, dctest: [model.f_totalcost, ">=" ] }'
85
+ v-el:sk v-scale="[model.f_totalcost, 2]">
86
+ </div>
87
+ <div class="col-sm-4" v-if="row.f_collection_type === '按金额'">
88
+ <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
89
+ <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
90
+ v-el:sk v-scale="[model.f_collection, 4]" disabled>
91
+ </div>
92
+ </div>
93
+ <div class="row" style="margin-top:5px;">
94
+ <div class="col-sm-4" v-if="!mjshow">
95
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
96
+ <input class="input_search" style="width:60%" type="text"
97
+ v-model="model.f_serial_number" placeholder="业务单号">
98
+ </div>
99
+ <div class="col-sm-4" v-if="mjshow"
100
+ :class="[$v.f_serial_number.required || $v.f_serial_number.dctest ? 'has-error' : 'has-success']">
101
+ <label for="f_serial_number" class=" font_normal_body">业务单号</label>
102
+ <input class="input_search" style="width:60%" type="text" v-validate:f_serial_number='{required: true }'
103
+ v-model="model.f_serial_number" placeholder="业务单号">
104
+ </div>
105
+ <div class="col-sm-4">
106
+ <label for="f_write_card" style="color: red" class=" font_normal_body">是否写卡</label>
107
+ <v-select id="f_write_card"
108
+ v-model="model.f_write_card"
109
+ placeholder='是否写卡'
110
+ value-single
111
+ :value.sync="model.f_write_card"
112
+ :options='writecard'
113
+ close-on-select clear-button></v-select>
114
+ </div>
115
+ </div>
116
+ <div class="row" style="margin-top:5px;">
117
+ <div class="col-sm-9">
118
+ </div>
119
+ <div class="col-sm-3">
120
+ <span v-if="$v.f_collection.dctest" style="color:red ">收款不能小于应收金额</span>
121
+ </div>
122
+ </div>
123
+ <div class="row" v-if="model.f_payment[0].includes('POS')">
124
+ <div class="col-sm-4">
125
+ <label for="f_voucher_number" class="font_normal_body">凭证号</label>
126
+ <input type="text" class="input_search" style="width:60%" v-model="model.f_voucher_number"
127
+ placeholder="凭证号">
128
+ </div>
129
+ </div>
130
+ <div class="row" v-if="!config.notShowFormula">
131
+ <div class="col-sm-4 col-sm-offset-8">
132
+ <strong>计算公式:{{ calculatedetail ? calculatedetail : ' 暂无' }}</strong>
133
+ </div>
134
+ </div>
135
+ <div class="row">
136
+ <div class="col-sm-5" v-if="row.f_collection_type === '按气量'">
137
+ <strong style="color:blue">温馨提示: 此气表品牌是按气量收费!!</strong>
138
+ </div>
139
+ <div class="col-sm-4" v-if="row.f_collection_type === '按金额'">
140
+ <strong style="color:blue">温馨提示: 此气表品牌是按金额收费!!</strong>
141
+ </div>
142
+ </div>
143
+ </form>
144
+ <print-bill :show="print" :bill-config='config' v-ref:printbill :bill-data='billData' :data='row'
145
+ v-on:toggle="close" @printok="printok"></print-bill>
146
+ <div style="text-align:right;height: 25%;">
147
+ <payment-code-button :clickable="!$v.valid || clickConfirm"
148
+ :payment.sync="model.f_payment" :payment-data="paytype"
149
+ @confirm-payment="confirm()">
150
+ </payment-code-button>
151
+ <button class="button_search btn-gn" @click="checkInvoiceMsg()" :disabled='!$v.valid || clickConfirm'>确认</button>
152
+ <button class="button_clear btn-gn" @click="clean()">取消</button>
153
+ </div>
154
+ </validator>
155
+ <payment-code v-ref:paymentcode :payment="model.f_payment" :row="row" :money="model.f_collection"></payment-code>
156
+ <eticket-modal :show="eticket_msg" @closemodalshow="eticket_msg = false" :row="row"
157
+ @confirm="confirm"></eticket-modal>
158
+ <ticket-print :show="eticket_show" @toggle="eticket_toggle" v-ref:eticketbill></ticket-print>
159
+ <upload :blodid="row.f_userinfo_id" v-if="config.showupload" :businessid="randomBusinessId" isremark="true"
160
+ fusetype="无卡收费"></upload>
161
+ </div>
162
+ </div>
163
+ </template>
164
+ <script>
165
+ /**
166
+ *综合业务
167
+ *卡表收费组件
168
+ */
169
+
170
+ // 输入金额,换算气量
171
+ let preamountGen = async function (self) {
172
+ let dymoney = 0
173
+ let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
174
+ let getGas = await self.$CommonService.feeCalculate(self.model, calFee)
175
+ if (getGas.data.gas) {
176
+ if (self.row.f_isdecimal === '是') {
177
+ if (self.row.f_alias === 'QiaoSong') {
178
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(1)
179
+ } else {
180
+ self.model.f_pregas = (getGas.data.gas - 0).toFixed(4)
181
+ }
182
+ } else {
183
+ let tempnum = Math.floor(getGas.data.gas - 0)
184
+ let dymoney1 = await self.$CommonService.gasCalculate(self.model, (tempnum).toFixed(4))
185
+ dymoney = (getGas.data.chargenum - 0).toFixed(2) - (dymoney1.data.chargenum - 0).toFixed(2)
186
+ self.model.f_pregas = Math.floor(getGas.data.gas - 0)
187
+ }
188
+ }
189
+ self.model.f_preamount = calFee - (dymoney - 0)
190
+ self.model.chargeprice = getGas.data.chargeprice
191
+ Object.assign(self.model, self.model, getGas.data)
192
+ self.model.f_totalcost = ((self.model.f_totalcost - 0) - (dymoney - 0)).toFixed(4)
193
+ // self.model.f_totalcost=Math.ceil(self.model.f_totalcost)
194
+ if (self.config.floor) {
195
+ self.model.f_totalcost = Math.ceil(self.model.f_totalcost)
196
+ }
197
+ self.calText(getGas.data.chargeprice)
198
+ }
199
+
200
+ // 输入气量,换算金额
201
+ let pregasGen = async function (self) {
202
+ if (self.row.f_isdecimal === '是') {
203
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(4)
204
+ } else {
205
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
206
+ }
207
+ if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
208
+ self.model.f_meter_type = self.row.f_meter_type
209
+ let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
210
+ self.model.f_preamount = getAmount.data.chargenum
211
+ self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(4))
212
+ Object.assign(self.model, self.model, getAmount.data)
213
+ self.model.chargeprice = getAmount.data.chargeprice
214
+ self.model.f_collection = self.model.f_totalcost
215
+ if (self.config.floor) {
216
+ self.model.f_collection = Math.ceil(self.model.f_collection)
217
+ }
218
+ self.calText(getAmount.data.chargeprice)
219
+ }
220
+ }
221
+
222
+ // 执行保存逻辑
223
+ let sellgasGen = async function (self) {
224
+ try {
225
+ self.model.f_write_money = self.model.f_preamount
226
+ if (self.row.f_price_type === '阶梯气价' && self.row.f_is_step === '否') {
227
+ self.model.f_write_money = (self.model.f_pregas * self.model.chargeprice[0].f_price)
228
+ self.model.f_write_money = self.model.f_write_money.toFixed(2)
229
+ }
230
+ // 加入扫码盒付款码支付流水号
231
+ self.model.f_serial_id = self.$refs.paymentcode.paymentCodeReturnData.f_out_trade_no
232
+
233
+ let res = await self.$CardService.noCardSellGas(self.model, self.row, self.cardallot)
234
+ console.log('卡表收费返回id', res, self.model)
235
+ if (self.config.showupload) {
236
+ let param = []
237
+ for (let row of self.resid) {
238
+ param.push({id: row.id})
239
+ }
240
+ let data = {
241
+ param: param,
242
+ f_blobid: res
243
+ }
244
+ await self.$resetpost('rs/logic/updatefiles', data)
245
+ }
246
+ // 开始打票
247
+ if (self.config.hasPrint) {
248
+ if (self.config.hasBillManage) {
249
+ // 启用发票管理,获取票据管理中的票号并存储记录
250
+ self.row.id = res
251
+ self.row.f_bill_type = '卡表收费'
252
+ self.row.f_bill_style = self.model.f_print[0]
253
+ self.row.f_preamount = self.model.f_preamount
254
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
255
+ self.row.f_collection = self.model.f_collection
256
+ self.print = true
257
+ } else {
258
+ self.row.id = res
259
+ self.row.f_url = 'http://192.168.50.77:31039/report/jmreport/shareView/787097260170534912'
260
+ self.print = true
261
+ }
262
+ console.log('发票类型:', self.model.f_print[0])
263
+ if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
264
+ self.eticket_show = true
265
+ self.row.f_print = self.model.f_print[0]
266
+ await self.$refs.eticketbill.openETicket(self.row.id, self.row, '售气收费', self.row.f_print, false, self.row.invoice_is_pax)
267
+ self.row.id = res
268
+ self.print = true
269
+ }
270
+ } else {
271
+ self.$dispatch('success')
272
+ }
273
+ self.clickConfirm = false
274
+ } catch (error) {
275
+ self.$showAlert(error, 'danger', 0)
276
+ self.$dispatch('refresh')
277
+ self.clickConfirm = false
278
+ }
279
+ }
280
+
281
+ let asyncCardMeterCenter = async function (self) {
282
+ await self.$getConfig(self, 'CardMeterCenter')
283
+ console.log('卡表收费config', self.config)
284
+ // 默认打印格式
285
+ self.model.f_print = self.config.printType instanceof Array ? self.config.printType : [self.config.printType]
286
+ self.model.f_payment = [self.config.payment]
287
+ self.mulPrint = self.config.printType instanceof Array
288
+ // 判断限购
289
+ let limit_param = {
290
+ f_userinfo_id: self.row.f_userinfo_id,
291
+ f_user_id: self.row.f_user_id,
292
+ f_stairprice_id: self.row.f_stairprice_id
293
+ }
294
+ let getLimit = await self.$resetpost('rs/logic/sale_getLimitGas', {data: limit_param}, {
295
+ resolveMsg: null,
296
+ rejectMsg: '获取限购值失败!!'
297
+ })
298
+ console.log('获取限购值', getLimit)
299
+ self.hasLimit = getLimit.data.hasLimit
300
+ if (self.hasLimit) {
301
+ if (getLimit.data.f_limit_value || getLimit.data.f_limit_amount) {
302
+ if (getLimit.data.f_limit_value < 0 && getLimit.data.f_limit_amount < 0) {
303
+ self.$showAlert(`${getLimit.data.msg}`, 'warning', 3000)
304
+ self.$dispatch('refresh')
305
+ } else {
306
+ if (getLimit.data.f_limit_value) {
307
+ self.maxgas = (getLimit.data.f_limit_value - 0)
308
+ self.limitgas = true
309
+ }
310
+ if (getLimit.data.f_limit_amount) {
311
+ self.maxmoney = (getLimit.data.f_limit_amount - 0)
312
+ self.limitmoney = true
313
+ }
314
+ }
315
+ }
316
+ }
317
+ }
318
+ export default {
319
+ title: '无卡收费',
320
+ data () {
321
+ return {
322
+ serialShow: false,
323
+ resid: [], // 存放新增的f_files表中id
324
+ config: {
325
+ notShowFormula: false, // 不显示计算公式,默认显示
326
+ hasPrint: true, // 默认打票
327
+ hasBillManage: false, // 默认不启用发票管理
328
+ floor: false, // 是否取整收费
329
+ billType: '燃气费', // 票据类型(燃气费,其他费用,调用的发票代码不同)
330
+ printType: '普通收据', // 收据/电子票/专用发票/国税发票
331
+ showupload: true,
332
+ payment: '现金缴费'
333
+ },
334
+ model: {
335
+ f_purchase: 0,
336
+ f_write_card: '不写卡',
337
+ f_payment: '',
338
+ f_pregas: '',
339
+ f_preamount: 0,
340
+ f_totalcost: 0,
341
+ f_curbalance: 0,
342
+ f_collection: '',
343
+ f_balance: 0,
344
+ f_print: [],
345
+ f_meter_type: '',
346
+ f_voucher_number: ''
347
+ },
348
+ calculatedetail: '',
349
+ print: false,
350
+ billData: {
351
+ url: 'rs/report/card_bill',
352
+ billnumber: ''
353
+ },
354
+ randomBusinessId: '',
355
+ hasLimit: false,
356
+ maxgas: 99999999, // 限购
357
+ maxmoney: 99999999,
358
+ limitmoney: false,
359
+ limitgas: false,
360
+ mulPrint: false,
361
+ clickConfirm: false, // 控制确认按钮只能点击一次
362
+ // 下拉框值
363
+ paytype: this.$appdata.getParam('付款方式'),
364
+ printstyle: this.$appdata.getParam('打印格式'),
365
+ writecard: [{label: '写卡', value: '写卡'}, {label: '不写卡', value: '不写卡'}],
366
+ mjshow: false,
367
+ eticket_msg: false,
368
+ eticket_show: false,
369
+ invoice_is_pax: '不征税',
370
+ is_pax: [{label: '征税', value: '征税'}, {label: '不征税', value: '不征税'}],
371
+ printInvoiceType: this.$appdata.getSingleValue('电子票打印类型') ? this.$appdata.getSingleValue('电子票打印类型') : '数电普票',
372
+ }
373
+ },
374
+ props: ['row'],
375
+ ready () {
376
+ // this.getPurchase()
377
+ this.model.f_price_id = this.row.f_price_id
378
+ this.model.f_user_id = this.row.f_user_id
379
+ this.model.f_userfiles_id = this.row.f_userfiles_id
380
+ this.model.f_userinfo_id = this.row.f_userinfo_id
381
+ this.model.f_balance = this.row.f_alias === 'QiaoSong' ? Math.trunc(this.row.f_balance) : this.row.f_balance
382
+ if (this.row.f_collection_type === '按金额') {
383
+ this.model.f_totalcost = ''
384
+ this.model.f_pregas = 0
385
+ }
386
+ document.getElementById('fpregas').focus()
387
+ asyncCardMeterCenter(this)
388
+ this.getRandomId()
389
+ },
390
+ events: {
391
+ // 删除Resid数组元素
392
+ 'delResid' (val) {
393
+ this.resid.$remove({id: val, f_biobid: ''})
394
+ // this.resid.splice(this.resid.indexOf({id:val,f_biobid:''}),1);
395
+ },
396
+ // 增加Resid数组元素
397
+ 'resid' (val) {
398
+ this.resid.push({id: val, f_biobid: ''})
399
+ }
400
+ },
401
+ methods: {
402
+ getRandomId () {
403
+ this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
404
+ let res = Math.random() * 16 | 0
405
+ let v = c === 'x' ? res : (res & 0x3 | 0x8)
406
+ return v.toString(16)
407
+ })
408
+ },
409
+ eticket_toggle () {
410
+ this.eticket_show = false
411
+ this.eticket_msg = false
412
+ // this.$dispatch('success', '售气收费')
413
+ },
414
+ checkInvoiceMsg (flag) {
415
+ if (flag) return
416
+ if (this.printInvoiceType.indexOf(this.model.f_print[0]) !== -1) {
417
+ if (!this.row.f_taxpayer_id && this.config.taxforidnumber) {
418
+ this.row.f_taxpayer_id = this.row.f_idnumber
419
+ }
420
+ if (!this.row.f_paper_name) {
421
+ this.row.f_paper_name = this.row.f_user_name
422
+ }
423
+ if (!this.row.f_address_phone) {
424
+ this.row.f_address_phone = this.row.f_address + ' ' + this.row.f_user_phone
425
+ }
426
+ this.eticket_msg = true
427
+ } else {
428
+ this.confirm()
429
+ }
430
+ },
431
+ confirm () {
432
+ this.$showMessage(`对客户${this.row.f_user_name}进行收费。该操作只做收费,不做写卡,确定要进行该操作吗?`, ['confirm', 'cancel']).then(async (res) => {
433
+ if (res === 'confirm') {
434
+ let ss = await this.$refs.paymentcode.flowPath()
435
+ this.$refs.paymentcode.paymentCodeShow = false
436
+ console.log('付款码操作返回', ss)
437
+ if (!ss.result) return
438
+ this.clickConfirm = true
439
+ this.model.f_curbalance = this.curbalance
440
+ this.$dispatch('no-button')
441
+ sellgasGen(this)
442
+ }
443
+ })
444
+ },
445
+ clean () {
446
+ this.$info('取消操作')
447
+ this.$dispatch('refresh', this.row)
448
+ },
449
+ printok () {
450
+ // 收据打完,判断是否还有其他票据进行请求
451
+ for (let i = 0; i < this.model.f_print.length; i++) {
452
+ if (this.model.f_print[i] === '电子发票') {
453
+ // this.$CommonService.openEticket(this.row.id, '售气收费')
454
+ console.log('这里不打发票,换到新的了')
455
+ }
456
+ }
457
+ this.$dispatch('success')
458
+ },
459
+ pregas () {
460
+ if (this.model.f_pregas && this.model.f_pregas > 0) {
461
+ try {
462
+ // 对气量进行验证
463
+ if ((this.row.f_topup_ceil - 0) > 0 && (this.model.f_pregas - 0) > (this.row.f_topup_ceil - 0)) {
464
+ this.$showAlert(`您输入的气量不能大于该表的充值上限: ${this.row.f_topup_ceil}`, 'warning', 5000)
465
+ this.model.f_pregas = null
466
+ } else {
467
+ pregasGen(this)
468
+ }
469
+ } catch (error) {
470
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
471
+ this.$dispatch('error', '发卡售气', this.model, error)
472
+ }
473
+ }
474
+ },
475
+ preamount () {
476
+ if ((this.model.f_totalcost && this.model.f_totalcost > 0) || this.row.f_balance > 0) {
477
+ try {
478
+ preamountGen(this)
479
+ } catch (error) {
480
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
481
+ this.$dispatch('error', '发卡售气', this.model, error)
482
+ }
483
+ }
484
+ },
485
+ calText (val) {
486
+ let str = ''
487
+ val.forEach((item) => {
488
+ str = str + item.f_price + ' x ' + item.f_gas + '+'
489
+ })
490
+ str = str.slice(0, str.length - 1)
491
+ this.calculatedetail = str
492
+ },
493
+ close () {
494
+ this.print = false
495
+ this.clean()
496
+ }
497
+ },
498
+ watch: {
499
+ 'model.f_payment' (val) {
500
+ if (val == '免交') {
501
+ this.mjshow = true
502
+ } else {
503
+ this.mjshow = false
504
+ }
505
+ }
506
+ },
507
+ computed: {
508
+ 'curbalance' () {
509
+ if (this.model.f_preamount) {
510
+ if (this.row.f_collection_type === '按金额') {
511
+ return ((this.model.f_totalcost - 0) + (this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
512
+ } else {
513
+ if ((this.row.f_balance - 0) > (this.model.f_preamount - 0)) {
514
+ return ((this.row.f_balance - 0) - (this.model.f_preamount - 0)).toFixed(4)
515
+ } else {
516
+ return ((this.model.f_collection - 0) - (this.model.f_totalcost - 0)).toFixed(4)
517
+ }
518
+ }
519
+ } else {
520
+ return 0
521
+ }
522
+ }
523
+ }
524
+ }
525
+ </script>
526
+
527
+ <style>
528
+ </style>
@@ -252,24 +252,22 @@ let otherChargeGen = async function (self, parameter) {
252
252
  localeSustainMoney = (localeSustainMoney - 0) + (self.model.f_collection - 0)
253
253
  window.localStorage.setItem('sustainMoney', localeSustainMoney)
254
254
  }
255
+ console.warn('电子票打印类型:', self.printInvoiceType)
255
256
  if (self.config.hasPrint && !self.$login.r.includes('不打印发票')) {
256
- if (self.printInvoiceType.indexOf(self.model.f_print) === -1) {
257
- if (self.config.hasBillManage) {
258
- self.row.id = resid.data
259
- self.row.f_bill_type = '其他收费'
260
- self.row.f_bill_style = self.model.f_print[0]
261
- self.print = true
262
- } else {
263
- self.row.id = resid.data
264
- self.print = true
265
- }
266
- } else if (self.model.f_print[0] === '国税发票') {
267
- // TODO
268
- self.$dispatch('success')
269
- } else if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
257
+ // if (self.printInvoiceType.indexOf(self.model.f_print) === -1) {
258
+ if (self.config.hasBillManage) {
259
+ self.row.id = resid.dataeticket_toggle
260
+ self.row.f_bill_type = '其他收费'
261
+ self.row.f_bill_style = self.model.f_print[0]
262
+ self.print = true
263
+ } else {
264
+ self.row.id = resid.data
265
+ self.print = true
266
+ }
267
+ if (self.printInvoiceType.indexOf(self.model.f_print[0]) !== -1) {
270
268
  self.eticket_show = true
271
269
  self.row.f_print = self.model.f_print[0]
272
- await self.$refs.eticketbill.openETicket(resid.data, self.row, '其他收费', '其他收费', '其他收费', self.model.f_print[0])
270
+ await self.$refs.eticketbill.openETicket(resid.data, self.row, '其他收费', self.row.f_print, false, self.row.invoice_is_pax)
273
271
  }
274
272
  } else {
275
273
  self.$dispatch('success')
@@ -480,6 +478,7 @@ export default {
480
478
  },
481
479
  // 校验发票信息
482
480
  checkInvoiceMsg () {
481
+ console.log('检验发票信息', this.printInvoiceType, this.model.f_print[0])
483
482
  if (this.printInvoiceType.indexOf(this.model.f_print[0]) !== -1) {
484
483
  if (!this.row.f_taxpayer_id) {
485
484
  this.row.f_taxpayer_id = this.row.f_idnumber
@@ -500,7 +499,8 @@ export default {
500
499
  },
501
500
  eticket_toggle () {
502
501
  this.eticket_show = false
503
- this.$dispatch('success')
502
+ this.eticket_msg = false
503
+ // this.$dispatch('success')
504
504
  },
505
505
  async setTypename (val, index) {
506
506
  this.model.otherdetail[index].f_typenumber = ''
@@ -23,6 +23,8 @@ export default function () {
23
23
  Vue.component('file-meter-info', (resolve) => { require(['./MeterinfoTest'], resolve) })
24
24
  // 机表收费
25
25
  Vue.component('machine-meter-center', (resolve) => { require(['./MachineMeterCenter'], resolve) })
26
+ // 无卡收费
27
+ Vue.component('no-card-meter-center', (resolve) => { require(['./NoCardMeterCenter'], resolve) })
26
28
  // 卡表收费
27
29
  Vue.component('card-meter-center', (resolve) => {
28
30
  require(['./CardMeterCenter'], resolve)