8 changed files with 576 additions and 37 deletions
@ -0,0 +1,100 @@ |
|||
<template> |
|||
<el-dialog :visible.sync="visible" :title="!dataForm.id ? $t('add') : $t('look')" :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="name"> |
|||
{{ dataForm.name }} |
|||
</el-form-item> |
|||
<el-form-item label="身份证号" prop="idNumber"> |
|||
{{ dataForm.idNumber }} |
|||
</el-form-item> |
|||
<el-form-item label="性别" prop="sex"> |
|||
{{ dataForm.sex }} |
|||
</el-form-item> |
|||
<el-form-item label="出生日期" prop="birthday"> |
|||
{{ dataForm.birthday }} |
|||
</el-form-item> |
|||
<el-form-item label="手机号" prop="mobile"> |
|||
{{ dataForm.mobile }} |
|||
</el-form-item> |
|||
<el-form-item label="民族" prop="nationName"> |
|||
{{ dataForm.nationName }} |
|||
</el-form-item> |
|||
<el-form-item label="户籍地" prop="domicile"> |
|||
{{ dataForm.domicile }} |
|||
</el-form-item> |
|||
<el-form-item label="所在选区" prop="constituencyName"> |
|||
{{ dataForm.constituencyName }} |
|||
</el-form-item> |
|||
<el-form-item label="所在小组" prop="groupCodeName"> |
|||
{{ dataForm.groupName }} |
|||
</el-form-item> |
|||
<el-form-item label="参选原则" prop="participationPrincipleName"> |
|||
{{ dataForm.participationPrincipleName }} |
|||
</el-form-item> |
|||
<el-form-item label="备注" prop="remark"> |
|||
{{ dataForm.remark }} |
|||
</el-form-item> |
|||
<el-form-item label="提交时间" prop="updatedTime"> |
|||
{{ dataForm.updatedTime }} |
|||
</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> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
name: '', |
|||
idNumber: '', |
|||
sex: '', |
|||
birthday: '', |
|||
mobile: '', |
|||
nationNumericalCode: '', |
|||
nationNumericalName: '', |
|||
nationName: '', |
|||
domicile: '', |
|||
constituencyCode: '', |
|||
constituencyName: '', |
|||
groupCode: '', |
|||
participationPrincipleCode: '', |
|||
participationPrincipleName: '', |
|||
remark: '', |
|||
updatedTime: '' |
|||
} |
|||
} |
|||
}, |
|||
computed: { |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/custom/voterregistration/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,183 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-news__voterregistration}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item label="所属选区"> |
|||
<el-select style="width: 150px" v-model="dataForm.constituencyCode" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for="item in constituencyList" |
|||
:key="item.configCode" |
|||
:label="item.configName" |
|||
:value="item.configCode"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="所属小组"> |
|||
<el-select v-model="dataForm.groupCode" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for="item in groupList" |
|||
:key="item.configCode" |
|||
:label="item.configName" |
|||
:value="item.configCode"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="参选原则"> |
|||
<el-select style="width: 150px" v-model="dataForm.participationPrincipleCode" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for="item in participationPrincipleList" |
|||
:key="item.configCode" |
|||
:label="item.configName" |
|||
:value="item.configCode"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="户籍地"> |
|||
<el-input style="width: 150px" v-model="dataForm.domicile" placeholder="请输入户籍地" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="性别"> |
|||
<el-select style="width: 100px" v-model="dataForm.sex" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for="item in sexList" |
|||
:key="item.dictValue" |
|||
:label="item.dictName" |
|||
:value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="姓名"> |
|||
<el-input style="width: 150px" v-model="dataForm.name" placeholder="请输入姓名" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="手机号"> |
|||
<el-input style="width: 150px" v-model="dataForm.mobile" placeholder="请输入手机号" clearable></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="出生日期" prop="startTime"> |
|||
<el-date-picker style="width: 170px" |
|||
v-model="dataForm.startTime" |
|||
type="date" |
|||
:picker-options="pickerBeginDateBefore" |
|||
value-format="yyyy-MM-dd" |
|||
format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item label="至" label-width="25px" prop="endTime"> |
|||
<el-date-picker style="width: 170px" |
|||
v-model="dataForm.endTime" |
|||
type="date" |
|||
:picker-options="pickerBeginDateAfter" |
|||
value-format="yyyy-MM-dd" |
|||
format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
> |
|||
</el-date-picker> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="danger" @click="exportHandle()">{{ $t('export') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;"> |
|||
<el-table-column prop="name" label="姓名" header-align="center" align="center" width="80px" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="idNumber" label="身份证号" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="mobile" label="手机号" header-align="center" align="center" width="110px"></el-table-column> |
|||
<el-table-column prop="domicile" label="户籍地" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="constituencyName" label="所在选区" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="groupName" label="所在小组" header-align="center" align="center" show-overflow-tooltip></el-table-column> |
|||
<el-table-column prop="participationPrincipleName" label="参选原则" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="updatedTime" label="提交时间" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('look') }}</el-button> |
|||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './voterregistration-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/custom/voterregistration/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/custom/voterregistration', |
|||
deleteIsBatch: true, |
|||
exportURL: '/custom/voterregistration/export' |
|||
}, |
|||
dataForm: { |
|||
name: '', |
|||
mobile: '', |
|||
domicile: '', |
|||
constituencyCode: '', |
|||
groupCode: '', |
|||
participationPrincipleCode: '', |
|||
sex: '', |
|||
startTime: '', |
|||
endTime: '' |
|||
}, |
|||
constituencyList: [], |
|||
groupList: [], |
|||
participationPrincipleList: [], |
|||
sexList: [ |
|||
{ dictValue: '1', dictName: '男' }, |
|||
{ dictValue: '0', dictName: '女' } |
|||
] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
created () { |
|||
this.getConstituencyList() |
|||
this.getGroupList() |
|||
this.getParticipationPrincipleList() |
|||
}, |
|||
methods: { |
|||
getConstituencyList () { |
|||
this.$http.get(`/custom/voterregistrationconfig/getConfigByType/0`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.constituencyList = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
getGroupList () { |
|||
this.$http.get(`/custom/voterregistrationconfig/getConfigByType/1`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.groupList = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
getParticipationPrincipleList () { |
|||
this.$http.get(`/custom/voterregistrationconfig/getConfigByType/2`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.participationPrincipleList = res.data |
|||
}).catch(() => {}) |
|||
} |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,159 @@ |
|||
<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="configType"> |
|||
<el-select v-model="dataForm.configType" placeholder="请选择类型" clearable> |
|||
<el-option |
|||
v-for="item in voterRegistrationConfigType" |
|||
:key="item.dictValue" |
|||
:label="item.dictName" |
|||
:value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item v-if="dataForm.configType === '1'" label="所属选区" required> |
|||
<el-select v-model="dataForm.pid" placeholder="请选择所属选区" clearable> |
|||
<el-option |
|||
v-for="item in ssxqList" |
|||
:key="item.id" |
|||
:label="item.configName" |
|||
:value="item.id"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="配置名称" prop="configName"> |
|||
<el-input v-model="dataForm.configName" placeholder="配置名称"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="配置代码" prop="configCode"> |
|||
<el-input v-model="dataForm.configCode" placeholder="配置代码"></el-input> |
|||
</el-form-item> |
|||
<el-form-item label="启用标识" prop="enableFlag"> |
|||
<el-select v-model="dataForm.enableFlag" placeholder="启用标识"> |
|||
<el-option v-for="item in enableFlagArr" :key="item.dictValue" :label="item.dictName" :value="item.dictValue" > |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item label="排序" prop="sort"> |
|||
<el-input-number v-model="dataForm.sort" :min="0"></el-input-number> |
|||
</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> |
|||
</template> |
|||
</el-dialog> |
|||
</template> |
|||
|
|||
<script> |
|||
import debounce from 'lodash/debounce' |
|||
export default { |
|||
data () { |
|||
return { |
|||
visible: false, |
|||
dataForm: { |
|||
id: '', |
|||
pid: '', |
|||
configType: '', |
|||
configName: '', |
|||
configCode: '', |
|||
enableFlag: '1', |
|||
sort: '' |
|||
}, |
|||
voterRegistrationConfigType: [], |
|||
enableFlagArr: [ |
|||
{ dictValue: '1', dictName: '是' }, |
|||
{ dictValue: '0', dictName: '否' } |
|||
], |
|||
ssxqList: [] |
|||
} |
|||
}, |
|||
computed: { |
|||
dataRule () { |
|||
return { |
|||
configType: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
configName: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
configCode: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
], |
|||
enableFlag: [ |
|||
{ required: true, message: this.$t('validate.required'), trigger: 'blur' } |
|||
] |
|||
} |
|||
} |
|||
}, |
|||
methods: { |
|||
init () { |
|||
this.visible = true |
|||
this.$nextTick(() => { |
|||
this.$refs['dataForm'].resetFields() |
|||
this.dataForm.pid = '' |
|||
this.getConfigType() |
|||
this.getConfigByType() |
|||
if (this.dataForm.id) { |
|||
this.getInfo() |
|||
} |
|||
}) |
|||
}, |
|||
// 获取信息 |
|||
getInfo () { |
|||
this.$http.get(`/custom/voterregistrationconfig/${this.dataForm.id}`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.dataForm = { |
|||
...this.dataForm, |
|||
...res.data |
|||
} |
|||
}).catch(() => {}) |
|||
}, |
|||
getConfigByType () { |
|||
this.$http.get(`/custom/voterregistrationconfig/getConfigByType/0`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.ssxqList = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
getConfigType () { |
|||
this.$http.get(`/sys/dict/listSimple/voter_registration_config`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.voterRegistrationConfigType = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
// 表单提交 |
|||
dataFormSubmitHandle: debounce(function () { |
|||
this.$refs['dataForm'].validate((valid) => { |
|||
if (!valid) { |
|||
return false |
|||
} |
|||
if (this.dataForm.configType === '1' && this.dataForm.pid === '') { |
|||
return this.$message.error('请选择所属选区') |
|||
} |
|||
if (this.dataForm.configType !== '1') { |
|||
this.dataForm.pid = '' |
|||
} |
|||
this.$http[!this.dataForm.id ? 'post' : 'put']('/custom/voterregistrationconfig/', this.dataForm).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.$message({ |
|||
message: this.$t('prompt.success'), |
|||
type: 'success', |
|||
duration: 500, |
|||
onClose: () => { |
|||
this.visible = false |
|||
this.$emit('refreshDataList') |
|||
} |
|||
}) |
|||
}).catch(() => {}) |
|||
}) |
|||
}, 1000, { 'leading': true, 'trailing': false }) |
|||
} |
|||
} |
|||
</script> |
@ -0,0 +1,98 @@ |
|||
<template> |
|||
<el-card shadow="never" class="aui-card--fill"> |
|||
<div class="mod-news__voterregistrationconfig}"> |
|||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> |
|||
<el-form-item label="配置类型" prop="configType"> |
|||
<el-select v-model="dataForm.configType" placeholder="请选择" clearable> |
|||
<el-option |
|||
v-for="item in voterRegistrationConfigType" |
|||
:key="item.dictValue" |
|||
:label="item.dictName" |
|||
:value="item.dictValue"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button @click="getDataList()">{{ $t('query') }}</el-button> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
<el-table v-loading="dataListLoading" :data="dataList" border style="width: 100%;"> |
|||
<el-table-column prop="configType" label="配置类型" header-align="center" align="center" :formatter="configTypeFormat"></el-table-column> |
|||
<el-table-column prop="configName" label="配置名称" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="configCode" label="配置代码" header-align="center" align="center"></el-table-column> |
|||
<el-table-column prop="enableFlag" label="启用标识" header-align="center" align="center" :formatter="showEnableFlag"></el-table-column> |
|||
<el-table-column prop="sort" label="排序" header-align="center" align="center"></el-table-column> |
|||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button> |
|||
<el-button type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-pagination |
|||
:current-page="page" |
|||
:page-sizes="[10, 20, 50, 100]" |
|||
:page-size="limit" |
|||
:total="total" |
|||
layout="total, sizes, prev, pager, next, jumper" |
|||
@size-change="pageSizeChangeHandle" |
|||
@current-change="pageCurrentChangeHandle"> |
|||
</el-pagination> |
|||
<!-- 弹窗, 新增 / 修改 --> |
|||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> |
|||
</div> |
|||
</el-card> |
|||
</template> |
|||
|
|||
<script> |
|||
import mixinViewModule from '@/mixins/view-module' |
|||
import AddOrUpdate from './voterregistrationconfig-add-or-update' |
|||
export default { |
|||
mixins: [mixinViewModule], |
|||
data () { |
|||
return { |
|||
mixinViewModuleOptions: { |
|||
getDataListURL: '/custom/voterregistrationconfig/page', |
|||
getDataListIsPage: true, |
|||
deleteURL: '/custom/voterregistrationconfig', |
|||
deleteIsBatch: true |
|||
}, |
|||
dataForm: { |
|||
configType: '' |
|||
}, |
|||
voterRegistrationConfigType: [] |
|||
} |
|||
}, |
|||
components: { |
|||
AddOrUpdate |
|||
}, |
|||
created () { |
|||
this.$http.get(`/sys/dict/listSimple/voter_registration_config`).then(({ data: res }) => { |
|||
if (res.code !== 0) { |
|||
return this.$message.error(res.msg) |
|||
} |
|||
this.voterRegistrationConfigType = res.data |
|||
}).catch(() => {}) |
|||
}, |
|||
methods: { |
|||
configTypeFormat (row, column) { |
|||
if (row.configType) { |
|||
let dict = this.voterRegistrationConfigType.filter(item => item.dictValue === row.configType)[0] |
|||
if (dict) { |
|||
return dict.dictName |
|||
} |
|||
} |
|||
}, |
|||
showEnableFlag (row, column) { |
|||
if (row.enableFlag === '0') { |
|||
return '否' |
|||
} else { |
|||
return '是' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
</script> |
Loading…
Reference in new issue