<template>
|
<div>
|
<el-form :inline="true" :model="From" class="demo-form-inline" label-width="110px">
|
<el-form-item label="办证状况">
|
<el-select placeholder="请选择" v-model="From.cultName">
|
<el-option v-for="item in cultNameList" :key="item.value"
|
:label="item.label" :value="item.value"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="残疾类别" >
|
<el-select placeholder="请选择" v-model="From.basicSituation">
|
<el-option v-for="item in basicSituationList" :key="item.value"
|
:label="item.label" :value="item.value"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="残疾等级" >
|
<el-select placeholder="请选择" v-model="From.joinCultDate">
|
<el-option v-for="item in joinCultDateList" :key="item.value"
|
:label="item.label" :value="item.value"></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="备注">
|
<el-input type="textarea" v-model="From.remark" placeholder="请输入-不超过200字" maxlength="200" show-word-limit></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="onSubmitdrug('From')">保存</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
props:["selectData",'editId'],
|
data() {
|
return{
|
From:{
|
cultName:'',
|
basicSituation:'',
|
joinCultDate:'',
|
remark:'',
|
populationId:'',
|
id:''
|
},
|
cultNameList:[],
|
basicSituationList:[],
|
joinCultDateList:[]
|
}
|
},
|
|
watch: {
|
selectData (val) {
|
if(val) {
|
this.init();
|
}
|
},
|
editId(val) {
|
this.From.populationId =val;
|
}
|
},
|
|
mounted() {
|
|
/** populationId:获取人口ID */
|
if(this.$route.query.id) {
|
this.From.populationId = this.$route.query.id;
|
this.getDetails();
|
}
|
|
},
|
methods: {
|
/** 获取吸毒信息 populationId:人口id
|
* id:主键id 有id编辑 无id新增 */
|
getDetails() {
|
this.$api.get("population/disability/detail",{populationId:this.From.populationId},e=> {
|
if(e.id) {
|
this.From = e;
|
}
|
})
|
},
|
init() {
|
this.cultNameList = this.selectData.certificateProcessingStatusList.map(d=> {
|
return {
|
label:d.value,
|
value:d.id,
|
}
|
});
|
this.basicSituationList = this.selectData.disabilityCategoryList.map(d=> {
|
return {
|
label:d.value,
|
value:d.id,
|
}
|
});
|
this.joinCultDateList = this.selectData.disabilityLevelList.map(d=> {
|
return {
|
label:d.value,
|
value:+d.id,
|
}
|
});
|
},
|
|
onSubmitdrug(formName) {
|
if(this.From.populationId == '') {
|
return this.$message({
|
message: '请先填写完基础信息',
|
type: 'warning'
|
});
|
}
|
if( this.From.id) {
|
//编辑
|
this.$api.post("population/disability/edit",this.From,e=> {
|
demo.toast("编辑成功")
|
})
|
}else {
|
//新增
|
this.$api.post("population/disability/add",this.From,e=> {
|
demo.toast("保存成功")
|
})
|
}
|
},
|
}
|
}
|
</script>
|
|
<style>
|
|
</style>
|