订单使用期限修改

dev_2022-03-03
yujialong 3 years ago
parent 47ded61124
commit c163740f43
  1. 143
      src/views/order/AddOrder.vue

@ -806,75 +806,88 @@ 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)
if (this.renewDisabled) { this.$post(this.api.renew, {
let end = Date.parse(e.endTime); authority: orderOther[0].authority,
let now = +new Date(); customerId: form.customerId,
if (now < end) { productId
let time = e.endTime.split(" ")[0]; }).then(res => {
let arr = time.split("-"); const renewList = res.orderOthers
e.startTime = arr[0] + "-" + arr[1] + "-" + (+arr[2] + 1); let list = orderOther.map(e => {
} else { const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId)
// if (item) {
e.startTime = ""; //
if (this.renewDisabled) {
let end = Date.parse(item.endTime);
let now = +new Date();
if (now < end) {
let time = new Date(item.endTime.split(" ")[0])
time = new Date(time.setDate(time.getDate() + 1))
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
} else {
//
e.startTime = "";
}
e.endTime = "";
e.periodOfUse = "";
} else {
e.startTime = item.startTime.split(" ")[0];
e.endTime = item.endTime.split(" ")[0];
}
} }
e.endTime = ""; return e;
e.periodOfUse = ""; });//
if (this.renewDisabled) { //
this.contract = {
contractName: "",
contractFile: "",
contractMoney: "",
contractNumber: "",
startTime: "",
endTime: ""
};
} else { } else {
e.startTime = e.startTime.split(" ")[0]; this.contract = {
e.endTime = e.endTime.split(" ")[0]; contractName: contract.contractName,
contractMoney: contract.contractMoney,
contractNumber: contract.contractNumber,
startTime: contract.startTime ? contract.startTime : "",
endTime: contract.endTime ? contract.endTime : "",
contractId: contract.contractId,
uploadList: {
name: contract.contractFile ? contract.contractFile.split("/").pop() : "",
url: contract.contractFile
}
};
if (contract.startTime && contract.endTime) {
this.contractTime = [contract.startTime, contract.endTime];
}
} }
return e; this.form = {
});// orderNumber: form.orderNumber,
if (this.renewDisabled) { // createTime: form.createTime,
this.contract = { provinceId: form.provinceId,
contractName: "", orderContact: form.orderContact,
contractFile: "", email: form.email,
contractMoney: "", customerId: form.customerId,
contractNumber: "", customerName: form.customerName,
startTime: "", orderType: form.orderType,
endTime: "" cityId: form.cityId,
phone: form.phone,
orderAmount: form.orderAmount,
orderId: form.orderId,
options: form.options,
}; };
} else { this.coursePermissions = list.filter(i => i.authority === 1);
this.contract = { this.dataPlatformPermissions = list.filter(i => i.authority === 0);
contractName: contract.contractName, this.$nextTick(() => {
contractMoney: contract.contractMoney, if(this.form.provinceId){
contractNumber: contract.contractNumber, this.getCityData()
startTime: contract.startTime ? contract.startTime : "",
endTime: contract.endTime ? contract.endTime : "",
contractId: contract.contractId,
uploadList: {
name: contract.contractFile ? contract.contractFile.split("/").pop() : "",
url: contract.contractFile
} }
}; });
if (contract.startTime && contract.endTime) { }).catch(err => {})
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()
}
});
}); });
}, },
// //
@ -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;

Loading…
Cancel
Save