@@ -820,9 +1213,12 @@ export default {
},
data() {
return {
+ deliverShow: ['pageTypes', 'dataPageTypes', 'modelPageTypes', 'practiceCourseTypes', 'expToolTypes'],
pageTypes: false,
dataPageTypes: false,
modelPageTypes:false,
+ practiceCourseTypes:false,
+ expToolTypes:false,
loading: false,// 页面加载
isAdd: false, // 是否添加
viewDisabled: false,// 查看禁用
@@ -852,6 +1248,8 @@ export default {
coursePermissions: [],// 课程权限
dataPlatformPermissions: [],// 数据平台权限
valuePermissions: [],
+ practicalCourses: [],
+ expTools: [],
contract: { // 合同信息
contractName: "", // 合同名称
contractFile: "", // 合同文件
@@ -965,9 +1363,28 @@ export default {
platfromPage: 1,// 页码
platformList: [],// 数据平台列表
platformSelect: [],// 数据平台弹框选中
+ productName: "",// 搜索产品名称
+
valueVisible: false,
valueCheck: [],
- productName: "",// 搜索产品名称
+
+ // 实训课程弹框
+ practicalCourseVisible: false,// 弹框显示
+ practicalCourseTotals: 0,// 列表条目
+ practicalCoursePage: 1,// 页码
+ practicalCourseList: [],
+ practicalCourseSelect: [],
+ practicalCourseName: '',
+
+
+ // 实验工具弹框
+ expToolVisible: false,// 弹框显示
+ expToolTotals: 0,// 列表条目
+ expToolPage: 1,// 页码
+ expToolList: [],
+ expToolSelect: [],
+ expToolName: '',
+
searchTimer: null,
titlesw:'',
orderRepeat: [],
@@ -1089,33 +1506,57 @@ export default {
if (orderOther.find(e => e.authority === 1)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
- authority: 1,
+ authority: 1,
+ customerId,
+ productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId)
+ }).then(({ orderOthers }) => {
+ list.push(...orderOthers)
+ resolve()
+ }).catch(err => {})
+ }))
+ }
+ if (orderOther.find(e => !e.authority)) {
+ promises.push(new Promise((resolve, reject) => {
+ this.$post(this.api.renew, {
+ authority: 0,
+ customerId,
+ productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId)
+ }).then(({ orderOthers }) => {
+ list.push(...orderOthers)
+ resolve()
+ }).catch(err => {})
+ }))
+ }
+ if (orderOther.find(e => e.authority === 2)) {
+ promises.push(new Promise((resolve, reject) => {
+ this.$post(this.api.renew, {
+ authority: 2,
customerId,
- productId: orderOther.filter(e => e.authority === 1).map(e => e.dataOrCourseId)
+ productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
}).catch(err => {})
}))
}
- if (orderOther.find(e => !e.authority)) {
+ if (orderOther.find(e => e.authority === 3)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
- authority: 0,
+ authority: 3,
customerId,
- productId: orderOther.filter(e => !e.authority).map(e => e.dataOrCourseId)
+ productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
}).catch(err => {})
}))
}
- if (orderOther.find(e => e.authority === 2)) {
+ if (orderOther.find(e => e.authority === 4)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
- authority: 2,
+ authority: 4,
customerId,
- productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
+ productId: orderOther.filter(e => e.authority === 4).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
list.push(...orderOthers)
resolve()
@@ -1144,7 +1585,6 @@ export default {
item.settlementPrice = 0
})
}
- console.log()
},
setStartDate(renewList, orderOther) {
let list = orderOther.map(e => {
@@ -1190,6 +1630,8 @@ export default {
this.coursePermissions = list.filter(i => i.authority === 1);
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);
},
// 获取费率
getRate() {
@@ -1224,7 +1666,7 @@ export default {
submitOrder() {
let purchase = 0 // 总采购成本
let profit = 0 // 总利润
- if (!this.coursePermissions.length && !this.dataPlatformPermissions.length && !this.valuePermissions.length) {
+ if (!this.coursePermissions.length && !this.dataPlatformPermissions.length && !this.valuePermissions.length && !this.practicalCourses.length && !this.expTools.length) {
return this.$message.error("请选择课程权限或数据权限或职站增值模块权限后再确认订单");
} else {
// 课程权限参数校验
@@ -1290,11 +1732,51 @@ export default {
return this.$message.error("请把课程参数输入完整");
}
}
+ if (this.practicalCourses.length) {
+ let courseVerify =
+ this.practicalCourses.some(e => {
+ if (!e.periodOfUse || e.finalPrice === '') {
+ 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.expTools.length) {
+ let courseVerify =
+ this.expTools.some(e => {
+ if (!e.periodOfUse || e.finalPrice === '') {
+ 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("请把课程参数输入完整");
+ }
+ }
}
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];
+ let tempArr = [...this.dataPlatformPermissions, ...this.coursePermissions, ...this.valuePermissions, ...this.practicalCourses, ...this.expTools];
let renew = tempArr.some(e => e.renew);
if (this.renewDisabled || renew) {/* 续费状态下 */
this.form.orderNature = 2;
@@ -1503,12 +1985,9 @@ export default {
}
});
},
- // 添加数据平台权限
- addDataJurisdiction() {
- if (!this.form.customerId) return this.$message.warning("请先选择客户");
- this.showPlatform = true;
- this.getDataJurisdiction();
- },
+
+
+ // 添加职站增值权限
addValueJurisdiction() {
if (!this.form.customerId) return this.$message.warning("请先选择客户");
this.valueVisible = true;
@@ -1553,6 +2032,14 @@ export default {
this.valuePermissions = data
this.valueVisible = false
},
+
+
+ // 添加数据平台权限
+ addDataJurisdiction() {
+ if (!this.form.customerId) return this.$message.warning("请先选择客户");
+ this.showPlatform = true;
+ this.getDataJurisdiction();
+ },
// 获取数据权限列表
getDataJurisdiction() {
let param = {
@@ -1671,41 +2158,280 @@ export default {
}
});
},
- // 课程/数据平台-启用
- handleEnable(e, row,type) {
- if (row.isEnable === 0 ) {
- if(type === 1) {
- this.pageTypes = false
- }else if(type === 2) {
- this.dataPageTypes = false
- }else {
- this.modelPageTypes = false
+
+
+
+ // 添加实训课程权限
+ addPracticalCourses() {
+ if (!this.form.customerId) return this.$message.warning("请先选择客户");
+ this.practicalCourseVisible = true;
+ this.getPracticalCourses();
+ },
+ // 获取数据权限列表
+ getPracticalCourses() {
+ const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
+ let param = {
+ pageSize: 10,
+ pageNum: this.practicalCoursePage,
+ isShelves: 1, // 只获取上架的课程
+ curriculumName: this.practicalCourseName,
+ supplierId: sid ? sid.supplierId : ''
+ };
+ this.dataLoading = true;
+ this.$post(this.api.curriculumList, param).then(res => {
+ this.practicalCourseList = res.page.records;
+ this.practicalCourseTotals = res.page.total;
+ this.dataLoading = false;
+ }).catch(err => {
+ this.dataLoading = false;
+ });
+ },
+ practicalCoursesSelectable(row, index) { // 禁止勾选已经选过的数据平台
+ let boolean = true;
+ this.practicalCourses.length && this.practicalCourses.some(e => {
+ if (e.dataOrCourseId === row.id) {
+ boolean = false;
}
- }else {
- if(type === 1) {
- this.pageTypes = false
- }else if(type === 2) {
- this.dataPageTypes = false
- }else {
- this.modelPageTypes = false
+ });
+ return boolean;
+ },
+ // 实训课程--弹框列表选中
+ practicalCoursesSelection(val) {
+ this.practicalCoursesSelect = val;
+ },
+ // 实训课程弹框--确定
+ async practicalCourseSubmit() {
+ if (this.practicalCoursesSelect.length > 0) {
+ let that = this;
+ const { orderType } = this.form
+ let fn = function(e) {
+ let obj = {
+ dataOrCourseId: e.cid,// id
+ productName: e.curriculumName,// 名称
+ periodOfUse: "",// 使用期限
+ startTime: new Date(),// 开始
+ endTime: "", // 终止
+ remainingPeriod: "",// 剩余期限
+ marketValue: '', // 市场价
+ marketPrice: e.marketPrice, // 市场单价
+ finalPrice: orderType === 2 ? 0 : '',// 成交价
+ discountRate: "",// 折扣率
+ accountNum: "",// 账号数
+ totalAmount: "",// 总价
+ isEnable: 0, // 启用否:1启用,0禁用
+ ship: 0,// 发货否(0未发货,1已发货,默认不发货)
+ authority: 3, // 区分权限 0为数据平台权限,1为课程权限
+ options: 1,
+ settlementPrice: orderType === 2 ? 0 : '', // 结算价
+ settlementMethod: e.settlementMethod, // 结算方式,0为单价,1为分成
+ settlementPriceUnit: e.settlementPrice, // 结算单价
+ businessProportion: e.businessProportion, // 商务占比
+ };
+ that.practicalCourses.push(obj);
+ };
+ let idArr = [];
+ this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值
+ idArr.push(e.cid);
+ if (this.practicalCourses.length > 0) {
+ // 比对是否存在该id,若存在,不操作,不存在,则进行push操作
+ let find = this.practicalCourses.some(i => e.cid === i.dataOrCourseId);// 判断已有的相同的id不进行处理
+ if (!find) {
+ fn(e);
+ }
+ } else {
+ fn(e);
+ }
+ });
+ this.practicalCourseVisible = false;
+ this.practicalCourseName = "";
+ this.practicalCoursesSelect = [];
+ /* 调接口,判断是否为客户已有的产品功能 */
+ let params = {
+ authority: 3,
+ customerId: this.form.customerId,
+ productId: idArr
+ };
+ await this.$post(this.api.renew, params).then(res => {
+ this.dataPlatformPermissions.map(e => {
+ res.orderOthers.map(el => {
+ if (el.dataOrCourseId === e.dataOrCourseId && el.authority == 3) {
+ let time = new Date(el.endTime)
+ time = new Date(time.setDate(time.getDate() + 1))
+ e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
+ e.endTime = "";
+ e.periodOfUse = "";
+ e.renew = true;
+ }
+ });
+ });
+ });
+ } else {
+ return this.$message.warning("请选择数据");
+ }
+ },
+ // 实训课程弹框--页数变更
+ practicalCoursesChange(val) {
+ this.practicalCoursePage = val;
+ this.getPracticalCourses();
+ },
+ // 删除实训课程权限
+ delPracticalCourses(index) {
+ this.$confirm("确定要删除吗?", "提示", {
+ type: "warning"
+ }).then(() => {
+ if (this.renewDisabled && this.practicalCourses.length === 1) {
+ return this.$message.warning("续费至少保留一条产品信息");
+ } else {
+ this.practicalCourses.splice(index, 1);
+ }
+ });
+ },
+
+
+ // 添加实训课程权限
+ addExpTool() {
+ if (!this.form.customerId) return this.$message.warning("请先选择客户");
+ this.expToolVisible = true;
+ this.getExpTool();
+ },
+ // 获取数据权限列表
+ getExpTool() {
+ const sid = this.$store.state.dataPer.find(e => e.permissionName === '课程管理')
+ let param = {
+ pageSize: 10,
+ pageNum: this.expToolPage,
+ isShelves: 1, // 只获取上架的课程
+ curriculumName: this.expToolName,
+ supplierId: sid ? sid.supplierId : ''
+ };
+ this.dataLoading = true;
+ this.$post(this.api.curriculumList, param).then(res => {
+ this.expToolList = res.page.records;
+ this.expToolTotals = res.page.total;
+ this.dataLoading = false;
+ }).catch(err => {
+ this.dataLoading = false;
+ });
+ },
+ expToolSelectable(row, index) { // 禁止勾选已经选过的数据平台
+ let boolean = true;
+ this.expTools.length && this.expTools.some(e => {
+ if (e.dataOrCourseId === row.cid) {
+ boolean = false;
}
+ });
+ return boolean;
+ },
+ // 实训课程--弹框列表选中
+ expToolSelection(val) {
+ this.expToolSelect = val;
+ },
+ // 实训课程弹框--确定
+ async expToolSubmit() {
+ if (this.expToolSelect.length > 0) {
+ let that = this;
+ const { orderType } = this.form
+ let fn = function(e) {
+ let obj = {
+ dataOrCourseId: e.cid,// id
+ productName: e.curriculumName,// 名称
+ periodOfUse: "",// 使用期限
+ startTime: new Date(),// 开始
+ endTime: "", // 终止
+ remainingPeriod: "",// 剩余期限
+ marketValue: '', // 市场价
+ marketPrice: e.marketPrice, // 市场单价
+ finalPrice: orderType === 2 ? 0 : '',// 成交价
+ discountRate: "",// 折扣率
+ accountNum: "",// 账号数
+ totalAmount: "",// 总价
+ isEnable: 0, // 启用否:1启用,0禁用
+ ship: 0,// 发货否(0未发货,1已发货,默认不发货)
+ authority: 4, // 区分权限 0为数据平台权限,1为课程权限
+ options: 1,
+ settlementPrice: orderType === 2 ? 0 : '', // 结算价
+ settlementMethod: e.settlementMethod, // 结算方式,0为单价,1为分成
+ settlementPriceUnit: e.settlementPrice, // 结算单价
+ businessProportion: e.businessProportion, // 商务占比
+ };
+ that.expTools.push(obj);
+ };
+ let idArr = [];
+ this.expToolSelect.map(e => {// 取得选中的值,进行赋值
+ idArr.push(e.cid);
+ if (this.expTools.length > 0) {
+ // 比对是否存在该id,若存在,不操作,不存在,则进行push操作
+ let find = this.expTools.some(i => e.cid === i.dataOrCourseId);// 判断已有的相同的id不进行处理
+ if (!find) {
+ fn(e);
+ }
+ } else {
+ fn(e);
+ }
+ });
+ this.expToolVisible = false;
+ this.expToolName = "";
+ this.expToolsSelect = [];
+ /* 调接口,判断是否为客户已有的产品功能 */
+ let params = {
+ authority: 4,
+ customerId: this.form.customerId,
+ productId: idArr
+ };
+ await this.$post(this.api.renew, params).then(res => {
+ this.dataPlatformPermissions.map(e => {
+ res.orderOthers.map(el => {
+ if (el.dataOrCourseId === e.dataOrCourseId && el.authority == 4) {
+ let time = new Date(el.endTime)
+ time = new Date(time.setDate(time.getDate() + 1))
+ e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
+ e.endTime = "";
+ e.periodOfUse = "";
+ e.renew = true;
+ }
+ });
+ });
+ });
+ } else {
+ return this.$message.warning("请选择数据");
}
},
+ // 实训课程弹框--页数变更
+ expToolChange(val) {
+ this.expToolPage = val;
+ this.getExpTool();
+ },
+ // 删除实训课程权限
+ delExpTool(index) {
+ this.$confirm("确定要删除吗?", "提示", {
+ type: "warning"
+ }).then(() => {
+ if (this.renewDisabled && this.expTools.length === 1) {
+ return this.$message.warning("续费至少保留一条产品信息");
+ } else {
+ this.expTools.splice(index, 1);
+ }
+ });
+ },
+
+
+ // 课程/数据平台-启用
+ handleEnable(e, row,type) {
+ this[this.deliverShow[type]] = !this[this.deliverShow[type]]
+ },
// 一键发货
batchDeliver(ship, data,type) {
- if (type === 1) {
- this.pageTypes = !this.pageTypes
- }else if (type ==2) {
- this.dataPageTypes = !this.dataPageTypes
- }else {
- this.modelPageTypes = !this.modelPageTypes
- }
-
+ this[this.deliverShow[data]] = !this[this.deliverShow[data]]
+ // data即各个课程的分类id,详见data里的注释
const list = data == 1 ?
this.dataPlatformPermissions :
data == 2 ?
this.valuePermissions :
- this.coursePermissions
+ data == 3 ?
+ this.practicalCourses :
+ data == 4 ?
+ this.expTools :
+ this.coursePermissions
list.map(e => {
e.ship = ship
if(e.ship === 1) {
@@ -1721,24 +2447,10 @@ export default {
},
// 课程/数据平台-发货
handleDeliver(e, row,type) {
- if(row.ship === 1) {
- row.isEnable = 1
- if(type === 1) {
- this.pageTypes = true
- }else if(type === 2) {
- this.dataPageTypes = true
- }else {
- this.modelPageTypes = true
- }
- }else {
- if(type === 1) {
- this.pageTypes = false
- }else if(type === 2) {
- this.dataPageTypes = false
- }else {
- this.modelPageTypes = false
- }
- }
+ this[this.deliverShow[type]] = row.ship === 1
+ if(row.ship === 1) {
+ row.isEnable = 1
+ }
},
// 如果非数字,则返回0
handleNaN(val) {
@@ -1767,7 +2479,7 @@ export default {
allAmount($event, row) {
this.dealSettlePrice(row)
let total = 0
- const list = [...this.coursePermissions, ...this.dataPlatformPermissions]
+ const list = [...this.coursePermissions, ...this.dataPlatformPermissions, ...this.practicalCourses, ...this.expTools]
list.map(e => total += +e.finalPrice)
this.form.orderAmount = total
},
diff --git a/src/views/parnerOperation/learnMg.vue b/src/views/parnerOperation/learnMg.vue
index b80e602..5ebf14c 100644
--- a/src/views/parnerOperation/learnMg.vue
+++ b/src/views/parnerOperation/learnMg.vue
@@ -230,7 +230,7 @@ import Setting from '@/setting'
import Util from '@/libs/util'
import { mapState } from 'vuex'
import Editor from '@tinymce/tinymce-vue'
-import editorConfig from './editor'
+import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
diff --git a/src/views/parnerOperation/schemeSet.vue b/src/views/parnerOperation/schemeSet.vue
index 24aa043..c9528af 100644
--- a/src/views/parnerOperation/schemeSet.vue
+++ b/src/views/parnerOperation/schemeSet.vue
@@ -120,7 +120,7 @@
import Setting from '@/setting'
import Util from '@/libs/util'
import Editor from '@tinymce/tinymce-vue'
-import editorConfig from './editor'
+import editorConfig from '@/utils/editor'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
diff --git a/src/views/shop/addProduct/index.vue b/src/views/shop/addProduct/index.vue
new file mode 100644
index 0000000..284a420
--- /dev/null
+++ b/src/views/shop/addProduct/index.vue
@@ -0,0 +1,778 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 自定义
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ getItemProfessionalClass(id,index)"
+ @clear="() => clearItemClass(index)"
+ >
+
+
+
+
+ getItemProfessional(id,index)"
+ @clear="() => clearItemProfess(index)"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
只能上传jpg/png文件
+
课程封面图将按1:1显示,最佳分辨率80*80
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
只能上传jpg/png文件
+
课程封面图将按1:1显示,最佳分辨率80*80
+
+
+
+
+
+
+
+ 元/年
+
+
+
+
+ 普适地区
+
+
+
+
+
+ 元/年
+
+
+
+
+
+
+
+
+
+
+
+ 上传文件
+
+
+
+
+
+
+
+
+
+ closeRange(i)">
+ {{tag.label}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ scope.row.classificationName }}
+
+
+ 否
+
+
+
+
+
+
+
+
+
+ 返回
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/shop/list/index.vue b/src/views/shop/list/index.vue
new file mode 100644
index 0000000..bc63fd2
--- /dev/null
+++ b/src/views/shop/list/index.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/shop/list/market/index.vue b/src/views/shop/list/market/index.vue
new file mode 100644
index 0000000..1b6b457
--- /dev/null
+++ b/src/views/shop/list/market/index.vue
@@ -0,0 +1,273 @@
+
+
+
+
+
+
+
+
+
+ {{ scope.$index + (page - 1) * pageSize + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/shop/list/product/index.vue b/src/views/shop/list/product/index.vue
new file mode 100644
index 0000000..66443e3
--- /dev/null
+++ b/src/views/shop/list/product/index.vue
@@ -0,0 +1,272 @@
+
+
+
+
+
+
+
+
+
+ {{ scope.$index + (page - 1) * pageSize + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file