Commit 453b718f authored by youjie's avatar youjie

no message

parent 1519e2a5
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
getClientSource(); getClientSource();
getCustomer(); getCustomer();
getTotalPrice(); getTotalPrice();
changeCustomer();
"> ">
<el-option v-for="item in customerTypeList" :label="item.Name" :value="item.Id" :key="item.Id"> <el-option v-for="item in customerTypeList" :label="item.Name" :value="item.Id" :key="item.Id">
</el-option> </el-option>
...@@ -89,7 +90,8 @@ ...@@ -89,7 +90,8 @@
<el-col :span="4" v-if="pagesTitle != '当地游产品'"> <el-col :span="4" v-if="pagesTitle != '当地游产品'">
<!-- 参团类型 --> <!-- 参团类型 -->
<el-form-item :label="$t('fnc.ctleixing')" prop="GroupType"> <el-form-item :label="$t('fnc.ctleixing')" prop="GroupType">
<el-select v-model="addMsg.GroupType" @change="changeGroupType(addMsg.GroupType),GetAutoCouponOrder()" filterable <el-select v-model="addMsg.GroupType"
@change="changeGroupType(addMsg.GroupType),GetAutoCouponOrder(),getUserCouponList()" filterable
:placeholder="$t('pub.pleaseSel')"> :placeholder="$t('pub.pleaseSel')">
<el-option v-for="item in joinTypeList" :label="item.Name" :value="item.Id" :key="item.Id"> <el-option v-for="item in joinTypeList" :label="item.Name" :value="item.Id" :key="item.Id">
</el-option> </el-option>
...@@ -264,16 +266,53 @@ ...@@ -264,16 +266,53 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
<span v-if="couponData" style="color: green;"> <span v-if="couponData" style="color: green;">
优惠活动: {{couponData.CouponsName}} 优惠活动: {{couponData.CouponsName}}
满{{couponData.UseCondition}}元可用 满{{couponData.UseCondition}}元可用
<template v-if="couponData.CouponsType==1">抵用券</template> <template v-if="couponData.CouponsType==1">抵用券</template>
<template v-if="couponData.CouponsType==2">折扣券</template> <template v-if="couponData.CouponsType==2">折扣券</template>
{{couponData.Denomination}} {{couponData.Denomination}}
</span> </span>
<span v-else style="color: red;"> <span v-else style="color: red;">
当前报名不参与公司任何优惠活动 当前报名不参与公司任何优惠活动
</span> </span>
</el-col>
<el-col :span="8" v-if="addMsg.GroupType==2&&couponList&&couponList.length>0">
<el-form-item label="优惠券" prop="">
<el-select v-model="DiscountAmountId" placeholder="选择优惠券"
@change="getDiscountAmount">
<el-option v-for="item in couponList"
:label="item.couponName"
:value="item.id"
:key="item.id"
:disabled="expiredTime(item)">
<span>
<!-- 名称: -->
<span style="color: sandybrown;">{{item.couponName}}</span>
</span>
<span>
/ <span style="color: sandybrown;">{{item.couponsType==1?'抵用券':'折扣卷'}}</span>
</span>
<span style="margin-left: 10px;margin-right: 10px;">
<span style="color:sandybrown;">{{item.useCondition}}</span>
可用
</span>
<!-- <span style="color: #E6A23C;">
{{item.expirationDate}}失效
</span> -->
</el-option>
</el-select>
<span v-if="CalculationPreference()" style="color: red;">
优惠 {{addMsg.PreferPrice-CalculationPreference()}} 元
</span>
</el-form-item>
<!-- <div v-for="(x,index) in couponList">
<span>名称:{{x.couponName}}</span>
<span>金额:{{x.denomination}}</span>
<span>{{x.expirationDate}}失效</span>
<span class="el-icon-success"></span>
</div> -->
</el-col> </el-col>
</el-row> </el-row>
<div style="width: 100%; border-top: 1px dashed #ccc; margin-bottom: 25px"></div> <div style="width: 100%; border-top: 1px dashed #ccc; margin-bottom: 25px"></div>
...@@ -674,6 +713,8 @@ ...@@ -674,6 +713,8 @@
], ],
data() { data() {
return { return {
DiscountAmountId: null,
DiscountAmountObj:{},
timer: false, timer: false,
fullHeight: document.documentElement.clientHeight, fullHeight: document.documentElement.clientHeight,
ScreenHeight: 0, ScreenHeight: 0,
...@@ -762,6 +803,7 @@ ...@@ -762,6 +803,7 @@
GatherAddress: "", GatherAddress: "",
LureEmpId: 0, //引流id LureEmpId: 0, //引流id
CRMGuestId: 0, //客人ID CRMGuestId: 0, //客人ID
CouponAllotIds: '',
}, },
uploadLloading: false, uploadLloading: false,
rules: { rules: {
...@@ -924,9 +966,45 @@ ...@@ -924,9 +966,45 @@
priceObj: {}, //团期价格信息 priceObj: {}, //团期价格信息
crmOrderObj: null, crmOrderObj: null,
couponData: null, couponData: null,
couponList:[],
}; };
}, },
methods: { methods: {
// 获取已选优惠券
getDiscountAmount(){
let obj = this.couponList.find(x=>{
return x.id==this.DiscountAmountId
})
console.log(obj,'----------------')
this.DiscountAmountObj = obj?obj:{}
},
getUserCouponList(){
let obj = this.customerList.find(x=>{
return x.customerId==this.addMsg.CustomerId
})
if(this.addMsg.GroupType!=2) {
this.couponList = []
this.DiscountAmountId = null
this.DiscountAmountObj = {}
return
}
if(obj&&obj.customerAccountId&&this.priceObj.LineID){
let params={
lineId: this.priceObj.LineID,
lineteamId:0,
CouponsUseScope:2,
userId: obj.customerAccountId
}
this.apipost('coupon_post_GetUserCanUseCouponList',params,(res)=>{
if(res.data.resultCode==1){
this.couponList = res.data.data
}
},(err)=>{
console.log(err)
})
}
},
// 大人>=2优惠 // 大人>=2优惠
GetAutoCouponOrder(){ GetAutoCouponOrder(){
this.couponData = null this.couponData = null
...@@ -1017,7 +1095,7 @@ ...@@ -1017,7 +1095,7 @@
}, },
//参团类型切换 //参团类型切换
changeGroupType(type) { changeGroupType(type) {
if ((type = !2)) { if (type = !2) {
this.addMsg.IndustryCategory = ""; this.addMsg.IndustryCategory = "";
this.addMsg.QuotationUrl = ""; this.addMsg.QuotationUrl = "";
} }
...@@ -1811,6 +1889,8 @@ ...@@ -1811,6 +1889,8 @@
}, },
//清空表单信息 //清空表单信息
clearMsg() { clearMsg() {
this.DiscountAmountId = null,
this.DiscountAmountObj = {},
this.addMsg = { this.addMsg = {
price: "0", price: "0",
GroupTypeNeedHouse: "0", GroupTypeNeedHouse: "0",
...@@ -1871,6 +1951,7 @@ ...@@ -1871,6 +1951,7 @@
GatherAddress: "", GatherAddress: "",
LureEmpId: 0, //引流id LureEmpId: 0, //引流id
CRMGuestId: 0, //客人ID CRMGuestId: 0, //客人ID
CouponAllotIds: '',
}; };
this.remarkMsg = { this.remarkMsg = {
zc: "", zc: "",
...@@ -2008,9 +2089,17 @@ ...@@ -2008,9 +2089,17 @@
this.addMsg.IsChildrenTour = this.priceObj.IsSupportChildren; this.addMsg.IsChildrenTour = this.priceObj.IsSupportChildren;
this.addMsg.IsBirdDiscount = this.priceObj.IsBirdDiscount; this.addMsg.IsBirdDiscount = this.priceObj.IsBirdDiscount;
let url; let url;
if (this.PProductType == 1) { if (this.PProductType == 1) {
if (this.pagesTitle == "跟团游产品") { if (this.pagesTitle == "跟团游产品") {
url = "sellorder_post_SetOrderInfo_02"; url = "sellorder_post_SetOrderInfo_02";
// 优惠券计算
if(this.addMsg.GroupType==2&&this.DiscountAmountId){
this.addMsg.CouponAllotIds = this.DiscountAmountId
// this.addMsg.PreferPrice = this.CalculationPreference()
}else{
this.addMsg.CouponAllotIds = ''
}
} }
if (this.pagesTitle == "当地游产品") { if (this.pagesTitle == "当地游产品") {
url = "sellorder_post_SetOneDayOrderInfo"; url = "sellorder_post_SetOneDayOrderInfo";
...@@ -2020,6 +2109,8 @@ ...@@ -2020,6 +2109,8 @@
} }
this.apipost(url, this.addMsg, (res) => { this.apipost(url, this.addMsg, (res) => {
if (res.data.resultCode == 1) { if (res.data.resultCode == 1) {
this.DiscountAmountId = null
this.DiscountAmountObj = {}
this.Success(res.data.message); this.Success(res.data.message);
this.$refs["addMsg"].resetFields(); this.$refs["addMsg"].resetFields();
this.clearMsg(); this.clearMsg();
...@@ -2030,6 +2121,53 @@ ...@@ -2030,6 +2121,53 @@
} }
}); });
}, },
// 优惠券有效期
expiredTime(item){
let start_time = item.effectDate.split(' ')[0].replace(/-/g, '-')
let end_time = item.expirationDate.split(' ')[0].replace(/-/g, '-')
let date1 = new Date(start_time);
let date2 = new Date(end_time);
let date3 = new Date();
if (this.addMsg.PreferPrice>item.useCondition
&& (date3.Format("yyyy-MM-dd") > date1.Format("yyyy-MM-dd")
&& date2.Format("yyyy-MM-dd") > date3.Format("yyyy-MM-dd"))) {
return false
}else{
return true
}
},
// 优惠券计算
CalculationPreference(){
let ChirdNum = Number(this.addMsg.ChirdNum);
if (this.addMsg.GroupType == 4) {
ChirdNum = 0;
}
let PreferPrice = 0
let DiscountNumber =
Number(this.addMsg.ManNum) +
ChirdNum +
Number(this.addMsg.OldPeopleNum)
// couponsType 优惠券类型 1:抵用券,2:折扣卷
if(DiscountNumber>0&&this.addMsg.GroupType==2&&this.DiscountAmountId){
if(this.DiscountAmountObj&&this.DiscountAmountObj.couponsType==1){
if(DiscountNumber==this.DiscountAmountObj.expansionModel.orderGuestNum){
PreferPrice = this.addMsg.PreferPrice-this.DiscountAmountObj.expansionModel.denomination
}else{
PreferPrice = this.addMsg.PreferPrice-this.DiscountAmountObj.denomination
}
}else if(this.DiscountAmountObj&&this.DiscountAmountObj.couponsType==2){
if(DiscountNumber==this.DiscountAmountObj.expansionModel.orderGuestNum){
PreferPrice = this.addMsg.PreferPrice-this.DiscountAmountObj.expansionModel.denomination
}else{
PreferPrice = this.addMsg.PreferPrice*(this.DiscountAmountObj.denomination/100)
}
}
return PreferPrice
}else {
return PreferPrice
}
},
//获取所有账户列表 //获取所有账户列表
getPlatformAccount(typeIdtwo) { getPlatformAccount(typeIdtwo) {
let platBranchId = this.CurrentUserInfo.RB_Branch_id; let platBranchId = this.CurrentUserInfo.RB_Branch_id;
...@@ -2092,10 +2230,11 @@ ...@@ -2092,10 +2230,11 @@
let obj = this.customerList.find( let obj = this.customerList.find(
(item) => item.customerId == this.addMsg.CustomerId (item) => item.customerId == this.addMsg.CustomerId
); );
this.customerId = obj.customerId; this.customerId = obj&&obj.customerId;
this.createByInfo = obj.createByInfo; this.createByInfo = obj&&obj.createByInfo;
this.addMsg.ContactName = obj.customerName + "(" + obj.contact + ")"; this.addMsg.ContactName = obj&&obj.customerName + "(" + obj.contact + ")";
this.addMsg.ContactMobile = obj.contactNumber; this.addMsg.ContactMobile = obj&&obj.contactNumber;
if (this.CurrentUserInfo.EmployeeId != this.createByInfo) { if (this.CurrentUserInfo.EmployeeId != this.createByInfo) {
this.addMsg.CommissionSharePeople = this.createByInfo; this.addMsg.CommissionSharePeople = this.createByInfo;
this.isUpdateSharePeople = true; this.isUpdateSharePeople = true;
...@@ -2341,6 +2480,13 @@ ...@@ -2341,6 +2480,13 @@
PTCID: function (oldValue, newVal) { PTCID: function (oldValue, newVal) {
}, },
'addMsg.CustomerId':{
handler(oldValue, newVal) {
if(oldValue){
this.getUserCouponList()
}
}
}
}, },
}; };
......
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