yujialong 2 years ago
parent 21e1cfebbc
commit a8e2b253c6
  1. 8
      src/setting.js
  2. 2
      src/utils/api.js
  3. 21
      src/views/course/Curriculum.vue
  4. 41
      src/views/customer/AddCustomer.vue
  5. 14
      src/views/data/Product.vue
  6. 9
      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. 248
      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}/`
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 默认密码
*/

@ -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`,

@ -245,16 +245,19 @@ export default {
},
//
handleDelete(row) {
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(err => {})
}).catch(() => {
});
}
}).catch(err => {})
},
//
handleSelectionChange(val) {
@ -263,6 +266,12 @@ export default {
//
delAllSelection() {
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(() => {
@ -276,10 +285,10 @@ export default {
this.getData();
this.$message.success("删除成功");
this.$refs.table.clearSelection()
}).catch(err => {
});
}).catch(() => {
});
}).catch(err => {})
}).catch(() => {})
}
}).catch(err => {})
} else {
this.$message.warning("请先选择课程 !");
}

@ -23,7 +23,7 @@
</el-select>
</el-form-item>
<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-select>
</el-form-item>
@ -86,9 +86,9 @@
<div class="tool">
<ul class="filter">
<li>
<label>产品类</label>
<el-select v-model="form2.productType" placeholder="请选择产品类型" @change="filterForm2">
<el-option v-for="(item,index) in productTypeList" :key="index" :label="item.name" :value="item.id"></el-option>
<label>产品</label>
<el-select v-model="form2.productType" placeholder="请选择产品类型" clearable @change="filterForm2">
<el-option v-for="(item,index) in productTypeList" :key="index" :label="item.classificationName" :value="item.classificationId"></el-option>
</el-select>
</li>
<li>
@ -105,12 +105,12 @@
<el-button type="primary" @click="exportList">导出列表</el-button>
</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="index" width="100" 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">
<template slot-scope="scope">
{{ 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,7 +573,8 @@ export default {
})
//
const now = Date.now()
if (now < new Date(list[0].startTime).getTime()) {
// 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 = connect ? list[list.length - 1].endTime : list[0].endTime
e.status = '未生效'
@ -586,7 +588,7 @@ export default {
e.other += `<br>${j.startTime} ~ ${j.endTime}`
})
}
} else if (now > new Date(list[list.length - 1].endTime).getTime()) {
} else if (list[list.length - 1].endTime && now > new Date(list[list.length - 1].endTime).getTime()) {
e.status = '已过期'
} else {
//
@ -599,7 +601,7 @@ export default {
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()) {
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
@ -614,7 +616,7 @@ export default {
})
}
break
} else if (i != 0 && now > new Date(list[i - 1].endTime).getTime() && now < new Date(n.startTime).getTime()) {
} 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
@ -625,16 +627,16 @@ export default {
}
}
}
// }
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))
},

@ -431,6 +431,8 @@ export default {
},
//
handleDelete(row) {
this.$post(`${this.api.deleteDataPrompt}?ids=${row.id}`).then(({ status }) => {
if (status === 200) {
this.$confirm('确定要删除吗?', '提示', {
type: 'warning'
}).then(() => {
@ -439,12 +441,20 @@ export default {
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('确定要删除吗?', '提示', {
@ -461,6 +471,8 @@ export default {
this.getData()
}).catch(res => {})
}).catch(() => {})
}
}).catch(err => {})
}else{
this.$message.error('请先选择数据')
}

@ -78,8 +78,10 @@ export default {
handleSave(i) {
//
if (this.active === 'tab1') {
const detail = this.$refs.detail
if (detail.step < 4 && detail.$refs['step' + detail.step].updateTime) {
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(() => {
@ -91,6 +93,9 @@ export default {
} else {
this.backOrTab(i)
}
} else {
this.backOrTab(i)
}
return false
} else {
return true

@ -119,7 +119,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(1)">添加</el-button>
</div>
@ -128,7 +128,7 @@
<el-table :data="coursePermissions" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center">
</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 label="使用期限" align="center" min-width="190">
<template slot-scope="scope">
@ -228,7 +228,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delCourseForm(scope.$index)"
@click="delCourseForm(scope.$index, scope.row)"
style="margin-right:10px;"
>删除</el-button>
<!-- 1: 未生效2生效中3已过期 -->
@ -270,13 +270,13 @@
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>理论课程</span>
<span>理论课程产品权限</span>
</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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction(2)">添加</el-button>
</div>
@ -285,7 +285,7 @@
<el-table :data="theoryCourseList" class="orderTable" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center">
</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 label="使用期限" align="center" min-width="190">
<template slot-scope="scope">
@ -385,7 +385,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delCourseDataForm(scope.$index)"
@click="delCourseDataForm(scope.$index, scope.row)"
style="margin-right:10px;"
>删除</el-button>
<!-- 1: 未生效2生效中3已过期 -->
@ -427,13 +427,13 @@
<div class="flex-between mgb20 user_header">
<div class="flex-center">
<p class="addhr_tag"></p>
<span>数据前瞻平台权限</span>
<span>数据前瞻产品权限</span>
</div>
<div>
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(5)">添加</el-button>
</div>
@ -545,7 +545,7 @@
<template slot-scope="scope">
<div class="small">
<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)]"
@input="scope.row.finalPrice = scope.row.finalPrice.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g, '$1')"
v-model="scope.row.finalPrice"
@ -570,7 +570,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delDataForm(scope.$index)"
@click="delDataForm(scope.$index, scope.row)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
@ -611,7 +611,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(3)">添加</el-button>
</div>
@ -621,7 +621,7 @@
<el-table :data="valuePermissions" class="orderTable orderTables" stripe header-align="center">
<el-table-column type="index" width="60" label="序号" align="center">
</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 label="使用期限" align="center" min-width="190">
<template slot-scope="scope">
@ -720,7 +720,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delDataFormList(scope.$index)"
@click="delDataFormList(scope.$index, scope.row)"
style="margin-right:10px;"
>删除</el-button>
<el-switch
@ -761,7 +761,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(4)">添加</el-button>
</div>
@ -871,7 +871,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delPracticalCourses(scope.$index)"
@click="delPracticalCourses(scope.$index, scope.row)"
style="margin: 0 10px;"
>删除</el-button>
<!-- 1: 未生效2生效中3已过期 -->
@ -919,7 +919,7 @@
<!-- 处理中 || 有未生效的课程 || 新增订单 && 有课程 -->
<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="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>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addCourseJurisdiction(6)">添加</el-button>
</div>
@ -1029,7 +1029,7 @@
<el-button
v-if="!editDisabled&&!viewDisabled"
type="text"
@click="delExpTool(scope.$index)"
@click="delExpTool(scope.$index, scope.row)"
style="margin-right:10px;"
>删除</el-button>
<!-- 1: 未生效2生效中3已过期 -->
@ -1148,7 +1148,7 @@
</div>
</div>
<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"
align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
@ -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 {
}
});
},
// orderRepeatid
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, // 10
ship: 0,// 01
authority, // 01
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]]
// dataiddata
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){

@ -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

@ -70,13 +70,16 @@
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</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">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</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">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}

@ -9,7 +9,7 @@
<el-card shadow="hover" class="m-b-20">
<el-form class="model" ref="form" label-width="110px" :disabled="isDetail">
<el-row>
<el-col :span="6" :offset="5">
<el-col :span="14" :offset="5">
<el-form-item class="req" label="关联产品" prop="curriculumName">
<div>
<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>
</div>
</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-input placeholder="请输入产品名称" v-model.trim="form.mall.productName" id="focus-el"></el-input>
</el-form-item>
@ -56,7 +76,7 @@
</el-option>
</template>
</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 class="req" label="供应厂商" prop="supplier">
<el-select v-model="form.supplierIds" clearable placeholder="请选择供应厂商" multiple :disabled="selectedProduct">
@ -71,6 +91,7 @@
<el-form-item label="学科类别" prop="supplier">
<el-select v-model="item.categoryId" clearable
@change="getProfessionalClass(item)">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in subjectList" :key="index"
:label="item.disciplineName"
:value="item.disciplineId"></el-option>
@ -80,6 +101,7 @@
<el-select v-model="item.professionalCategoryId" clearable
:disabled="item.categoryId ? false : true"
@change="getProfessional(item)">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in item.professionalClassList" :key="index"
:label="item.professionalClassName"
:value="item.professionalClassId"></el-option>
@ -88,15 +110,16 @@
<el-form-item label="专业" prop="supplier">
<el-select v-model="item.professionalId" clearable
:disabled="item.professionalCategoryId ? false : true">
<el-option label="不限" value=""></el-option>
<el-option v-for="(item,index) in item.professionalList" :key="index"
:label="item.professionalName"
:value="item.professionalId"></el-option>
</el-select>
</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 class="subject-plus" @click="addSubject">
<div v-if="!isDetail" class="subject-plus" @click="addSubject">
<i class="el-icon-circle-plus-outline"></i>
</div>
</el-form-item>
@ -124,6 +147,7 @@
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:before-remove="beforeCoverRemove"
:on-success="uploadSuccess"
:limit="1"
:action="api.fileupload"
@ -145,28 +169,31 @@
<el-form-item label="界面图" prop="miniProgramPictureAddress">
<el-upload
accept=".jpg,.png,.jpeg"
:on-remove="handleRemove"
:on-error="uploadError"
:before-upload="beforeUpload"
:on-success="uploadSuccessInterface"
:before-remove="beforeRemove"
:limit="4"
:on-exceed="handleExceed"
:action="api.fileupload"
:headers="headers"
:show-file-list="false"
name="file"
>
<div style="text-align: left;">
<el-button>上传界面图</el-button>
</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>
<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 label="小程序图标" prop="miniProgramPictureAddress">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:before-remove="beforeMiniRemove"
:on-success="uploadSuccessMini"
:limit="1"
:action="api.fileupload"
@ -188,7 +215,7 @@
</el-col>
<el-col :span="14" :offset="5">
<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>
</el-input>
</el-form-item>
@ -203,12 +230,12 @@
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template>
</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>
</template>
<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 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">
@ -219,13 +246,14 @@
<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-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-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>
</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>
</template>
</div>
@ -241,12 +269,12 @@
<el-input type="number" style="width: 200px" v-model.number="item.settlementPrice" @change="calcSettlement(item)">
<template slot="append">{{ handleUnit(item) }}</template>
</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>
</template>
<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 v-if="form.mallPrices.length && form.mallPrices.find(e => e.settlementPriceType && e.area !== 0)" class="subject">
<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-option v-for="(item, i) in item.cities" :key="i" :label="item.cityName" :value="item.cityId"></el-option>
</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-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>
</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>
</template>
</div>
@ -276,6 +305,7 @@
</el-form-item>
<el-form-item prop="file" label="产品参数">
<el-upload
:before-remove="beforeFileRemove"
:on-success="uploadSuccessFile"
:action="api.fileUploadNakadai"
:file-list="form.mallAnnex"
@ -315,11 +345,11 @@
<span v-else>{{ scope.row.typeName }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<el-table-column label="操作" align="center" width="70">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitClass(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editClass(scope.row)"></i>
<i class="el-icon-delete del" @click="delClass(scope.row, scope.$index)"></i>
<i v-if="scope.row.edit" class="el-icon-check icon" @click="submitClass(scope.row)"></i>
<i v-else class="el-icon-edit icon" @click="editClass(scope.row)"></i>
<i class="el-icon-delete icon" @click="delClass(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
@ -346,11 +376,11 @@
<span v-else>{{ scope.row.tagsName }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="60">
<el-table-column label="操作" align="center" width="70">
<template slot-scope="scope">
<i v-if="scope.row.edit" class="el-icon-check edit" @click="submitLabel(scope.row)"></i>
<i v-else class="el-icon-edit edit" @click="editLabel(scope.row)"></i>
<i class="el-icon-delete del" @click="delLabel(scope.row, scope.$index)"></i>
<i v-if="scope.row.edit" class="el-icon-check icon" @click="submitLabel(scope.row)"></i>
<i v-else class="el-icon-edit icon" @click="editLabel(scope.row)"></i>
<i class="el-icon-delete icon" @click="delLabel(scope.row, scope.$index)"></i>
</template>
</el-table-column>
</el-table>
@ -359,7 +389,8 @@
</span>
</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">
<a class="item" v-for="(item, i) in tabs" :key="i" :class="{active: i == productActive}" @click="tabChange(i)">{{ item }}</a>
</div>
@ -367,7 +398,7 @@
<el-table :data="products" class="table" ref="table" stripe header-align="center" row-key="id">
<el-table-column width="80" align="center">
<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>
</el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
@ -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,6 +762,9 @@ export default {
getLabel() {
this.$get(this.api.tagsList).then(res => {
this.labels = res.tagsList
//
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 => {
@ -731,6 +774,7 @@ export default {
})
})
this.form.tagsIds = ids
}
}).catch(err => {})
},
//
@ -797,13 +841,16 @@ export default {
//
getClass() {
this.$get(this.api.productTypeList).then(res => {
const list = res.typeList
//
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,15 +1035,18 @@ export default {
}).catch(res => {})
},
handleExceed(files, fileList) { //
Util.warningMsg("当前限制选择 4 个文件,如需更换,请删除上一个文件再重新选择!");
},
uploadSuccess(res) {
this.form.mall.coverDrawing = res.data.filesResult.fileUrl
},
uploadSuccessMini(res) { //
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;

@ -2,7 +2,7 @@
<!-- 营销推广管理 -->
<div style="padding-top: 24px">
<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>
<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>
@ -20,10 +20,10 @@
:active-value="0"
:inactive-value="1"
@change="switchOff($event, scope.row)"
v-auth="'/curriculum:上下架'">
v-auth="'/shop:营销推广管理:禁用'">
</el-switch>
<el-button style="margin-left: 10px;" v-auth="'平台自建:删除'" type="text" @click="edit(scope.row)">编辑</el-button>
<el-button v-auth="'平台自建:删除'" type="text" @click="handleDelete(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="'/shop:营销推广管理:删除'" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-table-column>
</el-table>
@ -34,13 +34,11 @@
<el-form-item label="图片">
<el-upload
class="avatar-uploader"
accept=".jpg,.png,.jpeg"
:on-success="uploadSuccess"
:limit="1"
:action="api.fileupload"
:headers="headers"
accept=".jpg,.png,.jpeg,.gif"
:on-change="changeFile"
:show-file-list="false"
name="file"
:action="this.api.fileupload"
:auto-upload="false"
>
<img v-if="form.banner" :src="form.banner" class="avatar">
<div class="uploader-default" v-else>
@ -61,12 +59,25 @@
<el-button type="primary" @click="submitBanner">确定</el-button>
</span>
</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>
</template>
<script>
import util from "@/libs/util";
import Util from "@/libs/util";
import Setting from '@/setting'
import Cropper from '@/components/img-upload/Cropper'
import Axios from 'axios'
export default {
data() {
return {
@ -80,9 +91,16 @@ export default {
banner: '',
title: '',
url: '',
}
},
cropperModel: false,
isUpload: false,
fixedNumber: [5.7, 1],
file: ''
};
},
components: {
Cropper
},
mounted() {
this.getList()
},
@ -97,24 +115,83 @@ export default {
}).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) { //
this.$message({
message: "上传出错,请重试!",
type: "error",
center: true
});
// base64bolb
dataURItoBlob(base64Data) {
let byteString
if (base64Data.split(',')[0].indexOf('base64') >= 0) {
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
})
},
//
imgUpload(formData) {
this.isUpload = true
Axios({
method: 'post',
url: this.api.fileUploadNakadai,
data: formData,
headers: {
'Content-Type': 'multipart/form-data',
...this.headers
},
beforeRemove(file, fileList) { //
return this.$confirm(`确定移除 ${file.name}`);
}).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() {
this.form = {
@ -132,8 +209,7 @@ export default {
// banner
submitBanner() {
const { form } = this
if (!form.banner) return util.errorMsg('请上传图片')
if (!form.title) return util.errorMsg('请输入标题')
if (!form.banner) return Util.errorMsg('请上传图片')
this.$post(this.api[form.id ? 'updateMarketing' : 'saveMarketing'], form).then(res => {
this.getList()
this.bannerVisible = false
@ -145,7 +221,7 @@ export default {
})
.then(() => {
this.$post(`${this.api.delMarketing}?ids=${row.id}`).then(res => {
util.successMsg("删除成功");
Util.successMsg("删除成功");
this.getList();
}).catch(res => {
});

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

Loading…
Cancel
Save