yujialong 2 years ago
parent 21e1cfebbc
commit a8e2b253c6
  1. 8
      src/setting.js
  2. 2
      src/utils/api.js
  3. 45
      src/views/course/Curriculum.vue
  4. 125
      src/views/customer/AddCustomer.vue
  5. 56
      src/views/data/Product.vue
  6. 23
      src/views/match/manage/index.vue
  7. 135
      src/views/order/AddOrder.vue
  8. 2
      src/views/parnerOperation/learnMg.vue
  9. 7
      src/views/serve/projectList.vue
  10. 272
      src/views/shop/addProduct/index.vue
  11. 134
      src/views/shop/list/market/index.vue
  12. 71
      src/views/shop/list/product/index.vue

@ -9,10 +9,10 @@ let jumpPath = `${location.origin}/judgmentPoint`
let host = `${location.origin}/` let host = `${location.origin}/`
if (isDev) { if (isDev) {
jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统 jumpPath = 'http://192.168.31.125:8087/' // 本地调试-需要启动本地判分点系统
// host = 'http://121.37.12.51/' host = 'http://121.37.12.51/'
// host = 'https://huorantech.cn/' // host = 'https://huorantech.cn/'
// host = 'http://192.168.31.151:9000/'// 榕 // host = 'http://192.168.31.151:9000/'// 榕
host = 'http://192.168.31.52:9000/'// 赓 // host = 'http://192.168.31.52:9000/'// 赓
} else if (isPro) { } else if (isPro) {
jumpPath = 'https://www.huorantech.cn/judgmentPoint/' jumpPath = 'https://www.huorantech.cn/judgmentPoint/'
} }
@ -45,7 +45,7 @@ const Setting = {
isDev, isDev,
isPro, isPro,
// 是否使用动态路由 // 是否使用动态路由
dynamicRoute: false, dynamicRoute: true,
/** /**
* @description 默认密码 * @description 默认密码
*/ */

@ -139,6 +139,7 @@ export default {
isShelves: `nakadai/nakadai/curriculum/isShelves`, //上下架课程 isShelves: `nakadai/nakadai/curriculum/isShelves`, //上下架课程
getInternalProjectBySystemId: `occupationlab/occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目 getInternalProjectBySystemId: `occupationlab/occupationlab/projectManage/getInternalProjectBySystemId`, //根据系统id、项目权限获取系统内置项目
checkConfig: `nakadai/nakadai/curriculum/checkConfig`, checkConfig: `nakadai/nakadai/curriculum/checkConfig`,
deleteCoursePrompt: `nakadai/nakadai/curriculum/deleteCoursePrompt`,
// 课程章节管理 // 课程章节管理
addChapter: `nakadai/nakadai/curriculum/chapter/addChapter`, //添加章节 addChapter: `nakadai/nakadai/curriculum/chapter/addChapter`, //添加章节
editChapter: `nakadai/nakadai/curriculum/chapter/editChapter`, //修改章节 editChapter: `nakadai/nakadai/curriculum/chapter/editChapter`, //修改章节
@ -239,6 +240,7 @@ export default {
updateProduct: `data/data/product/update`, updateProduct: `data/data/product/update`,
saveRecord: `data/data/dataRecord/saveRecord`, saveRecord: `data/data/dataRecord/saveRecord`,
getAllTableIdBycategoryId: `data/data/product/getAllTableIdBycategoryId`, getAllTableIdBycategoryId: `data/data/product/getAllTableIdBycategoryId`,
deleteDataPrompt: `data/data/product/deleteDataPrompt`,
// 关键词 // 关键词
addKeyword: `data/data/keyword/addKeyword`, addKeyword: `data/data/keyword/addKeyword`,

@ -245,16 +245,19 @@ export default {
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm("确定要删除吗?", "提示", { this.$post(`${this.api.deleteCoursePrompt}?cids=${row.cid}`).then(({ status }) => {
type: "warning" if (status === 200) {
}).then(() => { this.$confirm("确定要删除吗?", "提示", {
type: "warning"
}).then(() => {
this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => { this.$post(`${this.api.delCourse}?cids=${row.cid}`).then(res => {
this.getData(); this.getData();
this.$message.success("删除成功"); this.$message.success("删除成功");
}).catch(err => { }).catch(err => {})
}); }).catch(() => {
}).catch(() => { });
}); }
}).catch(err => {})
}, },
// //
handleSelectionChange(val) { handleSelectionChange(val) {
@ -262,12 +265,18 @@ export default {
}, },
// //
delAllSelection() { 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("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
let ids = this.multipleSelection.map(i => i.cid); 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(ids.length == this.courseData.length){
if(this.pageNo > 1){ if(this.pageNo > 1){
this.pageNo = this.pageNo-1 this.pageNo = this.pageNo-1
@ -276,13 +285,13 @@ export default {
this.getData(); this.getData();
this.$message.success("删除成功"); this.$message.success("删除成功");
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
}).catch(err => { }).catch(err => {})
}); }).catch(() => {})
}).catch(() => { }
}); }).catch(err => {})
} else { } else {
this.$message.warning("请先选择课程 !"); this.$message.warning("请先选择课程 !");
} }
}, },
// //
handleCurrentChange(val) { handleCurrentChange(val) {

@ -23,7 +23,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item prop="schoolId" label="客户名称"> <el-form-item prop="schoolId" label="客户名称">
<el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校" :disabled="customerId" @change="SchoolChange" @clear="clearSchool"> <el-select v-model="form.schoolId" filterable clearable placeholder="请选择学校" :disabled="!!customerId" @change="SchoolChange" @clear="clearSchool">
<el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option> <el-option v-for="(item,index) in schoolList" :key="index" :label="item.schoolName" :value="item.schoolId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -86,9 +86,9 @@
<div class="tool"> <div class="tool">
<ul class="filter"> <ul class="filter">
<li> <li>
<label>产品类</label> <label>产品</label>
<el-select v-model="form2.productType" placeholder="请选择产品类型" @change="filterForm2"> <el-select v-model="form2.productType" placeholder="请选择产品类型" clearable @change="filterForm2">
<el-option v-for="(item,index) in productTypeList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item,index) in productTypeList" :key="index" :label="item.classificationName" :value="item.classificationId"></el-option>
</el-select> </el-select>
</li> </li>
<li> <li>
@ -105,12 +105,12 @@
<el-button type="primary" @click="exportList">导出列表</el-button> <el-button type="primary" @click="exportList">导出列表</el-button>
</div> </div>
</div> </div>
<el-table :data="products" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="dataOrCourseId"> <el-table :data="products" class="orderTable" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column> <el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column> <el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="productTypeName" label="产品类" align="center"></el-table-column> <el-table-column prop="productTypeName" label="产品类" align="center"></el-table-column>
<el-table-column label="起止日期" align="center"> <el-table-column label="起止日期" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.status === '已过期' ? '' : scope.row.startAndEndTime }} {{ scope.row.status === '已过期' ? '' : scope.row.startAndEndTime }}
@ -516,6 +516,7 @@ export default {
mounted() { mounted() {
this.getIndustryClass() this.getIndustryClass()
this.getBm() this.getBm()
this.getCategory()
if(this.customerId){ if(this.customerId){
this.getProduct() this.getProduct()
this.$get(this.api.queryCustomerDetails,{ this.$get(this.api.queryCustomerDetails,{
@ -559,9 +560,9 @@ export default {
}).then(({ data }) => { }).then(({ data }) => {
data = data.filter(e => !e.productDel) // productDel=1 data = data.filter(e => !e.productDel) // productDel=1
const { productTypeList } = this const { productTypeList } = this
data.map(e => { data.map((e, i) => {
e.id = i
const list = e.startAndEndTimeList const list = e.startAndEndTimeList
console.log('list=>', list)
if (list) { if (list) {
let connect = true // let connect = true //
list.map((n, i) => { list.map((n, i) => {
@ -572,69 +573,70 @@ export default {
}) })
// //
const now = Date.now() const now = Date.now()
if (now < new Date(list[0].startTime).getTime()) { // if (list[0].startTime && list[0].endTime) {
e.startTime = list[0].startTime if (list[0].startTime && now < new Date(list[0].startTime).getTime()) {
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 += `<br>${j.startTime} ~ ${j.endTime}`
})
}
} else if (now > new Date(list[list.length - 1].endTime).getTime()) {
e.status = '已过期'
} else {
//
if (connect) {
e.startTime = list[0].startTime e.startTime = list[0].startTime
e.endTime = list[list.length - 1].endTime e.endTime = connect ? list[list.length - 1].endTime : list[0].endTime
e.status = '生效' e.status = '未生效'
e.orderEnable = list[0].isEnable e.orderEnable = list[0].isEnable
//
if (!connect && list[1]) {
const notActive = list.slice(1) //
e.other = ''
notActive.map(j => {
e.other += `<br>${j.startTime} ~ ${j.endTime}`
})
}
} else if (list[list.length - 1].endTime && now > new Date(list[list.length - 1].endTime).getTime()) {
e.status = '已过期'
} else { } else {
for (const j in list) { //
const i = +j if (connect) {
const n = list[i] e.startTime = list[0].startTime
if (now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) { e.endTime = list[list.length - 1].endTime
// e.status = '生效中'
e.startTime = n.startTime e.orderEnable = list[0].isEnable
e.endTime = n.endTime } else {
e.status = '生效中' for (const j in list) {
e.orderEnable = n.isEnable const i = +j
// const n = list[i]
if (list[i + 1]) { if (n.startTime && n.endTime && now >= new Date(n.startTime).getTime() && now <= new Date(n.endTime).getTime()) {
const notActive = list.slice(i + 1) // //
e.other = '' e.startTime = n.startTime
notActive.map(j => { e.endTime = n.endTime
e.other += `<br>${j.startTime} ~ ${j.endTime}` e.status = '生效中'
}) e.orderEnable = n.isEnable
//
if (list[i + 1]) {
const notActive = list.slice(i + 1) //
e.other = ''
notActive.map(j => {
e.other += `<br>${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() const date = new Date()
date.setHours(0) date.setHours(0)
date.setMinutes(0) date.setMinutes(0)
date.setSeconds(0) date.setSeconds(0)
e.remain = e.status === '已过期' ? 0 : this.getRemain(date.getTime(), e.endTime) // e.remain = e.status === '已过期' ? 0 : this.getRemain(date.getTime(), e.endTime) //
e.startAndEndTime = e.status === '已过期' ? '' : e.startTime + ' ~ ' + e.endTime e.startAndEndTime = e.status === '已过期' ? '' : e.startTime + ' ~ ' + e.endTime
const isHave = productTypeList.find(n => n.id === e.productType) const isHave = productTypeList.find(n => n.classificationId === e.productType)
console.log('ishave=>',isHave)
if (isHave) { if (isHave) {
e.productTypeName = isHave.name e.productTypeName = isHave.classificationName
}else { }else {
e.productTypeName = '' e.productTypeName = ''
} }
@ -644,7 +646,7 @@ export default {
1 1
} }
}) })
console.log('this.productAll=>',data) console.log("🚀 ~ file: AddCustomer.vue:651 ~ getProduct ~ data:", data)
this.productAll = data this.productAll = data
this.totalProduct = data.length this.totalProduct = data.length
this.handlePage() this.handlePage()
@ -663,10 +665,15 @@ export default {
this.handlePage() this.handlePage()
this.$router.push(`addcustomer?id=${this.customerId}&type=tab2&page=${val}`) 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() { filterForm2() {
const list = this.productAll const list = this.productAll
console.log('this.productAll=>', this.productAll)
const { productType, status, keyword } = this.form2 const { productType, status, keyword } = this.form2
this.products = list.filter(e => (productType === '' || productType === e.productType) && (e.status === status || status === '全部') && e.productName.includes(keyword)) this.products = list.filter(e => (productType === '' || productType === e.productType) && (e.status === status || status === '全部') && e.productName.includes(keyword))
}, },

@ -431,39 +431,51 @@ export default {
}, },
// //
handleDelete(row) { handleDelete(row) {
this.$confirm('确定要删除吗?', '提示', { this.$post(`${this.api.deleteDataPrompt}?ids=${row.id}`).then(({ status }) => {
type: 'warning' if (status === 200) {
}).then(() => { this.$confirm('确定要删除吗?', '提示', {
this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => { type: 'warning'
this.$message.success('删除成功') }).then(() => {
this.getData() this.$post(`${this.api.deleteProduct}?ids=${row.id}`).then(res => {
}).catch(res => {}) this.$message.success('删除成功')
}).catch(() => {}) this.getData()
}).catch(res => {})
}).catch(() => {})
}
}).catch(err => {})
}, },
handleSelectionChange(val) { handleSelectionChange(val) {
this.multipleSelection = val this.multipleSelection = val
}, },
delAllSelection() { 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 arr = this.multipleSelection
let result = arr.map(e => e.id) let result = arr.map(e => e.id)
this.$confirm('确定要删除吗?', '提示', { this.$confirm('确定要删除吗?', '提示', {
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => { this.$post(`${this.api.deleteProduct}?ids=${result.join(',')}`).then(res => {
if(result.length == this.listData.length){ if(result.length == this.listData.length){
if(this.page > 1){ if(this.page > 1){
this.page = this.page-1 this.page = this.page-1
} }
} }
this.$refs.table.clearSelection() this.$refs.table.clearSelection()
this.$message.success('删除成功') this.$message.success('删除成功')
this.getData() this.getData()
}).catch(res => {}) }).catch(res => {})
}).catch(() => {}) }).catch(() => {})
}else{ }
this.$message.error('请先选择数据') }).catch(err => {})
} }else{
this.$message.error('请先选择数据')
}
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.page = val this.page = val

@ -78,16 +78,21 @@ export default {
handleSave(i) { handleSave(i) {
// //
if (this.active === 'tab1') { if (this.active === 'tab1') {
const detail = this.$refs.detail const { detail } = this.$refs
if (detail.step < 4 && detail.$refs['step' + detail.step].updateTime) { if (detail) {
this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', { const step = detail.$refs['step' + detail.step]
type: 'warning' if (detail.step < 4 && step && step.updateTime) {
}).then(() => { this.$confirm(`编辑的内容未保存,是否保存并且发布?`, '提示', {
detail.save(1, 1) type: 'warning'
}).then(() => {
detail.save(1, 1)
this.backOrTab(i)
}).catch(() => {
this.backOrTab(i)
})
} else {
this.backOrTab(i) this.backOrTab(i)
}).catch(() => { }
this.backOrTab(i)
})
} else { } else {
this.backOrTab(i) this.backOrTab(i)
} }

@ -119,7 +119,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || coursePermissions.find(e => e.status == 1) || (isAdd && coursePermissions.length))"> <template v-if="!viewDisabled && (dispose || coursePermissions.find(e => e.status == 1) || (isAdd && coursePermissions.length))">
<el-button v-if="coursePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 0)">一键发货</el-button> <el-button v-if="coursePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 0)">一键发货</el-button>
<el-button v-if="pageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 0)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 0)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(1)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(1)">添加</el-button>
</div> </div>
@ -128,7 +128,7 @@
<el-table :data="coursePermissions" class="orderTable" stripe header-align="center"> <el-table :data="coursePermissions" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="课程名称" align="center" min-width="150" show-overflow-tooltip> <el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot-scope="scope"> <template slot-scope="scope">
@ -228,7 +228,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delCourseForm(scope.$index)" @click="delCourseForm(scope.$index, scope.row)"
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<!-- 1: 未生效2生效中3已过期 --> <!-- 1: 未生效2生效中3已过期 -->
@ -270,13 +270,13 @@
<div class="flex-between mgb20 user_header"> <div class="flex-between mgb20 user_header">
<div class="flex-center"> <div class="flex-center">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>理论课程</span> <span>理论课程产品权限</span>
</div> </div>
<div> <div>
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || theoryCourseList.find(e => e.status == 1) || (isAdd && coursePermissions.length))"> <template v-if="!viewDisabled && (dispose || theoryCourseList.find(e => e.status == 1) || (isAdd && theoryCourseList.length))">
<el-button v-if="theoryCourseList.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 5)">一键发货</el-button> <el-button v-if="theoryCourseList.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 5)">一键发货</el-button>
<el-button v-if="theoryCourse" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 5)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 5)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(2)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(2)">添加</el-button>
</div> </div>
@ -285,7 +285,7 @@
<el-table :data="theoryCourseList" class="orderTable" stripe header-align="center"> <el-table :data="theoryCourseList" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="课程名称" align="center" min-width="150" show-overflow-tooltip> <el-table-column prop="productName" label="产品名称" align="center" min-width="150" show-overflow-tooltip>
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot-scope="scope"> <template slot-scope="scope">
@ -385,7 +385,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delCourseDataForm(scope.$index)" @click="delCourseDataForm(scope.$index, scope.row)"
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<!-- 1: 未生效2生效中3已过期 --> <!-- 1: 未生效2生效中3已过期 -->
@ -427,13 +427,13 @@
<div class="flex-between mgb20 user_header"> <div class="flex-between mgb20 user_header">
<div class="flex-center"> <div class="flex-center">
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>数据前瞻平台权限</span> <span>数据前瞻产品权限</span>
</div> </div>
<div> <div>
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || dataPlatformPermissions.find(e => e.status == 1) || (isAdd && dataPlatformPermissions.length))"> <template v-if="!viewDisabled && (dispose || dataPlatformPermissions.find(e => e.status == 1) || (isAdd && dataPlatformPermissions.length))">
<el-button v-if="dataPlatformPermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 1)">一键发货</el-button> <el-button v-if="dataPlatformPermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 1)">一键发货</el-button>
<el-button v-if="dataPageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 1)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 1)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(5)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(5)">添加</el-button>
</div> </div>
@ -545,7 +545,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="small"> <div class="small">
<el-input style="width: 80%" :class="['normal', scope.row.finalPrice === '' && whetherSubmit?'red':'']" <el-input style="width: 80%" :class="['normal', scope.row.finalPrice === '' && whetherSubmit?'red':'']"
:disabled="viewDisabled||editDisabled" :disabled="viewDisabled"
@blur="[allAmount($event,scope.row),dealFinalValue($event,scope.row)]" @blur="[allAmount($event,scope.row),dealFinalValue($event,scope.row)]"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')" @input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.finalPrice" v-model="scope.row.finalPrice"
@ -570,7 +570,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delDataForm(scope.$index)" @click="delDataForm(scope.$index, scope.row)"
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<el-switch <el-switch
@ -611,7 +611,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || valuePermissions.find(e => e.status == 1) || (isAdd && valuePermissions.length))"> <template v-if="!viewDisabled && (dispose || valuePermissions.find(e => e.status == 1) || (isAdd && valuePermissions.length))">
<el-button v-if="valuePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 2)">一键发货</el-button> <el-button v-if="valuePermissions.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 2)">一键发货</el-button>
<el-button v-if="modelPageTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 2)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 2)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(3)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(3)">添加</el-button>
</div> </div>
@ -621,7 +621,7 @@
<el-table :data="valuePermissions" class="orderTable orderTables" stripe header-align="center"> <el-table :data="valuePermissions" class="orderTable orderTables" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center"> <el-table-column type="index" width="60" label="序号" align="center">
</el-table-column> </el-table-column>
<el-table-column prop="productName" label="模块名称" align="center" min-width="100"> <el-table-column prop="productName" label="产品名称" align="center" min-width="100">
</el-table-column> </el-table-column>
<el-table-column label="使用期限" align="center" min-width="190"> <el-table-column label="使用期限" align="center" min-width="190">
<template slot-scope="scope"> <template slot-scope="scope">
@ -720,7 +720,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delDataFormList(scope.$index)" @click="delDataFormList(scope.$index, scope.row)"
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<el-switch <el-switch
@ -761,7 +761,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || practicalCourses.find(e => e.status == 1) || (isAdd && practicalCourses.length))"> <template v-if="!viewDisabled && (dispose || practicalCourses.find(e => e.status == 1) || (isAdd && practicalCourses.length))">
<el-button v-if="practicalCourses.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 3)">一键发货</el-button> <el-button v-if="practicalCourses.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 3)">一键发货</el-button>
<el-button v-if="practiceCourseTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 3)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 3)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(4)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(4)">添加</el-button>
</div> </div>
@ -871,7 +871,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delPracticalCourses(scope.$index)" @click="delPracticalCourses(scope.$index, scope.row)"
style="margin: 0 10px;" style="margin: 0 10px;"
>删除</el-button> >删除</el-button>
<!-- 1: 未生效2生效中3已过期 --> <!-- 1: 未生效2生效中3已过期 -->
@ -919,7 +919,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 --> <!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<template v-if="!viewDisabled && (dispose || expTools.find(e => e.status == 1) || (isAdd && expTools.length))"> <template v-if="!viewDisabled && (dispose || expTools.find(e => e.status == 1) || (isAdd && expTools.length))">
<el-button v-if="expTools.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 4)">一键发货</el-button> <el-button v-if="expTools.find(e => !e.ship)" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(1, 4)">一键发货</el-button>
<el-button v-if="expToolTypes" v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 4)">取消全部发货</el-button> <el-button v-else v-auth="'/order:发货'" type="primary" round @click="batchDeliver(0, 4)">取消全部发货</el-button>
</template> </template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(6)">添加</el-button> <el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(6)">添加</el-button>
</div> </div>
@ -1029,7 +1029,7 @@
<el-button <el-button
v-if="!editDisabled&&!viewDisabled" v-if="!editDisabled&&!viewDisabled"
type="text" type="text"
@click="delExpTool(scope.$index)" @click="delExpTool(scope.$index, scope.row)"
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<!-- 1: 未生效2生效中3已过期 --> <!-- 1: 未生效2生效中3已过期 -->
@ -1148,7 +1148,7 @@
</div> </div>
</div> </div>
<el-table v-loading="dataLoading" :data="practicalCourseList" stripe header-align="center" <el-table v-loading="dataLoading" :data="practicalCourseList" stripe header-align="center"
@selection-change="practicalCoursesSelection" row-key="cid"> @selection-change="practicalCoursesSelection" row-key="mallId">
<el-table-column type="selection" :selectable="practicalCoursesSelectable" width="55" <el-table-column type="selection" :selectable="practicalCoursesSelectable" width="55"
align="center"></el-table-column> align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
@ -1561,7 +1561,6 @@ export default {
const promises = [] const promises = []
const { customerId } = form const { customerId } = form
const list = [] const list = []
//
if (orderOther.find(e => e.authority === 1)) { if (orderOther.find(e => e.authority === 1)) {
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, { this.$post(this.api.renew, {
@ -1589,8 +1588,7 @@ export default {
if (orderOther.find(e => e.authority === 2)) { if (orderOther.find(e => e.authority === 2)) {
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, { this.$post(this.api.renew, {
// authority: 2, authority: 2,
authority: 5,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId) productId: orderOther.filter(e => e.authority === 2).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
@ -1603,7 +1601,6 @@ export default {
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 3, authority: 3,
// authority: 2,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId) productId: orderOther.filter(e => e.authority === 3).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
@ -1628,7 +1625,7 @@ export default {
if (orderOther.find(e => e.authority === 5)) { if (orderOther.find(e => e.authority === 5)) {
promises.push(new Promise((resolve, reject) => { promises.push(new Promise((resolve, reject) => {
this.$post(this.api.renew, { this.$post(this.api.renew, {
authority: 2, authority: 5,
customerId, customerId,
productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId) productId: orderOther.filter(e => e.authority === 5).map(e => e.dataOrCourseId)
}).then(({ orderOthers }) => { }).then(({ orderOthers }) => {
@ -1664,7 +1661,7 @@ export default {
let list = orderOther.map(e => { let list = orderOther.map(e => {
e.settlementPriceUnit = e.settlementPrice e.settlementPriceUnit = e.settlementPrice
const now = Date.now() 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) console.log("🚀 ~ file: AddOrder.vue ~ line 946 ~ list ~ item", item)
// if (item) { // if (item) {
// //
@ -1701,8 +1698,8 @@ export default {
if (e.status === 3) e.isEnable = 0 // if (e.status === 3) e.isEnable = 0 //
return e; return e;
});// });//
this.coursePermissions = list.filter(i => i.authority === 1); this.coursePermissions = list.filter(i => i.authority === 1 && (i.mallClassificationId == 1 || !i.mallClassificationId));
this.theoryCourseList = list.filter(i => i.authority === 5); this.theoryCourseList = list.filter(i => i.authority === 1 && i.mallClassificationId == 2);
this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.dataPlatformPermissions = list.filter(i => i.authority === 0);
this.valuePermissions = list.filter(i => i.authority === 2); this.valuePermissions = list.filter(i => i.authority === 2);
this.practicalCourses = list.filter(i => i.authority === 3); this.practicalCourses = list.filter(i => i.authority === 3);
@ -1742,7 +1739,7 @@ export default {
let purchase = 0 // let purchase = 0 //
let profit = 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.dataPlatformPermissions.length && !this.valuePermissions.length && !this.practicalCourses.length && !this.expTools.length) {
return this.$message.error("请选择课程权限或数据权限或职站增值模块权限后再确认订单"); return this.$message.error("请选择产品权限后再确认订单");
} else { } else {
// //
if (this.coursePermissions.length) { if (this.coursePermissions.length) {
@ -1922,6 +1919,10 @@ export default {
} }
}); });
}, },
// orderRepeatid
handleOrderRepeat(id) {
this.orderRepeat.includes(id) && this.orderRepeat.splice(this.orderRepeat.findIndex(e => e == id), 1)
},
/* 处理0开头的期限 */ /* 处理0开头的期限 */
zero(e, row) { zero(e, row) {
if (e[0] == "0") { if (e[0] == "0") {
@ -1946,60 +1947,82 @@ export default {
this.form.provinceId = res.result.customer.provinceId; this.form.provinceId = res.result.customer.provinceId;
this.form.cityId = res.result.customer.cityId; this.form.cityId = res.result.customer.cityId;
this.getCityData(); this.getCityData();
this.getSettlemennt()
}); });
this.$forceUpdate(); 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() { // closeJCourse() { //
this.curriculumName = ""; this.curriculumName = "";
this.courseVisible = false; this.courseVisible = false;
}, },
// //
delCourseForm(index) { delCourseForm(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.coursePermissions.length === 1) { if (this.renewDisabled && this.coursePermissions.length === 1) {
return this.$message.warning("续费至少保留一条课程权限"); return this.$message.warning("续费至少保留一条课程权限");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.coursePermissions.splice(index, 1); this.coursePermissions.splice(index, 1);
} }
}); });
}, },
// //
delCourseDataForm(index) { delCourseDataForm(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.theoryCourseList.length === 1) { if (this.renewDisabled && this.theoryCourseList.length === 1) {
return this.$message.warning("续费至少保留一条课程权限"); return this.$message.warning("续费至少保留一条课程权限");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.theoryCourseList.splice(index, 1); this.theoryCourseList.splice(index, 1);
} }
}); });
}, },
// //
delDataForm(index) { delDataForm(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.dataPlatformPermissions.length === 1) { if (this.renewDisabled && this.dataPlatformPermissions.length === 1) {
return this.$message.warning("续费至少保留一条产品信息"); return this.$message.warning("续费至少保留一条产品信息");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.dataPlatformPermissions.splice(index, 1); this.dataPlatformPermissions.splice(index, 1);
} }
}); });
}, },
// //
delDataFormList(index) { delDataFormList(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.valuePermissions.length === 1) { if (this.renewDisabled && this.valuePermissions.length === 1) {
return this.$message.warning("续费至少保留一条产品信息"); return this.$message.warning("续费至少保留一条产品信息");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.valuePermissions.splice(index, 1); this.valuePermissions.splice(index, 1);
} }
}); });
@ -2015,7 +2038,8 @@ export default {
productClassification: this.classificationId, productClassification: this.classificationId,
pageSize: 10, pageSize: 10,
isShelves: 0, isShelves: 0,
productName: this.practicalCourseName productName: this.practicalCourseName,
hotTag: 1
}).then(({ page }) => { }).then(({ page }) => {
this.practicalCourseList = page.records; this.practicalCourseList = page.records;
this.practicalCourseTotals = page.total; this.practicalCourseTotals = page.total;
@ -2026,8 +2050,9 @@ export default {
}, },
practicalCoursesSelectable(row, index) { // practicalCoursesSelectable(row, index) { //
let boolean = true; let boolean = true;
this.practicalCourses.length && this.practicalCourses.some(e => { const { name } = this.listName.find(e => e.id == this.classificationId)
if (e.dataOrCourseId === row.id) { this[name].length && this[name].some(e => {
if (e.mallId == row.mallId) {
boolean = false; boolean = false;
} }
}); });
@ -2047,7 +2072,7 @@ export default {
authority = 1 authority = 1
break; break;
case 2: case 2:
authority = 5 authority = 1
break; break;
case 3: case 3:
authority = 2 authority = 2
@ -2078,22 +2103,22 @@ export default {
marketValue: '', // marketValue: '', //
marketPrice: e.marketUnitPrice, // marketPrice: e.marketUnitPrice, //
finalPrice: orderType === 2 ? 0 : '',// finalPrice: orderType === 2 ? 0 : '',//
finalValue: orderType === 2 ? 0 : '', //
discountRate: "",// discountRate: "",//
accountNum: "",// accountNum: "",//
totalAmount: "",// totalAmount: "",//
isEnable: 0, // 10 isEnable: 0, // 10
ship: 0,// 01 ship: 0,// 01
authority, // 01 authority, //
options: 1, options: 1,
settlementPrice: orderType === 2 ? 0 : '', // settlementPrice: orderType === 2 ? 0 : '', //
settlementPriceUnit: e.settlementPrice || 0, // settlementPriceUnit: e.settlementPrice || 0, //
}) })
}; };
let idArr = []; const productId = []
console.log("🚀 ~ file: AddOrder.vue:2095 ~ practicalCourseSubmit ~ idArr:", this[name],this.practicalCoursesSelect)
this.practicalCoursesSelect.map(e => {// this.practicalCoursesSelect.map(e => {//
idArr.push(e.mallId); e.associatedProduct && productId.push(+e.associatedProduct);
let find = this[name].some(i => e.associatedProduct === i.dataOrCourseId);// id let find = this[name].some(i => e.mallId === i.mallId);// id
if (!find) { if (!find) {
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => {
const mall = res.mallPrice const mall = res.mallPrice
@ -2107,16 +2132,16 @@ export default {
this.practicalCourseVisible = false; this.practicalCourseVisible = false;
this.practicalCourseName = ""; this.practicalCourseName = "";
this.practicalCoursesSelect = []; this.practicalCoursesSelect = [];
/* 调接口,判断是否为客户已有的产品功能 */ /* 调接口,判断是否为客户已有的产品功能 */
let params = { productId.length && await this.$post(this.api.renew, {
authority: this.classificationId, authority,
customerId: this.form.customerId, customerId: this.form.customerId,
productId: idArr productId
}; }).then(res => {
await this.$post(this.api.renew, params).then(res => { this[name].map(e => {
this.dataPlatformPermissions.map(e => {
res.orderOthers.map(el => { 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) let time = new Date(el.endTime)
time = new Date(time.setDate(time.getDate() + 1)) time = new Date(time.setDate(time.getDate() + 1))
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}`
@ -2137,26 +2162,28 @@ export default {
this.getPracticalCourses(); this.getPracticalCourses();
}, },
// //
delPracticalCourses(index) { delPracticalCourses(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.practicalCourses.length === 1) { if (this.renewDisabled && this.practicalCourses.length === 1) {
return this.$message.warning("续费至少保留一条产品信息"); return this.$message.warning("续费至少保留一条产品信息");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.practicalCourses.splice(index, 1); this.practicalCourses.splice(index, 1);
} }
}); });
}, },
// //
delExpTool(index) { delExpTool(index, row) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
if (this.renewDisabled && this.expTools.length === 1) { if (this.renewDisabled && this.expTools.length === 1) {
return this.$message.warning("续费至少保留一条产品信息"); return this.$message.warning("续费至少保留一条产品信息");
} else { } else {
this.handleOrderRepeat(row.dataOrCourseId)
this.expTools.splice(index, 1); this.expTools.splice(index, 1);
} }
}); });
@ -2168,7 +2195,7 @@ export default {
this[this.deliverShow[type]] = !this[this.deliverShow[type]] this[this.deliverShow[type]] = !this[this.deliverShow[type]]
}, },
// //
batchDeliver(ship, data,type) { batchDeliver(ship, data) {
this[this.deliverShow[data]] = !this[this.deliverShow[data]] this[this.deliverShow[data]] = !this[this.deliverShow[data]]
// dataiddata // dataiddata
const list = data == 1 ? const list = data == 1 ?
@ -2285,10 +2312,6 @@ export default {
}, },
// 使 // 使
deadLine(e,row,options, isDate) { deadLine(e,row,options, isDate) {
console.log('e=>',e)
console.log('row=>',row)
console.log('options=>',options)
console.log('isDate=>',isDate)
let optionsData = '' let optionsData = ''
if(e > 0){ if(e > 0){
if (options == 1){ if (options == 1){

@ -561,8 +561,6 @@ export default {
...this.headers ...this.headers
}, },
}).then(({ data }) => { }).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 this.form.bannerImg = data.filesResult.fileUrl
}).catch(res => {}) }).catch(res => {})
this.$refs.cropper.isDisabled = false this.$refs.cropper.isDisabled = false

@ -70,13 +70,16 @@
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template> <template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column> </el-table-column>
<el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center"></el-table-column> <el-table-column prop="projectName" label="实验项目名称" min-width="400" align="center"></el-table-column>
<el-table-column v-if='queryData.founder == 1' prop="schoolName" label="学校名字" min-width="100" align="center"></el-table-column>
<el-table-column prop="founder" label="来源" min-width="150" align="center"> <el-table-column prop="founder" label="来源" min-width="150" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ founderKeys[scope.row.founder] }} {{ founderKeys[scope.row.founder] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="creator" label="创建人" min-width="140" align="center"></el-table-column> <el-table-column prop="creator" label="创建人" min-width="140" align="center">
<template slot-scope="scope">
{{ queryData.founder == 1 ? scope.row.schoolName : scope.row.creator }}
</template>
</el-table-column>
<el-table-column label="权限" min-width="120" align="center"> <el-table-column label="权限" min-width="120" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }} {{ permissionsKeys[scope.row.permissions] }}

@ -9,7 +9,7 @@
<el-card shadow="hover" class="m-b-20"> <el-card shadow="hover" class="m-b-20">
<el-form class="model" ref="form" label-width="110px" :disabled="isDetail"> <el-form class="model" ref="form" label-width="110px" :disabled="isDetail">
<el-row> <el-row>
<el-col :span="6" :offset="5"> <el-col :span="14" :offset="5">
<el-form-item class="req" label="关联产品" prop="curriculumName"> <el-form-item class="req" label="关联产品" prop="curriculumName">
<div> <div>
<el-radio v-model="form.mall.isAssociatedProduct" :label="0" @change="associatedProductChange"></el-radio> <el-radio v-model="form.mall.isAssociatedProduct" :label="0" @change="associatedProductChange"></el-radio>
@ -20,7 +20,27 @@
<el-radio v-model="form.mall.isAssociatedProduct" :label="1" @change="associatedProductChange"></el-radio> <el-radio v-model="form.mall.isAssociatedProduct" :label="1" @change="associatedProductChange"></el-radio>
</div> </div>
</el-form-item> </el-form-item>
</el-col>
<!-- 关联产品选择了否才显示产品链接 -->
<el-col v-if="form.mall.isAssociatedProduct" :span="14" :offset="5">
<el-form-item label="产品链接">
<div v-if="form.mallNonAssociatedLinks && form.mallNonAssociatedLinks.length" class="subject">
<div v-for="(item, i) in form.mallNonAssociatedLinks" :key="i" class="line">
<el-form-item label="链接名称">
<el-input placeholder="请输入链接名称" v-model.trim="item.urlName"></el-input>
</el-form-item>
<el-form-item label="链接">
<el-input placeholder="请输入链接" v-model.trim="item.url"></el-input>
</el-form-item>
<i v-if="i && !isDetail" class="del el-icon-delete" @click="form.mallNonAssociatedLinks.splice(i, 1)"></i>
</div>
</div>
<div v-if="!isDetail" class="subject-plus" @click="addLink">
<i class="el-icon-circle-plus-outline"></i>
</div>
</el-form-item>
</el-col>
<el-col :span="6" :offset="5">
<el-form-item class="req" label="产品名称" prop="categoryId"> <el-form-item class="req" label="产品名称" prop="categoryId">
<el-input placeholder="请输入产品名称" v-model.trim="form.mall.productName" id="focus-el"></el-input> <el-input placeholder="请输入产品名称" v-model.trim="form.mall.productName" id="focus-el"></el-input>
</el-form-item> </el-form-item>
@ -56,7 +76,7 @@
</el-option> </el-option>
</template> </template>
</el-select> </el-select>
<el-button style="margin-left: 5px" type="primary" @click="setClass">自定义</el-button> <el-button v-auth="'/shop:产品管理:产品类型自定义'" style="margin-left: 5px" type="primary" @click="setClass">自定义</el-button>
</el-form-item> </el-form-item>
<el-form-item class="req" label="供应厂商" prop="supplier"> <el-form-item class="req" label="供应厂商" prop="supplier">
<el-select v-model="form.supplierIds" clearable placeholder="请选择供应厂商" multiple :disabled="selectedProduct"> <el-select v-model="form.supplierIds" clearable placeholder="请选择供应厂商" multiple :disabled="selectedProduct">
@ -71,6 +91,7 @@
<el-form-item label="学科类别" prop="supplier"> <el-form-item label="学科类别" prop="supplier">
<el-select v-model="item.categoryId" clearable <el-select v-model="item.categoryId" clearable
@change="getProfessionalClass(item)"> @change="getProfessionalClass(item)">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in subjectList" :key="index" <el-option v-for="(item,index) in subjectList" :key="index"
:label="item.disciplineName" :label="item.disciplineName"
:value="item.disciplineId"></el-option> :value="item.disciplineId"></el-option>
@ -80,6 +101,7 @@
<el-select v-model="item.professionalCategoryId" clearable <el-select v-model="item.professionalCategoryId" clearable
:disabled="item.categoryId ? false : true" :disabled="item.categoryId ? false : true"
@change="getProfessional(item)"> @change="getProfessional(item)">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in item.professionalClassList" :key="index" <el-option v-for="(item,index) in item.professionalClassList" :key="index"
:label="item.professionalClassName" :label="item.professionalClassName"
:value="item.professionalClassId"></el-option> :value="item.professionalClassId"></el-option>
@ -88,15 +110,16 @@
<el-form-item label="专业" prop="supplier"> <el-form-item label="专业" prop="supplier">
<el-select v-model="item.professionalId" clearable <el-select v-model="item.professionalId" clearable
:disabled="item.professionalCategoryId ? false : true"> :disabled="item.professionalCategoryId ? false : true">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in item.professionalList" :key="index" <el-option v-for="(item,index) in item.professionalList" :key="index"
:label="item.professionalName" :label="item.professionalName"
:value="item.professionalId"></el-option> :value="item.professionalId"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<i v-if="i" class="del el-icon-delete" @click="form.mallDisciplines.splice(i, 1)"></i> <i v-if="i && !isDetail" class="del el-icon-delete" @click="form.mallDisciplines.splice(i, 1)"></i>
</div> </div>
</div> </div>
<div class="subject-plus" @click="addSubject"> <div v-if="!isDetail" class="subject-plus" @click="addSubject">
<i class="el-icon-circle-plus-outline"></i> <i class="el-icon-circle-plus-outline"></i>
</div> </div>
</el-form-item> </el-form-item>
@ -124,6 +147,7 @@
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
:before-remove="beforeCoverRemove"
:on-success="uploadSuccess" :on-success="uploadSuccess"
:limit="1" :limit="1"
:action="api.fileupload" :action="api.fileupload"
@ -145,28 +169,31 @@
<el-form-item label="界面图" prop="miniProgramPictureAddress"> <el-form-item label="界面图" prop="miniProgramPictureAddress">
<el-upload <el-upload
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
:on-remove="handleRemove" :before-upload="beforeUpload"
:on-error="uploadError"
:on-success="uploadSuccessInterface" :on-success="uploadSuccessInterface"
:before-remove="beforeRemove"
:limit="4"
:on-exceed="handleExceed"
:action="api.fileupload" :action="api.fileupload"
:headers="headers" :headers="headers"
:show-file-list="false"
name="file" name="file"
> >
<div style="text-align: left;"> <div style="text-align: left;">
<el-button>上传界面图</el-button> <el-button>上传界面图</el-button>
</div> </div>
<div v-if="form.mall.interfaceDiagrams.length" class="avatars">
<img v-for="(item, i) in form.mall.interfaceDiagrams" :key="i" :src="item">
</div>
</el-upload> </el-upload>
<div v-if="form.mall.interfaceDiagrams.length" class="pics">
<div v-for="(item, i) in form.mall.interfaceDiagrams" :key="i" class="pic">
<img :src="item">
<div>
<el-button class="del" size="small" type="primary" @click="form.mall.interfaceDiagrams.splice(i, 1)">删除</el-button>
</div>
</div>
</div>
</el-form-item> </el-form-item>
<el-form-item label="小程序图标" prop="miniProgramPictureAddress"> <el-form-item label="小程序图标" prop="miniProgramPictureAddress">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg"
:before-remove="beforeMiniRemove"
:on-success="uploadSuccessMini" :on-success="uploadSuccessMini"
:limit="1" :limit="1"
:action="api.fileupload" :action="api.fileupload"
@ -188,7 +215,7 @@
</el-col> </el-col>
<el-col :span="14" :offset="5"> <el-col :span="14" :offset="5">
<el-form-item class="req" label="市场建议单价" prop="briefIntroduction"> <el-form-item class="req" label="市场建议单价" prop="briefIntroduction">
<el-input type="number" style="width: 250px" placeholder="请输入市场建议单价" v-model.number="form.mall.marketUnitPrice"> <el-input type="number" style="width: 250px" placeholder="请输入市场建议单价" v-model.number="form.mall.marketUnitPrice" @change="calcAllSettlement">
<template slot="append">{{ isData ? '元/账号/年' : '元/年' }}</template> <template slot="append">{{ isData ? '元/账号/年' : '元/年' }}</template>
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -203,12 +230,12 @@
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)"> <el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template> <template slot="append">{{ handleUnit(item) }}</template>
</el-input> </el-input>
<span v-if="item.entryType" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span> <span v-if="item.entryType && item.discountRate" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span>
</div> </div>
</template> </template>
<div style="display: flex;align-items: center;margin-top: 10px;"> <div style="display: flex;align-items: center;margin-top: 10px;">
除外地区 除外地区
<i class="el-icon-circle-plus-outline plus" style="margin: 0 0 0 10px;" @click="addArea(0)"></i> <i v-if="!isDetail" class="el-icon-circle-plus-outline plus" style="margin: 0 0 0 10px;" @click="addArea(0)"></i>
</div> </div>
<div v-if="form.mallPrices.length && form.mallPrices.find(e => !e.settlementPriceType && e.area !== 0)" class="subject mini"> <div v-if="form.mallPrices.length && form.mallPrices.find(e => !e.settlementPriceType && e.area !== 0)" class="subject mini">
<template v-for="(item, i) in form.mallPrices"> <template v-for="(item, i) in form.mallPrices">
@ -219,13 +246,14 @@
<el-select style="width: 150px;margin: 0 10px;" v-model="item.cityId" clearable placeholder="请选择城市" :disabled="item.area ? false : true"> <el-select style="width: 150px;margin: 0 10px;" v-model="item.cityId" clearable placeholder="请选择城市" :disabled="item.area ? false : true">
<el-option v-for="(item, i) in item.cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option> <el-option v-for="(item, i) in item.cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select> </el-select>
<el-select style="width: 150px;margin-right: 10px;" v-model="item.entryType" clearable placeholder="请选择"> <el-select style="width: 150px;margin-right: 10px;" v-model="item.entryType" clearable placeholder="请选择" @change="calcSettlement(item)">
<el-option v-for="(item, i) in entryTypes" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in entryTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice"> <el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template> <template slot="append">{{ handleUnit(item) }}</template>
</el-input> </el-input>
<i class="del el-icon-delete" @click="form.mallPrices.splice(i, 1)"></i> <span v-if="item.entryType && item.discountRate" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span>
<i v-if="!isDetail" class="del el-icon-delete" @click="form.mallPrices.splice(i, 1)"></i>
</div> </div>
</template> </template>
</div> </div>
@ -241,12 +269,12 @@
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)"> <el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template> <template slot="append">{{ handleUnit(item) }}</template>
</el-input> </el-input>
<span v-if="item.entryType" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span> <span v-if="item.entryType && item.discountRate" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span>
</div> </div>
</template> </template>
<div style="display: flex;align-items: center;margin-top: 10px;"> <div style="display: flex;align-items: center;margin-top: 10px;">
除外地区 除外地区
<i class="el-icon-circle-plus-outline plus" style="margin: 0 0 0 10px;" @click="addArea(1)"></i> <i v-if="!isDetail" class="el-icon-circle-plus-outline plus" style="margin: 0 0 0 10px;" @click="addArea(1)"></i>
</div> </div>
<div v-if="form.mallPrices.length && form.mallPrices.find(e => e.settlementPriceType && e.area !== 0)" class="subject"> <div v-if="form.mallPrices.length && form.mallPrices.find(e => e.settlementPriceType && e.area !== 0)" class="subject">
<template v-for="(item, i) in form.mallPrices"> <template v-for="(item, i) in form.mallPrices">
@ -257,13 +285,14 @@
<el-select style="width: 150px;margin: 0 10px;" v-model="item.cityId" clearable placeholder="请选择城市" :disabled="item.area ? false : true"> <el-select style="width: 150px;margin: 0 10px;" v-model="item.cityId" clearable placeholder="请选择城市" :disabled="item.area ? false : true">
<el-option v-for="(item, i) in item.cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option> <el-option v-for="(item, i) in item.cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</el-select> </el-select>
<el-select style="width: 150px;margin: 0 10px;" v-model="item.entryType" clearable placeholder="请选择"> <el-select style="width: 150px;margin: 0 10px;" v-model="item.entryType" clearable placeholder="请选择" @change="calcSettlement(item)">
<el-option v-for="(item, i) in entryTypes" :key="i" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, i) in entryTypes" :key="i" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice"> <el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template> <template slot="append">{{ handleUnit(item) }}</template>
</el-input> </el-input>
<i class="del el-icon-delete" @click="form.mallPrices.splice(i, 1)"></i> <span v-if="item.entryType && item.discountRate" class="m-l-20">{{ item.discountRate }} {{ isData ? '/账号/' : '/' }}</span>
<i v-if="!isDetail" class="del el-icon-delete" @click="form.mallPrices.splice(i, 1)"></i>
</div> </div>
</template> </template>
</div> </div>
@ -276,6 +305,7 @@
</el-form-item> </el-form-item>
<el-form-item prop="file" label="产品参数"> <el-form-item prop="file" label="产品参数">
<el-upload <el-upload
:before-remove="beforeFileRemove"
:on-success="uploadSuccessFile" :on-success="uploadSuccessFile"
:action="api.fileUploadNakadai" :action="api.fileUploadNakadai"
:file-list="form.mallAnnex" :file-list="form.mallAnnex"
@ -315,11 +345,11 @@
<span v-else>{{ scope.row.typeName }}</span> <span v-else>{{ scope.row.typeName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" min-width="60"> <el-table-column label="操作" align="center" width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i> <i v-if="scope.row.edit" class="el-icon-check icon" @click="submitClass(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i> <i v-else class="el-icon-edit icon" @click="editClass(scope.row)"></i>
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i> <i class="el-icon-delete icon" @click="delClass(scope.row, scope.$index)"></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -346,11 +376,11 @@
<span v-else>{{ scope.row.tagsName }}</span> <span v-else>{{ scope.row.tagsName }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" min-width="60"> <el-table-column label="操作" align="center" width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i> <i v-if="scope.row.edit" class="el-icon-check icon" @click="submitLabel(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i> <i v-else class="el-icon-edit icon" @click="editLabel(scope.row)"></i>
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i> <i class="el-icon-delete icon" @click="delLabel(scope.row, scope.$index)"></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -359,7 +389,8 @@
</span> </span>
</el-dialog> </el-dialog>
<el-dialog title="关联产品" :visible.sync="productVisible" width="800px" :close-on-click-modal="false" class="manage-dia"> <el-dialog title="关联产品" :visible.sync="productVisible" width="800px" :close-on-click-modal="false" class="product-dia">
<p class="tips">(已关联产品的不可重复关联)</p>
<div class="tabs"> <div class="tabs">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{active: i == productActive}" @click="tabChange(i)">{{ item }}</a> <a class="item" v-for="(item, i) in tabs" :key="i" :class="{active: i == productActive}" @click="tabChange(i)">{{ item }}</a>
</div> </div>
@ -367,7 +398,7 @@
<el-table :data="products" class="table" ref="table" stripe header-align="center" row-key="id"> <el-table :data="products" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column width="80" align="center"> <el-table-column width="80" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-radio class="product-radio" v-model="selectProduct" :label="scope.row.cid"></el-radio> <el-radio class="product-radio" v-model="selectProduct" :label="scope.row.cid" :disabled="scope.row.associatedProductIdentification"></el-radio>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"> <el-table-column type="index" width="100" label="序号" align="center">
@ -428,6 +459,12 @@ export default {
productName: '', productName: '',
state: 1, state: 1,
}, },
mallNonAssociatedLinks: [
{
url: '',
urlName: '',
}
],
mallAnnex: [], mallAnnex: [],
mallDisciplines: [ mallDisciplines: [
{ {
@ -501,6 +538,7 @@ export default {
// , // ,
form: { form: {
handler(val){ handler(val){
console.log("🚀 ~ file: index.vue:511 ~ handler ~ val:", val)
this.updateTime++ this.updateTime++
}, },
deep:true deep:true
@ -524,7 +562,6 @@ export default {
}).then(() => { }).then(() => {
this.submit(this.form.state, next) this.submit(this.form.state, next)
}).catch(() => { }).catch(() => {
console.log(55)
next() next()
}) })
} else { } else {
@ -538,6 +575,9 @@ export default {
this.id ? this.getData() : this.getOp() this.id ? this.getData() : this.getOp()
this.getSubject() this.getSubject()
this.getProvince() this.getProvince()
setTimeout(() => {
this.updateTime = 0
}, 1000)
}, },
components: { components: {
Editor Editor
@ -564,7 +604,7 @@ export default {
}) })
setTimeout(() => { setTimeout(() => {
this.updateTime = 0 this.updateTime = 0
}, 3000) }, 1000)
}) })
}).catch(err => {}) }).catch(err => {})
}, },
@ -722,15 +762,19 @@ export default {
getLabel() { getLabel() {
this.$get(this.api.tagsList).then(res => { this.$get(this.api.tagsList).then(res => {
this.labels = res.tagsList this.labels = res.tagsList
const ids = [] //
this.form.tagsIds.forEach(item => { if (this.id) {
this.labels.forEach(e => { console.log("🚀 ~ file: index.vue:735 ~ this.$get ~ id:", this.id)
if (item == e.tagsId) { const ids = []
ids.push(item) 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 => {}) }).catch(err => {})
}, },
// //
@ -797,13 +841,16 @@ export default {
// //
getClass() { getClass() {
this.$get(this.api.productTypeList).then(res => { this.$get(this.api.productTypeList).then(res => {
const list = res.typeList 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 this.classifications = list
}).catch(err => {}) }).catch(err => {})
}, },
@ -870,6 +917,16 @@ export default {
// id // id
if (!list.find(e => e.id == this.form.classificationId)) this.form.classificationId = '' 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: '' 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) { calcSettlement(item) {
// //
const unit = this.form.mall.marketUnitPrice const unit = this.form.mall.marketUnitPrice
console.log("🚀 ~ file: index.vue:917 ~ calcSettlement ~ unit:", unit,item) if (item.entryType && unit !== '' && item.settlementPrice !== '' && item.settlementPrice !== undefined) {
this.$set(item, 'discountRate', item.settlementPrice / 10 * unit)
if (item.entryType && unit !== '') { } else {
item.discountRate = item.settlementPrice / 10 * unit this.$set(item, 'discountRate', item.settlementPrice)
} }
}, },
// //
@ -966,14 +1035,17 @@ export default {
}).catch(res => {}) }).catch(res => {})
}, },
handleExceed(files, fileList) { //
Util.warningMsg("当前限制选择 4 个文件,如需更换,请删除上一个文件再重新选择!");
},
uploadSuccess(res) { uploadSuccess(res) {
this.form.mall.coverDrawing = res.data.filesResult.fileUrl this.form.mall.coverDrawing = res.data.filesResult.fileUrl
}, },
uploadSuccessMini(res) { // beforeCoverRemove() {
this.form.mall.appletIcon = res.data.filesResult.fileUrl; this.form.mall.coverDrawing = ''
},
uploadSuccessMini(res) {
this.form.mall.appletIcon = res.data.filesResult.fileUrl;
},
beforeMiniRemove() {
this.form.mall.appletIcon = ''
}, },
uploadSuccessInterface(res) { // uploadSuccessInterface(res) { //
this.form.mall.interfaceDiagrams.push(res.data.filesResult.fileUrl) this.form.mall.interfaceDiagrams.push(res.data.filesResult.fileUrl)
@ -986,23 +1058,16 @@ export default {
fileName: e.originalFileName, fileName: e.originalFileName,
name: e.originalFileName, name: e.originalFileName,
}] }]
console.log(22, this.form)
},
uploadError(err, file, fileList) {
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
}, },
beforeRemove(file, fileList) { beforeFileRemove() {
return this.$confirm(`确定移除 ${file.name}`); this.form.mallAnnex = []
}, },
handleRemove(file, fileList) { //
// let fileName = this.form.mall.coverDrawing.replace('https://huoran.oss-cn-shenzhen.aliyuncs.com/', ""); beforeUpload() {
// this.$del(`${this.api.fileDeletion}?keys=${fileName}`).then(res => { if (this.form.mall.interfaceDiagrams.length > 2) {
// this.form.mall.coverDrawing = '' Util.errorMsg('当前限制选择 3 个文件,如需更换,请删除上一个文件再重新选择!')
// }).catch(res => {}); return false
}
}, },
submit(state, next) { submit(state, next) {
const form = JSON.parse(JSON.stringify(this.form)) const form = JSON.parse(JSON.stringify(this.form))
@ -1013,41 +1078,40 @@ export default {
if (!form.classificationIds) return Util.errorMsg('请选择产品分类!') if (!form.classificationIds) return Util.errorMsg('请选择产品分类!')
if (!form.typeIds) return Util.errorMsg('请选择产品类型!') if (!form.typeIds) return Util.errorMsg('请选择产品类型!')
if (!form.supplierIds.length) return Util.errorMsg('请选择供应厂商!') if (!form.supplierIds.length) return Util.errorMsg('请选择供应厂商!')
let invalid = 0 if (!mall.coverDrawing) return Util.errorMsg('请上传封面图!')
for (const e of form.mallDisciplines) { if (!mall.marketUnitPrice) return Util.errorMsg('请输入市场建议单价!')
if (!e.categoryId) { let priceInvalid = 0
invalid = 1 for (const e of form.mallPrices) {
Util.errorMsg('请选择学科类别!') if (e.settlementPrice === '' || e.settlementPrice === undefined) {
break priceInvalid = 1
} Util.errorMsg(`请输入${e.settlementPriceType ? '平台' : '厂商'}结算价!`)
if (!e.professionalCategoryId) {
invalid = 1
Util.errorMsg('请选择专业类!')
break break
} }
if (!e.professionalId) { if (e.area === '') {
invalid = 1 priceInvalid = 1
Util.errorMsg('请选择专业!') Util.errorMsg(`请选择地区!`)
break break
} }
} }
if (invalid) return if (priceInvalid) 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 (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!') if (!mall.productIntroduction) return Util.errorMsg('请输入产品简介!')
if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!') if (!mall.detailedIntroduction) return Util.errorMsg('请输入详情介绍!')
} }
form.classificationIds = [form.classificationIds] form.classificationIds = [form.classificationIds]
form.typeIds = [form.typeIds] form.typeIds = [form.typeIds]
mall.interfaceDiagram = mall.interfaceDiagrams.join() 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.state = state
form.mall.isShelves = state form.mall.isShelves = state
if (this.submiting) return false if (this.submiting) return false
this.submiting = true this.submiting = true
if (form.mall.mallId) { if (form.mall.mallId) {
this.$post(this.api.renewalOfGoods, form).then(res => { this.$post(this.api.renewalOfGoods, form).then(res => {
this.pass = true
this.submiting = false; this.submiting = false;
Util.successMsg("修改成功"); Util.successMsg("修改成功");
next ? next() : this.$router.back() next ? next() : this.$router.back()
@ -1056,6 +1120,7 @@ export default {
}); });
} else { } else {
this.$post(this.api.addGoods, form).then(res => { this.$post(this.api.addGoods, form).then(res => {
this.pass = true
this.submiting = false; this.submiting = false;
Util.successMsg("新增成功"); Util.successMsg("新增成功");
next ? next() : this.$router.back() next ? next() : this.$router.back()
@ -1067,6 +1132,8 @@ export default {
// //
back() { back() {
this.pass = true this.pass = true
console.log("🚀 ~ file: index.vue:1100 ~ back ~ this.updateTime:", this.updateTime)
// //
if (this.updateTime) { if (this.updateTime) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
@ -1154,12 +1221,16 @@ $avatar-width: 104px;
} }
} }
} }
.avatars { .pics {
display: flex;
margin-top: 10px; margin-top: 10px;
text-align: center;
.pic {
margin-right: 20px;
}
img { img {
width: $avatar-width; width: $avatar-width;
height: $avatar-width; height: $avatar-width;
margin-right: 10px;
} }
} }
@ -1171,12 +1242,19 @@ $avatar-width: 104px;
} }
} }
.manage-dia { .manage-dia {
.edit, .del { .icon {
margin-right: 5px;
font-size: 14px; font-size: 14px;
cursor: pointer; cursor: pointer;
} }
.edit { }
margin-right: 10px; .product-dia {
.tips {
position: absolute;
top: 23px;
left: 100px;
font-size: 12px;
color: #f00;
} }
} }
.plus { .plus {
@ -1190,7 +1268,7 @@ $avatar-width: 104px;
padding: 10px; padding: 10px;
border: 1px dashed #ccc; border: 1px dashed #ccc;
&.mini { &.mini {
width: 740px; // width: 790px;
} }
.line { .line {
position: relative; position: relative;

@ -2,7 +2,7 @@
<!-- 营销推广管理 --> <!-- 营销推广管理 -->
<div style="padding-top: 24px"> <div style="padding-top: 24px">
<div style="margin-bottom: 10px;text-align: right;"> <div style="margin-bottom: 10px;text-align: right;">
<el-button v-auth="'平台自建:新增'" type="primary" round @click="add">新增</el-button> <el-button v-auth="'/shop:营销推广管理:新增'" type="primary" round @click="add">新增</el-button>
</div> </div>
<el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id"> <el-table :data="list" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column> <el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
@ -20,10 +20,10 @@
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
@change="switchOff($event, scope.row)" @change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'"> v-auth="'/shop:营销推广管理:禁用'">
</el-switch> </el-switch>
<el-button style="margin-left: 10px;" v-auth="'平台自建:删除'" type="text" @click="edit(scope.row)">编辑</el-button> <el-button style="margin-left: 10px;" v-auth="'/shop:营销推广管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'/shop:营销推广管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -34,13 +34,11 @@
<el-form-item label="图片"> <el-form-item label="图片">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
accept=".jpg,.png,.jpeg" accept=".jpg,.png,.jpeg,.gif"
:on-success="uploadSuccess" :on-change="changeFile"
:limit="1"
:action="api.fileupload"
:headers="headers"
:show-file-list="false" :show-file-list="false"
name="file" :action="this.api.fileupload"
:auto-upload="false"
> >
<img v-if="form.banner" :src="form.banner" class="avatar"> <img v-if="form.banner" :src="form.banner" class="avatar">
<div class="uploader-default" v-else> <div class="uploader-default" v-else>
@ -61,12 +59,25 @@
<el-button type="primary" @click="submitBanner">确定</el-button> <el-button type="primary" @click="submitBanner">确定</el-button>
</span> </span>
</el-dialog> </el-dialog>
<!-- 剪裁组件弹窗 -->
<el-dialog title="图片裁剪" append-to-body :visible.sync="cropperModel" width="1100px" :close-on-click-modal="false">
<Cropper
ref="cropper"
:img-file.sync="file"
:is-upload="isUpload"
:fixed="true"
:fixedNumber.sync="fixedNumber"
@upload="customUpload" />
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import util from "@/libs/util"; import Util from "@/libs/util";
import Setting from '@/setting' import Setting from '@/setting'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default { export default {
data() { data() {
return { return {
@ -80,9 +91,16 @@ export default {
banner: '', banner: '',
title: '', title: '',
url: '', url: '',
} },
cropperModel: false,
isUpload: false,
fixedNumber: [5.7, 1],
file: ''
}; };
}, },
components: {
Cropper
},
mounted() { mounted() {
this.getList() this.getList()
}, },
@ -97,24 +115,83 @@ export default {
}).catch(res => { }).catch(res => {
}); });
}, },
handleExceed() { // //
this.$message.warning("当前限制选择 1 个文件,如需更换,请删除上一个文件再重新选择!"); customUpload(data) {
const formData = new FormData()
formData.append('file', data, this.file.name)
this.imgUpload(formData)
}, },
uploadSuccess(res) { // //
this.form.banner = res.data.filesResult.fileUrl; compress(img) {
const canvas = document.createElement('canvas')
const ctx = canvas.getContext('2d')
// let initSize = img.src.length;
const width = img.width
const height = img.height
canvas.width = width
canvas.height = height
//
ctx.fillStyle = '#fff'
ctx.fillRect(0, 0, canvas.width, canvas.height)
ctx.drawImage(img, 0, 0, width, height)
//
const ndata = canvas.toDataURL('image/jpeg', 0.8)
return ndata
}, },
uploadError(err, file, fileList) { // // base64bolb
this.$message({ dataURItoBlob(base64Data) {
message: "上传出错,请重试!", let byteString
type: "error", if (base64Data.split(',')[0].indexOf('base64') >= 0) {
center: true byteString = atob(base64Data.split(',')[1])
}); } else {
byteString = unescape(base64Data.split(',')[1])
}
const mimeString = base64Data
.split(',')[0]
.split(':')[1]
.split(';')[0]
const ia = new Uint8Array(byteString.length)
for (let i = 0; i < byteString.length; i++) {
ia[i] = byteString.charCodeAt(i)
}
return new Blob([ia], {
type: mimeString
})
}, },
beforeRemove(file, fileList) { // //
return this.$confirm(`确定移除 ${file.name}`); imgUpload(formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.fileUploadNakadai,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
}).then(({ data }) => {
this.form.banner = data.filesResult.fileUrl
}).catch(res => {})
this.$refs.cropper.isDisabled = false
this.isUpload = false
this.cropperModel = false
}, },
handleRemove(file, fileList) { // //
// this.form.coverUrl = '' changeFile(file) {
const { size, name } = file
const ext = name.substring(name.lastIndexOf('.') + 1)
if (!Util.isImg(ext)) {
this.$message.error('请上传图片!')
return false
}
this.file = file
this.cropperModel = true
this.$nextTick(() => {
this.$refs.cropper.updateImg({
url: window.URL.createObjectURL(file.raw),
size: file.size
})
})
}, },
add() { add() {
this.form = { this.form = {
@ -132,8 +209,7 @@ export default {
// banner // banner
submitBanner() { submitBanner() {
const { form } = this const { form } = this
if (!form.banner) return util.errorMsg('请上传图片') if (!form.banner) return Util.errorMsg('请上传图片')
if (!form.title) return util.errorMsg('请输入标题')
this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => { this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => {
this.getList() this.getList()
this.bannerVisible = false this.bannerVisible = false
@ -145,7 +221,7 @@ export default {
}) })
.then(() => { .then(() => {
this.$post(`${this.api.delMarketing}?ids=${row.id}`).then(res => { this.$post(`${this.api.delMarketing}?ids=${row.id}`).then(res => {
util.successMsg("删除成功"); Util.successMsg("删除成功");
this.getList(); this.getList();
}).catch(res => { }).catch(res => {
}); });

@ -44,7 +44,7 @@
</li> </li>
</ul> </ul>
<div> <div>
<el-button v-auth="'平台自建:新增'" type="primary" round @click="addCourse">新增</el-button> <el-button v-auth="'/shop:产品管理:新增'" type="primary" round @click="addCourse">新增</el-button>
</div> </div>
</div> </div>
@ -69,7 +69,7 @@
<el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column> <el-table-column prop="userName" label="最近编辑人" min-width="150" align="center"></el-table-column>
<el-table-column prop="selected" label="精选" min-width="150" align="center" sortable="custom"> <el-table-column prop="selected" label="精选" min-width="150" align="center" sortable="custom">
<template slot-scope="scope"> <template slot-scope="scope">
<i :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" @click="selected(scope.row)"></i> <i v-auth="'/shop:产品管理:精选'" :class="['icon', scope.row.selected ? 'el-icon-check' : 'el-icon-close']" @click="selected(scope.row)"></i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="上架/下架" align="center" width="90"> <el-table-column label="上架/下架" align="center" width="90">
@ -79,17 +79,17 @@
:active-value="0" :active-value="0"
:inactive-value="1" :inactive-value="1"
@change="changeSwitch($event, scope.row)" @change="changeSwitch($event, scope.row)"
v-auth="'/curriculum:上下架'"> v-auth="'/shop:产品管理:上下架'">
</el-switch> </el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="120"> <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<template v-if="scope.row.isShelves"> <template v-if="scope.row.isShelves">
<el-button v-auth="'平台自建:编辑信息'" type="text" @click="edit(scope.row)">编辑</el-button> <el-button v-auth="'/shop:产品管理:编辑'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button v-auth="'/shop:产品管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
<el-button v-else v-auth="'平台自建:编辑信息'" type="text" @click="edit(scope.row, 1)">查看</el-button> <el-button v-else v-auth="'/shop:产品管理:查看'" type="text" @click="edit(scope.row, 1)">查看</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -108,6 +108,7 @@ export default {
return { return {
timer: null, timer: null,
form: { form: {
hotTag: 1,
sort: 0, sort: 0,
categoryId: '', categoryId: '',
productClassification: '', productClassification: '',
@ -267,51 +268,59 @@ export default {
const { mall } = form const { mall } = form
let err let err
let disErr let disErr
for (const e of form.mallDisciplines) { // for (const e of form.mallDisciplines) {
if (!e.categoryId) { // if (!e.categoryId) {
disErr = '请选择学科类别!' // disErr = ''
break // break
} // }
if (!e.professionalCategoryId) { // if (!e.professionalCategoryId) {
disErr = '请选择专业类!' // disErr = ''
break // break
} // }
if (!e.professionalId) { // if (!e.professionalId) {
disErr = '请选择专业!' // disErr = ''
// break
// }
// }
let priceErr
for (const e of form.mallPrices) {
if (e.settlementPrice === '' || e.settlementPrice === undefined || e.area === '') {
priceErr = 1
break break
} }
} }
if (!mall.isAssociatedProduct && !mall.associatedProduct) { if (!mall.isAssociatedProduct && !mall.associatedProduct) {
err = '请选择产品!' err = 1
} else if (!form.classificationIds.length) { } else if (!form.classificationIds.length) {
err = '请选择产品分类!' err = 1
} else if (!form.typeIds.length) { } else if (!form.typeIds.length) {
err = '请选择产品类型!' err = 1
} else if (!form.supplierIds.length) { } else if (!form.supplierIds.length) {
err = '请选择供应厂商!' err = 1
} else if (disErr) { } else if (disErr) {
err = disErr err = disErr
} else if (!mall.coverDrawing) { } else if (!mall.coverDrawing) {
err = '请上传封面图!' err = 1
} else if (!mall.marketUnitPrice) { } else if (!mall.marketUnitPrice) {
err = '请输入市场建议单价!' err = 1
} else if (form.mallPrices.find(e => !e.settlementPriceType && e.area === 0).settlementPrice === '') { } else if (priceErr) {
err = '请输入厂商结算价!' err = 1
} else if (form.mallPrices.find(e => e.settlementPriceType && e.area === 0).settlementPrice === '') {
err = '请输入平台结算价!'
} else if (!mall.productIntroduction) { } else if (!mall.productIntroduction) {
err = '请输入产品简介!' err = 1
} else if (!mall.detailedIntroduction) { } else if (!mall.detailedIntroduction) {
err = '请输入详情介绍!' err = 1
} }
if (err) { if (err) {
Util.errorMsg('无法上架!' + err) Util.errorMsg('无法上架!请编辑产品后上架!')
row.isShelves = 1 row.isShelves = 1
return return
} }
this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => { this.$post(`${this.api.goodsOffTheShelf}?mallId=${row.mallId}&isShelves=${value}`).then((res) => {
this.getData() this.getData()
}).catch((res) => {}) }).catch(({ status }) => {
if (status !== 200) row.isShelves = 1
})
}, },
// //
selected(row) { selected(row) {

Loading…
Cancel
Save