|
@@ -1,9 +1,8 @@
|
|
|
<template>
|
|
|
<div v-loading="fullscreenLoading">
|
|
|
<div class="group-list">
|
|
|
- <div class="group-title">
|
|
|
- <div>团组列表</div>
|
|
|
- <div class="group-box">
|
|
|
+ <div class="group-box">
|
|
|
+ <div>
|
|
|
<el-select v-model="value" clearable placeholder="请选择" @change="filterStatus(value)">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -14,17 +13,22 @@
|
|
|
</el-select>
|
|
|
<el-input
|
|
|
style="width:200px;"
|
|
|
- @input="Inquireclick()"
|
|
|
placeholder="请输入查询内容"
|
|
|
v-model="input"
|
|
|
clearable>
|
|
|
</el-input>
|
|
|
+ <el-button @click="Inquireclick()" type="primary">查 询</el-button>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
<el-button @click="addgroup()" type="primary">新增团组</el-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="group-title">
|
|
|
+ <div>团组列表</div>
|
|
|
+ </div>
|
|
|
<template>
|
|
|
<el-table
|
|
|
- :data="groupDatas.slice((currentPage-1)*pageSize,currentPage*pageSize)"
|
|
|
+ :data="groupDatas"
|
|
|
border
|
|
|
style="width: 100%">
|
|
|
<el-table-column
|
|
@@ -119,7 +123,7 @@
|
|
|
:page-sizes="[10,12,15,20]"
|
|
|
:page-size="pageSize"
|
|
|
layout="total, sizes, prev, pager, next"
|
|
|
- :total="groupDatas.length">
|
|
|
+ :total="count">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -131,22 +135,23 @@ export default {
|
|
|
return {
|
|
|
options: [
|
|
|
{
|
|
|
- value: '0',
|
|
|
+ value: '-1',
|
|
|
label: '全部'
|
|
|
}, {
|
|
|
- value: '1',
|
|
|
+ value: '0',
|
|
|
label: '已完成'
|
|
|
}, {
|
|
|
- value: '2',
|
|
|
+ value: '1',
|
|
|
label: '未完成'
|
|
|
}
|
|
|
],
|
|
|
- value: '0',
|
|
|
+ value: '-1',
|
|
|
groupDatas:[],
|
|
|
groupData: [],
|
|
|
groupDatass:[],
|
|
|
+ count:0,//总条数
|
|
|
currentPage: 1, // 当前页码
|
|
|
- pageSize: 12 ,// 每页的数据条数
|
|
|
+ pageSize: 10 ,// 每页的数据条数
|
|
|
input:'',
|
|
|
token:'',
|
|
|
fullscreenLoading:false,
|
|
@@ -154,167 +159,58 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
+ //分页api
|
|
|
+ PostGroupPageList(){
|
|
|
+ var url = "/api/Groups/PostGroupPageList"
|
|
|
+ var that = this
|
|
|
+ this.$axios({
|
|
|
+ method: 'post',
|
|
|
+ url: url,
|
|
|
+ headers: {
|
|
|
+ Authorization: 'Bearer ' + this.token
|
|
|
+ },
|
|
|
+ data: {
|
|
|
+ portType: 1,
|
|
|
+ pageIndex: that.currentPage,
|
|
|
+ pageSize: that.pageSize,
|
|
|
+ isSure: that.value,
|
|
|
+ searchCriteria: that.input,
|
|
|
+ }
|
|
|
+ }).then(function (res) {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ that.groupDatas=res.data.data
|
|
|
+ that.count=res.data.count
|
|
|
+ }
|
|
|
+ console.log(that.count)
|
|
|
+ })
|
|
|
+ },
|
|
|
//每页条数改变时触发 选择一页显示多少行
|
|
|
handleSizeChange(val) {
|
|
|
this.currentPage = 1;
|
|
|
this.pageSize = val;
|
|
|
+ this.PostGroupPageList()
|
|
|
},
|
|
|
//当前页改变时触发 跳转其他页
|
|
|
handleCurrentChange(val) {
|
|
|
this.currentPage = val;
|
|
|
+ this.PostGroupPageList()
|
|
|
},
|
|
|
Inquireclick(){
|
|
|
- var newarr=[];
|
|
|
- if(this.input==""){
|
|
|
- if(this.value=="0"){
|
|
|
- newarr=this.groupData;
|
|
|
- }else{
|
|
|
- newarr=this.groupDatass;
|
|
|
- }
|
|
|
- }else{
|
|
|
- for(var i=0;i<this.groupDatas.length;i++){
|
|
|
- if(this.groupDatas[i].clientName.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].clientUnit.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].jietuanOperator.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].salesQuoteNo.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].teamLev.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].teamName.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].teamType.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- else if(this.groupDatas[i].tourCode.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }else if(this.groupDatas[i].visitDate.indexOf(this.input)!=-1){
|
|
|
- newarr.push(this.groupDatas[i]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
this.currentPage=1;
|
|
|
- this.groupDatas=newarr;
|
|
|
+ this.PostGroupPageList()
|
|
|
},
|
|
|
addgroup(){
|
|
|
this.$router.push({path: '/home/Groupedit'});
|
|
|
},
|
|
|
- //
|
|
|
- Grouplist(){
|
|
|
- var url="/api/Groups/GetGroupList"
|
|
|
- var that=this
|
|
|
- that.fullscreenLoading = true;
|
|
|
- this.$axios({
|
|
|
- method: 'post',
|
|
|
- url:url,
|
|
|
- headers:{
|
|
|
- Authorization:'Bearer '+this.token
|
|
|
- },
|
|
|
- data:{
|
|
|
- portType: 1,
|
|
|
- }
|
|
|
- }).then(function(res){
|
|
|
- if(res.data.code==200){
|
|
|
- that.groupData=res.data.data
|
|
|
- that.groupData.forEach(item=>{
|
|
|
- if(item.clientName==null){
|
|
|
- item.clientName = ''
|
|
|
- }
|
|
|
- if(item.clientUnit==null){
|
|
|
- item.clientUnit = ''
|
|
|
- }
|
|
|
- if(item.id==null){
|
|
|
- item.id = ''
|
|
|
- }
|
|
|
- if(item.isSure==null){
|
|
|
- item.isSure = ''
|
|
|
- }
|
|
|
- if(item.jietuanOperator==null){
|
|
|
- item.jietuanOperator = ''
|
|
|
- }
|
|
|
- if(item.salesQuoteNo==null){
|
|
|
- item.salesQuoteNo = ''
|
|
|
- }
|
|
|
- if(item.teamName==null){
|
|
|
- item.teamName = ''
|
|
|
- }
|
|
|
- if(item.teamType==null){
|
|
|
- item.teamType = ''
|
|
|
- }
|
|
|
- if(item.tourCode==null){
|
|
|
- item.tourCode = ''
|
|
|
- }
|
|
|
- if(item.visitDate==null){
|
|
|
- item.visitDate = ''
|
|
|
- }
|
|
|
- if(item.visitDays==null){
|
|
|
- item.visitDays = ''
|
|
|
- }
|
|
|
- if(item.visitPNumber==null){
|
|
|
- item.visitPNumber = ''
|
|
|
- }
|
|
|
- })
|
|
|
- that.groupDatas=that.groupData;
|
|
|
- console.log(that.groupData)
|
|
|
- that.fullscreenLoading = false;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
filteryear(val){
|
|
|
let gstime=val.visitDate.split(' ')[0]
|
|
|
return gstime;
|
|
|
},
|
|
|
//筛选状态
|
|
|
- filterStatus(val){
|
|
|
- var newgroup=[];
|
|
|
- if(this.input==""){
|
|
|
- if(val=="0"||val==""){
|
|
|
- newgroup=this.groupData;
|
|
|
- }else if(val=="1"){
|
|
|
- for(var j=0;j<this.groupData.length;j++){
|
|
|
- if(this.groupData[j].isSure==1){
|
|
|
- newgroup.push(this.groupData[j])
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(val=="2"){
|
|
|
- for(var j=0;j<this.groupData.length;j++){
|
|
|
- if(this.groupData[j].isSure==0){
|
|
|
- newgroup.push(this.groupData[j])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.currentPage=1;
|
|
|
- this.groupDatas=newgroup
|
|
|
- this.groupDatass=newgroup
|
|
|
- }else{
|
|
|
- if(val=="0"||val==""){
|
|
|
- newgroup=this.groupData
|
|
|
- }else if(val=="1"){
|
|
|
- for(var j=0;j<this.groupData.length;j++){
|
|
|
- if(this.groupData[j].isSure==1){
|
|
|
- newgroup.push(this.groupData[j])
|
|
|
- }
|
|
|
- }
|
|
|
- }else if(val=="2"){
|
|
|
- for(var j=0;j<this.groupData.length;j++){
|
|
|
- if(this.groupData[j].isSure==0){
|
|
|
- newgroup.push(this.groupData[j])
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- this.currentPage=1;
|
|
|
- this.groupDatas=newgroup
|
|
|
- this.groupDatass=newgroup
|
|
|
- this.Inquireclick()
|
|
|
- }
|
|
|
+ filterStatus(){
|
|
|
+ this.currentPage=1;
|
|
|
+ this.PostGroupPageList()
|
|
|
},
|
|
|
//编辑
|
|
|
handleEdit(index, row,rows) {
|
|
@@ -414,7 +310,7 @@ export default {
|
|
|
mounted(){
|
|
|
this.token=JSON.parse(localStorage.getItem('userinif')).token;
|
|
|
this.userid=JSON.parse(localStorage.getItem('userinif')).userInfo.userId;
|
|
|
- this.Grouplist();
|
|
|
+ this.PostGroupPageList();
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
@@ -437,6 +333,7 @@ export default {
|
|
|
}
|
|
|
.group-box{
|
|
|
display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
}
|
|
|
.group-box>button{
|
|
|
margin-left: 10px;
|