订单修复

dev_2022-03-03
yujialong 3 years ago
parent 47f94669e1
commit b30a3b5efc
  1. 47
      src/views/order/AddOrder.vue

@ -122,10 +122,10 @@
class="time-input" class="time-input"
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" :class="!scope.row.periodOfUse&&whetherSubmit?'red':''"
:disabled="viewDisabled||editDisabled" maxlength="4" :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,'')" @input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')"
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> 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="0"></el-option>
<el-option label="月" :value="1"></el-option> <el-option label="月" :value="1"></el-option>
<el-option label="年" :value="2"></el-option> <el-option label="年" :value="2"></el-option>
@ -1337,27 +1337,6 @@ export default {
}, },
// 使 // 使
deadLine(e,row,options, isDate) { 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 = '' let optionsData = ''
if(e > 0){ if(e > 0){
if (options == 1){ if (options == 1){
@ -1379,6 +1358,28 @@ export default {
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
// +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() { clearprovince() {

Loading…
Cancel
Save