Commit 9389093a authored by 吴春's avatar 吴春

Merge branch 'B2C' of http://gitlab.oytour.com/zk123/jz_travel into B2C

parents 6b763d38 99547a29
...@@ -127,6 +127,7 @@ ...@@ -127,6 +127,7 @@
<template v-else>暂无司机信息</template> <template v-else>暂无司机信息</template>
</view> </view>
<view v-if="params.type>1&&params.type<5" class="row justify-center items-center"> <view v-if="params.type>1&&params.type<5" class="row justify-center items-center">
<view v-if="params.type==2" class="row justify-center items-center" @click="showOptionVisible(3)"> <view v-if="params.type==2" class="row justify-center items-center" @click="showOptionVisible(3)">
<view class="nameTitle"> <view class="nameTitle">
{{ datas.HotelOrderList[datas.hotelIndex].ReimburseList.ActualUseInfo?datas.HotelOrderList[datas.hotelIndex].ReimburseList.ActualUseInfo:datas.HotelOrderList[datas.hotelIndex].NewHotelName }} {{ datas.HotelOrderList[datas.hotelIndex].ReimburseList.ActualUseInfo?datas.HotelOrderList[datas.hotelIndex].ReimburseList.ActualUseInfo:datas.HotelOrderList[datas.hotelIndex].NewHotelName }}
...@@ -213,9 +214,18 @@ ...@@ -213,9 +214,18 @@
</template> </template>
</view> </view>
<view class="headeDatasCurrency row justify-between" @click="showOptionVisible(2)"> <view class="headeDatasCurrency row justify-between" @click="showOptionVisible(2)">
<view> <view v-if="params.type==1">
实际金额:¥{{ datas&&datas.TotalMoney>=0?datas.TotalMoney.toFixed(2):0.0 }} 实际金额:¥{{ datas&&datas.TotalMoney>=0?datas.TotalMoney.toFixed(2):0.0 }}
</view> </view>
<view v-else-if="params.type==2">
实际金额:¥{{ datas&&datas.HotelOrderList&&datas.HotelOrderList[datas.hotelIndex].TotalMoney>=0?datas.HotelOrderList[datas.hotelIndex].TotalMoney.toFixed(2):0.0 }}
</view>
<view v-else-if="params.type==3">
实际金额:¥{{ datas&&datas.DiningSummaryList&&datas.DiningSummaryList[datas.diningIndex].TotalMoney>=0?datas.DiningSummaryList[datas.diningIndex].TotalMoney.toFixed(2):0.0 }}
</view>
<view v-else="params.type==4">
实际金额:¥{{ datas&&datas.ScenicStatisticsList&&datas.ScenicStatisticsList[datas.scenicIndex].TotalMoney>=0?datas.ScenicStatisticsList[datas.scenicIndex].TotalMoney.toFixed(2):0.0 }}
</view>
<view class="row items-center"> <view class="row items-center">
<text style="color: red;">*</text> <text style="color: red;">*</text>
<text class="ML10">币种:{{ currencyObj.name }}</text> <text class="ML10">币种:{{ currencyObj.name }}</text>
......
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.Sure{
padding: 0 20rpx; .Sure {
margin-top: 30rpx; padding: 0 20rpx;
} margin-top: 30rpx;
.Sure view{ }
background: #257BF2;
border-radius: 80rpx; .Sure view {
line-height: 80rpx; background: #257BF2;
font-size: 32rpx; border-radius: 80rpx;
color: #fff; line-height: 80rpx;
} font-size: 32rpx;
color: #fff;
.paymentTitle{ }
font-size: 28rpx;
} .paymentTitle {
.paymentTexts view{ font-size: 28rpx;
padding: 5rpx 15rpx; }
border: 1px solid #EDEDED;
color: #888888; .paymentTexts view {
border-radius: 6rpx; padding: 5rpx 15rpx;
} border: 1px solid #EDEDED;
.paymentTexts view:last-child{ color: #888888;
margin-left: 40rpx; border-radius: 6rpx;
} }
.paymentTexts view.active{
color: #fff; .paymentTexts view:last-child {
background: #257BF2; margin-left: 40rpx;
border: 1px solid #257BF2; }
}
.paymentTitle .tisp{ .paymentTexts view.active {
color: #666666; color: #fff;
} background: #257BF2;
.textareaBox textarea{ border: 1px solid #257BF2;
height: 208rpx; }
background: #FFFFFF;
border: 1rpx solid #EAEAEA; .paymentTitle .tisp {
border-radius: 10rpx; color: #666666;
} }
.InforImgBox{
flex-wrap: wrap; .textareaBox textarea {
} height: 208rpx;
.InforImg,.addUp{ background: #FFFFFF;
width: 208rpx; border: 1rpx solid #EAEAEA;
height: 208rpx; border-radius: 10rpx;
margin-bottom: 20rpx; }
}
.InforImg{ .InforImgBox {
border-radius: 10rpx; flex-wrap: wrap;
margin-right: 20rpx; }
position: relative;
} .InforImg,
.InforImg image{ .addUp {
width: 100%; width: 208rpx;
height: 100%; height: 208rpx;
border-radius: 10rpx; margin-bottom: 20rpx;
} }
.InforImgDel{
position: absolute; .InforImg {
left: 0; border-radius: 10rpx;
top: -14rpx; margin-right: 20rpx;
z-index: 1; position: relative;
background: #fff; }
border-radius: 50%;
} .InforImg image {
.inforCenter{ width: 100%;
border-radius: 10rpx; height: 100%;
overflow: hidden; border-radius: 10rpx;
border: 1px solid rgba(102,102,102,0.3); }
margin-bottom: 40rpx;
position: relative; .InforImgDel {
} position: absolute;
.inforCenter:last-child{ left: 0;
margin-bottom: 0; top: -14rpx;
} z-index: 1;
.inforCenterTop{ background: #fff;
background: #F3F3F3; border-radius: 50%;
padding: 20rpx 29rpx; }
font-size: 32rpx;
color: #333333; .inforCenter {
} border-radius: 10rpx;
.inputBox{ overflow: hidden;
padding: 20rpx 0; border: 1px solid rgba(102, 102, 102, 0.3);
margin: 0 29rpx; margin-bottom: 40rpx;
border-bottom:1px solid #DDD ; position: relative;
font-size: 28rpx; }
}
.inputBox.noBorder{ .inforCenter:last-child {
border: 0; margin-bottom: 0;
} }
.tisp{
color: red; .inforCenterTop {
} background: #F3F3F3;
.inputBoxRight{ padding: 20rpx 29rpx;
position: relative; font-size: 32rpx;
} color: #333333;
.inputBoxRight u-number-box{ }
position: absolute;
right: 0; .inputBox {
top: -7rpx; padding: 20rpx 0;
} margin: 0 29rpx;
/deep/.inputBoxRight u-number-box input{ border-bottom: 1px solid #DDD;
width: 130rpx !important; font-size: 28rpx;
min-width: 130rpx !important; }
}
.inforCenterTopDel{ .inputBox.noBorder {
position: absolute; border: 0;
left: -7rpx; }
top: -7rpx;
padding: 5rpx; .tisp {
z-index: 1; color: red;
} }
.inputBoxRight {
</style> 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;
}
.inforCenterTopDel {
position: absolute;
left: -7rpx;
top: -7rpx;
padding: 5rpx;
z-index: 1;
}
</style>
<template> <template>
<view> <view>
<view class="inforCenterBox PX30 MT20"> <view class="inforCenterBox PX30 MT20">
<view class="inforCenter" v-for="(item,index) in datas.HotelOrderList[datas.hotelIndex].ReimburseList.ReimburseDetailsList" <view class="inforCenter"
:key="index"> v-for="(item,index) in datas.HotelOrderList[datas.hotelIndex].ReimburseList.ReimburseDetailsList"
<view class="inforCenterTop row justify-between" @click="showOptionVisible(index)"> :key="index">
<view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view> <view class="inforCenterTop row justify-between" @click="showOptionVisible(index)">
<view> <view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view>
<u-icon name="arrow-down" color="#BBBBBB" size="42"/> <view>
</view> <u-icon name="arrow-down" color="#BBBBBB" size="42" />
</view> </view>
<u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967" size="36"/> </view>
<view class="inputBox row justify-between"> <u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967"
<view class="row"> size="36" />
<text>数量</text> <view class="inputBox row justify-between">
</view> <view class="row">
<view class="inputBoxRight"> <text>数量</text>
<u-number-box :min="0" :value="item.UserNum" @change="(e)=>getNum(e,index,'数量')"/> </view>
</view> <view class="inputBoxRight">
</view> <input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<view class="inputBox row justify-between"> </view>
<view class="row"> </view>
<text>单价</text> <view class="inputBox row justify-between">
</view> <view class="row">
<view class="inputBoxRight"> <text>单价</text>
<u-number-box :min="0" :max="99999999999999999" v-model="item.UnitPrice" @change="(e)=>getNum(e,index,'金额')"/> </view>
</view> <view class="inputBoxRight">
</view> <input class="text-right" type="number" v-model="item.UnitPrice" @input="getNum()" />
<view class="inputBox row justify-between noBorder"> </view>
<view class="row"> </view>
<text>金额小计</text> <view class="inputBox row justify-between noBorder">
</view> <view class="row">
<view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view> <text>金额小计</text>
</view> </view>
</view> <view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view>
</view> </view>
<view class="Sure"> </view>
<view class="text-center" @click="addData">添加</view> </view>
</view> <view class="Sure">
<view class="paymentTitle PA30">支付方式</view> <view class="text-center" @click="addData">添加</view>
<view class="PX30 PB20 paymentTexts row"> </view>
<template v-for="(item,index) in paymentList"> <view class="paymentTitle PA30">支付方式</view>
<view :class="[datas.HotelOrderList[datas.hotelIndex].ReimburseList.SettlementType==item.id?'active':'']" @click="getSettlementType(item)">{{ item.name }}</view> <view class="PX30 PB20 paymentTexts row">
</template> <template v-for="(item,index) in paymentList">
</view> <view
<view class="paymentTitle PA30">备注</view> :class="[datas.HotelOrderList[datas.hotelIndex].ReimburseList.SettlementType==item.id?'active':'']"
<view class="textareaBox PX30 row"> @click="getSettlementType(item)">{{ item.name }}</view>
<textarea class="PA20 flex1" placeholder-style="color:#AAAAAA" </template>
v-model="datas.HotelOrderList[datas.hotelIndex].ReimburseList.Remarks" placeholder="请输入备注信息" @blur="updateData"/> </view>
</view> <view class="paymentTitle PA30">备注</view>
<view class="paymentTitle PA30"> <view class="textareaBox PX30 row">
<text>凭证</text> <textarea class="PA20 flex1" placeholder-style="color:#AAAAAA"
<text class="tisp">(可上传多张图片)</text> v-model="datas.HotelOrderList[datas.hotelIndex].ReimburseList.Remarks" placeholder="请输入备注信息"
</view> @blur="updateData" />
<view class="PX30 PB30 row InforImgBox"> </view>
<view class="InforImg" v-for="(item,index) in datas.HotelOrderList[datas.hotelIndex].ReimburseList.VoucherPicList" > <view class="paymentTitle PA30">
<image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image> <text>凭证</text>
<u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36"/> <text class="tisp">(可上传多张图片)</text>
</view> </view>
<upload class="addUp" @onSuccess="onSuccess"></upload> <view class="PX30 PB30 row InforImgBox">
</view> <view class="InforImg"
<singleChoice v-if="optionVisible" v-for="(item,index) in datas.HotelOrderList[datas.hotelIndex].ReimburseList.VoucherPicList">
:current="optionObj.id" <image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image>
:list="optionList" <u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36" />
@close="close" @change="popupCurrent"></singleChoice> </view>
</view> <upload class="addUp" @onSuccess="onSuccess"></upload>
</view>
<singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close"
@change="popupCurrent"></singleChoice>
</view>
</template> </template>
<script> <script>
import upload from "../upload"; import upload from "../upload";
import singleChoice from "../singleChoice"; import singleChoice from "../singleChoice";
export default { export default {
props:['data','optionList'], props: ['data', 'dataIndex2', 'optionList'],
components: { components: {
upload, upload,
singleChoice, singleChoice,
}, },
data() { data() {
return { return {
paymentList:[ paymentList: [{
{name:'现金支付',id:1}, name: '现金支付',
{name:'公司结算',id:2}, id: 1
], },
optionVisible: false, {
optionObj:{}, name: '公司结算',
params: {}, id: 2
datas: null,//展示数据 },
dataIndex: 0, ],
ReimIndex: 0, optionVisible: false,
ReimDatas: {}, optionObj: {},
BusList:[], //车信息 params: {},
HotelOrderListReport:[], //酒店信息,合团 datas: null, //展示数据
DiningList:[], //餐厅 dataIndex: 0,
ScenicList:[], //景点 ReimIndex: 0,
OtherList:[], //其他订单信息 ReimDatas: {},
TipList:[], //小费收入 HotelOrderListReport: [], //酒店信息,合团
TeamList:[], //团费小计 }
SelfPlayingIncomeList:[], //自费收入 },
SelfPlayingExpendList:[], //自费支出 watch: {
LeaderShopList:[], //购物报账
} data: {
}, handler(newVal, oldVal) {
watch: { if (newVal && oldVal) {
data:{ //切换酒店日期
handler(newVal,oldVal){ if (newVal.dataIndex2 != oldVal.dataIndex2) {
this.params = JSON.parse(JSON.stringify(newVal)) this.initData();
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团 }
//切换同一天酒店
else if (oldVal.HotelOrderListReport[this.dataIndex2].hotelIndex != newVal.HotelOrderListReport[
this.dataIndex2]
.hotelIndex) {
this.initData();
}
}
},
deep: true,
immediate: true
},
},
mounted() {
this.initData();
},
methods: {
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.HotelOrderListReport = this.params.HotelOrderListReport //酒店信息,合团
this.dataIndex = this.dataIndex2;
this.getRenderingData()
this.getTotal()
},
getNum() {
this.getTotal()
},
getTotal() {
let total = 0
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index) {
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.splice(index, 1)
},
delImg(index) {
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.splice(index, 1)
},
getSettlementType(item) {
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
// 酒店
getRenderingData() {
this.datas = this.HotelOrderListReport[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList
.ReimburseDetailsList[0]))
},
showOptionVisible(index) {
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this
.ReimIndex].UserTypeStr,
id: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this
.ReimIndex].UserType,
}
},
close() {
this.optionVisible = false
},
popupCurrent(value) {
this.optionVisible = false
let findIndex = this.optionList.findIndex(x => x.id == value)
this.optionObj = this.optionList[findIndex]
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserTypeStr = this.optionObj.name
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.map(x => {
return x.url
}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
this.dataIndex = this.params.dataIndex2 },
this.getRenderingData() },
this.getTotal() });
}, },
deep:true, addData() {
immediate:true this.ReimDatas = {
}, ...this.ReimDatas,
datas:{ ID: 0,
handler(newVal,oldVal){ UserType: 0,
this.updateData() UserTypeStr: '',
}, UserNum: 0,
deep:true, UnitPrice: 0,
immediate:false }
} this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(JSON
}, .stringify(this.ReimDatas)))
mounted() { },
onSuccess(infor) {
}, this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.push({
methods:{ FileName: infor.name,
getNum(e,index,type){ url: infor.url,
if(type=='数量') { })
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value }
}else if(type=='金额'){ }
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[index].UnitPrice = e.value }
}
this.getTotal()
},
getTotal(){
let total = 0
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.forEach(x=>{
total+=x.UserNum*x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index){
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.splice(index,1)
},
delImg(index){
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.splice(index,1)
},
getSettlementType(item){
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
// 酒店
getRenderingData(){
this.datas = this.HotelOrderListReport[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[0]))
},
showOptionVisible(index){
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr,
id: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType,
}
},
close(){
this.optionVisible = false
},
popupCurrent(value){
this.optionVisible = false
let findIndex = this.optionList.findIndex(x=>x.id==value)
this.optionObj = this.optionList[findIndex]
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr = this.optionObj.name
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.map(x=> {return x.url}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
},
},
});
},
addData(){
this.ReimDatas = {
...this.ReimDatas,
ID: 0,
UserType: 0,
UserTypeStr: '',
UserNum: 0,
UnitPrice: 0,
}
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(JSON.stringify(this.ReimDatas)))
},
onSuccess(infor){
this.datas.HotelOrderList[this.datas.hotelIndex].ReimburseList.VoucherPicList.push({
FileName: infor.name,
url: infor.url,
})
}
}
}
</script> </script>
\ No newline at end of file
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.Sure{
padding: 0 20rpx; .Sure {
margin-top: 30rpx; padding: 0 20rpx;
} margin-top: 30rpx;
.Sure view{ }
background: #257BF2;
border-radius: 80rpx; .Sure view {
line-height: 80rpx; background: #257BF2;
font-size: 32rpx; border-radius: 80rpx;
color: #fff; line-height: 80rpx;
} font-size: 32rpx;
color: #fff;
.paymentTitle{ }
font-size: 28rpx;
} .paymentTitle {
.paymentTexts view{ font-size: 28rpx;
padding: 5rpx 15rpx; }
border: 1px solid #EDEDED;
color: #888888; .paymentTexts view {
border-radius: 6rpx; padding: 5rpx 15rpx;
} border: 1px solid #EDEDED;
.paymentTexts view:last-child{ color: #888888;
margin-left: 40rpx; border-radius: 6rpx;
} }
.paymentTexts view.active{
color: #fff; .paymentTexts view:last-child {
background: #257BF2; margin-left: 40rpx;
border: 1px solid #257BF2; }
}
.paymentTitle .tisp{ .paymentTexts view.active {
color: #666666; color: #fff;
} background: #257BF2;
.textareaBox textarea{ border: 1px solid #257BF2;
height: 208rpx; }
background: #FFFFFF;
border: 1rpx solid #EAEAEA; .paymentTitle .tisp {
border-radius: 10rpx; color: #666666;
} }
.InforImgBox{
flex-wrap: wrap; .textareaBox textarea {
} height: 208rpx;
.InforImg,.addUp{ background: #FFFFFF;
width: 208rpx; border: 1rpx solid #EAEAEA;
height: 208rpx; border-radius: 10rpx;
margin-bottom: 20rpx; }
}
.InforImg{ .InforImgBox {
border-radius: 10rpx; flex-wrap: wrap;
margin-right: 20rpx; }
position: relative;
} .InforImg,
.InforImg image{ .addUp {
width: 100%; width: 208rpx;
height: 100%; height: 208rpx;
border-radius: 10rpx; margin-bottom: 20rpx;
} }
.InforImgDel{
position: absolute; .InforImg {
left: 0; border-radius: 10rpx;
top: -14rpx; margin-right: 20rpx;
z-index: 1; position: relative;
background: #fff; }
border-radius: 50%;
} .InforImg image {
.inforCenter{ width: 100%;
border-radius: 10rpx; height: 100%;
overflow: hidden; border-radius: 10rpx;
border: 1px solid rgba(102,102,102,0.3); }
margin-bottom: 40rpx;
position: relative; .InforImgDel {
} position: absolute;
.inforCenter:last-child{ left: 0;
margin-bottom: 0; top: -14rpx;
} z-index: 1;
.inforCenterTop{ background: #fff;
background: #F3F3F3; border-radius: 50%;
padding: 20rpx 29rpx; }
font-size: 32rpx;
color: #333333; .inforCenter {
} border-radius: 10rpx;
.inputBox{ overflow: hidden;
padding: 20rpx 0; border: 1px solid rgba(102, 102, 102, 0.3);
margin: 0 29rpx; margin-bottom: 40rpx;
border-bottom:1px solid #DDD ; position: relative;
font-size: 28rpx; }
}
.inputBox.noBorder{ .inforCenter:last-child {
border: 0; margin-bottom: 0;
} }
.tisp{
color: red; .inforCenterTop {
} background: #F3F3F3;
.inputBoxRight{ padding: 20rpx 29rpx;
position: relative; font-size: 32rpx;
} color: #333333;
.inputBoxRight u-number-box{ }
position: absolute;
right: 0; .inputBox {
top: -7rpx; padding: 20rpx 0;
} margin: 0 29rpx;
/deep/.inputBoxRight u-number-box input{ border-bottom: 1px solid #DDD;
width: 130rpx !important; font-size: 28rpx;
min-width: 130rpx !important; }
}
.inforCenterTopDel{ .inputBox.noBorder {
position: absolute; border: 0;
left: -7rpx; }
top: -7rpx;
padding: 5rpx; .tisp {
z-index: 1; color: red;
} }
.inputBoxRight {
</style> 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;
}
.inforCenterTopDel {
position: absolute;
left: -7rpx;
top: -7rpx;
padding: 5rpx;
z-index: 1;
}
</style>
<template> <template>
<view> <view>
<view class="inforCenterBox PX30 MT20"> <view class="inforCenterBox PX30 MT20">
<view class="inforCenter" v-for="(item,index) in datas.DiningSummaryList[datas.diningIndex].ReimburseList.ReimburseDetailsList" <view class="inforCenter"
:key="index"> v-for="(item,index) in datas.DiningSummaryList[datas.diningIndex].ReimburseList.ReimburseDetailsList"
<view class="inforCenterTop row justify-between" @click="showOptionVisible(index)"> :key="index">
<view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view> <view class="inforCenterTop row justify-between" @click="showOptionVisible(index)">
<view> <view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view>
<u-icon name="arrow-down" color="#BBBBBB" size="42"/> <view>
</view> <u-icon name="arrow-down" color="#BBBBBB" size="42" />
</view> </view>
<u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967" size="36"/> </view>
<view class="inputBox row justify-between"> <u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967"
<view class="row"> size="36" />
<text>数量</text> <view class="inputBox row justify-between">
</view> <view class="row">
<view class="inputBoxRight"> <text>数量</text>
<u-number-box :min="0" :value="item.UserNum" @change="(e)=>getNum(e,index,'数量')"/> </view>
</view> <view class="inputBoxRight">
</view>
<view class="inputBox row justify-between"> <input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<view class="row"> </view>
<text>单价</text> </view>
</view> <view class="inputBox row justify-between">
<view class="inputBoxRight"> <view class="row">
<u-number-box :min="0" :max="99999999999999999" v-model="item.UnitPrice" @change="(e)=>getNum(e,index,'金额')"/> <text>单价</text>
</view> </view>
</view> <view class="inputBoxRight">
<view class="inputBox row justify-between noBorder">
<view class="row"> <input class="text-right" type="number" v-model="item.UnitPrice" @input="getNum()" />
<text>金额小计</text> </view>
</view> </view>
<view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view> <view class="inputBox row justify-between noBorder">
</view> <view class="row">
</view> <text>金额小计</text>
</view> </view>
<view class="Sure"> <view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view>
<view class="text-center" @click="addData">添加</view> </view>
</view> </view>
<view class="paymentTitle PA30">支付方式</view> </view>
<view class="PX30 PB20 paymentTexts row"> <view class="Sure">
<template v-for="(item,index) in paymentList"> <view class="text-center" @click="addData">添加</view>
<view :class="[datas.DiningSummaryList[datas.diningIndex].ReimburseList.SettlementType==item.id?'active':'']" @click="getSettlementType(item)">{{ item.name }}</view> </view>
</template> <view class="paymentTitle PA30">支付方式</view>
</view> <view class="PX30 PB20 paymentTexts row">
<view class="paymentTitle PA30">备注</view> <template v-for="(item,index) in paymentList">
<view class="textareaBox PX30 row"> <view
<textarea class="PA20 flex1" placeholder-style="color:#AAAAAA" :class="[datas.DiningSummaryList[datas.diningIndex].ReimburseList.SettlementType==item.id?'active':'']"
v-model="datas.DiningSummaryList[datas.diningIndex].ReimburseList.Remarks" placeholder="请输入备注信息" @blur="updateData"/> @click="getSettlementType(item)">{{ item.name }}</view>
</view> </template>
<view class="paymentTitle PA30"> </view>
<text>凭证</text> <view class="paymentTitle PA30">备注</view>
<text class="tisp">(可上传多张图片)</text> <view class="textareaBox PX30 row">
</view> <textarea class="PA20 flex1" placeholder-style="color:#AAAAAA"
<view class="PX30 PB30 row InforImgBox"> v-model="datas.DiningSummaryList[datas.diningIndex].ReimburseList.Remarks" placeholder="请输入备注信息"
<view class="InforImg" v-for="(item,index) in datas.DiningSummaryList[datas.diningIndex].ReimburseList.VoucherPicList" > @blur="updateData" />
<image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image> </view>
<u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36"/> <view class="paymentTitle PA30">
</view> <text>凭证</text>
<upload class="addUp" @onSuccess="onSuccess"></upload> <text class="tisp">(可上传多张图片)</text>
</view> </view>
<singleChoice v-if="optionVisible" <view class="PX30 PB30 row InforImgBox">
:current="optionObj.id" <view class="InforImg"
:list="optionList" v-for="(item,index) in datas.DiningSummaryList[datas.diningIndex].ReimburseList.VoucherPicList">
@close="close" @change="popupCurrent"></singleChoice> <image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image>
</view> <u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36" />
</view>
<upload class="addUp" @onSuccess="onSuccess"></upload>
</view>
<singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close"
@change="popupCurrent"></singleChoice>
</view>
</template> </template>
<script> <script>
import upload from "../upload"; import upload from "../upload";
import singleChoice from "../singleChoice"; import singleChoice from "../singleChoice";
export default { export default {
props:['data','optionList'], props: ['data', 'dataIndex3', 'optionList'],
components: { components: {
upload, upload,
singleChoice, singleChoice,
}, },
data() { data() {
return { return {
paymentList:[ paymentList: [{
{name:'现金支付',id:1}, name: '现金支付',
{name:'公司结算',id:2}, id: 1
], },
optionVisible: false, {
optionObj:{}, name: '公司结算',
params: {}, id: 2
datas: null,//展示数据 },
dataIndex: 0, ],
ReimIndex: 0, optionVisible: false,
ReimDatas: {}, optionObj: {},
BusList:[], //车信息 params: {},
HotelOrderListReport:[], //酒店信息,合团 datas: null, //展示数据
DiningList:[], //餐厅 dataIndex: 0,
ScenicList:[], //景点 ReimIndex: 0,
OtherList:[], //其他订单信息 ReimDatas: {},
TipList:[], //小费收入 DiningList: [], //餐厅
TeamList:[], //团费小计 }
SelfPlayingIncomeList:[], //自费收入 },
SelfPlayingExpendList:[], //自费支出 watch: {
LeaderShopList:[], //购物报账 data: {
} handler(newVal, oldVal) {
}, if (newVal && oldVal) {
watch: { //切换用餐日期
data:{ if (newVal.dataIndex3 != oldVal.dataIndex3) {
handler(newVal,oldVal){ this.initData();
this.params = JSON.parse(JSON.stringify(newVal)) }
this.DiningList = this.params.DiningList //切换同一天餐厅
else if (oldVal.DiningList[this.dataIndex3].diningIndex != newVal.DiningList[this.dataIndex3]
.diningIndex) {
this.initData();
}
}
},
deep: true,
immediate: true
},
},
mounted() {
this.initData();
},
methods: {
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.DiningList = this.params.DiningList
this.dataIndex = this.dataIndex3;
this.getRenderingData()
this.getTotal();
},
getNum(e, index, type) {
this.getTotal()
},
getTotal() {
let total = 0
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index) {
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.splice(index, 1)
},
delImg(index) {
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.splice(index, 1)
},
getSettlementType(item) {
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
getRenderingData() {
this.datas = this.DiningList[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.DiningSummaryList[this.datas.diningIndex]
.ReimburseList.ReimburseDetailsList[0]))
},
showOptionVisible(index) {
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this
.ReimIndex].UserTypeStr,
id: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this
.ReimIndex].UserType,
}
},
close() {
this.optionVisible = false
},
popupCurrent(value) {
this.optionVisible = false
let findIndex = this.optionList.findIndex(x => x.id == value)
this.optionObj = this.optionList[findIndex]
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserTypeStr = this.optionObj.name
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.map(
x => {
return x.url
}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
this.dataIndex = this.params.dataIndex3 },
this.getRenderingData() },
this.getTotal() });
}, },
deep:true, addData() {
immediate:true this.ReimDatas = {
}, ...this.ReimDatas,
datas:{ ID: 0,
handler(newVal,oldVal){ UserType: 0,
this.updateData() UserTypeStr: '',
}, UserNum: 0,
deep:true, UnitPrice: 0,
immediate:false }
} this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(
}, JSON.stringify(this.ReimDatas)))
mounted() { },
onSuccess(infor) {
}, this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.push({
methods:{ FileName: infor.name,
getNum(e,index,type){ url: infor.url,
if(type=='数量') { })
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value }
}else if(type=='金额'){ }
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[index].UnitPrice = e.value }
}
this.getTotal()
},
getTotal(){
let total = 0
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.forEach(x=>{
total+=x.UserNum*x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index){
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.splice(index,1)
},
delImg(index){
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.splice(index,1)
},
getSettlementType(item){
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
getRenderingData(){
this.datas = this.DiningList[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[0]))
},
showOptionVisible(index){
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr,
id: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType,
}
},
close(){
this.optionVisible = false
},
popupCurrent(value){
this.optionVisible = false
let findIndex = this.optionList.findIndex(x=>x.id==value)
this.optionObj = this.optionList[findIndex]
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr = this.optionObj.name
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.map(x=> {return x.url}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
},
},
});
},
addData(){
this.ReimDatas = {
...this.ReimDatas,
ID: 0,
UserType: 0,
UserTypeStr: '',
UserNum: 0,
UnitPrice: 0,
}
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(JSON.stringify(this.ReimDatas)))
},
onSuccess(infor){
this.datas.DiningSummaryList[this.datas.diningIndex].ReimburseList.VoucherPicList.push({
FileName: infor.name,
url: infor.url,
})
}
}
}
</script> </script>
\ No newline at end of file
<style lang="scss" scoped> <style lang="scss" scoped>
@import url("@/asset/css/flex.css"); @import url("@/asset/css/flex.css");
.Sure{
padding: 0 20rpx; .Sure {
margin-top: 30rpx; padding: 0 20rpx;
} margin-top: 30rpx;
.Sure view{ }
background: #257BF2;
border-radius: 80rpx; .Sure view {
line-height: 80rpx; background: #257BF2;
font-size: 32rpx; border-radius: 80rpx;
color: #fff; line-height: 80rpx;
} font-size: 32rpx;
color: #fff;
.paymentTitle{ }
font-size: 28rpx;
} .paymentTitle {
.paymentTexts view{ font-size: 28rpx;
padding: 5rpx 15rpx; }
border: 1px solid #EDEDED;
color: #888888; .paymentTexts view {
border-radius: 6rpx; padding: 5rpx 15rpx;
} border: 1px solid #EDEDED;
.paymentTexts view:last-child{ color: #888888;
margin-left: 40rpx; border-radius: 6rpx;
} }
.paymentTexts view.active{
color: #fff; .paymentTexts view:last-child {
background: #257BF2; margin-left: 40rpx;
border: 1px solid #257BF2; }
}
.paymentTitle .tisp{ .paymentTexts view.active {
color: #666666; color: #fff;
} background: #257BF2;
.textareaBox textarea{ border: 1px solid #257BF2;
height: 208rpx; }
background: #FFFFFF;
border: 1rpx solid #EAEAEA; .paymentTitle .tisp {
border-radius: 10rpx; color: #666666;
} }
.InforImgBox{
flex-wrap: wrap; .textareaBox textarea {
} height: 208rpx;
.InforImg,.addUp{ background: #FFFFFF;
width: 208rpx; border: 1rpx solid #EAEAEA;
height: 208rpx; border-radius: 10rpx;
margin-bottom: 20rpx; }
}
.InforImg{ .InforImgBox {
border-radius: 10rpx; flex-wrap: wrap;
margin-right: 20rpx; }
position: relative;
} .InforImg,
.InforImg image{ .addUp {
width: 100%; width: 208rpx;
height: 100%; height: 208rpx;
border-radius: 10rpx; margin-bottom: 20rpx;
} }
.InforImgDel{
position: absolute; .InforImg {
left: 0; border-radius: 10rpx;
top: -14rpx; margin-right: 20rpx;
z-index: 1; position: relative;
background: #fff; }
border-radius: 50%;
} .InforImg image {
.inforCenter{ width: 100%;
border-radius: 10rpx; height: 100%;
overflow: hidden; border-radius: 10rpx;
border: 1px solid rgba(102,102,102,0.3); }
margin-bottom: 40rpx;
position: relative; .InforImgDel {
} position: absolute;
.inforCenter:last-child{ left: 0;
margin-bottom: 0; top: -14rpx;
} z-index: 1;
.inforCenterTop{ background: #fff;
background: #F3F3F3; border-radius: 50%;
padding: 20rpx 29rpx; }
font-size: 32rpx;
color: #333333; .inforCenter {
} border-radius: 10rpx;
.inputBox{ overflow: hidden;
padding: 20rpx 0; border: 1px solid rgba(102, 102, 102, 0.3);
margin: 0 29rpx; margin-bottom: 40rpx;
border-bottom:1px solid #DDD ; position: relative;
font-size: 28rpx; }
}
.inputBox.noBorder{ .inforCenter:last-child {
border: 0; margin-bottom: 0;
} }
.tisp{
color: red; .inforCenterTop {
} background: #F3F3F3;
.inputBoxRight{ padding: 20rpx 29rpx;
position: relative; font-size: 32rpx;
} color: #333333;
.inputBoxRight u-number-box{ }
position: absolute;
right: 0; .inputBox {
top: -7rpx; padding: 20rpx 0;
} margin: 0 29rpx;
/deep/.inputBoxRight u-number-box input{ border-bottom: 1px solid #DDD;
width: 130rpx !important; font-size: 28rpx;
min-width: 130rpx !important; }
}
.inforCenterTopDel{ .inputBox.noBorder {
position: absolute; border: 0;
left: -7rpx; }
top: -7rpx;
padding: 5rpx; .tisp {
z-index: 1; color: red;
} }
.inputBoxRight {
</style> 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;
}
.inforCenterTopDel {
position: absolute;
left: -7rpx;
top: -7rpx;
padding: 5rpx;
z-index: 1;
}
</style>
<template> <template>
<view> <view>
<view class="inforCenterBox PX30 MT20"> <view class="inforCenterBox PX30 MT20">
<view class="inforCenter" v-for="(item,index) in datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.ReimburseDetailsList" <view class="inforCenter"
:key="index"> v-for="(item,index) in datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.ReimburseDetailsList"
<view class="inforCenterTop row justify-between" @click="showOptionVisible(index)"> :key="index">
<view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view> <view class="inforCenterTop row justify-between" @click="showOptionVisible(index)">
<view> <view>{{ item.UserTypeStr?item.UserTypeStr:'选择类型' }}</view>
<u-icon name="arrow-down" color="#BBBBBB" size="42"/> <view>
</view> <u-icon name="arrow-down" color="#BBBBBB" size="42" />
</view> </view>
<u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967" size="36"/> </view>
<view class="inputBox row justify-between"> <u-icon v-if="index" @click="delInfor(index)" class="inforCenterTopDel" name="clear" color="#FA6967"
<view class="row"> size="36" />
<text>数量</text> <view class="inputBox row justify-between">
</view> <view class="row">
<view class="inputBoxRight"> <text>数量</text>
<u-number-box :min="0" :value="item.UserNum" @change="(e)=>getNum(e,index,'数量')"/> </view>
</view> <view class="inputBoxRight">
</view> <input class="text-right" type="number" v-model="item.UserNum" @input="getNum()" />
<view class="inputBox row justify-between"> </view>
<view class="row"> </view>
<text>单价</text> <view class="inputBox row justify-between">
</view> <view class="row">
<view class="inputBoxRight"> <text>单价</text>
<u-number-box :min="0" :max="99999999999999999" v-model="item.UnitPrice" @change="(e)=>getNum(e,index,'金额')"/> </view>
</view> <view class="inputBoxRight">
</view> <input class="text-right" type="number" v-model="item.UnitPrice" @input="getNum()" />
<view class="inputBox row justify-between noBorder"> </view>
<view class="row"> </view>
<text>金额小计</text> <view class="inputBox row justify-between noBorder">
</view> <view class="row">
<view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view> <text>金额小计</text>
</view> </view>
</view> <view class="text-right">{{ (item.UserNum*item.UnitPrice).toFixed(2) }}</view>
</view> </view>
<view class="Sure"> </view>
<view class="text-center" @click="addData">添加</view> </view>
</view> <view class="Sure">
<view class="paymentTitle PA30">支付方式</view> <view class="text-center" @click="addData">添加</view>
<view class="PX30 PB20 paymentTexts row"> </view>
<template v-for="(item,index) in paymentList"> <view class="paymentTitle PA30">支付方式</view>
<view :class="[datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.SettlementType==item.id?'active':'']" @click="getSettlementType(item)">{{ item.name }}</view> <view class="PX30 PB20 paymentTexts row">
</template> <template v-for="(item,index) in paymentList">
</view> <view
<view class="paymentTitle PA30">备注</view> :class="[datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.SettlementType==item.id?'active':'']"
<view class="textareaBox PX30 row"> @click="getSettlementType(item)">{{ item.name }}</view>
<textarea class="PA20 flex1" placeholder-style="color:#AAAAAA" </template>
v-model="datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.Remarks" placeholder="请输入备注信息" @blur="updateData"/> </view>
</view> <view class="paymentTitle PA30">备注</view>
<view class="paymentTitle PA30"> <view class="textareaBox PX30 row">
<text>凭证</text> <textarea class="PA20 flex1" placeholder-style="color:#AAAAAA"
<text class="tisp">(可上传多张图片)</text> v-model="datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.Remarks" placeholder="请输入备注信息"
</view> @blur="updateData" />
<view class="PX30 PB30 row InforImgBox"> </view>
<view class="InforImg" v-for="(item,index) in datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.VoucherPicList" > <view class="paymentTitle PA30">
<image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image> <text>凭证</text>
<u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36"/> <text class="tisp">(可上传多张图片)</text>
</view> </view>
<upload class="addUp" @onSuccess="onSuccess"></upload> <view class="PX30 PB30 row InforImgBox">
</view> <view class="InforImg"
<singleChoice v-if="optionVisible" v-for="(item,index) in datas.ScenicStatisticsList[datas.scenicIndex].ReimburseList.VoucherPicList">
:current="optionObj.id" <image :src="item.url" mode="aspectFill" @click="previewImage(item.url)"></image>
:list="optionList" <u-icon @click="delImg(index)" class="InforImgDel" name="clear" color="#FA6967" size="36" />
@close="close" @change="popupCurrent"></singleChoice> </view>
</view> <upload class="addUp" @onSuccess="onSuccess"></upload>
</view>
<singleChoice v-if="optionVisible" :current="optionObj.id" :list="optionList" @close="close"
@change="popupCurrent"></singleChoice>
</view>
</template> </template>
<script> <script>
import upload from "../upload"; import upload from "../upload";
import singleChoice from "../singleChoice"; import singleChoice from "../singleChoice";
export default { export default {
props:['data','optionList'], props: ['data', 'dataIndex4', 'optionList'],
components: { components: {
upload, upload,
singleChoice, singleChoice,
}, },
data() { data() {
return { return {
paymentList:[ paymentList: [{
{name:'现金支付',id:1}, name: '现金支付',
{name:'公司结算',id:2}, id: 1
], },
optionVisible: false, {
optionObj:{}, name: '公司结算',
params: {}, id: 2
datas: null,//展示数据 },
dataIndex: 0, ],
ReimIndex: 0, optionVisible: false,
ReimDatas: {}, optionObj: {},
BusList:[], //车信息 params: {},
HotelOrderListReport:[], //酒店信息,合团 datas: null, //展示数据
DiningList:[], //餐厅 dataIndex: 0,
ScenicList:[], //景点 ReimIndex: 0,
OtherList:[], //其他订单信息 ReimDatas: {},
TipList:[], //小费收入 ScenicList: [], //景点
TeamList:[], //团费小计 }
SelfPlayingIncomeList:[], //自费收入 },
SelfPlayingExpendList:[], //自费支出 watch: {
LeaderShopList:[], //购物报账 data: {
} handler(newVal, oldVal) {
}, if (newVal && oldVal) {
watch: { //切换日期
data:{ if (newVal.dataIndex4 != oldVal.dataIndex4) {
handler(newVal,oldVal){ this.initData();
this.params = JSON.parse(JSON.stringify(newVal)) }
this.ScenicList = this.params.ScenicList //切换同一天的景点
else if (oldVal.ScenicList[this.dataIndex4].scenicIndex != newVal.ScenicList[this.dataIndex4]
.scenicIndex) {
this.initData();
}
}
},
deep: true,
immediate: true
},
},
mounted() {
this.initData();
},
methods: {
initData() {
this.params = JSON.parse(JSON.stringify(this.data))
this.ScenicList = this.params.ScenicList
this.dataIndex = this.dataIndex4;
this.getRenderingData()
this.getTotal()
},
getNum() {
this.getTotal()
},
getTotal() {
let total = 0
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.forEach(x => {
total += x.UserNum * x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index) {
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.splice(index, 1)
},
delImg(index) {
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.splice(index, 1)
},
getSettlementType(item) {
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
getRenderingData() {
this.datas = this.ScenicList[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.ScenicStatisticsList[this.datas.scenicIndex]
.ReimburseList.ReimburseDetailsList[0]))
},
showOptionVisible(index) {
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[
this.ReimIndex].UserTypeStr,
id: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this
.ReimIndex].UserType,
}
},
close() {
this.optionVisible = false
},
popupCurrent(value) {
this.optionVisible = false
let findIndex = this.optionList.findIndex(x => x.id == value)
this.optionObj = this.optionList[findIndex]
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserTypeStr = this.optionObj.name
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex]
.UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.map(
x => {
return x.url
}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
this.dataIndex = this.params.dataIndex4 },
this.getRenderingData() },
this.getTotal() });
}, },
deep:true, addData() {
immediate:true this.ReimDatas = {
}, ...this.ReimDatas,
datas:{ ID: 0,
handler(newVal,oldVal){ UserType: 0,
this.updateData() UserTypeStr: '',
}, UserNum: 0,
deep:true, UnitPrice: 0,
immediate:false }
} this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(
}, JSON.stringify(this.ReimDatas)))
mounted() { },
onSuccess(infor) {
}, this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.push({
methods:{ FileName: infor.name,
getNum(e,index,type){ url: infor.url,
if(type=='数量') { })
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[index].UserNum = e.value }
}else if(type=='金额'){ }
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[index].UnitPrice = e.value }
}
this.getTotal()
},
getTotal(){
let total = 0
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.forEach(x=>{
total+=x.UserNum*x.UnitPrice
})
this.datas.TotalMoney = total
this.updateData()
},
delInfor(index){
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.splice(index,1)
},
delImg(index){
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.splice(index,1)
},
getSettlementType(item){
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.SettlementType = item.id
this.updateData()
this.$forceUpdate()
},
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)
},
getRenderingData(){
this.datas = this.ScenicList[this.dataIndex]
this.ReimDatas = JSON.parse(JSON.stringify(this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[0]))
},
showOptionVisible(index){
this.optionVisible = true
this.ReimIndex = index
this.optionObj = {
name: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr,
id: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType,
}
},
close(){
this.optionVisible = false
},
popupCurrent(value){
this.optionVisible = false
let findIndex = this.optionList.findIndex(x=>x.id==value)
this.optionObj = this.optionList[findIndex]
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserTypeStr = this.optionObj.name
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList[this.ReimIndex].UserType = this.optionObj.id
},
previewImage(src) {
uni.previewImage({
urls: this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.map(x=> {return x.url}),
current: src,
longPressActions: {
itemList: ["发送给朋友", "保存图片", "收藏"],
success: function(data) {
},
fail: function(err) {
},
},
});
},
addData(){
this.ReimDatas = {
...this.ReimDatas,
ID: 0,
UserType: 0,
UserTypeStr: '',
UserNum: 0,
UnitPrice: 0,
}
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.ReimburseDetailsList.push(JSON.parse(JSON.stringify(this.ReimDatas)))
},
onSuccess(infor){
this.datas.ScenicStatisticsList[this.datas.scenicIndex].ReimburseList.VoucherPicList.push({
FileName: infor.name,
url: infor.url,
})
}
}
}
</script> </script>
\ No newline at end of file
...@@ -89,34 +89,38 @@ ...@@ -89,34 +89,38 @@
</headeDatas> </headeDatas>
</view> </view>
<!-- 车信息--> <!-- 车信息-->
<productInfor1 v-if="params.type==1" :data="params" :dataIndex1="params.dataIndex1" @change="getNewData" :optionList="busTypeList"> <productInfor1 v-if="params.type==1" :data="params" :dataIndex1="params.dataIndex1" @change="getNewData"
:optionList="busTypeList">
</productInfor1> </productInfor1>
<!-- 酒店信息--> <!-- 酒店信息-->
<productInfor2 :data="params" v-if="params.type==2" @change="getNewData" :optionList="hotelTypeList"> <productInfor2 v-else-if="params.type==2" :data="params" :dataIndex2="params.dataIndex2"
@change="getNewData" :optionList="hotelTypeList">
</productInfor2> </productInfor2>
<!-- 餐食信息--> <!-- 餐食信息-->
<productInfor3 :data="params" v-else-if="params.type==3" @change="getNewData" :optionList="diningTypeList"> <productInfor3 v-else-if="params.type==3" :data="params" :dataIndex3="params.dataIndex3"
@change="getNewData" :optionList="diningTypeList">
</productInfor3> </productInfor3>
<!-- 门票信息--> <!-- 门票信息-->
<productInfor4 :data="params" v-else-if="params.type==4" @change="getNewData" :optionList="scenicTypeList"> <productInfor4 v-else-if="params.type==4" :data="params" :dataIndex4="params.dataIndex4"
@change="getNewData" :optionList="scenicTypeList">
</productInfor4> </productInfor4>
<!-- 其它信息--> <!-- 其它信息-->
<otherInfor1 :currencyList="currencyList" :data="params" v-else-if="params.type==5" @change="getNewData" <otherInfor1 v-else-if="params.type==5" :currencyList="currencyList" :data="params" @change="getNewData"
:options="otherTypeList"></otherInfor1> :options="otherTypeList"></otherInfor1>
<!-- 小费收入--> <!-- 小费收入-->
<otherInfor2 :currencyList="currencyList" :data="params" v-else-if="params.type==6" @change="getNewData"> <otherInfor2 v-else-if="params.type==6" :currencyList="currencyList" :data="params" @change="getNewData">
</otherInfor2> </otherInfor2>
<!-- 团费小计--> <!-- 团费小计-->
<otherInfor3 :currencyList="currencyList" :data="params" v-else-if="params.type==7" @change="getNewData"> <otherInfor3 v-else-if="params.type==7" :currencyList="currencyList" :data="params" @change="getNewData">
</otherInfor3> </otherInfor3>
<!-- 自费收入--> <!-- 自费收入-->
<otherInfor4 :currencyList="currencyList" :data="params" v-else-if="params.type==8" @change="getNewData"> <otherInfor4 v-else-if="params.type==8" :currencyList="currencyList" :data="params" @change="getNewData">
</otherInfor4> </otherInfor4>
<!-- 自费支出--> <!-- 自费支出-->
<otherInfor5 :currencyList="currencyList" :data="params" v-else-if="params.type==9" @change="getNewData"> <otherInfor5 v-else-if="params.type==9" :currencyList="currencyList" :data="params" @change="getNewData">
</otherInfor5> </otherInfor5>
<!-- 购物报账--> <!-- 购物报账-->
<otherInfor6 :currencyList="currencyList" :data="params" v-else-if="params.type==10" @change="getNewData" <otherInfor6 v-else-if="params.type==10" :currencyList="currencyList" :data="params" @change="getNewData"
:options="shopTypeList"></otherInfor6> :options="shopTypeList"></otherInfor6>
</scroll-view> </scroll-view>
<view v-if="params.IsOperation==0" class="saveBox" @click="saveData"> <view v-if="params.IsOperation==0" class="saveBox" @click="saveData">
...@@ -534,9 +538,11 @@ ...@@ -534,9 +538,11 @@
} }
if (this.loading) return if (this.loading) return
this.loading = true this.loading = true
uni.showLoading() uni.showLoading({
title: '保存中...'
})
this.apipost("dmcstatistics_post_SetNewLeaderApplyList_V2", this.params, (res) => { this.apipost("dmcstatistics_post_SetNewLeaderApplyList_V2", this.params, (res) => {
console.log("dmcstatistics_post_SetNewLeaderApplyList_V2",JSON.parse(JSON.stringify(res.data))); uni.hideLoading()
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.loading = false this.loading = false
uni.showToast({ uni.showToast({
...@@ -544,10 +550,8 @@ ...@@ -544,10 +550,8 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}); });
uni.hideLoading()
this.init() this.init()
} }
}, (failed) => { }, (failed) => {
this.loading = false this.loading = false
uni.showToast({ uni.showToast({
...@@ -567,31 +571,113 @@ ...@@ -567,31 +571,113 @@
this.scrollLeft = item.left this.scrollLeft = item.left
}, },
init() { init() {
uni.showLoading() uni.showLoading({
title: '数据加载中...'
});
this.apipost("dmcstatistics_post_GetNewLeaderPayMoneyStatics", this.msg, (res) => { this.apipost("dmcstatistics_post_GetNewLeaderPayMoneyStatics", this.msg, (res) => {
console.log("dmcstatistics_post_GetNewLeaderPayMoneyStatics",JSON.parse(JSON.stringify(res.data)));
if (res.resultCode == 1) { if (res.resultCode == 1) {
this.params = res.data; this.params = res.data;
console.log("dmcstatistics_post_GetNewLeaderPayMoneyStatics", JSON.parse(JSON.stringify(
this.params)));
for (let i = 1; i < 5; i++) { for (let i = 1; i < 5; i++) {
this.$set(this.params, `dataIndex${i}`, 0); this.$set(this.params, `dataIndex${i}`, 0);
} }
this.$set(this.params, `type`, this.oldDataIndex); this.$set(this.params, `type`, this.oldDataIndex);
for (let i = 0; i < this.params.ScenicList.length; i++) {
this.$set(this.params.ScenicList[i], `TotalMoney`, 0); if (this.params.BusList && this.params.BusList.length > 0) {
this.$set(this.params.ScenicList[i], `scenicIndex`, 0); for (let i = 0; i < this.params.BusList.length; i++) {
this.$set(this.params.BusList, `TotalMoney`, 0);
}
this.params.BusList.forEach(item => {
var totalMoney = 0;
if (item.ReimburseList && item.ReimburseList.ReimburseDetailsList && item
.ReimburseList.ReimburseDetailsList.length > 0) {
item.ReimburseList.ReimburseDetailsList.forEach(subItem => {
totalMoney += subItem.UserNum * subItem.UnitPrice
})
}
item.TotalMoney = totalMoney;
})
} }
for (let i = 0; i < this.params.DiningList.length; i++) {
this.$set(this.params.DiningList[i], `TotalMoney`, 0); if (this.params && this.params.HotelOrderListReport && this.params.HotelOrderListReport
this.$set(this.params.DiningList[i], `diningIndex`, 0); .length > 0) {
for (let i = 0; i < this.params.HotelOrderListReport.length; i++) {
this.$set(this.params.HotelOrderListReport[i], `TotalMoney`, 0);
this.$set(this.params.HotelOrderListReport[i], `hotelIndex`, 0);
}
this.params.HotelOrderListReport.forEach(item => {
if (item.HotelOrderList && item.HotelOrderList.length > 0) {
item.HotelOrderList.forEach(subItem => {
var totalMoney = 0;
if (subItem.ReimburseList.ReimburseDetailsList && subItem
.ReimburseList.ReimburseDetailsList.length > 0) {
subItem.ReimburseList.ReimburseDetailsList.forEach(
childItem => {
totalMoney += childItem.UserNum * childItem
.UnitPrice
})
}
subItem.TotalMoney = totalMoney;
});
}
});
console.log("this.params.HotelOrderListReport",this.params.HotelOrderListReport)
} }
for (let i = 0; i < this.params.HotelOrderListReport.length; i++) {
this.$set(this.params.HotelOrderListReport[i], `TotalMoney`, 0); if (this.params && this.params.DiningList && this.params.DiningList.length > 0) {
this.$set(this.params.HotelOrderListReport[i], `hotelIndex`, 0); for (let i = 0; i < this.params.DiningList.length; i++) {
this.$set(this.params.DiningList[i], `TotalMoney`, 0);
this.$set(this.params.DiningList[i], `diningIndex`, 0);
}
this.params.DiningList.forEach(item => {
if (item.DiningSummaryList && item.DiningSummaryList.length > 0) {
item.DiningSummaryList.forEach(subItem => {
var totalMoney = 0;
if (subItem.ReimburseList && subItem.ReimburseList
.ReimburseDetailsList && subItem.ReimburseList
.ReimburseDetailsList.length > 0) {
subItem.ReimburseList.ReimburseDetailsList.forEach(
childItem => {
totalMoney += childItem.UserNum * childItem
.UnitPrice
})
}
subItem.TotalMoney = totalMoney;
})
}
})
}
if (this.params && this.params.ScenicList && this.params.ScenicList.length > 0) {
for (let i = 0; i < this.params.ScenicList.length; i++) {
this.$set(this.params.ScenicList[i], `TotalMoney`, 0);
this.$set(this.params.ScenicList[i], `scenicIndex`, 0);
}
this.params.ScenicList.forEach(item => {
if (item.ScenicStatisticsList && item.ScenicStatisticsList.length > 0) {
item.ScenicStatisticsList.forEach(subItem => {
var totalMoney = 0;
if (subItem.ReimburseList && subItem.ReimburseList
.ReimburseDetailsList && subItem.ReimburseList
.ReimburseDetailsList.length > 0) {
subItem.ReimburseList.ReimburseDetailsList.forEach(
childItem => {
totalMoney += childItem.UserNum * childItem
.UnitPrice
})
}
subItem.TotalMoney = totalMoney;
})
}
});
} }
if (res.data.CountryIds) { if (res.data.CountryIds) {
this.getShoppingType(res.data.CountryIds) this.getShoppingType(res.data.CountryIds)
} }
for (let i = 0; i < this.params.OtherOrderInfo.OtherList.length; i++) { for (let i = 0; i < this.params.OtherOrderInfo.OtherList.length; i++) {
let obj = this.params.OtherOrderInfo.OtherList[i] let obj = this.params.OtherOrderInfo.OtherList[i]
if (obj.UseDate == null && obj.UnitPrice == 0 && obj.Rebate == 0 && obj.VoucherPic != if (obj.UseDate == null && obj.UnitPrice == 0 && obj.Rebate == 0 && obj.VoucherPic !=
......
...@@ -239,13 +239,11 @@ function goZanYangUrl() { ...@@ -239,13 +239,11 @@ function goZanYangUrl() {
//验证只能输入2位小数【负数:isMinus传true】 //验证只能输入2位小数【负数:isMinus传true】
function checkPrice(value, isMinus) { function checkPrice(value, isMinus) {
console.log("checkPrice1", value);
var newValue = ''; var newValue = '';
if (value) { if (value) {
newValue = value + ''; newValue = value + '';
} }
var t = newValue.length > 0 ? newValue[0] : ''; var t = newValue.length > 0 ? newValue[0] : '';
console.log("checkPrice2", newValue);
newValue = newValue.replace(/[^\d.]/g, ''); //清除“数字”和“.”以外的字符 newValue = newValue.replace(/[^\d.]/g, ''); //清除“数字”和“.”以外的字符
newValue = newValue.replace(/\.{2,}/g, '.'); //只保留第一个. 清除多余的 newValue = newValue.replace(/\.{2,}/g, '.'); //只保留第一个. 清除多余的
newValue = newValue newValue = newValue
...@@ -263,12 +261,10 @@ function checkPrice(value, isMinus) { ...@@ -263,12 +261,10 @@ function checkPrice(value, isMinus) {
//验证只能输入整数【负数:isMinus传true】 //验证只能输入整数【负数:isMinus传true】
function checkInteger(value, isMinus) { function checkInteger(value, isMinus) {
console.log("checkInteger1", value)
var newValue = ''; var newValue = '';
if (value) { if (value) {
newValue = value + ''; newValue = value + '';
} }
console.log("checkInteger2", newValue)
var t = newValue.length > 0 ? newValue[0] : ''; var t = newValue.length > 0 ? newValue[0] : '';
newValue = newValue.replace(/[^\d]/g, ''); newValue = newValue.replace(/[^\d]/g, '');
//是否允许负数 //是否允许负数
......
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