Parcourir la source

修改经费开支单价和总金额保留两位小数,给l-input添加失去焦点事件@blur

新疆警官学校中职
lb01 il y a 1 an
Parent
révision
ba721d261e
2 fichiers modifiés avec 24 ajouts et 7 suppressions
  1. +5
    -1
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/input.vue
  2. +19
    -6
      Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/FundsApply/single.vue

+ 5
- 1
Learun.Framework.Ultimate V7/LearunApp-2.2.0/components/learun-mpui/learun-ui-mp/input.vue Voir le fichier

@@ -6,6 +6,7 @@
</view>
<input
@input="input"
@blur="blur"
:value="value"
:type="type"
:disabled="disabled"
@@ -38,7 +39,10 @@ export default {
input(e) {
this.$emit('input', e.detail.value)
this.$emit('change', e.detail.value)
}
},
blur(e){
this.$emit('blur', e.detail.value)
}
},

computed: {


+ 19
- 6
Learun.Framework.Ultimate V7/LearunApp-2.2.0/pages/AssetManagementSystem/FundsApply/single.vue Voir le fichier

@@ -41,8 +41,8 @@
<view class="welBox" id="StuInfoFreshEmergePeople" v-show="FundsApplyDetail.length != 0">
<view class="welCon" v-for="(item, i) in FundsApplyDetail" :key='i'>
<l-input v-model="item.ProjectContent" title="项目内容" placeholder="请填写" right :disabled="!edit" />
<l-input v-model="item.Number" type="number" @change="SumAmountChange(item)" title="数量" :disabled="!edit" placeholder="请填写" right />
<l-input v-model="item.Price" type="number" @change="SumAmountChange(item)" title="单价(元)" :disabled="!edit" placeholder="请填写" right />
<l-input v-model="item.Number" type="number" @change="SumAmountChange(item,'Number')" title="数量" :disabled="!edit" placeholder="请填写" right />
<l-input v-model="item.Price" type="number" @blur="blurChange(item)" title="单价(元)" :disabled="!edit" placeholder="请填写" right />
<l-input v-model="item.Amount" title="金额(元)" disabled placeholder="请填写" right />
<view v-if="edit||create" class="welDel" @click="del('FundsApplyDetails', i)"><text
class="text-xxl cuIcon cuIcon-move"></text></view>
@@ -388,19 +388,32 @@
_this.current.FundsApply.SumAmount = _this.sum(Amounts)
_this.current.FundsApply.UpperAmount = _this.smalltoBIG(_this.current.FundsApply.SumAmount)
},
blurChange(item){
console.log(item)
let _this = this
item.Price = Number(item.Price).toFixed(2)
if (item.Number && item.Price) {
item.Amount = (item.Number * item.Price).toFixed(2)
// _this.current.SumAmount = item.Number * item.Price
let Amounts = _this.FundsApplyDetail.map(item => {
return Number(item.Amount).toFixed(2)
})
_this.current.FundsApply.SumAmount = Number(_this.sum(Amounts)).toFixed(2)
_this.current.FundsApply.UpperAmount = _this.smalltoBIG(_this.current.FundsApply.SumAmount)
// console.log(_this.smalltoBIG(_this.current.FundsApply.SumAmount))
}
},
SumAmountChange(item) {
console.log(item)
let _this = this
if (item.Number && item.Price) {
item.Amount = (item.Number * item.Price).toFixed(2)

// _this.current.SumAmount = item.Number * item.Price

let Amounts = _this.FundsApplyDetail.map(item => {
return item.Amount
})

_this.current.FundsApply.SumAmount = _this.sum(Amounts)
_this.current.FundsApply.SumAmount = Number(_this.sum(Amounts)).toFixed(2)
_this.current.FundsApply.UpperAmount = _this.smalltoBIG(_this.current.FundsApply.SumAmount)
// console.log(_this.smalltoBIG(_this.current.FundsApply.SumAmount))
}


Chargement…
Annuler
Enregistrer