From a1c08d1646f4c9d280a0e3462d55e9ea6aadd845 Mon Sep 17 00:00:00 2001
From: yangan <yangan0921@163.com>
Date: 星期四, 02 一月 2025 16:43:34 +0800
Subject: [PATCH] faet:拼单列表增加展示字段

---
 subPages/pvcSplicePage/index.vue |   94 +++++++++++++++++++++++++++++++++++-----------
 1 files changed, 71 insertions(+), 23 deletions(-)

diff --git a/subPages/pvcSplicePage/index.vue b/subPages/pvcSplicePage/index.vue
index 97955a0..e50b2bd 100644
--- a/subPages/pvcSplicePage/index.vue
+++ b/subPages/pvcSplicePage/index.vue
@@ -15,11 +15,12 @@
 					<uni-th align="center">鎿嶄綔</uni-th>
 				</uni-tr>
 				<uni-tr v-for="(item, index) in daiPageList"
-					:key="item.id">
+					:key="index">
 	
-					<uni-td align="center">{{ item.productName || '' }}</uni-td>
+					<uni-td align="center">{{ item.productName || '' }}</uni-td> 
 					<uni-td align="center">{{ item.customerName || '' }}</uni-td>
-					<uni-td align="center"><u-button text="閫夋嫨"
+					<uni-td align="center">
+						<u-button text="閫夋嫨"
 							type="primary"
 							:disabled=" item.isPretendDischar === 1"
 							@click="enterOk(item)"></u-button></uni-td>
@@ -37,14 +38,18 @@
 				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" >浜у搧</uni-th>
+					<uni-th align="center" width="300">瀹㈡埛</uni-th>
+					<uni-th align="center">缂栧彿</uni-th>
+					<uni-th align="center">璁″垝閲�</uni-th>
                     <uni-th align="center">鎿嶄綔</uni-th>
 				</uni-tr>
 				<uni-tr v-for="(item, index) in yiPageList"
-					:key="item.id">
+					:key="index">
 					<uni-td align="center">{{ item.productName || '' }}</uni-td>
 					<uni-td align="center">{{ item.customerName || '' }}</uni-td>
+					<uni-td align="center">{{ item.orderCode || '' }}</uni-td>
+					<uni-td align="center">{{ item.planMeasure || '' }}</uni-td>
                     <uni-td  align="center"><u-button text="鍒犻櫎"
 							type="error"
                             v-if="item.mainTmTaskId"
@@ -139,6 +144,7 @@
     onLoad(params){
         console.log(params,'params')
         this.mainTmTaskId = JSON.parse(params.item).id;
+		this.init();
         console.log(JSON.parse(params.item).id,'213123')
 
     },
@@ -147,11 +153,12 @@
 			
 		},
     onShow(){
-        this.init();
+        // this.init();
     },
     data() {
         return {
             daiPageList:[],
+			radioNum:'',
             yiPageList:[],
             quxiaoShow:false,
             radioValue:'',
@@ -168,19 +175,20 @@
     methods: {
         init(){
             this.$reqGet('pvcSplicingList').then((res) => {
-                console.log(res,'res')
+                console.log(res.data.list1,this.daiPageList,'res');
                 this.daiPageList = res.data.list1;
                 this.yiPageList = res.data.list2;
 
             })
         },
         enterOk(item){
+			console.log(item,'12313')
             this.activeObj = item;
-            this.getBuild();
+            this.getBuild(item);
 
         },
         getBuild(item){
-					this.$reqGet('getBuildList',{orderPlanId:this.activeObj.orderPlanId,customerId:this.activeObj.customerId,status:1,fleetId:this.activeObj.fleetId}).then(res=>{
+					this.$reqGet('getBuildList',{orderPlanId:item.orderPlanId,customerId:item.customerId,status:1,fleetId:item.fleetId}).then(res=>{
 					console.log(res,'resss')
                     this.showLing = true;
                     this.pageList = res.data.map(item=>{
@@ -200,19 +208,59 @@
             if(!this.radioValue){
                 return this.$u.toast('蹇呴』閫夋嫨瑙勬牸')
             }else{
-                if (this.activeObj.tmcCount == '0') {
-				this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
-							!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
-			} else {
-				// this.qiangDanOrderPlanId = value.orderPlanId;
-			    // this.fleetId = value.fleetId;
-				// this.customerId = !value.customerId ? '0' : value.customerId;
-				// this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
-				// this.qiangDanShow = true;
-				 this.$u.toast(`褰撳墠宸叉帴${value.tmcCount}鍗昤);
-                 this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
-							!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
-			}
+				let radioNum  = this.pageList.find(item=>item.id === this.radioValue).planMeasure;
+				console.log(radioNum,'ressi88')
+					let result = this.yiPageList.reduce((cur,next)=>{
+					return  Number(cur) + Number(next.productQuantity)
+				},radioNum);
+				
+				
+				console.log(result,'result')
+				if(result >= 40){
+					uni.showModal({
+						title: '鎻愮ず',
+						content: '鍔犱笂姝ゅ崟绱澶т簬绛変簬40鍚ㄤ簡,杩樿缁х画鎷煎崟鍚楋紵',
+						cancelText: "鍙栨秷", // 鍙栨秷鎸夐挳鐨勬枃瀛�  d
+						confirmText: "纭", // 纭鎸夐挳鐨勬枃瀛�  
+						showCancel: true, // 鏄惁鏄剧ず鍙栨秷鎸夐挳锛岄粯璁や负 true
+						success: (res) => {
+						if(res.confirm) {  
+							console.log('comfirm') //鐐瑰嚮纭畾涔嬪悗鎵ц鐨勪唬鐮�
+							if (this.activeObj.tmcCount == '0') {
+							this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
+										!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
+						} else {
+							// this.qiangDanOrderPlanId = value.orderPlanId
+							// this.fleetId =
+							// this.customerId = !value.customerId ? '0' : value.customerId;
+							// this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
+							// this.qiangDanShow = true;
+							this.$u.toast(`褰撳墠宸叉帴${value.tmcCount}鍗昤);
+							this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
+										!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
+						}
+						} else {  
+							console.log('cancel') //鐐瑰嚮鍙栨秷涔嬪悗鎵ц鐨勪唬鐮�
+							}  
+						} 
+					})
+				}else{
+					if (this.activeObj.tmcCount == '0') {
+							this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
+										!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
+						} else {
+							// this.qiangDanOrderPlanId = value.orderPlanId
+							// this.fleetId =
+							// this.customerId = !value.customerId ? '0' : value.customerId;
+							// this.xsUserId = !value.xsUserId ? '0' : value.xsUserId;
+							// this.qiangDanShow = true;
+							this.$u.toast(`褰撳墠宸叉帴${value.tmcCount}鍗昤);
+							this.qiangDan(this.activeObj.orderPlanId,this.activeObj.fleetId, !this.activeObj.customerId ? '0' : this.activeObj.customerId,
+										!this.activeObj.xsUserId ? '0' : this.activeObj.xsUserId,this.mainTmTaskId);
+						}
+
+				}
+               
             }
            
             

--
Gitblit v1.9.1