kun 19 1112 15:54

This commit is contained in:
沈学坤
2019-11-12 15:53:58 +08:00
parent d56cee75c2
commit ef39693c10
2 changed files with 170 additions and 129 deletions

View File

@@ -8,23 +8,23 @@
type="text"
placeholder="请输入组织名称"
v-model.trim="searchVal"
@keyup.enter="globalSearch()"
@keyup.enter="getData()"
/>
<label @click="globalSearch()">搜索</label>
<label @click="getData()">搜索</label>
</div>
<!-- 分类搜索 -->
<div class="select-box">
<select name="type" v-model="type_value" @change="scree()">
<option value="组织类型">组织类型</option>
<template v-for="(type,index) in types">
<option :key="index" :value="index">{{type}}</option>
<template v-for="(type, index) in types">
<option :key="index" :value="index">{{ type }}</option>
</template>
</select>
<select name="year" v-model="year_value" @change="scree()">
<option value="年检时间">年检时间</option>
<template v-for="(year,index) in years">
<option :key="index" :value="index">{{year}}</option>
<template v-for="(year, index) in years">
<option :key="index" :value="index">{{ year }}</option>
</template>
</select>
@@ -47,11 +47,12 @@
<div class="box-table">
<div class="caption">
<span
v-for="(list,index) in text"
v-for="(list, index) in text"
:class="sub == index ? 'color' : ''"
:key="index"
@click="btn(index)"
>{{list}}</span>
>{{ list }}</span
>
</div>
<table>
<tr>
@@ -65,34 +66,42 @@
</tr>
<template v-if="searchValue.length == 0">
<tr
v-for="(info,index) in conversion"
v-for="(info, index) in conversion"
:key="index"
:class="index % 2 == 0 ? 'bgcbz' : 'bgcz'"
class="tr"
>
<td>{{info.name}}</td>
<td>{{info.unicode}}</td>
<td>{{info.society_type}}</td>
<td>{{info.legal_person}}</td>
<td>{{info.reg_time}}</td>
<td v-if="info.status == '白名单'" style="color:#2fd63f">信用良好</td>
<td v-if="info.status == '黑名单'" style="color:#e13232">活动异常</td>
<td>{{ info.name }}</td>
<td>{{ info.unicode }}</td>
<td>{{ info.society_type }}</td>
<td>{{ info.legal_person }}</td>
<td>{{ info.reg_time }}</td>
<td v-if="info.status == '白名单'" style="color:#2fd63f">
信用良好
</td>
<td v-if="info.status == '黑名单'" style="color:#e13232">
活动异常
</td>
</tr>
</template>
<template v-if="searchValue.length > 0">
<tr
class="tr"
v-for="(info,index) in searchValue"
v-for="(info, index) in searchValue"
:key="index"
:class="index % 2 == 0 ? 'bgcbz' : 'bgcz'"
>
<td>{{info.name}}</td>
<td>{{info.unicode}}</td>
<td>{{info.society_type}}</td>
<td>{{info.legal_person}}</td>
<td>{{info.reg_time}}</td>
<td v-if="info.status == '白名单'" style="color:#2fd63f">信用良好</td>
<td v-if="info.status == '黑名单'" style="color:#e13232">活动异常</td>
<td>{{ info.name }}</td>
<td>{{ info.unicode }}</td>
<td>{{ info.society_type }}</td>
<td>{{ info.legal_person }}</td>
<td>{{ info.reg_time }}</td>
<td v-if="info.status == '白名单'" style="color:#2fd63f">
信用良好
</td>
<td v-if="info.status == '黑名单'" style="color:#e13232">
活动异常
</td>
</tr>
</template>
</table>
@@ -139,10 +148,10 @@ export default {
searchValue: [],
record: [],
types: [],
years: '',
year_status: '年检结果',
type_value: '组织类型',
year_value: '年检时间',
years: "",
year_status: "年检结果",
type_value: "组织类型",
year_value: "年检时间",
bgData: [],
arr1: [],
arr0: [],
@@ -150,7 +159,7 @@ export default {
pageSize: 1,
currentPage: 1,
totalCount: 1,
status: ''
status: ""
};
},
computed: {},
@@ -162,19 +171,26 @@ export default {
scree() {
this.currentPage = 1;
if (this.sub == 0) {
this.sub = ''
this.sub = "";
} else if (this.sub == 1) {
this.sub = 0
this.sub = 0;
} else {
this.sub = 1
this.sub = 1;
}
this.getData(this.type_value, this.years[this.year_value], this.year_status, this.sub, this.currentPage);
if (this.sub == '') {
this.sub = 0
this.getData(
this.searchVal,
this.type_value,
this.years[this.year_value],
this.year_status,
this.sub,
this.currentPage
);
if (this.sub == "") {
this.sub = 0;
} else if (this.sub == 0) {
this.sub = 1
this.sub = 1;
} else {
this.sub = 2
this.sub = 2;
}
},
/** 删除单条数据 */
@@ -193,95 +209,124 @@ export default {
this.currentPage = 1;
switch (this.sub) {
case 0:
this.getData(this.type_value, this.years[this.year_value], this.year_status,this.status = '');
this.getData(
this.searchVal,
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, this.status = 0);
case 1:
this.getData(
this.searchVal,
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, this.status = 1);
this.getData(
this.searchVal,
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 = this.status, page = this.currentPage) {
getData(
name = this.searchVal,
type = this.type_value,
year = this.years[this.year_value],
yearStatus = this.year_status,
status = this.status,
page = this.currentPage
) {
if (type == "组织类型") {
type = ''
type = "";
// this.type_value = ''
}
if (year == '年检时间') {
year = ''
if (year == "年检时间") {
year = "";
// this.years[this.year_value] = ''
}
if (yearStatus == '年检结果') {
yearStatus = ''
if (yearStatus == "年检结果") {
yearStatus = "";
// this.year_status = ''
}
let _this = this
let _this = this;
this.$http({
method: 'post',
url: 'v1/society/society',
method: "post",
url: "v1/society/society",
data: {
name: name,
type: type,
year: year,
yearStatus: yearStatus,
status: status,
page: page
}
}).then(res => {
if (res.data.data.code !== 200) {
return;
}
// if (this.page == 1) {
if (res.data.data.data.info.length == 0) {
alert('您所查询的数据暂时没有!')
return;
} else {
_this.conversion = res.data.data.data.info
_this.totalCount = res.data.data.data.allPage
// console.log(_this.conversion);
}
_this.page++
})
.then(res => {
if (res.data.data.code !== 200) {
return;
}
// if (this.page == 1) {
if (res.data.data.data.info.length == 0) {
alert("您所查询的数据暂时没有!");
return;
} else {
_this.conversion = res.data.data.data.info;
_this.totalCount = res.data.data.data.allPage;
// console.log(_this.conversion);
}
_this.page++;
})
// eslint-disable-next-line handle-callback-err
.catch(err => {
console.log(err)
})
console.log(err);
});
// console.log(this.type_value);
if (this.type_value === '') {
this.type_value = '组织类型'
if (this.type_value === "") {
this.type_value = "组织类型";
}
if (this.years[this.year_value] === '') {
this.year_value = '年检时间'
if (this.years[this.year_value] === "") {
this.year_value = "年检时间";
}
if (this.year_status === '') {
this.year_status = '年检结果'
if (this.year_status === "") {
this.year_status = "年检结果";
}
},
/** 获取类型 */
getDataG() {
let _this = this
let _this = this;
this.$http({
method: 'get',
url: 'v1/society/get-type',
method: "get",
url: "v1/society/get-type",
params: {}
}).then(res => {
if (res.data.code !== 200) {
return;
}
_this.types = res.data.data.type
_this.years = res.data.data.year
})
.then(res => {
if (res.data.code !== 200) {
return;
}
_this.types = res.data.data.type;
_this.years = res.data.data.year;
})
// eslint-disable-next-line handle-callback-err
.catch(err => {
console.log(err)
})
console.log(err);
});
},
/** 本页搜索函数 */
getSearchThisPage() {
@@ -299,45 +344,45 @@ export default {
return;
}
let searchData = this.$tool.setSearch(this.bgData, this.searchVal)
let searchData = this.$tool.setSearch(this.bgData, this.searchVal);
console.log(searchData, this.bgData, this.searchVal);
return false;
if (searchData) {
this.searchValue = searchData
this.searchValue = searchData;
this.searchVal = "";
} else {
this.$message('您搜索的内容暂无~')
this.$message("您搜索的内容暂无~");
}
},
/** 全局搜索 */
globalSearch(name = this.searchVal, page = this.currentPage) {
this.$http({
method: 'post',
url: 'v1/society/society',
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++
})
.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)
})
console.log(err);
});
},
handleSizeChange(val) {
this.pageSize = val;
@@ -345,24 +390,20 @@ export default {
},
handleCurrentChange(val) {
this.currentPage = val;
if (this.searchValue.length > 0) {
this.globalSearch()
} else {
this.getData()
}
this.getData();
this.getPackData();
},
getPackData() { }
getPackData() {}
},
created() {
this.getDataG()
this.getData()
this.getDataG();
this.getData();
},
mounted() { }
mounted() {}
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.wrapper {
min-width: 1280px;
box-sizing: border-box;
@@ -392,8 +433,8 @@ export default {
}
/deep/ .el-icon.el-icon-arrow-left::before {
content: '上一页';
font-family: 'MicrosoftYaHei';
content: "上一页";
font-family: "MicrosoftYaHei";
font-size: 12px;
font-weight: normal;
font-stretch: normal;
@@ -410,8 +451,8 @@ export default {
}
/deep/ .el-icon.el-icon-arrow-right::before {
content: '下一页';
font-family: 'MicrosoftYaHei';
content: "下一页";
font-family: "MicrosoftYaHei";
font-size: 12px;
font-weight: normal;
font-stretch: normal;
@@ -434,7 +475,7 @@ export default {
counter-increment: items 1; /* 1 同样可以省略 */
&:before {
content: counter(items);
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 16px;
font-weight: normal;
font-stretch: normal;
@@ -453,7 +494,7 @@ export default {
line-height: 40px;
text-align: center;
height: 40px;
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 16px;
font-weight: normal;
font-stretch: normal;
@@ -503,7 +544,7 @@ export default {
line-height: 40px;
text-align: center;
height: 40px;
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 16px;
font-weight: normal;
font-stretch: normal;
@@ -556,7 +597,7 @@ export default {
display: inline-block;
height: 38px;
text-align: center;
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 20px;
font-weight: normal;
font-stretch: normal;
@@ -580,7 +621,7 @@ export default {
position: relative;
&::after {
content: '';
content: "";
width: 100%;
height: 2px;
background-image: linear-gradient(#e60012, #e60012),
@@ -604,7 +645,7 @@ export default {
border-radius: 4px;
border: solid 1px #c7c7c7;
padding: 10px 24px;
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -631,7 +672,7 @@ export default {
-moz-appearance: none;
-webkit-appearance: none;
/* 右侧添加小箭头的背景图 */
background: url('../../static/img/xa.png') 90% center no-repeat;
background: url("../../static/img/xa.png") 90% center no-repeat;
background-size: 14px 8px;
// width: 170px;
padding: 0 30px;
@@ -645,7 +686,7 @@ export default {
-moz-appearance: none;
-webkit-appearance: none;
/* 右侧添加小箭头的背景图 */
background: url('../../static/img/xa.png') 126px center no-repeat;
background: url("../../static/img/xa.png") 126px center no-repeat;
background-size: 14px 8px;
width: 170px;
height: 38px;
@@ -670,7 +711,7 @@ export default {
margin-bottom: 30px;
input {
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 18px;
font-weight: normal;
font-stretch: normal;
@@ -688,7 +729,7 @@ export default {
width: 96px;
height: 50px;
background-color: #e60012;
font-family: 'MicrosoftYaHei';
font-family: "MicrosoftYaHei";
font-size: 18px;
font-weight: normal;
font-stretch: normal;

View File

@@ -998,12 +998,12 @@ export default {
.then(res => {
if (res.data.code === 200) {
if (res.data.data.status === 0) {
alert("您当前社会状态为:黑名单");
alert("您当前社会组织状态为:活动异常,请与主管单位联系审核");
_this.$router.push({
name: "project"
});
} else if (res.data.data.status === 3) {
alert("您当前社会状态为:审核!");
alert("您当前社会组织状态为:活动异常,请与主管单位联系审核!");
_this.$router.push({
name: "project"
});