Commit 72f18976 authored by 黄奎's avatar 黄奎

车修改

parent 55b84043
......@@ -166,7 +166,7 @@
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UserNum"
@input="handleInput($event, item, 'UserNum')" @blur="handleBlur(item, 'UserNum')" />
@input="handleInput($event, item,1, 'UserNum')" @blur="handleBlur(item,1, 'UserNum')" />
</view>
</view>
<view class="inputBox row justify-between">
......@@ -175,7 +175,7 @@
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UnitPrice"
@input="handleInput($event, item, 'UnitPrice')" @blur="handleBlur(item, 'UnitPrice')" />
@input="handleInput($event, item,2, 'UnitPrice')" @blur="handleBlur(item,2, 'UnitPrice')" />
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -249,7 +249,6 @@
watch: {
data: {
handler(newVal, oldVal) {
console.log("newVal", newVal);
if (oldVal.dataIndex1 != newVal.dataIndex1) {
this.initData();
} else {
......@@ -263,22 +262,39 @@
deep: true,
immediate: false
},
datas: {
handler(newVal, oldVal) {
this.updateData();
},
deep: true,
immediate: false
},
},
mounted() {
this.initData();
},
methods: {
// 在模板中的使用示例
handleInput(e, item, field) {
handleInput(e, item, type, field) {
const value = e.detail.value;
const validValue = this.$utils.checkInteger(value, true);
var validValue = 0;
if (type == 1) {
validValue = this.$utils.checkInteger(value, true);
} else {
validValue = this.$utils.checkPrice(value, true);
}
// 更新数据
item[field] = validValue;
// 触发其他逻辑(如计算)
this.getTotal();
},
handleBlur(item, field) {
const formattedValue = this.$utils.checkPrice(item[field], true);
handleBlur(item, type, field) {
var formattedValue = 0;
if (type == 1) {
formattedValue = this.$utils.checkInteger(item[field], true);
} else {
formattedValue = this.$utils.checkPrice(item[field], true);
}
// 更新数据
item[field] = formattedValue;
this.$set(item, field, formattedValue);
......@@ -296,12 +312,10 @@
},
getTotal() {
let total = 0;
this.datas.ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index) {
this.datas.ReimburseList.ReimburseDetailsList.splice(index, 1)
......@@ -312,7 +326,7 @@
},
getSettlementType(item) {
this.datas.ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
updateData() {
......@@ -342,7 +356,7 @@
let findIndex = this.optionList.findIndex(x => x.id == value)
this.optionObj = this.optionList[findIndex]
this.datas.ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr = this.optionObj.name
this.datas.ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType = this.optionObj.id
this.datas.ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType = this.optionObj.id;
},
previewImage(src) {
uni.previewImage({
......
This diff is collapsed.
......@@ -542,8 +542,8 @@
title: '保存中...'
})
this.apipost("dmcstatistics_post_SetNewLeaderApplyList_V2", this.params, (res) => {
this.loading = false;
if (res.resultCode == 1) {
this.loading = false
uni.showToast({
title: '操作成功!',
icon: 'success',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment