Commit cce53ea7 authored by wangxl's avatar wangxl

333

parent 30f929c0
<template> <template>
<!-- <a-cascader v-model="selected" :style="{width:'80%'}" :options="options" v-if="changeOnSelect" :changeOnSelect="changeOnSelect" :show-search="{ filter }" slot-scope="{labels, selectedOptions}" expand-trigger="hover" placeholder="请选择学科代码" @change="onChange" /> -->
<a-cascader v-model="selected" :style="{width:'80%'}" :options="options" :changeOnSelect="changeOnSelect" :show-search="{ filter }" :display-render="displayRender" expand-trigger="hover" placeholder="请选择学科代码" @change="onChange" /> <a-cascader v-model="selected" :style="{width:'80%'}" :options="options" :changeOnSelect="changeOnSelect" :show-search="{ filter }" :display-render="displayRender" expand-trigger="hover" placeholder="请选择学科代码" @change="onChange" />
</template> </template>
<script> <script>
//import { specList, getSpecArray } from "@/views/components/common/config"
export default { export default {
name: "cascaderSelect", name: "cascaderSelect",
data () { data () {
return { return {
options: [], options: [],
paraArray: [],
selected: null, selected: null,
specArray: [], loadState: false,
}; };
}, },
props: { props: {
...@@ -38,28 +37,35 @@ export default { ...@@ -38,28 +37,35 @@ export default {
}, },
methods: { methods: {
loadSpecList () { loadSpecList () {
console.log(this.typeId) if (!!this.options && this.options.length > 0) {
let pars = { typeId: this.typeId } this.loadParaArray()
this.$api.parameter.getKnowledgeInfoList2(pars).then(({ data = {} }) => { } else {
if (data) { this.$api.parameter.getKnowledgeInfoList2({ typeId: this.typeId }).then(({ data = {} }) => {
this.options = data if (data) {
this.loadSpecArray() this.options = data
this.loading = true this.loadParaArray()
} }
}) })
}
}, },
loadSpecArray () { loadParaArray () {
let pars = { typeId: this.typeId } if (!!this.paraArray && this.paraArray.length > 0) {
this.$api.parameter.getSpecArray(pars).then(({ data = {} }) => { if (!!this.value) {
if (data) { this.selected = this.getSpecInfo(this.value)
this.specArray = data
if (!!this.value)
this.selected = this.getSpecInfo(this.value)
} }
}) } else {
this.$api.parameter.getSpecArray({ typeId: this.typeId }).then(({ data = {} }) => {
if (data) {
this.paraArray = data
if (!!this.value) {
this.selected = this.getSpecInfo(this.value)
}
}
})
}
}, },
getSpecInfo (key) { getSpecInfo (key) {
let newArray = this.specArray.filter( let newArray = this.paraArray.filter(
function (el) { function (el) {
return el.key == key return el.key == key
} }
...@@ -88,8 +94,9 @@ export default { ...@@ -88,8 +94,9 @@ export default {
watch: { watch: {
value: { value: {
handler (value) { handler (value) {
if (!!value) { if (!!value && !this.loadState) {
this.loadSpecList() this.loadSpecList()
this.loadState = true
} }
}, },
}, },
......
...@@ -152,8 +152,8 @@ ...@@ -152,8 +152,8 @@
<a-col :span="5"> <a-col :span="5">
<div class="special-middle"> <div class="special-middle">
<div> <div>
<a-form-model-item prop="spec"> <a-form-model-item prop="profession">
<cascader-select v-model="formData.spec" :typeId="69"/> <cascader-select v-model="formData.profession" :typeId="69"/>
</a-form-model-item> </a-form-model-item>
</div> </div>
</div> </div>
...@@ -571,7 +571,7 @@ export default { ...@@ -571,7 +571,7 @@ export default {
degree: null, degree: null,
degreeTime: null, degreeTime: null,
degreeUnit: null, degreeUnit: null,
spec: null, profession: null,
graduateTeacher: null, graduateTeacher: null,
title: null, title: null,
politicalParty: null, politicalParty: null,
...@@ -621,7 +621,7 @@ export default { ...@@ -621,7 +621,7 @@ export default {
degree: [{ required: true, message: '*', trigger: 'change' },], degree: [{ required: true, message: '*', trigger: 'change' },],
degreeTime: [{ required: true, message: '*', trigger: 'change' },], degreeTime: [{ required: true, message: '*', trigger: 'change' },],
degreeUnit: [{ required: true, message: '*', trigger: 'blur' },], degreeUnit: [{ required: true, message: '*', trigger: 'blur' },],
spec: [{ required: true, message: '*', trigger: 'change' }], profession: [{ required: true, message: '*', trigger: 'change' }],
graduateTeacher: [{ required: true, message: '*', trigger: 'change' }], graduateTeacher: [{ required: true, message: '*', trigger: 'change' }],
title: [{ required: true, message: '*', trigger: 'change' },], title: [{ required: true, message: '*', trigger: 'change' },],
politicalParty: [{ required: true, message: '*', trigger: 'blur' },], politicalParty: [{ required: true, message: '*', trigger: 'blur' },],
...@@ -778,7 +778,7 @@ export default { ...@@ -778,7 +778,7 @@ export default {
case 0: case 0:
obj = { obj = {
id: null, reportYear: null, certId: null, personId: null, personName: null, nation: null, sex: null, birthday: null, degree: null, degreeTime: null, id: null, reportYear: null, certId: null, personId: null, personName: null, nation: null, sex: null, birthday: null, degree: null, degreeTime: null,
degreeUnit: null, spec: null, graduateTeacher: null, title: null, politicalParty: null, duty: null, talentType: null, honoraryTitle: null, degreeUnit: null, profession: null, graduateTeacher: null, title: null, politicalParty: null, duty: null, talentType: null, honoraryTitle: null,
holdPost1: null, holdPost2: null, holdPost3: null, mobile: null, fax: null, email: null, completeStatus: null, talentState: null, holdPost1: null, holdPost2: null, holdPost3: null, mobile: null, fax: null, email: null, completeStatus: null, talentState: null,
appPersonId: null, appUnitId: null, talentCategory: null, appPersonId: null, appUnitId: null, talentCategory: null,
} }
...@@ -902,7 +902,6 @@ export default { ...@@ -902,7 +902,6 @@ export default {
this.talentCategoryHolder(null) this.talentCategoryHolder(null)
}, },
talentCategoryHolder (talentType) { talentCategoryHolder (talentType) {
console.log(this.formData.talentCategory, this.talentTraningInfo.HTTalent)
if (this.formData.talentCategory === this.talentTraningInfo.HTTalent || if (this.formData.talentCategory === this.talentTraningInfo.HTTalent ||
this.formData.talentCategory === this.talentTraningInfo.RTTalent) { this.formData.talentCategory === this.talentTraningInfo.RTTalent) {
this.talentTypeId = 23 this.talentTypeId = 23
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment