|
|
@ -247,7 +247,7 @@ |
|
|
|
</el-switch> |
|
|
|
</el-switch> |
|
|
|
<el-switch |
|
|
|
<el-switch |
|
|
|
v-else |
|
|
|
v-else |
|
|
|
:disabled="viewDisabled || scope.row.status === 3" |
|
|
|
:disabled="viewDisabled" |
|
|
|
v-model="scope.row.isEnable" |
|
|
|
v-model="scope.row.isEnable" |
|
|
|
:active-value="1" |
|
|
|
:active-value="1" |
|
|
|
:inactive-value="0" |
|
|
|
:inactive-value="0" |
|
|
@ -642,7 +642,7 @@ |
|
|
|
</el-dialog> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<!-- 选择客户 --> |
|
|
|
<!-- 选择客户 --> |
|
|
|
<select-client @back="backToOrder" v-show="showSelectClient" :refresh="showSelectClient"></select-client> |
|
|
|
<select-client ref="client" @back="backToOrder" v-show="showSelectClient" :refresh="showSelectClient"></select-client> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
@ -943,25 +943,27 @@ export default { |
|
|
|
let list = orderOther.map(e => { |
|
|
|
let list = orderOther.map(e => { |
|
|
|
const now = Date.now() |
|
|
|
const now = Date.now() |
|
|
|
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // 匹配renew接口返回的数据 |
|
|
|
const item = renewList.find(n => n.dataOrCourseId === e.dataOrCourseId && n.authority === e.authority) // 匹配renew接口返回的数据 |
|
|
|
if (item) { |
|
|
|
// if (item) { |
|
|
|
// 处于续费 |
|
|
|
// 处于续费 |
|
|
|
|
|
|
|
const cur = item || e |
|
|
|
if (this.renewDisabled) { |
|
|
|
if (this.renewDisabled) { |
|
|
|
let end = Date.parse(item.endTime); |
|
|
|
let end = Date.parse(cur.endTime); |
|
|
|
if (now < end) { |
|
|
|
if (now < end) { |
|
|
|
let time = new Date(item.endTime.split(" ")[0]) |
|
|
|
let time = new Date(cur.endTime.split(" ")[0]) |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
const date = new Date() |
|
|
|
// 过期 |
|
|
|
// 过期 |
|
|
|
e.startTime = ""; |
|
|
|
e.startTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}` |
|
|
|
} |
|
|
|
} |
|
|
|
e.endTime = ""; |
|
|
|
e.endTime = ""; |
|
|
|
e.periodOfUse = ""; |
|
|
|
e.periodOfUse = ""; |
|
|
|
} else if (!this.viewDisabled) { // 如果不是查看 |
|
|
|
} else if (!this.viewDisabled) { // 如果不是查看 |
|
|
|
e.startTime = item.startTime.split(" ")[0]; |
|
|
|
e.startTime = cur.startTime.split(" ")[0]; |
|
|
|
e.endTime = item.endTime.split(" ")[0]; |
|
|
|
e.endTime = cur.endTime.split(" ")[0]; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// } |
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
const startTime = new Date(e.startTime) |
|
|
|
const endTime = new Date(e.endTime) |
|
|
|
const endTime = new Date(e.endTime) |
|
|
|
// 1: 未生效,2:生效中,3:已过期 |
|
|
|
// 1: 未生效,2:生效中,3:已过期 |
|
|
@ -976,6 +978,13 @@ export default { |
|
|
|
this.coursePermissions = list.filter(i => i.authority === 1); |
|
|
|
this.coursePermissions = list.filter(i => i.authority === 1); |
|
|
|
this.dataPlatformPermissions = list.filter(i => i.authority === 0); |
|
|
|
this.dataPlatformPermissions = list.filter(i => i.authority === 0); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 刷新缓存 |
|
|
|
|
|
|
|
refreshCache() { |
|
|
|
|
|
|
|
const { customerId } = this.form |
|
|
|
|
|
|
|
const clients = this.$refs.client.listData |
|
|
|
|
|
|
|
const curClient = clients.find(e => e.customerId == customerId) |
|
|
|
|
|
|
|
this.$post(`${this.api.refreshCache}?schoolId=${curClient ? curClient.schoolId : ''}`).then(res => {}).catch(res => {}) |
|
|
|
|
|
|
|
}, |
|
|
|
// 新增订单 |
|
|
|
// 新增订单 |
|
|
|
submitOrder() { |
|
|
|
submitOrder() { |
|
|
|
let purchase = 0 // 总采购成本 |
|
|
|
let purchase = 0 // 总采购成本 |
|
|
@ -1054,6 +1063,7 @@ export default { |
|
|
|
this.loading = true; |
|
|
|
this.loading = true; |
|
|
|
if (this.editDisabled) { |
|
|
|
if (this.editDisabled) { |
|
|
|
this.$post(this.api.orderUpdate, param).then(res => { |
|
|
|
this.$post(this.api.orderUpdate, param).then(res => { |
|
|
|
|
|
|
|
this.refreshCache() |
|
|
|
this.$message.success("修改成功"); |
|
|
|
this.$message.success("修改成功"); |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
this.$router.back(); |
|
|
|
this.$router.back(); |
|
|
@ -1062,9 +1072,10 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.$post(this.api.orderAdd, param).then(res => { |
|
|
|
this.$post(this.api.orderAdd, param).then(res => { |
|
|
|
|
|
|
|
this.refreshCache() |
|
|
|
this.$message.success("添加订单成功"); |
|
|
|
this.$message.success("添加订单成功"); |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
this.$router.back(); |
|
|
|
this.renewDisabled ? this.$router.push('/order') : this.$router.back(); |
|
|
|
}).catch(err => { |
|
|
|
}).catch(err => { |
|
|
|
this.loading = false; |
|
|
|
this.loading = false; |
|
|
|
}); |
|
|
|
}); |
|
|
@ -1362,6 +1373,7 @@ export default { |
|
|
|
const list = data ? this.dataPlatformPermissions : this.coursePermissions |
|
|
|
const list = data ? this.dataPlatformPermissions : this.coursePermissions |
|
|
|
list.map(e => e.ship = ship) |
|
|
|
list.map(e => e.ship = ship) |
|
|
|
if (this.editDisabled) { |
|
|
|
if (this.editDisabled) { |
|
|
|
|
|
|
|
this.refreshCache() |
|
|
|
this.$post(this.api.bulkShipping, { |
|
|
|
this.$post(this.api.bulkShipping, { |
|
|
|
orderOthers: list |
|
|
|
orderOthers: list |
|
|
|
}).then(res => {}) |
|
|
|
}).then(res => {}) |
|
|
@ -1370,6 +1382,7 @@ export default { |
|
|
|
// 课程/数据平台-发货 |
|
|
|
// 课程/数据平台-发货 |
|
|
|
handleDeliver(e, row) { |
|
|
|
handleDeliver(e, row) { |
|
|
|
if (this.editDisabled) { |
|
|
|
if (this.editDisabled) { |
|
|
|
|
|
|
|
this.refreshCache() |
|
|
|
this.$post(this.api.ship,row).then(res => {}); |
|
|
|
this.$post(this.api.ship,row).then(res => {}); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -1488,9 +1501,10 @@ export default { |
|
|
|
unit === 1 ? |
|
|
|
unit === 1 ? |
|
|
|
price / 12 * useUnit : |
|
|
|
price / 12 * useUnit : |
|
|
|
price * useUnit)).toFixed(2) |
|
|
|
price * useUnit)).toFixed(2) |
|
|
|
|
|
|
|
|
|
|
|
this.dealComputers(e, row) |
|
|
|
this.dealComputers(e, row) |
|
|
|
|
|
|
|
|
|
|
|
row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row) |
|
|
|
row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row) |
|
|
|
|
|
|
|
|
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
// 只有改变了起止日期才需要调接口查询订单,该接口作用是把开始时间传过去,会返回一个提示或者时间,如果是时间,则把时间+1天,如果是提示,则无法保存 |
|
|
|
if (isDate) { |
|
|
|
if (isDate) { |
|
|
|
const cId = row.dataOrCourseId |
|
|
|
const cId = row.dataOrCourseId |
|
|
|