课程订单修复

dev_202207
yujialong 2 years ago
parent 4d98052b9a
commit 3ac5c7aba2
  1. 1
      src/utils/api.js
  2. 45
      src/views/course/AddCurriculum.vue
  3. 16
      src/views/match/add/index.vue
  4. 36
      src/views/order/AddOrder.vue

@ -25,6 +25,7 @@ export default {
orderUpdate: `nakadai/nakadai/order/update`,// 订单更新 orderUpdate: `nakadai/nakadai/order/update`,// 订单更新
renew: `nakadai/nakadai/orderOther/renew`,// 续费信息管理-post renew: `nakadai/nakadai/orderOther/renew`,// 续费信息管理-post
ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post ship: `nakadai/nakadai/orderOther/ship`,// 处理时的订单发货管理-post
bulkShipping: `nakadai/nakadai/orderOther/bulkShipping`,
getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`, getOrderOtherTime: `nakadai/nakadai/orderOther/getOrderOtherTime`,
// 客户管理 // 客户管理

@ -323,7 +323,7 @@
<el-table-column prop="projectName" label="项目名称" align="center"></el-table-column> <el-table-column prop="projectName" label="项目名称" align="center"></el-table-column>
<el-table-column label="操作" align="center" width="55"> <el-table-column label="操作" align="center" width="55">
<template slot-scope="scope"> <template slot-scope="scope">
<i class="el-icon-delete rm" @click="delProject(scope.$index)"></i> <i class="el-icon-delete rm" @click="delProject(scope.$index, scope.row)"></i>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -613,30 +613,28 @@ export default {
const result = [] const result = []
list.map(e => { list.map(e => {
// //
if (!checked.find(n => n.systemId == e.systemId)) { // if (!checked.find(n => n.systemId == e.systemId)) {
e.check = false e.check = false
result.push(e) result.push(e)
} // }
}) })
this.systems = result this.systems = result
list.length && this.getProject(result[0]) result.length && this.getProject(result[0])
}).catch(err => {}) }).catch(err => {})
}, },
// //
getProject(item) { getProject(item) {
const { check } = item // const checked = this.checkeds
const checked = this.permissions ? this.assessmentData : this.practiceData
this.curSystem = item.systemId this.curSystem = item.systemId
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
this.projectAll = JSON.parse(JSON.stringify(res)) // this.projectAll = JSON.parse(JSON.stringify(res)) //
const result = [] const result = []
res.map(e => { res.map(e => {
// e.type = item.type ? '流程类' : '编程类'
if (!checked.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) { //
e.type = item.type ? '流程类' : '编程类' const include = checked.some(n => n.projectId == e.projectId && n.systemId == e.systemId)
e.check = check e.check = include
result.push(e) result.push(e)
}
}) })
this.projects = result this.projects = result
}).catch(err => {}) }).catch(err => {})
@ -651,13 +649,19 @@ export default {
// //
const { projects, checkeds } = this const { projects, checkeds } = this
if (projects.length && projects[0].systemId == item.systemId) { if (projects.length && projects[0].systemId == item.systemId) {
projects.map(e => e.check = val) projects.map(e => {
e.check = val
})
} }
this.projectKeyword = '' this.projectKeyword = ''
this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => { this.$get(`${this.api.getInternalProjectBySystemId}?permissions=${this.permissions}&systemId=${item.systemId}`).then(res => {
if (val) { if (val) {
res.map(e => e.type = item.type ? '流程类' : '编程类') res.map(e => {
checkeds.push(...res) if (!checkeds.find(n => n.projectId == e.projectId && n.systemId == e.systemId)) {
e.type = item.type ? '流程类' : '编程类'
checkeds.push(e)
}
})
} else { } else {
res.map(e => { res.map(e => {
const i = checkeds.findIndex(n => n.projectId == e.projectId && n.systemId == e.systemId) 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)) this.checkeds = this.checkedAll.filter(e => e.projectName.includes(val))
}, },
// //
delProject(i) { delProject(i, e) {
this.$confirm("确定要删除吗?", "提示", { this.$confirm("确定要删除吗?", "提示", {
type: "warning" type: "warning"
}).then(() => { }).then(() => {
this.checkeds.splice(i, 1) this.checkeds.splice(i, 1)
// checkdisabled
if (e.systemId == this.curSystem) {
const { projectId } = e
this.projects.map(n => {
if (n.projectId == projectId) {
n.check = false
}
})
}
}).catch(() => {}) }).catch(() => {})
}, },
// //

@ -156,6 +156,7 @@
:before-filter="beforeFilter" :before-filter="beforeFilter"
:options="rangeList" :options="rangeList"
@change="rangeChange" @change="rangeChange"
@visible-change="rangeViChange"
@input.native="rangeSearch"></el-cascader> @input.native="rangeSearch"></el-cascader>
<el-tag <el-tag
v-for="(tag, i) in rangeChecked" v-for="(tag, i) in rangeChecked"
@ -250,7 +251,7 @@ export default {
e.value = e.provinceId e.value = e.provinceId
e.label = e.provinceName e.label = e.provinceName
e.children = [] e.children = []
e.disabled = !!checked.find(n => n.provinceId == e.provinceId) e.disabled = !!checked.find(n => n.provinceId == e.provinceId && !n.cityId)
data.push(e) data.push(e)
}) })
resolve(data) resolve(data)
@ -265,7 +266,7 @@ export default {
e.value = e.cityId e.value = e.cityId
e.label = e.cityName e.label = e.cityName
e.children = [] 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) data.push(e)
}) })
resolve(data) resolve(data)
@ -282,7 +283,7 @@ export default {
e.value = e.schoolId e.value = e.schoolId
e.label = e.schoolName e.label = e.schoolName
e.leaf = true 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) data.push(e)
}) })
resolve(data) resolve(data)
@ -390,10 +391,17 @@ export default {
const name = [] const name = []
const { rangeChecked } = this const { rangeChecked } = this
checked.map(e => { 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) this.rangeChecked.push(...name)
}, },
//
rangeViChange(e) {
//
if (e) {
this.rangeList = []
}
},
// //
getSchool() { getSchool() {
this.$get(this.api.querySchoolData).then(({ list }) => { this.$get(this.api.querySchoolData).then(({ list }) => {

@ -114,10 +114,13 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>课程权限</span> <span>课程权限</span>
</div> </div>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round <div>
class="mag" <template v-if="!viewDisabled && !renewDisabled && coursePermissions.length">
@click="addCourseJurisdiction()">添加 <el-button v-if="coursePermissions.find(e => !e.ship)" type="primary" round @click="batchDeliver(1, 0)">一键发货</el-button>
</el-button> <el-button v-else type="primary" round @click="batchDeliver(0, 0)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round @click="addCourseJurisdiction()">添加</el-button>
</div>
</div> </div>
<el-table :data="coursePermissions" class="orderTable" stripe header-align="center"> <el-table :data="coursePermissions" class="orderTable" stripe header-align="center">
@ -233,7 +236,7 @@
3处理中的订单显示发货不显示禁用 3处理中的订单显示发货不显示禁用
--> -->
<el-switch <el-switch
v-if="scope.row.status === 1 || !scope.row.ship" v-if="scope.row.status === 1 || dispose || isAdd"
style="margin-right:10px;" style="margin-right:10px;"
v-model="scope.row.ship" v-model="scope.row.ship"
:active-value="1" :active-value="1"
@ -266,9 +269,13 @@
<p class="addhr_tag"></p> <p class="addhr_tag"></p>
<span>数据平台权限</span> <span>数据平台权限</span>
</div> </div>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" <div>
round class="mag" @click="addDataJurisdiction()">添加 <template v-if="!viewDisabled && !renewDisabled && dataPlatformPermissions.length">
</el-button> <el-button v-if="dataPlatformPermissions.find(e => !e.ship)" type="primary" round @click="batchDeliver(1, 1)">一键发货</el-button>
<el-button v-else type="primary" round @click="batchDeliver(0, 1)">取消全部发货</el-button>
</template>
<el-button v-if="!viewDisabled&&!editDisabled&&!renewDisabled" type="primary" round class="mag" @click="addDataJurisdiction()">添加</el-button>
</div>
</div> </div>
<!--:summary-method="getSummaries"--> <!--:summary-method="getSummaries"-->
@ -406,7 +413,7 @@
style="margin-right:10px;" style="margin-right:10px;"
>删除</el-button> >删除</el-button>
<el-switch <el-switch
v-if="scope.row.status === 1 || !scope.row.ship" v-if="scope.row.status === 1 || dispose || isAdd"
style="margin-right:10px;" style="margin-right:10px;"
v-model="scope.row.ship" v-model="scope.row.ship"
:active-value="1" :active-value="1"
@ -966,7 +973,6 @@ export default {
if (e.status === 3) e.isEnable = 0 // if (e.status === 3) e.isEnable = 0 //
return e; return e;
});// });//
console.log(33, list)
this.coursePermissions = list.filter(i => i.authority === 1); this.coursePermissions = list.filter(i => i.authority === 1);
this.dataPlatformPermissions = list.filter(i => i.authority === 0); this.dataPlatformPermissions = list.filter(i => i.authority === 0);
}, },
@ -1350,6 +1356,16 @@ console.log(33, list)
// /- // /-
handleEnable(e, row) { 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) { handleDeliver(e, row) {

Loading…
Cancel
Save