kun 19 11 12 14 55

This commit is contained in:
沈学坤
2019-11-12 14:54:22 +08:00
parent 7d57570097
commit d56cee75c2
6 changed files with 936 additions and 621 deletions

View File

@@ -8,9 +8,9 @@
type="text"
placeholder="请输入组织名称"
v-model.trim="searchVal"
@keyup.enter="getSearch()"
@keyup.enter="globalSearch()"
/>
<label @click="getSearch()">搜索</label>
<label @click="globalSearch()">搜索</label>
</div>
<!-- 分类搜索 -->
<div class="select-box">
@@ -35,14 +35,14 @@
</select>
</div>
<!-- 搜索记录 -->
<div class="record">
<!-- <div class="record">
<template v-for="(item,index) in record">
<div class="list" :key="index" @click="searchRecord(item.nameOf)">
<span>{{item.category + '' + item.nameOf}}</span>
<span class="iconfont icon-cuowu" @click="del(index)"></span>
</div>
</template>
</div>
</div>-->
<!-- 表格 -->
<div class="box-table">
<div class="caption">
@@ -150,11 +150,12 @@ export default {
pageSize: 1,
currentPage: 1,
totalCount: 1,
status: ''
};
},
computed: {},
watch: {
record(newVal, oldVal) { }
// record(newVal, oldVal) { }
},
methods: {
/** 筛选函数 */
@@ -177,14 +178,13 @@ export default {
}
},
/** 删除单条数据 */
del(index) {
let delArr = this.record.splice(index, 1)
},
// del(index) {
// let delArr = this.record.splice(index, 1)
// },
/** 调用搜索函数 */
searchRecord(str) {
this.getSearch(str)
},
// searchRecord(str) {
// this.getSearch(str)
// },
/** 名单切换 */
btn(index) {
let s = this.sub;
@@ -193,17 +193,17 @@ export default {
this.currentPage = 1;
switch (this.sub) {
case 0:
this.getData(this.type_value, this.years[this.year_value], this.year_status);
this.getData(this.type_value, this.years[this.year_value], this.year_status,this.status = '');
break;
case 1: this.getData(this.type_value, this.years[this.year_value], this.year_status, 0);
case 1: this.getData(this.type_value, this.years[this.year_value], this.year_status, this.status = 0);
break;
case 2:
this.getData(this.type_value, this.years[this.year_value], this.year_status, 1);
this.getData(this.type_value, this.years[this.year_value], this.year_status, this.status = 1);
break;
}
},
/** 获取后台数据 */
getData(type = this.type_value, year = this.years[this.year_value], yearStatus = this.year_status, status = '', page = this.currentPage) {
getData(type = this.type_value, year = this.years[this.year_value], yearStatus = this.year_status, status = this.status, page = this.currentPage) {
if (type == "组织类型") {
type = ''
// this.type_value = ''
@@ -219,7 +219,6 @@ export default {
// this.year_status = ''
}
let _this = this
console.log(type);
this.$http({
method: 'post',
@@ -284,33 +283,73 @@ export default {
console.log(err)
})
},
/** 搜索函数 */
getSearch(str) {
/** 本页搜索函数 */
getSearchThisPage() {
this.searchValue = [];
if (this.searchVal === "" && str !== "" && str !== undefined && str !== null && str !== 'null') {
this.searchVal = str
} else if (this.searchVal === "") {
// if (this.searchVal === "" && str !== "" && str !== undefined && str !== null && str !== 'null') {
// this.searchVal = str
// } else if (this.searchVal === "") {
// this.$message.warning("请输入搜索内容");
// return;
// }
if (this.searchVal == "") {
this.$message.warning("请输入搜索内容");
return;
}
let searchData = this.$tool.setSearch(this.bgData, this.searchVal)
console.log(searchData, this.bgData, this.searchVal);
return false;
if (searchData != undefined && searchData != '') {
if (searchData) {
this.searchValue = searchData
this.searchVal = "";
} else {
this.$message('您搜索的内容暂无~')
}
},
/** 全局搜索 */
globalSearch(name = this.searchVal, page = this.currentPage) {
this.$http({
method: 'post',
url: 'v1/society/society',
data: {
name: name,
page: page
}
}).then(res => {
if (res.data.data.code !== 200) {
return;
}
if (res.data.data.data.info.length == 0) {
alert('您所查询的数据暂时没有!')
return;
} else {
this.searchValue = res.data.data.data.info
this.totalCount = res.data.data.data.allPage
// console.log(res);
}
this.page++
})
// eslint-disable-next-line handle-callback-err
.catch(err => {
console.log(err)
})
},
handleSizeChange(val) {
this.pageSize = val;
this.getPackData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData()
if (this.searchValue.length > 0) {
this.globalSearch()
} else {
this.getData()
}
this.getPackData();
},
getPackData() { }