From a8e2b253c63d9947d13226354a6b580a2aa81caa Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 16 May 2023 14:09:17 +0800
Subject: [PATCH] fix
---
src/setting.js | 8 +-
src/utils/api.js | 2 +
src/views/course/Curriculum.vue | 45 +++--
src/views/customer/AddCustomer.vue | 125 ++++++------
src/views/data/Product.vue | 56 +++---
src/views/match/manage/index.vue | 23 ++-
src/views/order/AddOrder.vue | 135 +++++++------
src/views/parnerOperation/learnMg.vue | 2 -
src/views/serve/projectList.vue | 7 +-
src/views/shop/addProduct/index.vue | 272 +++++++++++++++++---------
src/views/shop/list/market/index.vue | 134 ++++++++++---
src/views/shop/list/product/index.vue | 71 ++++---
12 files changed, 551 insertions(+), 329 deletions(-)
diff --git a/src/setting.js b/src/setting.js
index 5b1b6a7..5f0626c 100644
--- a/src/setting.js
+++ b/src/setting.js
@@ -9,10 +9,10 @@ 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.52:9000/'// 赓
+ // host = 'http://192.168.31.151:9000/'// 榕
+ // host = 'http://192.168.31.52:9000/'// 赓
} else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
}
@@ -45,7 +45,7 @@ const Setting = {
isDev,
isPro,
// 是否使用动态路由
- dynamicRoute: false,
+ dynamicRoute: true,
/**
* @description 默认密码
*/
diff --git a/src/utils/api.js b/src/utils/api.js
index 05e55e1..8e61dba 100644
--- a/src/utils/api.js
+++ b/src/utils/api.js
@@ -139,6 +139,7 @@ export default {
isShelves: `nakadai/nakadai/curriculum/isShelves`, //上下架课程
getInternalProjectBySystemId: `occupationlab/occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目
checkConfig: `nakadai/nakadai/curriculum/checkConfig`,
+ deleteCoursePrompt: `nakadai/nakadai/curriculum/deleteCoursePrompt`,
// 课程章节管理
addChapter: `nakadai/nakadai/curriculum/chapter/addChapter`, //添加章节
editChapter: `nakadai/nakadai/curriculum/chapter/editChapter`, //修改章节
@@ -239,6 +240,7 @@ export default {
updateProduct: `data/data/product/update`,
saveRecord: `data/data/dataRecord/saveRecord`,
getAllTableIdBycategoryId: `data/data/product/getAllTableIdBycategoryId`,
+ deleteDataPrompt: `data/data/product/deleteDataPrompt`,
// 关键词
addKeyword: `data/data/keyword/addKeyword`,
diff --git a/src/views/course/Curriculum.vue b/src/views/course/Curriculum.vue
index 496fb2f..a442781 100644
--- a/src/views/course/Curriculum.vue
+++ b/src/views/course/Curriculum.vue
@@ -245,16 +245,19 @@ export default {
},
// 删除
handleDelete(row) {
- this.$confirm("确定要删除吗?", "提示", {
- type: "warning"
- }).then(() => {
+ this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
+ if (status === 200) {
+ this.$confirm("确定要删除吗?", "提示", {
+ type: "warning"
+ }).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
- this.getData();
- this.$message.success("删除成功");
- }).catch(err => {
- });
- }).catch(() => {
- });
+ this.getData();
+ this.$message.success("删除成功");
+ }).catch(err => {})
+ }).catch(() => {
+ });
+ }
+ }).catch(err => {})
},
// 处理多选
handleSelectionChange(val) {
@@ -262,12 +265,18 @@ export default {
},
// 批量删除
delAllSelection() {
- if (this.multipleSelection.length) {
+ if (this.multipleSelection.length) {
+ let cids = []
+ this.multipleSelection.forEach(i => {
+ cids.push('cids=' + i.cid)
+ });
+ this.$post(`${this.api.deleteCoursePrompt}?${cids.join('&')}`).then(({ status }) => {
+ if (status === 200) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
let ids = this.multipleSelection.map(i => i.cid);
- this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
+ this.$post(`${this.api.delCourse}?cids=${ids.toString()}`).then(res => {
if(ids.length == this.courseData.length){
if(this.pageNo > 1){
this.pageNo = this.pageNo-1
@@ -276,13 +285,13 @@ export default {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
- }).catch(err => {
- });
- }).catch(() => {
- });
- } else {
- this.$message.warning("请先选择课程 !");
- }
+ }).catch(err => {})
+ }).catch(() => {})
+ }
+ }).catch(err => {})
+ } else {
+ this.$message.warning("请先选择课程 !");
+ }
},
// 处理页码切换
handleCurrentChange(val) {
diff --git a/src/views/customer/AddCustomer.vue b/src/views/customer/AddCustomer.vue
index 870822a..72b1f02 100644
--- a/src/views/customer/AddCustomer.vue
+++ b/src/views/customer/AddCustomer.vue
@@ -23,7 +23,7 @@
-
+
@@ -86,9 +86,9 @@
-
+
-
+
{{ scope.row.status === '已过期' ? '' : scope.row.startAndEndTime }}
@@ -516,6 +516,7 @@ export default {
mounted() {
this.getIndustryClass()
this.getBm()
+ this.getCategory()
if(this.customerId){
this.getProduct()
this.$get(this.api.queryCustomerDetails,{
@@ -559,9 +560,9 @@ export default {
}).then(({ data }) => {
data = data.filter(e => !e.productDel) // productDel=1的不显示
const { productTypeList } = this
- data.map(e => {
+ data.map((e, i) => {
+ e.id = i
const list = e.startAndEndTimeList
- console.log('list=>', list)
if (list) {
let connect = true // 每个订单的开始结束日期是否连续
list.map((n, i) => {
@@ -572,69 +573,70 @@ export default {
})
// 如果是连续订单,则取第一个订单的开始日期和最后一个订单的结束日期
const now = Date.now()
- if (now < new Date(list[0].startTime).getTime()) {
- e.startTime = list[0].startTime
- e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
- e.status = '未生效'
- e.orderEnable = list[0].isEnable
-
- // 如果还有未生效的订单,页面上要显示出来
- if (!connect && list[1]) {
- const notActive = list.slice(1) // 取第一个订单以后的所有订单
- e.other = ''
- notActive.map(j => {
- e.other += `
${j.startTime} ~ ${j.endTime}`
- })
- }
- } else if (now > new Date(list[list.length - 1].endTime).getTime()) {
- e.status = '已过期'
- } else {
- // 连续订单
- if (connect) {
+ // if (list[0].startTime && list[0].endTime) {
+ if (list[0].startTime && now < new Date(list[0].startTime).getTime()) {
e.startTime = list[0].startTime
- e.endTime = list[list.length - 1].endTime
- e.status = '生效中'
+ e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
+ e.status = '未生效'
e.orderEnable = list[0].isEnable
+
+ // 如果还有未生效的订单,页面上要显示出来
+ if (!connect && list[1]) {
+ const notActive = list.slice(1) // 取第一个订单以后的所有订单
+ e.other = ''
+ notActive.map(j => {
+ e.other += `
${j.startTime} ~ ${j.endTime}`
+ })
+ }
+ } else if (list[list.length - 1].endTime && now > new Date(list[list.length - 1].endTime).getTime()) {
+ e.status = '已过期'
} else {
- for (const j in list) {
- const i = +j
- const n = list[i]
- if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) {
- // 生效中的订单,直接取该订单的开始结束日期
- e.startTime = n.startTime
- e.endTime = n.endTime
- e.status = '生效中'
- e.orderEnable = n.isEnable
- // 如果还有未生效的订单,页面上要显示出来
- if (list[i + 1]) {
- const notActive = list.slice(i + 1) // 取当前订单以后的所有订单
- e.other = ''
- notActive.map(j => {
- e.other += `
${j.startTime} ~ ${j.endTime}`
- })
+ // 连续订单
+ if (connect) {
+ e.startTime = list[0].startTime
+ e.endTime = list[list.length - 1].endTime
+ e.status = '生效中'
+ e.orderEnable = list[0].isEnable
+ } else {
+ for (const j in list) {
+ const i = +j
+ const n = list[i]
+ if (n.startTime && n.endTime && now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) {
+ // 生效中的订单,直接取该订单的开始结束日期
+ e.startTime = n.startTime
+ e.endTime = n.endTime
+ e.status = '生效中'
+ e.orderEnable = n.isEnable
+ // 如果还有未生效的订单,页面上要显示出来
+ if (list[i + 1]) {
+ const notActive = list.slice(i + 1) // 取当前订单以后的所有订单
+ e.other = ''
+ notActive.map(j => {
+ e.other += `
${j.startTime} ~ ${j.endTime}`
+ })
+ }
+ break
+ } else if (i != 0 && list[i - 1].endTime && n.startTime && n.endTime && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
+ // 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效
+ e.startTime = n.startTime
+ e.endTime = n.endTime
+ e.status = '未生效'
+ e.orderEnable = n.isEnable
+ break
}
- break
- } else if (i != 0 && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
- // 当前时间位于两个订单时间之间,则取次订单的开始结束日期,并且为未生效
- e.startTime = n.startTime
- e.endTime = n.endTime
- e.status = '未生效'
- e.orderEnable = n.isEnable
- break
}
}
}
- }
+ // }
const date = new Date()
date.setHours(0)
date.setMinutes(0)
date.setSeconds(0)
e.remain = e.status === '已过期' ? 0 : this.getRemain(date.getTime(), e.endTime) // 获取剩余期限
e.startAndEndTime = e.status === '已过期' ? '' : e.startTime + ' ~ ' + e.endTime
- const isHave = productTypeList.find(n => n.id === e.productType)
- console.log('ishave=>',isHave)
+ const isHave = productTypeList.find(n => n.classificationId === e.productType)
if (isHave) {
- e.productTypeName = isHave.name
+ e.productTypeName = isHave.classificationName
}else {
e.productTypeName = ''
}
@@ -644,7 +646,7 @@ export default {
1
}
})
- console.log('this.productAll=>',data)
+ console.log("🚀 ~ file: AddCustomer.vue:651 ~ getProduct ~ data:", data)
this.productAll = data
this.totalProduct = data.length
this.handlePage()
@@ -663,10 +665,15 @@ export default {
this.handlePage()
this.$router.push(`addcustomer?id=${this.customerId}&type=tab2&page=${val}`)
},
+ // 获取产品分类
+ getCategory() {
+ this.$get(this.api.productCategoryList).then(res => {
+ this.productTypeList = res.classificationList
+ }).catch(err => {})
+ },
// 已订阅产品筛选
filterForm2() {
const list = this.productAll
- console.log('this.productAll=>', this.productAll)
const { productType, status, keyword } = this.form2
this.products = list.filter(e => (productType === '' || productType === e.productType) && (e.status === status || status === '全部') && e.productName.includes(keyword))
},
diff --git a/src/views/data/Product.vue b/src/views/data/Product.vue
index 41052f2..b10355c 100644
--- a/src/views/data/Product.vue
+++ b/src/views/data/Product.vue
@@ -431,39 +431,51 @@ export default {
},
// 删除产品
handleDelete(row) {
- this.$confirm('确定要删除吗?', '提示', {
- type: 'warning'
- }).then(() => {
- this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => {
- this.$message.success('删除成功')
- this.getData()
- }).catch(res => {})
- }).catch(() => {})
+ this.$post(`${this.api.deleteDataPrompt}?ids=${row.id}`).then(({ status }) => {
+ if (status === 200) {
+ this.$confirm('确定要删除吗?', '提示', {
+ type: 'warning'
+ }).then(() => {
+ this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => {
+ this.$message.success('删除成功')
+ this.getData()
+ }).catch(res => {})
+ }).catch(() => {})
+ }
+ }).catch(err => {})
},
handleSelectionChange(val) {
this.multipleSelection = val
},
delAllSelection() {
- if(this.multipleSelection.length != ''){
+ if(this.multipleSelection.length){
+ let ids = []
+ this.multipleSelection.forEach(i => {
+ ids.push('ids=' + i.id)
+ });
+ this.$post(`${this.api.deleteDataPrompt}?${ids.join('&')}`).then(({ status }) => {
+ if (status === 200) {
let arr = this.multipleSelection
let result = arr.map(e => e.id)
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
- this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
- if(result.length == this.listData.length){
- if(this.page > 1){
- this.page = this.page-1
- }
- }
- this.$refs.table.clearSelection()
- this.$message.success('删除成功')
- this.getData()
- }).catch(res => {})
+ this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
+ if(result.length == this.listData.length){
+ if(this.page > 1){
+ this.page = this.page-1
+ }
+ }
+ this.$refs.table.clearSelection()
+ this.$message.success('删除成功')
+ this.getData()
+ }).catch(res => {})
}).catch(() => {})
- }else{
- this.$message.error('请先选择数据')
- }
+ }
+ }).catch(err => {})
+ }else{
+ this.$message.error('请先选择数据')
+ }
},
handleCurrentChange(val) {
this.page = val
diff --git a/src/views/match/manage/index.vue b/src/views/match/manage/index.vue
index f996489..f76eec9 100644
--- a/src/views/match/manage/index.vue
+++ b/src/views/match/manage/index.vue
@@ -78,16 +78,21 @@ export default {
handleSave(i) {
// 如果是赛事详情,则要判断是否已经保存,未保存则提示是否保存
if (this.active === 'tab1') {
- const detail = this.$refs.detail
- if (detail.step < 4 && detail.$refs['step' + detail.step].updateTime) {
- this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
- type: 'warning'
- }).then(() => {
- detail.save(1, 1)
+ const { detail } = this.$refs
+ if (detail) {
+ const step = detail.$refs['step' + detail.step]
+ if (detail.step < 4 && step && step.updateTime) {
+ this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
+ type: 'warning'
+ }).then(() => {
+ detail.save(1, 1)
+ this.backOrTab(i)
+ }).catch(() => {
+ this.backOrTab(i)
+ })
+ } else {
this.backOrTab(i)
- }).catch(() => {
- this.backOrTab(i)
- })
+ }
} else {
this.backOrTab(i)
}
diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue
index aaae7eb..5a882c1 100644
--- a/src/views/order/AddOrder.vue
+++ b/src/views/order/AddOrder.vue
@@ -119,7 +119,7 @@
一键发货
- 取消全部发货
+ 取消全部发货
添加
@@ -128,7 +128,7 @@
-
+
@@ -228,7 +228,7 @@
删除
@@ -270,13 +270,13 @@
@@ -1029,7 +1029,7 @@
删除
@@ -1148,7 +1148,7 @@
+ @selection-change="practicalCoursesSelection" row-key="mallId">
@@ -1561,7 +1561,6 @@ export default {
const promises = []
const { customerId } = form
const list = []
- // 课程和数据的分别调接口查询
if (orderOther.find(e => e.authority === 1)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
@@ -1589,8 +1588,7 @@ export default {
if (orderOther.find(e => e.authority === 2)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
- // authority: 2,
- authority: 5,
+ authority: 2,
customerId,
productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
@@ -1603,7 +1601,6 @@ 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 }) => {
@@ -1628,7 +1625,7 @@ export default {
if (orderOther.find(e => e.authority === 5)) {
promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, {
- authority: 2,
+ authority: 5,
customerId,
productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => {
@@ -1664,7 +1661,7 @@ export default {
let list = orderOther.map(e => {
e.settlementPriceUnit = e.settlementPrice
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接口返回的数据
console.log("🚀 ~ file: AddOrder.vue ~ line 946 ~ list ~ item", item)
// if (item) {
// 处于续费
@@ -1701,8 +1698,8 @@ export default {
if (e.status === 3) e.isEnable = 0 // 已过期的,变成禁用状态,且不能启用
return e;
});// 俩列表
- this.coursePermissions = list.filter(i => i.authority === 1);
- this.theoryCourseList = list.filter(i => i.authority === 5);
+ 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.dataPlatformPermissions = list.filter(i => i.authority === 0);
this.valuePermissions = list.filter(i => i.authority === 2);
this.practicalCourses = list.filter(i => i.authority === 3);
@@ -1742,7 +1739,7 @@ export default {
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) {
- return this.$message.error("请选择课程权限或数据权限或职站增值模块权限后再确认订单");
+ return this.$message.error("请选择产品权限后再确认订单");
} else {
// 课程权限参数校验
if (this.coursePermissions.length) {
@@ -1922,6 +1919,10 @@ export default {
}
});
},
+ // 处理orderRepeat里的id
+ handleOrderRepeat(id) {
+ this.orderRepeat.includes(id) && this.orderRepeat.splice(this.orderRepeat.findIndex(e => e == id), 1)
+ },
/* 处理0开头的期限 */
zero(e, row) {
if (e[0] == "0") {
@@ -1946,60 +1947,82 @@ export default {
this.form.provinceId = res.result.customer.provinceId;
this.form.cityId = res.result.customer.cityId;
this.getCityData();
+ this.getSettlemennt()
});
this.$forceUpdate();
}
},
+ // 更换了订单客户后重新获取结算价
+ getSettlemennt() {
+ const list = []
+ this.listName.map(e => e.name).forEach(e => {
+ list.push(...this[e])
+ })
+ console.log("🚀 ~ file: AddOrder.vue:1954 ~ getSettlemennt ~ list:", list)
+
+ list.map(e => {
+ this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => {
+ const mall = res.mallPrice
+ if (mall) {
+ e.settlementPrice = mall.discountRate
+ }
+ }).catch((res) => {})
+ })
+ },
closeJCourse() { // 关闭课程选择对话框
this.curriculumName = "";
this.courseVisible = false;
},
// 删除课程权限
- delCourseForm(index) {
+ delCourseForm(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.coursePermissions.length === 1) {
return this.$message.warning("续费至少保留一条课程权限");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.coursePermissions.splice(index, 1);
}
});
},
//删除理论课程
- delCourseDataForm(index) {
+ delCourseDataForm(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.theoryCourseList.length === 1) {
return this.$message.warning("续费至少保留一条课程权限");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.theoryCourseList.splice(index, 1);
}
});
},
// 删除数据平台权限
- delDataForm(index) {
+ delDataForm(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.dataPlatformPermissions.length === 1) {
return this.$message.warning("续费至少保留一条产品信息");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.dataPlatformPermissions.splice(index, 1);
}
});
},
// 删除职站增值应用产品权限
- delDataFormList(index) {
+ delDataFormList(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.valuePermissions.length === 1) {
return this.$message.warning("续费至少保留一条产品信息");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.valuePermissions.splice(index, 1);
}
});
@@ -2015,7 +2038,8 @@ export default {
productClassification: this.classificationId,
pageSize: 10,
isShelves: 0,
- productName: this.practicalCourseName
+ productName: this.practicalCourseName,
+ hotTag: 1
}).then(({ page }) => {
this.practicalCourseList = page.records;
this.practicalCourseTotals = page.total;
@@ -2026,8 +2050,9 @@ export default {
},
practicalCoursesSelectable(row, index) { // 禁止勾选已经选过的数据平台
let boolean = true;
- this.practicalCourses.length && this.practicalCourses.some(e => {
- if (e.dataOrCourseId === row.id) {
+ const { name } = this.listName.find(e => e.id == this.classificationId)
+ this[name].length && this[name].some(e => {
+ if (e.mallId == row.mallId) {
boolean = false;
}
});
@@ -2047,7 +2072,7 @@ export default {
authority = 1
break;
case 2:
- authority = 5
+ authority = 1
break;
case 3:
authority = 2
@@ -2078,22 +2103,22 @@ export default {
marketValue: '', // 市场价
marketPrice: e.marketUnitPrice, // 市场单价
finalPrice: orderType === 2 ? 0 : '',// 成交价
+ finalValue: orderType === 2 ? 0 : '', // 成交单价
discountRate: "",// 折扣率
accountNum: "",// 账号数
totalAmount: "",// 总价
isEnable: 0, // 启用否:1启用,0禁用
ship: 0,// 发货否(0未发货,1已发货,默认不发货)
- authority, // 区分权限 0为数据平台权限,1为课程权限
+ authority, // 区分权限
options: 1,
settlementPrice: orderType === 2 ? 0 : '', // 结算价
settlementPriceUnit: e.settlementPrice || 0, // 结算单价
})
};
- let idArr = [];
- console.log("🚀 ~ file: AddOrder.vue:2095 ~ practicalCourseSubmit ~ idArr:", this[name],this.practicalCoursesSelect)
+ const productId = []
this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值
- idArr.push(e.mallId);
- let find = this[name].some(i => e.associatedProduct === i.dataOrCourseId);// 判断已有的相同的id不进行处理
+ e.associatedProduct && productId.push(+e.associatedProduct);
+ let find = this[name].some(i => e.mallId === i.mallId);// 判断已有的相同的id不进行处理
if (!find) {
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => {
const mall = res.mallPrice
@@ -2107,16 +2132,16 @@ export default {
this.practicalCourseVisible = false;
this.practicalCourseName = "";
this.practicalCoursesSelect = [];
+
/* 调接口,判断是否为客户已有的产品功能 */
- let params = {
- authority: this.classificationId,
+ productId.length && await this.$post(this.api.renew, {
+ authority,
customerId: this.form.customerId,
- productId: idArr
- };
- await this.$post(this.api.renew, params).then(res => {
- this.dataPlatformPermissions.map(e => {
+ productId
+ }).then(res => {
+ this[name].map(e => {
res.orderOthers.map(el => {
- if (el.dataOrCourseId === e.dataOrCourseId && el.authority == 3) {
+ if (el.dataOrCourseId == e.dataOrCourseId && el.authority == authority) {
let time = new Date(el.endTime)
time = new Date(time.setDate(time.getDate() + 1))
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
@@ -2137,26 +2162,28 @@ export default {
this.getPracticalCourses();
},
// 删除实训课程权限
- delPracticalCourses(index) {
+ delPracticalCourses(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.practicalCourses.length === 1) {
return this.$message.warning("续费至少保留一条产品信息");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.practicalCourses.splice(index, 1);
}
});
},
// 删除实训课程权限
- delExpTool(index) {
+ delExpTool(index, row) {
this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
if (this.renewDisabled && this.expTools.length === 1) {
return this.$message.warning("续费至少保留一条产品信息");
} else {
+ this.handleOrderRepeat(row.dataOrCourseId)
this.expTools.splice(index, 1);
}
});
@@ -2168,7 +2195,7 @@ export default {
this[this.deliverShow[type]] = !this[this.deliverShow[type]]
},
// 一键发货
- batchDeliver(ship, data,type) {
+ batchDeliver(ship, data) {
this[this.deliverShow[data]] = !this[this.deliverShow[data]]
// data即各个课程的分类id,详见data里的注释
const list = data == 1 ?
@@ -2285,10 +2312,6 @@ export default {
},
// 使用期限转换以及计算剩余天数
deadLine(e,row,options, isDate) {
- console.log('e=>',e)
- console.log('row=>',row)
- console.log('options=>',options)
- console.log('isDate=>',isDate)
let optionsData = ''
if(e > 0){
if (options == 1){
diff --git a/src/views/parnerOperation/learnMg.vue b/src/views/parnerOperation/learnMg.vue
index 70611db..0f51a07 100644
--- a/src/views/parnerOperation/learnMg.vue
+++ b/src/views/parnerOperation/learnMg.vue
@@ -561,8 +561,6 @@ export default {
...this.headers
},
}).then(({ data }) => {
- // let url = this.form.bannerImg
- // url && this.$del(this.api.fileDeletion, [url.split('/').pop()]).then(res => {}).catch(e => {}) // 删除替换掉的图片
this.form.bannerImg = data.filesResult.fileUrl
}).catch(res => {})
this.$refs.cropper.isDisabled = false
diff --git a/src/views/serve/projectList.vue b/src/views/serve/projectList.vue
index e24ffe4..8ba3897 100644
--- a/src/views/serve/projectList.vue
+++ b/src/views/serve/projectList.vue
@@ -70,13 +70,16 @@
{{ scope.$index + (page - 1) * pageSize + 1 }}
-
{{ founderKeys[scope.row.founder] }}
-
+
+
+ {{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }}
+
+
{{ permissionsKeys[scope.row.permissions] }}
diff --git a/src/views/shop/addProduct/index.vue b/src/views/shop/addProduct/index.vue
index 2354b65..cf5c90b 100644
--- a/src/views/shop/addProduct/index.vue
+++ b/src/views/shop/addProduct/index.vue
@@ -9,7 +9,7 @@
-
+
是
@@ -20,7 +20,27 @@
否
-
+
+
+
+
+
+
+
+
+
+
+
@@ -56,7 +76,7 @@
- 自定义
+ 自定义
@@ -71,6 +91,7 @@
+
@@ -80,6 +101,7 @@
+
@@ -88,15 +110,16 @@
+
-
+
-
+
@@ -124,6 +147,7 @@
上传界面图
-
-
-
+
+
+
+
+ 删除
+
+
+
-
+
{{ isData ? '元/账号/年' : '元/年' }}
@@ -203,12 +230,12 @@
{{ handleUnit(item) }}
- {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
+ {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
除外地区
-
+
@@ -219,13 +246,14 @@
-
+
-
+
{{ handleUnit(item) }}
-
+ {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
+
@@ -241,12 +269,12 @@
{{ handleUnit(item) }}
- {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
+ {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
除外地区
-
+
@@ -257,13 +285,14 @@
-
+
-
+
{{ handleUnit(item) }}
-
+ {{ item.discountRate }} {{ isData ? '元/账号/年' : '元/年' }}
+
@@ -276,6 +305,7 @@
{{ scope.row.typeName }}
-
+
-
-
-
+
+
+
@@ -346,11 +376,11 @@
{{ scope.row.tagsName }}
-
+
-
-
-
+
+
+
@@ -359,7 +389,8 @@
-
+
+ (已关联产品的不可重复关联)
@@ -367,7 +398,7 @@
-
+
@@ -428,6 +459,12 @@ export default {
productName: '',
state: 1,
},
+ mallNonAssociatedLinks: [
+ {
+ url: '',
+ urlName: '',
+ }
+ ],
mallAnnex: [],
mallDisciplines: [
{
@@ -501,6 +538,7 @@ export default {
// 监听信息是否有更改,有的话页面离开的时候要询问是否要保存
form: {
handler(val){
+ console.log("🚀 ~ file: index.vue:511 ~ handler ~ val:", val)
this.updateTime++
},
deep:true
@@ -524,7 +562,6 @@ export default {
}).then(() => {
this.submit(this.form.state, next)
}).catch(() => {
- console.log(55)
next()
})
} else {
@@ -538,6 +575,9 @@ export default {
this.id ? this.getData() : this.getOp()
this.getSubject()
this.getProvince()
+ setTimeout(() => {
+ this.updateTime = 0
+ }, 1000)
},
components: {
Editor
@@ -564,7 +604,7 @@ export default {
})
setTimeout(() => {
this.updateTime = 0
- }, 3000)
+ }, 1000)
})
}).catch(err => {})
},
@@ -722,15 +762,19 @@ export default {
getLabel() {
this.$get(this.api.tagsList).then(res => {
this.labels = res.tagsList
- const ids = []
- this.form.tagsIds.forEach(item => {
- this.labels.forEach(e => {
- if (item == e.tagsId) {
- ids.push(item)
- }
+ // 编辑的时候要根据标签列表去除掉已经保存的删除了的标签
+ if (this.id) {
+ console.log("🚀 ~ file: index.vue:735 ~ this.$get ~ id:", this.id)
+ const ids = []
+ this.form.tagsIds.forEach(item => {
+ this.labels.forEach(e => {
+ if (item == e.tagsId) {
+ ids.push(item)
+ }
+ })
})
- })
- this.form.tagsIds = ids
+ this.form.tagsIds = ids
+ }
}).catch(err => {})
},
// 显示标签弹框
@@ -796,14 +840,17 @@ export default {
},
-
// 获取产品类型
getClass() {
this.$get(this.api.productTypeList).then(res => {
const list = res.typeList
- const id = this.form.typeIds
- if (id && !list.find(e => e.typeId == id)) this.form.typeIds = ''
+ // 编辑的时候要根据产品类型列表去除掉已经保存的删除了的产品类型
+ if (this.id) {
+ console.log("🚀 ~ file: index.vue:735 ~ this.$get ~ id:", this.id)
+ const id = this.form.typeIds
+ if (id && !list.find(e => e.typeId == id)) this.form.typeIds = ''
+ }
this.classifications = list
}).catch(err => {})
},
@@ -870,6 +917,16 @@ export default {
// 所选的分类被删了后,要清空所选的分类id
if (!list.find(e => e.id == this.form.classificationId)) this.form.classificationId = ''
},
+ // 添加非关联产品链接
+ addLink() {
+ this.form.mallNonAssociatedLinks.push(
+ {
+ mallId: this.id,
+ url: '',
+ urlName: '',
+ }
+ )
+ },
// 添加学科
@@ -936,14 +993,26 @@ export default {
discountRate: ''
})
},
- // 计算折扣后的结算价
+ // 计算折扣后的结算价(所有结算价)
+ calcAllSettlement() {
+ // 选的按折扣才需要计算
+ const unit = this.form.mall.marketUnitPrice
+ unit !== '' && this.form.mallPrices.forEach(item => {
+ if (item.entryType && item.settlementPrice !== '' && item.settlementPrice !== undefined) {
+ this.$set(item, 'discountRate', item.settlementPrice / 10 * unit)
+ } else {
+ this.$set(item, 'discountRate', item.settlementPrice)
+ }
+ })
+ },
+ // 计算折扣后的结算价(单个结算价)
calcSettlement(item) {
// 选的按折扣才需要计算
const unit = this.form.mall.marketUnitPrice
- console.log("🚀 ~ file: index.vue:917 ~ calcSettlement ~ unit:", unit,item)
-
- if (item.entryType && unit !== '') {
- item.discountRate = item.settlementPrice / 10 * unit
+ if (item.entryType && unit !== '' && item.settlementPrice !== '' && item.settlementPrice !== undefined) {
+ this.$set(item, 'discountRate', item.settlementPrice / 10 * unit)
+ } else {
+ this.$set(item, 'discountRate', item.settlementPrice)
}
},
// 处理价格单位
@@ -966,14 +1035,17 @@ export default {
}).catch(res => {})
},
- handleExceed(files, fileList) { // 上传文件
- Util.warningMsg("当前限制选择 4 个文件,如需更换,请删除上一个文件再重新选择!");
- },
uploadSuccess(res) {
- this.form.mall.coverDrawing = res.data.filesResult.fileUrl
+ this.form.mall.coverDrawing = res.data.filesResult.fileUrl
},
- uploadSuccessMini(res) { // 文件上传成功时的钩子
- this.form.mall.appletIcon = res.data.filesResult.fileUrl;
+ beforeCoverRemove() {
+ this.form.mall.coverDrawing = ''
+ },
+ uploadSuccessMini(res) {
+ this.form.mall.appletIcon = res.data.filesResult.fileUrl;
+ },
+ beforeMiniRemove() {
+ this.form.mall.appletIcon = ''
},
uploadSuccessInterface(res) { // 文件上传成功时的钩子
this.form.mall.interfaceDiagrams.push(res.data.filesResult.fileUrl)
@@ -986,23 +1058,16 @@ export default {
fileName: e.originalFileName,
name: e.originalFileName,
}]
- console.log(22, this.form)
- },
- uploadError(err, file, fileList) {
- this.$message({
- message: "上传出错,请重试!",
- type: "error",
- center: true
- });
},
- beforeRemove(file, fileList) {
- return this.$confirm(`确定移除 ${file.name}?`);
+ beforeFileRemove() {
+ this.form.mallAnnex = []
},
- handleRemove(file, fileList) {
- // let fileName = this.form.mall.coverDrawing.replace('https://huoran.oss-cn-shenzhen.aliyuncs.com/', "");
- // this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => {
- // this.form.mall.coverDrawing = ''
- // }).catch(res => {});
+ // 界面图上传前回调
+ beforeUpload() {
+ if (this.form.mall.interfaceDiagrams.length > 2) {
+ Util.errorMsg('当前限制选择 3 个文件,如需更换,请删除上一个文件再重新选择!')
+ return false
+ }
},
submit(state, next) {
const form = JSON.parse(JSON.stringify(this.form))
@@ -1013,41 +1078,40 @@ export default {
if (!form.classificationIds) return Util.errorMsg('请选择产品分类!')
if (!form.typeIds) return Util.errorMsg('请选择产品类型!')
if (!form.supplierIds.length) return Util.errorMsg('请选择供应厂商!')
- let invalid = 0
- for (const e of form.mallDisciplines) {
- if (!e.categoryId) {
- invalid = 1
- Util.errorMsg('请选择学科类别!')
- break
- }
- if (!e.professionalCategoryId) {
- invalid = 1
- Util.errorMsg('请选择专业类!')
+ if (!mall.coverDrawing) return Util.errorMsg('请上传封面图!')
+ if (!mall.marketUnitPrice) return Util.errorMsg('请输入市场建议单价!')
+ let priceInvalid = 0
+ for (const e of form.mallPrices) {
+ if (e.settlementPrice === '' || e.settlementPrice === undefined) {
+ priceInvalid = 1
+ Util.errorMsg(`请输入${e.settlementPriceType ? '平台' : '厂商'}结算价!`)
break
}
- if (!e.professionalId) {
- invalid = 1
- Util.errorMsg('请选择专业!')
+ if (e.area === '') {
+ priceInvalid = 1
+ Util.errorMsg(`请选择地区!`)
break
}
}
- if (invalid) return
- if (!mall.coverDrawing) return Util.errorMsg('请上传封面图!')
- if (!mall.marketUnitPrice) return Util.errorMsg('请输入市场建议单价!')
- if (form.mallPrices.find(e => !e.settlementPriceType && e.area === 0).settlementPrice === '') return Util.errorMsg('请输入厂商结算价!')
- if (form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice === '') return Util.errorMsg('请输入平台结算价!')
+ if (priceInvalid) return
if (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!')
if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!')
}
form.classificationIds = [form.classificationIds]
form.typeIds = [form.typeIds]
mall.interfaceDiagram = mall.interfaceDiagrams.join()
+ const links = []
+ form.mallNonAssociatedLinks.forEach(e => {
+ (e.urlName || e.url) && links.push(e)
+ })
+ form.mallNonAssociatedLinks = links
form.mall.state = state
form.mall.isShelves = state
if (this.submiting) return false
this.submiting = true
if (form.mall.mallId) {
this.$post(this.api.renewalOfGoods, form).then(res => {
+ this.pass = true
this.submiting = false;
Util.successMsg("修改成功");
next ? next() : this.$router.back()
@@ -1056,6 +1120,7 @@ export default {
});
} else {
this.$post(this.api.addGoods, form).then(res => {
+ this.pass = true
this.submiting = false;
Util.successMsg("新增成功");
next ? next() : this.$router.back()
@@ -1067,6 +1132,8 @@ export default {
// 返回
back() {
this.pass = true
+ console.log("🚀 ~ file: index.vue:1100 ~ back ~ this.updateTime:", this.updateTime)
+
// 更改了信息才需要提示
if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
@@ -1154,12 +1221,16 @@ $avatar-width: 104px;
}
}
}
-.avatars {
+.pics {
+ display: flex;
margin-top: 10px;
+ text-align: center;
+ .pic {
+ margin-right: 20px;
+ }
img {
width: $avatar-width;
height: $avatar-width;
- margin-right: 10px;
}
}
@@ -1171,12 +1242,19 @@ $avatar-width: 104px;
}
}
.manage-dia {
- .edit, .del {
+ .icon {
+ margin-right: 5px;
font-size: 14px;
cursor: pointer;
}
- .edit {
- margin-right: 10px;
+}
+.product-dia {
+ .tips {
+ position: absolute;
+ top: 23px;
+ left: 100px;
+ font-size: 12px;
+ color: #f00;
}
}
.plus {
@@ -1190,7 +1268,7 @@ $avatar-width: 104px;
padding: 10px;
border: 1px dashed #ccc;
&.mini {
- width: 740px;
+ // width: 790px;
}
.line {
position: relative;
diff --git a/src/views/shop/list/market/index.vue b/src/views/shop/list/market/index.vue
index 5ac1792..1d9d668 100644
--- a/src/views/shop/list/market/index.vue
+++ b/src/views/shop/list/market/index.vue
@@ -2,7 +2,7 @@
- 新增
+ 新增
@@ -20,10 +20,10 @@
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row)"
- v-auth="'/curriculum:上下架'">
+ v-auth="'/shop:营销推广管理:禁用'">
- 编辑
- 删除
+ 编辑
+ 删除
@@ -34,13 +34,11 @@
@@ -61,12 +59,25 @@
确定
+
+
+
+
+