Просмотр исходного кода

业务部分分页,模糊搜索重写

zishan-an 1 год назад
Родитель
Сommit
00398b2688

+ 42 - 6
src/api/index.js

@@ -145,18 +145,54 @@ export function findCooperatorFieldsByName(cooperatorName){
     })
 }
 
-export function businessToDoList(){
-    return request.get('/business/businessToDoList');
+export function businessToDoList(pageNum,pageSize){
+    return request.post('/business/businessToDoList',
+        {
+            pageNum:pageNum,
+            pageSize:pageSize,
+        });
 }
 
-export function businessAnalysisList(){
-    return request.get('/business/businessAnalysisList');
+export function selectBusinessToDo(pageNum,pageSize,customerName){
+    return request.post('/business/selectBusinessToDo',
+        {
+            pageNum:pageNum,
+            pageSize:pageSize,
+            customerName:customerName,
+
+        });
 }
 
-export function businessFailList(){
-    return request.get('/business/businessFailList');
+export function businessAnalysisList(pageNum,pageSize){
+    return request.post('/business/businessAnalysisList',        {
+        pageNum:pageNum,
+        pageSize:pageSize,
+    });
 }
+export function selectBusinessAnalysis(pageNum,pageSize,customerName){
+    return request.post('/business/selectBusinessAnalysis',
+        {
+            pageNum:pageNum,
+            pageSize:pageSize,
+            customerName:customerName,
+
+        });
+}
+export function businessFailList(pageNum,pageSize) {
+    return request.post('/business/businessFailList', {
+        pageNum: pageNum,
+        pageSize: pageSize,
+    });
+}
+export function selectBusinessFail(pageNum,pageSize,customerName){
+    return request.post('/business/selectBusinessFail',
+        {
+            pageNum:pageNum,
+            pageSize:pageSize,
+            customerName:customerName,
 
+        });
+}
 export function modelDefineList(){
     return request.get('/model_define/modelDefineList');
 }

+ 67 - 16
src/views/system/businessAnalysis.vue

@@ -31,7 +31,7 @@
 
         <div class="line-between-divs"></div>
 
-        <el-table :data="businessShowData.slice((currentPage-1)*pagesize,currentPage*pagesize)" style="width: 100%;" @row-click="onButtonClick" stripe>
+        <el-table :data="businessShowData" style="width: 100%;" @row-click="onButtonClick" stripe>
           <el-table-column align="center" label="申请编号" >
             <template v-slot="{row}">
               <span>{{ row.businessNum}}</span>
@@ -90,7 +90,7 @@
                         :page-sizes="[5,10,15]"
                         :page-size="pagesize"
                         layout="total,jumper,prev, pager, next,sizes"
-                        :total="businessShowData.length" >
+                        :total=showSize >
         </el-pagination>
       </el-main>
 
@@ -101,7 +101,7 @@
 <script>
 
 import {
-  businessAnalysisList
+  businessAnalysisList, selectBusinessAnalysis,
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -119,8 +119,10 @@ export default {
       activeKey: 0,
       activeName: "second",
       currentPage: 1,
-      pagesize:5,
+      pagesize:10,
       businessData : [],
+      selectBusinessData : [],
+
       businessShowData : [],
 
       selected1: true,
@@ -130,6 +132,8 @@ export default {
       selected5: true,
       selected6: false,
       input:'',
+      showSize:'',
+      totalSize:''
     }
   },
   watch: {},
@@ -139,11 +143,14 @@ export default {
   beforeMount() {},
   mounted() 
   {
-    businessAnalysisList().then(
+    businessAnalysisList(this.currentPage,this.pagesize).then(
         res=>
         {
-          this.businessData=res.data.business_todo_list;
+          this.businessData=res.data.business_analysis_list.list;
           this.businessShowData = this.businessData
+          var j = parseInt(res.data.business_analysis_list.total)
+          this.totalSize = j
+          this.showSize = this.totalSize
         }
     )
   },
@@ -185,9 +192,45 @@ export default {
     },
     handleCurrentChange:function(currentPage){
       this.currentPage=currentPage;
+      if(!this.input){
+        businessAnalysisList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_analysis_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessAnalysis(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.select_business_analysis.list;
+              this.businessShowData = this.selectBusinessData
+            }
+        )
+      }
     },
     handleSizeChange:function(size){
       this.pagesize=size;
+      if(!this.input){
+        businessAnalysisList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_analysis_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessAnalysis(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.select_business_analysis.list;
+              this.businessShowData = this.selectBusinessData
+            }
+        )
+      }
     },
     async getTableData(){
       try {
@@ -254,19 +297,27 @@ export default {
     filterTable(){
 
       if (this.input.trim() === '') {
-        this.businessShowData = this.businessData
+        businessAnalysisList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_analysis_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+        this.showSize = this.totalSize
         // 如果输入框为空,显示所有数据
       } else {
         // 否则,只显示与输入文本匹配的数据
-
-
-        this.businessShowData = this.businessData.filter(item =>
-        {
-          const values = Object.values(item);
-          const str = values.join(' ').toLowerCase();
-          return str.includes(this.input.toLowerCase());
-        });
-
+        selectBusinessAnalysis(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.select_business_analysis.list;
+              this.businessShowData = this.selectBusinessData
+              var j = parseInt(res.data.select_business_analysis.total)
+              this.totalSize = j
+              this.showSize = this.totalSize
+            }
+        )
       }
     },
     

+ 67 - 16
src/views/system/businessFail.vue

@@ -31,7 +31,7 @@
 
         <div class="line-between-divs"></div>
 
-        <el-table :data="businessShowData.slice((currentPage-1)*pagesize,currentPage*pagesize)" style="width: 100%;" @row-click="onButtonClick" stripe>
+        <el-table :data="businessShowData" style="width: 100%;" @row-click="onButtonClick" stripe>
           <el-table-column align="center" label="申请编号">
             <template v-slot="{row}">
               <span>{{ row.businessNum}}</span>
@@ -90,7 +90,7 @@
                         :page-sizes="[5,10,15]"
                         :page-size="pagesize"
                         layout="total,jumper,prev, pager, next,sizes"
-                        :total="businessShowData.length" >
+                        :total=showSize >
         </el-pagination>
       </el-main>
 
@@ -101,7 +101,7 @@
 <script>
 
 import {
-  businessFailList
+  businessFailList,selectBusinessFail
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -119,8 +119,10 @@ export default {
       activeKey: 0,
       activeName: "second",
       currentPage: 1,
-      pagesize:5,
+      pagesize:10,
       businessData : [],
+      selectBusinessData : [],
+
       businessShowData : [],
 
       selected1: true,
@@ -130,6 +132,8 @@ export default {
       selected5: false,
       selected6: true,
       input:'',
+      showSize:'',
+      totalSize:''
     }
   },
   watch: {},
@@ -139,11 +143,14 @@ export default {
   beforeMount() {},
   mounted() 
   {
-    businessFailList().then(
+    businessFailList(this.currentPage,this.pagesize).then(
         res=>
         {
-          this.businessData=res.data.business_todo_list;
+          this.businessData=res.data.business_fail_list.list;
           this.businessShowData = this.businessData
+          var j = parseInt(res.data.business_fail_list.total)
+          this.totalSize = j
+          this.showSize = this.totalSize
         }
     )
   },
@@ -187,9 +194,45 @@ export default {
 
     handleCurrentChange:function(currentPage){
       this.currentPage=currentPage;
+      if(!this.input){
+        businessFailList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_fail_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessFail(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.businessData=res.data.select_business_fail.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
     },
     handleSizeChange:function(size){
       this.pagesize=size;
+      if(!this.input){
+        businessFailList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_fail_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessFail(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.businessData=res.data.select_business_fail.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
     },
     async getTableData(){
       try {
@@ -256,19 +299,27 @@ export default {
     filterTable(){
 
       if (this.input.trim() === '') {
-        this.businessShowData = this.businessData
+        businessFailList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_fail_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+        this.showSize = this.totalSize
         // 如果输入框为空,显示所有数据
       } else {
         // 否则,只显示与输入文本匹配的数据
-
-
-        this.businessShowData = this.businessData.filter(item =>
-        {
-          const values = Object.values(item);
-          const str = values.join(' ').toLowerCase();
-          return str.includes(this.input.toLowerCase());
-        });
-
+        selectBusinessFail(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.businessData=res.data.select_business_fail.list;
+              this.businessShowData = this.businessData
+              var j = parseInt(res.data.select_business_fail.total)
+              this.totalSize = j
+              this.showSize = this.totalSize
+            }
+        )
       }
     },
 

+ 66 - 15
src/views/system/businesstodo.vue

@@ -35,7 +35,7 @@
 
         <div class="line-between-divs"></div>
 
-        <el-table :data="businessShowData.slice((currentPage-1)*pagesize,currentPage*pagesize)" style="width: 100%;" @row-click="onButtonClick" stripe>
+        <el-table :data="businessShowData" style="width: 100%;" @row-click="onButtonClick" stripe>
           <el-table-column align="center" label="申请编号" >
             <template v-slot="{row}">
               <span>{{ row.businessNum}}</span>
@@ -94,7 +94,7 @@
                         :page-sizes="[5,10,15]"
                         :page-size="pagesize"
                         layout="total,jumper,prev, pager, next,sizes"
-                        :total="businessShowData.length" >
+                        :total=showSize >
         </el-pagination>
       </el-main>
 
@@ -107,7 +107,7 @@
 <script>
 
 import {
-  businessToDoList
+  businessToDoList,selectBusinessToDo
 } from '@/api/index.js'
 import store from "@/store";
 import request from '@/utils/request.js'
@@ -127,6 +127,7 @@ export default {
       currentPage: 1,
       pagesize:10,
       businessData : [],
+      selectBusinessData : [],
       businessShowData : [],
       isCollapse: false,
       status:"",
@@ -137,6 +138,8 @@ export default {
       selected5: true,
       selected6: false,
       input:'',
+      showSize:'',
+      totalSize:''
     }
   },
   watch: {},
@@ -146,12 +149,14 @@ export default {
   beforeMount() {},
   mounted()
   {
-    businessToDoList().then(
+    businessToDoList(this.currentPage,this.pagesize).then(
         res=>
         {
-          this.businessData=res.data.business_todo_list;
+          this.businessData=res.data.business_todo_list.list;
           this.businessShowData = this.businessData
-
+          var j = parseInt(res.data.business_todo_list.total)
+          this.totalSize = j
+          this.showSize = this.totalSize
 
         }
     )
@@ -197,9 +202,45 @@ export default {
     },
     handleCurrentChange:function(currentPage){
       this.currentPage=currentPage;
+      if(!this.input){
+        businessToDoList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_todo_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessToDo(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.business_todo_list.list;
+              this.businessShowData = this.selectBusinessData
+            }
+        )
+      }
     },
     handleSizeChange:function(size){
       this.pagesize=size;
+      if(!this.input){
+        businessToDoList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_todo_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+      }
+      else {
+        selectBusinessToDo(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.business_todo_list.list;
+              this.businessShowData = this.selectBusinessData
+            }
+        )
+      }
     },
     async getTableData(){
       try {
@@ -266,18 +307,28 @@ export default {
     filterTable(){
 
       if (this.input.trim() === '') {
-        this.businessShowData = this.businessData
+        businessToDoList(this.currentPage,this.pagesize).then(
+            res=>
+            {
+              this.businessData=res.data.business_todo_list.list;
+              this.businessShowData = this.businessData
+            }
+        )
+        this.showSize = this.totalSize
         // 如果输入框为空,显示所有数据
       } else {
         // 否则,只显示与输入文本匹配的数据
-
-
-        this.businessShowData = this.businessData.filter(item =>
-        {
-            const values = Object.values(item);
-            const str = values.join(' ').toLowerCase();
-            return str.includes(this.input.toLowerCase());
-        });
+        selectBusinessToDo(this.currentPage,this.pagesize,this.input).then(
+            res=>
+            {
+              this.selectBusinessData=res.data.select_business_todo.list;
+              this.businessShowData = this.selectBusinessData
+              var j = parseInt(res.data.select_business_todo.total)
+              this.totalSize = j
+              this.showSize = this.totalSize
+
+            }
+        )
 
       }
     },