diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 588cb47..815f608 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -400,6 +400,155 @@ + + +
+
+
+

+ 理实课程产品权限 +
+
+ + + 添加 +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
@@ -1211,6 +1360,12 @@ export default { deadline: '', unit: '', }, + { + id: 7, + name: 'theoryTrialList', + deadline: '', + unit: '', + }, ], pageTypes: false, dataPageTypes: false, @@ -1395,10 +1550,11 @@ export default { shipContent: '', shipInfo: '', curRow: {}, - // 用于区分栏目 1实训课程 2理论课程 3职站增值应用 4实训课程(非集成)5数据前瞻 6实验工具 + // 用于区分栏目 1实训课程 2理论课程 3职站增值应用 4实训课程(非集成)5数据前瞻 6实验工具 7理实课程 classificationId: 0, // 理论课程数据 theoryCourseList: [], + theoryTrialList: [], units: [ { id: 0, @@ -1662,6 +1818,7 @@ export default { });// 俩列表 this.coursePermissions = list.filter(i => i.authority === 1 && (i.mallClassificationId == 1 || !i.mallClassificationId)); this.theoryCourseList = list.filter(i => i.authority === 1 && i.mallClassificationId == 2); + this.theoryTrialList = list.filter(i => i.authority === 1 && i.mallClassificationId == 7); this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.valuePermissions = list.filter(i => i.authority === 2); this.practicalCourses = list.filter(i => i.authority === 3); @@ -1723,7 +1880,7 @@ export default { submitOrder () { let purchase = 0 // 总采购成本 let profit = 0 // 总利润 - if (!this.coursePermissions.length && !this.theoryCourseList.length && !this.dataPlatformPermissions.length && !this.valuePermissions.length && !this.practicalCourses.length && !this.expTools.length) { + if (!this.coursePermissions.length && !this.theoryCourseList.length && !this.theoryTrialList.length && !this.dataPlatformPermissions.length && !this.valuePermissions.length && !this.practicalCourses.length && !this.expTools.length) { return this.$message.error("请选择产品权限后再确认订单"); } else { // 课程权限参数校验 @@ -1769,6 +1926,27 @@ export default { return this.$message.error("请把课程参数输入完整"); } } + if (this.theoryTrialList.length) { + let courseVerify = + this.theoryTrialList.some(e => { + // if (!e.periodOfUse || e.finalPrice === '') { + if (!e.periodOfUse || e.finalPrice === '' || !e.startTime) { + return false; + } else { + const curPurchase = +e.settlementPrice + (e.settlementPrice * (this.rate / 100)) + purchase += curPurchase + profit += +e.finalPrice - curPurchase + return true; + } + }); + if (!courseVerify) { + this.whetherSubmit = true; + setTimeout(() => { + this.whetherSubmit = false; + }, 4000); + return this.$message.error("请把课程参数输入完整"); + } + } // 数据平台权限参数校验 if (this.dataPlatformPermissions.length) { let dataVerify = @@ -1854,7 +2032,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, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools, ...this.theoryCourseList]; + let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools, ...this.theoryCourseList, ...this.theoryTrialList]; console.log('tempArr=>', tempArr) let renew = tempArr.some(e => e.renew); if (this.renewDisabled || renew) {/* 续费状态下 */ @@ -2082,6 +2260,9 @@ export default { case 6: authority = 4 break; + case 7: + authority = 1 + break; default: break; } @@ -2211,8 +2392,9 @@ export default { this.expTools : data === 5 ? this.theoryCourseList : - this.coursePermissions - + data === 6 ? + this.theoryTrialList : + this.coursePermissions list.map(e => { e.ship = ship if (e.ship === 1) { @@ -2581,6 +2763,8 @@ export default { return '数据前瞻平台权限列表' case 6: return '实验工具列表' + case 7: + return '理实课程列表' default: break; } diff --git a/src/views/shop/add.vue b/src/views/shop/add.vue index 108349e..a24f505 100644 --- a/src/views/shop/add.vue +++ b/src/views/shop/add.vue @@ -900,7 +900,7 @@ export default { this.$post(`${this.api.curriculumDetail}?cid=${id}`).then(({ data }) => { form.supplierIds = data.supplier.split(',').map(e => +e) this.selectedProduct = true - form.classificationIds = !data.curriculumType ? 2 : data.curriculumType + form.classificationIds = !data.curriculumType ? 2 : data.curriculumType === 1 ? 1 : 7 if (data.curriculumDisciplines && data.curriculumDisciplines.length) { form.mallDisciplines = data.curriculumDisciplines