ymy 2 yıl önce
ebeveyn
işleme
649a1f744a

+ 565 - 540
src/benyun/components/byBill/byBill.vue

@@ -1,555 +1,580 @@
 <template>
-  <div class="bill">
-    <div class="bill-left">
-      <div class="bill-tab" :style="{width:closeTab?0:'200px'}">
-        <div class="bill-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 == 'draftsBox'}" @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 == 'recycleBin'}" @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="close" @click="closeTab = !closeTab">
-        <i class="el-icon-back" v-if="!closeTab"></i>
-        <i class="el-icon-right" v-if="closeTab"></i>
-      </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)" @pagination="paginationChange($event,'source_'+index)" @detail="detail($event,'source_'+index)" />
-          </el-tab-pane>
-        </el-tabs>
-      </div>
-      <!-- 单据 -->
-      <div class="bill-box b-bill" v-if="billConfig" :class="{'on-show':showTab == 'bill'}">
-        <div class="bill-cont">
-          <div class="bill-tool" v-if="billConfig.tool">
-            <by-tool ref="billTool" :propConfig="billConfig.tool" @clickHandle="clickHandle($event,'bill')" />
-          </div>
-          <div class="form" v-if="billConfig.form">
-            <by-form ref="billForm" :propConfig="billConfig.form" @getSupplierModal="getSupplierModal" />
-          </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" @onChangeRow="onChangeRow" />
-              </div>
-            </div>
-          </template>
-        </div>
-        <div class="bill-log">
-          <div class="log-icon" @click="showLog">
-            <i v-if="!drawer" class="el-icon-back"></i>
-            <i v-else class="el-icon-right"></i>
-          </div>
-        </div>
-        <el-drawer
-          class="log-drawer"
-          :size="600"
-          append-to-body
-          title="操作日志"
-          :visible.sync="drawer"
-          direction="rtl">
-          <byLog :propConfig="billConfig && billConfig.log" :parentValue="billValue" ref="log" />
-        </el-drawer>
-      </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')" 
-        @resert="resert('smt')" @pagination="paginationChange($event,'smt')" @detail="detail($event,'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')" 
-        @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')" @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')" @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}">
-        <slot :name='item.name'></slot>
-      </div>
-    </div>
-  </div>
+	<div class="bill">
+		<div class="bill-left">
+			<div class="bill-tab" :style="{width:closeTab?0:'200px'}">
+				<div class="bill-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 == 'draftsBox'}"
+					@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 == 'recycleBin'}"
+					@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="close" @click="closeTab = !closeTab">
+				<i class="el-icon-back" v-if="!closeTab"></i>
+				<i class="el-icon-right" v-if="closeTab"></i>
+			</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)"
+							@pagination="paginationChange($event,'source_'+index)" @detail="detail($event,'source_'+index)" />
+					</el-tab-pane>
+				</el-tabs>
+			</div>
+			<!-- 单据 -->
+			<div class="bill-box b-bill" v-if="billConfig" :class="{'on-show':showTab == 'bill'}">
+				<div class="bill-cont">
+					<div class="bill-tool" v-if="billConfig.tool">
+						<by-tool ref="billTool" :propConfig="billConfig.tool" @clickHandle="clickHandle($event,'bill')" />
+					</div>
+					<div class="form" v-if="billConfig.form">
+						<by-form ref="billForm" :propConfig="billConfig.form" @getSupplierModal="getSupplierModal"
+							@getbusinessType="getbusinessType" />
+					</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" @onChangeRow="onChangeRow" />
+							</div>
+						</div>
+					</template>
+				</div>
+				<div class="bill-log">
+					<div class="log-icon" @click="showLog">
+						<i v-if="!drawer" class="el-icon-s-fold"></i>
+						<i v-else class="el-icon-s-unfold"></i>
+					</div>
+				</div>
+				<el-drawer class="log-drawer" :size="600" append-to-body title="操作日志" :visible.sync="drawer" direction="rtl">
+					<byLog :propConfig="billConfig && billConfig.log" :parentValue="billValue" ref="log" />
+				</el-drawer>
+			</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')" @resert="resert('smt')" @pagination="paginationChange($event,'smt')"
+					@detail="detail($event,'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')" @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')" @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')"
+					@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}">
+				<slot :name='item.name'></slot>
+			</div>
+		</div>
+	</div>
 </template>
 <script lang="ts">
-/**
+	/**
  config:{
-  attr:{
-    activeName:'' //tabs标签值
-  },
-  source:[ //引单
-    {
-      title:'', //标题
-      search:{}, //表单配置
-      tool:{},  //工具栏配置
-      table:{} //表格配置
-    }
-  ],
-  bill:{ //单据
-    form:{}, //表单配置
-    tool:{},  //工具栏配置
-    log:{}, //日志配置
-    tableConfig:[ //表格配置
-      {
-        title:'',
-        tool:{} //表格工具栏
-        table:{}
-      }
-    ] 
-  },
-  smt:{ //已提交
-    search:{}, //表单配置
-    tool:{},  //工具栏配置
-    table:{} //表格配置
-  },
-  draftsBox:{ //草稿箱
-    search:{}, //表单配置
-    tool:{},  //工具栏配置
-    table:{} //表格配置
-  },
-  all:{}, //综合查询(配置同上)
-  recycleBin:{} //回收站(配置同上)
+	attr:{
+		activeName:'' //tabs标签值
+	},
+	source:[ //引单
+		{
+			title:'', //标题
+			search:{}, //表单配置
+			tool:{},  //工具栏配置
+			table:{} //表格配置
+		}
+	],
+	bill:{ //单据
+		form:{}, //表单配置
+		tool:{},  //工具栏配置
+		log:{}, //日志配置
+		tableConfig:[ //表格配置
+			{
+				title:'',
+				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"
-  closeTab = false;
-  billValue={};
-  activeSource='source0';
-  drawer=false;
-  //引单
-  get sourceConfig(){
-    return this.config?.source ? this.config.source : null;
-  }
-  //单据配置
-  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)
-    }
-  }
-  //日志弹窗
-  showLog(){
-    if(this.$refs.billForm){
-      this.billValue = (this.$refs.billForm as any).getValue();
-      this.drawer = true;
-    }
-    if(this.$refs.log){
-      (this.$refs.log as any).resertPage();
-      (this.$refs.log as any).request();
-    }
-  }
-
-  setConfigAfter(){
-    if(this.attrs.activeName){
-      this.showTab = this.attrs.activeName
-    }
-  }
-
-  //设置单据内表单和表格配置
-  setBillConfig(c:any){
-    if(c){
-      this.config.bill = c;
-			this.$nextTick(()=>{
-				if(c.form){
-				  (this.$refs.billForm as any).setConfig(c.form)
-				}
-				if(this.$refs.billTool){
-				  (this.$refs.billTool as any).initTools()
-				}
-				
-				if(c?.tableConfig?.length > 0){
-				  let n = 0;
-				  for(const item of c.tableConfig){
-				    if(this.$refs['tableTool_'+n]){
-				      (this.$refs['tableTool_'+n] as any)[0].initTools();
-				    }
-				    if(item.table && this.$refs['billTable_'+n]){
-				      (this.$refs['billTable_'+n] as any)[0].setConfig(item.table)
-				    }
-				    n++;
-				  }
-				}
+	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"
+		closeTab = false;
+		billValue = {};
+		activeSource = 'source0';
+		drawer = false;
+		//引单
+		get sourceConfig() {
+			return this.config?.source ? this.config.source : null;
+		}
+		//单据配置
+		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)
+			}
+		}
+		//日志弹窗
+		showLog() {
+			if (this.$refs.billForm) {
+				this.billValue = (this.$refs.billForm as any).getValue();
+				this.drawer = true;
+			}
+			if (this.$refs.log) {
+				(this.$refs.log as any).request();
+			}
+		}
+
+		setConfigAfter() {
+			if (this.attrs.activeName) {
+				this.showTab = this.attrs.activeName
+			}
+		}
+
+		//设置单据内表单和表格配置
+		setBillConfig(c : any) {
+			if (c) {
+				this.config.bill = c;
+				this.$nextTick(() => {
+					if (c.form) {
+						(this.$refs.billForm as any).setConfig(c.form)
+					}
+					if (this.$refs.billTool) {
+						(this.$refs.billTool as any).initTools()
+					}
+
+					if (c?.tableConfig?.length > 0) {
+						let n = 0;
+						for (const item of c.tableConfig) {
+							if (this.$refs['tableTool_' + n]) {
+								(this.$refs['tableTool_' + n] as any)[0].initTools();
+							}
+							if (item.table && this.$refs['billTable_' + n]) {
+								(this.$refs['billTable_' + n] as any)[0].setConfig(item.table)
+							}
+							n++;
+						}
+					}
+				})
+			}
+		}
+
+		//左侧tab切换
+		tabChange(t : string) {
+			this.showTab = t;
+			this.$emit('clickTab', t)
+		}
+
+		//工具栏
+		/**
+		 * 
+		 * @param n1 方法
+		 * @param n2 表示哪个表格的操作
+		 */
+		clickHandle(n1 : string, n2 : string) {
+			this.$emit(n1, n2)
+		}
+		search(v : any, n : string) {
+			this.$emit('search', {
+				type: n,
+				value: v
+			})
+		}
+
+		resert(n : string) {
+			this.$emit('resert', {
+				type: n
 			})
-    }
-  }
-
-  //左侧tab切换
-  tabChange(t:string){
-    this.showTab = t;
-		this.$emit('clickTab',t)
-  }
-
-  //工具栏
-  /**
-   * 
-   * @param n1 方法
-   * @param n2 表示哪个表格的操作
-   */
-  clickHandle(n1:string,n2:string){
-    this.$emit(n1,n2)
-  }
-  search(v:any,n:string){
-    this.$emit('search',{
-      type:n,
-      value:v
-    })
-  }
-
-  resert(n:string){
-    this.$emit('resert',{
-      type:n
-    })
-  }
-
-  //设置引单表格数据
-  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()
-    }
-    return d;
-  }
-
-  //获取引单表格选中数据
-  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> = [];
-    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).getSelectTable()
-    }  
-    return d;
-  }
-  //获取搜索数据
-  getSearchValue(n:string){
-    let d:any = {};
-    if(this.$refs[n]){
-      d = (this.$refs[n] as any).getSearchValue()
-    }  
-    return d;
-  }
-
-  //获取单据数据
-  getBillFormValue(){
-    let v = (this.$refs.billForm as any).getValue();
-    return v;
-  }
-
-  onChangeRow(row:any){
-    this.$emit('onChangeRow',row);
-  }
-
-  //获取单据表格已选数据
-  /**
-   * 
-   * @param n 表示第几个单据表格,用下标表示
-   */
-  getBillTableSelect(n:any){
-    let d:Array<any>=[];
-    const code = 'billTable_'+n;
-    if(this.$refs[code]){
-      d = (this.$refs[code] as any)[0].getSelectData();
-    }
-    return d;
-  }
-
-  //获取单据表格数据
-  getBillTableData(n:any){
-    let d:Array<any>=[];
-    const code = 'billTable_'+n;
-    if(this.$refs[code]){
-      d = (this.$refs[code] as any)[0].getValue();
-    }
-    return d;
-  }
-
-
-  //设置单据表单数据
-  setBillFormValue(value:any){
-    if(this.$refs['billForm']){
-      (this.$refs['billForm'] as any).setValue(value)
-    }
-  }
-  //设置单据表格数据
-  /**
-   * 
-   * @param value 表格值
-   * @param n 表示第几个表格,一般是下标值
-   */
-  setBillTableValue(value:any,n:number){
-    let code = 'billTable_'+n;
-    if(this.$refs[code]){
-      (this.$refs[code] as any)[0].setValue(value);
-    }
-  }
-  //设置tab表格数据
-  /**
-   * 
-   * @param n 
-   * @param data 
-   */
-  setTabTableValue(n:string,data:Array<any>){
-    if(this.$refs[n]){
-      (this.$refs[n] as any).setTableValue(data);
-    }
-  }
-
-  /**
-   * 
-   * @param n 
-   * @param page 
-   */
-  //设置tab表格分页
-  setTablePage(n:string,page:any){
-    if(this.$refs[n]){
-      (this.$refs[n] as any).setPage(page);
-    }
-  }
-
-  /**
-   * 获取tab表格分页
-   * @param n 
-   */
-  getTablePage(n:string){
-    if(this.$refs[n]){
-      return (this.$refs[n] as any).getPage();
-    }
-  }
-
-  //分页变化
-  paginationChange(page:any,n:string){
-    this.$emit('pagination',{page,type:n})
-  }
-
-  detail(row:any,n:string){
-    this.$emit('detail',{row,type:n})
-  }
-	
-	getSupplierModal(e:any){
-		this.$emit('getSupplierModal',e);
+		}
+
+		//设置引单表格数据
+		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> = [];
+			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).getSelectTable()
+			}
+			return d;
+		}
+		//获取搜索数据
+		getSearchValue(n : string) {
+			let d : any = {};
+			if (this.$refs[n]) {
+				d = (this.$refs[n] as any).getSearchValue()
+			}
+			return d;
+		}
+
+		//获取单据数据
+		getBillFormValue() {
+			let v = (this.$refs.billForm as any).getValue();
+			return v;
+		}
+
+		onChangeRow(row : any) {
+			this.$emit('onChangeRow', row);
+		}
+
+		//获取单据表格已选数据
+		/**
+		 * 
+		 * @param n 表示第几个单据表格,用下标表示
+		 */
+		getBillTableSelect(n : any) {
+			let d : Array<any> = [];
+			const code = 'billTable_' + n;
+			if (this.$refs[code]) {
+				d = (this.$refs[code] as any)[0].getSelectData();
+			}
+			return d;
+		}
+
+		//获取单据表格数据
+		getBillTableData(n : any) {
+			let d : Array<any> = [];
+			const code = 'billTable_' + n;
+			if (this.$refs[code]) {
+				d = (this.$refs[code] as any)[0].getValue();
+			}
+			return d;
+		}
+
+
+		//设置单据表单数据
+		setBillFormValue(value : any) {
+			if (this.$refs['billForm']) {
+				(this.$refs['billForm'] as any).setValue(value)
+			}
+		}
+		//设置单据表格数据
+		/**
+		 * 
+		 * @param value 表格值
+		 * @param n 表示第几个表格,一般是下标值
+		 */
+		setBillTableValue(value : any, n : number) {
+			let code = 'billTable_' + n;
+			if (this.$refs[code]) {
+				(this.$refs[code] as any)[0].setValue(value);
+			}
+		}
+		//设置tab表格数据
+		/**
+		 * 
+		 * @param n 
+		 * @param data 
+		 */
+		setTabTableValue(n : string, data : Array<any>) {
+			if (this.$refs[n]) {
+				(this.$refs[n] as any).setTableValue(data);
+			}
+		}
+
+		/**
+		 * 
+		 * @param n 
+		 * @param page 
+		 */
+		//设置tab表格分页
+		setTablePage(n : string, page : any) {
+			if (this.$refs[n]) {
+				(this.$refs[n] as any).setPage(page);
+			}
+		}
+
+		/**
+		 * 获取表格分页
+		 * @param n 
+		 */
+		getTablePage(n : string) {
+			if (this.$refs[n]) {
+				return (this.$refs[n] as any).getPage();
+			}
+		}
+
+		//分页变化
+		paginationChange(page : any, n : string) {
+			this.$emit('pagination', { page, type: n })
+		}
+
+		detail(row : any, n : string) {
+			this.$emit('detail', { row, type: n })
+		}
+
+		getSupplierModal(e : any) {
+			this.$emit('getSupplierModal', e);
+		}
+		getbusinessType(e : any) {
+			this.$emit('getbusinessType', e);
+		}
 	}
-}
 </script>
 
 <style lang="scss" scoped>
-.bill{
-  width: 100%;
-  box-sizing: border-box;
-  display: flex;
-  padding: 16px;
-  .bill-left {
-    position: relative;
-    border-right: solid #EEE 1px;
-    padding-right:16px;
-    flex-shrink: 0;
-    min-height: 820px;
-    .bill-tab{
-      width: 200px;
-      height: 100%;
-      transition: all .5s;
-      overflow: hidden;
-    }
-    .bill-title{
-      font-size: 16px;
-      padding-bottom: 16px;
-      width: 200px;
-    }
-    .bill-nav{
-      font-size: 14px;
-      height: 30px;
-      line-height: 30px;
-      width: 200px;
-      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;
-    }
-    .close{
-      height: 22px;
-      width: 22px;
-      border-radius: 50%;
-      border: solid #EEE 1px;
-      position: absolute;
-      top: 30px;
-      right: -11px;
-      background-color: #FFF;
-      display: flex;
-      justify-content: center;
-      align-items: center;
-      cursor: pointer;
-    }
-  }
-  .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-cont{
-        width:100%
-      }
-      .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;
-      }
-      .form{
-        margin-bottom: 8px;
-      }
-      .bill-log{
-        width: 30px;
-        display: flex;
-        flex-direction: column;
-        justify-content: center;
-        align-items: center;
-        flex-shrink: 0;
-        margin-left: 16px;
-        border-left: solid 1px #EEE;
-        .log-icon{
-          width: 30px;
-          height: 40px;
-          display: flex;
-          justify-content: center;
-          align-items: center;
-          cursor: pointer;
-          border-top-right-radius: 5px;
-          border-bottom-right-radius: 5px;
-          background-color: #EEE;
-          >i{
-            font-size: 20px;
-          }
-        }
-      }
-    }
-    .b-bill{
-      display: flex;
-      justify-content: space-between;
-    }
-    .on-show{
-      opacity: 1;
-      z-index: 1;
-    }
-  }
-}
+	.bill {
+		width: 100%;
+		box-sizing: border-box;
+		display: flex;
+		padding: 16px;
+
+		.bill-left {
+			position: relative;
+			border-right: solid #EEE 1px;
+			padding-right: 16px;
+			flex-shrink: 0;
+			min-height: 780px;
+
+			.bill-tab {
+				width: 200px;
+				height: 100%;
+				transition: all .5s;
+				overflow: hidden;
+			}
+
+			.bill-title {
+				font-size: 16px;
+				padding-bottom: 16px;
+				width: 200px;
+			}
+
+			.bill-nav {
+				font-size: 14px;
+				height: 30px;
+				line-height: 30px;
+				width: 200px;
+				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;
+			}
+
+			.close {
+				height: 22px;
+				width: 22px;
+				border-radius: 50%;
+				border: solid #EEE 1px;
+				position: absolute;
+				top: 30px;
+				right: -11px;
+				background-color: #FFF;
+				display: flex;
+				justify-content: center;
+				align-items: center;
+				cursor: pointer;
+			}
+		}
+
+		.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-cont {
+					width: 100%
+				}
+
+				.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;
+				}
+
+				.form {
+					margin-bottom: 8px;
+				}
+
+				.bill-log {
+					width: 30px;
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					align-items: center;
+					flex-shrink: 0;
+					margin-left: 8px;
+					border-left: solid 1px #EEE;
+
+					.log-icon {
+						// background-color: #EEE;
+						width: 30px;
+						height: 40px;
+						display: flex;
+						justify-content: center;
+						align-items: center;
+						cursor: pointer;
+
+						.el-icon-notebook {
+							font-size: 20px;
+						}
+					}
+				}
+			}
+
+			.b-bill {
+				display: flex;
+				justify-content: space-between;
+			}
+
+			.on-show {
+				opacity: 1;
+				z-index: 1;
+			}
+		}
+	}
 </style>
 
 <style lang="scss">
-.log-drawer{
-  .el-drawer__body{
-    height: calc(100% - 63px);
-  }
-}
+	.log-drawer {
+		.el-drawer__body {
+			height: calc(100% - 63px);
+		}
+	}
 </style>

+ 16 - 1
src/components/warehouse/warehouse.vue

@@ -23,6 +23,10 @@
   配置说明
   config:{
     attrs:{
+      retConfig:{
+        retLabel:'name'  //返回的值(示例)
+        retValue:'id'  //返回的值(示例)
+      }
       disabled:true/false  //是否禁用
       size:medium/small/mini //尺寸
       clearable:true/false  //是否清空
@@ -78,13 +82,24 @@ export default class Warehouse extends VueViews {
   }
 
   onChange(){
-    this.$emit('onChange',this.value);
     let currentItem:any=null;
     for(const item of this.options){
       if(item.id == this.value){
         currentItem = item
       }
     }
+    if(this.attrs.retConfig){
+      let obj:any={};
+      if(currentItem){
+        for(const key in this.attrs.retConfig){
+          obj[key] = currentItem[this.attrs.retConfig[key]]
+        }
+      }
+      this.$emit('onChange',obj);
+    }else{
+      this.$emit('onChange',this.value);
+    }
+    
     (this.$root as any).eventHub.$emit('warehouseChange',currentItem)
   }
 

+ 21 - 1
src/components/warehousePosition/warehousePosition.vue

@@ -23,6 +23,10 @@
   配置说明
   config:{
     attrs:{
+      retConfig:{
+        retLabel:'name'  //返回的值(示例)
+        retValue:'id'  //返回的值(示例)
+      }
       disabled:true/false  //是否禁用
       size:medium/small/mini //尺寸
       clearable:true/false  //是否清空
@@ -80,7 +84,23 @@ export default class Warehouse extends VueViews {
   }
 
   onChange(){
-    this.$emit('onChange',this.value);
+    let currentItem:any=null;
+    for(const item of this.options){
+      if(item.id == this.value){
+        currentItem = item
+      }
+    }
+    if(this.attrs.retConfig){
+      let obj:any={};
+      if(currentItem){
+        for(const key in this.attrs.retConfig){
+          obj[key] = currentItem[this.attrs.retConfig[key]]
+        }
+      }
+      this.$emit('onChange',obj);
+    }else{
+      this.$emit('onChange',this.value);
+    }
   }
 
   // 清空数据

+ 13 - 10
src/views/audit/order/index.vue

@@ -15,7 +15,6 @@
 		// 右边
 		baseURL : any = process.env.VUE_APP_BASE_API
 		setStatusData : any = ''
-		pageSize : any = 15
 		timeNum = 0;
 		timer : any = null
 		config : any = {
@@ -344,15 +343,16 @@
 		}
 		// 分页
 		pagination(e : any) {
-			let query = {
-				pageNo: e.page.pageNum,
-				pageSize: this.pageSize,
-				submitState: 1
-			};
+			let query : any = (this as any).$refs.bill.getSearchValue(e.type);
+			query.pageNo = e.page.pageNum;
+			query.pageSize = e.page.pageSize;
+			query.submitState = 1;
+			let loading = this.$loading({ target: '.main-container' });
 			// query.submitState = 1; // 已提交状态
 			api.pageList(query, 'supplyTaskOrder').then((res : any) => {
 				if (res.code === 200) {
 					(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
+					loading.close()
 				} else this.failHandle(res)
 			})
 		}
@@ -367,7 +367,7 @@
 			}
 			clearInterval(this.timer)
 			// submitState: 提交状态
-			this.getPageList({ pageSize: this.pageSize, pageNo: 1 }, 'all'); // 综合数据
+			this.getPageList({}, 'all'); // 综合数据
 		}
 		// 获取分页数据
 		getPageList(query : any, type : any) {
@@ -377,7 +377,7 @@
 					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
 					let page = {
 						pageNo: res.data.current, //当前页
-						pageSize: this.pageSize, //每页条数
+						pageSize: res.data.size, //每页条数
 						total: res.data.total //总条数
 					};
 					(this.$refs.bill as any).setTablePage(type, page)
@@ -402,10 +402,12 @@
 		}
 		// 搜索
 		search(parames : any) {
+			let loading = this.$loading({ target: '.main-container' });
 			let query = parames.value
 			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
 			if (parames.type === 'smt') query.submitState = 1 // 草稿箱数据
 			this.getPageList(query, parames.type) // 获取分页数据
+			loading.close();
 		}
 		// 接单
 		getOrder(item : any) {
@@ -431,8 +433,9 @@
 		}
 		// 刷新/重置
 		resert(e : any) {
-			e = e.type ? e.type : e;
-			if (e === 'all') this.getPageList({ pageSize: this.pageSize, pageNo: 1 }, 'all'); // 综合数据
+			let data:any = e.type ? e.type : e;
+			(this as any).$refs.bill.$refs[data].clearSearch();
+			if (data === 'all') this.getPageList({}, 'all'); // 综合数据
 		}
 		// 工具栏接单
 		onOrder(n : string) {

+ 12 - 13
src/views/audit/outbound/index.vue

@@ -1,6 +1,6 @@
 <template>
 	<div>
-		<by-bill ref="bill" :propConfig="config" @search="search" @onDelete="onDelete" @onRefresh="onRefresh"
+		<by-bill ref="bill" :propConfig="config" @search="search" @onDelete="onDelete" @onRefresh="resert" @resert="resert"
 			@detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow" @pagination="pagination"
 			@getSupplierModal="getSupplierModal">
 		</by-bill>
@@ -1084,10 +1084,9 @@
 		// 分页
 		pagination(e : any) {
 			console.log('分页 ==> ', e);
-			let query = {
-				pageNo: e.page.pageNum,
-				pageSize: e.page.pageSize,
-			};
+			let query : any = (this as any).$refs.bill.getSearchValue(e.type);
+			query.pageNo = e.page.pageNum;
+			query.pageSize = e.page.pageSize;
 			let loading = this.$loading({ target: '.main-container' });
 			if (e.type === 'recycleBin') {
 				api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
@@ -1142,14 +1141,14 @@
 			console.log('搜索 ==> ', query);
 			this.getPageList(query, parames.type) // 获取分页数据
 		}
-		// 刷新
-		onRefresh(e : any) {
-			console.log('刷新 ==>', e);
-			(this as any).$refs.bill.$refs[e].resert();
-			if (e === 'all') this.getPageList({}, 'all'); // 综合查询
-			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
-			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
-			if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
+		// 刷新/重置
+		resert(e : any) {
+			let data : any = e.type ? e.type : e;
+			(this as any).$refs.bill.$refs[data].clearSearch();
+			if (data === 'all') this.getPageList({}, 'all'); // 综合数据
+			if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
+			if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
+			if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
 		}
 		// 单据表格删除
 		changeTable(item : any) {

+ 118 - 112
src/views/audit/saleOrder/components/byBill/billModule.vue

@@ -1,128 +1,134 @@
 <template>
-  <div class="bill-module-box">
-    <div class="bill-module-form" v-if="searchConfig" v-show="!hideSearch">
-      <by-form :propConfig="searchConfig" ref="search" />
-      <div class="search-btn">
-        <el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
-        <el-button size="mini" icon="el-icon-refresh" @click="resert">重置</el-button>
-      </div>
-    </div>
-    <div class="bill-tool" v-if="toolConfig">
-      <by-tool :propConfig="toolConfig" ref="tool" @clickHandle="clickHandle" />
-    </div>
-    <div class="table" v-if="tableConfig">
-      <by-table :propConfig="tableConfig" ref="table" v-on="$listeners"  />
-    </div>
-  </div>
+	<div class="bill-module-box">
+		<div class="bill-module-form" v-if="searchConfig" v-show="!hideSearch">
+			<by-form :propConfig="searchConfig" ref="search" />
+			<div class="search-btn">
+				<el-button type="primary" size="mini" icon="el-icon-search" @click="search">搜索</el-button>
+				<el-button size="mini" icon="el-icon-refresh" @click="resert">重置</el-button>
+			</div>
+		</div>
+		<div class="bill-tool" v-if="toolConfig">
+			<by-tool :propConfig="toolConfig" ref="tool" @clickHandle="clickHandle" />
+		</div>
+		<div class="table" v-if="tableConfig">
+			<by-table :propConfig="tableConfig" ref="table" v-on="$listeners" />
+		</div>
+	</div>
 </template>
 
 <script lang="ts">
-import { Component, Prop, Vue, Watch } from "vue-property-decorator";
-@Component
-export default class BillModule extends Vue {
-  config:any={}
-  hideSearch = false
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	@Component
+	export default class BillModule extends Vue {
+		config : any = {}
+		hideSearch = false
 
-  @Prop()
-  propConfig:any
+		@Prop()
+		propConfig : any
 
-  get searchConfig(){
-    return this.config?.search ? this.config.search : null
-  }
+		get searchConfig() {
+			return this.config?.search ? this.config.search : null
+		}
 
-  get toolConfig(){
-    return this.config?.tool ? this.config.tool : null
-  }
+		get toolConfig() {
+			return this.config?.tool ? this.config.tool : null
+		}
 
-  get tableConfig(){
-    return this.config?.table ? this.config.table : null
-  }
+		get tableConfig() {
+			return this.config?.table ? this.config.table : null
+		}
 
-  created(){
-    if(this.propConfig){
-      this.setConfig(this.propConfig)
-    }
-  }
+		created() {
+			if (this.propConfig) {
+				this.setConfig(this.propConfig)
+			}
+		}
 
-  setConfig(c:any){
-    this.config = c?c:{}
-  }
+		setConfig(c : any) {
+			this.config = c ? c : {}
+		}
 
-  getConfig(){
-    return (this as any).$lodash.cloneDeep(this.config)
-  }
-  //工具栏按钮点击操作
-  clickHandle(n:string){
-    if(n == 'toggleSearch'){
-      this.hideSearch = !this.hideSearch
-    }else{
-      this.$emit('clickHandle',n)
-    }
-  }
+		getConfig() {
+			return (this as any).$lodash.cloneDeep(this.config)
+		}
+		//工具栏按钮点击操作
+		clickHandle(n : string) {
+			if (n == 'toggleSearch') {
+				this.hideSearch = !this.hideSearch
+			} else {
+				this.$emit('clickHandle', n)
+			}
+		}
 
-  //获取搜索值
-  getSearchValue(){
-    let value:any = {}
-    if(this.$refs.search){
-      value = (this.$refs.search as any).getValue()
-    }
-    return value
-  }
-  //获取表格数据
-  getTableValue(){
-    let data:Array<any>=[];
-    if(this.$refs.table){
-      data = (this.$refs.table as any).getValue();
-    }
-    return data;
-  }
-  //获取已选中表格数据
-  getSelectTable(){
-    let data:Array<any>=[];
-    if(this.$refs.table){
-      data = (this.$refs.table as any).getSelectData();
-    }
-    return data;
-  }
-
-  search(){
-    this.$emit('search',this.getSearchValue());
-  }
-  resert(){
-    if(this.$refs.search){
-      (this.$refs.search as any).setValue({})
-    }
-    this.$emit('resert');
-  }
-  //设置表格数据
-  setTableValue(data:Array<any>){
-    if(this.$refs.table){
-      (this.$refs.table as any).setValue(data)
-    }
-  }
-  setPage(page:any){
-    if(this.$refs.table){
-      (this.$refs.table as any).setPage(page)
-    }
-  }
-}
+		//获取搜索值
+		getSearchValue() {
+			let value : any = {}
+			if (this.$refs.search) {
+				value = (this.$refs.search as any).getValue()
+			}
+			return value
+		}
+		//获取表格数据
+		getTableValue() {
+			let data : Array<any> = [];
+			if (this.$refs.table) {
+				data = (this.$refs.table as any).getValue();
+			}
+			return data;
+		}
+		//获取已选中表格数据
+		getSelectTable() {
+			let data : Array<any> = [];
+			if (this.$refs.table) {
+				data = (this.$refs.table as any).getSelectData();
+			}
+			return data;
+		}
+		//清除搜索条件
+		clearSearch() {
+			(this.$refs.search as any).clearValue();
+		}
+		search() {
+			this.$emit('search', this.getSearchValue());
+		}
+		resert() {
+			if (this.$refs.search) {
+				(this.$refs.search as any).setValue({})
+			}
+			this.$emit('resert');
+		}
+		//设置表格数据
+		setTableValue(data : Array<any>) {
+			if (this.$refs.table) {
+				(this.$refs.table as any).setValue(data)
+			}
+		}
+		setPage(page : any) {
+			if (this.$refs.table) {
+				(this.$refs.table as any).setPage(page)
+			}
+		}
+	}
 </script>
 
 <style lang="scss" scoped>
-.bill-module-box{
-  width: 100%;
-  .bill-tool{
-    width: 100%;
-    padding-bottom: 16px;
-  }
-  .bill-module-form{
-    padding-bottom: 8px;
-    .search-btn{
-      width: 100%;
-      display: flex;
-      justify-content: flex-end;
-    }
-  }
-  
-}
+	.bill-module-box {
+		width: 100%;
+
+		.bill-tool {
+			width: 100%;
+			padding-bottom: 16px;
+		}
+
+		.bill-module-form {
+			padding-bottom: 8px;
+
+			.search-btn {
+				width: 100%;
+				display: flex;
+				justify-content: flex-end;
+			}
+		}
+
+	}
 </style>

+ 12 - 11
src/views/audit/saleOrder/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<byBill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @resert="getDataList" @detail="openEdit"
-			@onRefresh="onRefresh" @pagination="pagination" @clickTab="clickTab">
+		<byBill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @resert="resert" @detail="openEdit"
+			@onRefresh="resert" @pagination="pagination" @clickTab="clickTab">
 		</byBill>
 		<vxe-modal v-model="vxeValue" width="70%" height="70%" min-width="800" min-height="600" show-zoom resize transfer
 			show-footer>
@@ -570,7 +570,7 @@
 				api.splitOrder(obj, 'supplyPurchaseOrder').then((res : any) => {
 					if (res.code === 200) {
 						this.$message.success('拆单成功!');
-						this.getPageList({ pageSize: 20, pageNo: 1 }, 'all'); // 综合数据
+						this.getPageList({}, 'all'); // 综合数据
 						this.vxeValue = false;
 					} else this.$message.error(res.msg);
 				})
@@ -603,7 +603,7 @@
 				return
 			}
 			clearInterval(this.timer);
-			this.getPageList({ pageSize: 20, pageNo: 1 }, 'all'); // 综合数据
+			this.getPageList({}, 'all'); // 综合数据
 		}
 		// 获取分页数据
 		getPageList(query : any, type : any) {
@@ -711,10 +711,9 @@
 		}
 		// 分页
 		pagination(e : any) {
-			let query = {
-				pageNo: e.page.pageNum,
-				pageSize: e.page.pageSize,
-			};
+			let query : any = (this as any).$refs.bill.getSearchValue(e.type);
+			query.pageNo = e.page.pageNum;
+			query.pageSize = e.page.pageSize;
 			let loading = this.$loading({ target: '.main-container' })
 			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
 				if (res.code === 200) {
@@ -730,9 +729,11 @@
 			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
 			this.getPageList(query, parames.type) // 获取综合分页数据
 		}
-		// 刷新
-		onRefresh(e : string) {
-			(this as any).$refs.bill.$refs[e].resert();
+		// 刷新/重置
+		resert(e : any) {
+			let data : any = e.type ? e.type : e;
+			(this as any).$refs.bill.$refs[data].clearSearch();
+			if (data === 'all') this.getPageList({}, 'all'); // 综合数据
 		}
 	}
 </script>

+ 34 - 0
src/views/audit/warehousing/components/businessType.vue

@@ -0,0 +1,34 @@
+<template>
+	<div>
+		<el-select v-model="value" placeholder="请选择" style="width: 100%;" @change="change">
+			<el-option v-for="(item,index) in options" :key="index" :value="item">
+			</el-option>
+		</el-select>
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/order";
+	@Component
+	export default class Focus extends Vue {
+		@Prop()
+		propValue : any;
+		value : any = '';
+		options : any = []
+		@Watch('propValue')
+		propValueChange(v : any) {
+			this.value = v;
+		};
+		created() {
+			api.getbusinessType('supplyEntryOrder').then((res : any) => {
+				if (res.code === 200) {
+					this.options = res.data;
+				}
+			});
+		}
+		change(e : any) {
+			this.$emit('getbusinessType', e)
+		}
+	}
+</script>

+ 63 - 8
src/views/audit/warehousing/components/towInOne.vue

@@ -2,16 +2,30 @@
 	<div class="clearfix parentC">
 		<div class="inputC">{{propValue}}</div>
 		<div v-if="getPropConfig">
-			<div class="selectC" v-if="propValue" key="propValue1">更换</div>
-			<div class="selectC" v-else key="propValue2">选择</div>
+			<div class="selectC" v-if="propValue" key="propValue1" @click="openModal">更换</div>
+			<div class="selectC" v-else key="propValue2" @click="vxeValue = true;">选择</div>
 		</div>
+		<vxe-modal v-model="vxeValue" width="800" show-zoom resize transfer show-footer>
+			<template #title>
+				<span>选择仓库、仓位</span>
+			</template>
+			<template #default>
+				<by-form :propConfig="config" ref="form"></by-form>
+			</template>
+			<template #footer>
+				<div class="btn">
+					<el-button type="primary" size="small" @click="doConfirm">确定</el-button>
+				</div>
+			</template>
+		</vxe-modal>
 	</div>
 </template>
 
 <script lang="ts">
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	@Component
-	export default class Focus extends Vue {
+	export default class TowInOne extends Vue {
+		vxeValue : any = false
 		@Prop()
 		propValue : any;
 		@Prop()
@@ -19,12 +33,53 @@
 		get getPropConfig() {
 			return this.propConfig?.isSelect;
 		}
-		created() {
-			// console.log('propConfig', this.propConfig);
+		config = {
+			attr: {
+				size: 'small',
+				height: 200,
+			},
+			columns: [
+				[{
+					span: 11,
+					label: '仓库',
+					prop: 'warehouse',
+					component: 'warehouse',
+					compConfig: {
+						attr: {
+							placeholder: '请选择仓库',
+							clearable: true
+						}
+					}
+				}, {
+					span: 11,
+					label: '仓位',
+					prop: 'warehousePosition',
+					component: 'warehouse-position',
+					compConfig: {
+						attr: {
+							placeholder: '请选择仓位',
+							clearable: true
+						}
+					}
+				}]
+			]
 		}
-		// 确定机构名称
-		confirm(e : any) {
-			this.$emit('getSupplierModal', e[0])
+
+		// 打开弹窗
+		openModal() {
+			let data = (this as any).$lodash.cloneDeep(this.propValue);
+			data = data.split(',');
+			setTimeout(() => {
+				(this as any).$refs.form.setValue({
+					warehouse: data[0],
+					warehousePosition: data[1]
+				})
+			}, 0)
+			this.vxeValue = true;
+		}
+		// 确定仓库仓位
+		doConfirm(e : any) {
+			console.log((this as any).$refs.form.getValue());
 		}
 	}
 </script>

+ 36 - 48
src/views/audit/warehousing/index.vue

@@ -1,8 +1,8 @@
 <template>
 	<div>
-		<by-bill ref="bill" :propConfig="config" @search="search" @onAdd="onAdd" @onDelete="onDelete" @onRefresh="onRefresh"
-			@detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow" @pagination="pagination"
-			@getSupplierModal="getSupplierModal">
+		<by-bill ref="bill" :propConfig="config" @search="search" @onAdd="onAdd" @onDelete="onDelete" @onRefresh="resert"
+			@resert="resert" @detail="openEdit" @onSave="onSave" @clickTab="clickTab" @onChangeRow="onChangeRow"
+			@pagination="pagination" @getSupplierModal="getSupplierModal" @getbusinessType="getbusinessType">
 		</by-bill>
 		<!-- 选择物料 -->
 		<productModal ref="product" :mulit="true" @confirm="confirmProduct" />
@@ -15,6 +15,7 @@
 	import productModal from "../orderTask/components/productModal.vue";
 	import Focus from "../orderTask/components/focus.vue";
 	import towInOne from "./components/towInOne.vue";
+	import BusinessType from "./components/businessType.vue";
 	@Component({ components: { productModal } })
 	export default class OrderTask extends Vue {
 		// 左边
@@ -22,6 +23,7 @@
 		isAdd : any = false
 		// 右边
 		supplierInfo : any = {} // 机构信息
+		businessType : any = '' // 业务类型
 		tableData : any = []
 		mergeObj : any = []
 		setStatusData : any = ''
@@ -42,11 +44,6 @@
 					attr: {
 						size: 'small',
 						readonly: false,
-						rules: {
-							// orderNumber: [{
-							// 	required: true, message: '请输入单据编号', trigger: 'blur'
-							// }]
-						}
 					},
 					columns: [
 						[
@@ -77,7 +74,14 @@
 								span: 8,
 								label: '业务类型',
 								prop: 'businessType',
-								component: 'by-select',
+								component: BusinessType,
+							},
+							{
+
+								span: 8,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
 							},
 							{
 								span: 8,
@@ -169,24 +173,6 @@
 											},
 										}
 									},
-									{
-										width: 110,
-										title: '实际金额',
-										field: 'realityPrice',
-									},
-									{
-										width: 110,
-										title: '优惠金额',
-										field: 'prePrice',
-										component: 'by-input',
-										compConfig: {
-											attr: {
-												size: 'mini',
-												type: 'number',
-												defaultValue: 0,
-											},
-										}
-									},
 									{
 										width: 110,
 										title: '合计金额',
@@ -691,10 +677,14 @@
 		getSupplierModal(e : any) {
 			this.supplierInfo = e;
 		}
+		// 获取业务类型
+		getbusinessType(e : any) {
+			console.log(e);
+			this.businessType = e;
+		}
 		// 监听表格数据变化
 		onChangeRow(e : any) {
-			e.realityPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
-			e.totalPrice = e.realityPrice - e.prePrice;
+			e.totalPrice = parseFloat((e.number * e.unitPrice).toFixed(2));
 		}
 		// 确定商品新增
 		confirmProduct(e : any) {
@@ -730,22 +720,23 @@
 		}
 		// 保存
 		onSave(e : any) {
-			console.log('保存 ==>', this.tabType);
+			// console.log('保存 ==>', this.tabType);
 			(this as any).$refs.bill.$refs.billForm.validate().then(() => {
 				let query = (this.$refs.bill as any).getBillFormValue(); // 获取单据数据
 				// 供应商数据
 				if (!query.organizationName) query.organizationName = this.supplierInfo.name;
 				if (!query.organizationId) query.organizationId = this.supplierInfo.id;
+				if (!query.businessType) query.businessType = this.businessType;
 				if (!query.organizationName) return this.$message.warning('请选择机构名称');
+				if (!query.businessType) return this.$message.warning('请选择业务类型');
 				// 子表数据
 				query.suborderList = this.tableData;
 				if (query.suborderList.length > 0) {
 					for (let v of query.suborderList) {
-						console.log(v.prePrice);
 						if (!v.number || v.number <= 0) return this.$message.warning('请输入正确物料数量');
 						if (!v.unitPrice || v.unitPrice <= 0) return this.$message.warning('请输入正确物料单价');
 						if (v.prePrice.length <= 0 || v.prePrice < 0) return this.$message.warning('请输入正确优惠金额');
-						v.taskOrderId = query.id;
+						if (query.id) v.taskOrderId = query.id;
 						v.storehouseName = '我是仓库';
 						v.storehouseId = 2;
 						v.storingLocationName = '我是仓位';
@@ -759,11 +750,9 @@
 					}
 				});
 
-				console.log('保存参数query ==> ', query);
 
+				console.log('保存参数query ==> ', query);
 				if (this.isAdd) {
-					query.submitState = 0
-					console.log('保存进草稿箱 ==>', query);
 					api.saveList(query, 'supplyEntryOrder').then((res : any) => {
 						if (res.code === 200) {
 							this.$message.success(res.msg);
@@ -823,7 +812,7 @@
 				data.map((v : any, i : any) => {
 					v.dataIndex = i;
 					if (!v.prePrice) v.prePrice = '0';
-					v.towInOne = v.storehouseName + '' + v.storingLocationName; // 仓库仓位
+					v.towInOne = v.storehouseName + ',' + v.storingLocationName; // 仓库仓位
 				});
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
 				if (billConfig.tableConfig[0].table.columns.at(-1).title != '操作') {
@@ -898,10 +887,9 @@
 		// 分页
 		pagination(e : any) {
 			console.log('分页 ==> ', e);
-			let query = {
-				pageNo: e.page.pageNum,
-				pageSize: e.page.pageSize,
-			};
+			let query : any = (this as any).$refs.bill.getSearchValue(e.type);
+			query.pageNo = e.page.pageNum;
+			query.pageSize = e.page.pageSize;
 			let loading = this.$loading({ target: '.main-container' });
 			if (e.type === 'recycleBin') {
 				api.selectDeleteList(query, 'supplyEntryOrder').then((res : any) => {
@@ -956,14 +944,14 @@
 			console.log('搜索 ==> ', query);
 			this.getPageList(query, parames.type) // 获取分页数据
 		}
-		// 刷新
-		onRefresh(e : any) {
-			console.log('刷新 ==>', e);
-			(this as any).$refs.bill.$refs[e].resert();
-			if (e === 'all') this.getPageList({}, 'all'); // 综合查询
-			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
-			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
-			if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
+		// 刷新/重置
+		resert(e : any) {
+			let data:any = e.type ? e.type : e;
+			(this as any).$refs.bill.$refs[data].clearSearch();
+			if (data === 'all') this.getPageList({}, 'all'); // 综合数据
+			if (data === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
+			if (data === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
+			if (data === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
 		}
 		// 单据表格删除
 		changeTable(item : any) {