|
|
|
@ -122,10 +122,10 @@ |
|
|
|
|
class="time-input" |
|
|
|
|
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled||editDisabled" maxlength="4" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)" |
|
|
|
|
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options, 1)"> |
|
|
|
|
<el-option label="日" :value="0"></el-option> |
|
|
|
|
<el-option label="月" :value="1"></el-option> |
|
|
|
|
<el-option label="年" :value="2"></el-option> |
|
|
|
@ -1337,27 +1337,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
|
deadLine(e,row,options, isDate) { |
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
|
if (isDate) { |
|
|
|
|
const cId = row.dataOrCourseId |
|
|
|
|
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(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1) |
|
|
|
|
if (res.endTime) { |
|
|
|
|
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(cId) || orderRepeat.push(cId) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
let optionsData = '' |
|
|
|
|
if(e > 0){ |
|
|
|
|
if (options == 1){ |
|
|
|
@ -1379,6 +1358,28 @@ export default { |
|
|
|
|
let endYear = timestamp - time |
|
|
|
|
let endYears = endYear/1000/60/60/24 |
|
|
|
|
row.remainingPeriod = endYears |
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
|
if (isDate) { |
|
|
|
|
const cId = row.dataOrCourseId |
|
|
|
|
const date = new 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(), |
|
|
|
|
endTime: row.endTime |
|
|
|
|
}).then(res => { |
|
|
|
|
orderRepeat.includes(cId) && orderRepeat.splice(orderRepeat.findIndex(e => e === cId), 1) |
|
|
|
|
if (res.endTime) { |
|
|
|
|
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(cId) || orderRepeat.push(cId) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 清除省份 |
|
|
|
|
clearprovince() { |
|
|
|
|