|
|
|
@ -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 { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 处理orderRepeat里的id |
|
|
|
|
handleOrderRepeat(id) { |
|
|
|
|
this.orderRepeat.includes(id) && this.orderRepeat.splice(this.orderRepeat.findIndex(e => e == id), 1) |
|
|
|
|
}, |
|
|
|
|
/* 处理0开头的期限 */ |
|
|
|
|
zero(e, row) { |
|
|
|
|
if (e[0] == "0") { |
|
|
|
@ -1946,60 +1947,82 @@ export default { |
|
|
|
|
this.form.provinceId = res.result.customer.provinceId; |
|
|
|
|
this.form.cityId = res.result.customer.cityId; |
|
|
|
|
this.getCityData(); |
|
|
|
|
this.getSettlemennt() |
|
|
|
|
}); |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
// 更换了订单客户后重新获取结算价 |
|
|
|
|
getSettlemennt() { |
|
|
|
|
const list = [] |
|
|
|
|
this.listName.map(e => e.name).forEach(e => { |
|
|
|
|
list.push(...this[e]) |
|
|
|
|
}) |
|
|
|
|
console.log("🚀 ~ file: AddOrder.vue:1954 ~ getSettlemennt ~ list:", list) |
|
|
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { |
|
|
|
|
const mall = res.mallPrice |
|
|
|
|
if (mall) { |
|
|
|
|
e.settlementPrice = mall.discountRate |
|
|
|
|
} |
|
|
|
|
}).catch((res) => {}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
closeJCourse() { // 关闭课程选择对话框 |
|
|
|
|
this.curriculumName = ""; |
|
|
|
|
this.courseVisible = false; |
|
|
|
|
}, |
|
|
|
|
// 删除课程权限 |
|
|
|
|
delCourseForm(index) { |
|
|
|
|
delCourseForm(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.coursePermissions.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条课程权限"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.coursePermissions.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
//删除理论课程 |
|
|
|
|
delCourseDataForm(index) { |
|
|
|
|
delCourseDataForm(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.theoryCourseList.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条课程权限"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.theoryCourseList.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 删除数据平台权限 |
|
|
|
|
delDataForm(index) { |
|
|
|
|
delDataForm(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.dataPlatformPermissions.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条产品信息"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.dataPlatformPermissions.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 删除职站增值应用产品权限 |
|
|
|
|
delDataFormList(index) { |
|
|
|
|
delDataFormList(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.valuePermissions.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条产品信息"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.valuePermissions.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -2015,7 +2038,8 @@ export default { |
|
|
|
|
productClassification: this.classificationId, |
|
|
|
|
pageSize: 10, |
|
|
|
|
isShelves: 0, |
|
|
|
|
productName: this.practicalCourseName |
|
|
|
|
productName: this.practicalCourseName, |
|
|
|
|
hotTag: 1 |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
this.practicalCourseList = page.records; |
|
|
|
|
this.practicalCourseTotals = page.total; |
|
|
|
@ -2026,8 +2050,9 @@ export default { |
|
|
|
|
}, |
|
|
|
|
practicalCoursesSelectable(row, index) { // 禁止勾选已经选过的数据平台 |
|
|
|
|
let boolean = true; |
|
|
|
|
this.practicalCourses.length && this.practicalCourses.some(e => { |
|
|
|
|
if (e.dataOrCourseId === row.id) { |
|
|
|
|
const { name } = this.listName.find(e => e.id == this.classificationId) |
|
|
|
|
this[name].length && this[name].some(e => { |
|
|
|
|
if (e.mallId == row.mallId) { |
|
|
|
|
boolean = false; |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -2047,7 +2072,7 @@ export default { |
|
|
|
|
authority = 1 |
|
|
|
|
break; |
|
|
|
|
case 2: |
|
|
|
|
authority = 5 |
|
|
|
|
authority = 1 |
|
|
|
|
break; |
|
|
|
|
case 3: |
|
|
|
|
authority = 2 |
|
|
|
@ -2078,22 +2103,22 @@ export default { |
|
|
|
|
marketValue: '', // 市场价 |
|
|
|
|
marketPrice: e.marketUnitPrice, // 市场单价 |
|
|
|
|
finalPrice: orderType === 2 ? 0 : '',// 成交价 |
|
|
|
|
finalValue: orderType === 2 ? 0 : '', // 成交单价 |
|
|
|
|
discountRate: "",// 折扣率 |
|
|
|
|
accountNum: "",// 账号数 |
|
|
|
|
totalAmount: "",// 总价 |
|
|
|
|
isEnable: 0, // 启用否:1启用,0禁用 |
|
|
|
|
ship: 0,// 发货否(0未发货,1已发货,默认不发货) |
|
|
|
|
authority, // 区分权限 0为数据平台权限,1为课程权限 |
|
|
|
|
authority, // 区分权限 |
|
|
|
|
options: 1, |
|
|
|
|
settlementPrice: orderType === 2 ? 0 : '', // 结算价 |
|
|
|
|
settlementPriceUnit: e.settlementPrice || 0, // 结算单价 |
|
|
|
|
}) |
|
|
|
|
}; |
|
|
|
|
let idArr = []; |
|
|
|
|
console.log("🚀 ~ file: AddOrder.vue:2095 ~ practicalCourseSubmit ~ idArr:", this[name],this.practicalCoursesSelect) |
|
|
|
|
const productId = [] |
|
|
|
|
this.practicalCoursesSelect.map(e => {// 取得选中的值,进行赋值 |
|
|
|
|
idArr.push(e.mallId); |
|
|
|
|
let find = this[name].some(i => e.associatedProduct === i.dataOrCourseId);// 判断已有的相同的id不进行处理 |
|
|
|
|
e.associatedProduct && productId.push(+e.associatedProduct); |
|
|
|
|
let find = this[name].some(i => e.mallId === i.mallId);// 判断已有的相同的id不进行处理 |
|
|
|
|
if (!find) { |
|
|
|
|
this.$post(`${this.api.queryCitySettlementPrice}?mallId=${e.mallId}&provinceId=${this.form.provinceId}&cityId=${this.form.cityId}`).then(res => { |
|
|
|
|
const mall = res.mallPrice |
|
|
|
@ -2107,16 +2132,16 @@ export default { |
|
|
|
|
this.practicalCourseVisible = false; |
|
|
|
|
this.practicalCourseName = ""; |
|
|
|
|
this.practicalCoursesSelect = []; |
|
|
|
|
|
|
|
|
|
/* 调接口,判断是否为客户已有的产品功能 */ |
|
|
|
|
let params = { |
|
|
|
|
authority: this.classificationId, |
|
|
|
|
productId.length && await this.$post(this.api.renew, { |
|
|
|
|
authority, |
|
|
|
|
customerId: this.form.customerId, |
|
|
|
|
productId: idArr |
|
|
|
|
}; |
|
|
|
|
await this.$post(this.api.renew, params).then(res => { |
|
|
|
|
this.dataPlatformPermissions.map(e => { |
|
|
|
|
productId |
|
|
|
|
}).then(res => { |
|
|
|
|
this[name].map(e => { |
|
|
|
|
res.orderOthers.map(el => { |
|
|
|
|
if (el.dataOrCourseId === e.dataOrCourseId && el.authority == 3) { |
|
|
|
|
if (el.dataOrCourseId == e.dataOrCourseId && el.authority == authority) { |
|
|
|
|
let time = new Date(el.endTime) |
|
|
|
|
time = new Date(time.setDate(time.getDate() + 1)) |
|
|
|
|
e.startTime = `${time.getFullYear()}-${time.getMonth() + 1}-${time.getDate()}` |
|
|
|
@ -2137,26 +2162,28 @@ export default { |
|
|
|
|
this.getPracticalCourses(); |
|
|
|
|
}, |
|
|
|
|
// 删除实训课程权限 |
|
|
|
|
delPracticalCourses(index) { |
|
|
|
|
delPracticalCourses(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.practicalCourses.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条产品信息"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.practicalCourses.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 删除实训课程权限 |
|
|
|
|
delExpTool(index) { |
|
|
|
|
delExpTool(index, row) { |
|
|
|
|
this.$confirm("确定要删除吗?", "提示", { |
|
|
|
|
type: "warning" |
|
|
|
|
}).then(() => { |
|
|
|
|
if (this.renewDisabled && this.expTools.length === 1) { |
|
|
|
|
return this.$message.warning("续费至少保留一条产品信息"); |
|
|
|
|
} else { |
|
|
|
|
this.handleOrderRepeat(row.dataOrCourseId) |
|
|
|
|
this.expTools.splice(index, 1); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
@ -2168,7 +2195,7 @@ export default { |
|
|
|
|
this[this.deliverShow[type]] = !this[this.deliverShow[type]] |
|
|
|
|
}, |
|
|
|
|
// 一键发货 |
|
|
|
|
batchDeliver(ship, data,type) { |
|
|
|
|
batchDeliver(ship, data) { |
|
|
|
|
this[this.deliverShow[data]] = !this[this.deliverShow[data]] |
|
|
|
|
// data即各个课程的分类id,详见data里的注释 |
|
|
|
|
const list = data == 1 ? |
|
|
|
@ -2285,10 +2312,6 @@ export default { |
|
|
|
|
}, |
|
|
|
|
// 使用期限转换以及计算剩余天数 |
|
|
|
|
deadLine(e,row,options, isDate) { |
|
|
|
|
console.log('e=>',e) |
|
|
|
|
console.log('row=>',row) |
|
|
|
|
console.log('options=>',options) |
|
|
|
|
console.log('isDate=>',isDate) |
|
|
|
|
let optionsData = '' |
|
|
|
|
if(e > 0){ |
|
|
|
|
if (options == 1){ |
|
|
|
|