订单修复

dev_review
yujialong 5 months ago
parent 6fe4a41fa1
commit 300e917d1e
  1. 66
      src/views/order/AddOrder.vue

@ -157,15 +157,15 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@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.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -303,15 +303,15 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@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.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -453,15 +453,15 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@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.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -621,14 +621,14 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
placeholder="请选择使用日期">
</el-date-picker>
</p>
<p v-else>
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -754,15 +754,15 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@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.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -898,15 +898,15 @@
<el-table-column label="起止日期" align="center" min-width="240">
<template slot-scope="scope">
<p v-if="!scope.row.startTime">
<el-date-picker :class="orderRepeat.includes(scope.row.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@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.dataOrCourseId) ? 'red' : ''"
style="width:130px" v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
<el-date-picker :class="orderRepeat.includes(scope.row.mallId) ? 'red' : ''" style="width:130px"
v-model="scope.row.startTime" type="date" :disabled="viewDisabled || isEdit"
@change="deadLine(scope.row.periodOfUse, scope.row, scope.row.options, 1)"
placeholder="请选择使用日期">
</el-date-picker>
@ -1555,7 +1555,6 @@ export default {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
authority: 4,
// authority: 3,
customerId,
productId: orderOther.filter(e => e.authority === 4).map(e => e.mallId),
}).then(({ orderOthers }) => {
@ -1598,6 +1597,7 @@ export default {
},
async setStartDate (renewList, orderOther) {
const now = await Util.getNow()
const onTrial = this.form.orderType === 2
let list = orderOther.map(e => {
e.settlementPriceUnit = e.settlementPrice
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.endTime = "";
e.periodOfUse = "";
e.endTime = ''
e.periodOfUse = ''
// 1
if (onTrial) {
e.periodOfUse = 1
e.options = 1
this.deadLine(e.periodOfUse, e, e.options, 1)
}
} else if (!this.viewDisabled) { //
e.startTime = cur.startTime.split(" ")[0];
if (cur.endTime) e.endTime = cur.endTime.split(" ")[0];
@ -2301,9 +2307,7 @@ export default {
let endTime = time + optionsData
var timestamp = endTime;
var dt = new Date(timestamp); //
// debugger
row.endTime = (dt.getFullYear()) + "-" + (dt.getMonth() + 1) + "-" + (dt.getDate())
console.log("🚀 ~ deadLine ~ row.endTime:", row.endTime)
let endYear = timestamp - time
let endYears = endYear / 1000 / 60 / 60 / 24
row.remainingPeriod = endYears
@ -2322,9 +2326,9 @@ export default {
// +1
if (isDate) {
const cId = row.dataOrCourseId
const cId = row.mallId
const date = new Date(row.startTime)
const orderRepeat = this.orderRepeat
const { orderRepeat } = this
this.$post(this.api.getOrderOtherTime, {
customerId: this.form.customerId,
id: row.mallId,

Loading…
Cancel
Save