|
|
@ -157,15 +157,15 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -303,15 +303,15 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -453,15 +453,15 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -621,14 +621,14 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -754,15 +754,15 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -898,15 +898,15 @@ |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<el-table-column label="起止日期" align="center" min-width="240"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
|
</p> |
|
|
|
</p> |
|
|
|
<p v-else> |
|
|
|
<p v-else> |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''" |
|
|
|
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px" |
|
|
|
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)" |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
placeholder="请选择使用日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-date-picker> |
|
|
@ -1555,7 +1555,6 @@ export default { |
|
|
|
promises.push(new Promise((resolve, reject) => { |
|
|
|
promises.push(new Promise((resolve, reject) => { |
|
|
|
this.$post(this.api.renew, { |
|
|
|
this.$post(this.api.renew, { |
|
|
|
authority: 4, |
|
|
|
authority: 4, |
|
|
|
// authority: 3, |
|
|
|
|
|
|
|
customerId, |
|
|
|
customerId, |
|
|
|
productId: orderOther.filter(e => e.authority === 4).map(e => e.mallId), |
|
|
|
productId: orderOther.filter(e => e.authority === 4).map(e => e.mallId), |
|
|
|
}).then(({ orderOthers }) => { |
|
|
|
}).then(({ orderOthers }) => { |
|
|
@ -1598,6 +1597,7 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
async setStartDate (renewList, orderOther) { |
|
|
|
async setStartDate (renewList, orderOther) { |
|
|
|
const now = await Util.getNow() |
|
|
|
const now = await Util.getNow() |
|
|
|
|
|
|
|
const onTrial = this.form.orderType === 2 |
|
|
|
let list = orderOther.map(e => { |
|
|
|
let list = orderOther.map(e => { |
|
|
|
e.settlementPriceUnit = e.settlementPrice |
|
|
|
e.settlementPriceUnit = e.settlementPrice |
|
|
|
const item = renewList.find(n => n.dataOrCourseId == e.dataOrCourseId && n.authority == e.authority) // 匹配renew接口返回的数据 |
|
|
|
const item = renewList.find(n => n.dataOrCourseId == e.dataOrCourseId && n.authority == e.authority) // 匹配renew接口返回的数据 |
|
|
@ -1615,8 +1615,14 @@ export default { |
|
|
|
// 过期 |
|
|
|
// 过期 |
|
|
|
e.startTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` |
|
|
|
e.startTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` |
|
|
|
} |
|
|
|
} |
|
|
|
e.endTime = ""; |
|
|
|
e.endTime = '' |
|
|
|
e.periodOfUse = ""; |
|
|
|
e.periodOfUse = '' |
|
|
|
|
|
|
|
// 试用则自动填充1月 |
|
|
|
|
|
|
|
if (onTrial) { |
|
|
|
|
|
|
|
e.periodOfUse = 1 |
|
|
|
|
|
|
|
e.options = 1 |
|
|
|
|
|
|
|
this.deadLine(e.periodOfUse, e, e.options, 1) |
|
|
|
|
|
|
|
} |
|
|
|
} else if (!this.viewDisabled) { // 如果不是查看 |
|
|
|
} else if (!this.viewDisabled) { // 如果不是查看 |
|
|
|
e.startTime = cur.startTime.split(" ")[0]; |
|
|
|
e.startTime = cur.startTime.split(" ")[0]; |
|
|
|
if (cur.endTime) e.endTime = cur.endTime.split(" ")[0]; |
|
|
|
if (cur.endTime) e.endTime = cur.endTime.split(" ")[0]; |
|
|
@ -2301,9 +2307,7 @@ export default { |
|
|
|
let endTime = time + optionsData |
|
|
|
let endTime = time + optionsData |
|
|
|
var timestamp = endTime; |
|
|
|
var timestamp = endTime; |
|
|
|
var dt = new Date(timestamp); //根据时间戳生成的时间对象 |
|
|
|
var dt = new Date(timestamp); //根据时间戳生成的时间对象 |
|
|
|
// debugger |
|
|
|
|
|
|
|
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate()) |
|
|
|
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate()) |
|
|
|
console.log("🚀 ~ deadLine ~ row.endTime:", row.endTime) |
|
|
|
|
|
|
|
let endYear = timestamp - time |
|
|
|
let endYear = timestamp - time |
|
|
|
let endYears = endYear / 1000 / 60 / 60 / 24 |
|
|
|
let endYears = endYear / 1000 / 60 / 60 / 24 |
|
|
|
row.remainingPeriod = endYears |
|
|
|
row.remainingPeriod = endYears |
|
|
@ -2322,9 +2326,9 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
if (isDate) { |
|
|
|
if (isDate) { |
|
|
|
const cId = row.dataOrCourseId |
|
|
|
const cId = row.mallId |
|
|
|
const date = new Date(row.startTime) |
|
|
|
const date = new Date(row.startTime) |
|
|
|
const orderRepeat = this.orderRepeat |
|
|
|
const { orderRepeat } = this |
|
|
|
this.$post(this.api.getOrderOtherTime, { |
|
|
|
this.$post(this.api.getOrderOtherTime, { |
|
|
|
customerId: this.form.customerId, |
|
|
|
customerId: this.form.customerId, |
|
|
|
id: row.mallId, |
|
|
|
id: row.mallId, |
|
|
|