From 3ac5c7aba29678bf18b33712974ea509f9e7c2f0 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 1 Aug 2022 17:45:13 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A2=E5=8D=95=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/api.js | 1 + src/views/course/AddCurriculum.vue | 45 +++++++++++++++++++----------- src/views/match/add/index.vue | 16 ++++++++--- src/views/order/AddOrder.vue | 36 +++++++++++++++++------- 4 files changed, 68 insertions(+), 30 deletions(-) diff --git a/src/utils/api.js b/src/utils/api.js index 63fd01b..715afb7 100644 --- a/src/utils/api.js +++ b/src/utils/api.js @@ -25,6 +25,7 @@ export default { orderUpdate: `nakadai/nakadai/order/update`,// 订单更新 renew: `nakadai/nakadai/orderOther/renew`,// 续费信息管理-post ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post + bulkShipping: `nakadai/nakadai/orderOther/bulkShipping`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`, // 客户管理 diff --git a/src/views/course/AddCurriculum.vue b/src/views/course/AddCurriculum.vue index 19b015b..4abe193 100644 --- a/src/views/course/AddCurriculum.vue +++ b/src/views/course/AddCurriculum.vue @@ -323,7 +323,7 @@ @@ -613,30 +613,28 @@ export default { const result = [] list.map(e => { // 如果选中的项目里有该系统的项目,则隐藏 - if (!checked.find(n => n.systemId == e.systemId)) { + // if (!checked.find(n => n.systemId == e.systemId)) { e.check = false result.push(e) - } + // } }) this.systems = result - list.length && this.getProject(result[0]) + result.length && this.getProject(result[0]) }).catch(err => {}) }, // 获取项目列表 getProject(item) { - const { check } = item // 项目选中状态跟随系统 - const checked = this.permissions ? this.assessmentData : this.practiceData + const checked = this.checkeds this.curSystem = item.systemId this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { this.projectAll = JSON.parse(JSON.stringify(res)) // 全部项目,另外保存 const result = [] res.map(e => { - // 如果选择了该项目,则隐藏 - if (!checked.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { - e.type = item.type ? '流程类' : '编程类' - e.check = check - result.push(e) - } + e.type = item.type ? '流程类' : '编程类' + // 如果选择了该项目,则禁用并选中 + const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId) + e.check = include + result.push(e) }) this.projects = result }).catch(err => {}) @@ -651,13 +649,19 @@ export default { // 项目列表选中状态同步 const { projects, checkeds } = this if (projects.length && projects[0].systemId == item.systemId) { - projects.map(e => e.check = val) + projects.map(e => { + e.check = val + }) } this.projectKeyword = '' this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { if (val) { - res.map(e => e.type = item.type ? '流程类' : '编程类') - checkeds.push(...res) + res.map(e => { + if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { + e.type = item.type ? '流程类' : '编程类' + checkeds.push(e) + } + }) } else { res.map(e => { const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId) @@ -688,11 +692,20 @@ export default { this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val)) }, // 删除已选项目 - delProject(i) { + delProject(i, e) { this.$confirm("确定要删除吗?", "提示", { type: "warning" }).then(() => { this.checkeds.splice(i, 1) + // 如果当前展示的项目列表跟删掉的项目是同个系统,则找到项目列表里删掉的该项目,重置check和disabled + if (e.systemId == this.curSystem) { + const { projectId } = e + this.projects.map(n => { + if (n.projectId == projectId) { + n.check = false + } + }) + } }).catch(() => {}) }, // 确认系统 diff --git a/src/views/match/add/index.vue b/src/views/match/add/index.vue index fb37d37..fccb2e0 100644 --- a/src/views/match/add/index.vue +++ b/src/views/match/add/index.vue @@ -156,6 +156,7 @@ :before-filter="beforeFilter" :options="rangeList" @change="rangeChange" + @visible-change="rangeViChange" @input.native="rangeSearch"> n.provinceId == e.provinceId) + e.disabled = !!checked.find(n => n.provinceId == e.provinceId && !n.cityId) data.push(e) }) resolve(data) @@ -265,7 +266,7 @@ export default { e.value = e.cityId e.label = e.cityName e.children = [] - e.disabled = !!checked.find(n => n.cityId == e.cityId) + e.disabled = !!checked.find(n => n.cityId == e.cityId && n.provinceId == e.provinceId && !n.schoolId) data.push(e) }) resolve(data) @@ -282,7 +283,7 @@ export default { e.value = e.schoolId e.label = e.schoolName e.leaf = true - e.disabled = !!checked.find(n => n.schoolId == e.schoolId) + e.disabled = !!checked.find(n => n.schoolId == e.schoolId && n.cityId == e.cityId && n.provinceId == e.provinceId) data.push(e) }) resolve(data) @@ -390,10 +391,17 @@ export default { const name = [] const { rangeChecked } = this checked.map(e => { - rangeChecked.find(n => n.value === e.value) || name.push(e.data) // 未勾选的,则push + rangeChecked.find(n => n.value === e.value && n.label == e.label) || name.push(e.data) // 未勾选的,则push }) this.rangeChecked.push(...name) }, + // 范围展开收缩回调 + rangeViChange(e) { + // 展开的时候清空搜索结果 + if (e) { + this.rangeList = [] + } + }, // 获取学校列表 getSchool() { this.$get(this.api.querySchoolData).then(({ list }) => { diff --git a/src/views/order/AddOrder.vue b/src/views/order/AddOrder.vue index f5fc0c6..b8d1428 100644 --- a/src/views/order/AddOrder.vue +++ b/src/views/order/AddOrder.vue @@ -114,10 +114,13 @@

课程权限 - 添加 - +
+ + 添加 +
@@ -233,7 +236,7 @@ 3、处理中的订单显示发货,不显示禁用 -->

数据平台权限 - 添加 - +
+ + 添加 +
@@ -406,7 +413,7 @@ style="margin-right:10px;" >删除 i.authority === 1); this.dataPlatformPermissions = list.filter(i => i.authority === 0); }, @@ -1350,6 +1356,16 @@ console.log(33, list) // 课程/数据平台-启用 handleEnable(e, row) { + }, + // 一键发货 + batchDeliver(ship, data) { + const list = data ? this.dataPlatformPermissions : this.coursePermissions + list.map(e => e.ship = ship) + if (this.editDisabled) { + this.$post(this.api.bulkShipping, { + orderOthers: list + }).then(res => {}) + } }, // 课程/数据平台-发货 handleDeliver(e, row) {