订单课程修复

dev_202207
yujialong 2 years ago
parent 3ac5c7aba2
commit 7b495b35fd
  1. 1
      src/setting.js
  2. 1
      src/utils/api.js
  3. 19
      src/views/course/AddCurriculum.vue
  4. 4
      src/views/course/contentSettings.vue
  5. 40
      src/views/order/AddOrder.vue
  6. 33
      src/views/order/Order.vue

@ -10,6 +10,7 @@ let host = `${location.origin}/`
if (isDev) { if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/'
// host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.137:9000/'// 赓 // host = 'http://192.168.31.137:9000/'// 赓
} else if (isPro) { } else if (isPro) {

@ -27,6 +27,7 @@ export default {
ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
bulkShipping: `nakadai/nakadai/orderOther/bulkShipping`, bulkShipping: `nakadai/nakadai/orderOther/bulkShipping`,
getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
refreshCache: `data/data/myDate/refreshCache`,
// 客户管理 // 客户管理
delCustomers: `nakadai/nakadai/customer/delCustomers`, delCustomers: `nakadai/nakadai/customer/delCustomers`,

@ -187,7 +187,7 @@
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column prop="applicationName" label="系统名称" align="center"> <el-table-column prop="applicationName" label="系统名称" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ systemAll.find(e => e.systemId == scope.row.systemId).systemName }} {{ scope.row.applicationName || systemAll.find(e => e.systemId == scope.row.systemId).systemName }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" width="100"> <el-table-column label="排序" align="center" width="100">
@ -317,7 +317,7 @@
</el-table-column> </el-table-column>
<el-table-column prop="projectName" width="80" label="系统类型" align="center"> <el-table-column prop="projectName" width="80" label="系统类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.type }} {{ scope.row.type ? '流程类' : '编程类' }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
@ -594,11 +594,14 @@ export default {
}, },
// //
handleConfig(type) { handleConfig(type) {
this.permissions = type; this.systemKeyword = ''
this.configVisible = true; this.projectKeyword = ''
this.pageNo = 1; this.checkedKeyword = ''
this.getConfig(); this.permissions = type;
this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData)) this.configVisible = true;
this.pageNo = 1;
this.getConfig();
this.checkeds = JSON.parse(JSON.stringify(type ? this.assessmentData : this.practiceData))
}, },
// //
getConfig() { getConfig() {
@ -630,7 +633,6 @@ export default {
this.projectAll = JSON.parse(JSON.stringify(res)) // this.projectAll = JSON.parse(JSON.stringify(res)) //
const result = [] const result = []
res.map(e => { res.map(e => {
e.type = item.type ? '流程类' : '编程类'
// //
const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId) const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId)
e.check = include e.check = include
@ -658,7 +660,6 @@ export default {
if (val) { if (val) {
res.map(e => { res.map(e => {
if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) {
e.type = item.type ? '流程类' : '编程类'
checkeds.push(e) checkeds.push(e)
} }
}) })

@ -834,6 +834,10 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.page-content {
max-height: calc(100vh - 420px);
overflow: auto;
}
.action-btn{ .action-btn{
color: #9076FF; color: #9076FF;
font-size: 14px; font-size: 14px;

@ -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: 23 // 1: 23
@ -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,7 +1382,8 @@ export default {
// /- // /-
handleDeliver(e, row) { handleDeliver(e, row) {
if (this.editDisabled) { if (this.editDisabled) {
this.$post(this.api.ship,row).then(res => {}); this.refreshCache()
this.$post(this.api.ship,row).then(res => {});
} }
}, },
// 0 // 0
@ -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

@ -158,7 +158,8 @@ export default {
pageNo: +this.$route.query.page || 1, pageNo: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
totals: 0, totals: 0,
searchTimer: null searchTimer: null,
schools: []
}; };
}, },
watch: { watch: {
@ -170,7 +171,8 @@ export default {
} }
}, },
created() { created() {
this.getData(); this.getData()
this.getSchool()
}, },
methods: { methods: {
test(val) { test(val) {
@ -245,6 +247,23 @@ export default {
}) })
// this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus); // this.$router.push("/addorder?" + val + "=" + row.orderId+"&orderStatus="+orderStatus);
}, },
//
getSchool() {
this.$post(this.api.queryCustomer, {
countries: '中国',
provinceId: '',
cityId: '',
searchContent: '',
page: 1,
size: 10000
}).then(res => {
this.schools = res.message.list
}).catch(res => {})
},
//
refreshCache(customerId) {
this.$post(`${this.api.refreshCache}?schoolId=${this.schools.find(e => e.customerId == customerId).schoolId}`).then(res => {}).catch(res => {})
},
// //
handleDelete(row) { handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
@ -261,6 +280,7 @@ export default {
this.pageNo = this.pageNo-1 this.pageNo = this.pageNo-1
} }
} }
this.refreshCache(row.customerId)
this.getData(); this.getData();
}).catch(res => { }).catch(res => {
}); });
@ -279,14 +299,17 @@ export default {
} }
}, },
delAllSelection() { delAllSelection() {
if (this.multipleSelection.length != "") { const list = this.multipleSelection
if (list.length != "") {
// //
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.$post(this.api.orderDelete, { ids: this.multipleSelection }).then(res => { this.$post(this.api.orderDelete, { ids: list }).then(res => {
const { orderData } = this
list.map(e => this.refreshCache(orderData.find(n => n.orderId == e).customerId))
this.$message.success("删除成功"); this.$message.success("删除成功");
if(this.multipleSelection.length == this.orderData.length){ if(list.length == this.orderData.length){
if(this.pageNo > 1){ if(this.pageNo > 1){
this.pageNo = this.pageNo-1 this.pageNo = this.pageNo-1
} }

Loading…
Cancel
Save