订单课程修复

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. 42
      src/views/order/AddOrder.vue
  6. 33
      src/views/order/Order.vue

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

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

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

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

@ -247,7 +247,7 @@
</el-switch>
<el-switch
v-else
:disabled="viewDisabled || scope.row.status === 3"
:disabled="viewDisabled"
v-model="scope.row.isEnable"
:active-value="1"
:inactive-value="0"
@ -642,7 +642,7 @@
</el-dialog>
</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>
</template>
@ -943,25 +943,27 @@ export default {
let list = orderOther.map(e => {
const now = Date.now()
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) {
let end = Date.parse(item.endTime);
let end = Date.parse(cur.endTime);
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))
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
} else {
//
e.startTime = "";
const date = new Date()
//
e.startTime = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`
}
e.endTime = "";
e.periodOfUse = "";
} else if (!this.viewDisabled) { //
e.startTime = item.startTime.split(" ")[0];
e.endTime = item.endTime.split(" ")[0];
e.startTime = cur.startTime.split(" ")[0];
e.endTime = cur.endTime.split(" ")[0];
}
}
// }
const startTime = new Date(e.startTime)
const endTime = new Date(e.endTime)
// 1: 23
@ -976,6 +978,13 @@ export default {
this.coursePermissions = list.filter(i => i.authority === 1);
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() {
let purchase = 0 //
@ -1054,6 +1063,7 @@ export default {
this.loading = true;
if (this.editDisabled) {
this.$post(this.api.orderUpdate, param).then(res => {
this.refreshCache()
this.$message.success("修改成功");
this.loading = false;
this.$router.back();
@ -1062,9 +1072,10 @@ export default {
});
} else {
this.$post(this.api.orderAdd, param).then(res => {
this.refreshCache()
this.$message.success("添加订单成功");
this.loading = false;
this.$router.back();
this.renewDisabled ? this.$router.push('/order') : this.$router.back();
}).catch(err => {
this.loading = false;
});
@ -1362,6 +1373,7 @@ export default {
const list = data ? this.dataPlatformPermissions : this.coursePermissions
list.map(e => e.ship = ship)
if (this.editDisabled) {
this.refreshCache()
this.$post(this.api.bulkShipping, {
orderOthers: list
}).then(res => {})
@ -1370,7 +1382,8 @@ export default {
// /-
handleDeliver(e, row) {
if (this.editDisabled) {
this.$post(this.api.ship,row).then(res => {});
this.refreshCache()
this.$post(this.api.ship,row).then(res => {});
}
},
// 0
@ -1483,14 +1496,15 @@ export default {
const useUnit = row.periodOfUse // 使
let price = row.marketPrice //
// //365,/12)
row.marketValue = ((!unit ?
row.marketValue = ((!unit ?
price / 365 * useUnit :
unit === 1 ?
price / 12 * useUnit :
price * useUnit)).toFixed(2)
this.dealComputers(e, row)
row.authority ? this.calculateDiscountCourse(e, row) : this.calculateDiscount(e, row)
// +1
if (isDate) {
const cId = row.dataOrCourseId

@ -158,7 +158,8 @@ export default {
pageNo: +this.$route.query.page || 1,
pageSize: 10,
totals: 0,
searchTimer: null
searchTimer: null,
schools: []
};
},
watch: {
@ -170,7 +171,8 @@ export default {
}
},
created() {
this.getData();
this.getData()
this.getSchool()
},
methods: {
test(val) {
@ -245,6 +247,23 @@ export default {
})
// 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) {
this.$confirm("确定要删除吗?", "提示", {
@ -261,6 +280,7 @@ export default {
this.pageNo = this.pageNo-1
}
}
this.refreshCache(row.customerId)
this.getData();
}).catch(res => {
});
@ -279,14 +299,17 @@ export default {
}
},
delAllSelection() {
if (this.multipleSelection.length != "") {
const list = this.multipleSelection
if (list.length != "") {
//
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).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("删除成功");
if(this.multipleSelection.length == this.orderData.length){
if(list.length == this.orderData.length){
if(this.pageNo > 1){
this.pageNo = this.pageNo-1
}

Loading…
Cancel
Save