订单起止日期修改

dev_2022-03-03
yujialong 3 years ago
parent 43d37d41b4
commit 2f0607780a
  1. 1
      src/utils/api.js
  2. 48
      src/views/order/AddOrder.vue

@ -20,6 +20,7 @@ export default {
orderUpdate: `${host}/nakadai/nakadai/order/update`,// 订单更新
renew: `${host}/nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
ship: `${host}/nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
getOrderOtherTime: `${host}/nakadai/nakadai/orderOther/getOrderOtherTime`,
queryAccountIsExist: `${host}/liuwanr/userInfo/queryServerAccountIsExist`, //查询账号是否存在

@ -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 {

Loading…
Cancel
Save