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