|
|
@ -1,64 +1,88 @@ |
|
|
|
<template> |
|
|
|
<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-item label="姓名" prop="realName"> |
|
|
|
<el-input v-model="dataForm.realName" placeholder="姓名"></el-input> |
|
|
|
<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-item label="姓名" |
|
|
|
prop="realName"> |
|
|
|
<el-input v-model="dataForm.realName" |
|
|
|
placeholder="姓名"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="手机号" prop="mobile"> |
|
|
|
<el-input v-model="dataForm.mobile" placeholder="手机号"></el-input> |
|
|
|
<el-form-item label="手机号" |
|
|
|
prop="mobile"> |
|
|
|
<el-input v-model="dataForm.mobile" |
|
|
|
placeholder="手机号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份证号" prop="identityNo"> |
|
|
|
<el-input v-model="dataForm.identityNo" placeholder="身份证号"></el-input> |
|
|
|
<el-form-item label="身份证号" |
|
|
|
prop="identityNo"> |
|
|
|
<el-input v-model="dataForm.identityNo" |
|
|
|
placeholder="身份证号"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="街道党工委" prop="streetId"> |
|
|
|
<el-select v-model="dataForm.streetId" placeholder="请选择" @change="getCommunityList"> |
|
|
|
<el-option |
|
|
|
v-for="item in streetOptions" |
|
|
|
<el-form-item label="街道党工委" |
|
|
|
prop="streetId"> |
|
|
|
<el-select v-model="dataForm.streetId" |
|
|
|
placeholder="请选择" |
|
|
|
@change="getCommunityList"> |
|
|
|
<el-option v-for="item in streetOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="社区党委" prop="communityId"> |
|
|
|
<el-select v-model="dataForm.communityId" placeholder="请选择" @change="getGridList"> |
|
|
|
<el-option |
|
|
|
v-for="item in communityOptions" |
|
|
|
<el-form-item label="社区党委" |
|
|
|
prop="communityId"> |
|
|
|
<el-select v-model="dataForm.communityId" |
|
|
|
placeholder="请选择" |
|
|
|
@change="getGridList"> |
|
|
|
<el-option v-for="item in communityOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="网格党支部" prop="gridId"> |
|
|
|
<el-select v-model="dataForm.gridId" placeholder="请选择" @change="evaluation"> |
|
|
|
<el-option |
|
|
|
v-for="item in gridOptions" |
|
|
|
<el-form-item label="网格党支部" |
|
|
|
prop="gridId"> |
|
|
|
<el-select v-model="dataForm.gridId" |
|
|
|
placeholder="请选择" |
|
|
|
@change="evaluation"> |
|
|
|
<el-option v-for="item in gridOptions" |
|
|
|
:key="item.id" |
|
|
|
:label="item.name" |
|
|
|
:value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="干部下沉" prop="cadreFlag"> |
|
|
|
<el-select v-model="dataForm.cadreFlag" placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
v-for="item in cadreOptions" |
|
|
|
<el-form-item label="干部下沉" |
|
|
|
prop="cadreFlag"> |
|
|
|
<el-select v-model="dataForm.cadreFlag" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in cadreOptions" |
|
|
|
:key="item.cadreFlag" |
|
|
|
:label="item.cadreTitle" |
|
|
|
:value="item.cadreFlag"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户角色" prop="tagIds"> |
|
|
|
<el-form-item label="用户标签" |
|
|
|
prop="tagIds"> |
|
|
|
<el-checkbox-group v-model="dataForm.tagIds"> |
|
|
|
<el-checkbox v-for="item in tagOptions" :key="item.tagName" :label="item.id">{{item.tagName}}</el-checkbox> |
|
|
|
<el-checkbox v-for="item in tagOptions" |
|
|
|
:key="item.tagName" |
|
|
|
:label="item.id">{{item.tagName}}</el-checkbox> |
|
|
|
</el-checkbox-group> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<template slot="footer"> |
|
|
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button> |
|
|
|
<el-button type="primary" @click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
@click="dataFormSubmitHandle()">{{ $t('confirm') }}</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
</template> |
|
|
@ -86,13 +110,7 @@ export default { |
|
|
|
streetOptions: [], |
|
|
|
communityOptions: [], |
|
|
|
gridOptions: [], |
|
|
|
cadreOptions: [{ |
|
|
|
cadreFlag: '1', |
|
|
|
cadreTitle: '是' |
|
|
|
}, { |
|
|
|
cadreFlag: '0', |
|
|
|
cadreTitle: '否' |
|
|
|
}], |
|
|
|
cadreOptions: [{ cadreFlag: '1', cadreTitle: '是' }, { cadreFlag: '0', cadreTitle: '否' }], |
|
|
|
tagOptions: [] |
|
|
|
} |
|
|
|
}, |
|
|
@ -144,7 +162,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.tagOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getStreetList () { |
|
|
|
this.$http.get(`/sys/dept/sublist/1169154711480528897`).then(({ data: res }) => { |
|
|
@ -152,7 +170,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.streetOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getCommunityList () { |
|
|
|
let choosenItem = this.streetOptions.filter(item => item.id === this.dataForm.streetId)[0] |
|
|
@ -164,7 +182,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.communityOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
getGridList () { |
|
|
|
let choosenItem = this.communityOptions.filter(item => item.id === this.dataForm.communityId)[0] |
|
|
@ -175,7 +193,7 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.gridOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
evaluation () { |
|
|
|
let choosenItem = this.gridOptions.filter(item => item.id === this.dataForm.gridId)[0] |
|
|
@ -197,14 +215,14 @@ export default { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.communityOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
this.$http.get(`/sys/dept/sublist/` + this.dataForm.communityId).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
|
return this.$message.error(res.msg) |
|
|
|
} |
|
|
|
this.gridOptions = res.data |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
// 表单提交 |
|
|
|
dataFormSubmitHandle: debounce(function () { |
|
|
@ -225,7 +243,7 @@ export default { |
|
|
|
this.$emit('refreshDataList') |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}).catch(() => { }) |
|
|
|
}) |
|
|
|
}, 1000, { 'leading': true, 'trailing': false }) |
|
|
|
} |
|
|
|