瀏覽代碼

出入库

AlanWong 2 年之前
父節點
當前提交
13378d3cd9

+ 20 - 1
src/api/order.ts

@@ -57,6 +57,23 @@ function ordersaccepting(data : any, url : any) {
 		params: data
 	})
 }
+
+// 拆单
+function splitOrder(data : any, url : any) {
+	return request({
+		url: '/supply/' + url + '/splitOrder',
+		method: 'POST',
+		params: data
+	})
+}
+// 退单
+function backOrder(data : any, url : any) {
+	return request({
+		url: '/supply/' + url + '/backOrder',
+		method: 'POST',
+		params: data
+	})
+}
 export default {
 	treeList,
 	pageList,
@@ -64,5 +81,7 @@ export default {
 	updateList,
 	deleteList,
 	selectDeleteList,
-	ordersaccepting
+	ordersaccepting,
+	splitOrder,
+	backOrder
 }

+ 17 - 17
src/views/audit/order/index.vue

@@ -227,26 +227,20 @@
 					},
 					columns: [
 						{
-							width: 200,
-							title: '机构名称',
-							field: 'organizationName',
-							isDetail: true,
-						},
-						{
-							width: 150,
+							width: 168,
 							title: '单据编号',
 							field: 'orderNumber',
+							isDetail: true,
 						},
 						{
-							width: 80,
-							title: '状态',
-							field: 'status',
-							component: Assembly,
+							width: 180,
+							title: '机构名称',
+							field: 'organizationName',
 						},
 						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
+							width: 130,
+							title: '交货',
+							field: 'delivery',
 						},
 						{
 							width: 150,
@@ -254,9 +248,9 @@
 							field: 'deliveryData',
 						},
 						{
-							width: 130,
-							title: '交货',
-							field: 'delivery',
+							width: 200,
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
 							width: 130,
@@ -268,6 +262,12 @@
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 110,
 							title: '操作',

+ 48 - 48
src/views/audit/orderTask/index.vue

@@ -305,15 +305,9 @@
 							field: 'organizationName',
 						},
 						{
-							width: 80,
-							title: '状态',
-							field: 'status',
-							component: Assembly,
-						},
-						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
+							width: 130,
+							title: '交货人',
+							field: 'delivery',
 						},
 						{
 							width: 150,
@@ -321,9 +315,9 @@
 							field: 'deliveryData',
 						},
 						{
-							width: 130,
-							title: '交货',
-							field: 'delivery',
+							width: 200,
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
 							width: 130,
@@ -335,6 +329,12 @@
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 110,
 							title: '操作',
@@ -451,15 +451,9 @@
 							field: 'organizationName',
 						},
 						{
-							width: 80,
-							title: '状态',
-							field: 'status',
-							component: Assembly,
-						},
-						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
+							width: 130,
+							title: '交货人',
+							field: 'delivery',
 						},
 						{
 							width: 150,
@@ -467,9 +461,9 @@
 							field: 'deliveryData',
 						},
 						{
-							width: 130,
-							title: '交货',
-							field: 'delivery',
+							width: 200,
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
 							width: 130,
@@ -481,6 +475,12 @@
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 110,
 							title: '操作',
@@ -598,15 +598,9 @@
 							field: 'organizationName',
 						},
 						{
-							width: 80,
-							title: '状态',
-							field: 'status',
-							component: Assembly,
-						},
-						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
+							width: 130,
+							title: '交货人',
+							field: 'delivery',
 						},
 						{
 							width: 150,
@@ -614,9 +608,9 @@
 							field: 'deliveryData',
 						},
 						{
-							width: 130,
-							title: '交货',
-							field: 'delivery',
+							width: 200,
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
 							width: 130,
@@ -628,6 +622,12 @@
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 110,
 							title: '操作',
@@ -742,15 +742,9 @@
 							field: 'organizationName',
 						},
 						{
-							width: 80,
-							title: '状态',
-							field: 'status',
-							component: Assembly,
-						},
-						{
-							width: 200,
-							title: '交货地点',
-							field: 'deliveryAddress',
+							width: 130,
+							title: '交货人',
+							field: 'delivery',
 						},
 						{
 							width: 150,
@@ -758,9 +752,9 @@
 							field: 'deliveryData',
 						},
 						{
-							width: 130,
-							title: '交货',
-							field: 'delivery',
+							width: 200,
+							title: '交货地点',
+							field: 'deliveryAddress',
 						},
 						{
 							width: 130,
@@ -772,6 +766,12 @@
 							title: '交货方式',
 							field: 'deliveryWay',
 						},
+						{
+							width: 80,
+							title: '状态',
+							field: 'status',
+							component: Assembly,
+						},
 						{
 							width: 110,
 							title: '操作',

+ 28 - 0
src/views/audit/outbound/components/focus.vue

@@ -0,0 +1,28 @@
+<template>
+	<div>
+		<el-input placeholder="请选择供应商" v-model="propValue" class="input-organizationName" clearable :readonly="true">
+			<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
+		</el-input>
+		<!-- 选择机构名称 -->
+		<supplier-modal ref="supplierModal" @confirm="confirm" />
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	@Component
+	export default class Focus extends Vue {
+		@Prop()
+		propValue : any
+		handleSupplier() {
+			(this.$refs.supplierModal as any).setShow(true);
+		}
+		// 确定机构名称
+		confirm(e : any) {
+			this.$emit('getSupplierModal', e[0])
+		}
+	}
+</script>
+
+<style>
+</style>

+ 172 - 0
src/views/audit/outbound/components/productModal.vue

@@ -0,0 +1,172 @@
+<template>
+	<vxe-modal v-model="value" id="productDialogModal" :width="width?width+'px':'80%'" @show="show"
+		:height="height?height+'px':'80%'" min-width="500" min-height="400" show-zoom resize transfer show-footer
+		@confirm="confirm">
+		<template #title>
+			<span>选择商品</span>
+		</template>
+		<template #default>
+			<module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList"
+				@clickHandle="clickHandle" />
+		</template>
+	</vxe-modal>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	@Component
+	export default class ProductModal extends Vue {
+		value = false
+		time : any;
+		timeNum = 0;
+		data : Array<any> = []
+
+		@Prop()
+		width ?: number
+
+		@Prop()
+		height ?: number
+
+		@Prop()
+		mulit ?: boolean
+
+		config : any = {
+			search: {
+				attr: {
+					size: 'mini'
+				},
+				columns: [
+					[{
+						span: 6,
+						label: '标题',
+						prop: 'skuTitle',
+						component: 'by-input',
+						compConfig: {
+							attr: {
+								clearable: true,
+								placeholder: '请输入名称'
+							}
+						}
+					}]
+				]
+			},
+			tool: {
+				tools: {
+					search: true,
+					refresh: true
+				}
+			},
+			table: {
+				attr: {
+					size: 'mini',
+					seq: true,
+					align: 'center',
+					checkbox:true,
+					pageSize: 10
+				},
+				columns:
+					[
+						{
+							title: '标题',
+							field: 'skuTitle',
+							// width: 150
+						},
+						{
+							title: '副标题',
+							field: 'skuSubtitle',
+							// width: 150
+						},
+						{
+							title: '规格',
+							field: 'materialSpec'
+						},
+						{
+							title: '单位',
+							field: 'unit'
+						},
+						{
+							title: '单价',
+							field: 'price'
+						},
+					]
+			},
+			// request:{
+			//   url:'/system/maindataMaterial/page'
+			// }
+		}
+		brandData : Array<any> = []
+
+		getBrandData() {
+			return this.brandData;
+		}
+
+		clickHandle(n : string) {
+			if (n == 'onRefresh') {
+				this.getList()
+			}
+		}
+
+		setShow(v : boolean) {
+			this.value = v;
+		}
+
+		mounted() { }
+
+		//确定
+		confirm() {
+			let data : Array<any> = this.getSelectdata();
+			this.$emit('confirm', data);
+			this.value = false;
+		}
+		//获取已选中表格数据
+		getSelectdata() {
+			let data : Array<any> = [];
+			if (this.$refs.view) {
+				data = (this.$refs.view as any).getSelectData()
+			}
+			return data;
+		}
+		//显示弹窗
+		show() {
+			if (this.data.length == 0) {
+				this.time = setInterval(() => {
+					this.getList()
+				}, 500)
+			}
+			if (this.$refs.view) {
+				(this.$refs.view as any).clearCheckboxRow();
+			}
+		}
+		getList() {
+			if (!this.$refs.view) {
+				if (this.timeNum > 5) {
+					clearInterval(this.time)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.time)
+			let query : any = (this.$refs.view as any).getQuery();
+			query.isLikeSearch = '1';
+			(this as any).$request({
+				url: '/maindata/maindataMaterialSku/page',
+				method: 'get',
+				params: query
+			}).then((res : any) => {
+				if (res.data.records) {
+					(this.$refs.view as any).setTableValue(res.data.records);
+					this.data = res.data.records;
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.view as any).setPage(page)
+				}
+			})
+		}
+	}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 979 - 4
src/views/audit/outbound/index.vue

@@ -1,8 +1,983 @@
 <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>
+		<!-- 选择物料 -->
+		<productModal ref="product" :mulit="true" />
+	</div>
 </template>
 
-<script>
-</script>
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/order";
+	import productModal from "./components/productModal.vue";
+	import Focus from "./components/focus.vue";
+	@Component({ components: { productModal } })
+	export default class OrderTask extends Vue {
+		// 左边
+		tabType : any = 'all';
+		isAdd : any = false
+		// 右边
+		supplierInfo : any = {} // 机构信息
+		tableData : any = []
+		mergeObj : any = []
+		setStatusData : any = ''
+		timeNum = 0;
+		timer : any = null
+		config : any = {
+			attr: {
+				activeName: 'all'
+			},
+			// 单据
+			bill: {
+				tool: {
+					tools: {
+						save: true,
+					}
+				},
+				form: {
+					attr: {
+						size: 'small',
+						readonly: false,
+						rules: {
+							outOrderNo: [{
+								required: true, message: '请输入单据编号', trigger: 'blur'
+							}]
+						}
+					},
+					columns: [
+						[
+							{
+								span: 8,
+								label: '单据编号',
+								prop: 'outOrderNo',
+								component: 'by-input',
+							},
+							{
+								span: 8,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: Focus,
+							},
+							{
+								span: 8,
+								label: '经办人',
+								prop: 'operator',
+								component: 'by-input',
+							},
+							{
+								span: 8,
+								label: 'WMS编号',
+								prop: 'wmsId',
+								component: 'by-input',
+							},
+						],
+						[
+							{
+								span: 28,
+								label: '备注',
+								slot: true,
+								prop: 'remark',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										placeholder: '请输入备注',
+										type: 'textarea'
+									},
+								}
+							},
+						]
+					]
+				},
+				tableConfig: [
+					{
+						tool: {
+							tools: {
+								add: true
+							}
+						},
+						table: {
+							attr: {
+								size: 'mini',
+								height: 500,
+								align: 'center',
+								readonly: true
+							},
+							columns:
+								[{
+									width: 300,
+									title: '物料名称',
+									field: 'materialName',
+								},
+								{
+									width: 140,
+									title: '单位',
+									field: 'unit',
+								},
+								{
+									width: 140,
+									title: '数量',
+									field: 'number',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+											defaultValue: 1,
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '已交付数量',
+									field: 'deliveryNumber',
+								},
+								{
+									width: 140,
+									title: '单价',
+									field: 'unitPrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '实际金额',
+									field: 'realityPrice',
+								},
+								{
+									width: 140,
+									title: '优惠金额',
+									field: 'prePrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+											defaultValue: '0',
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '合计金额',
+									field: 'totalPrice',
+								},
+								{
+									width: 90,
+									title: '操作',
+									action: true,
+									plugins: [{
+										icon: 'el-icon-delete',
+										name: '删除',
+										audit: '',
+										event: {
+											click: (item : any) => {
+												(this as any).changeTable(item)
+											}
+										}
+									}]
+								},
+								]
+						}
+					}
+				]
+			},
+			// 已提交
+			smt: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'outOrderNo',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'outOrderNo',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 150,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 150,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 120,
+							title: '收货人',
+							field: 'receive',
+						},
+						{
+							width: 120,
+							title: '收货地址',
+							field: 'receiveAddress',
+						},
+						{
+							width: 120,
+							title: '联系方式',
+							field: 'receivePhone',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).setReadonly(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 草稿箱
+			draftsBox: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'outOrderNo',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						smt: true,
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'outOrderNo',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 150,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 150,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 120,
+							title: '收货人',
+							field: 'receive',
+						},
+						{
+							width: 120,
+							title: '收货地址',
+							field: 'receiveAddress',
+						},
+						{
+							width: 120,
+							title: '联系方式',
+							field: 'receivePhone',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).openEdit(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 综合
+			all: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'outOrderNo',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'outOrderNo',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 150,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 150,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 120,
+							title: '收货人',
+							field: 'receive',
+						},
+						{
+							width: 120,
+							title: '收货地址',
+							field: 'receiveAddress',
+						},
+						{
+							width: 120,
+							title: '联系方式',
+							field: 'receivePhone',
+						},
+						{
+							width: 120,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).openEdit(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 回收站
+			recycleBin: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'outOrderNo',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 150,
+							title: '单据编号',
+							field: 'outOrderNo',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 150,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 150,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 120,
+							title: '收货人',
+							field: 'receive',
+						},
+						{
+							width: 120,
+							title: '收货地址',
+							field: 'receiveAddress',
+						},
+						{
+							width: 120,
+							title: '联系方式',
+							field: 'receivePhone',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								// icon: 'el-icon-edit',
+								name: '查看',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).setReadonly(e)
+									}
+								}
+							}]
+						}
+					]
+				}
 
-<style>
-</style>
+			}
+		}
+		created() {
+			this.timer = setInterval(() => {
+				this.getDataList()
+			}, 500)
+		}
+		// 获取机构数据
+		getSupplierModal(e : any) {
+			this.supplierInfo = e;
+		}
+		// 监听表格数据变化
+		onChangeRow(e : any) {
+			console.log(e);
+		}
+		// 保存
+		onSave(e : any) {
+			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.organizationName) return this.$message.warning('请选择机构名称');
+				// 子表数据
+				query.suborderList = this.tableData;
+				if (query.suborderList.length > 0) {
+					query.suborderList.map((v : any) => {
+						v.taskOrderId = query.id
+					})
+				};
+				// 表格删除
+				query.suborderList.map((v : any, i : any) => {
+					if (v.isDeleted === 1 && !v.id) {
+						v.splice(i, 1)
+					}
+				});
+				if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
+				console.log('保存参数query ==> ', query);
+
+				if (this.isAdd) {
+					query.submitState = 0
+					console.log('保存进草稿箱 ==>', query);
+					api.saveList(query, 'supplyOutOrder').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(res.msg);
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+							(this.$refs.bill as any).setBillFormValue({});
+						} else this.$message.error(res.msg);
+					})
+				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+					if (this.tabType === 'draftsBox') query.submitState = 0;
+					console.log('保存 ==>', query);
+					api.updateList(query, 'supplyOutOrder').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(res.msg);
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+							(this.$refs.bill as any).setBillFormValue({});
+						} else this.$message.error(res.msg);
+					})
+				};
+			})
+		}
+		// 打开新增
+		onAdd(e : any) {
+			console.log('新增 ==>', e);
+			if (e === 'billTable_0') {
+				(this.$refs.product as any).setShow(true); // 打开sku弹窗
+				let obj = (this.$refs.bill as any).getBillFormValue();
+				if (!this.tableData) this.tableData = obj.suborderList;
+				console.log('this.tableData ==> ', this.tableData);
+				(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+			} else {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.form.attr.readonly = false; // 设置只读
+				billConfig.tool.tools = { save: true, };
+				if (e === 'all') {
+					billConfig.tool.tools = { save: true, smt: true };
+					this.tableData = [];
+					(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+				}
+				billConfig.tableConfig[0].tool.tools = { add: true };
+				this.isAdd = true;
+				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
+			};
+			(this.$refs.bill as any).showTab = 'bill';
+		}
+		// 打开编辑
+		openEdit(e : any) {
+			console.log('编辑this.tabType ==>', this.tabType);
+			if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+				e = e.row ? e.row : e;
+				console.log('编辑 ==>', e);
+				if (this.tabType === 'all' && e.submitState === 1) return this.setReadonly(e);
+				let data = e.suborderList
+				data.map((v : any, i : any) => {
+					v.dataIndex = i
+				});
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.form.attr.readonly = false; // 设置只读
+				billConfig.tool.tools = { save: true, };
+				if (this.tabType === 'draftsBox' || e.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
+				billConfig.tableConfig[0].tool.tools = { add: true };
+				this.tableData = data;
+				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
+				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+				this.isAdd = false;
+				(this.$refs.bill as any).showTab = 'bill';
+			} else {
+				this.setReadonly(e.row ? e.row : e);
+			};
+		}
+		// 设置只读
+		setReadonly(e : any) {
+			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
+			readonly.form.attr.readonly = true; // 设置只读
+			readonly.tool.tools = {};
+			readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
+			readonly.tableConfig[0].tool.tools = {};
+			console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
+			let data = e.suborderList;
+			(this.$refs.bill as any).setBillConfig(readonly);
+			(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
+			(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+			this.isAdd = false;
+			(this.$refs.bill as any).showTab = 'bill';
+
+		}
+		// 切换tab栏
+		clickTab(e : any) {
+			console.log('切换tab ==> ', e);
+			this.tabType = e;
+			// submitState: 提交状态
+			if (e === 'all') this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 草稿箱数据
+			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
+			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
+			if (e === 'recycleBin') this.getSelectDeleteList({ pageNo: 1, pageSize: 10 }); // 回收站数据
+		}
+		// 初始化
+		getDataList() {
+			if (!this.$refs.bill) {
+				if (this.timeNum > 5) {
+					clearInterval(this.timer)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.timer)
+			this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 综合数据
+		}
+		// 分页
+		pagination(e : any) {
+			console.log('分页 ==> ', e);
+			let query = {
+				pageNo: e.page.pageNum,
+				pageSize: e.page.pageSize,
+			};
+			let loading = this.$loading({ target: '.main-container' });
+			if (e.type === 'recycleBin') {
+				api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
+					if (res.code === 200) {
+						(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
+						loading.close()
+					} else this.failHandle(res)
+				});
+			} else {
+				api.pageList(query, 'supplyOutOrder').then((res : any) => {
+					if (res.code === 200) {
+						(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
+						loading.close()
+					} else this.failHandle(res)
+				})
+			}
+
+		}
+		// 获取分页数据
+		getPageList(query : any, type : any) {
+			api.pageList(query, 'supplyOutOrder').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage(type, page)
+				} else this.failHandle(res)
+			})
+		}
+		// 回收站数据
+		getSelectDeleteList(query : any) {
+			api.selectDeleteList(query, 'supplyOutOrder').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage('recycleBin', page)
+				} else this.failHandle(res)
+			});
+		}
+		// 搜索
+		search(parames : any) {
+			let query = parames.value
+			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
+			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
+			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({}) // 回收站数据
+		}
+		// 单据表格删除
+		changeTable(item : any) {
+			this.$confirm('确定删除吗!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				this.tableData[item.dataIndex].isDeleted = 1;
+				let newData = this.tableData.filter((res : any) => res.isDeleted === 0);
+				console.log('原表格数据 ==> ', this.tableData);
+				console.log('新表格数据 ==> ', newData);
+				(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+				this.$message.success('删除成功');
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 工具栏删除
+		onDelete(e : any) {
+			console.log('工具栏删除 ==> ', e);
+			let selectData = (this.$refs.bill as any).getTableSelectData(e)
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message({ type: 'warning', message: '请选择删除数据' })
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: ids }, 'supplyOutOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.clickTab(this.tabType);
+						this.$message.success('删除成功!');
+					} else this.failHandle(res)
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 操作删除
+		doDelete2(item : any) {
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: item.id }, 'supplyOutOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.clickTab(this.tabType);
+						this.$message.success('删除成功!');
+					} else this.failHandle(res)
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 运行错误
+		failHandle(err : any) {
+			let msg = err.msg ? err.msg : '运行错误!';
+			this.$message.error(msg)
+		}
+	}
+</script>

+ 128 - 0
src/views/audit/saleOrder/components/byBill/billModule.vue

@@ -0,0 +1,128 @@
+<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>
+</template>
+
+<script lang="ts">
+import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+@Component
+export default class BillModule extends Vue {
+  config:any={}
+  hideSearch = false
+
+  @Prop()
+  propConfig:any
+
+  get searchConfig(){
+    return this.config?.search ? this.config.search : null
+  }
+
+  get toolConfig(){
+    return this.config?.tool ? this.config.tool : null
+  }
+
+  get tableConfig(){
+    return this.config?.table ? this.config.table : null
+  }
+
+  created(){
+    if(this.propConfig){
+      this.setConfig(this.propConfig)
+    }
+  }
+
+  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)
+    }
+  }
+
+  //获取搜索值
+  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)
+    }
+  }
+}
+</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;
+    }
+  }
+  
+}
+</style>

+ 473 - 0
src/views/audit/saleOrder/components/byBill/byBill.vue

@@ -0,0 +1,473 @@
+<template>
+  <div class="bill">
+    <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 == '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-if="returnOrderConfig" :class="{'onBill':showTab == 'returnOrder'}" @click="tabChange('returnOrder')">退单</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" v-if="billConfig" :class="{'on-show':showTab == 'bill'}">
+        <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-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-if="returnOrderConfig" :class="{'on-show':showTab == 'returnOrder'}">
+			  <bill-module :propConfig="returnOrderConfig" ref="returnOrder" @clickHandle="clickHandle($event,'returnOrder')" @search="search($event,'returnOrder')" 
+			  @resert="resert('returnOrder')" @pagination="paginationChange($event,'returnOrder')" @detail="detail($event,'returnOrder')" />
+			</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:{},  //工具栏配置
+    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
+  activeSource='source0'
+  //引单
+  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 returnOrderConfig(){
+		return this.config?.returnOrder ? this.config.returnOrder : null;
+	}
+  //自定义插槽
+  get customs(){
+    return this.config?.customs ? this.config.customs : []
+  }
+
+  created(){
+    if(this.propConfig){
+      this.setConfig(this.propConfig)
+    }
+  }
+
+  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
+    })
+  }
+
+  //设置引单表格数据
+  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;
+  }
+
+  //设置单据表单数据
+  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);
+    }
+  }
+
+  //分页变化
+  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);
+	}
+}
+</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;
+    // box-sizing: border-box;
+    .bill-tab{
+      width: 200px;
+      height: 100%;
+      transition: all .5s;
+      overflow: hidden;
+    }
+    .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-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;
+      }
+    }
+    .on-show{
+      opacity: 1;
+      z-index: 1;
+    }
+  }
+}
+</style>

+ 264 - 141
src/views/audit/saleOrder/index.vue

@@ -1,19 +1,20 @@
 <template>
 	<div>
-		<by-bill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @onAdd="onAdd" @onOrder="onOrder"
-			@resert="resert" @detail="openEdit" @onRefresh="onRefresh" @pagination="pagination">
-		</by-bill>
-
+		<byBill :propConfig="config" @search="search" @onSmt="doSave" ref="bill" @resert="getDataList" @detail="openEdit"
+			@onRefresh="onRefresh" @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 @confirm="confirm">
 			<template #title>
 				<!-- <span>拆单</span> -->
 			</template>
 			<template #default>
-				<div class="fl" style="width: 40%; margin-right: 20%;">
+				<div class="fl" style="width: 40%;">
 					<div style="margin-bottom: 20px;">主单销售数据</div>
 					<by-table ref="leftTable" :propConfig="leftTableConfig"></by-table>
 				</div>
+				<div class="fl" style="font-size: 80px;margin: 200px 6% 0 6%;transform: rotate(90deg);"><i
+						class="el-icon-sort"></i></div>
 				<div class="fl" style="width: 40%;">
 					<div style="margin-bottom: 20px;">拆单销售数据</div>
 					<by-table ref="rightTable" :propConfig="rightTableConfig" @onChangeRow="rightChange"></by-table>
@@ -26,11 +27,13 @@
 <script lang="ts">
 	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
 	import api from "@/api/order";
-	@Component
+	import byBill from "./components/byBill/byBill.vue";
+	@Component({ components: { byBill } })
 	export default class OrderTask extends Vue {
 		vxeValue = false
 		timeNum = 0;
 		timer : any = null
+		regularData : any = [] // 固定值
 		leftTableConfig : any = {
 			attr: {
 				size: 'mini',
@@ -47,6 +50,14 @@
 						title: '数量',
 						field: 'number',
 					},
+					{
+						title: '已拆单数量',
+						field: 'splitOrderNumber',
+					},
+					{
+						title: '可拆单数量',
+						field: 'splitNumber',
+					}
 				]
 		}
 		rightTableConfig : any = {
@@ -81,15 +92,7 @@
 			// 单据
 			bill: {
 				tool: {
-					customTools: [
-						{
-							name: '拆单', icon: 'el-icon-plus', audit: [''], event: {
-								click: () => {
-									// (this as any).orderTaking()
-								}
-							}
-						}
-					]
+					customTools: []
 				},
 				form: {
 					attr: {
@@ -124,8 +127,8 @@
 							},
 							{
 								span: 8,
-								label: '货人',
-								prop: 'delivery',
+								label: '货人',
+								prop: 'consignee',
 								component: 'by-input',
 							},
 							{
@@ -264,16 +267,6 @@
 									}
 								}
 							},
-							{
-								span: 6,
-								label: '交货时间',
-								prop: 'deliveryData',
-								component: 'by-date-picker',
-								compConfig: {
-									format: 'yyyy-MM-dd',
-									type: 'datetime'
-								}
-							},
 						],
 					]
 				},
@@ -283,17 +276,10 @@
 						refresh: true
 					},
 					customTools: [
-						{
-							name: '入库', icon: 'el-icon-plus', audit: [''], event: {
-								click: () => {
-									// (this as any)
-								}
-							}
-						},
 						{
 							name: '退单', icon: 'el-icon-top', audit: [''], event: {
 								click: () => {
-									// (this as any)
+									(this as any).doBackOrder()
 								}
 							}
 						}
@@ -326,28 +312,154 @@
 						},
 						{
 							width: 90,
-							title: '货人',
-							field: 'delivery',
+							title: '货人',
+							field: 'consignee',
 						},
 						{
 							width: 120,
 							title: '联系方式',
-							field: 'deliveryPhone',
+							field: 'phone',
 						},
 						{
 							width: 150,
-							title: '交货时间',
-							field: 'deliveryData',
+							title: '计划交货时间',
+							field: 'planDeliveryData',
+						},
+						{
+							width: 150,
+							title: '确定交货时间',
+							field: 'affirmDeliveryData',
 						},
 						{
 							width: 150,
 							title: '交货地点',
-							field: 'deliveryAddress',
+							field: 'address',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '查看',
+								audit: '',
+								event: {
+									click: (item : any) => {
+										(this as any).openEdit(item)
+									}
+								}
+							}, {
+								name: '拆单',
+								event: {
+									click: (item : any) => (this as any).orderTaking(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 退单
+			returnOrder: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '退单编号',
+								prop: 'chargebackNo',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入退单编号',
+										clearable: true
+									}
+								}
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						search: true,
+						refresh: true
+					},
+				},
+				table: {
+					attr: {
+						height: 600,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 178,
+							title: '单据编号',
+							field: 'orderNumber',
+							isDetail: true,
+						},
+						{
+							width: 180,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 178,
+							title: '退单编号',
+							field: 'chargebackNo',
+						},
+						{
+							width: 90,
+							title: '收货人',
+							field: 'consignee',
 						},
 						{
 							width: 120,
-							title: '交货方式',
-							field: 'deliveryWay',
+							title: '联系方式',
+							field: 'phone',
+						},
+						{
+							width: 150,
+							title: '计划交货时间',
+							field: 'planDeliveryData',
+						},
+						{
+							width: 150,
+							title: '确定交货时间',
+							field: 'affirmDeliveryData',
+						},
+						{
+							width: 150,
+							title: '交货地点',
+							field: 'address',
 						},
 						{
 							width: 110,
@@ -378,51 +490,83 @@
 				this.getDataList()
 			}, 500)
 		}
-		// 刷新
-		onRefresh(n : string) {
-			console.log(n)
+		// 工具栏退单
+		doBackOrder() {
+			console.log((this as any).$refs.bill.getTableSelectData('all'));
+			let selectData = (this as any).$refs.bill.getTableSelectData('all');
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message({ type: 'warning', message: '请选择退单数据' })
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定退单吗!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.backOrder({ mid: ids }, 'supplyPurchaseOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.$message.success('退单成功!');
+						this.getDataList();
+					} else this.$message.error(res.msg)
+				})
+			}).catch(() => this.$message.info('已取消退单'));
 		}
 		// 右拆单数据变化
 		rightChange(e : any) {
-			console.log(e.number);
-			console.log(e.number >= 0);
-			if (e.number >= 0 && e.number) {
-
+			if (e.number && 0 <= e.number && e.number <= this.regularData[e.dataIndex].splitNumber) {
+				let leftTableData = (this.$refs.leftTable as any).getValue();
+				leftTableData[e.dataIndex].splitNumber = leftTableData[e.dataIndex].number - e.number;
+				(this.$refs.leftTable as any).setValue(leftTableData);
 			} else {
-				let rightForm = (this.$refs.rightTable as any).getValue();
-				rightForm[e.dataIndex].number = '0';
-				(this.$refs.rightTable as any).setValue(rightForm);
-				this.$message.warning('只能输入自然数');
+				let leftTableData = (this.$refs.leftTable as any).getValue();
+				let rifhtTableData = (this.$refs.rightTable as any).getValue();
+				rifhtTableData[e.dataIndex].number = '0';
+				leftTableData[e.dataIndex].splitNumber = leftTableData[e.dataIndex].number - leftTableData[e.dataIndex].splitOrderNumber;
+				(this.$refs.leftTable as any).setValue(leftTableData);
+				(this.$refs.rightTable as any).setValue(rifhtTableData);
+				this.$message.warning('输入值只能是自然数且不能大于可拆单数量');
 			}
 		}
-		// 拆单
+		// 打开拆单
 		orderTaking(item : any) {
 			this.vxeValue = true;
+			this.regularData = (this as any).$lodash.cloneDeep(item.suborderList);
 			let rightData = (this as any).$lodash.cloneDeep(item.suborderList);
+			this.regularData.map((v : any) => {
+				v.splitNumber = v.number - v.splitOrderNumber;
+			})
 			rightData.map((v : any, i : any) => {
 				v.number = '0';
 				v.dataIndex = i;
+				v.splitNumber = v.number - v.splitOrderNumber;
 			});
 			setTimeout(() => {
-				(this.$refs.leftTable as any).setValue(item.suborderList);
+				(this.$refs.leftTable as any).setValue(this.regularData);
 				(this.$refs.rightTable as any).setValue(rightData);
 			}, 0)
-			// let query : any = (this as any).$refs.bill.$refs.billForm.getValue();
-			// api.updateList(query, 'supplyPurchaseOrder').then((res : any) => {
-			// 	if (res.code === 200) {
-			// 		this.$message({
-			// 			type: 'success',
-			// 			message: '保存成功!'
-			// 		});
-			// 		this.getDataList();
-			// 		(this.$refs.bill as any).showTab = 'all';
-			// 		(this.$refs.bill as any).setBillFormValue({});
-			// 	} else this.failHandle(res)
-			// })
 		}
 		// 确认拆单
-		confirm(e : any) {
-			console.log(e);
+		confirm() {
+			let leftTableData = (this.$refs.leftTable as any).getValue();
+			let rifhtTableData = (this.$refs.rightTable as any).getValue();
+			let checkNumber : any = []
+			console.log(leftTableData);
+			console.log(rifhtTableData);
+			rifhtTableData.map((v : any) => {
+				checkNumber.push(v.number);
+			});
+			console.log(checkNumber.indexOf('0'));
+			// api.splitOrder(leftTableData, 'supplyPurchaseOrder').then((res : any) => {
+			// 	if (res.code === 200) {
+			// 		this.$message.success('拆单成功!');
+			// 		this.getPageList({ pageSize: 20, pageNo: 1 }, 'all'); // 综合数据
+			// 	} else this.$message.error(res.msg);
+			// })
+			// this.$message.warning('请输入拆单销售数据')
 		}
 		// 保存新增
 		doSave() {
@@ -438,7 +582,7 @@
 						this.getDataList();
 						(this.$refs.bill as any).showTab = 'all';
 						(this.$refs.bill as any).setBillFormValue({});
-					} else this.failHandle(res)
+					} else this.$message.error(res.msg);
 				})
 			})
 		}
@@ -450,27 +594,8 @@
 				this.timeNum++;
 				return
 			}
-			clearInterval(this.timer)
-			// submitState: 提交状态
+			clearInterval(this.timer);
 			this.getPageList({ pageSize: 20, pageNo: 1 }, 'all'); // 综合数据
-			// recycleBin
-			// this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
-			// this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
-			// this.getSelectDeleteList('supplyPurchaseOrder') // 回收站数据
-		}
-		pagination(e : any) {
-			console.log(e);
-			let query = {
-				pageNo: e.page.pageNum,
-				pageSize: e.page.pageSize,
-			};
-			let loading = this.$loading({ target: '.main-container' })
-			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
-					loading.close()
-				} else this.failHandle(res)
-			})
 		}
 		// 获取分页数据
 		getPageList(query : any, type : any) {
@@ -483,71 +608,69 @@
 						total: res.data.total //总条数
 					};
 					(this.$refs.bill as any).setTablePage(type, page)
-				} else this.failHandle(res)
+				} else this.$message.error(res.msg);
 			})
 		}
-		// 回收站数据
-		getSelectDeleteList(data : any) {
-			api.selectDeleteList(data, 'supplyTaskOrder').then((res : any) => {
-				if (res.code === 200) {
-					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data);
-					let page = {
-						pageNo: res.data.current, //当前页
-						pageSize: res.data.size, //每页条数
-						total: res.data.total //总条数
-					};
-					(this.$refs.bill as any).setTablePage('recycleBin', page)
-				} else this.failHandle(res)
-			});
-		}
-		// 打开新增
-		onAdd(e : any) {
-			console.log(e);
-			// this.orderType = '新增';
-			(this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
-			(this.$refs.bill as any).showTab = 'bill';
-		}
 		// 打开编辑
 		openEdit(e : any) {
-			console.log(e);
 			e = e.row ? e.row : e;
-			// this.orderType = '编辑';
+			let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+			billConfig.tool.customTools = [
+				{
+					name: '拆单', icon: 'el-icon-minus', audit: [''], event: {
+						click: () => {
+							(this as any).orderTaking(e)
+						}
+					}
+				},
+				{
+					name: '退单', icon: 'el-icon-bottom', audit: [''], event: {
+						click: () => {
+							// (this as any)
+						}
+					}
+				}
+			];
+			(this.$refs.bill as any).setBillConfig(billConfig);
 			(this.$refs.bill as any).setBillFormValue(e); // 设置单据表单数据
 			(this.$refs.bill as any).setBillTableValue(e.suborderList, 0);// 设置第1张单据表格数据
 			(this.$refs.bill as any).showTab = 'bill';
 		}
+		// 导航切换
+		clickTab(e : any) {
+			console.log('导航切换 ==> ', e);
+			if (e === 'all') this.getDataList();
+			if (e === 'bill') {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.tool.customTools = [];
+				(this.$refs.bill as any).setBillConfig(billConfig);
+			}
+		}
+		// 分页
+		pagination(e : any) {
+			let query = {
+				pageNo: e.page.pageNum,
+				pageSize: e.page.pageSize,
+			};
+			let loading = this.$loading({ target: '.main-container' })
+			api.pageList(query, 'supplyPurchaseOrder').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
+					loading.close()
+				} else this.$message.error(res.msg);
+			})
+		}
 		// 搜索
 		search(parames : any) {
 			let query = parames.value
 			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
 			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
-			this.getPageList(query, parames.type) // 获取分页数据
-		}
-		// 接单
-		getOrder(item : any) {
-			api.ordersaccepting({ ids: item.id }, 'supplyPurchaseOrder').then((res : any) => {
-				if (res.code === 200) {
-					// 是否跳转销售订单 this.$router.push()
-					this.getDataList();
-					this.$message({
-						type: 'success',
-						message: '接单成功!'
-					});
-				} else this.failHandle(res)
-
-			})
-		}
-		resert(parames : any) {
-			console.log('重置回传参数', parames);
+			this.getPageList(query, parames.type) // 获取综合分页数据
 		}
-		// 工具栏接单
-		onOrder(n : string) {
-			console.log(n + ':工具栏执行操作onOrder')
-		}
-		// 运行错误
-		failHandle(err : any) {
-			let msg = err.msg ? err.msg : '运行错误!';
-			this.$message.error(msg)
+		// 刷新
+		onRefresh(e : string) {
+			(this as any).$refs.bill.$refs[e].resert();
+			this.getPageList({ pageSize: 20, pageNo: 1 }, 'all'); // 综合数据
 		}
 	}
 </script>

+ 28 - 0
src/views/audit/warehousing/components/focus.vue

@@ -0,0 +1,28 @@
+<template>
+	<div>
+		<el-input placeholder="请选择供应商" v-model="propValue" class="input-organizationName" clearable :readonly="true">
+			<el-button slot="append" icon="el-icon-more" @click="handleSupplier"></el-button>
+		</el-input>
+		<!-- 选择机构名称 -->
+		<supplier-modal ref="supplierModal" @confirm="confirm" />
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	@Component
+	export default class Focus extends Vue {
+		@Prop()
+		propValue : any
+		handleSupplier() {
+			(this.$refs.supplierModal as any).setShow(true);
+		}
+		// 确定机构名称
+		confirm(e : any) {
+			this.$emit('getSupplierModal', e[0])
+		}
+	}
+</script>
+
+<style>
+</style>

+ 172 - 0
src/views/audit/warehousing/components/productModal.vue

@@ -0,0 +1,172 @@
+<template>
+	<vxe-modal v-model="value" id="productDialogModal" :width="width?width+'px':'80%'" @show="show"
+		:height="height?height+'px':'80%'" min-width="500" min-height="400" show-zoom resize transfer show-footer
+		@confirm="confirm">
+		<template #title>
+			<span>选择商品</span>
+		</template>
+		<template #default>
+			<module-view :propConfig="config" ref="view" @pagination="getList" @search="getList" @resert="getList"
+				@clickHandle="clickHandle" />
+		</template>
+	</vxe-modal>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	@Component
+	export default class ProductModal extends Vue {
+		value = false
+		time : any;
+		timeNum = 0;
+		data : Array<any> = []
+
+		@Prop()
+		width ?: number
+
+		@Prop()
+		height ?: number
+
+		@Prop()
+		mulit ?: boolean
+
+		config : any = {
+			search: {
+				attr: {
+					size: 'mini'
+				},
+				columns: [
+					[{
+						span: 6,
+						label: '标题',
+						prop: 'skuTitle',
+						component: 'by-input',
+						compConfig: {
+							attr: {
+								clearable: true,
+								placeholder: '请输入名称'
+							}
+						}
+					}]
+				]
+			},
+			tool: {
+				tools: {
+					search: true,
+					refresh: true
+				}
+			},
+			table: {
+				attr: {
+					size: 'mini',
+					seq: true,
+					align: 'center',
+					checkbox:true,
+					pageSize: 10
+				},
+				columns:
+					[
+						{
+							title: '标题',
+							field: 'skuTitle',
+							// width: 150
+						},
+						{
+							title: '副标题',
+							field: 'skuSubtitle',
+							// width: 150
+						},
+						{
+							title: '规格',
+							field: 'materialSpec'
+						},
+						{
+							title: '单位',
+							field: 'unit'
+						},
+						{
+							title: '单价',
+							field: 'price'
+						},
+					]
+			},
+			// request:{
+			//   url:'/system/maindataMaterial/page'
+			// }
+		}
+		brandData : Array<any> = []
+
+		getBrandData() {
+			return this.brandData;
+		}
+
+		clickHandle(n : string) {
+			if (n == 'onRefresh') {
+				this.getList()
+			}
+		}
+
+		setShow(v : boolean) {
+			this.value = v;
+		}
+
+		mounted() { }
+
+		//确定
+		confirm() {
+			let data : Array<any> = this.getSelectdata();
+			this.$emit('confirm', data);
+			this.value = false;
+		}
+		//获取已选中表格数据
+		getSelectdata() {
+			let data : Array<any> = [];
+			if (this.$refs.view) {
+				data = (this.$refs.view as any).getSelectData()
+			}
+			return data;
+		}
+		//显示弹窗
+		show() {
+			if (this.data.length == 0) {
+				this.time = setInterval(() => {
+					this.getList()
+				}, 500)
+			}
+			if (this.$refs.view) {
+				(this.$refs.view as any).clearCheckboxRow();
+			}
+		}
+		getList() {
+			if (!this.$refs.view) {
+				if (this.timeNum > 5) {
+					clearInterval(this.time)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.time)
+			let query : any = (this.$refs.view as any).getQuery();
+			query.isLikeSearch = '1';
+			(this as any).$request({
+				url: '/maindata/maindataMaterialSku/page',
+				method: 'get',
+				params: query
+			}).then((res : any) => {
+				if (res.data.records) {
+					(this.$refs.view as any).setTableValue(res.data.records);
+					this.data = res.data.records;
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.view as any).setPage(page)
+				}
+			})
+		}
+	}
+</script>
+<style lang="scss" scoped>
+
+</style>

+ 944 - 0
src/views/audit/warehousing/index.vue

@@ -0,0 +1,944 @@
+<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>
+		<!-- 选择物料 -->
+		<productModal ref="product" :mulit="true" />
+	</div>
+</template>
+
+<script lang="ts">
+	import { Component, Prop, Vue, Watch } from "vue-property-decorator";
+	import api from "@/api/order";
+	import productModal from "./components/productModal.vue";
+	import Focus from "./components/focus.vue";
+	@Component({ components: { productModal } })
+	export default class OrderTask extends Vue {
+		// 左边
+		tabType : any = 'all';
+		isAdd : any = false
+		// 右边
+		supplierInfo : any = {} // 机构信息
+		tableData : any = []
+		mergeObj : any = []
+		setStatusData : any = ''
+		timeNum = 0;
+		timer : any = null
+		config : any = {
+			attr: {
+				activeName: 'all'
+			},
+			// 单据
+			bill: {
+				tool: {
+					tools: {
+						save: true,
+					}
+				},
+				form: {
+					attr: {
+						size: 'small',
+						readonly: false,
+						rules: {
+							orderNumber: [{
+								required: true, message: '请输入单据编号', trigger: 'blur'
+							}]
+						}
+					},
+					columns: [
+						[
+							{
+								span: 8,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+							},
+							{
+								span: 8,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: Focus,
+							},
+							{
+								span: 8,
+								label: '经办人',
+								prop: 'operator',
+								component: 'by-input',
+							},
+							{
+								span: 8,
+								label: 'WMS编码',
+								prop: 'wmsId',
+								component: 'by-input',
+							},
+						],
+						[
+							{
+								span: 28,
+								label: '备注',
+								slot: true,
+								prop: 'remark',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										size: 'mini',
+										placeholder: '请输入备注',
+										type: 'textarea'
+									},
+								}
+							},
+						]
+					]
+				},
+				tableConfig: [
+					{
+						tool: {
+							tools: {
+								add: true
+							}
+						},
+						table: {
+							attr: {
+								size: 'mini',
+								height: 500,
+								align: 'center',
+								readonly: true
+							},
+							columns:
+								[{
+									width: 300,
+									title: '物料名称',
+									field: 'materialName',
+								},
+								{
+									width: 140,
+									title: '单位',
+									field: 'unit',
+								},
+								{
+									width: 140,
+									title: '数量',
+									field: 'number',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+											defaultValue: 1,
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '已交付数量',
+									field: 'deliveryNumber',
+								},
+								{
+									width: 140,
+									title: '单价',
+									field: 'unitPrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '实际金额',
+									field: 'realityPrice',
+								},
+								{
+									width: 140,
+									title: '优惠金额',
+									field: 'prePrice',
+									component: 'by-input',
+									compConfig: {
+										attr: {
+											size: 'mini',
+											type: 'number',
+											defaultValue: '0',
+										},
+									}
+								},
+								{
+									width: 140,
+									title: '合计金额',
+									field: 'totalPrice',
+								},
+								{
+									width: 90,
+									title: '操作',
+									action: true,
+									plugins: [{
+										icon: 'el-icon-delete',
+										name: '删除',
+										audit: '',
+										event: {
+											click: (item : any) => {
+												(this as any).changeTable(item)
+											}
+										}
+									}]
+								},
+								]
+						}
+					}
+				]
+			},
+			// 已提交
+			smt: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 200,
+							title: '单据编号',
+							field: 'orderNumber',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 200,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 200,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 250,
+							title: '备注',
+							field: 'remark',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).setReadonly(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 草稿箱
+			draftsBox: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						smt: true,
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 200,
+							title: '单据编号',
+							field: 'orderNumber',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 200,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 200,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 250,
+							title: '备注',
+							field: 'remark',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).openEdit(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 综合
+			all: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						add: true,
+						delete: true,
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 200,
+							title: '单据编号',
+							field: 'orderNumber',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 200,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 200,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 250,
+							title: '备注',
+							field: 'remark',
+						},
+						{
+							width: 120,
+							title: '操作',
+							action: true,
+							plugins: [{
+								icon: 'el-icon-edit',
+								name: '编辑',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).openEdit(e)
+									}
+								}
+							}, {
+								name: '删除',
+								event: {
+									click: (item : any) => (this as any).doDelete2(item)
+								}
+							}]
+						}
+					]
+				}
+			},
+			// 回收站
+			recycleBin: {
+				search: {
+					attr: {
+						size: 'mini',
+					},
+					columns: [
+						[
+							{
+								span: 6,
+								label: '单据编号',
+								prop: 'orderNumber',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入单据编号',
+										clearable: true
+									}
+								}
+							},
+							{
+								span: 6,
+								label: '机构名称',
+								prop: 'organizationName',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入机构名称',
+										clearable: true
+									},
+								},
+							},
+							{
+								span: 6,
+								label: '财务系统单据',
+								prop: 'financeOrderId',
+								component: 'by-input',
+								compConfig: {
+									attr: {
+										placeholder: '请输入财务系统单据',
+										clearable: true
+									},
+								},
+							},
+						],
+					]
+				},
+				tool: {
+					tools: {
+						search: true,
+						refresh: true
+					}
+				},
+				table: {
+					attr: {
+						height: 620,
+						size: 'mini',
+						seq: true,
+						align: 'center',
+						checkbox: true
+					},
+					columns: [
+						{
+							width: 200,
+							title: '单据编号',
+							field: 'orderNumber',
+							isDetail: true,
+						},
+						{
+							width: 200,
+							title: '机构名称',
+							field: 'organizationName',
+						},
+						{
+							width: 200,
+							title: '财务系统单据',
+							field: 'financeOrderId',
+						},
+						{
+							width: 200,
+							title: 'WMS编号',
+							field: 'wmsId',
+						},
+						{
+							width: 120,
+							title: '经办人',
+							field: 'operator',
+						},
+						{
+							width: 250,
+							title: '备注',
+							field: 'remark',
+						},
+						{
+							width: 110,
+							title: '操作',
+							action: true,
+							plugins: [{
+								// icon: 'el-icon-edit',
+								name: '查看',
+								audit: '',
+								event: {
+									click: (e : any) => {
+										(this as any).setReadonly(e)
+									}
+								}
+							}]
+						}
+					]
+				}
+
+			}
+		}
+		created() {
+			this.timer = setInterval(() => {
+				this.getDataList()
+			}, 500)
+		}
+		// 获取机构数据
+		getSupplierModal(e : any) {
+			this.supplierInfo = e;
+		}
+		// 监听表格数据变化
+		onChangeRow(e : any) {
+			console.log(e);
+		}
+		// 保存
+		onSave(e : any) {
+			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.organizationName) return this.$message.warning('请选择机构名称');
+				// 子表数据
+				query.suborderList = this.tableData;
+				if (query.suborderList.length > 0) {
+					query.suborderList.map((v : any) => {
+						v.taskOrderId = query.id
+					})
+				};
+				// 表格删除
+				query.suborderList.map((v : any, i : any) => {
+					if (v.isDeleted === 1 && !v.id) {
+						v.splice(i, 1)
+					}
+				});
+				if (query.deliveryData) query.deliveryData = query.deliveryData + ' 00:00:00';
+				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);
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+							(this.$refs.bill as any).setBillFormValue({});
+						} else this.$message.error(res.msg);
+					})
+				} else if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+					if (this.tabType === 'draftsBox') query.submitState = 0;
+					console.log('保存 ==>', query);
+					api.updateList(query, 'supplyEntryOrder').then((res : any) => {
+						if (res.code === 200) {
+							this.$message.success(res.msg);
+							this.getDataList();
+							(this.$refs.bill as any).showTab = 'all';
+							(this.$refs.bill as any).setBillFormValue({});
+						} else this.$message.error(res.msg);
+					})
+				};
+			})
+		}
+		// 打开新增
+		onAdd(e : any) {
+			console.log('新增 ==>', e);
+			if (e === 'billTable_0') {
+				(this.$refs.product as any).setShow(true); // 打开sku弹窗
+				let obj = (this.$refs.bill as any).getBillFormValue();
+				if (!this.tableData) this.tableData = obj.suborderList;
+				console.log('this.tableData ==> ', this.tableData);
+				(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+			} else {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.form.attr.readonly = false; // 设置只读
+				billConfig.tool.tools = { save: true, };
+				if (e === 'all') {
+					billConfig.tool.tools = { save: true, smt: true };
+					this.tableData = [];
+					(this.$refs.bill as any).setBillTableValue(this.tableData, 0);// 设置第1张单据表格数据
+				}
+				billConfig.tableConfig[0].tool.tools = { add: true };
+				this.isAdd = true;
+				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue({}); // 设置单据表单数据
+			};
+			(this.$refs.bill as any).showTab = 'bill';
+		}
+		// 打开编辑
+		openEdit(e : any) {
+			console.log('编辑this.tabType ==>', this.tabType);
+			if (this.tabType === 'all' || this.tabType === 'draftsBox') {
+				e = e.row ? e.row : e;
+				console.log('编辑 ==>', e);
+				if (this.tabType === 'all' && e.submitState === 1) return this.setReadonly(e);
+				let data = e.suborderList
+				data.map((v : any, i : any) => {
+					v.dataIndex = i
+				});
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.form.attr.readonly = false; // 设置只读
+				billConfig.tool.tools = { save: true, };
+				if (this.tabType === 'draftsBox' || e.submitState === 0) billConfig.tool.tools = { save: true, smt: true };
+				billConfig.tableConfig[0].tool.tools = { add: true };
+				this.tableData = data;
+				(this.$refs.bill as any).setBillConfig(billConfig);
+				(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
+				(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+				this.isAdd = false;
+				(this.$refs.bill as any).showTab = 'bill';
+			} else {
+				this.setReadonly(e.row ? e.row : e);
+			};
+		}
+		// 设置只读
+		setReadonly(e : any) {
+			let readonly = (this as any).$lodash.cloneDeep(this.config.bill);
+			readonly.form.attr.readonly = true; // 设置只读
+			readonly.tool.tools = {};
+			readonly.tableConfig[0].table.columns = readonly.tableConfig[0].table.columns.filter((v : any) => v.title != '操作');
+			readonly.tableConfig[0].tool.tools = {};
+			console.log(readonly.tableConfig[0].table.columns.slice(0, -1));
+			let data = e.suborderList;
+			(this.$refs.bill as any).setBillConfig(readonly);
+			(this.$refs.bill as any).setBillFormValue(e);// 设置单据表单数据
+			(this.$refs.bill as any).setBillTableValue(data, 0);// 设置第1张单据表格数据
+			this.isAdd = false;
+			(this.$refs.bill as any).showTab = 'bill';
+
+		}
+		// 切换tab栏
+		clickTab(e : any) {
+			console.log('切换tab ==> ', e);
+			this.tabType = e;
+			// submitState: 提交状态
+			if (e === 'all') this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 草稿箱数据
+			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
+			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
+			if (e === 'recycleBin') this.getSelectDeleteList({ pageNo: 1, pageSize: 10 }); // 回收站数据
+		}
+		// 初始化
+		getDataList() {
+			if (!this.$refs.bill) {
+				if (this.timeNum > 5) {
+					clearInterval(this.timer)
+				}
+				this.timeNum++;
+				return
+			}
+			clearInterval(this.timer)
+			this.getPageList({ pageSize: 10, pageNo: 1 }, 'all'); // 综合数据
+		}
+		// 分页
+		pagination(e : any) {
+			console.log('分页 ==> ', e);
+			let query = {
+				pageNo: e.page.pageNum,
+				pageSize: e.page.pageSize,
+			};
+			let loading = this.$loading({ target: '.main-container' });
+			if (e.type === 'recycleBin') {
+				api.selectDeleteList(query, 'supplyEntryOrder').then((res : any) => {
+					if (res.code === 200) {
+						(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
+						loading.close()
+					} else this.failHandle(res)
+				});
+			} else {
+				api.pageList(query, 'supplyEntryOrder').then((res : any) => {
+					if (res.code === 200) {
+						(this.$refs.bill as any).setTabTableValue(e.type, res.data.records);
+						loading.close()
+					} else this.failHandle(res)
+				})
+			}
+
+		}
+		// 获取分页数据
+		getPageList(query : any, type : any) {
+			api.pageList(query, 'supplyEntryOrder').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue(type, res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage(type, page)
+				} else this.failHandle(res)
+			})
+		}
+		// 回收站数据
+		getSelectDeleteList(query : any) {
+			api.selectDeleteList(query, 'supplyEntryOrder').then((res : any) => {
+				if (res.code === 200) {
+					(this.$refs.bill as any).setTabTableValue('recycleBin', res.data.records);
+					let page = {
+						pageNo: res.data.current, //当前页
+						pageSize: res.data.size, //每页条数
+						total: res.data.total //总条数
+					};
+					(this.$refs.bill as any).setTablePage('recycleBin', page)
+				} else this.failHandle(res)
+			});
+		}
+		// 搜索
+		search(parames : any) {
+			let query = parames.value
+			if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
+			if (parames.type === 'smt') query.submitState = 1 // 已提交数据
+			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({}) // 回收站数据
+		}
+		// 单据表格删除
+		changeTable(item : any) {
+			this.$confirm('确定删除吗!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				this.tableData[item.dataIndex].isDeleted = 1;
+				let newData = this.tableData.filter((res : any) => res.isDeleted === 0);
+				console.log('原表格数据 ==> ', this.tableData);
+				console.log('新表格数据 ==> ', newData);
+				(this.$refs.bill as any).setBillTableValue(newData, 0);// 设置第1张单据表格数据
+				this.$message.success('删除成功');
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 工具栏删除
+		onDelete(e : any) {
+			console.log('工具栏删除 ==> ', e);
+			let selectData = (this.$refs.bill as any).getTableSelectData(e)
+			let ids = '';
+			if (selectData.length > 0) {
+				selectData.map((v : any) => {
+					ids += v.id + ','
+				})
+			} else return this.$message({ type: 'warning', message: '请选择删除数据' })
+			ids = ids.slice(0, ids.length - 1);
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: ids }, 'supplyEntryOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.clickTab(this.tabType);
+						this.$message.success('删除成功!');
+					} else this.failHandle(res)
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 操作删除
+		doDelete2(item : any) {
+			this.$confirm('确定删除吗,此操作不能撤销!', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				api.deleteList({ ids: item.id }, 'supplyEntryOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.clickTab(this.tabType);
+						this.$message.success('删除成功!');
+					} else this.failHandle(res)
+				})
+			}).catch(() => this.$message.info('已取消删除'));
+		}
+		// 运行错误
+		failHandle(err : any) {
+			let msg = err.msg ? err.msg : '运行错误!';
+			this.$message.error(msg)
+		}
+	}
+</script>