|
@@ -0,0 +1,203 @@
|
|
|
|
+<template>
|
|
|
|
+ <div class="bill">
|
|
|
|
+ <div class="bill-left">
|
|
|
|
+ <div class="title">导航</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>
|
|
|
|
+ <div class="bill-nav" v-if="allConfig" :class="{'onBill':showTab == 'all'}" @click="tabChange('all')">综合查询</div>
|
|
|
|
+ <div class="bill-nav" v-if="recycleBinConfig" :class="{'onBill':showTab == 'recycle'}" @click="tabChange('recycleBin')">回收站</div>
|
|
|
|
+ <div class="bill-nav" v-for="(item,index) of customs" :class="{'onBill':showTab == item.name}" @click="tabChange(item.name)" :key="index">{{item.label}}</div>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bill-main">
|
|
|
|
+ <div class="bill-box" v-if="billConfig" :class="{'on-show':showTab == 'bill'}">
|
|
|
|
+ <div class="bill-tool">
|
|
|
|
+ <by-tool v-if="billConfig.tool" ref="bill-tool" :propConfig="billConfig.tool" @clickHandle="billToolHandle" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="form">
|
|
|
|
+ <by-form v-if="billConfig.form" ref="bill-form" :propConfig="billConfig.form" />
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div class="bill-box" v-if="smtConfig" :class="{'on-show':showTab == 'smt'}">
|
|
|
|
+ <bill-module :propConfig="smtConfig" ref="smt" @clickHandle="clickHandle($event,'clickHandleSmt')" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bill-box" v-if="draftsBoxConfig" :class="{'on-show':showTab == 'draftsBox'}">
|
|
|
|
+ <bill-module :propConfig="draftsBoxConfig" ref="draftsBox" @clickHandle="clickHandle($event,'clickHandleDrafts')" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bill-box" v-if="allConfig" :class="{'on-show':showTab == 'all'}">
|
|
|
|
+ <bill-module :propConfig="allConfig" ref="all" @clickHandle="clickHandle($event,'clickHandleAll')" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bill-box" v-if="recycleBinConfig" :class="{'on-show':showTab == 'recycleBin'}">
|
|
|
|
+ <bill-module :propConfig="recycleBinConfig" ref="recycleBin" @clickHandle="clickHandle($event,'clickHandleRecycle')" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="bill-box" v-for="(item,index) of customs" :key="index" :class="{'on-show':showTab == item.name}">
|
|
|
|
+ <slot :name='item.name'></slot>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+</template>
|
|
|
|
+<script lang="ts">
|
|
|
|
+/**
|
|
|
|
+ config:{
|
|
|
|
+ bill:{ //单据
|
|
|
|
+ search:{}, //表单配置
|
|
|
|
+ tool:{}, //工具栏配置
|
|
|
|
+ table:{} //表格配置
|
|
|
|
+ },
|
|
|
|
+ smt:{ //已提交
|
|
|
|
+ search:{}, //表单配置
|
|
|
|
+ tool:{}, //工具栏配置
|
|
|
|
+ table:{} //表格配置
|
|
|
|
+ },
|
|
|
|
+ draftsBox:{ //草稿箱
|
|
|
|
+ search:{}, //表单配置
|
|
|
|
+ tool:{}, //工具栏配置
|
|
|
|
+ table:{} //表格配置
|
|
|
|
+ },
|
|
|
|
+ all:{}, //综合查询(配置同上)
|
|
|
|
+ recycleBin:{} //回收站(配置同上)
|
|
|
|
+ }
|
|
|
|
+ */
|
|
|
|
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
|
|
+import VueViews from '@/benyun/compVue/VueViews'
|
|
|
|
+import billModule from "./billModule.vue";
|
|
|
|
+@Component({components:{billModule}})
|
|
|
|
+export default class ByBill extends VueViews {
|
|
|
|
+ showTab="bill"
|
|
|
|
+
|
|
|
|
+ //单据配置
|
|
|
|
+ get billConfig(){
|
|
|
|
+ return this.config?.bill ? this.config.bill : null;
|
|
|
|
+ }
|
|
|
|
+ //已提交配置
|
|
|
|
+ get smtConfig(){
|
|
|
|
+ return this.config?.smt ? this.config.smt : null;
|
|
|
|
+ }
|
|
|
|
+ //草稿箱配置
|
|
|
|
+ get draftsBoxConfig(){
|
|
|
|
+ return this.config?.draftsBox ? this.config.draftsBox : null;
|
|
|
|
+ }
|
|
|
|
+ //综合查询配置
|
|
|
|
+ get allConfig(){
|
|
|
|
+ return this.config?.all ? this.config.all : null;
|
|
|
|
+ }
|
|
|
|
+ //回收站配置
|
|
|
|
+ get recycleBinConfig(){
|
|
|
|
+ return this.config?.recycleBin ? this.config.recycleBin : null;
|
|
|
|
+ }
|
|
|
|
+ //自定义插槽
|
|
|
|
+ get customs(){
|
|
|
|
+ return this.config?.customs ? this.config.customs : []
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ created(){
|
|
|
|
+ if(this.propConfig){
|
|
|
|
+ this.setConfig(this.propConfig)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //单据工具栏点击操作
|
|
|
|
+ billToolHandle(s:string){
|
|
|
|
+ this.$emit('billToolHandle',s)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //左侧tab切换
|
|
|
|
+ tabChange(t:string){
|
|
|
|
+ this.showTab = t;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //工具栏
|
|
|
|
+ clickHandle(n1:string,n2:string){
|
|
|
|
+ this.$emit(n1,n2)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //获取表格数据
|
|
|
|
+ getTableData(n:string){
|
|
|
|
+ let d:Array<any> = [];
|
|
|
|
+ if(this.$refs[n]){
|
|
|
|
+ d = (this.$refs[n] as any).getTableValue()
|
|
|
|
+ }
|
|
|
|
+ return d;
|
|
|
|
+ }
|
|
|
|
+ //获取表格选中数据
|
|
|
|
+ getTableSelectData(n:string){
|
|
|
|
+ let d:Array<any> = [];
|
|
|
|
+ if(this.$refs[n]){
|
|
|
|
+ d = (this.$refs[n] as any).getTableValue()
|
|
|
|
+ }
|
|
|
|
+ return d;
|
|
|
|
+ }
|
|
|
|
+ //获取搜索数据数据
|
|
|
|
+ getSearchValue(n:string){
|
|
|
|
+ let d:any = {};
|
|
|
|
+ if(this.$refs[n]){
|
|
|
|
+ d = (this.$refs[n] as any).getSearchValue()
|
|
|
|
+ }
|
|
|
|
+ return d;
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</script>
|
|
|
|
+
|
|
|
|
+<style lang="scss" scoped>
|
|
|
|
+.bill{
|
|
|
|
+ width: 100%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ display: flex;
|
|
|
|
+ padding: 16px;
|
|
|
|
+ .bill-left {
|
|
|
|
+ width: 200px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ height: 100%;
|
|
|
|
+ border-right: solid #EEE 1px;
|
|
|
|
+ padding-right:16px;
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
+ position: relative;
|
|
|
|
+ .title{
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ padding-bottom: 16px;
|
|
|
|
+ }
|
|
|
|
+ .bill-nav{
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ line-height: 30px;
|
|
|
|
+ width: 100%;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ padding: 0 8px;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ margin-bottom: 2px;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ }
|
|
|
|
+ .onBill{
|
|
|
|
+ background-color: #bde3f7;
|
|
|
|
+ }
|
|
|
|
+ .bill-nav:hover{
|
|
|
|
+ background-color: #bde3f7;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .bill-main{
|
|
|
|
+ width: calc(100% - 16px);
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ margin-left: 16px;
|
|
|
|
+ position: relative;
|
|
|
|
+ .bill-box{
|
|
|
|
+ width: 100%;
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: 0;
|
|
|
|
+ top: 0;
|
|
|
|
+ opacity: 0;
|
|
|
|
+ z-index: -1;
|
|
|
|
+ transition: all .5s;
|
|
|
|
+ .bill-tool{
|
|
|
|
+ width: 100%;
|
|
|
|
+ padding-bottom: 16px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .on-show{
|
|
|
|
+ opacity: 1;
|
|
|
|
+ z-index: 1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+</style>
|