diff --git a/src/setting.js b/src/setting.js index b1dd2f0..4453817 100644 --- a/src/setting.js +++ b/src/setting.js @@ -9,9 +9,9 @@ let jumpPath = `${location.origin}/judgmentPoint` let host = `${location.origin}/` if (isDev) { 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.116:9000/'// 赓 } else if (isPro) { jumpPath = 'https://www.huorantech.cn/judgmentPoint/' diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index 0b70b12..8899024 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -121,7 +121,7 @@ 一键发货 取消全部发货 - 添加 + 添加 @@ -264,6 +264,163 @@ + + + + + + + 理论课程 + + + + + 一键发货 + 取消全部发货 + + 添加 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - {{ scope.row.endTime }} + + + + + + + 天 + + + + + + + 元 + + + + + + + + + + + + 元 + + + + + + + 元 + + + + + + 配置 + + + + + + 删除 + + + + + + + + + + + + + @@ -278,7 +435,7 @@ 一键发货 取消全部发货 - 添加 + 添加 @@ -456,7 +613,7 @@ 一键发货 取消全部发货 - 添加 + 添加 @@ -563,7 +720,7 @@ 删除 一键发货 取消全部发货 - 添加 + 添加 @@ -763,7 +920,7 @@ 一键发货 取消全部发货 - 添加 + 添加 @@ -1054,7 +1211,7 @@ 确 定 - + @@ -1071,7 +1228,7 @@ - 实训课程(非集成)列表 + {{ classificationId | dialogTitle}} @@ -1086,8 +1243,8 @@ - - + + 取 消 - 确 定 + 确 定147258 @@ -1199,7 +1356,7 @@ - + 取消 确定 @@ -1217,12 +1374,13 @@ export default { data() { return { // authority: 权限。0数据平台,1为课程,2职站增值模块,3实训课程(非集成),4实验工具 - deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes'], + deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes','theoryCourse'], pageTypes: false, dataPageTypes: false, modelPageTypes:false, practiceCourseTypes:false, expToolTypes:false, + theoryCourse: false, loading: false,// 页面加载 isAdd: false, // 是否添加 viewDisabled: false,// 查看禁用 @@ -1399,6 +1557,10 @@ export default { shipVisible: false, shipContent: '', curRow: {}, + // 用于区分栏目 1实训课程 2理论课程 3职站增值应用 4实训课程(非集成)5数据前瞻 6实验工具 + classificationId: 0, + // 理论课程数据 + theoryCourseList: [] }; }, watch: { @@ -1537,7 +1699,8 @@ export default { if (orderOther.find(e => e.authority === 2)) { promises.push(new Promise((resolve, reject) => { this.$post(this.api.renew, { - authority: 2, + // authority: 2, + authority: 5, customerId, productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId) }).then(({ orderOthers }) => { @@ -1550,6 +1713,7 @@ export default { promises.push(new Promise((resolve, reject) => { this.$post(this.api.renew, { authority: 3, + // authority: 2, customerId, productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId) }).then(({ orderOthers }) => { @@ -1562,6 +1726,7 @@ export default { promises.push(new Promise((resolve, reject) => { this.$post(this.api.renew, { authority: 4, + // authority: 3, customerId, productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId) }).then(({ orderOthers }) => { @@ -1570,6 +1735,18 @@ export default { }).catch(err => {}) })) } + if (orderOther.find(e => e.authority === 5)) { + promises.push(new Promise((resolve, reject) => { + this.$post(this.api.renew, { + authority: 2, + customerId, + productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId) + }).then(({ orderOthers }) => { + list.push(...orderOthers) + resolve() + }).catch(err => {}) + })) + } Promise.all(promises).then(_ => { this.setStartDate(list, orderOther) }) @@ -1635,10 +1812,17 @@ export default { return e; });// 俩列表 this.coursePermissions = list.filter(i => i.authority === 1); + this.theoryCourseList = list.filter(i => i.authority === 5); this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.valuePermissions = list.filter(i => i.authority === 2); this.practicalCourses = list.filter(i => i.authority === 3); this.expTools = list.filter(i => i.authority === 4); + + + // this.dataPlatformPermissions = list.filter(i => i.authority === 0); + // this.theoryCourseList = list.filter(i => i.authority === 2); + // this.practicalCourses = list.filter(i => i.authority === 3); + // this.expTools = list.filter(i => i.authority === 4); }, // 获取费率 getRate() { @@ -1783,7 +1967,8 @@ 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]; + let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools,...this.theoryCourseList]; + console.log('tempArr=>',tempArr) let renew = tempArr.some(e => e.renew); if (this.renewDisabled || renew) {/* 续费状态下 */ this.form.orderNature = 2; @@ -1860,12 +2045,6 @@ export default { this.$forceUpdate(); } }, - // 添加课程权限 - addCourseJurisdiction() { - if (!this.form.customerId) return this.$message.warning("请先选择客户"); - this.courseVisible = true; - this.getCourseJurisdiction(); - }, // 获取课程权限列表 getCourseJurisdiction() { const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') @@ -1992,7 +2171,18 @@ export default { } }); }, - + //删除理论课程 + delCourseDataForm(index) { + this.$confirm("确定要删除吗?", "提示", { + type: "warning" + }).then(() => { + if (this.renewDisabled && this.theoryCourseList.length === 1) { + return this.$message.warning("续费至少保留一条课程权限"); + } else { + this.theoryCourseList.splice(index, 1); + } + }); + }, // 添加职站增值权限 addValueJurisdiction() { @@ -2166,6 +2356,19 @@ export default { }); }, + // 删除职站增值应用产品权限 + delDataFormList(index) { + this.$confirm("确定要删除吗?", "提示", { + type: "warning" + }).then(() => { + if (this.renewDisabled && this.valuePermissions.length === 1) { + return this.$message.warning("续费至少保留一条产品信息"); + } else { + this.valuePermissions.splice(index, 1); + } + }); + }, + // 添加实训课程权限 @@ -2179,6 +2382,7 @@ export default { this.dataLoading = true; this.$post(this.api.listOfGoods, { pageNum: this.practicalCoursePage, + productClassification: this.classificationId, pageSize: 10, isShelves: 0 }).then(({ page }) => { @@ -2206,10 +2410,34 @@ export default { async practicalCourseSubmit() { if (this.practicalCoursesSelect.length > 0) { let that = this; + let authority + switch (that.classificationId) { + case 1: + authority = 1 + break; + case 2: + authority = 5 + break; + case 3: + authority = 2 + break; + case 4: + authority = 3 + break; + case 5: + authority = 0 + break; + case 6: + authority = 4 + break; + default: + break; + } const { orderType } = this.form let fn = function(e) { let obj = { - dataOrCourseId: e.mallId,// id + dataOrCourseId: e.associatedProduct,// id + mallId: e.mallId, productName: e.productName,// 名称 periodOfUse: "",// 使用期限 startTime: new Date(),// 开始 @@ -2223,14 +2451,42 @@ export default { totalAmount: "",// 总价 isEnable: 0, // 启用否:1启用,0禁用 ship: 0,// 发货否(0未发货,1已发货,默认不发货) - authority: 3, // 区分权限 0为数据平台权限,1为课程权限 + authority: authority, // 区分权限 0为数据平台权限,1为课程权限 options: 1, settlementPrice: orderType === 2 ? 0 : '', // 结算价 settlementMethod: e.settlementMethod, // 结算方式,0为单价,1为分成 settlementPriceUnit: e.settlementPrice, // 结算单价 businessProportion: e.businessProportion, // 商务占比 }; - that.practicalCourses.push(obj); + switch (that.classificationId) { + case 1: + // 实训课程 + that.coursePermissions.push(obj) + break; + case 2: + // 理论课程 + that.theoryCourseList.push(obj) + break; + case 3: + // 职站增值应用 + that.valuePermissions.push(obj) + break; + case 4: + // 实训课程(非集成) + that.practicalCourses.push(obj) + break; + case 5: + // 数据前瞻 + that.dataPlatformPermissions.push(obj) + break; + case 6: + // 实验工具 + that.expTools.push(obj) + break; + default: + break; + } + // that.practicalCourses.push(obj); }; let idArr = []; this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值 @@ -2250,7 +2506,7 @@ export default { this.practicalCoursesSelect = []; /* 调接口,判断是否为客户已有的产品功能 */ let params = { - authority: 3, + authority: this.classificationId, customerId: this.form.customerId, productId: idArr }; @@ -2297,6 +2553,7 @@ export default { this.expToolVisible = true; this.getExpTool(); }, + // 获取数据权限列表 getExpTool() { const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理') @@ -2434,7 +2691,10 @@ export default { this.practicalCourses : data == 4 ? this.expTools : + data === 5 ? + this.theoryCourseList : this.coursePermissions + list.map(e => { e.ship = ship if(e.ship === 1) { @@ -2771,6 +3031,40 @@ export default { }, goBack() { this.$router.go(-1); + }, + /** + * 添加实训课程产品权限,理论课程 ,数据前瞻平台权限,职站增值应用产品权限,实训课程(非集成),实验工具 + * type + */ + addCourseJurisdiction(type) { + if (!this.form.customerId) return this.$message.warning("请先选择客户"); + // this.courseVisible = true; + // this.getCourseJurisdiction(); + this.classificationId = type + this.practicalCourseVisible = true; + this.getPracticalCourses(); + }, + + }, + filters: { + dialogTitle(options) { + console.log(options) + switch (options) { + case 1: + return '实训课程产品列表' + case 2: + return '理论课程列表' + case 3: + return '职站增值应用列表' + case 4: + return '实训课程(非集成)列表' + case 5: + return '数据前瞻平台权限列表' + case 6: + return '实验工具列表' + default: + break; + } } } }; diff --git a/src/views/shop/addProduct/index.vue b/src/views/shop/addProduct/index.vue index 166cd7f..fb90808 100644 --- a/src/views/shop/addProduct/index.vue +++ b/src/views/shop/addProduct/index.vue @@ -41,7 +41,7 @@ - + @@ -59,7 +59,7 @@ 自定义 - +
+ + +
+ + + - {{ scope.row.endTime }}