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

车修改

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