|
@ -1,5 +1,5 @@ |
|
|
<template> |
|
|
<template> |
|
|
<el-dialog :visible.sync="visible" :title=" $t('add') " :close-on-click-modal="false" :close-on-press-escape="false"> |
|
|
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('update')" :close-on-click-modal="false" :close-on-press-escape="false"> |
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|
|
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmitHandle()" :label-width="$i18n.locale === 'en-US' ? '120px' : '80px'"> |
|
|
<el-form-item label="姓名" prop="name"> |
|
|
<el-form-item label="姓名" prop="name"> |
|
|
<el-input v-model="dataForm.name" placeholder="姓名"></el-input> |
|
|
<el-input v-model="dataForm.name" placeholder="姓名"></el-input> |
|
@ -37,11 +37,12 @@ |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="所属机构" > |
|
|
<el-form-item label="所属网格" prop="ids"> |
|
|
<el-cascader |
|
|
<el-cascader |
|
|
v-model="ids" |
|
|
v-model="dataForm.ids" |
|
|
:options="options" |
|
|
:options="options" |
|
|
clearable |
|
|
clearable |
|
|
|
|
|
@change="changeHandle" |
|
|
style="width:250px;" |
|
|
style="width:250px;" |
|
|
> |
|
|
> |
|
|
</el-cascader> |
|
|
</el-cascader> |
|
@ -109,9 +110,11 @@ export default { |
|
|
updatedTime: '', |
|
|
updatedTime: '', |
|
|
streetId: '', |
|
|
streetId: '', |
|
|
communityId: '', |
|
|
communityId: '', |
|
|
gridId: '' |
|
|
gridId: '', |
|
|
|
|
|
ids:[] |
|
|
}, |
|
|
}, |
|
|
ids:[], |
|
|
ids:[], |
|
|
|
|
|
adminIds:[], |
|
|
options: [], |
|
|
options: [], |
|
|
pairingReason:[], |
|
|
pairingReason:[], |
|
|
sexList: [ |
|
|
sexList: [ |
|
@ -123,6 +126,9 @@ export default { |
|
|
computed: { |
|
|
computed: { |
|
|
dataRule () { |
|
|
dataRule () { |
|
|
return { |
|
|
return { |
|
|
|
|
|
ids: [ |
|
|
|
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
|
|
|
], |
|
|
name: [ |
|
|
name: [ |
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|
|
], |
|
|
], |
|
@ -207,6 +213,28 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
changeHandle(value){ |
|
|
|
|
|
if (value.length === 0) { |
|
|
|
|
|
this.dataForm.streetId = '' |
|
|
|
|
|
this.dataForm.communityId = '' |
|
|
|
|
|
this.dataForm.gridId = '' |
|
|
|
|
|
} |
|
|
|
|
|
if (value.length === 1) { |
|
|
|
|
|
this.dataForm.streetId = this.dataForm.ids[0] |
|
|
|
|
|
this.dataForm.communityId = '' |
|
|
|
|
|
this.dataForm.gridId = '' |
|
|
|
|
|
} |
|
|
|
|
|
if (value.length === 2) { |
|
|
|
|
|
this.dataForm.streetId = this.dataForm.ids[0] |
|
|
|
|
|
this.dataForm.communityId = this.dataForm.ids[1] |
|
|
|
|
|
this.dataForm.gridId = '' |
|
|
|
|
|
} |
|
|
|
|
|
if (value.length === 3) { |
|
|
|
|
|
this.dataForm.streetId = this.dataForm.ids[0] |
|
|
|
|
|
this.dataForm.communityId = this.dataForm.ids[1] |
|
|
|
|
|
this.dataForm.gridId = this.dataForm.ids[2] |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
//获取部门信息 |
|
|
//获取部门信息 |
|
|
getOptions() { |
|
|
getOptions() { |
|
|
this.$http |
|
|
this.$http |
|
@ -255,6 +283,10 @@ export default { |
|
|
} |
|
|
} |
|
|
this.$http['post']('/workRecord/familyinfoacquisition/addFamilyInfo', this.dataForm).then(({ data: res }) => { |
|
|
this.$http['post']('/workRecord/familyinfoacquisition/addFamilyInfo', this.dataForm).then(({ data: res }) => { |
|
|
if (res.code !== 0) { |
|
|
if (res.code !== 0) { |
|
|
|
|
|
this.dataForm.streetId = '' |
|
|
|
|
|
this.dataForm.communityId = '' |
|
|
|
|
|
this.dataForm.gridId = '' |
|
|
|
|
|
this.dataForm.deptInfo='' |
|
|
return this.$message.error(res.msg) |
|
|
return this.$message.error(res.msg) |
|
|
} |
|
|
} |
|
|
this.$message({ |
|
|
this.$message({ |
|
@ -262,8 +294,8 @@ export default { |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
duration: 500, |
|
|
duration: 500, |
|
|
onClose: () => { |
|
|
onClose: () => { |
|
|
this.visible = false |
|
|
this.visible = false |
|
|
this.$emit('refreshDataList') |
|
|
this.$emit('refreshDataList') |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(() => {}) |
|
|
}).catch(() => {}) |
|
|