Browse Source

居民信息分页问题

feature
mk 2 years ago
parent
commit
8b740834e8
  1. 119
      src/views/modules/base/resi.vue

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

@ -12,7 +12,7 @@
<el-col :span="24">
<el-button size="small"
type="primary"
@click="handleSearchFrom">查询</el-button>
@click="handleSearchFrom('search')">查询</el-button>
<el-button style="margin-left: 10px"
size="small"
plain
@ -442,7 +442,8 @@
formCode: 'resident_base_info',
pageNo: currentPage,
pageSize: pageSize,
conditions: conditions,
// conditions: conditions,
...this.searchForm
}"
@close="handleDiyClose"></diy-info>
</el-dialog>
@ -596,6 +597,8 @@ export default {
},
queryConditions: [],
searchForm:{}
};
},
@ -643,7 +646,7 @@ export default {
categoryKey: "resi_info",
},
});
this.getQueryConditions();
// this.getQueryConditions();
},
methods: {
@ -683,83 +686,35 @@ export default {
},
});
},
handleSearchFrom () {
let obj = this.$refs.myResiSearch.form;
let categoryArr = this.$refs.myResiSearch.form.categoryKey;
let agencyId = this.$refs.myResiSearch.form.agencyId;
if (
typeof obj.categoryKey == "object" &&
obj.categoryKey.length != 0
) {
obj.categoryKey = obj.categoryKey.join(",");
} else {
obj.categoryKey = "";
}
if (typeof obj.agencyId == "object" && obj.agencyId.length != 0) {
// obj.agencyId = obj.agencyId.join(",");
obj.agencyId = obj.agencyId[obj.agencyId.length - 1]
} else {
obj.agencyId = "";
}
obj.level = this.$refs.myResiSearch.level ? this.$refs.myResiSearch.level : ''
this.currentPage = 1;
this.getTableData(obj);
let conditions = this.queryConditions
.filter((item) => obj[item.humpName])
.map((item) => {
let queryType = "equal";
const { humpName } = item;
if (
humpName == "name" ||
humpName == "mobile" ||
humpName == "idNum"
) {
queryType = "like";
}
return {
...item,
queryType,
columnValue: [obj[item.humpName]],
};
});
if (obj.birthdayStart || obj.birthdayEnd) {
conditions.push({
queryType: "daterange",
columnValue: [
obj.birthdayStart || "",
obj.birthdayEnd || "",
],
columnName: "BIRTHDAY",
label: "出生日期",
tableName: "resident_base_info",
});
}
if (obj.ageStart || obj.ageEnd) {
let ageStart = obj.ageStart || 0;
let ageEnd = obj.ageEnd || 200;
let currentYear = new Date().getFullYear();
let dateStart = dateFormat(
new Date(new Date().setFullYear(currentYear - ageStart)),
"yyyy-MM-dd"
);
let dateEnd = dateFormat(
new Date(new Date().setFullYear(currentYear - ageEnd)),
"yyyy-MM-dd"
);
conditions.push({
queryType: "daterange",
columnValue: [dateEnd, dateStart],
columnName: "BIRTHDAY",
label: "出生日期",
tableName: "resident_base_info",
});
}
this.conditions = conditions;
console.log(obj, this.conditions);
handleSearchFrom (type) {
// 使
const { categoryKey, agencyId, level } = this.$refs.myResiSearch.form;
//
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form));
// categoryKey
if (Array.isArray(categoryKey) && categoryKey.length) {
_obj.categoryKey = categoryKey.join(",");
} else {
_obj.categoryKey = "";
}
// agencyId
if (Array.isArray(agencyId) && agencyId.length) {
_obj.agencyId = agencyId[agencyId.length - 1];
} else {
_obj.agencyId = "";
}
this.$refs.myResiSearch.form.categoryKey = categoryArr;
this.$refs.myResiSearch.form.agencyId = agencyId;
_obj.level = level || ''; // 使
if(type){
this.currentPage = 1
}
this.getTableData(_obj);
this.searchForm = _obj;
// form
this.$refs.myResiSearch.form.categoryKey = categoryKey;
this.$refs.myResiSearch.form.agencyId = agencyId;
},
//
checkSelectable (row, index) {
@ -809,6 +764,7 @@ export default {
},
async diyExport () {
await this.getExportList();
console.log(this.$refs['']);
},
computedWidth (label, type) {
let wd = "";
@ -908,8 +864,8 @@ export default {
resetSearchForm () {
for (const n in this.$refs.myResiSearch.form) {
this.$refs.myResiSearch.form[n] = "";
}
this.currentPage = 1
this.$refs.myResiSearch.level = ''
this.getTableData();
},
@ -1447,12 +1403,13 @@ export default {
},
async getTableData (obj) {
console.log(this.currentPage);
let params = {
pageNo: this.currentPage,
pageSize: this.pageSize,
...obj,
};
this.tableLoading = true;
const { data } = await this.$http.post(
"/actual/base/residentBaseInfo/page",

Loading…
Cancel
Save