|
|
@ -806,15 +806,25 @@ export default { |
|
|
|
this.$get(this.api.orderDetail, { orderId: +id }).then(res => { |
|
|
|
this.$get(this.api.orderDetail, { orderId: +id }).then(res => { |
|
|
|
let form = res.orderDetails.order;// 基本信息 |
|
|
|
let form = res.orderDetails.order;// 基本信息 |
|
|
|
let contract = res.orderDetails.contractInformation ? res.orderDetails.contractInformation : {}; // 合同 |
|
|
|
let contract = res.orderDetails.contractInformation ? res.orderDetails.contractInformation : {}; // 合同 |
|
|
|
let list = res.orderDetails.orderOther.map(e => { |
|
|
|
const { orderOther } = res.orderDetails |
|
|
|
|
|
|
|
const productId = orderOther.map(e => e.dataOrCourseId) |
|
|
|
|
|
|
|
this.$post(this.api.renew, { |
|
|
|
|
|
|
|
authority: orderOther[0].authority, |
|
|
|
|
|
|
|
customerId: form.customerId, |
|
|
|
|
|
|
|
productId |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
const renewList = res.orderOthers |
|
|
|
|
|
|
|
let list = orderOther.map(e => { |
|
|
|
|
|
|
|
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId) |
|
|
|
|
|
|
|
if (item) { |
|
|
|
// 处于续费 |
|
|
|
// 处于续费 |
|
|
|
if (this.renewDisabled) { |
|
|
|
if (this.renewDisabled) { |
|
|
|
let end = Date.parse(e.endTime); |
|
|
|
let end = Date.parse(item.endTime); |
|
|
|
let now = +new Date(); |
|
|
|
let now = +new Date(); |
|
|
|
if (now < end) { |
|
|
|
if (now < end) { |
|
|
|
let time = e.endTime.split(" ")[0]; |
|
|
|
let time = new Date(item.endTime.split(" ")[0]) |
|
|
|
let arr = time.split("-"); |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); |
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
// 过期 |
|
|
|
// 过期 |
|
|
|
e.startTime = ""; |
|
|
|
e.startTime = ""; |
|
|
@ -822,8 +832,9 @@ export default { |
|
|
|
e.endTime = ""; |
|
|
|
e.endTime = ""; |
|
|
|
e.periodOfUse = ""; |
|
|
|
e.periodOfUse = ""; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
e.startTime = e.startTime.split(" ")[0]; |
|
|
|
e.startTime = item.startTime.split(" ")[0]; |
|
|
|
e.endTime = e.endTime.split(" ")[0]; |
|
|
|
e.endTime = item.endTime.split(" ")[0]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return e; |
|
|
|
return e; |
|
|
|
});// 俩列表 |
|
|
|
});// 俩列表 |
|
|
@ -875,6 +886,8 @@ export default { |
|
|
|
this.getCityData() |
|
|
|
this.getCityData() |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}).catch(err => {}) |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增订单 |
|
|
|
// 新增订单 |
|
|
@ -886,7 +899,7 @@ export default { |
|
|
|
if (this.coursePermissions.length) { |
|
|
|
if (this.coursePermissions.length) { |
|
|
|
let courseVerify = |
|
|
|
let courseVerify = |
|
|
|
this.coursePermissions.some(e => { |
|
|
|
this.coursePermissions.some(e => { |
|
|
|
if (!e.periodOfUse || !e.finalPrice) { |
|
|
|
if (!e.periodOfUse || e.finalPrice === '') { |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|