sale-client 4.0.45-preview → 4.0.47-preview

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": "4.0.45-preview",
3
+ "version": "4.0.47-preview",
4
4
  "description": "收费模块前台组件",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -65,7 +65,7 @@
65
65
  <div class="col-sm-4" :class="{'has-success':row.f_discount_amount,'has-error':!row.f_discount_amount}">
66
66
  <label style="" for="f_discount_amount" class=" font_normal_body">&nbsp;优惠金额</label>
67
67
  <input class="input_search" style="width:60%" type="number" min="1" @input.prevent="getcollection()"
68
- v-validate:f_discount_amount='{required: true, dctest: [0, ">" ] }'
68
+ v-validate:f_discount_amount='{required: true, dctest: [0, ">=" ] }'
69
69
  v-model="row.f_discount_amount"
70
70
  :value.sync="row.f_discount_amount"
71
71
  :disabled="false"
@@ -543,14 +543,18 @@ export default {
543
543
  if (!item.f_unitprice || item.f_unitprice == '0') flag = false
544
544
  if (item.f_unitprice && item.f_number) {
545
545
  // 新增优惠金额
546
- const discount = item.f_discount_amount ? parseFloat(item.f_discount_amount) : 0
546
+ const discount = item.f_discount_amount ? item.f_discount_amount : 0
547
547
  money += ((item.f_unitprice - 0) * (item.f_number - 0)) - discount
548
548
  } else {
549
549
  flag = false
550
550
  this.model.f_collection = 0
551
551
  }
552
552
  })
553
- if (money != 0) {
553
+ if (money < 0) {
554
+ this.$showAlert('优惠金额不能大于实收金额!!!', 'danger', 3000)
555
+ this.model.f_discount_amount = ''
556
+ }
557
+ if (money >= 0) {
554
558
  this.model.f_collection = money.toFixed(2)
555
559
  }
556
560
  if (!flag) this.model.f_collection = ''
@@ -581,7 +585,7 @@ export default {
581
585
  if (this.isflag) {
582
586
  if (this.model.f_collection && this.model.f_collection != '') {
583
587
  let collection = (parseFloat(this.model.f_collection - 0)).toFixed(2)
584
- if (collection > 0) return !this.isflag
588
+ if (collection >= 0) return !this.isflag
585
589
  else return !this.$v.valid
586
590
  } else {
587
591
  return !this.$v.valid