Commit cce53ea7 authored by wangxl's avatar wangxl

333

parent 30f929c0
<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" />
</template>
<script>
//import { specList, getSpecArray } from "@/views/components/common/config"
export default {
name: "cascaderSelect",
data () {
return {
options: [],
paraArray: [],
selected: null,
specArray: [],
loadState: false,
};
},
props: {
......@@ -38,28 +37,35 @@ export default {
},
methods: {
loadSpecList () {
console.log(this.typeId)
let pars = { typeId: this.typeId }
this.$api.parameter.getKnowledgeInfoList2(pars).then(({ data = {} }) => {
if (data) {
this.options = data
this.loadSpecArray()
this.loading = true
}
})
if (!!this.options && this.options.length > 0) {
this.loadParaArray()
} else {
this.$api.parameter.getKnowledgeInfoList2({ typeId: this.typeId }).then(({ data = {} }) => {
if (data) {
this.options = data
this.loadParaArray()
}
})
}
},
loadSpecArray () {
let pars = { typeId: this.typeId }
this.$api.parameter.getSpecArray(pars).then(({ data = {} }) => {
if (data) {
this.specArray = data
if (!!this.value)
this.selected = this.getSpecInfo(this.value)
loadParaArray () {
if (!!this.paraArray && this.paraArray.length > 0) {
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) {
let newArray = this.specArray.filter(
let newArray = this.paraArray.filter(
function (el) {
return el.key == key
}
......@@ -88,8 +94,9 @@ export default {
watch: {
value: {
handler (value) {
if (!!value) {
if (!!value && !this.loadState) {
this.loadSpecList()
this.loadState = true
}
},
},
......
......@@ -152,8 +152,8 @@
<a-col :span="5">
<div class="special-middle">
<div>
<a-form-model-item prop="spec">
<cascader-select v-model="formData.spec" :typeId="69"/>
<a-form-model-item prop="profession">
<cascader-select v-model="formData.profession" :typeId="69"/>
</a-form-model-item>
</div>
</div>
......@@ -571,7 +571,7 @@ export default {
degree: null,
degreeTime: null,
degreeUnit: null,
spec: null,
profession: null,
graduateTeacher: null,
title: null,
politicalParty: null,
......@@ -621,7 +621,7 @@ export default {
degree: [{ required: true, message: '*', trigger: 'change' },],
degreeTime: [{ required: true, message: '*', trigger: 'change' },],
degreeUnit: [{ required: true, message: '*', trigger: 'blur' },],
spec: [{ required: true, message: '*', trigger: 'change' }],
profession: [{ required: true, message: '*', trigger: 'change' }],
graduateTeacher: [{ required: true, message: '*', trigger: 'change' }],
title: [{ required: true, message: '*', trigger: 'change' },],
politicalParty: [{ required: true, message: '*', trigger: 'blur' },],
......@@ -778,7 +778,7 @@ export default {
case 0:
obj = {
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,
appPersonId: null, appUnitId: null, talentCategory: null,
}
......@@ -902,7 +902,6 @@ export default {
this.talentCategoryHolder(null)
},
talentCategoryHolder (talentType) {
console.log(this.formData.talentCategory, this.talentTraningInfo.HTTalent)
if (this.formData.talentCategory === this.talentTraningInfo.HTTalent ||
this.formData.talentCategory === this.talentTraningInfo.RTTalent) {
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