From cc456f2c057eaa904919961888d4f1c755524dd5 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期一, 11 十一月 2024 16:05:01 +0800
Subject: [PATCH] feat:供应商增加日计划isNUm限制

---
 subPages/addDailyPlan/addDailyPlan.vue |   39 ++++++++++++++++++++++++++++-----------
 1 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/subPages/addDailyPlan/addDailyPlan.vue b/subPages/addDailyPlan/addDailyPlan.vue
index 8bb4d1b..5139e83 100644
--- a/subPages/addDailyPlan/addDailyPlan.vue
+++ b/subPages/addDailyPlan/addDailyPlan.vue
@@ -75,22 +75,24 @@
 			emptyText="鏆傛棤鏇村鏁版嵁">
 					<uni-tr>
 					    <uni-th align="center">浜у搧鍚嶇О</uni-th>
-					    <uni-th align="center">浠撳簱</uni-th>
+						<uni-th align="center">瑙勬牸</uni-th>
 						<uni-th align="center" v-if="isNumOk">鏁伴噺</uni-th>
+						<uni-th align="center">璁㈠崟浣欓噺</uni-th>
 					</uni-tr>
 					<uni-tr v-for="(item, index) in subDataList" :key="index">
 						<uni-td align="center">
 							<view>{{   item.productName}}</view></uni-td>
-					
-				聽   <uni-td align="center">
-					<view>{{ item.bunkerName }}</view></uni-td>
+							<uni-td align="center">
+							<view>{{   item.productSpecs}}</view></uni-td>
 					聽   <uni-td align="center" v-if="isNumOk">
 						<view>
-							<u-input 
-							v-model="subDataList[index].surplusQuant"
+							<u--input 
+							v-model="subDataList[index].nums"
 							border="surround"
 							placeholder="璇疯緭鍏ユ暟閲�" />
 								</view></uni-td>
+								<uni-td align="center">
+									<view>{{   item.surplusQuant}}</view></uni-td>
 				</uni-tr>
 				</uni-table>
 		 </view>
@@ -268,6 +270,10 @@
 						this.subDataList = this.customerNameList.filter(item=>item.id === e).length ? 
 						
 		  			    this.customerNameList.filter(item=>item.id === e)[0].tmOrderList  : []; 
+						this.subDataList.map(item=>{
+							item.nums = item.surplusQuant
+							return item
+						})
 						console.log(this.subDataList,'subDataList')
 						const tempArr = this.customerNameList.filter(item=>item.id === e);
 						if(tempArr.length){
@@ -289,7 +295,7 @@
 								this.subDataList = [];
 							}
 							//鏌ョ湅鏄笉鏄噰璐殑璁℃暟
-							if(this.subDataList.find(item=>item.isWeight === 0)){
+							if(this.subDataList.find(item=>item.isWeight === 0 || item.isWeight === 2)){
 								this.isNumOk = true;
 								this.value = 1;
 							} else{
@@ -298,7 +304,7 @@
 							if(this.isNumOk){
 								let tempArr = [];
 								this.subDataList.forEach(item=>{
-								tempArr.push(item.productId + ':' + item.quant);
+								tempArr.push(item.id + ':' + item.surplusQuant);
 								this.isWeighing = item.isWeight;
 								this.orderType = item.orderType;
 								})
@@ -315,9 +321,20 @@
 			confirmBuild() {
 				let tempArr = [];
 					this.subDataList.forEach(item=>{
-						tempArr.push(item.productId + ':' + item.surplusQuant);
+						this.checkList.forEach(val=>{
+							if(item.id === val){
+								tempArr.push(item.id + ':' + item.nums);
+							}
+						
 						})
-					this.mapProductNum = tempArr.join(",")
+						
+						})
+					this.mapProductNum = tempArr.join(","); 
+					if(   this.subDataList.find(item=>Number(item.nums) > Number(item.surplusQuant))){
+						this.$u.toast('璇锋鏌ユ墍閫夋嫨鐨勪骇鍝佽緭鍏ョ殑鏁伴噺鏄惁灏忎簬璁㈠崟浣欓噺')
+						return;
+					}
+				;
 				let form = {
 				  orderId:this.deptId,
 				  carNum:this.value,
@@ -368,7 +385,7 @@
 			clearInp(){
 				this.closeOrderId = '';
 				this.activeName = '';
-			}
+			},
 		},
 	}
 </script>

--
Gitblit v1.9.1