From 71ba67906896248aa2df5e70756b997fad9a9033 Mon Sep 17 00:00:00 2001
From: wk
Date: 星期一, 09 九月 2024 17:54:18 +0800
Subject: [PATCH] feat:门卫

---
 subPages/addDailyPlan/addDailyPlan.vue |   66 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/subPages/addDailyPlan/addDailyPlan.vue b/subPages/addDailyPlan/addDailyPlan.vue
index cc9f5ad..7c06012 100644
--- a/subPages/addDailyPlan/addDailyPlan.vue
+++ b/subPages/addDailyPlan/addDailyPlan.vue
@@ -9,10 +9,15 @@
 						褰撳墠閫夋嫨璁㈠崟
 					</view>
 					<view class="selected-info_text">
-						<niceui-data-select-input v-model="deptId"
+						<uni-combox :candidates="customerNameList" placeholder="璇烽�夋嫨璁㈠崟"
+						 labelKey="text"
+						 valueKey="value"
+						 ref='combox'
+						 v-model="deptId" @input="(e)=>deptChange(e)"></uni-combox>
+						<!-- <niceui-data-select-input v-model="deptId"
 							:localdata="customerNameList"
 							placeholder="璇烽�夋嫨璁㈠崟"
-							@change="deptChange"></niceui-data-select-input>
+							@change="deptChange"></niceui-data-select-input> -->
 					</view>
 				</view>
 			</view>
@@ -45,6 +50,8 @@
 			</view>
 				 <view class="table">
 			<uni-table border stripe 
+			@selection-change="selectionChange"
+			 type="selection"
 			emptyText="鏆傛棤鏇村鏁版嵁">
 					<uni-tr>
 					    <uni-th align="center">浜у搧鍚嶇О</uni-th>
@@ -96,7 +103,7 @@
 							v-for="item in customerNameList"
 							@click="selectCustomer(item)">
 							<view class="item-image">
-								<image src="https://mx.jzeg.cn:9096/appimg/image/banner/address.png"
+								<image src="https://wrzs.czjlchem.com:9090/appimg/image/banner/address.png"
 									mode="widthFix"
 									style="width: 18px;"></image>
 							</view>
@@ -132,6 +139,7 @@
 			return {
 				selfDeliverShow: false,
 				deptId: '',
+				checkList:[],
 				deptName: '',
 				deptList: [],
 				productName: '',
@@ -152,18 +160,18 @@
 		},
 		computed: {
 			abledBuild() {
-				return !this.subDataList.length || !this.sendDate || !this.value
+				return !this.subDataList.length || !this.sendDate || !this.value || !this.checkList.length
 			}
 		},
 		methods: {
             //鏌ヨ璁㈠崟
             getDingdan(){
-                    this.$reqGet('getAppOrderList',{orderType:'澶栭攢'})
+                    this.$reqGet('getAppOrderList',{code:this.deptId})
 					.then(res => {
 						uni.hideLoading()
 						if (res.code == 0) {
 							this.customerNameList = res.data.map(item=>{
-								item.text = (item.productNames ? item.productNames : item.productName) + '-' + item.orderCode;
+								item.text =  item.orderCode;
 								item.value = item.id;
 								return item;
 							});
@@ -180,10 +188,34 @@
 					})
             },
 			deptChange(e) {
-				console.log(e,'eee');
-				this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? 
-				this.customerNameList.filter(item=>item.id === e)[0].tmOrderList  : [];
-				; 
+				console.log(e,this.$refs.combox,'eee');
+				this.$reqGet('getAppOrderList',{code:this.$refs.combox.inputVal})
+					.then(res => {
+						uni.hideLoading()
+						if (res.code == 0) {
+							this.customerNameList = res.data.map(item=>{
+								item.text =  item.orderCode;
+								item.value = item.id;
+								return item;
+							});
+							if(this.customerNameList.length === 1){
+								this.deptId = this.customerNameList[0].value; //閫夋嫨褰撳墠 
+								// if(this.deptId){
+								// 	this.deptChange(this.deptId);
+								// }
+							}else{
+								this.deptId = '';
+							}
+				
+							if(this.deptId){
+						this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? 
+		  			    this.customerNameList.filter(item=>item.id === e)[0].tmOrderList  : []; 
+							}else{
+								this.subDataList = [];
+							}
+						}
+					})
+			
 				
 			},
 			confirmBuild() {
@@ -192,6 +224,7 @@
 				  carNum:this.value,
 				  sendDate:this.sendDate,
 				  sendSign:0,
+				  itemIds:this.checkList.join(",") + ','
 				}
 				this.buildLoading = true
 				this.$reqPost('addDeliveryPlan', form, 'json').then(res => {
@@ -209,6 +242,17 @@
 				}).catch(e => {
 					this.buildLoading = false
 				})
+			},
+			selectionChange(item){
+				//閫夋嫨 鏌愪釜浜у搧 
+				this.checkList = [];
+				console.log(item,'items')
+				 if(item.detail.index.length){
+			      item.detail.index.forEach((v) => {
+					this.checkList.push(this.subDataList[v].id)
+				  })
+					console.log(this.checkList,'checkList')
+			 	}
 			}
 		},
 	}
@@ -247,6 +291,8 @@
 	.main {
 		width: 100%;
 		color: #232323;
+		overflow: auto;
+		height: 80vh;
 
 		.product-info {
 			width: 96%;

--
Gitblit v1.9.1