|
|
|
@ -140,19 +140,21 @@ |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
|
<el-date-picker |
|
|
|
|
:class="orderRepeat.includes(scope.row.id) ? 'red' : ''" |
|
|
|
|
style="width:130px" |
|
|
|
|
v-model="scope.row.startTime" |
|
|
|
|
type="date" :disabled="viewDisabled||editDisabled" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" |
|
|
|
|
placeholder="请选择使用日期"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</p> |
|
|
|
|
<p v-else> |
|
|
|
|
<el-date-picker |
|
|
|
|
:class="orderRepeat.includes(scope.row.id) ? 'red' : ''" |
|
|
|
|
style="width:130px" |
|
|
|
|
v-model="scope.row.startTime" |
|
|
|
|
type="date" :disabled="viewDisabled||editDisabled" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" |
|
|
|
|
placeholder="请选择使用日期"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p> |
|
|
|
@ -278,19 +280,21 @@ |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<p v-if="!scope.row.startTime"> |
|
|
|
|
<el-date-picker |
|
|
|
|
:class="orderRepeat.includes(scope.row.id) ? 'red' : ''" |
|
|
|
|
style="width:130px" |
|
|
|
|
v-model="scope.row.startTime" |
|
|
|
|
type="date" :disabled="viewDisabled||editDisabled" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" |
|
|
|
|
placeholder="请选择使用日期"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
</p> |
|
|
|
|
<p v-else> |
|
|
|
|
<el-date-picker |
|
|
|
|
:class="orderRepeat.includes(scope.row.id) ? 'red' : ''" |
|
|
|
|
style="width:130px" |
|
|
|
|
v-model="scope.row.startTime" |
|
|
|
|
type="date" :disabled="viewDisabled||editDisabled" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" |
|
|
|
|
placeholder="请选择使用日期"> |
|
|
|
|
</el-date-picker> |
|
|
|
|
<span v-if="scope.row.startTime"><span v-if='scope.row.endTime'> - </span>{{ scope.row.endTime }}</span></p> |
|
|
|
@ -752,6 +756,8 @@ export default { |
|
|
|
|
productName: "",// 搜索产品名称 |
|
|
|
|
searchTimer: null, |
|
|
|
|
titlesw:'', |
|
|
|
|
orderRepeat: [], |
|
|
|
|
repeatMsg: '' |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
watch: { |
|
|
|
@ -934,6 +940,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.$refs["form"].validate((valid) => { |
|
|
|
|
if (valid) { |
|
|
|
|
if (this.orderRepeat.length) return this.$message.error(this.repeatMsg) |
|
|
|
|
let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions]; |
|
|
|
|
let renew = tempArr.some(e => e.renew); |
|
|
|
|
if (this.renewDisabled || renew) {/* 续费状态下 */ |
|
|
|
@ -1315,7 +1322,25 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
|
deadLine(e,row,options) { |
|
|
|
|
deadLine(e,row,options, isDate) { |
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
|
if (isDate) { |
|
|
|
|
const date = row.startTime |
|
|
|
|
const orderRepeat = this.orderRepeat |
|
|
|
|
this.$post(this.api.getOrderOtherTime, { |
|
|
|
|
customerId: this.form.customerId, |
|
|
|
|
id: row.dataOrCourseId, |
|
|
|
|
startTime: date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate() |
|
|
|
|
}).then(res => { |
|
|
|
|
orderRepeat.includes(row.id) && orderRepeat.splice(orderRepeat.findIndex(e => e === row.id), 1) |
|
|
|
|
let time = new Date(res.endTime) |
|
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
|
row.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
|
}).catch(res => { |
|
|
|
|
this.repeatMsg = res.message |
|
|
|
|
orderRepeat.includes(row.id) || orderRepeat.push(row.id) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
let optionsData = '' |
|
|
|
|
if(e > 0){ |
|
|
|
|
if (options == 1){ |
|
|
|
@ -1333,8 +1358,7 @@ export default { |
|
|
|
|
row.endTime = time + optionsData |
|
|
|
|
var timestamp = endTime; |
|
|
|
|
var dt = new Date(timestamp); //根据时间戳生成的时间对象 |
|
|
|
|
var date = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate()) |
|
|
|
|
row.endTime = date; |
|
|
|
|
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate()) |
|
|
|
|
let endYear = timestamp - time |
|
|
|
|
let endYears = endYear/1000/60/60/24 |
|
|
|
|
row.remainingPeriod = endYears |
|
|
|
@ -1358,8 +1382,7 @@ export default { |
|
|
|
|
}; |
|
|
|
|
return this.$get(this.api.queryCity, data).then(res => { |
|
|
|
|
this.cityList = res.list; |
|
|
|
|
}).catch(res => { |
|
|
|
|
}); |
|
|
|
|
}).catch(res => {}) |
|
|
|
|
}, |
|
|
|
|
// 清除城市 |
|
|
|
|
clearcity() { |
|
|
|
@ -1486,10 +1509,9 @@ export default { |
|
|
|
|
/deep/.orderTables .el-select>.el-input{ |
|
|
|
|
width: 35%; |
|
|
|
|
} |
|
|
|
|
/deep/ .course-input .red .el-input__inner { |
|
|
|
|
border: 1px solid red; |
|
|
|
|
} |
|
|
|
|
/deep/ .small .red .el-input__inner { |
|
|
|
|
/deep/ .course-input .red .el-input__inner, |
|
|
|
|
/deep/ .small .red .el-input__inner, |
|
|
|
|
/deep/ .red .el-input__inner { |
|
|
|
|
border: 1px solid red; |
|
|
|
|
} |
|
|
|
|
/deep/ .small .el-input__inner { |
|
|
|
|