123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355 |
- <template>
- <div>
- <div class="group-list">
- <div class="group-title">
- <div>团组列表</div>
- <div class="group-box">
- <el-select v-model="value" clearable placeholder="请选择" @change="filterStatus(value)">
- <el-option
- v-for="item in options"
- :key="item.value"
- :label="item.label"
- :value="item.value">
- </el-option>
- </el-select>
- <el-input
- style="width:200px;"
- @input="Inquireclick()"
- placeholder="请输入查询内容"
- v-model="input"
- clearable>
- </el-input>
- <el-button @click="Inquireclick()" type="primary"><i class="icon-sousuo"></i></el-button>
- </div>
- </div>
- <template>
- <el-table
- :data="groupDatas.slice((currentPage-1)*pageSize,currentPage*pageSize)"
- border
- style="width: 100%">
- <el-table-column
- prop="num"
- label="序 号"
- width="55">
- <template slot-scope="scope">
- {{(currentPage - 1) * pageSize + scope.$index + 1}}
- </template>
- </el-table-column>
- <el-table-column
- prop="tourCode"
- width="100"
- label="团 号">
- </el-table-column>
- <el-table-column
- width="100"
- prop="salesQuoteNo"
- label="销售报价号">
- </el-table-column>
- <el-table-column
- prop="teamType"
- label="团组类型"
- width="150">
- </el-table-column>
- <el-table-column
- prop="teamLev"
- label="级 别"
- width="80">
- </el-table-column>
- <el-table-column
- prop="teamName"
- label="团队名称"
- width="200">
- </el-table-column>
- <el-table-column
- prop="clientName"
- label="客户名称"
- width="100">
- </el-table-column>
- <el-table-column
- prop="clientUnit"
- label="客户单位"
- width="200">
- </el-table-column>
- <el-table-column
- prop="visitDate"
- :formatter="filteryear"
- label="出访时间"
- width="100">
- </el-table-column>
- <el-table-column
- prop="visitDays"
- label="出访天数"
- width="80">
- </el-table-column>
- <el-table-column
- prop="visitPNumber"
- label="出访人数"
- width="80">
- </el-table-column>
- <el-table-column
- prop="jietuanOperator"
- label="接团操作人"
- width="110">
- </el-table-column>
- <el-table-column label="操作">
- <template slot-scope="scope">
- <el-button
- size="mini"
- @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
- <el-button
- size="mini"
- type="danger"
- @click="handleDelete(scope.$index, scope.row)">删除</el-button>
- </template>
- </el-table-column>
- </el-table>
- </template>
- <div class="block">
- <el-pagination align='center'
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10,12,15,20]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next"
- :total="groupDatas.length">
- </el-pagination>
- </div>
- </div>
- </div>
- </template>
- <script>
- import { co, el } from '@fullcalendar/core/internal-common';
- export default {
- data() {
- return {
- options: [
- {
- value: '0',
- label: '全部'
- }, {
- value: '1',
- label: '已完成'
- }, {
- value: '2',
- label: '未完成'
- }
- ],
- value: '0',
- groupDatas:[],
- groupData: [
-
- ],
- groupDatass:[],
- currentPage: 1, // 当前页码
- pageSize: 12 ,// 每页的数据条数
- input:'',
- token:''
- }
- },
- methods:{
- //每页条数改变时触发 选择一页显示多少行
- handleSizeChange(val) {
- this.currentPage = 1;
- this.pageSize = val;
- },
- //当前页改变时触发 跳转其他页
- handleCurrentChange(val) {
- this.currentPage = val;
- },
- Inquireclick(){
- console.log(this.groupDatass)
- var newarr=[];
- if(this.input==""){
- if(this.value=="0"){
- console.log(123)
- 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.groupDatas=newarr;
- },
- //
- Grouplist(){
- var url="/api/Group"
- var that=this
- 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)
- }
- })
- },
- filteryear(val){
- let gstime=val.visitDate.split('T')[0]
- return gstime;
- },
- //筛选状态
- filterStatus(val){
- console.log(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.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.groupDatas=newgroup
- this.groupDatass=newgroup
- this.Inquireclick()
- }
- },
- //编辑
- handleEdit(index, row) {
- console.log(index, row.id);
- },
- //删除
- handleDelete(index, row) {
- console.log(index, row.id);
- }
- },
- mounted(){
- this.token=JSON.parse(localStorage.getItem('userinif')).token;
- console.log(this.token)
- this.Grouplist();
- }
- }
- </script>
- <style>
- .group-list{
- background-color: #fff;
- padding: 10px;
- box-shadow: 0 0 5px #0005;
- border-radius: 10px;
- min-width: 1525px;
- }
- .group-title{
- display: flex;
- font-size: 17px;
- font-weight:600 ;
- color: #555;
- margin-top: 8px;
- margin-bottom: 2px;
- justify-content: space-between;
- align-items: center;
- }
- .group-box{
- display: flex;
- }
- .group-box>button{
- margin-left: 10px;
- padding: 8px 20px;
- }
- .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf{
- text-align: center;
- }
- .group-box>.el-input{
- margin-left: 10px;
- }
- </style>
|