瀏覽代碼

单据新增引单功能

ymy 2 年之前
父節點
當前提交
0560d563c2

+ 3 - 0
src/assets/styles/index.scss

@@ -11,6 +11,7 @@ html,body,div,button,input,i,span,ul,li,a,dl,dt,dd{
 }
 
 body {
+  width: 100%;
   height: 100%;
   -moz-osx-font-smoothing: grayscale;
   -webkit-font-smoothing: antialiased;
@@ -24,10 +25,12 @@ label {
 
 html {
   height: 100%;
+  width: 100%;
   box-sizing: border-box;
 }
 
 #app {
+  width: 100%;
   height: 100%;
 }
 

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

@@ -92,6 +92,7 @@ export default class BillModule extends Vue {
     if(this.$refs.search){
       (this.$refs.search as any).setValue({})
     }
+    this.$emit('resert');
   }
   //设置表格数据
   setTableValue(data:Array<any>){

+ 67 - 13
src/benyun/components/byBill/byBill.vue

@@ -3,6 +3,7 @@
     <div class="bill-left">
       <div class="bill-tab" :style="{width:closeTab?0:'200px'}">
         <div class="title">导航</div>
+        <div class="bill-nav" v-if="sourceConfig" :class="{'onBill':showTab == 'source'}" @click="tabChange('source')">引单</div>
         <div class="bill-nav" v-if="billConfig" :class="{'onBill':showTab == 'bill'}" @click="tabChange('bill')">单据</div>
         <div class="bill-nav" v-if="smtConfig" :class="{'onBill':showTab == 'smt'}" @click="tabChange('smt')">已提交</div>
         <div class="bill-nav" v-if="draftsBoxConfig" :class="{'onBill':showTab == 'drafts'}" @click="tabChange('draftsBox')">草稿箱</div>
@@ -16,6 +17,15 @@
       </div>
     </div>
     <div class="bill-main">
+      <!-- 引单 -->
+      <div class="bill-box" v-if="sourceConfig" :class="{'on-show':showTab == 'source'}">
+        <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)" />
+          </el-tab-pane>
+        </el-tabs>
+      </div>
       <!-- 单据 -->
       <div class="bill-box" v-if="billConfig" :class="{'on-show':showTab == 'bill'}">
         <div class="bill-tool" v-if="billConfig.tool">
@@ -24,28 +34,38 @@
         <div class="form" v-if="billConfig.form">
           <by-form ref="billForm" :propConfig="billConfig.form" />
         </div>
-        <div class="table-tool" v-if="billConfig.tableTool">
-          <by-tool ref="tableTool" :propConfig="billConfig.tableTool" @clickHandle="clickHandle($event,'billTable')" />
-        </div>
-        <div class="table" v-if="billConfig.table">
-          <by-table :propConfig="billConfig.table" ref="billTable" />
-        </div>
+        <template v-if="billConfig.tableConfig && billConfig.tableConfig.length > 0">
+          <div class="bill-table" v-for="(item,index) of billConfig.tableConfig" :key="index">
+            <div class="table-title" v-if="item.title">{{ item.title }}</div>
+            <div class="table-tool" v-if="item.tool">
+              <by-tool :ref="'tableTool_'+index" :propConfig="item.tool" @clickHandle="clickHandle($event,'billTable_'+index)" />
+            </div>
+            <div class="table" v-if="item.table">
+              <by-table :propConfig="item.table" :ref="'billTable_'+index" />
+            </div>
+          </div>
+        </template>
+        
       </div>
       <!-- 已提交 -->
       <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')" />
+        <bill-module :propConfig="smtConfig" ref="smt" @clickHandle="clickHandle($event,'smt')" @search="search($event,'smt')" 
+        @resert="resert('smt')" />
       </div>
       <!-- 草稿箱 -->
       <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')" />
+        <bill-module :propConfig="draftsBoxConfig" ref="draftsBox" @clickHandle="clickHandle($event,'draftsBox')" @search="search($event,'draftsBox')" 
+        @resert="resert('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')" />
+        <bill-module :propConfig="allConfig" ref="all" @clickHandle="clickHandle($event,'all')" @search="search($event,'all')" 
+        @resert="resert('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')" />
+        <bill-module :propConfig="recycleBinConfig" ref="recycleBin" @clickHandle="clickHandle($event,'recycleBin')" @search="search($event,'recycleBin')" 
+        @resert="resert('recycleBin')" />
       </div>
       <!-- 插槽 -->
       <div class="bill-box" v-for="(item,index) of customs" :key="index" :class="{'on-show':showTab == item.name}">
@@ -57,11 +77,24 @@
 <script lang="ts">
 /**
  config:{
+  source:[ //引单
+    {
+      title:'', //标题
+      search:{}, //表单配置
+      tool:{},  //工具栏配置
+      table:{} //表格配置
+    }
+  ],
   bill:{ //单据
     form:{}, //表单配置
     tool:{},  //工具栏配置
-    tableTool:{} //表格工具栏
-    table:{} //表格配置
+    tableConfig:[ //表格配置
+      {
+        title:'',
+        tool:{} //表格工具栏
+        table:{}
+      }
+    ] 
   },
   smt:{ //已提交
     search:{}, //表单配置
@@ -84,7 +117,11 @@ import billModule from "./billModule.vue";
 export default class ByBill extends VueViews {
   showTab="bill"
   closeTab = false
-
+  activeSource='source0'
+  //引单
+  get sourceConfig(){
+    return this.config?.source ? this.config.source : null;
+  }
   //单据配置
   get billConfig(){
     return this.config?.bill ? this.config.bill : null;
@@ -132,6 +169,12 @@ export default class ByBill extends VueViews {
     })
   }
 
+  resert(n:string){
+    this.$emit('resert',{
+      type:n
+    })
+  }
+
   //获取表格数据
   getTableData(n:string){
     let d:Array<any> = [];
@@ -246,6 +289,17 @@ export default class ByBill extends VueViews {
       opacity: 0;
       z-index: -1;
       transition: all .5s;
+      .bill-table{
+        padding-bottom: 16px;
+        width: 100%;
+        .table-title{
+          font-size: 14px;
+          padding-bottom: 8px;
+        }
+      }
+      .bill-table:last-child{
+        padding: 0;
+      }
       .bill-tool,.table-tool{
         width: 100%;
         padding-bottom: 16px;

+ 0 - 11
src/benyun/components/byDialog/byDialog.vue

@@ -1,11 +0,0 @@
-<template>
-  <div></div>
-</template>
-
-<script lang="ts">
-
-</script>
-
-<style lang="scss" scoped>
-
-</style>

+ 4 - 4
src/benyun/components/byTool/byTool.vue

@@ -36,8 +36,8 @@ export default class GmTools extends Vue {
   @Prop()
   propConfig:any
 
-  @Prop()
-  customTools:any;
+  // @Prop()
+  // customTools:any;
 
   get audit(){
     return this.propConfig?.audit ? this.propConfig.audit : {}
@@ -61,8 +61,8 @@ export default class GmTools extends Vue {
     if(this.propConfig?.tools){
       this.setTool(this.propConfig?.tools)
     }
-    if(this.customTools && this.customTools.length > 0){
-      this.setCustomTools(this.customTools)
+    if(this.propConfig?.customTools && this.propConfig?.customTools.length > 0){
+      this.setCustomTools(this.propConfig?.customTools)
     }
   }
 

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

@@ -28,7 +28,6 @@
 <script lang="ts">
 import { Component, Prop, Vue, Watch,Mixins } from "vue-property-decorator";
 import ModuleViewHandle from '@/benyun/compVue/ModuleViewHandle'
-import A from "@/views/demo/a.vue";
 interface Page{
   pageNo?:number,
   pageSize?:number,

+ 171 - 26
src/views/demo/bill.vue

@@ -1,6 +1,6 @@
 <template>
   <div>
-    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd">
+    <by-bill :propConfig="config" @search="search" @onSmt="onSmt" ref="bill" @onAdd="onAdd" @onUpdate="onUpdate" @resert="resert">
       <template v-slot:cus>我是插槽</template>
     </by-bill>
     <div style="clear: both;"></div>
@@ -17,16 +17,11 @@ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 @Component
 export default class BillDemo extends Vue {
   config:any={
-    bill:{
-      tool:{
-        tools:{
-          add:true,
-          edit:true
-        }
-      },
-      form:{
+    source:[{
+      title:'引单1',
+      search:{
         attr:{
-          size:'small'
+          size:'mini'
         },
         columns:[
           [{
@@ -35,21 +30,23 @@ export default class BillDemo extends Vue {
             prop:'created',
             component:'by-date-picker',
             compConfig:{
-              format:'yyyy-MM-dd HH:mm:ss',
+              format:'yyyy-MM-dd',
               type:'datetime'
             }
           }]
         ]
       },
-      tableTool:{
+      tool:{
         tools:{
-          add:true
+          edit:true,
+          delete:true,
+          search:true,
+          refresh:true
         }
       },
       table:{
         attr:{
           size:'mini',
-          height:240,
           seq:true,
           align:'center',
           checkbox:true
@@ -63,21 +60,163 @@ export default class BillDemo extends Vue {
           title:'姓名',
           field:'name',
           width:100
-        },{
-          title:'操作',
-          action:true,
-          plugins:[{
-            icon:'el-icon-edit',
-            name:'编辑',
-            audit:'',
-            event:{
-              click:(item:any) => {
-                console.log('该行数据:',item)
-              }
-            }
+        },
+        {
+          title:'日期',
+          field:'time',
+          // width:200
+        }]
+      }
+    },{
+      title:'引单2',
+      search:{
+        attr:{
+          size:'mini'
+        },
+        columns:[
+          [{
+            span:6,
+            label:'名称',
+            prop:'name',
+            component:'by-input'
           }]
+        ]
+      },
+      tool:{
+        tools:{
+          edit:true,
+          export:true,
+          search:true,
+          refresh:true
+        }
+      },
+      table:{
+        attr:{
+          size:'mini',
+          seq:true,
+          align:'center',
+          checkbox:true
+        },
+        columns:[{
+          title:'id',
+          field:'id',
+          width:50
+        },
+        {
+          title:'姓名',
+          field:'name',
+          width:100
+        },
+        {
+          title:'日期',
+          field:'time',
+          // width:200
         }]
       }
+    }],
+    bill:{
+      tool:{
+        tools:{
+          add:true,
+          edit:true
+        }
+      },
+      form:{
+        attr:{
+          size:'small'
+        },
+        columns:[
+          [{
+            span:6,
+            label:'创建时间',
+            prop:'created',
+            component:'by-date-picker',
+            compConfig:{
+              format:'yyyy-MM-dd HH:mm:ss',
+              type:'datetime'
+            }
+          }]
+        ]
+      },
+      tableConfig:[{
+        title:'单据表格1数据',
+        tool:{
+          tools:{
+            add:true
+          }
+        },
+        table:{
+          attr:{
+            size:'mini',
+            height:240,
+            seq:true,
+            align:'center',
+            checkbox:true
+          },
+          columns:[{
+            title:'id',
+            field:'id',
+            width:50
+          },
+          {
+            title:'姓名',
+            field:'name',
+            width:100
+          },{
+            title:'操作',
+            action:true,
+            plugins:[{
+              icon:'el-icon-edit',
+              name:'编辑',
+              audit:'',
+              event:{
+                click:(item:any) => {
+                  console.log('该行数据:',item)
+                }
+              }
+            }]
+          }]
+        }
+      },{
+        title:'单据表格2数据',
+        tool:{
+          tools:{
+            add:true
+          }
+        },
+        table:{
+          attr:{
+            size:'mini',
+            height:140,
+            seq:true,
+            align:'center',
+            checkbox:true
+          },
+          columns:[{
+            title:'id',
+            field:'id',
+            width:50
+          },
+          {
+            title:'姓名',
+            field:'name',
+            width:100
+          },{
+            title:'操作',
+            action:true,
+            plugins:[{
+              icon:'el-icon-edit',
+              name:'编辑',
+              audit:'',
+              event:{
+                click:(item:any) => {
+                  console.log('该行数据:',item)
+                }
+              }
+            }]
+          }]
+        }
+      }]
     },
     smt:{
       search:{
@@ -190,12 +329,18 @@ export default class BillDemo extends Vue {
   search(parames:any){
     console.log('搜索回传参数',parames);
   }
+  resert(parames:any){
+    console.log('重置回传参数',parames);
+  }
   onSmt(n:string){
     console.log(n+':工具栏执行操作onSmt')
   }
   onAdd(n:string){
     console.log(n);
   }
+  onUpdate(n:string){
+    console.log(n+':工具栏执行操作onUpdate')
+  }
   setSmtValue(){
     let data:Array<any>=[{
       id:1,

+ 11 - 10
src/views/demo/form.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="form" >
-    <by-tool :propConfig="toolConfig" @onAdd="onAdd" :customTools="customTools">
+    <by-tool :propConfig="toolConfig" @onAdd="onAdd">
       <template v-slot:tool-right><div style="width: 120px;">右边</div></template>
     </by-tool>
     <by-form :propConfig="config" ref="form">
@@ -140,17 +140,18 @@ export default class DemoForm extends Vue {
       edit:'audit:collaborationLog:edit',
       delete:'audit:collaborationLog:remove',
       export:'audit:collaborationLog:export'
-    }
-  }
-  customTools:Array<any>=[
-    {
-      name: '新增123', icon: 'el-icon-plus', audit:[''], event:{
-        click:()=>{
-          console.log('新增123')
+    },
+    customTools:[
+      {
+        name: '新增123', icon: 'el-icon-plus', audit:[''], event:{
+          click:()=>{
+            console.log('新增123')
+          }
         }
       }
-    }
-  ]
+    ]
+  }
+  
   onAdd(){
     console.log('点击新增')
   }

+ 2 - 2
src/views/demo/table.vue

@@ -109,7 +109,7 @@ export default class DemoTable extends Vue {
 
   mounted(){
     setTimeout(()=>{
-      (this as any).$refs.table.setValue(this.data);
+      (this as any).$refs.table?.setValue(this.data);
     },500)
     this.request();
   }
@@ -117,7 +117,7 @@ export default class DemoTable extends Vue {
     console.log('操作00000000')
   }
   setData(){
-    (this as any).$refs.table.setValue(this.data);
+    (this as any).$refs.table?.setValue(this.data);
   }
   detail(row:any){
     console.log('该行详情',row);