Commit 453b718f authored by youjie's avatar youjie

no message

parent 1519e2a5
......@@ -80,6 +80,7 @@
getClientSource();
getCustomer();
getTotalPrice();
changeCustomer();
">
<el-option v-for="item in customerTypeList" :label="item.Name" :value="item.Id" :key="item.Id">
</el-option>
......@@ -89,7 +90,8 @@
<el-col :span="4" v-if="pagesTitle != '当地游产品'">
<!-- 参团类型 -->
<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')">
<el-option v-for="item in joinTypeList" :label="item.Name" :value="item.Id" :key="item.Id">
</el-option>
......@@ -275,6 +277,43 @@
当前报名不参与公司任何优惠活动
</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-row>
<div style="width: 100%; border-top: 1px dashed #ccc; margin-bottom: 25px"></div>
<el-row :gutter="20">
......@@ -674,6 +713,8 @@
],
data() {
return {
DiscountAmountId: null,
DiscountAmountObj:{},
timer: false,
fullHeight: document.documentElement.clientHeight,
ScreenHeight: 0,
......@@ -762,6 +803,7 @@
GatherAddress: "",
LureEmpId: 0, //引流id
CRMGuestId: 0, //客人ID
CouponAllotIds: '',
},
uploadLloading: false,
rules: {
......@@ -924,9 +966,45 @@
priceObj: {}, //团期价格信息
crmOrderObj: null,
couponData: null,
couponList:[],
};
},
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优惠
GetAutoCouponOrder(){
this.couponData = null
......@@ -1017,7 +1095,7 @@
},
//参团类型切换
changeGroupType(type) {
if ((type = !2)) {
if (type = !2) {
this.addMsg.IndustryCategory = "";
this.addMsg.QuotationUrl = "";
}
......@@ -1811,6 +1889,8 @@
},
//清空表单信息
clearMsg() {
this.DiscountAmountId = null,
this.DiscountAmountObj = {},
this.addMsg = {
price: "0",
GroupTypeNeedHouse: "0",
......@@ -1871,6 +1951,7 @@
GatherAddress: "",
LureEmpId: 0, //引流id
CRMGuestId: 0, //客人ID
CouponAllotIds: '',
};
this.remarkMsg = {
zc: "",
......@@ -2008,9 +2089,17 @@
this.addMsg.IsChildrenTour = this.priceObj.IsSupportChildren;
this.addMsg.IsBirdDiscount = this.priceObj.IsBirdDiscount;
let url;
if (this.PProductType == 1) {
if (this.pagesTitle == "跟团游产品") {
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 == "当地游产品") {
url = "sellorder_post_SetOneDayOrderInfo";
......@@ -2020,6 +2109,8 @@
}
this.apipost(url, this.addMsg, (res) => {
if (res.data.resultCode == 1) {
this.DiscountAmountId = null
this.DiscountAmountObj = {}
this.Success(res.data.message);
this.$refs["addMsg"].resetFields();
this.clearMsg();
......@@ -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) {
let platBranchId = this.CurrentUserInfo.RB_Branch_id;
......@@ -2092,10 +2230,11 @@
let obj = this.customerList.find(
(item) => item.customerId == this.addMsg.CustomerId
);
this.customerId = obj.customerId;
this.createByInfo = obj.createByInfo;
this.addMsg.ContactName = obj.customerName + "(" + obj.contact + ")";
this.addMsg.ContactMobile = obj.contactNumber;
this.customerId = obj&&obj.customerId;
this.createByInfo = obj&&obj.createByInfo;
this.addMsg.ContactName = obj&&obj.customerName + "(" + obj.contact + ")";
this.addMsg.ContactMobile = obj&&obj.contactNumber;
if (this.CurrentUserInfo.EmployeeId != this.createByInfo) {
this.addMsg.CommissionSharePeople = this.createByInfo;
this.isUpdateSharePeople = true;
......@@ -2341,6 +2480,13 @@
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