|
|
|
@ -120,11 +120,10 @@ |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input |
|
|
|
|
class="time-input" |
|
|
|
|
onkeyup="value=this.value.replace(/\D+/g,'')" |
|
|
|
|
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled||editDisabled" maxlength="4" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'')" |
|
|
|
|
@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-option label="日" :value="0"></el-option> |
|
|
|
@ -181,7 +180,7 @@ |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :class="scope.row.finalPrice === '' && whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[allAmount($event,scope.row),calculateDiscount($event,scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" |
|
|
|
|
type="text"></el-input> |
|
|
|
@ -256,12 +255,12 @@ |
|
|
|
|
<el-table-column label="使用期限" align="center" min-width="190"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input onkeyup="value=this.value.replace(/\D+/g,'')" |
|
|
|
|
<el-input |
|
|
|
|
class="time-input" |
|
|
|
|
:class="!scope.row.periodOfUse&&whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled||editDisabled" maxlength="4" |
|
|
|
|
@change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)" |
|
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'')" |
|
|
|
|
@input="scope.row.periodOfUse = scope.row.periodOfUse.replace(/[^0-9.]/g,'')" |
|
|
|
|
v-model="scope.row.periodOfUse" placeholder="输入时间"></el-input> |
|
|
|
|
<span style="margin-left:5px"> |
|
|
|
|
<el-select class="time-select" v-model="scope.row.options" :disabled="viewDisabled||editDisabled" placeholder="请选择" @change="deadLine(scope.row.periodOfUse,scope.row,scope.row.options)"> |
|
|
|
@ -320,7 +319,7 @@ |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :class="scope.row.finalPrice === '' && whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@change="[dealComputers($event,scope.row),calculateDiscount($event,scope.row),userAmount($event,scope.row)]" |
|
|
|
|
v-model="scope.row.finalPrice" |
|
|
|
|
type="text"></el-input> |
|
|
|
@ -342,8 +341,7 @@ |
|
|
|
|
<div class="small"> |
|
|
|
|
<el-input :class="!scope.row.accountNum&&whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled" |
|
|
|
|
onkeyup="value=this.value.replace(/\D+/g,'')" |
|
|
|
|
oninput="value=value.replace(/[^0-9.]/g,'')" |
|
|
|
|
@input="scope.row.accountNum = scope.row.accountNum.replace(/[^0-9.]/g,'')" |
|
|
|
|
v-model="scope.row.accountNum" |
|
|
|
|
@change="[dealComputers($event,scope.row),dealBargain($event,scope.row),calculateDiscount($event,scope.row)]" |
|
|
|
|
type="text"></el-input> |
|
|
|
@ -357,7 +355,7 @@ |
|
|
|
|
<el-input :class="scope.row.totalAmount === '' && whetherSubmit?'red':''" |
|
|
|
|
:disabled="viewDisabled||editDisabled" |
|
|
|
|
@blur="[allAmount($event,scope.row),allAmountChange($event,scope.row),calculateDiscount($event,scope.row)]" |
|
|
|
|
oninput="value=value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
@input="scope.row.totalAmount = scope.row.totalAmount.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" |
|
|
|
|
v-model="scope.row.totalAmount" |
|
|
|
|
type="text"></el-input> |
|
|
|
|
</div> |
|
|
|
@ -1336,25 +1334,25 @@ export default { |
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
|
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 => { |
|
|
|
|
// if (res.endTime) { |
|
|
|
|
// 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) |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
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 => { |
|
|
|
|
if (res.endTime) { |
|
|
|
|
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){ |
|
|
|
|