Commit d76b4341 authored by youjie's avatar youjie

订单取消

parent b414444b
......@@ -56,7 +56,6 @@
<view v-if="item.orderStatus==1||item.orderStatus==2" class="jz_Zailai"
style="width: 110rpx;margin-left: 10rpx;" @click.stop="goCancelZK(item)">取消</view>
</template>
<view v-if="item.orderStatus==1" class="jz_Zailai jz_ZailaiZF"
style="width: 150rpx;margin-left: 10rpx;" @click.stop="submitGetCodeByOrderNo(item)">
立即支付</view>
......@@ -374,28 +373,6 @@
},
//取消订单(同行订单取消)
goCancel(item) {
// #ifdef MP-DI
// #endif
// #ifdef MP-AG
if(item.goodsType==5){
wx.showModal({
title: '提示',
content: `${item.SalePhone?'确定拨打服务电话取消订单吗?':'请联系服务人员进行取消?'}`,
success: (tip) => {
if (tip.confirm) {
if(item.SalePhone){
uni.makePhoneCall({
phoneNumber: item.SalePhone,
});
}
}
}
})
return
}
// #endif
let that = this
if (this.submit || this.submitCancel) return
wx.showModal({
......
......@@ -225,7 +225,7 @@
</button>
<!-- #endif -->
<!-- #ifdef MP-AG -->
<button v-if="orderData.OrderStatus==1||orderData.OrderStatus==5" class="jz_OrderReNow"
<button v-if="orderData.OrderStatus==1" class="jz_OrderReNow"
@click="goCancel" style="background: #fff; color: #111; border: 1px solid #111"
:disabled="submitCancel" :loading="submitCancel">
取消
......@@ -432,7 +432,7 @@
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true;
this.apipost(
that.apipost(
"GetCancelOrder_post", {
OrderNo: that.OrderNo,
},
......@@ -461,133 +461,41 @@
},
goCancel() {
let that = this
console.log("this.orderData----", that.SalePhone);
// #ifdef MP-AG
wx.showModal({
title: '提示',
content: `${that.SalePhone?'确定拨打服务电话取消订单吗?':'请联系服务人员进行取消?'}`,
success: (tip) => {
if (tip.confirm) {
if(that.SalePhone){
uni.makePhoneCall({
phoneNumber: that.SalePhone,
});
}
}
}
})
return
// #endif
if (this.submitCancel) return
this.submitCancel = true;
var cancelMsg = {
OrderNo: this.OrderNo,
ErpOrderId: this.id,
OrderTypeStr: "Hotel", //订单类型为酒店
ConfirmID: "",
};
//待付款-直接取消
if (this.orderData.OrderStatus == 1) {
this.apipost(
"b2b_get_GetB2BAllCancelOrder", {
ID: this.id,
OrderTypeStr: "5",
},
(res) => {
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
this.getOrderDetail()
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
}
);
}
//已付款,可能会有取消费用
else if (this.orderData.model.OrderStatus == 5) {
var didaMsg = {
BookingID: this.orderData.model.ThirdOrderNo
}
this.apipost("dmc_post_GetDiDaBookingCancel", didaMsg, (res) => {
if (res.resultCode == 1) {
var tempData = res.data;
console.log("tempData", tempData);
if (tempData) {
cancelMsg.ConfirmID = tempData.ConfirmID;
//有取消费用
if (tempData.Amount && tempData.Amount > 0) {
var tipmsg = "取消订单将收取【" + tempData.Amount + "】取消费用,是否确认取消订单?"
wx.showModal({
title: '提示',
content: tipmsg,
content: '确定取消订单?',
success: (tip) => {
if (tip.confirm) {
that.submitCancel = true
that.submitCancel = true;
that.apipost(
"post_CancelThirdHotelOrder", cancelMsg,
"b2b_get_GetB2BAllCancelOrder", {
ID: that.id,
OrderTypeStr: "5",
},
(res) => {
that.submitCancel = false
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research');
that.getOrderDetail()
}
},
(err) => {
that.submitCancel = false
uni.showToast({
title: err.message,
icon: "none",
})
}
);
}
}
})
}
//无取消费用
else {
that.apipost(
"post_CancelThirdHotelOrder", cancelMsg,
(res) => {
that.submitCancel = false
if (res.resultCode == 1) {
uni.showToast({
title: "操作成功",
icon: "success",
});
that.$emit('research');
}
},
(err) => {
that.submitCancel = false
uni.showToast({
title: err.message,
icon: "none",
})
}
);
}
}
}
},
(err) => {
uni.showToast({
title: err.message,
icon: "none",
});
this.submitCancel = false
})
}
},
formatStatus(status,Income,TotalPrice,PlatformTax) {
......@@ -640,17 +548,17 @@
// this.orderStatus.text = "待出行";
// this.showPayBtn = false;
// }
if (status == 4) {
if (status == 3) {
this.orderStatus.code = -1;
this.orderStatus.text = "已取消";
this.showPayBtn = false;
} else if (status == 3) {
} else if (status == 1) {
this.orderStatus.code = 0;
this.orderStatus.text = "待付款";
this.showPayBtn = true;
} else if (status == 1) {
} else if (status == 4) {
this.orderStatus.code = -2;
this.orderStatus.text = "正常";
this.orderStatus.text = "已完成";
this.showPayBtn = true;
} else if (status == 2) {
this.orderStatus.code = 1;
......
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