sale-client 4.1.6 → 4.1.7

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.
File without changes
@@ -0,0 +1,2 @@
1
+ #Wed Apr 02 14:48:19 CST 2025
2
+ gradle.version=5.2.1
File without changes
@@ -19,6 +19,12 @@ var devConfig = {
19
19
  children: false // 不输出子模块构建信息
20
20
  },
21
21
  proxy: {
22
+ '/api/af-revenue/report': {
23
+ pathRewrite: {
24
+ '/api/af-revenue/report': '/report'
25
+ },
26
+ target: localUrl
27
+ },
22
28
  '/api/af-revenue/batchdeduction/all': {
23
29
  pathRewrite: {
24
30
  '/api/af-revenue/batchdeduction/all': '/batchdeduction/all'
@@ -31,10 +37,10 @@ var devConfig = {
31
37
  },
32
38
  target: localUrl
33
39
  },
34
- '/api/af-revenue/file': {
35
- // pathRewrite: {
36
- // '/api/af-revenue/file': '/file'
37
- // },
40
+ '/api/af-revenue/downloadfile/file': {
41
+ pathRewrite: {
42
+ '/api/af-revenue/downloadfile/file': 'downloadfile/file'
43
+ },
38
44
  target: localUrl
39
45
  },
40
46
  '/weixin2/rs':{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sale-client",
3
- "version": "4.1.6",
3
+ "version": "4.1.7",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -32,7 +32,7 @@
32
32
  "less-loader": "^2.2.3",
33
33
  "system-clients": "3.3.2",
34
34
  "ldap-clients": "3.0.96",
35
- "address-client": "4.0.1-yunChengV4",
35
+ "address-client": "4.0.11",
36
36
  "manage-client": "3.1.8-88",
37
37
  "axios": "0.15.3",
38
38
  "babel-core": "^6.0.0",
@@ -244,10 +244,10 @@
244
244
  let gas = self.model.f_pregas - self.model.f_fill_gas
245
245
  let getAmount = await self.$CommonService.gasCalculate(self.model, gas)
246
246
  console.log('划价返回', getAmount, self.openFee, self.row.f_balance)
247
- self.model.f_preamount = getAmount.data.chargenum
247
+ self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(self.getDecimalPlaces)
248
248
  // 计算气费和其他费用(暂时只有开卡费,之后有其他费在加)
249
249
  let total = (getAmount.data.chargenum - 0) + (self.openFee - 0)
250
- self.model.f_totalcost = (self.row.f_balance - 0) > (total - 0) ? 0 : ((total - 0) - (self.row.f_balance - 0)).toFixed(4)
250
+ self.model.f_totalcost = (self.row.f_balance - 0) > (total - 0) ? 0 : ((total - 0) - (self.row.f_balance - 0)).toFixed(self.getDecimalPlaces)
251
251
  Object.assign(self.model, self.model, getAmount.data)
252
252
  self.model.chargeprice = getAmount.data.chargeprice
253
253
  self.model.f_collection = self.model.f_totalcost
@@ -433,6 +433,13 @@
433
433
 
434
434
  props: ['row'],
435
435
  async ready () {
436
+ // 重写 toFixed 方法,实现四舍五入
437
+ Number.prototype.toFixed = function(digits) {
438
+ const num = this
439
+ const multiplier = Math.pow(10, digits)
440
+ const rounded = Math.round(num * multiplier) / multiplier
441
+ return rounded.toString()
442
+ }
436
443
  this.blodid = this.row.f_userinfo_id
437
444
  this.model.f_price_id = this.row.f_price_id
438
445
  this.model.f_user_id = this.row.f_user_id
@@ -536,7 +543,19 @@
536
543
  this.model.f_pregasBuy = 0
537
544
  return
538
545
  }
539
- this.model.f_pregas = (this.model.f_fill_gas - 0 + (this.model.f_pregasBuy - 0)).toFixed(4) - 0
546
+ // 根据f_meter_brand保留对应的小数位数
547
+ if (this.row.f_isdecimal === '是') {
548
+ if (this.row.f_meter_brand === '秦川卡表') {
549
+ this.model.f_pregasBuy = (this.model.f_pregasBuy - 0).toFixed(2)
550
+ } else if (this.row.f_meter_brand === '重庆精益民用') {
551
+ this.model.f_pregasBuy = (this.model.f_pregasBuy - 0).toFixed(1)
552
+ } else {
553
+ this.model.f_pregasBuy = (this.model.f_pregasBuy - 0).toFixed(4)
554
+ }
555
+ } else {
556
+ this.model.f_pregasBuy = parseInt(this.model.f_pregasBuy - 0)
557
+ }
558
+ this.model.f_pregas = (this.model.f_fill_gas - 0 + (this.model.f_pregasBuy - 0)).toFixed(this.getDecimalPlaces) - 0
540
559
  this.pregas()
541
560
  },
542
561
  pregas () {
@@ -303,7 +303,14 @@
303
303
  // 输入气量,换算金额
304
304
  let pregasGen = async function (self) {
305
305
  if (self.row.f_isdecimal === '是') {
306
- self.model.f_pregas = (self.model.f_pregas - 0).toFixed(self.row.f_gas_decimal || 4)
306
+ // 根据表具品牌判断小数位数
307
+ if (self.row.f_meter_brand === '秦川卡表') {
308
+ self.model.f_pregas = Math.floor(self.model.f_pregas * 100) / 100
309
+ } else if (self.row.f_meter_brand === '重庆精益民用') {
310
+ self.model.f_pregas = Math.floor(self.model.f_pregas * 10) / 10
311
+ } else {
312
+ self.model.f_pregas = (self.model.f_pregas - 0).toFixed(self.row.f_gas_decimal || 4)
313
+ }
307
314
  } else {
308
315
  self.model.f_pregas = (self.model.f_pregas - 0).toFixed(0)
309
316
  }
@@ -315,8 +322,15 @@
315
322
  if (self.row.f_project_money && self.row.f_project_money > 0) {
316
323
  self.model.getDeduct = (self.$CommonService.getDeduct(self.row, self.model.f_pregas) - 0)
317
324
  }
318
- self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(self.row.f_fee_decimal || 4)
319
- self.model.f_totalcost = ((self.row.f_balance - 0) > ((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) ? 0 : (((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) - (self.row.f_balance - 0)).toFixed(self.row.f_fee_decimal || 4))
325
+ // 根据表具品牌判断金额小数位数
326
+ let feeDecimal = 4
327
+ if (self.row.f_meter_brand === '秦川卡表') {
328
+ feeDecimal = 2
329
+ } else if (self.row.f_meter_brand === '重庆精益民用') {
330
+ feeDecimal = 1
331
+ }
332
+ self.model.f_preamount = (getAmount.data.chargenum - 0).toFixed(feeDecimal)
333
+ self.model.f_totalcost = ((self.row.f_balance - 0) > ((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) ? 0 : (((getAmount.data.chargenum - 0) + self.model.getDeduct - 0) - (self.row.f_balance - 0)).toFixed(feeDecimal))
320
334
  Object.assign(self.model, self.model, getAmount.data)
321
335
  self.model.chargeprice = getAmount.data.chargeprice
322
336
  if (self.model.f_payment == '赠气') {
@@ -432,7 +446,7 @@
432
446
  let asyncCardMeterCenter = async function (self) {
433
447
  await self.$getConfig(self, 'CardMeterCenter')
434
448
  console.log('卡表收费config', self.config)
435
- // 添加 “系统余额透支” 付款方式
449
+ // 添加 "系统余额透支" 付款方式
436
450
  let i = -1
437
451
  for (const index in self.paytype) {
438
452
  if (self.paytype[index].value == '系统余额透支') {
@@ -530,7 +544,7 @@
530
544
  randomBusinessId: '',
531
545
  resid: [], // 存放新增的f_files表中id
532
546
  config: {
533
- calculatePreByCollection: false, // 可以更具收款来反向计算预购
547
+ calculatePreByCollection: false, // 可以根据收款来反向计算预购
534
548
  notShowFormula: false, // 不显示计算公式,默认显示
535
549
  autoCollection: true, // 自动填写收款
536
550
  quickSale: false,
@@ -602,6 +616,13 @@
602
616
  },
603
617
  props: ['row', 'cardData'],
604
618
  async ready () {
619
+ // 重写 toFixed 方法,实现四舍五入
620
+ Number.prototype.toFixed = function(digits) {
621
+ const num = this
622
+ const multiplier = Math.pow(10, digits)
623
+ const rounded = Math.round(num * multiplier) / multiplier
624
+ return rounded.toString()
625
+ }
605
626
  if (this.authArr.includes('余额写卡限定')) {
606
627
  this.paytype = [{label: '余额写卡', value: '余额写卡'}]
607
628
  } else {
@@ -697,20 +718,41 @@
697
718
  async calculatePreByCollection () {
698
719
  try {
699
720
  this.model.f_collection = (this.model.f_collection - 0)
700
- let calFee = ((this.model.f_collection - 0) + (this.row.f_balance)).toFixed(4)
701
- // 通过收款进行划价
702
- let getGas = await this.$CommonService.feeCalculate(this.model, calFee)
703
- this.model.f_pregas = parseInt(getGas.data.gas)
721
+ // 根据表具品牌判断金额小数位数
722
+ let feeDecimal = 4
723
+ if (this.row.f_meter_brand === '秦川卡表') {
724
+ feeDecimal = 2
725
+ } else if (this.row.f_meter_brand === '重庆精益民用') {
726
+ feeDecimal = 1
727
+ }
728
+
729
+ // 根据收款金额计算预购气量
730
+ let getGas = await this.$CommonService.feeCalculate(this.model, this.model.f_collection)
731
+
732
+ // 根据表具品牌判断气量小数位数,使用截取而不是四舍五入
733
+ if (this.row.f_meter_brand === '秦川卡表') {
734
+ this.model.f_pregas = Math.floor(getGas.data.gas * 100) / 100
735
+ } else if (this.row.f_meter_brand === '重庆精益民用') {
736
+ this.model.f_pregas = Math.floor(getGas.data.gas * 10) / 10
737
+ } else {
738
+ this.model.f_pregas = parseInt(getGas.data.gas)
739
+ }
740
+
741
+ // 根据气量计算金额
704
742
  let dymoney2 = await this.$CommonService.gasCalculate(this.model, this.model.f_pregas)
705
743
  this.model.chargeprice = dymoney2.data.chargeprice
706
744
  Object.assign(this.model, this.model, dymoney2.data)
707
- this.model.f_totalcost = ((this.row.f_balance - 0) > (dymoney2.data.chargenum - 0) ? 0 : ((dymoney2.data.chargenum - 0) - (this.row.f_balance - 0)).toFixed(this.row.f_fee_decimal || 4))
708
- this.model.f_preamount = dymoney2.data.chargenum
745
+
746
+ // 计算应收金额
747
+ let totalCost = ((this.row.f_balance - 0) > (dymoney2.data.chargenum - 0) ? 0 : ((dymoney2.data.chargenum - 0) - (this.row.f_balance - 0)))
748
+
749
+ this.model.f_totalcost = totalCost.toFixed(feeDecimal)
750
+ this.model.f_preamount = ((dymoney2.data.chargenum - 0)).toFixed(feeDecimal)
709
751
  this.model.getDeduct = 0
710
752
  if (this.row.f_project_money && this.row.f_project_money > 0) {
711
753
  this.model.getDeduct = (this.$CommonService.getDeduct(this.row, this.model.f_pregas) - 0)
712
- this.model.f_totalcost = (this.model.f_totalcost - 0 ) + (this.model.getDeduct- 0 )
713
- this.model.f_collection = (this.model.f_collection - 0 ) + (this.model.getDeduct- 0 )
754
+ this.model.f_totalcost = ((this.model.f_totalcost - 0) + (this.model.getDeduct - 0)).toFixed(feeDecimal)
755
+ this.model.f_collection = ((this.model.f_collection - 0) + (this.model.getDeduct - 0)).toFixed(feeDecimal)
714
756
  }
715
757
  this.calText(dymoney2.data.chargeprice, this.model.getDeduct)
716
758
  } catch (error) {
@@ -543,6 +543,13 @@ export default {
543
543
  }
544
544
  },
545
545
  ready () {
546
+ // 重写 toFixed 方法,实现四舍五入
547
+ Number.prototype.toFixed = function(digits) {
548
+ const num = this
549
+ const multiplier = Math.pow(10, digits)
550
+ const rounded = Math.round(num * multiplier) / multiplier
551
+ return rounded.toString()
552
+ }
546
553
  getPrice(this)
547
554
  this.getRandomId()
548
555
  },
@@ -990,7 +997,7 @@ export default {
990
997
  this.$showAlert('该表可能存在超用,请核实输入后进行换表操作!!', 'warning', 5000)
991
998
  this.$dispatch('refresh')
992
999
  }
993
- this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(4)
1000
+ this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(this.getGasDecimalPlaces())
994
1001
  },
995
1002
 
996
1003
  calMoneyCardRemanent () {
@@ -1007,10 +1014,10 @@ export default {
1007
1014
  this.$showAlert('该表可能存在超用,请核实输入后进行换表操作!!', 'warning', 5000)
1008
1015
  this.$dispatch('refresh')
1009
1016
  }
1010
- this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(4)
1017
+ this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(this.getGasDecimalPlaces())
1011
1018
  console.log('金额结算' + this.model.f_remanent_gas)
1012
1019
  if (this.model.f_remanent_price > 0) {
1013
- this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(4)
1020
+ this.model.f_remanent_gas = (param - (this.model.f_using_base_old - 0)).toFixed(this.getGasDecimalPlaces())
1014
1021
  this.model.f_remanent_money = ((this.model.f_remanent_gas - 0) * (this.model.f_remanent_price - 0)).toFixed(4)
1015
1022
  if (this.row.f_remanent_gas > 0) {
1016
1023
  this.model.f_remanent_money = (this.model.f_remanent_money - 0) + ((this.row.f_remanent_gas - 0) * (this.row.f_remanent_price - 0)).toFixed(4)
@@ -1054,32 +1061,17 @@ export default {
1054
1061
  let res = this.$ChangeMeter.changeMeter(oldMeter, newMeter, this.row)
1055
1062
  console.log('看看新旧表的转换结果', res)
1056
1063
  this.changeType = res.name
1057
- /* if (this.addbalance) {
1058
- this.addbalance = false
1059
- this.model.f_remanent_money = (this.model.f_remanent_money - 0) - (this.row.f_balance - 0)
1060
- }
1061
- if (this.addgas) {
1062
- this.addgas = false
1063
- this.model.f_remanent_gas = (this.model.f_remanent_gas - 0) - (this.addgasnum - 0)
1064
- this.addgasnum = 0
1065
- }
1066
- if (newMeter.f_meter_type == '物联网表' && newMeter.f_collection_type == '按金额' && (!this.addbalance)) {
1067
- this.addbalance = true
1068
- this.model.f_remanent_money = this.model.f_remanent_money ? (this.model.f_remanent_money - 0) + (this.row.f_balance - 0) : (this.row.f_balance - 0)
1069
- if (!this.isGas) {
1070
- this.addgas = true
1064
+
1065
+ // 根据新表品牌重新计算补气量的小数位数
1066
+ if (this.model.f_remanent_gas) {
1067
+ if (val[0].f_meter_brand === '秦川卡表') {
1068
+ this.model.f_remanent_gas = (this.model.f_remanent_gas - 0).toFixed(2)
1069
+ } else if (val[0].f_meter_brand === '重庆精益民用') {
1070
+ this.model.f_remanent_gas = (this.model.f_remanent_gas - 0).toFixed(1)
1071
+ } else {
1072
+ this.model.f_remanent_gas = (this.model.f_remanent_gas - 0).toFixed(4)
1071
1073
  }
1072
1074
  }
1073
- if (newMeter.f_meter_type == '物联网表' && newMeter.f_collection_type == '按气量' && (!this.addgas)) {
1074
- this.addgas = true
1075
- debugger
1076
- this.addgasnum = ((this.row.f_balance - 0) / this.model.f_remanent_price).toFixed(4)
1077
- this.model.f_remanent_gas = this.model.f_remanent_gas ? (this.model.f_remanent_gas - 0) + (this.addgasnum - 0) : this.addgasnum
1078
- if (!this.isGas) {
1079
- this.addbalance = true
1080
- this.model.f_remanent_money = this.model.f_remanent_money ? (this.model.f_remanent_money - 0) + (this.row.f_balance - 0) : (this.row.f_balance - 0)
1081
- }
1082
- } */
1083
1075
  }
1084
1076
  },
1085
1077
 
@@ -1178,6 +1170,17 @@ export default {
1178
1170
  this.model.f_remanent_money = totalAmount
1179
1171
  // 计算公式
1180
1172
  this.getComments(allocations)
1173
+ },
1174
+ // 新增:根据表品牌返回补气量小数位数
1175
+ getGasDecimalPlaces() {
1176
+ if (this.model.metermessage.gasbrand && this.model.metermessage.gasbrand[0]) {
1177
+ if (this.model.metermessage.gasbrand[0].f_meter_brand === '秦川卡表') {
1178
+ return 2
1179
+ } else if (this.model.metermessage.gasbrand[0].f_meter_brand === '重庆精益民用') {
1180
+ return 1
1181
+ }
1182
+ }
1183
+ return 4
1181
1184
  }
1182
1185
  },
1183
1186
  watch: {
@@ -1201,7 +1204,7 @@ export default {
1201
1204
  console.log('观察补气金额', val)
1202
1205
  if (!this.isGas) {
1203
1206
  if (this.model.f_remanent_price) {
1204
- this.model.f_remanent_gas = (val / this.model.f_remanent_price).toFixed(4)
1207
+ this.model.f_remanent_gas = (val / this.model.f_remanent_price).toFixed(this.getGasDecimalPlaces())
1205
1208
  } else {
1206
1209
  this.model.f_remanent_gas = 0
1207
1210
  }
package/src/main.js CHANGED
@@ -2,8 +2,8 @@ import Vue from 'vue'
2
2
  import all from 'vue-client/src/all'
3
3
  import App from './App'
4
4
  import system from 'system-clients/src/system'
5
- import FilialeSale from './filiale/fugu/sale'
6
5
  import sale from './sale'
6
+ import FilialeSale from './filiale/yangchun/sale'
7
7
  import address from 'address-client/src/address'
8
8
  import ldap from 'ldap-clients/src/ldap'
9
9
  import VueClipboard from 'vue-clipboard2'
@@ -22,7 +22,7 @@ Vue.config.silent = true
22
22
  all()
23
23
  system(false)
24
24
  sale()
25
- address()
25
+ address('yangchun')
26
26
  ldap()
27
27
  FilialeSale()
28
28
  require('system-clients/src/styles/less/bootstrap.less')