sale-client 3.6.533 → 3.6.534

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.533",
3
+ "version": "3.6.534",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -30,9 +30,9 @@
30
30
 
31
31
  <div class="col-sm-4">
32
32
  <label for="f_preamount" class=" font_normal_body">预购金额</label>
33
- <input class="input_search" style="width:60%" type="number" v-model="model.f_preamount"
33
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_preamount"
34
34
  v-validate:f_preamount='{required: true, dctest: [maxmoney, "<=" ] }'
35
- v-scale="[model.f_preamount, 2]" placeholder="预购金额" disabled>
35
+ placeholder="预购金额" disabled>
36
36
  </div>
37
37
  </div>
38
38
  <div class="row" style="margin-top:6px;">
@@ -66,10 +66,10 @@
66
66
  class=" font_normal_body">应收金额</label>
67
67
  <label for="f_temp_amount" v-if="row.f_collection_type === '按金额'"
68
68
  class=" font_normal_body">本次缴费</label>
69
- <input class="input_search" style="width:60%" type="number"
69
+ <input class="input_search" style="width:60%" type="text"
70
70
  @blur="preamount()" v-model="model.f_totalcost"
71
71
  v-validate:f_totalcost='{required: true, dctest: [0, ">=" ] }' placeholder="应收金额"
72
- v-next-el='sk' v-scale="[model.f_totalcost, 2]" >
72
+ v-next-el='sk' >
73
73
  </div>
74
74
  </div>
75
75
  <div class="row">
@@ -87,14 +87,14 @@
87
87
  <div class="col-sm-4" v-if="row.f_collection_type === '按气量'"
88
88
  :class="[$v.f_collection.required ? 'has-error' : 'has-success']">
89
89
  <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
90
- <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
90
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_collection"
91
91
  v-validate:f_collection='{required: true, dctest: [model.f_totalcost, ">=" ] }'
92
- v-el:sk v-scale="[model.f_totalcost, 2]" disabled>
92
+ v-el:sk disabled>
93
93
  </div>
94
94
  <div class="col-sm-4" v-if="row.f_collection_type === '按金额'">
95
95
  <label for="f_collection" class=" font_normal_body">&nbsp;&nbsp;&nbsp;收款&nbsp;&nbsp;&nbsp;</label>
96
- <input class="input_search" style="width:60%" type="number" v-model="model.f_collection"
97
- v-el:sk v-scale="[model.f_collection, 2]" disabled>
96
+ <input class="input_search" style="width:60%" type="text" v-model="model.f_collection"
97
+ v-el:sk disabled>
98
98
  </div>
99
99
  </div>
100
100
  <div class="row" style="margin-top:5px;">
@@ -169,6 +169,10 @@
169
169
  */
170
170
  import CardService from './CardService'
171
171
  // 输入金额,换算气量
172
+ function stringRound(num, decimals = 2) {
173
+ const strValue = num + 'e' + decimals
174
+ return Math.round(Number(strValue)) / Math.pow(10, decimals)
175
+ }
172
176
  let preamountGen = async function (self) {
173
177
  let dymoney = 0
174
178
  let calFee = (self.model.f_totalcost - 0) + (self.row.f_balance - 0)
@@ -208,8 +212,8 @@
208
212
  if ((self.model.f_pregas - 0) - (self.maxgas - 0) <= 0) {
209
213
  self.model.f_meter_type = self.row.f_meter_type
210
214
  let getAmount = await self.$CommonService.gasCalculate(self.model, self.model.f_pregas)
211
- self.model.f_preamount = getAmount.data.chargenum
212
- self.model.f_totalcost = ((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)).toFixed(2))
215
+ self.model.f_preamount = stringRound(getAmount.data.chargenum)
216
+ self.model.f_totalcost = stringRound((self.row.f_balance - 0) > (getAmount.data.chargenum - 0) ? 0 : ((getAmount.data.chargenum - 0) - (self.row.f_balance - 0)))
213
217
  Object.assign(self.model, self.model, getAmount.data)
214
218
  self.model.chargeprice = getAmount.data.chargeprice
215
219
  self.model.f_collection = self.model.f_totalcost
@@ -492,6 +496,10 @@
492
496
  } else {
493
497
  return 0
494
498
  }
499
+ },
500
+ formattedAmount() {
501
+ // 四舍五入保留两位小数
502
+ return (Math.round(this.model.f_preamount * 100) / 100).toFixed(2);
495
503
  }
496
504
  }
497
505
  }
@@ -5,7 +5,7 @@
5
5
  <div novalidate class="form-horizontal select-overspread container-fluid auto" partial>
6
6
  <div class="row">
7
7
 
8
- <!-- <res-select-group :initres="$parent.$parent.initres" :show-component="['company']" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>-->
8
+ <res-select-group :initres="$parent.$parent.initres" :show-component="['company']" @re-res="$parent.$parent.getRes" v-ref:sel></res-select-group>
9
9
 
10
10
  <div class="col-sm-2 form-group">
11
11
  <label for="startDate" class="font_normal_body">开始日期</label>