Ver código fonte

Merge branch 'master' of http://47.107.53.207:3000/ymy/oms

AlanWong 2 anos atrás
pai
commit
67bc30148c

+ 52 - 5
src/benyun/components/byBill/byBill.vue

@@ -22,7 +22,7 @@
         <el-tabs v-model="activeSource">
           <el-tab-pane v-for="(item,index) of sourceConfig" :key="index" :label="item.title" :name="'source'+index">
             <bill-module :propConfig="item" :ref="'source_'+index" @clickHandle="clickHandle($event,'source_'+index)" @search="search($event,'source_'+index)"  
-            @resert="resert('source_'+index)" />
+            @resert="resert('source_'+index)" @pagination="paginationChange($event,'source_'+index)" @detail="detail($event,'source_'+index)" />
           </el-tab-pane>
         </el-tabs>
       </div>
@@ -55,17 +55,17 @@
       <!-- 草稿箱 -->
       <div class="bill-box" v-if="draftsBoxConfig" :class="{'on-show':showTab == 'draftsBox'}">
         <bill-module :propConfig="draftsBoxConfig" ref="draftsBox" @clickHandle="clickHandle($event,'draftsBox')" @search="search($event,'draftsBox')" 
-        @resert="resert('draftsBox')" />
+        @resert="resert('draftsBox')" @pagination="paginationChange($event,'draftsBox')" @detail="detail($event,'draftsBox')" />
       </div>
       <!-- 综合查询 -->
       <div class="bill-box" v-if="allConfig" :class="{'on-show':showTab == 'all'}">
         <bill-module :propConfig="allConfig" ref="all" @clickHandle="clickHandle($event,'all')" @search="search($event,'all')" 
-        @resert="resert('all')" />
+        @resert="resert('all')" @pagination="paginationChange($event,'all')" @detail="detail($event,'all')" />
       </div>
       <!-- 回收站 -->
       <div class="bill-box" v-if="recycleBinConfig" :class="{'on-show':showTab == 'recycleBin'}">
         <bill-module :propConfig="recycleBinConfig" ref="recycleBin" @clickHandle="clickHandle($event,'recycleBin')" @search="search($event,'recycleBin')" 
-        @resert="resert('recycleBin')" />
+        @resert="resert('recycleBin')" @pagination="paginationChange($event,'recycleBin')" @detail="detail($event,'recycleBin')" />
       </div>
       <!-- 插槽 -->
       <div class="bill-box" v-for="(item,index) of customs" :key="index" :class="{'on-show':showTab == item.name}">
@@ -189,6 +189,49 @@ export default class ByBill extends VueViews {
     })
   }
 
+  //设置引单表格数据
+  setSourceTableData(n:any,data:Array<any>){
+    const code = 'source_'+n;
+    if(this.$refs[code]){
+      (this.$refs[code] as any)[0]?.setTableValue(data)
+    }
+  }
+
+  //获取引单表格数据
+  getSourceTableData(n:any){
+    let d:Array<any>=[];
+    const code = 'source_'+n;
+    if(this.$refs[code]){
+      d = (this.$refs[code] as any)[0]?.getTableValue()
+    }
+  }
+
+  //获取引单表格选中数据
+  getSourceTableSelectData(n:any){
+    let d:Array<any>=[];
+    const code = 'source_'+n;
+    if(this.$refs[code]){
+      d = (this.$refs[code] as any)[0]?.getTableValue()
+    }  
+    return d;
+  }
+  //获取引单搜索数据
+  getSourceSearchData(n:any){
+    let d:any = {};
+    const code = 'source_'+n;
+    if(this.$refs[code]){
+      d = (this.$refs[code] as any)[0]?.getSearchValue()
+    }  
+    return d;
+  }
+  //设置引单分页
+  setSourcePage(n:any,page:any){
+    const code = 'source_'+n;
+    if(this.$refs[code]){
+      (this.$refs[code] as any)[0]?.setPage(page)
+    }
+  }
+
   //获取表格数据
   getTableData(n:string){
     let d:Array<any> = [];
@@ -205,7 +248,7 @@ export default class ByBill extends VueViews {
     }  
     return d;
   }
-  //获取搜索数据数据
+  //获取搜索数据
   getSearchValue(n:string){
     let d:any = {};
     if(this.$refs[n]){
@@ -259,6 +302,10 @@ export default class ByBill extends VueViews {
   paginationChange(page:any,n:string){
     this.$emit('pagination',{page,type:n})
   }
+
+  detail(row:any,n:string){
+    this.$emit('detail',{row,type:n})
+  }
 }
 </script>
 

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

@@ -67,7 +67,7 @@
         @current-change="handleCurrentChange"
         :current-page="page.pageNo"
         :page-sizes="attrs.pageSizes"
-        :page-size="attrs.pageSize?attrs.pageSize:20"
+        :page-size="page.pageSize?page.pageSize:20"
         :layout="attrs.layoutPage?attrs.layoutPage:'total, sizes, prev, pager, next, jumper'"
         :total="page.total">
       </el-pagination>
@@ -148,6 +148,7 @@ export default class ByTable extends VueViews {
       }
     })
   }
+  
 
   //点击详情
   detail(row:any){

+ 28 - 3
src/views/demo/bill.vue

@@ -1,10 +1,12 @@
 <template>
   <div>
-    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert" @pagination="pagination">
+    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert" @pagination="pagination" @detail="detail">
       <template v-slot:cus>我是插槽</template>
     </by-bill>
     <div style="clear: both;"></div>
     <div>
+      <el-button type="primary" plain @click="setSourceValue">设置引单1数据</el-button><br/>
+      <el-button type="primary" plain @click="setSourcePage">设置引单1分页</el-button><br/>
       <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>
@@ -63,6 +65,7 @@ export default class BillDemo extends Vue {
         {
           title:'姓名',
           field:'name',
+          isDetail:true,
           width:100
         },
         {
@@ -268,6 +271,7 @@ export default class BillDemo extends Vue {
         {
           title:'姓名',
           field:'name',
+          isDetail:true,
           width:100
         },
         {
@@ -349,6 +353,18 @@ export default class BillDemo extends Vue {
   onUpdate(n:string){
     console.log(n+':工具栏执行操作onUpdate')
   }
+  setSourceValue(){
+    let data:Array<any>=[{
+      id:1,
+      name:'王五',
+      time:'2023-02-02'
+    },{
+      id:2,
+      name:'李四',
+      time:'2023-02-02'
+    }];
+    (this.$refs.bill as any).setSourceTableData(0,data);
+  }
   setSmtValue(){
     let data:Array<any>=[{
       id:1,
@@ -359,16 +375,25 @@ export default class BillDemo extends Vue {
       name:'李四',
       time:'2023-02-02'
     }];
-		console.log(data);
     (this.$refs.bill as any).setTabTableValue('smt',data);
   }
+  setSourcePage(){
+    (this.$refs.bill as any).setSourcePage(0,{
+      pageNo:1,
+      pageSize:20,
+      total:100
+    });
+  }
+  detail(parames:any){
+    console.log('点击详情:',parames)
+  }
   pagination(parames:any){
     console.log('点击分页:',parames)
   }
   setSmtPage(){
     (this.$refs.bill as any).setTablePage('smt',{
       pageNo:1,
-      pageSize:20,
+      pageSize:10,
       total:500
     });
   }