From 07b12cf496c9380145414972ffe3a8969bf685ac Mon Sep 17 00:00:00 2001
From: wk
Date: 星期三, 09 十月 2024 15:17:28 +0800
Subject: [PATCH] feat:门卫

---
 subPages/addDailyPlan/addDailyPlan.vue |   79 ++++++++++++++++++++++++++++++++++++++-
 1 files changed, 77 insertions(+), 2 deletions(-)

diff --git a/subPages/addDailyPlan/addDailyPlan.vue b/subPages/addDailyPlan/addDailyPlan.vue
index 7c06012..1cf821d 100644
--- a/subPages/addDailyPlan/addDailyPlan.vue
+++ b/subPages/addDailyPlan/addDailyPlan.vue
@@ -48,6 +48,25 @@
 						></u--input>
 				</view>
 			</view>
+				<!-- 瀹㈡埛鍚嶇О -->
+				<view class="customer-name">
+				<view class="customer-name_label" style="display: flex; align-items: center;">
+				   鍚堝崱璁㈠崟
+				   <view style="width: 50%;margin-left: 30rpx;"><u-button  text='閫夋嫨闇�瑕佸悎鍗¤鍗�'  	:disabled="!deptId" @click="todoUncoid"></u-button></view>
+				</view>
+				<view class="customer-name_block">
+						  <u-input
+						  @clear="clearInp"
+						  clearable
+						   class="customer-name_block-input"
+							placeholder="璇烽�夋嫨璁㈠崟"
+							border="surround"
+							v-model="activeName"
+							:disabled="!deptId"
+						
+						></u-input>
+				</view>
+			</view>
 				 <view class="table">
 			<uni-table border stripe 
 			@selection-change="selectionChange"
@@ -135,22 +154,43 @@
 			this.sendDate = this.sendDateStart = dayjs().format('YYYY-MM-DD')
 			this.sendDateEnd = dayjs().add(7, 'day').format('YYYY-MM-DD')
 		},
+		onShow(){
+			uni.$on('updateData',(data)=>{
+				console.log('鐩戝惉鍒颁簨浠舵潵鑷� updateData 锛屾惡甯﹀弬鏁颁负锛�' + JSON.parse( JSON.stringify(data)) , JSON.parse(data) .id );
+				const params = JSON.parse(data);
+				// this.checkList2 = params.map(item=>{
+				// 	item.text = item.orderCode + '/' + item.customerName;
+				// 	return item;
+				// });
+				// let temp = this.checkList2;
+				// this.closeOrderIds = temp.map(item=>item.id).join(',')
+				this.activeName = params.orderCode  +'/' + params.customerName;
+				this.closeOrderId = params.id;
+
+
+			})
+		},
 		data() {
 			return {
 				selfDeliverShow: false,
 				deptId: '',
 				checkList:[],
 				deptName: '',
+				activeName:'',
+				checkList2:[],
 				deptList: [],
+				uncoidCard:'',
 				productName: '',
 				productNameList: [],
 				filedId: '',
 				filedName: '',
+				unionParams:{},
 				filedNameList: [],
 				sendDate: '',
 				sendDateStart: '',
 				sendDateEnd: '',
 				customerId: '',
+				closeOrderIds:'',
 				value:'',
 				customerName: '',
 				customerNameList: [],
@@ -202,7 +242,14 @@
 								this.deptId = this.customerNameList[0].value; //閫夋嫨褰撳墠 
 								// if(this.deptId){
 								// 	this.deptChange(this.deptId);
-								// }
+								// } 
+								this.unionParams = {
+									orderId:this.customerNameList[0].id,
+									deptId:this.customerNameList[0].deptId,
+									customerId:this.customerNameList[0].customerId,
+									productId:this.customerNameList[0].productId
+								}
+								    
 							}else{
 								this.deptId = '';
 							}
@@ -210,6 +257,22 @@
 							if(this.deptId){
 						this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? 
 		  			    this.customerNameList.filter(item=>item.id === e)[0].tmOrderList  : []; 
+						const tempArr = this.customerNameList.filter(item=>item.id === e);
+						if(tempArr.length){
+							this.unionParams = {
+									orderId:tempArr[0].id,
+									deptId:tempArr[0].deptId,
+									customerId:tempArr[0].customerId,
+									productId:tempArr[0].productId
+								}
+						}else{
+							this.unionParams = {
+									orderId:'',
+									deptId:'',
+									customerId:'',
+									productId:'',
+								}
+						}
 							}else{
 								this.subDataList = [];
 							}
@@ -224,7 +287,8 @@
 				  carNum:this.value,
 				  sendDate:this.sendDate,
 				  sendSign:0,
-				  itemIds:this.checkList.join(",") + ','
+				  itemIds:this.checkList.join(",") + ',',
+				  closeOrderId:this.closeOrderId,
 				}
 				this.buildLoading = true
 				this.$reqPost('addDeliveryPlan', form, 'json').then(res => {
@@ -253,6 +317,17 @@
 				  })
 					console.log(this.checkList,'checkList')
 			 	}
+			},
+			todoUncoid(){
+				console.log('todoUncoid');
+				uni.navigateTo({
+				url: `/subPages/unionCard/unionCard?unionParams=${JSON.stringify(this.unionParams)}&checkArray=${JSON.stringify(this.checkList2) }`
+				});
+
+			},
+			clearInp(){
+				this.closeOrderId = '';
+				this.activeName = '';
 			}
 		},
 	}

--
Gitblit v1.9.1