瀏覽代碼

单证【订单数据】分页器修改

liangy 3 年之前
父節點
當前提交
59a078c31d

+ 8 - 3
src/api/reportForms/supply-capacity-table.js

@@ -4,8 +4,13 @@ import { getAction } from '@/api/manage'
 
 const supplyCapList = params => getAction('/scas/supplierCapacity/list', params)
 
+//合并导出
+const handleXls = params => getAction('/scas/supplierCapacity/excel98888888888', params)
+
 //月份供应商合计导出
-const monthlySupplyXls = params => getAction('/scas/supplierCapacity/excel3', params)
+const monthSupplyXls = params => getAction('/scas/supplierCapacity/excel3', params)
+
+// 月份部门合计导出
+const monthDepartXls = params => getAction('/scas/supplierCapacity/excel2', params)
 
-//
-export { supplyCapList, monthlySupplyXls }
+export { supplyCapList, handleXls, monthSupplyXls, monthDepartXls }

+ 18 - 9
src/views/order/orderDetailDrawer.vue

@@ -1,12 +1,6 @@
 <template>
   <!-- 订单数据 详情 -->
-  <a-drawer
-    title="详情"
-    width="89%"
-    placement="right"
-    :closable="true"
-    :visible="visible"
-    @close="onClose">
+  <a-drawer title="详情" width="89%" placement="right" :closable="true" :visible="visible" @close="onClose">
     <!--主表信息 -->
     <a-card :bordered="true">
       <div class="table-page-search-wrapper">
@@ -148,7 +142,7 @@
         bordered
         :columns="childColumns"
         :data-source="childData"
-        :pagination="ipagination"
+        :pagination="pagination"
         :loading="loading"
         :scroll="{ x: 1500 }"
         @change="handleTableChange"
@@ -223,7 +217,12 @@ export default {
       orderDetail: [], // 主表信息
       childData: [], // 子表数据
       loading: false, // 表格加载
-
+      // 分页
+      pagination: {
+        // total: '',
+        // current: 0,
+        // pageSize: 0
+      },
       dateFormat: 'YYYY-MM-DD'
     }
   },
@@ -233,6 +232,16 @@ export default {
     onClose() {
       // 关闭抽屉
       this.visible = false
+    },
+    // 分页变化时触发
+    handleTableChange(pagination, filters, sorter) {
+      console.log('分页器信息', pagination)
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
+      }
+      this.queryParam.pageNo = pagination.current
+      // this.getOrderList()
     }
   },
   computed: {},

+ 17 - 11
src/views/order/orderList.vue

@@ -69,7 +69,7 @@
         <a-button type="primary" @click="synchronization" icon="reload">同步</a-button>
       </div>
 
-      <!-- 主表信息  rowKey="id" -->
+      <!-- 主表信息  rowKey="id"  :pagination="ipagination" -->
       <div>
         <a-table
           bordered
@@ -77,7 +77,7 @@
           :columns="orderLIstColumns"
           :data-source="orderListData"
           :loading="loading"
-          :pagination="ipagination"
+          :pagination="pagination"
           :scroll="{ x: 1500 }"
           @change="handleTableChange"
         >
@@ -89,7 +89,7 @@
       </div>
     </a-card>
     <!-- 订单数据明细 抽屉 -->
-    <orderDetail-drawer ref="orderDetailDrawer" :father="aa" @ok="modalFormOk"></orderDetail-drawer>
+    <orderDetail-drawer ref="orderDetailDrawer" @ok="modalFormOk"></orderDetail-drawer>
   </div>
 </template>
 
@@ -191,14 +191,13 @@ export default {
         customerAbbreviation: '',
         account: '',
         dilivery: '',
-        pageNo: '', // 初始页
-        pageSize: '-1' // 每页显示条数
+        pageNo: '' // 初始页
       },
       // 分页
       pagination: {
-        total: '',
-        current: 0,
-        pageSize: 0
+        // total: '',
+        // current: 0,
+        // pageSize: 0
       }
     }
   },
@@ -214,7 +213,6 @@ export default {
           if (res.success) {
             this.orderListData = res.result.records
             console.log('订单数据列表', this.orderListData)
-            // 分页信息赋值
             this.pagination = {
               total: res.result.total,
               current: res.result.current,
@@ -265,8 +263,16 @@ export default {
     // 同步
     synchronization() {},
 
-    // father 抽屉方法
-    aa() {}
+    // 分页变化时触发
+    handleTableChange(pagination, filters, sorter) {
+      console.log('分页器信息', pagination)
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
+      }
+      this.queryParam.pageNo = pagination.current
+      this.getOrderList() //重新渲染
+    }
   },
   computed: {},
   mounted() {}

+ 54 - 22
src/views/reportForms/supply-capacity-table.vue

@@ -78,18 +78,18 @@
     <a-card :bordered="false" style="marginTop:10px;">
       <div class="table-operator">
         <a-button type="primary" @click="handleExportXls('供应链产能报表')" icon="download">合并导出</a-button>
-        <a-button type="primary" @click="monthlySupplyExport" icon="download">月份供应商合计导出</a-button>
-        <a-button type="primary" @click="monthlyDepartExport" icon="download">月份部门合计导出</a-button>
+        <a-button type="primary" @click="monthSupplyExport" icon="download">月份供应商合计导出</a-button>
+        <a-button type="primary" @click="monthDepartExport" icon="download">月份部门合计导出</a-button>
       </div>
 
-      <!-- 合计 table  rowKey="id" :scroll="{ x: 1500 }"  -->
+      <!-- 合计 table  rowKey="id" :scroll="{ x: 1500 }" :pagination="ipagination  -->
       <a-table
         bordered
         :row-key="record => record.id"
         :columns="supplyCapacityColumns"
         :data-source="supplyCapacityData"
         :loading="loading"
-        :pagination="ipagination"
+        :pagination="pagination"
         @change="handleTableChange"
       >
       </a-table>
@@ -102,7 +102,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import JEllipsis from '@/components/jeecg/JEllipsis'
 import moment from 'moment'
 
-import { supplyCapList, monthlySupplyXls } from '@api/reportForms/supply-capacity-table'
+import { supplyCapList, handleXls, monthSupplyXls, monthDepartXls } from '@api/reportForms/supply-capacity-table'
 
 export default {
   name: 'SupplyCapacityTable', // 供应商产能报表
@@ -185,20 +185,19 @@ export default {
         cVenCode: '',
         cPlanLotNumber: '',
         pageNo: '', // 当前页
-        pageSize: '-1' // 页面大小
       },
       // 分页
       pagination: {
-        total: '',
-        current: 0,
-        pageSize: 0
+        // total: '',
+        // current: 0,
+        // pageSize: 0
       },
       dateFormat: 'YYYY-MM-DD'
     }
   },
   created() {
-    this.getSupplyCapList() // 渲染供应链产能报表
-    console.log('000');
+    this.getSupplyCapList() // 渲染 供应链产能报表
+    console.log('000')
   },
 
   methods: {
@@ -206,18 +205,35 @@ export default {
     getSupplyCapList() {
       this.$nextTick(() => {
         supplyCapList(this.queryParam).then(res => {
-           console.log('111');
+          console.log('111')
           if (res.success) {
-             console.log('222');
-            console.log('查询结果:', res.result)
-            this.supplyCapacityData = res.result
+            console.log('222')
+            this.supplyCapacityData = res.result.records
+            console.log('【供应商产能报表数据】:', this.supplyCapacityData)
+            this.pagination = {
+              total: res.result.total,
+              current: res.result.current,
+              pageSize: res.result.size
+            }
           }
         })
       })
     },
+
+    //合并导出
+    handleExportXls() {
+      handleXls().then(res => {
+        console.log('000')
+        if (res.success) {
+          console.log('月份供应链合计导出', res.result)
+          console.log('请求接口成功')
+        }
+      })
+    },
+
     // 月份供应链合计导出
-    monthlySupplyExport() {
-      monthlySupplyXls().then(res => {
+    monthSupplyExport() {
+      monthSupplyXls().then(res => {
         console.log('000')
         if (res.success) {
           console.log('月份供应链合计导出', res.result)
@@ -226,20 +242,36 @@ export default {
       })
     },
     // 月份部门合计导出
-    monthlyDepartExport() {},
+    monthDepartExport() {
+      monthDepartXls().then(res => {
+        console.log('000')
+        if (res.success) {
+          console.log('月份供应链合计导出', res.result)
+          console.log('请求接口成功')
+        }
+      })
+    },
 
     // 查询按钮
     searchQuery() {
       this.getSupplyCapList()
     },
     searchReset() {
-      // console.log('>>>>重置')
       this.queryParam = {}
       this.getSupplyCapList()
+    },
+
+    // 分页变化时触发
+    handleTableChange(pagination, filters, sorter) {
+      console.log('分页器信息', pagination)
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = sorter.order == 'ascend' ? 'asc' : 'desc'
+      }
+      this.queryParam.pageNo = pagination.current
+      this.getSupplyCapList()
     }
-  },
-  computed: {},
-  mounted() {}
+  }
 }
 </script>
 <style lang="less" scoped>

+ 1 - 1
src/views/shipment-details/shipmentList.vue

@@ -484,7 +484,7 @@ export default {
               current: res.result.current,
               pageSize: res.result.size
             }
-            console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
+            // console.log('分页器赋值:', this.pagination.total, this.pagination.current, this.pagination.pageSize)
           }
         })
       })