AlanWong 2 лет назад
Родитель
Сommit
f084661a51

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

@@ -424,7 +424,7 @@
 				api.ordersaccepting({ ids: item.id }, 'supplyTaskOrder').then((res : any) => {
 					if (res.code === 200) {
 						this.getDataList();
-						this.$message.success('删除成功!');
+						this.$message.success('接单成功!');
 						this.$alert('是否跳转销售订单', '提示', {
 							confirmButtonText: '确定',
 							cancelButtonText: '取消',

+ 6 - 0
src/views/audit/orderTask/index.vue

@@ -1185,6 +1185,12 @@
 			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
 			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
 			if (e === 'recycleBin') this.getSelectDeleteList({}) // 回收站数据
+			if (e === 'bill') {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.tool.tools={};
+				billConfig.tool.customTools = [];
+				(this.$refs.bill as any).setBillConfig(billConfig);
+			}
 		}
 		// 初始化
 		getDataList() {

+ 6 - 0
src/views/audit/outbound/index.vue

@@ -1122,6 +1122,12 @@
 			if (e === 'draftsBox') this.getPageList({ submitState: 0 }, 'draftsBox'); // 草稿箱数据
 			if (e === 'smt') this.getPageList({ submitState: 1 }, 'smt'); // 已提交数据
 			if (e === 'recycleBin') this.getSelectDeleteList({}); // 回收站数据
+			if (e === 'bill') {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.tool.tools={};
+				billConfig.tool.customTools = [];
+				(this.$refs.bill as any).setBillConfig(billConfig);
+			}
 		}
 		// 初始化
 		getDataList() {

+ 55 - 21
src/views/audit/saleOrder/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<div>
-		<by-bill :propConfig="config" @search="search" ref="bill" @resert="resert" @detail="openEdit"
-			@onRefresh="resert" @pagination="pagination" @clickTab="clickTab">
+		<by-bill :propConfig="config" @search="search" ref="bill" @resert="resert" @detail="openEdit" @onRefresh="resert"
+			@pagination="pagination" @clickTab="clickTab" @onOrder="onOrder">
 		</by-bill>
 		<vxe-modal v-model="vxeValue" width="70%" height="70%" min-width="800" min-height="600" show-zoom resize transfer
 			show-footer>
@@ -390,7 +390,7 @@
 					},
 					customTools: [
 						{
-							name: '终止订单', icon: 'el-icon-top', audit: [''], event: {
+							name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
 								click: () => {
 									(this as any).doBackOrder()
 								}
@@ -603,7 +603,6 @@
 		// 引单
 		citationOrder() {
 			let data : any = (this as any).$refs.bill.getSourceTableSelectData(0);
-			console.log(data);
 			if (data.length <= 0) return this.$message.warning('请选择引单数据');
 			data = data.map((item : any) => {
 				item.address = item.deliveryAddress
@@ -614,7 +613,7 @@
 				return newData
 			})
 			let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
-			billConfig.tool.tools = { save: true };
+			billConfig.tool.tools = { order: true };
 			billConfig.tool.customTools = [];
 			this.isCitation = true;
 			(this.$refs.bill as any).showTab = 'bill';
@@ -624,6 +623,24 @@
 				(this.$refs.bill as any).setBillTableValue(data[0].suborderList, 0);// 设置第1张单据表格数据
 			}, 0)
 		};
+		// 接单
+		onOrder() {
+			this.$confirm('确定接单吗', '注意', {
+				confirmButtonText: '确定',
+				cancelButtonText: '取消',
+				type: 'warning',
+				center: true
+			}).then(() => {
+				let data = (this.$refs.bill as any).getBillFormValue();
+				api.ordersaccepting({ ids: data.id }, 'supplyTaskOrder').then((res : any) => {
+					if (res.code === 200) {
+						this.getDataList();
+						this.$message.success('接单成功!');
+						(this.$refs.bill as any).showTab = 'all';
+					} else this.$message.error(res.msg);
+				})
+			}).catch(() => this.$message.info('已取消接单'));
+		}
 		// 右拆单数据变化
 		rightChange(e : any) {
 			console.log(e.number);
@@ -742,28 +759,41 @@
 			api.single({ id: e.id }, 'supplyPurchaseOrder').then((res : any) => {
 				if (res.code === 200) {
 					let parentData = res.data ? res.data : e;
+					console.log(parentData);
 					let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
-					if (parentData.isMaster === 1) {
+					if (parentData.status === 2) {
+						billConfig.tool.customTools = [];
+					} else {
 						billConfig.tool.customTools = [
 							{
-								name: '拆单', icon: 'el-icon-minus', audit: [''], event: {
-									click: () => {
-										(this as any).orderTaking(parentData)
-									}
-								}
-							},
-						];
-					} else if (parentData.status != 2) {
-						billConfig.tool.customTools = [
-							{
-								name: '终止订单', icon: 'el-icon-bottom', audit: [''], event: {
+								name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
 									click: () => {
 										(this as any).doBackOrder2(parentData)
 									}
 								}
 							}
 						];
+						// 主单
+						if (parentData.isMaster === 1) {
+							billConfig.tool.customTools = [
+								{
+									name: '拆单', icon: 'el-icon-minus', audit: [''], event: {
+										click: () => {
+											(this as any).orderTaking(parentData)
+										}
+									}
+								},
+								{
+									name: '终止订单', icon: 'el-icon-close', audit: [''], event: {
+										click: () => {
+											(this as any).doBackOrder2(parentData)
+										}
+									}
+								}
+							];
+						}
 					};
+					billConfig.tool.tools = {};
 					(this.$refs.bill as any).setBillConfig(billConfig);
 					(this.$refs.bill as any).setBillFormValue(parentData); // 设置单据表单数据
 					(this.$refs.bill as any).setBillTableValue(parentData.suborderList, 0);// 设置第1张单据表格数据
@@ -809,12 +839,13 @@
 				this.getCitationList({});
 			}
 			if (e === 'all') this.getDataList();
+			if (e === 'returnOrder') this.getPageList({ status: 2 }, 'returnOrder');
 			if (e === 'bill') {
 				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.tool.tools = {};
 				billConfig.tool.customTools = [];
 				(this.$refs.bill as any).setBillConfig(billConfig);
 			}
-			if (e === 'returnOrder') this.getPageList({ status: 2 }, 'returnOrder')
 		}
 		// 单据操作终止订单
 		doBackOrder2(e : any) {
@@ -839,10 +870,12 @@
 		}
 		// 分页
 		pagination(e : any) {
+			console.log('分页 ==> ', e);
 			let query : any = (this as any).$refs.bill.getSearchValue(e.type);
 			query.pageNo = e.page.pageNum;
 			query.pageSize = e.page.pageSize;
-			let loading = this.$loading({ target: '.main-container' })
+			if (e.type === 'returnOrder') query.status = 2; // 终止订单数据
+			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);
@@ -856,20 +889,21 @@
 			if (parames.type === 'source_0') {
 				this.getCitationList(query);
 			} else {
-				if (parames.type === 'draftsBox') query.submitState = 0 // 草稿箱数据
-				if (parames.type === 'smt') query.submitState = 1 // 已提交数据
+				if (query.type === 'returnOrder') query.status = 2; // 终止订单数据
 				this.getPageList(query, parames.type) // 获取综合分页数据
 			}
 		}
 		// 刷新/重置
 		resert(e : any) {
 			let data : any = e.type ? e.type : e;
+			console.log('刷新/重置 ==> ', data);
 			if (data === 'source_0') {
 				(this as any).$refs.bill.$refs.source_0[0].clearSearch();
 				this.getCitationList({});
 			} else {
 				(this as any).$refs.bill.$refs[data].clearSearch();
 				if (data === 'all') this.getPageList({}, 'all'); // 综合数据
+				if (data === 'returnOrder') this.getPageList({status:2}, 'returnOrder'); // 终止订单数据
 			}
 		}
 	}

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

@@ -995,6 +995,12 @@
 			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 }); // 回收站数据
+			if (e === 'bill') {
+				let billConfig = (this as any).$lodash.cloneDeep(this.config.bill);
+				billConfig.tool.tools={};
+				billConfig.tool.customTools = [];
+				(this.$refs.bill as any).setBillConfig(billConfig);
+			}
 		}
 		// 初始化
 		getDataList() {