Commit b970bfe2 authored by 黄奎's avatar 黄奎

页面修改

parent 453f7878
......@@ -279,13 +279,8 @@
</el-col>
<el-col :span="4" v-if="(addMsg.GroupType==1||addMsg.GroupType==2)&&couponList&&couponList.length>0">
<el-form-item label="优惠券" prop="">
<el-select v-model="DiscountAmountId" placeholder="选择优惠券"
@change="getDiscountAmount"
clearable>
<el-option v-for="item in couponList"
:label="item.couponName"
:value="item.id"
:key="item.id"
<el-select v-model="DiscountAmountId" placeholder="选择优惠券" @change="getDiscountAmount" clearable>
<el-option v-for="item in couponList" :label="item.couponName" :value="item.id" :key="item.id"
:disabled="expiredTime(item)">
<span>
<!-- 名称: -->
......@@ -349,6 +344,7 @@
">
{{ $t("salesModule.NoSupplier") }}!
</p>
<el-form-item v-if="priceObj.IsSupportChildren == 1" :label="$t('Operation.Op_childNobed')"
prop="ChirdNoNeedBedNum">
<el-input v-model="addMsg.ChirdNoNeedBedNum" @keyup.native="checkInteger(addMsg, 'ChirdNoNeedBedNum')"
......@@ -553,8 +549,6 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="4" v-if="pagesTitle == '当地游产品'">
<!--联系人-->
<el-form-item label="行李数量" prop="LuggageNum">
......@@ -724,7 +718,7 @@
data() {
return {
DiscountAmountId: null,
DiscountAmountObj:{},
DiscountAmountObj: {},
timer: false,
fullHeight: document.documentElement.clientHeight,
ScreenHeight: 0,
......@@ -814,7 +808,7 @@
LureEmpId: 0, //引流id
CRMGuestId: 0, //客人ID
CouponAllotIds: '',
LuggageNum:'',//行李数量
LuggageNum: '', //行李数量
},
uploadLloading: false,
rules: {
......@@ -824,10 +818,35 @@
trigger: "change",
}, ],
CustomerId: [{
required: false,
required: true,
message: "请选择客户门店",
trigger: "change",
}, ],
ManNum: [{
required: true,
message: "请填写成人人数",
trigger: "blur",
}, ],
ChirdNeedBedNum: [{
required: true,
message: "请填写儿童占床人数",
trigger: "blur",
}, ],
BabyNum: [{
required: true,
message: "请填写婴儿人数",
trigger: "blur",
}, ],
OldPeopleNum: [{
required: true,
message: "请填写老人人数",
trigger: "blur",
}, ],
ChirdNoNeedBedNum: [{
required: true,
message: "请填写儿童不占床人数",
trigger: "blur",
}, ],
DepartureCityId: [{
required: true,
message: "请选择出发城市",
......@@ -982,45 +1001,45 @@
priceObj: {}, //团期价格信息
crmOrderObj: null,
couponData: null,
couponList:[],
couponList: [],
};
},
methods: {
// 获取已选优惠券
getDiscountAmount(){
let obj = this.couponList.find(x=>{
return x.id==this.DiscountAmountId
getDiscountAmount() {
let obj = this.couponList.find(x => {
return x.id == this.DiscountAmountId
})
this.DiscountAmountObj = obj?obj:{}
this.DiscountAmountObj = obj ? obj : {}
},
getUserCouponList(){
let obj = this.customerList.find(x=>{
return x.customerId==this.addMsg.CustomerId
getUserCouponList() {
let obj = this.customerList.find(x => {
return x.customerId == this.addMsg.CustomerId
})
if(this.addMsg.GroupType!=1&&this.addMsg.GroupType!=2) {
if (this.addMsg.GroupType != 1 && this.addMsg.GroupType != 2) {
this.couponList = []
this.DiscountAmountId = null
this.DiscountAmountObj = {}
return
}
if(obj&&obj.customerAccountId&&this.priceObj.LineID){
let params={
if (obj && obj.customerAccountId && this.priceObj.LineID) {
let params = {
lineId: this.priceObj.LineID,
lineteamId:0,
CouponsUseScope:2,
lineteamId: 0,
CouponsUseScope: 2,
userId: obj.customerAccountId
}
this.apipost('coupon_post_GetUserCanUseCouponList',params,(res)=>{
if(res.data.resultCode==1){
this.apipost('coupon_post_GetUserCanUseCouponList', params, (res) => {
if (res.data.resultCode == 1) {
this.couponList = res.data.data
}
},(err)=>{
}, (err) => {
console.log(err)
})
}
},
// 大人>=2优惠
GetAutoCouponOrder(){
GetAutoCouponOrder() {
this.couponData = null
let ChirdNum = Number(this.addMsg.ChirdNum);
if (this.addMsg.GroupType == 4) {
......@@ -1032,26 +1051,26 @@
Number(this.addMsg.OldPeopleNum) +
Number(this.addMsg.BabyNum) +
Number(this.addMsg.AirticketNum);
let OrderGuest = this.addMsg.GuestNum-Number(this.addMsg.BabyNum)
if(OrderGuest>=2&&(this.addMsg.GroupType==1||this.addMsg.GroupType==2)&&this.addMsg.CustomerId>0){
let OrderGuest = this.addMsg.GuestNum - Number(this.addMsg.BabyNum)
if (OrderGuest >= 2 && (this.addMsg.GroupType == 1 || this.addMsg.GroupType == 2) && this.addMsg.CustomerId >
0) {
let msg = {
TCID:this.productObj.TCID,
CustomerId:this.addMsg.CustomerId,
OrderId:0,
StratDate:this.productObj.StartCityTime,
OrderGuest:OrderGuest,
lineId:this.priceObj.LineID
TCID: this.productObj.TCID,
CustomerId: this.addMsg.CustomerId,
OrderId: 0,
StratDate: this.productObj.StartCityTime,
OrderGuest: OrderGuest,
lineId: this.priceObj.LineID
}
this.apipost(
"coupon_post_GetAutoCouponOrder", msg,
(res) => {
if (res.data.resultCode == 1&&res.data.data!=null) {
if (res.data.resultCode == 1 && res.data.data != null) {
this.couponData = res.data.data
}
}
);
}
},
Transformation(val, type, index) {
let text = this.pinyin(val, {
......@@ -2108,10 +2127,10 @@
if (this.pagesTitle == "跟团游产品") {
url = "sellorder_post_SetOrderInfo_02";
// 优惠券计算
if((this.addMsg.GroupType==1||this.addMsg.GroupType==2)&&this.DiscountAmountId){
if ((this.addMsg.GroupType == 1 || this.addMsg.GroupType == 2) && this.DiscountAmountId) {
this.addMsg.CouponAllotIds = this.DiscountAmountId
// this.addMsg.PreferPrice = this.CalculationPreference()
}else{
} else {
this.addMsg.CouponAllotIds = ''
}
}
......@@ -2136,22 +2155,22 @@
});
},
// 优惠券有效期
expiredTime(item){
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"))) {
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{
} else {
return true
}
},
// 优惠券计算
CalculationPreference(){
CalculationPreference() {
let ChirdNum = Number(this.addMsg.ChirdNum);
if (this.addMsg.GroupType == 4) {
ChirdNum = 0;
......@@ -2164,29 +2183,29 @@
ChirdNum +
Number(this.addMsg.OldPeopleNum)
// couponsType 优惠券类型 1:抵用券,2:折扣卷
if(DiscountNumber>0&&this.DiscountAmountId&&(this.addMsg.GroupType==1||this.addMsg.GroupType==2)){
if(this.DiscountAmountObj&&this.DiscountAmountObj.couponsType==1){
if(this.addMsg.GroupType==2){
if(DiscountNumber>=this.DiscountAmountObj.expansionModel.orderGuestNum){
PreferPrice = this.addMsg.PreferPrice-this.DiscountAmountObj.expansionModel.denomination
if (DiscountNumber > 0 && this.DiscountAmountId && (this.addMsg.GroupType == 1 || this.addMsg.GroupType == 2)) {
if (this.DiscountAmountObj && this.DiscountAmountObj.couponsType == 1) {
if (this.addMsg.GroupType == 2) {
if (DiscountNumber >= this.DiscountAmountObj.expansionModel.orderGuestNum) {
PreferPrice = this.addMsg.PreferPrice - this.DiscountAmountObj.expansionModel.denomination
}
}
PreferPriceTwo = this.addMsg.PreferPrice-this.DiscountAmountObj.denomination
}else if(this.DiscountAmountObj&&this.DiscountAmountObj.couponsType==2){
if(this.addMsg.GroupType==2){
if(DiscountNumber>=this.DiscountAmountObj.expansionModel.orderGuestNum){
PreferPrice = this.addMsg.PreferPrice-this.DiscountAmountObj.expansionModel.denomination
PreferPriceTwo = this.addMsg.PreferPrice - this.DiscountAmountObj.denomination
} else if (this.DiscountAmountObj && this.DiscountAmountObj.couponsType == 2) {
if (this.addMsg.GroupType == 2) {
if (DiscountNumber >= this.DiscountAmountObj.expansionModel.orderGuestNum) {
PreferPrice = this.addMsg.PreferPrice - this.DiscountAmountObj.expansionModel.denomination
}
}
PreferPriceTwo = this.addMsg.PreferPrice*(this.DiscountAmountObj.denomination/100)
PreferPriceTwo = this.addMsg.PreferPrice * (this.DiscountAmountObj.denomination / 100)
}
if((PreferPrice>PreferPriceTwo)||PreferPrice==0){
if ((PreferPrice > PreferPriceTwo) || PreferPrice == 0) {
Price = PreferPriceTwo
}else{
} else {
Price = PreferPrice
}
return Price
}else {
} else {
return Price
}
},
......@@ -2253,10 +2272,10 @@
let obj = this.customerList.find(
(item) => item.customerId == this.addMsg.CustomerId
);
this.customerId = obj&&obj.customerId;
this.createByInfo = obj&&obj.createByInfo;
this.addMsg.ContactName = obj&&obj.customerName + "(" + obj.contact + ")";
this.addMsg.ContactMobile = obj&&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;
......@@ -2504,9 +2523,9 @@
PTCID: function (oldValue, newVal) {
this.getScenicRefund(this.PTCID); // 可退景点
},
'addMsg.CustomerId':{
'addMsg.CustomerId': {
handler(oldValue, newVal) {
if(oldValue){
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