Browse Source

2022-04-17 21:55

王克恕 3 years ago
parent
commit
5e99649de7

+ 59 - 54
imcs-ui/src/views/zuihou/runManageCenter/orderMgr/components/runningOrder/index.vue

@@ -538,29 +538,35 @@
 
         // 如果是:【暂停】
         if(command == "stop"){
-          const produceStatus = this.selection[0].produceStatus
-          console.log("produceStatus="+produceStatus)
-          if (produceStatus === '1' || produceStatus === '4') {
-            this.$message({
-              message: this.$t("订单未开始生产或已经生产完成,无需暂停"),
-              type: "warning"
-            })
-            return false
+          // 验证是否选中数据-函数
+          if(this.checkData()){
+          	const produceStatus = this.selection[0].produceStatus
+          	// console.log("produceStatus="+produceStatus)
+          	if (produceStatus === '1' || produceStatus === '4') {
+	            this.$message({
+	              message: this.$t("订单未开始生产或已经生产完成,无需暂停"),
+	              type: "warning"
+	            })
+	            return false
+	          }
+	        	this.panseBtn('0', this.selection[0])
           }
-        	this.panseBtn('0')
         }
 
         // 如果是:【启用】
         if(command == "start"){
-          const produceStatus = this.selection[0].produceStatus
-          if (produceStatus != '3') {
-            this.$message({
-              message: this.$t("订单未暂停,无需启用"),
-              type: "warning"
-            })
-            return false
-          }
-        	this.panseBtn('1')
+        	// 验证是否选中数据-函数
+          if(this.checkData()){ 
+	          const produceStatus = this.selection[0].produceStatus
+	          if (produceStatus != '3') {
+	            this.$message({
+	              message: this.$t("订单未暂停,无需启用"),
+	              type: "warning"
+	            })
+	            return false
+	          }
+	        	this.panseBtn('1', this.selection[0])
+        	}
         }
 
         // 如果是:【删除】
@@ -581,7 +587,7 @@
                 })
                 return false
             }
-            this.panseBtn('0')
+            this.panseBtn('0', row)
         }
 
         // 如果是:【启用】
@@ -594,7 +600,7 @@
                 })
                 return false
             }
-            this.panseBtn('1')
+            this.panseBtn('1', row)
         }
       },
 
@@ -611,38 +617,36 @@
       	}
       },
       // 【暂停/启用】按钮-事件
-      panseBtn(val){
-      	if(this.checkData()){
-      		let obj = {
-		    		id: this.selection[0].id,
-		    		status: val
-		    	}
-      		if(val == '1'){
-      			orderMgrApi.orderEnable(obj).then(res => {
-			    		res = res.data
-		          if (res.isSuccess) {
-		            this.$message({
-		              message: this.$t('tips.optionSuccess'),
-		              type: 'success'
-		            })
-		            // 更新列表
-		            this.search()
-		          }
-			    	})
-      		}else{
-      			orderMgrApi.orderSuspend(obj).then(res => {
-			    		res = res.data
-		          if (res.isSuccess) {
-		            this.$message({
-		              message: this.$t('tips.optionSuccess'),
-		              type: 'success'
-		            })
-		            // 更新列表
-		            this.search()
-		          }
-			    	})
-      		}
-      	}
+      panseBtn(val, data){
+      	let obj = { status: val }
+      	if(data) {
+      		obj.id  = data.id;
+		  		if(val == '1'){
+		  			orderMgrApi.orderEnable(obj).then(res => {
+				    		res = res.data
+			          if (res.isSuccess) {
+			            this.$message({
+			              message: this.$t('tips.optionSuccess'),
+			              type: 'success'
+			            })
+			            // 更新列表
+			            this.search()
+			          }
+				    	})
+		  		}else{
+		  			orderMgrApi.orderSuspend(obj).then(res => {
+				    		res = res.data
+			          if (res.isSuccess) {
+			            this.$message({
+			              message: this.$t('tips.optionSuccess'),
+			              type: 'success'
+			            })
+			            // 更新列表
+			            this.search()
+			          }
+				    	})
+		  		}
+	  		}
       },
       // 【删除】按钮-事件
       orderDelete(){
@@ -944,6 +948,7 @@
 	    		this.loadingDom = false;
         })
 	    },
+	    
 	    viewPgRow(row){
 	    	// this.$refs.prodProg.setTenant(row)
 	      // this.$refs.prodProg.type = "view"
@@ -951,11 +956,11 @@
 	      // this.dialogPP.isVisible = true
         const orderList = []
         orderList.push(row)
-        console.log(orderList)
+        // console.log("1234344 === ", orderList)
         // 把选择的数据,给后台,
         orderMgrApi.oneTouchSchedule({orderList: orderList}).then(res => {
             res = res.data
-            console.log("【查看排产方案】按钮: ", res)
+            // console.log("【查看排产方案】按钮: ", res)
             if(res.isSuccess){
                 this.$message({
                     message: this.$t('tips.optionSuccess'),