This commit is contained in:
yanran200730
2022-02-10 12:03:25 +08:00
parent de30d29b53
commit d1a7c2fd17
4 changed files with 23 additions and 32 deletions

View File

@@ -1,8 +1,7 @@
<template> <template>
<section class="AppResident"> <section class="AppResident">
<ai-list v-if="!showDetail" isTabs> <ai-list v-if="!showDetail" isTabs>
<ai-title slot="title" title="居民档案" :instance="instance" :hideLevel="hideLevel-1" isShowArea <ai-title slot="title" title="居民档案"></ai-title>
v-model="areaId"/>
<template #tabs> <template #tabs>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane v-for="op in tabs" :key="op.value" :name="op.value" :label="op.label"> <el-tab-pane v-for="op in tabs" :key="op.value" :name="op.value" :label="op.label">

View File

@@ -4,6 +4,8 @@
<template #content> <template #content>
<ai-search-bar> <ai-search-bar>
<template #left> <template #left>
<ai-area-get style="width: 180px;" placeholder="请选择地区" :instance="resident.instance" v-model="search.areaId"
@select="onAreaChange"/>
<ai-select placeholder="档案状态" v-model="search.fileStatus" <ai-select placeholder="档案状态" v-model="search.fileStatus"
:selectList="resident.dict.getDict('fileStatus')" :selectList="resident.dict.getDict('fileStatus')"
@change="page.current=1,refreshTable()"/> @change="page.current=1,refreshTable()"/>
@@ -163,7 +165,6 @@ export default {
name: "listTpl", name: "listTpl",
inject: ['resident'], inject: ['resident'],
props: { props: {
areaId: {default: ""},
active: {default: ""},//人员类型 active: {default: ""},//人员类型
}, },
computed: { computed: {
@@ -176,14 +177,14 @@ export default {
if (this.deleteIds.length) { if (this.deleteIds.length) {
params = { params = {
...params, ...params,
areaId: this.areaId, areaId: this.search.areaId,
ids: this.deleteIds ids: this.deleteIds
} }
} else { } else {
params = { params = {
areaId: this.areaId, areaId: this.search.areaId,
...params, ...params,
...this.search ...this.search.search
} }
} }
return params return params
@@ -203,11 +204,7 @@ export default {
] ]
} }
}, },
watch: {
areaId(v) {
v && this.refreshTable()
}
},
data() { data() {
return { return {
page: {current: 1, size: 10, total: 0}, page: {current: 1, size: 10, total: 0},
@@ -221,6 +218,7 @@ export default {
birthEnd: "", birthEnd: "",
faithType: "", faithType: "",
householdName: "", householdName: "",
areaId: '',
con: "", con: "",
maritalStatus: "" maritalStatus: ""
}, },
@@ -236,6 +234,15 @@ export default {
this.multipleSelection = []; this.multipleSelection = [];
this.searchInit() this.searchInit()
}, },
onAreaChange (e) {
this.search.areaId = e
this.page.current = 1
this.$nextTick(() => {
this.refreshTable()
})
},
searchInit() { searchInit() {
let tempAreaId = this.search.areaId; let tempAreaId = this.search.areaId;
this.search = { this.search = {
@@ -305,7 +312,7 @@ export default {
}, },
refreshTable() { refreshTable() {
this.resident.instance.post(`/app/appresident/list`, null, { this.resident.instance.post(`/app/appresident/list`, null, {
params: {...this.search, ...this.page, areaId: this.areaId, residentType: this.active} params: {...this.search, ...this.page, residentType: this.active}
}).then(res => { }).then(res => {
if (res?.data) { if (res?.data) {
this.tableData = res.data.records this.tableData = res.data.records

View File

@@ -372,7 +372,7 @@
</div> </div>
</div> </div>
<el-form-item label="现住址:" prop="currentAreaId"> <el-form-item label="现住址:" prop="currentAreaId">
<ai-area-select clearable always-show :instance="instance" :disabled-level="disabledLevel" v-model="baseInfo.currentAreaId" <ai-area-select clearable always-show :instance="instance" v-model="baseInfo.currentAreaId"
:valueLevel="4"/> :valueLevel="4"/>
<el-form-item> <el-form-item>
<el-input v-model="baseInfo.currentAddress" placeholder="详细地址" clearable/> <el-input v-model="baseInfo.currentAddress" placeholder="详细地址" clearable/>
@@ -435,8 +435,8 @@
</div> </div>
<el-form-item label="户籍地:" prop="householdAreaId"> <el-form-item label="户籍地:" prop="householdAreaId">
<ai-area-select clearable always-show :instance="instance" v-if="showEdit3" <ai-area-select clearable always-show :instance="instance" v-if="showEdit3"
v-model="baseInfo.householdAreaId" :disabled-level="disabledLevel" :valueLevel="4"/> v-model="baseInfo.householdAreaId" :valueLevel="4"/>
<el-form-item v-if="baseInfo.householdAreaId"> <el-form-item>
<el-input v-model="baseInfo.householdAddress" placeholder="详细地址" clearable/> <el-input v-model="baseInfo.householdAddress" placeholder="详细地址" clearable/>
</el-form-item> </el-form-item>
</el-form-item> </el-form-item>
@@ -722,16 +722,7 @@ export default {
}, trigger: "blur" }, trigger: "blur"
}], }],
currentAddress: [{message: "请选择现住址详细地址", required: true}], currentAddress: [{message: "请选择现住址详细地址", required: true}],
householdAreaId: [
{message: "户籍地必须选到村级", required: true,trigger: "blur"},
{
validator: (r, v, cb) => {
if (/.+0{3}$/.test(v)) {
cb("户籍地必须选到村级")
} else cb()
},trigger: "blur"
}
],
householdName: [ householdName: [
{required: true, message: "请选择是否户主", trigger: "change"} {required: true, message: "请选择是否户主", trigger: "change"}
], ],
@@ -740,9 +731,6 @@ export default {
], ],
householdIdNumber: [ householdIdNumber: [
{required: true, validator: IdNumberPass, trigger: "blur"} {required: true, validator: IdNumberPass, trigger: "blur"}
],
householdAddress: [
{required: true, message: "请选择户籍地详细地址", trigger: "blur"}
] ]
}, },
imgUrl: "", imgUrl: "",
@@ -946,14 +934,11 @@ export default {
} }
}, },
created() { created() {
this.disabledLevel = this.user.info.areaMap[this.user.info.areaId].length;
if (!this.showDetail) { if (!this.showDetail) {
this.showEdit1 = true; this.showEdit1 = true;
this.showEdit2 = true; this.showEdit2 = true;
this.showEdit3 = true; this.showEdit3 = true;
this.showEdit4 = true; this.showEdit4 = true;
this.baseInfo.householdAreaId = JSON.parse(JSON.stringify(this.user.info.areaId))
this.baseInfo.currentAreaId = JSON.parse(JSON.stringify(this.user.info.areaId))
this.$nextTick(() => this.$refs.ruleForm?.resetFields()) this.$nextTick(() => this.$refs.ruleForm?.resetFields())
} else { } else {
this.searchDetail(this.$route.query.id); this.searchDetail(this.$route.query.id);

View File

@@ -370,7 +370,7 @@
</div> </div>
</div> </div>
<el-form-item label="现住址:" prop="currentAreaId"> <el-form-item label="现住址:" prop="currentAreaId">
<ai-area-select clearable always-show :instance="instance" :disabled-level="disabledLevel" v-model="baseInfo.currentAreaId" <ai-area-select clearable always-show :instance="instance" v-model="baseInfo.currentAreaId"
:valueLevel="4"/> :valueLevel="4"/>
<el-form-item> <el-form-item>
<el-input v-model="baseInfo.currentAddress" placeholder="详细地址" clearable/> <el-input v-model="baseInfo.currentAddress" placeholder="详细地址" clearable/>