Răsfoiți Sursa

修改单据分页

ymy 2 ani în urmă
părinte
comite
7f4e18ce99

+ 6 - 1
src/benyun/components/byBill/billModule.vue

@@ -11,7 +11,7 @@
       <by-tool :propConfig="toolConfig" ref="tool" @clickHandle="clickHandle" />
     </div>
     <div class="table" v-if="tableConfig">
-      <by-table :propConfig="tableConfig" ref="table" />
+      <by-table :propConfig="tableConfig" ref="table" v-on="$listeners"  />
     </div>
   </div>
 </template>
@@ -100,6 +100,11 @@ export default class BillModule extends Vue {
       (this.$refs.table as any).setValue(data)
     }
   }
+  setPage(page:any){
+    if(this.$refs.table){
+      (this.$refs.table as any).setPage(page)
+    }
+  }
 }
 </script>
 

+ 17 - 1
src/benyun/components/byBill/byBill.vue

@@ -50,7 +50,7 @@
       <!-- 已提交 -->
       <div class="bill-box" v-if="smtConfig" :class="{'on-show':showTab == 'smt'}">
         <bill-module :propConfig="smtConfig" ref="smt" @clickHandle="clickHandle($event,'smt')" @search="search($event,'smt')" 
-        @resert="resert('smt')" />
+        @resert="resert('smt')" @pagination="paginationChange($event,'smt')" @detail="detail($event,'smt')" />
       </div>
       <!-- 草稿箱 -->
       <div class="bill-box" v-if="draftsBoxConfig" :class="{'on-show':showTab == 'draftsBox'}">
@@ -243,6 +243,22 @@ export default class ByBill extends VueViews {
     }
   }
 
+  /**
+   * 
+   * @param n 
+   * @param page 
+   */
+  //设置tab表格分页
+  setTablePage(n:string,page:any){
+    if(this.$refs[n]){
+      (this.$refs[n] as any).setPage(page);
+    }
+  }
+
+  //分页变化
+  paginationChange(page:any,n:string){
+    this.$emit('pagination',{page,type:n})
+  }
 }
 </script>
 

+ 1 - 0
src/benyun/components/byTable/byTable.vue

@@ -179,6 +179,7 @@ export default class ByTable extends VueViews {
   }
   //每页条数发生变化
   handleSizeChange(val:number) {
+    this.page.pageSize = val;
     if (this.page.pageSize * val > this.page.total) {
       this.page.pageNo = 1
     }

+ 2 - 2
src/benyun/components/moduleView/moduleView.vue

@@ -95,8 +95,8 @@ export default class ModuleView extends ModuleViewHandle {
     }
   }
   //分页的变化
-  paginationChange(pageNum:string,pageSize:string){
-    this.$emit('pagination',{pageNum,pageSize})
+  paginationChange(page:any){
+    this.$emit('pagination',page)
     // this.getList();
   }
 }

+ 12 - 1
src/views/demo/bill.vue

@@ -1,11 +1,12 @@
 <template>
   <div>
-    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert">
+    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert" @pagination="pagination">
       <template v-slot:cus>我是插槽</template>
     </by-bill>
     <div style="clear: both;"></div>
     <div>
       <el-button type="primary" plain @click="setSmtValue">设置已提交数据</el-button><br/>
+      <el-button type="primary" plain @click="setSmtPage">设置已提交分页</el-button><br/>
       <el-button type="primary" plain @click="setdraftsBoxValue">设置草稿箱数据</el-button>
     </div>
     
@@ -361,6 +362,16 @@ export default class BillDemo extends Vue {
 		console.log(data);
     (this.$refs.bill as any).setTabTableValue('smt',data);
   }
+  pagination(parames:any){
+    console.log('点击分页:',parames)
+  }
+  setSmtPage(){
+    (this.$refs.bill as any).setTablePage('smt',{
+      pageNo:1,
+      pageSize:20,
+      total:500
+    });
+  }
   setdraftsBoxValue(){
     let data:Array<any>=[{
       name:'王五',

+ 4 - 4
src/views/demo/order/components/orderTable.vue

@@ -17,7 +17,7 @@
     <vxe-column field="skus" title="商品" width="120"></vxe-column>
     <vxe-column field="weight" title="重量" width="70"></vxe-column>
     <vxe-column field="isCod" title="是否货到付款" width="120"></vxe-column>
-    <vxe-column field="freight" title="运费" width="70"></vxe-column>
+    <!-- <vxe-column field="freight" title="运费" width="70"></vxe-column> -->
     <vxe-column field="sendDate" title="发货日期" width="120"></vxe-column>
     <vxe-column field="signTime" title="预计送达时间" width="120"></vxe-column>
     <vxe-column field="endTime" title="确认收货时间" width="120"></vxe-column>
@@ -29,7 +29,7 @@
     <vxe-column field="payDate" title="支付时间" width="120"></vxe-column>
     <vxe-column field="freeAmount" title="抵扣金额" width="120"></vxe-column>
     <vxe-column field="payAmount" title="应付金额" width="120"></vxe-column>
-    <vxe-column field="paidAmount" title="实际支付金额" width="120"></vxe-column>
+    <vxe-column field="paidAmount" title="实付+运费" width="120"></vxe-column>
     <vxe-column field="shopBuyerId" title="买家昵称" width="120"></vxe-column>
     <vxe-column field="openId" title="平台买家唯一值" width="120"></vxe-column>
     <vxe-column field="buyerPaidAmount" title="总买家实付" width="120"></vxe-column>
@@ -38,8 +38,8 @@
     <vxe-column field="questionDesc" title="问题描述" width="120"></vxe-column>
     <vxe-column field="shopName" title="店铺" width="120"></vxe-column>
     <vxe-column field="invoiceType" title="发票类型" width="120"></vxe-column>
-    <vxe-column field="invoiceTitle" title="发票抬头" width="120"></vxe-column>
-    <vxe-column field="buyerTaxNo" title="发票税号" width="120"></vxe-column>
+    <vxe-column field="invoiceTitle" title="发票抬头+税号" width="120"></vxe-column>
+    <!-- <vxe-column field="buyerTaxNo" title="发票税号" width="120"></vxe-column> -->
     <vxe-column field="drpCoIdFrom" title="分销商编号" width="120"></vxe-column>
     <vxe-column field="drpCoIdTo" title="供销商编号" width="120"></vxe-column>
     <vxe-column field="orderDate" title="订单日期" width="120"></vxe-column>

+ 1 - 0
src/views/demo/order/order.vue

@@ -40,6 +40,7 @@
       </div>
       <div class="table">
         <order-table :data="data"/>
+        
       </div>
     </div>
   </div>