|
|
|
@ -38,14 +38,13 @@ |
|
|
|
|
<div> |
|
|
|
|
<p class="m-b-20">课程</p> |
|
|
|
|
<div class="inline-input"> |
|
|
|
|
<el-select v-model="form.mallId" |
|
|
|
|
@change="courseChange"> |
|
|
|
|
<el-option v-for="(item, i) in curriculumList" |
|
|
|
|
:key="i" |
|
|
|
|
:label="item.productName" |
|
|
|
|
:value="item.mallId"> |
|
|
|
|
</el-option> |
|
|
|
|
</el-select> |
|
|
|
|
<el-cascader ref="cur" |
|
|
|
|
v-model="mallIds" |
|
|
|
|
:options="curs" |
|
|
|
|
:props="{ checkStrictly: true, value: 'id' }" |
|
|
|
|
popper-class="course-cas" |
|
|
|
|
@expand-change="curChange" |
|
|
|
|
@change="curChange"></el-cascader> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</el-card> |
|
|
|
@ -130,7 +129,8 @@ export default { |
|
|
|
|
data () { |
|
|
|
|
return { |
|
|
|
|
loadIns: null, |
|
|
|
|
curriculumList: [], |
|
|
|
|
mallIds: [], |
|
|
|
|
curs: [], |
|
|
|
|
keyword: '', |
|
|
|
|
projects: [], |
|
|
|
|
page: 1, |
|
|
|
@ -161,38 +161,62 @@ export default { |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
// 获取课程 |
|
|
|
|
getCourse () { |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.$post(this.api.listOfGoods, { |
|
|
|
|
async getCourse () { |
|
|
|
|
const sid = this.$store.state.dataPer.find(e => e.permissionName === '服务配置') |
|
|
|
|
const { serviceList } = await this.$post(this.api.queryServiceConfig, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 1000, |
|
|
|
|
supplierId: sid ? sid.supplierId : '' |
|
|
|
|
}) |
|
|
|
|
const { page } = await this.$post(this.api.listOfGoods, { |
|
|
|
|
pageNum: 1, |
|
|
|
|
pageSize: 10000, |
|
|
|
|
hotTag: 1, |
|
|
|
|
sort: 0, |
|
|
|
|
isAssociatedProduct: 1, |
|
|
|
|
}).then(({ page }) => { |
|
|
|
|
const list = page.records |
|
|
|
|
this.curriculumList = page.records |
|
|
|
|
if (list.length) { |
|
|
|
|
isShelves: 0, |
|
|
|
|
}) |
|
|
|
|
const { records } = page |
|
|
|
|
const { mallId, cid, systemId } = this.form |
|
|
|
|
const first = list[0] |
|
|
|
|
if (records.length) { |
|
|
|
|
serviceList.records.map(e => { |
|
|
|
|
e.id = +e.systemId |
|
|
|
|
e.label = e.systemName |
|
|
|
|
}) |
|
|
|
|
records.map(e => { |
|
|
|
|
e.id = +e.mallId |
|
|
|
|
e.label = e.productName |
|
|
|
|
e.children = serviceList.records.filter(n => e.systemId.split(',').includes(n.systemId)) // 筛选出该课程下的系统 |
|
|
|
|
}) |
|
|
|
|
this.curs = records |
|
|
|
|
|
|
|
|
|
// 查询项目 |
|
|
|
|
const first = records[0] |
|
|
|
|
this.mallIds = [mallId || first.mallId, systemId || first.children[0].id] |
|
|
|
|
this.form.mallId = mallId || first.mallId |
|
|
|
|
this.form.cid = cid || +first.associatedProduct |
|
|
|
|
this.sysId = systemId || +first.systemId |
|
|
|
|
this.form.systemId = systemId || first.systemId |
|
|
|
|
this.sysId = systemId || first.systemId |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.getProject() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.courseChange() |
|
|
|
|
}).catch(err => { |
|
|
|
|
this.loadIns.close() |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 课程选择回调 |
|
|
|
|
courseChange (val) { |
|
|
|
|
const { systemId, associatedProduct } = this.curriculumList.find(e => e.mallId == this.form.mallId) |
|
|
|
|
this.sysId = systemId |
|
|
|
|
this.form.cid = associatedProduct |
|
|
|
|
if (val) this.loadIns = Loading.service() |
|
|
|
|
curChange (val) { |
|
|
|
|
const id = val[0] |
|
|
|
|
const item = this.curs.find(e => e.id == id) |
|
|
|
|
if (val.length === 1) { |
|
|
|
|
// 如果选择的是课程,则默认选中下面第一个系统 |
|
|
|
|
this.mallIds = [id, item.children[0].id] |
|
|
|
|
} |
|
|
|
|
this.form.mallId = id |
|
|
|
|
this.form.cid = +item.associatedProduct |
|
|
|
|
this.form.systemId = this.mallIds[1] |
|
|
|
|
this.sysId = this.mallIds[1] |
|
|
|
|
this.loadIns = Loading.service() |
|
|
|
|
this.getProject() |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// 查询项目 |
|
|
|
|
getProject () { |
|
|
|
|
this.$post(this.api.getProjectAssessmentByCompetition, { |
|
|
|
@ -226,10 +250,7 @@ export default { |
|
|
|
|
form, |
|
|
|
|
curStep |
|
|
|
|
}) |
|
|
|
|
const item = this.curriculumList.find(e => e.cid == this.form.cid) || {} // 获取选中课程中的系统id |
|
|
|
|
let systemId = item.sysId || '1' |
|
|
|
|
systemId = systemId.split(',')[0] // 系统id可能是多个,逗号分割的,所以处理成数组 |
|
|
|
|
this.$router.push(`/projectList?systemId=${systemId}&show=1&name=${item.sysName.split(',')[0]}`) |
|
|
|
|
this.$router.push(`/projectList?systemId=${this.mallIds[1]}&show=1&name=${this.$refs.cur.getCheckedNodes()[0].label}`) |
|
|
|
|
}, |
|
|
|
|
// 时间选择回调 |
|
|
|
|
timeChange (val) { |
|
|
|
|