Browse Source

搜索

feature
马魁 3 years ago
parent
commit
c650d900ee
  1. 4
      src/assets/scss/modules/management/list-main.scss
  2. 1
      src/views/components/resiForm.vue
  3. 243
      src/views/components/resiSearch.vue
  4. 153
      src/views/modules/base/resi.vue

4
src/assets/scss/modules/management/list-main.scss

@ -38,6 +38,10 @@
.u-item-width-communitycascader{
width: 141px;
}
// 查询栏人防年龄两个输入框
.u-item-width-resiAge{
width: 67px;
}
.u-item-width-buildcascader{
width: 96px;
}

1
src/views/components/resiForm.vue

@ -1161,6 +1161,7 @@ export default {
if(flag){
return this.form
}
console.log(this.form);
return this.form
},

243
src/views/components/resiSearch.vue

@ -25,6 +25,7 @@
type="date"
size="small"
class="u-item-width-daterange"
value-format="yyyy-MM-dd"
placeholder="开始日期">
</el-date-picker>
<span class="u-data-tag"></span>
@ -32,12 +33,16 @@
v-model="form.birthdayEnd"
type="date"
size="small"
value-format="yyyy-MM-dd"
class="u-item-width-daterange u-data-tag"
placeholder="结束日期">
</el-date-picker>
</el-form-item>
<el-form-item label="居民年龄" >
<el-input v-model="form.ageStart" class="u-item-width-normal" placeholder="请输入" clearable size="small">
<el-input v-model="form.ageStart" class="u-item-width-resiAge" placeholder="请输入" clearable size="small">
</el-input>
<span class="u-data-tag"></span>
<el-input v-model="form.ageEnd" class="u-item-width-resiAge u-data-tag" placeholder="请输入" clearable size="small">
</el-input>
</el-form-item>
<el-form-item label="文化程度" >
@ -75,33 +80,33 @@
</template>
</el-select>
</el-form-item>
<el-form-item prop="agencyIdArray">
<el-form-item >
<span style="width:100px;text-align: right;padding-right:14px;display: inline-block; " >所属组织:</span>
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" v-model="agencyIdArray" :options="orgOptions"
<el-cascader class="u-item-width-normal" size="small" ref="myCascader" v-model="form.agencyId" :options="orgOptions"
:props="orgOptionProps" :show-all-levels="false" @change="handleChangeAgency"></el-cascader>
</el-form-item>
<el-form-item prop="VILLAGE_ID" >
<el-form-item prop="villageId" >
<div class="resi-cell">
<div class="resi-cell-value">
<span style="width:100px;text-align: right;padding-right:14px;display: inline-block; " >所属房屋:</span>
<el-select v-model.trim="form.VILLAGE_ID" placeholder="请选择小区" size="small" filterable clearable
<el-select v-model.trim="form.villageId" placeholder="请选择小区" size="small" filterable clearable
class="u-item-width-communitycascader" @clear="handleClearVillage" @change="handleChangeV">
<el-option v-for="item in optionsV" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="form.BUILD_ID" placeholder="楼号" size="small" filterable clearable
<el-select v-model.trim="form.buildId" placeholder="楼号" size="small" filterable clearable
style="margin-left: 5px" class="u-item-width-buildcascader" :disabled="changeVDisabled" @clear="handleClearBuild"
@change="handleChangeB">
<el-option v-for="item in optionsB" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="form.UNIT_ID" :disabled="changeBDisabled" placeholder="单元" size="small"
<el-select v-model.trim="form.unitId" :disabled="changeBDisabled" placeholder="单元" size="small"
filterable clearable style="margin-left: 5px" class="u-item-width-buildcascader" @click="handleClearDan"
@change="handleChangeD">
<el-option v-for="item in optionsD" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
<el-select v-model.trim="form.HOME_ID" :disabled="changeDDisabled" placeholder="房号" size="small"
<el-select v-model.trim="form.homeId" :disabled="changeDDisabled" placeholder="房号" size="small"
filterable clearable style="margin-left: 5px" class="u-item-width-buildcascader">
<el-option v-for="item in optionsH" :key="item.value" :label="item.label" :value="item.value">
</el-option>
@ -208,31 +213,7 @@ export default {
}
})
let constForm = {
name:'',
mobile:'',
idNum:'',
birthdayStart:'',
birthdayEnd:'',
ageStart:'',
ageEnd:'',
gender:'',
cultureLevel:'',
localResidenceFlag:'',
householdSituation:'',
nation:'',
agencyId:'',
buildId:'',
homeId:'',
unitId:'',
gridId:'',
villageId:'',
categoryKey:[],
remark:'',
GRID_ID: '',
VILLAGE_ID: '',
BUILD_ID: '',
UNIT_ID: '',
HOME_ID: ''
}
let orgOptionProps = {
multiple: false,
@ -278,13 +259,31 @@ export default {
fixedList: [],
constForm,
form: {
...form,
agencyId : '',
name:'',
mobile:'',
idNum:'',
birthdayStart:'',
birthdayEnd:'',
ageStart:'',
ageEnd:'',
gender:'',
cultureLevel:'',
localResidenceFlag:'',
householdSituation:'',
nation:'',
agencyId:'',
buildId:'',
homeId:'',
unitId:'',
gridId:'',
villageId:'',
categoryKey:[],
remark:'',
GRID_ID: '',
VILLAGE_ID: '',
BUILD_ID: '',
UNIT_ID: '',
HOME_ID: ''
villageId: '',
buildId: '',
unitId: '',
homeId: ''
},
tempFormList,
pickerOptions: {
@ -449,13 +448,13 @@ export default {
}
},
changeVDisabled() {
return !this.form.VILLAGE_ID
return !this.form.villageId
},
changeBDisabled() {
return !this.form.BUILD_ID
return !this.form.buildId
},
changeDDisabled() {
return !this.form.UNIT_ID
return !this.form.unitId
},
},
watch: {
@ -513,17 +512,17 @@ export default {
return len == 1 ? 24 : 6
},
handleClearVillage() {
this.form.BUILD_ID = ''
this.form.HOME_ID = ''
this.form.buildId = ''
this.form.homeId = ''
},
handleClearBuild() {
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.buildId = ''
this.form.unitId = ''
this.form.homeId = ''
},
handleClearDan() {
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.unitId = ''
this.form.homeId = ''
},
resetForm(formName) {
for (const n in this.form) {
@ -545,58 +544,58 @@ export default {
// this.handleSearch()
// this.orgOptions = [];
},
handleSearch() {
if (this.showSmartSearchForm) {
let refObj = this.$refs['ref_rule']
refObj.getRule()
} else {
// debugger
// console.log('formmmmm---', this.form)
const itemTypes = ['daterange', 'timerange', 'checkbox']
let a = this.tempFormList.filter(item => item.itemType != 'inputRange')
let arr = a.filter(n => n.isChange).map((item) => {
return {
queryType: item.queryType,
tableName: item.tableName,
columnName: item.columnName,
columnValue: this.form[item.columnName] &&
(itemTypes.includes(item.queryType) ||
itemTypes.includes(item.itemType) || item.multiSelect == 1
? this.form[item.columnName]
: [this.form[item.columnName].toString()])
}
})
const arr2 = arr.filter(item => item.columnValue.length > 0)
let arr1 = this.fixedList
.filter((n) => n.columnValue.length > 0)
.map((item) => {
return {
...item
}
})
var arr4 = []
var arr3 = [...arr1, ...arr2];
if (this.timer.startPickerTime && this.timer.endPickerTime) {
arr4 = [{
queryType: 'daterange',
tableName: 'ic_resi_user',
columnName: 'BIRTHDAY',
columnValue: [this.timer.startPickerTime || '', this.timer.endPickerTime || '']
}]
arr3 = [...arr1, ...arr2, ...arr4]
} else {
let i = arr3.findIndex(item => item.columnName == 'BIRTHDAY')
console.log(i, '标');
arr3 = arr3.splice(i,1)
console.log(arr3);
}
this.$emit('search', arr3)
arr3 = []
return arr3
// handleSearch() {
// if (this.showSmartSearchForm) {
// let refObj = this.$refs['ref_rule']
// refObj.getRule()
// } else {
// // debugger
// // console.log('formmmmm---', this.form)
// const itemTypes = ['daterange', 'timerange', 'checkbox']
// let a = this.tempFormList.filter(item => item.itemType != 'inputRange')
// let arr = a.filter(n => n.isChange).map((item) => {
// return {
// queryType: item.queryType,
// tableName: item.tableName,
// columnName: item.columnName,
// columnValue: this.form[item.columnName] &&
// (itemTypes.includes(item.queryType) ||
// itemTypes.includes(item.itemType) || item.multiSelect == 1
// ? this.form[item.columnName]
// : [this.form[item.columnName].toString()])
// }
// })
// const arr2 = arr.filter(item => item.columnValue.length > 0)
// let arr1 = this.fixedList
// .filter((n) => n.columnValue.length > 0)
// .map((item) => {
// return {
// ...item
// }
// })
// var arr4 = []
// var arr3 = [...arr1, ...arr2];
// if (this.timer.startPickerTime && this.timer.endPickerTime) {
// arr4 = [{
// queryType: 'daterange',
// tableName: 'ic_resi_user',
// columnName: 'BIRTHDAY',
// columnValue: [this.timer.startPickerTime || '', this.timer.endPickerTime || '']
// }]
// arr3 = [...arr1, ...arr2, ...arr4]
// } else {
// let i = arr3.findIndex(item => item.columnName == 'BIRTHDAY')
// console.log(i, '');
// arr3 = arr3.splice(i,1)
// console.log(arr3);
// }
// this.$emit('search', arr3)
// arr3 = []
// return arr3
}
// }
},
// },
handleOpenSearch() {
this.openSearch = !this.openSearch
},
@ -617,49 +616,45 @@ export default {
handleChangeAgency(val) {
let obj = this.$refs["myCascader"].getCheckedNodes()[0].data
if (obj) {
if (obj.level === 'grid') {
this.form.GRID_ID = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.form.agencyId = ''
} else {
this.form.agencyId = this.agencyIdArray.length > 0 ? this.agencyIdArray[this.agencyIdArray.length - 1] : '';
this.form.GRID_ID = ''
}
this.GRID_ID = ''
} else {
this.form.agencyId = ''
this.form.GRID_ID = ''
this.GRID_ID = ''
}
this.form.VILLAGE_ID = ''
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.villageId = ''
this.form.buildId = ''
this.form.unitId = ''
this.form.homeId = ''
this.getValiheList()
},
handleChangeGrid(val) {
console.log('val', val)
this.form.VILLAGE_ID = ''
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.villageId = ''
this.form.buildId = ''
this.form.unitId = ''
this.form.homeId = ''
this.getValiheList()
},
handleChangeV(val) {
console.log('val', val)
this.form.BUILD_ID = ''
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.buildId = ''
this.form.unitId = ''
this.form.homeId = ''
this.getBuildList()
},
handleChangeB(val) {
console.log('val', val)
this.form.UNIT_ID = ''
this.form.HOME_ID = ''
this.form.unitId = ''
this.form.homeId = ''
this.getUniList()
},
handleChangeD(val) {
console.log('val', val)
this.form.HOME_ID = ''
this.form.homeId = ''
this.getHouseList()
},
// form
@ -738,7 +733,7 @@ export default {
const { user } = this.$store.state
this.$http
.post('/gov/org/icneighborhood/neighborhoodoption', {
gridId: this.form.GRID_ID,
gridId: this.GRID_ID,
agencyId: this.form.agencyId ,
// agencyId: user.agencyId
})
@ -757,7 +752,7 @@ export default {
getBuildList() {
this.$http
.post('/gov/org/icbuilding/buildingoption', {
neighborHoodId: this.form.VILLAGE_ID
neighborHoodId: this.form.villageId
})
.then(({ data: res }) => {
if (res.code !== 0) {
@ -774,7 +769,7 @@ export default {
getUniList() {
this.$http
.post('/gov/org/icbuildingunit/unitoption', {
buildingId: this.form.BUILD_ID
buildingId: this.form.buildId
})
.then(({ data: res }) => {
if (res.code !== 0) {
@ -790,7 +785,7 @@ export default {
},
getHouseList() {
this.$http
.post('/gov/org/ichouse/houseoption', { unitId: this.form.UNIT_ID })
.post('/gov/org/ichouse/houseoption', { unitId: this.form.unitId })
.then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)

153
src/views/modules/base/resi.vue

@ -42,23 +42,18 @@
<resi-search ref="myResiSearch" />
<el-row class="resi-search">
<el-col :span="24">
<el-button
size="small"
<el-button size="small"
class="diy-button--blue"
@click="handleSearchFrom"
>查询</el-button
>
@click="handleSearchFrom">查询</el-button>
<!-- -->
<el-button
style="margin-left: 10px"
<el-button style="margin-left:10px"
size="small"
class="diy-button--white"
@click=""
>重置</el-button
>
@click="resetSearchForm">重置</el-button>
<!-- resetSearchForm -->
</el-col>
</el-row>
</div>
<div class="m-table">
@ -174,20 +169,20 @@
{{ scope.row.gender == 1 ? "男" : "女" }}
</div>
<div v-else-if="item.columnName == 'birthday'">
{{ scope.row.birthday.substr(0, 10) }}
{{ scope.row.birthday?scope.row.birthday.substr(0, 10):'' }}
</div>
<div v-else-if="item.columnName == 'idNum'">
{{
{{scope.row.idNum?
`${scope.row.idNum.substr(0, 11)}` +
"******" +
`${scope.row.idNum.substr(16, 2)}`
`${scope.row.idNum.substr(16, 2)}`:''
}}
</div>
<div v-else-if="item.columnName == 'mobile'">
{{
{{scope.row.mobile?
`${scope.row.mobile.substr(0, 3)}` +
"******" +
`${scope.row.mobile.substr(7, 4)}`
`${scope.row.mobile.substr(7, 4)}`:''
}}
</div>
<span v-else>{{ handleFilterSpan(scope.row, item) }}</span>
@ -286,6 +281,7 @@
:visible.sync="dialogVisible"
width="986px"
top="5vh"
height="750px"
append-to-body
class="dialog-h"
:close-on-click-modal="false"
@ -297,7 +293,6 @@
ref="baseForm"
:fixed="true"
:form-list="formList"
:resi-id="editUserId"
@changegroup="handleChangeGroup"
/>
<!-- <div v-if="dialogVisible"
@ -332,7 +327,6 @@
>取消</el-button
>
<el-button
v-if="!editUserId"
type="primary"
size="small"
:loading="btnLoading"
@ -340,15 +334,6 @@
class="diy-button--blue"
>保存</el-button
>
<el-button
v-else
type="primary"
size="small"
:loading="btnLoading"
@click="handleEditSUbmit"
>提交</el-button
>
</div>
</el-dialog>
@ -698,8 +683,15 @@ export default {
},
});
},
handleSearchFrom() {
console.log(this.$refs.myResiSearch.form);
handleSearchFrom(){
let obj = this.$refs.myResiSearch.form
obj.categoryKey = obj.categoryKey.join(',')
obj.agencyId = obj.agencyId.join(',')
this.getTableData(obj)
obj.categoryKey =[]
console.log(obj.categoryKey);
obj.agencyId = []
},
//
checkSelectable(row, index) {
@ -846,9 +838,10 @@ export default {
},
resetSearchForm(formName) {
// for(const n in this.form) {
// this.form[n] = ''
// }
for(let n in this.$refs.myResiSearch.form) {
this.$refs.myResiSearch.form[n] = ''
}
console.log(this.$refs.myResiSearch.form);
this.searchList.forEach((item) => {
this.$refs[`resiSearch${item.itemGroupId}`][0].resetForm();
// console.log('search-----refs', this.$refs[`resiSearch${item.itemGroupId}`])
@ -1051,7 +1044,6 @@ export default {
console.log(tab, event);
},
async handleLook(row) {
this.formName = "居民详情";
console.log(row);
this.lookInfo.userId = row.icResiUserId;
this.lookInfo.gridName = row.GRID_ID;
@ -1067,21 +1059,17 @@ export default {
this.showedPeopleMoreInfo = false;
},
async handleEdit(row) {
// this.disabled = false;
// this.editAgencyId = row.ORG_ID;
this.editUserId = row.resiId;
this.formName = "编辑居民";
this.dialogVisible = true;
// await this.getFormList("edit");
// await this.getrowInfo(row.icResiUserId);
this.disabled = false;
this.editAgencyId = row.ORG_ID;
this.editUserId = row.icResiUserId;
await this.getFormList("edit");
await this.getrowInfo(row.icResiUserId);
},
handlerReset() {
this.$refs.baseForm.resetForm();
},
async handleAdd() {
this.formName = "新增居民";
// await this.getFormList();
this.editUserId = "";
await this.getFormList();
this.dialogVisible = true;
},
async handleChangeGroup(val) {
@ -1184,56 +1172,49 @@ export default {
async handleSUbmit() {
const _baseForm = this.$refs.baseForm.submit_from();
(_baseForm.partyFlag = parseInt(_baseForm.partyFlag)), //
(_baseForm.subsistenceAllowanceFlag = parseInt(
_baseForm.subsistenceAllowanceFlag
)), //
(_baseForm.ensureHouseFlag = parseInt(_baseForm.ensureHouseFlag)), //
(_baseForm.unemployedFlag = parseInt(_baseForm.unemployedFlag)), //
(_baseForm.fertileWomanFlag = parseInt(_baseForm.fertileWomanFlag)), //
(_baseForm.veteranFlag = parseInt(_baseForm.veteranFlag)), //退
(_baseForm.unitedFrontFlag = parseInt(_baseForm.unitedFrontFlag)), //
(_baseForm.petitionOfficerFlag = parseInt(
_baseForm.petitionOfficerFlag
)), //访
(_baseForm.volunteerFlag = parseInt(_baseForm.volunteerFlag)), //
(_baseForm.bereavedPersonFlag = parseInt(_baseForm.bereavedPersonFlag)), //
(_baseForm.tenantFlag = parseInt(_baseForm.tenantFlag)), //
(_baseForm.floatingFlag = parseInt(_baseForm.floatingFlag)), //
(_baseForm.specialCrowdFlag = parseInt(_baseForm.specialCrowdFlag)), //
(_baseForm.oldPeopleFlag = parseInt(_baseForm.oldPeopleFlag)), //
(_baseForm.emptyNesterFlag = parseInt(_baseForm.emptyNesterFlag)), //
(_baseForm.liveAloneFlag = parseInt(_baseForm.liveAloneFlag)), //
(_baseForm.disabledFlag = parseInt(_baseForm.disabledFlag)), //
(_baseForm.dementedFlag = parseInt(_baseForm.dementedFlag)), //
(_baseForm.disabilityFlag = parseInt(_baseForm.disabilityFlag)), //
(_baseForm.seriousIllnessFlag = parseInt(_baseForm.seriousIllnessFlag)), //
(_baseForm.chronicDiseaseFlag = parseInt(_baseForm.chronicDiseaseFlag)); //
if ((_baseForm.hobbyInfoDto.hobbyCode = [])) {
_baseForm.hobbyInfoDto.hobbyCode = "";
_baseForm.partyFlag = parseInt(_baseForm.partyFlag),//
_baseForm.subsistenceAllowanceFlag = parseInt(_baseForm.subsistenceAllowanceFlag), //
_baseForm.ensureHouseFlag = parseInt(_baseForm.ensureHouseFlag), //
_baseForm.unemployedFlag = parseInt(_baseForm.unemployedFlag),//
_baseForm.fertileWomanFlag = parseInt(_baseForm.fertileWomanFlag), //
_baseForm.veteranFlag = parseInt(_baseForm.veteranFlag), //退
_baseForm.unitedFrontFlag = parseInt(_baseForm.unitedFrontFlag),//
_baseForm.petitionOfficerFlag = parseInt(_baseForm.petitionOfficerFlag),//访
_baseForm.volunteerFlag = parseInt(_baseForm.volunteerFlag), //
_baseForm.bereavedPersonFlag = parseInt(_baseForm.bereavedPersonFlag), //
_baseForm.tenantFlag = parseInt(_baseForm.tenantFlag), //
_baseForm.floatingFlag = parseInt(_baseForm.floatingFlag),//
_baseForm.specialCrowdFlag = parseInt(_baseForm.specialCrowdFlag),//
_baseForm.oldPeopleFlag = parseInt(_baseForm.oldPeopleFlag), //
_baseForm.emptyNesterFlag = parseInt(_baseForm.emptyNesterFlag), //
_baseForm.liveAloneFlag = parseInt(_baseForm.liveAloneFlag), //
_baseForm.disabledFlag = parseInt(_baseForm.disabledFlag), //
_baseForm.dementedFlag = parseInt(_baseForm.dementedFlag), //
_baseForm.disabilityFlag = parseInt(_baseForm.disabilityFlag),//
_baseForm.seriousIllnessFlag = parseInt(_baseForm.seriousIllnessFlag), //
_baseForm.chronicDiseaseFlag = parseInt(_baseForm.chronicDiseaseFlag) //
if(_baseForm.hobbyInfoDto.hobbyCode = []) {
_baseForm.hobbyInfoDto.hobbyCode = ''
} else {
_baseForm.hobbyInfoDto.hobbyCode.forEach((element) => {
_baseForm.hobbyInfoDto.hobbyCode =
_baseForm.hobbyInfoDto.hobbyCode + "," + element;
_baseForm.hobbyInfoDto.hobbyCode.forEach(element => {
_baseForm.hobbyInfoDto.hobbyCode = _baseForm.hobbyInfoDto.hobbyCode + ',' + element
});
}
if ((_baseForm.volunteerDto.volunteerCategory = [])) {
_baseForm.volunteerDto.volunteerCategory = "";
if(_baseForm.volunteerDto.volunteerCategory = []) {
_baseForm.volunteerDto.volunteerCategory = ''
} else {
_baseForm.volunteerDto.volunteerCategory.forEach((element) => {
_baseForm.volunteerDto.volunteerCategory =
_baseForm.volunteerDto.volunteerCategory + "," + element;
_baseForm.volunteerDto.volunteerCategory.forEach(element => {
_baseForm.volunteerDto.volunteerCategory = _baseForm.volunteerDto.volunteerCategory + ',' + element
});
}
if ((_baseForm.specialDto.specialCategoryCode = [])) {
_baseForm.specialDto.specialCategoryCode = "";
if(_baseForm.specialDto.specialCategoryCode = []) {
_baseForm.specialDto.specialCategoryCode = ''
} else {
_baseForm.specialDto.specialCategoryCode.forEach((element) => {
_baseForm.specialDto.specialCategoryCode =
_baseForm.specialDto.specialCategoryCode + "," + element;
_baseForm.specialDto.specialCategoryCode.forEach(element => {
_baseForm.specialDto.specialCategoryCode = _baseForm.specialDto.specialCategoryCode + ',' + element
});
}
this.submitAdd(_baseForm);
this.submitAdd(_baseForm)
},
handleDel(row) {
let params = {
@ -1319,11 +1300,13 @@ export default {
this.btnLoading = false;
},
async getTableData() {
async getTableData(keyWord) {
let params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
...keyWord
};
console.log(params);
this.tableLoading = true;
const { data, code, msg } = await requestPost(
"/actual/base/residentBaseInfo/page",
@ -1577,7 +1560,7 @@ export default {
.dialog-h-content {
max-height: calc(83vh - 80px);
box-sizing: border-box;
padding: 50px 80px;
padding: 0 10px 0px 79px;
overflow: auto;
}
}

Loading…
Cancel
Save