|
|
@ -813,87 +813,103 @@ export default { |
|
|
|
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 : {}; // 合同 |
|
|
|
const { orderOther } = res.orderDetails |
|
|
|
const { orderOther } = res.orderDetails |
|
|
|
const productId = orderOther.map(e => e.dataOrCourseId) |
|
|
|
if (orderOther.find(e => e.authority)) { |
|
|
|
this.$post(this.api.renew, { |
|
|
|
this.$post(this.api.renew, { |
|
|
|
authority: orderOther[0].authority, |
|
|
|
authority: 1, |
|
|
|
customerId: form.customerId, |
|
|
|
customerId: form.customerId, |
|
|
|
productId |
|
|
|
productId: orderOther.filter(e => e.authority).map(e => e.dataOrCourseId) |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
const renewList = res.orderOthers |
|
|
|
const renewList = res.orderOthers |
|
|
|
let list = orderOther.map(e => { |
|
|
|
if (orderOther.find(e => !e.authority)) { |
|
|
|
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId) |
|
|
|
this.$post(this.api.renew, { |
|
|
|
if (item) { |
|
|
|
authority: 0, |
|
|
|
// 处于续费 |
|
|
|
customerId: form.customerId, |
|
|
|
if (this.renewDisabled) { |
|
|
|
productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId) |
|
|
|
let end = Date.parse(item.endTime); |
|
|
|
}).then(res => { |
|
|
|
let now = +new Date(); |
|
|
|
renewList.push(...res.orderOthers) |
|
|
|
if (now < end) { |
|
|
|
this.setStartDate(renewList, contract, form, orderOther) |
|
|
|
let time = new Date(item.endTime.split(" ")[0]) |
|
|
|
}).catch(err => {}) |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
} else { |
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
this.setStartDate(renewList, contract, form, orderOther) |
|
|
|
} else { |
|
|
|
|
|
|
|
// 过期 |
|
|
|
|
|
|
|
e.startTime = ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
e.endTime = ""; |
|
|
|
|
|
|
|
e.periodOfUse = ""; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.startTime = item.startTime.split(" ")[0]; |
|
|
|
|
|
|
|
e.endTime = item.endTime.split(" ")[0]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return e; |
|
|
|
}).catch(err => {}) |
|
|
|
});// 俩列表 |
|
|
|
} |
|
|
|
if (this.renewDisabled) { // 续费状态下,清空上个订单合同信息 |
|
|
|
}); |
|
|
|
this.contract = { |
|
|
|
}, |
|
|
|
contractName: "", |
|
|
|
setStartDate(renewList, contract, form, orderOther) { |
|
|
|
contractFile: "", |
|
|
|
console.log(33, renewList, contract, form) |
|
|
|
contractMoney: "", |
|
|
|
let list = orderOther.map(e => { |
|
|
|
contractNumber: "", |
|
|
|
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) |
|
|
|
startTime: "", |
|
|
|
if (item) { |
|
|
|
endTime: "" |
|
|
|
// 处于续费 |
|
|
|
}; |
|
|
|
if (this.renewDisabled) { |
|
|
|
} else { |
|
|
|
let end = Date.parse(item.endTime); |
|
|
|
this.contract = { |
|
|
|
let now = +new Date(); |
|
|
|
contractName: contract.contractName, |
|
|
|
if (now < end) { |
|
|
|
contractMoney: contract.contractMoney, |
|
|
|
let time = new Date(item.endTime.split(" ")[0]) |
|
|
|
contractNumber: contract.contractNumber, |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
startTime: contract.startTime ? contract.startTime : "", |
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
endTime: contract.endTime ? contract.endTime : "", |
|
|
|
} else { |
|
|
|
contractId: contract.contractId, |
|
|
|
// 过期 |
|
|
|
uploadList: { |
|
|
|
e.startTime = ""; |
|
|
|
name: contract.contractFile ? contract.contractFile.split("/").pop() : "", |
|
|
|
|
|
|
|
url: contract.contractFile |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (contract.startTime && contract.endTime) { |
|
|
|
|
|
|
|
this.contractTime = [contract.startTime, contract.endTime]; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
e.endTime = ""; |
|
|
|
|
|
|
|
e.periodOfUse = ""; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
e.startTime = item.startTime.split(" ")[0]; |
|
|
|
|
|
|
|
e.endTime = item.endTime.split(" ")[0]; |
|
|
|
} |
|
|
|
} |
|
|
|
this.form = { |
|
|
|
} |
|
|
|
orderNumber: form.orderNumber, |
|
|
|
return e; |
|
|
|
createTime: form.createTime, |
|
|
|
});// 俩列表 |
|
|
|
provinceId: form.provinceId, |
|
|
|
|
|
|
|
orderContact: form.orderContact, |
|
|
|
if (this.renewDisabled) { // 续费状态下,清空上个订单合同信息 |
|
|
|
email: form.email, |
|
|
|
this.contract = { |
|
|
|
customerId: form.customerId, |
|
|
|
contractName: "", |
|
|
|
customerName: form.customerName, |
|
|
|
contractFile: "", |
|
|
|
orderType: form.orderType, |
|
|
|
contractMoney: "", |
|
|
|
cityId: form.cityId, |
|
|
|
contractNumber: "", |
|
|
|
phone: form.phone, |
|
|
|
startTime: "", |
|
|
|
orderAmount: form.orderAmount, |
|
|
|
endTime: "" |
|
|
|
orderId: form.orderId, |
|
|
|
}; |
|
|
|
options: form.options, |
|
|
|
} else { |
|
|
|
}; |
|
|
|
this.contract = { |
|
|
|
this.coursePermissions = list.filter(i => i.authority === 1); |
|
|
|
contractName: contract.contractName, |
|
|
|
this.dataPlatformPermissions = list.filter(i => i.authority === 0); |
|
|
|
contractMoney: contract.contractMoney, |
|
|
|
this.$nextTick(() => { |
|
|
|
contractNumber: contract.contractNumber, |
|
|
|
if(this.form.provinceId){ |
|
|
|
startTime: contract.startTime ? contract.startTime : "", |
|
|
|
this.getCityData() |
|
|
|
endTime: contract.endTime ? contract.endTime : "", |
|
|
|
} |
|
|
|
contractId: contract.contractId, |
|
|
|
}); |
|
|
|
uploadList: { |
|
|
|
}).catch(err => {}) |
|
|
|
name: contract.contractFile ? contract.contractFile.split("/").pop() : "", |
|
|
|
|
|
|
|
url: contract.contractFile |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
if (contract.startTime && contract.endTime) { |
|
|
|
|
|
|
|
this.contractTime = [contract.startTime, contract.endTime]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.form = { |
|
|
|
|
|
|
|
orderNumber: form.orderNumber, |
|
|
|
|
|
|
|
createTime: form.createTime, |
|
|
|
|
|
|
|
provinceId: form.provinceId, |
|
|
|
|
|
|
|
orderContact: form.orderContact, |
|
|
|
|
|
|
|
email: form.email, |
|
|
|
|
|
|
|
customerId: form.customerId, |
|
|
|
|
|
|
|
customerName: form.customerName, |
|
|
|
|
|
|
|
orderType: form.orderType, |
|
|
|
|
|
|
|
cityId: form.cityId, |
|
|
|
|
|
|
|
phone: form.phone, |
|
|
|
|
|
|
|
orderAmount: form.orderAmount, |
|
|
|
|
|
|
|
orderId: form.orderId, |
|
|
|
|
|
|
|
options: form.options, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
this.coursePermissions = list.filter(i => i.authority === 1); |
|
|
|
|
|
|
|
this.dataPlatformPermissions = list.filter(i => i.authority === 0); |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
|
|
if(this.form.provinceId){ |
|
|
|
|
|
|
|
this.getCityData() |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 新增订单 |
|
|
|
// 新增订单 |
|
|
@ -1102,7 +1118,7 @@ export default { |
|
|
|
await this.$post(this.api.renew, params).then(res => { |
|
|
|
await this.$post(this.api.renew, params).then(res => { |
|
|
|
this.coursePermissions.map(e => { |
|
|
|
this.coursePermissions.map(e => { |
|
|
|
res.orderOthers.map(el => { |
|
|
|
res.orderOthers.map(el => { |
|
|
|
if (el.dataOrCourseId === e.dataOrCourseId) { |
|
|
|
if (el.dataOrCourseId === e.dataOrCourseId && el.authority) { |
|
|
|
let time = el.endTime.split(" ")[0]; |
|
|
|
let time = el.endTime.split(" ")[0]; |
|
|
|
let arr = time.split("-"); |
|
|
|
let arr = time.split("-"); |
|
|
|
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); |
|
|
|
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); |
|
|
@ -1174,7 +1190,7 @@ export default { |
|
|
|
dataOrCourseId: e.id,// id |
|
|
|
dataOrCourseId: e.id,// id |
|
|
|
productName: e.productName,// 名称 |
|
|
|
productName: e.productName,// 名称 |
|
|
|
periodOfUse: "",// 使用期限 |
|
|
|
periodOfUse: "",// 使用期限 |
|
|
|
startTime: "",// 开始 |
|
|
|
startTime: new Date(),// 开始 |
|
|
|
endTime: "", // 终止 |
|
|
|
endTime: "", // 终止 |
|
|
|
remainingPeriod: "",// 剩余期限 |
|
|
|
remainingPeriod: "",// 剩余期限 |
|
|
|
marketValue: e.market,// 市场价 |
|
|
|
marketValue: e.market,// 市场价 |
|
|
@ -1214,7 +1230,7 @@ export default { |
|
|
|
await this.$post(this.api.renew, params).then(res => { |
|
|
|
await this.$post(this.api.renew, params).then(res => { |
|
|
|
this.dataPlatformPermissions.map(e => { |
|
|
|
this.dataPlatformPermissions.map(e => { |
|
|
|
res.orderOthers.map(el => { |
|
|
|
res.orderOthers.map(el => { |
|
|
|
if (el.dataOrCourseId === e.dataOrCourseId) { |
|
|
|
if (el.dataOrCourseId === e.dataOrCourseId && !el.authority) { |
|
|
|
let time = el.endTime.split(" ")[0]; |
|
|
|
let time = el.endTime.split(" ")[0]; |
|
|
|
let arr = time.split("-"); |
|
|
|
let arr = time.split("-"); |
|
|
|
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); |
|
|
|
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); |
|
|
@ -1331,10 +1347,12 @@ export default { |
|
|
|
id: row.dataOrCourseId, |
|
|
|
id: row.dataOrCourseId, |
|
|
|
startTime: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() |
|
|
|
startTime: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() |
|
|
|
}).then(res => { |
|
|
|
}).then(res => { |
|
|
|
orderRepeat.includes(row.id) && orderRepeat.splice(orderRepeat.findIndex(e => e === row.id), 1) |
|
|
|
if (res.endTime) { |
|
|
|
let time = new Date(res.endTime) |
|
|
|
orderRepeat.includes(row.id) && orderRepeat.splice(orderRepeat.findIndex(e => e === row.id), 1) |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
let time = new Date(res.endTime) |
|
|
|
row.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
|
|
|
|
row.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
|
|
|
|
} |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
this.repeatMsg = res.message |
|
|
|
this.repeatMsg = res.message |
|
|
|
orderRepeat.includes(row.id) || orderRepeat.push(row.id) |
|
|
|
orderRepeat.includes(row.id) || orderRepeat.push(row.id) |
|
|
|