sale-client 3.6.126 → 3.6.127

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.
@@ -1,5 +1,5 @@
1
1
  var path = require('path')
2
- const [serverRul, localUrl ] = ['http://192.168.50.4:8400/', 'http://127.0.0.1:8080/']
2
+ const [serverRul, localUrl ] = ['http://192.168.50.4:8400/', 'http://192.168.50.4:8400/']
3
3
  var merge = require('webpack-merge')
4
4
  var baseConfig = require('./webpack.dev.conf')
5
5
  var devConfig = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "3.6.126",
3
+ "version": "3.6.127",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -24,6 +24,7 @@
24
24
  <label for="f_pregas" class=" font_normal_body">预购气量</label>
25
25
  <input class="input_search" style="width:60%" type="number" id="pregasFocue"
26
26
  @blur="pregas()" v-model="model.f_pregas"
27
+ :disabled="config.calculatePreByCollection"
27
28
  v-validate:f_pregas='{required: true, dctest: [maxgas, "<=" ]}' placeholder="预购气量"
28
29
  v-next-el='sk' >
29
30
  </div>
@@ -37,6 +38,7 @@
37
38
  <label for="f_preamount" class=" font_normal_body">预购金额</label>
38
39
  <input class="input_search" style="width:60%" @blur="preamount()" type="number" v-model="model.f_preamount"
39
40
  v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
41
+ :disabled="config.calculatePreByCollection"
40
42
  v-scale="[model.f_preamount, row.f_fee_decimal||4]" placeholder="预购金额" >
41
43
  </div>
42
44
  </div>
@@ -107,7 +109,8 @@
107
109
  <div class="col-sm-3 form-group">
108
110
  <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
109
111
  <input id="f_collection" class="input_search" style="width:60%" type="number" v-model="model.f_collection"
110
- v-el:sk v-scale="[model.f_collection, row.f_fee_decimal||4]" disabled>
112
+ @blur="config.calculatePreByCollection && calculatePreByCollection()"
113
+ v-el:sk v-scale="[model.f_collection, row.f_fee_decimal||4]" :disabled="!config.calculatePreByCollection">
111
114
  </div>
112
115
  <div class="col-sm-1 form-group">
113
116
  <give-change :curbalance="curbalance" :collection.sync="model.f_collection" v-ref:givechange></give-change>
@@ -474,7 +477,8 @@
474
477
  printType: '普通收据', // 收据/电子票/专用发票/国税发票
475
478
  payment: '',
476
479
  hasArrearsChange: false, // 是否可以有欠费换表 收费时用来判断是否查询旧表欠费
477
- overdraftBalance: false // 是否支持系统余额透支
480
+ overdraftBalance: false, // 是否支持系统余额透支
481
+ calculatePreByCollection: false // 可以更具收款来反向计算预购
478
482
  },
479
483
  model: {
480
484
  f_purchase: 0,
@@ -612,6 +616,31 @@
612
616
  }
613
617
  },
614
618
  methods: {
619
+ // 根据收款金额计算划价信息
620
+ // 需要配置 calculatePreByCollection = true
621
+ async calculatePreByCollection () {
622
+ if (this.alldue_fee > this.model.f_collection) {
623
+ this.$showAlert('收款不能小于旧表机表欠费,请重新输入', 'danger', 5000)
624
+ this.model.f_collection = undefined
625
+ return
626
+ }
627
+ try {
628
+ this.model.f_collection = (this.model.f_collection - 0)
629
+ let calFee = ((this.model.f_collection - 0) + (this.row.f_balance) - (this.alldue_fee)).toFixed(4)
630
+ // 通过收款进行划价
631
+ let getGas = await this.$CommonService.feeCalculate(this.model, calFee)
632
+ this.model.f_pregas = parseInt(getGas.data.gas)
633
+ let dymoney2 = await this.$CommonService.gasCalculate(this.model, this.model.f_pregas)
634
+ this.model.chargeprice = dymoney2.data.chargeprice
635
+ Object.assign(this.model, this.model, dymoney2.data)
636
+ this.model.f_totalcost = dymoney2.data.chargenum
637
+ this.model.f_preamount = dymoney2.data.chargenum
638
+ this.calText(dymoney2.data.chargeprice)
639
+ } catch (error) {
640
+ this.$showAlert(`发卡售气划价错误,错误类型:${error}`, 'danger', 0)
641
+ this.$dispatch('error', '发卡售气', this.model, error)
642
+ }
643
+ },
615
644
  getRandomId () {
616
645
  this.randomBusinessId = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
617
646
  let res = Math.random() * 16 | 0