Commit a9803f34 authored by youjie's avatar youjie

输入框

parent 6f9ac5d1
......@@ -332,7 +332,6 @@
data: {
handler(newVal, oldVal) {
this.params = JSON.parse(JSON.stringify(newVal))
console.log("this.params",this.params);
this.BusList = this.params.BusList //车信息
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团
this.DiningList = this.params.DiningList //餐厅
......@@ -359,7 +358,7 @@
}
},
deep: true,
immediate: false,
immediate: true,
},
},
mounted() {
......@@ -580,8 +579,8 @@
id: i + 1,
})
}
this.datas = this.BusList[this.dataIndex]
}
this.datas = this.BusList[this.dataIndex]
let dates = this.dateList.filter(x => {
return x.id == this.BusList[this.dataIndex].CheckDateId
})
......
......@@ -177,7 +177,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!-- <input class="text-right" type="text" v-model="item.UnitPrice" /> -->
</view>
</view>
<view class="inputBox row justify-between">
......@@ -185,7 +189,11 @@
<text>返佣</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.Rebate" />
<input class="text-right" type="number"
v-model="item.Rebate"
@input="handleInput($event,item,index,'Rebate')"
@blur="handleBlur(item,index,'Rebate')" />
<!-- <input class="text-right" type="text" v-model="item.Rebate" /> -->
</view>
</view>
<view class="paymentTitle PA30">备注</view>
......@@ -274,6 +282,28 @@
this.getRenderingData();
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.OtherList = this.params.OtherOrderInfo.OtherList
......
......@@ -149,7 +149,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!-- <input class="text-right" type="text" v-model="item.UnitPrice" /> -->
</view>
</view>
<view class="paymentTitle PA30">备注</view>
......@@ -222,6 +226,28 @@
this.initData()
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.TipList = this.params.OtherOrderInfo.TipList
......
......@@ -149,7 +149,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!-- <input class="text-right" type="text" v-model="item.UnitPrice" /> -->
</view>
</view>
<view class="paymentTitle PA30">备注</view>
......@@ -221,6 +225,28 @@
this.initData();
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.TeamList = this.params.OtherOrderInfo.TeamList
......
......@@ -168,7 +168,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!-- <input class="text-right" type="text" v-model="item.UnitPrice" /> -->
</view>
</view>
......@@ -245,6 +249,28 @@
this.initData();
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.SelfPlayingIncomeList = this.params.OtherOrderInfo.SelfPlayingIncomeList
......
......@@ -159,7 +159,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!-- <input class="text-right" type="text" v-model="item.UnitPrice" /> -->
</view>
</view>
<view class="inputBox row justify-between">
......@@ -167,7 +171,11 @@
<text>返佣</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.Rebate" />
<input class="text-right" type="number"
v-model="item.Rebate"
@input="handleInput($event,item,index,'Rebate')"
@blur="handleBlur(item,index,'Rebate')" />
<!-- <input class="text-right" type="text" v-model="item.Rebate" /> -->
</view>
</view>
<view class="paymentTitle PA30">备注</view>
......@@ -256,6 +264,28 @@
this.initData();
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.SelfPlayingExpendList = this.params.OtherOrderInfo.SelfPlayingExpendList
......
......@@ -186,7 +186,11 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.ShopMoney" />
<input class="text-right" type="number"
v-model="item.ShopMoney"
@input="handleInput($event,item,index,'ShopMoney')"
@blur="handleBlur(item,index,'ShopMoney')" />
<!-- <input class="text-right" type="text" v-model="item.ShopMoney" /> -->
</view>
</view>
......@@ -276,6 +280,28 @@
this.initData();
},
methods: {
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.LeaderShopList = this.params.LeaderShopList
......
......@@ -116,16 +116,15 @@
position: relative;
}
.inputBoxRight u-number-box {
position: absolute;
right: 0;
top: -7rpx;
}
/deep/.inputBoxRight u-number-box input {
width: 130rpx !important;
min-width: 130rpx !important;
}
.inputBoxRight u-number-box{
position: absolute;
right: 0;
top: -7rpx;
}
/deep/.inputBoxRight u-number-box input{
width: 130rpx !important;
min-width: 130rpx !important;
}
.inforCenterTopDel {
position: absolute;
......@@ -165,8 +164,7 @@
<text>数量</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UserNum"
@input="getTotal()" />
<u-number-box :min="0" v-model="item.UserNum" @change="(e)=>getNum(e,index)"/>
</view>
</view>
<view class="inputBox row justify-between">
......@@ -174,8 +172,10 @@
<text>金额</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice"
@input="handleInput($event, item,2, 'UnitPrice')" @blur="handleBlur(item,2, 'UnitPrice')" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -274,34 +274,32 @@
this.initData();
},
methods: {
getNum(e,index){
this.datas.ReimburseList.ReimburseDetailsList[index].UserNum = e.value
this.getTotal()
},
// 在模板中的使用示例
handleInput(e, item, type, field) {
const value = e.detail.value;
var validValue = 0;
if (type == 1) {
validValue = this.$utils.checkInteger(value, true);
} else {
validValue = this.$utils.checkPrice(value, true);
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
this.getTotal()
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
// 更新数据
item[field] = validValue;
console.log("handleInput", item[field]);
// 触发其他逻辑(如计算)
this.getTotal();
},
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);
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
this.getTotal();
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
// 更新数据
item[field] = formattedValue;
console.log("handleBlur", item[field]);
// 触发其他逻辑
this.getTotal();
},
//初始化数据
initData() {
......@@ -333,8 +331,8 @@
},
updateData() {
this.BusList[this.dataIndex] = JSON.parse(JSON.stringify(this.datas))
this.params.BusList = JSON.parse(JSON.stringify(this.BusList))
this.$emit('change', this.params)
// this.params.BusList = JSON.parse(JSON.stringify(this.BusList))
this.$emit('change', this.BusList,1)
},
getRenderingData() {
this.datas = this.BusList[this.dataIndex]
......
......@@ -137,7 +137,7 @@
</style>
<template>
<view>
<view class="inforCenterBox PX30 MT20">
<view class="inforCenterBox PX30 MT20" v-if="datas.HotelOrderList[datas.hotelIndex]">
<view class="inforCenter"
v-for="(item,index) in datas.HotelOrderList[datas.hotelIndex].ReimburseList.ReimburseDetailsList"
:key="index">
......@@ -154,7 +154,7 @@
<text>数量</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<u-number-box :min="0" v-model="item.UserNum" @change="(e)=>getNum(e,index)"/>
</view>
</view>
<view class="inputBox row justify-between">
......@@ -162,7 +162,11 @@
<text>单价</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" @input="getNum()" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!--<input class="text-right" type="text" v-model="item.UnitPrice" @input="getNum()" />-->
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -269,23 +273,46 @@
}
},
deep: true,
immediate: true
immediate: false
},
},
mounted() {
this.initData();
},
methods: {
getNum(e,index){
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value
this.getTotal()
},
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
this.getTotal()
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
this.getTotal();
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团
this.dataIndex = this.dataIndex2;
this.datas = this.HotelOrderListReport[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList
.ReimburseDetailsList[0]))
this.getTotal()
},
getNum() {
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[0]))
this.getTotal()
},
getTotal() {
......@@ -314,7 +341,7 @@
updateData() {
this.HotelOrderListReport[this.dataIndex] = JSON.parse(JSON.stringify(this.datas))
this.params.HotelOrderListReport = JSON.parse(JSON.stringify(this.HotelOrderListReport))
this.$emit('change', this.params)
this.$emit('change', this.HotelOrderListReport,2)
},
showOptionVisible(index) {
......
......@@ -137,7 +137,7 @@
</style>
<template>
<view>
<view class="inforCenterBox PX30 MT20">
<view class="inforCenterBox PX30 MT20" v-if="datas&&datas.DiningSummaryList&&datas.DiningSummaryList.length>0&&datas.DiningSummaryList[datas.diningIndex]">
<view class="inforCenter"
v-for="(item,index) in datas.DiningSummaryList[datas.diningIndex].ReimburseList.ReimburseDetailsList"
:key="index">
......@@ -154,7 +154,7 @@
<text>数量</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<u-number-box :min="0" v-model="item.UserNum" @change="(e)=>getNum(e,index)"/>
</view>
</view>
<view class="inputBox row justify-between">
......@@ -162,7 +162,10 @@
<text>单价</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" @input="getNum()" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -262,7 +265,7 @@
}
},
deep: true,
immediate: true
immediate: false
},
},
mounted() {
......@@ -276,9 +279,33 @@
this.getRenderingData()
this.getTotal();
},
getNum(e, index, type) {
getNum(e, index) {
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value
this.getTotal()
},
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
this.getTotal()
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
this.getTotal();
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
getTotal() {
let total = 0
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
......@@ -302,7 +329,7 @@
updateData() {
this.DiningList[this.dataIndex] = JSON.parse(JSON.stringify(this.datas))
this.params.DiningList = JSON.parse(JSON.stringify(this.DiningList))
this.$emit('change', this.params)
this.$emit('change', this.DiningList,3)
},
getRenderingData() {
this.datas = this.DiningList[this.dataIndex]
......
......@@ -137,7 +137,7 @@
</style>
<template>
<view>
<view class="inforCenterBox PX30 MT20">
<view class="inforCenterBox PX30 MT20" v-if="datas&&datas.ScenicStatisticsList">
<view class="inforCenter"
v-for="(item,index) in datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.ReimburseDetailsList"
:key="index">
......@@ -154,7 +154,8 @@
<text>数量</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<u-number-box :min="0" v-model="item.UserNum" @change="(e)=>getNum(e,index)"/>
<!--<input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />-->
</view>
</view>
<view class="inputBox row justify-between">
......@@ -162,7 +163,11 @@
<text>单价</text>
</view>
<view class="inputBoxRight">
<input class="text-right" type="text" v-model="item.UnitPrice" @input="getNum()" />
<input class="text-right" type="number"
v-model="item.UnitPrice"
@input="handleInput($event,item,index,'UnitPrice')"
@blur="handleBlur(item,index,'UnitPrice')" />
<!--<input class="text-right" type="text" v-model="item.UnitPrice" @input="getNum()" />-->
</view>
</view>
<view class="inputBox row justify-between noBorder">
......@@ -262,7 +267,7 @@
}
},
deep: true,
immediate: true
immediate: false
},
},
mounted() {
......@@ -276,9 +281,33 @@
this.getRenderingData()
this.getTotal()
},
getNum() {
getNum(e, index) {
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value
this.getTotal()
},
// 在模板中的使用示例
handleInput(e,item,index,field) {
const value = e.detail.value
if(this.$utils.checkIsNum(value)){
item[field] = value
this.getTotal()
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
handleBlur(item,index,field) {
if(this.$utils.checkIsNum(item[field])){
this.getTotal();
}else{
uni.showToast({
title: '请输入正确的金额',
icon: 'none'
})
}
},
getTotal() {
let total = 0
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
......@@ -302,7 +331,7 @@
updateData() {
this.ScenicList[this.dataIndex] = JSON.parse(JSON.stringify(this.datas))
this.params.ScenicList = JSON.parse(JSON.stringify(this.ScenicList))
this.$emit('change', this.params)
this.$emit('change', this.ScenicList,4)
},
getRenderingData() {
this.datas = this.ScenicList[this.dataIndex]
......
......@@ -569,9 +569,17 @@
this.loading = false
})
},
getNewData(params, type) {
//其它费用
if (type == 5) {
getNewData(row, type) {
let params = JSON.parse(JSON.stringify(row))
if(type==1){
this.params.BusList = params
}else if (type == 2) {
this.params.HotelOrderListReport = params
}else if (type == 3) {
this.params.DiningList = params
}else if (type == 4) {
this.params.ScenicList = params
}else if (type == 5) {//其它费用
this.params.OtherOrderInfo.OtherList = params;
} else if (type == 6) {
this.params.OtherOrderInfo.TipList = params;
......@@ -584,7 +592,7 @@
} else if (type == 10) {
this.params.LeaderShopList = params;
} else {
this.params = JSON.parse(JSON.stringify(params))
this.params = params
}
},
getType(item) {
......@@ -734,13 +742,13 @@
},
scroll(e) {
this.old.scrollTop = e.detail.scrollTop
this.boxOption = Math.floor((e.detail.scrollTop - 100) / 1.5);
this.boxOption = Math.floor((e.detail.scrollTop - 50) / 1.5);
this.titleStyle.opacity =
e.detail.scrollTop - 200 < 0 ?
e.detail.scrollTop - 50 < 0 ?
0 :
Math.floor(e.detail.scrollTop - 100) / 100 > 1 ?
Math.floor(e.detail.scrollTop - 50) / 100 > 1 ?
1 :
Math.floor(e.detail.scrollTop - 100) / 100;
Math.floor(e.detail.scrollTop - 50) / 100;
this.$forceUpdate();
},
getOptionData() {
......
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