Przeglądaj źródła

处理上下料站页面功能、实现工艺复制功能

oyq28 2 lat temu
rodzic
commit
05804c0d05

+ 3 - 3
imcs-ui/src/api/AxiosApi.js

@@ -45,8 +45,8 @@ function handleError(error, reject, opts) {
       })
     } else if (error.response && error.response.data) {
     	// 回话失败,返回登录页面
-		if(error.response.data.code == 40001 || error.response.data.code == 40000){
-			window.location.hash = '/login'
+		if(error.response.data.code == 40001 || error.response.data.code == 40000 || error.response.data.code == 40005){
+			window.location.hash = '/login'      
 		}
 	    if(error.response.data.msg){
 	        Message({
@@ -109,7 +109,7 @@ const httpServer = (opts) => {
     baseURL: process.env.VUE_APP_PROD_REQUEST_DOMAIN_PREFIX + process.env.VUE_APP_BASE_API,
     url: opts.url,
     responseType: opts.responseType || '',
-    timeout: 600000
+    timeout: 900000
   }
   if (opts['meta']) {
     httpDefaultOpts.headers = opts['meta']

+ 12 - 1
imcs-ui/src/api/machiningClient/machiningClient.js

@@ -96,6 +96,10 @@ const apiList = {
         method: 'POST',
     	url: `/authority/task/getValidTrayCount`
 	},
+	checkStockNode:{
+        method: 'POST',
+    	url: `/authority/task/checkStockNode`
+	},
 	read: {
 		method: 'POST',
     	url: `http://192.168.11.240:8089/api/ReadRFID`
@@ -216,7 +220,14 @@ export default {
 	      	data
 	    })
   	},
-  	
+  	// 判断入库节点是否已配置
+	checkStockNode (data) {
+	    return axiosApi({
+	      	...apiList.checkStockNode,
+	      	data
+	    })
+  	},
+
   	export (data) {
 	    return axiosApi({
 	      	...apiList.export,

+ 10 - 0
imcs-ui/src/api/prepareProductMgr/technologyVersion.js

@@ -25,6 +25,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/bomProcedureVersion/saveProcessAnalysis`
   },
+  clone: {
+    method: 'POST',
+    url: `/authority/bomProcedureVersion/cloneProcedure`
+  },
   getProcessAnalysis: {
     method: 'POST',
     url: `/authority/bomProcedureVersion/getProcessAnalysis`
@@ -84,6 +88,12 @@ export default {
       data
     })
   },
+  clone (data) {
+    return axiosApi({
+      ...apiList.clone,
+      data
+    })
+  },
   getProcessAnalysis (data) {
     return axiosApi({
       ...apiList.getProcessAnalysis,

+ 2 - 1
imcs-ui/src/lang/zh/machining.js

@@ -46,7 +46,8 @@ export default {
 		// 按钮的名称
 	  	buttons: {
 	  		noFinished: '暂不完成',
-	  		finished: '我已完成'
+	  		finished: '我已完成',
+			inFinished: '入库完成'
 	  	},
 	  	// 列表的cell名称
 		table: {

+ 6 - 11
imcs-ui/src/views/zuihou/machiningClient/touchScreen/Index.vue

@@ -420,10 +420,9 @@ export default {
     selectChange(value) {
       console.log(value);
     },
-    getStation() {
-      stationMgrApi
-        .getStation({ userId: this.$store.state.account.user.id })
-        .then((res) => {
+    getStation() {            
+      stationMgrApi.getStation({ userId: this.$store.state.account.user.id })
+        .then((res) => {          
           res = res.data;
           if (res.isSuccess) {
             if (res.data.length > 0) {
@@ -440,7 +439,7 @@ export default {
               });
             }
           }
-        });
+        }).catch(()=>{ this.clearTimer()});
     },
 
     readView() {
@@ -492,7 +491,7 @@ export default {
                 this.$refs.view2.setTenant(item)
                 this.view2Visible = true
             }else if(item.taskName.indexOf('下料')>-1){
-                if(item.taskName.indexOf('OP')>-1 || item.taskName.indexOf('动态')>-1){
+                if(item.taskName.indexOf('OP')>-1 || item.taskName.indexOf('热处理')>-1){
                   //工序下料
                   item.uniqueCode = this.uniqueCode
                   this.$refs.view6.setTenant(item)
@@ -510,11 +509,7 @@ export default {
                 item.uniqueCode = this.uniqueCode
                 this.$refs.view5.setTenant(item)
                 this.view5Visible = true
-            }else if(item.taskName.indexOf('换料')>-1){
-                item.uniqueCode = this.uniqueCode
-                this.$refs.view7.setTenant(item)
-                this.view7Visible = true
-            }  
+            } 
             //this.$refs.view4.setTenant(item)
             //this.view4Visible = true
         }         

+ 5 - 3
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View1.vue

@@ -78,9 +78,9 @@
 			<p v-if="this.existed==3" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
 				零件下料未完成,请耐心等待
 			</p>
-			<!--<p v-if="this.existed==2 && tenant.step != 1" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
-				请优先执行1号上料任务
-			</p>-->
+			<p v-if="this.locked" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
+				前序任务执行未结束,请耐心等待
+			</p>
 			<p v-if="this.existed==2 && !this.matched" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
 				当前工装与零件不匹配
 			</p>
@@ -176,6 +176,7 @@ export default {
     	tenantViewVisible: false,
 		unFeedingCount: 0,  //未上料零件数
 		xbkValid: true,
+		locked: false,
       	existed: 0,
         matched: false,  //工装是否匹配
         count: 0,   //工序未零件数
@@ -233,6 +234,7 @@ export default {
 			this.matched = res.data.matched
             this.confirmDisabled = false
 			this.xbkValid = res.data.xbkValid
+			this.locked = res.data.locked
           }
         });        
       },

+ 29 - 1
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View3.vue

@@ -78,7 +78,7 @@
     	</el-row>
 
     	<div slot="footer" class="dialog-footer">
-	      <el-button type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('machining.buttons.finished') }}</el-button>
+	      <el-button type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('machining.buttons.inFinished') }}</el-button>
 	    </div>
     </div>
   </el-dialog>
@@ -102,6 +102,7 @@ export default {
     return {
       screenWidth: 0,
       confirmDisabled: false,
+      callRobotFlag: false,	
       width: this.initWidth(),
       tenant: {},
       queryParams: initQueryParams({}),
@@ -175,6 +176,18 @@ export default {
       }).finally(()=>{
         this.loading = false
       });
+    },
+    storageForm(){
+      machiningClientApi.checkStockNode({"taskNodeId": this.tenant.taskNodeId}).then((res)=>{
+            res = res.data;
+            if (res.isSuccess) {                   
+              if(res.data){
+                  this.submitForm()   
+              }else{
+                  this.callRobot()
+              }
+            }
+      })
     },
   	submitForm(){
         this.confirmDisabled = true
@@ -190,6 +203,21 @@ export default {
         this.confirmDisabled = false
       });
   	},
+    callRobot(){
+      this.callRobotFlag = false     	
+      	machiningClientApi.callRobot({ "taskNodeId" : this.tenant.taskNodeId, "callType":"2"}).then((res) => {
+        			res = res.data
+        			if (res.isSuccess) {                 
+         				 // 通知列表
+          				this.$emit("success");
+          				// 通知列表-并关闭弹出框
+          				this.$emit("close");
+       				 }
+      			}).finally(()=>{
+        			this.callRobotFlag = true
+       });		 
+		
+    },
     initWidth () {
       this.screenWidth = document.body.clientWidth
       if (this.screenWidth < 550) {

+ 102 - 38
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View4.vue

@@ -70,6 +70,21 @@
   
               </el-table>
           </el-row>
+
+      <el-row v-show="this.active==1">
+			    <p v-if="this.existed==0" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
+				    ST1: 请申请托盘工装
+			    </p>
+			    <p v-if="this.existed==3" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
+				    零件下料未完成,请耐心等待
+			    </p>
+			    <p v-if="this.locked" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
+				    前序任务执行未结束,请耐心等待
+			    </p>
+			    <p v-if="this.existed==2 && !this.matched" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
+				    当前工装与零件不匹配
+			    </p>
+		  </el-row>
   
           <!-- 装夹物料 -->
           <el-row v-show="this.active>1">
@@ -96,6 +111,7 @@
                                <el-image
                                     style="width: 60px; height: 60px"
                                     :src="row.armorPic"
+                                    :preview-src-list="[row.armorPic]"
                                     fit="fill"></el-image>
                            </div>
                       </template>
@@ -111,9 +127,9 @@
           </el-row>
   
           <div slot="footer" class="dialog-footer">
-            <el-button type="primary" @click.native="callRobot" v-show="!this.matched || this.existed==0"  >申请上料</el-button>
+            <el-button type="primary" :disabled="callRobotFlag"  @click.native="apply" v-show="(!this.matched || this.existed==0) && !this.locked"  >申请上料</el-button>
             <el-button type="primary" :disabled="confirmDisabled" @click.native="next" v-show="this.active==1 && this.existed==2">已完成,下一步</el-button>
-            <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1">上料完成</el-button>
+            <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1 && !this.locked ">上料完成</el-button>
           </div>
       </div>
     </el-dialog>
@@ -140,6 +156,8 @@
         confirmDisabled: true,
         confirmDisabled2: true,
         callRobotFlag: false,
+        xbkValid: true,
+        locked: false,
         unFeedingCount: 0,  //未上料零件数
       	existed: 0,
         matched: false,  //工装是否匹配
@@ -184,28 +202,20 @@
         })()
       }
     },
-    methods: {
-      /*
-      apply(){
-        let that = this
+    methods: {      
+      apply(){        
         this.loading = true
         this.confirmDisabled = true
         taskMgrApi.updateTaskStatus({ "id" : this.tenant.id, "taskNodeId": this.tenant.taskNodeId, "updateType" : "end", "processType" : "4", "updateUser" : this.$store.state.account.user.id}).then((res) => {
             if (res.isSuccess) {
                 //that.loading = false
-                //that.confirmDisabled = false                              
+                //that.confirmDisabled = false
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");                              
             }            
-        });    
-        setTimeout(function(){
-             //通知列表
-             that.loading = false
-             that.confirmDisabled = false 
-             that.$emit("success");
-              //通知列表-并关闭弹出框
-             that.$emit("close");
-        }, 2000);    
-        
-      }, */
+        })
+      },
       confirmProcedure(){
 		  let valid = this.tenant.taskNodeId!=''? true: false;
 	    if(!valid){
@@ -224,6 +234,8 @@
             this.existed = res.data.existed
 			      this.matched = res.data.matched
             this.confirmDisabled = false
+            this.locked = res.data.locked
+            this.xbkValid = res.data.xbkValid
           }
         });        
       },
@@ -256,32 +268,75 @@
         });
         if (this.active++ > 1) this.active = 0;
       },
-        submitForm(){
+      submitForm(){
         // 更新改任务的开始时间
         // TODO 写入rfid内容,工件信息、原材料R
-          this.confirmDisabled2 = true
-        let valid = this.uniqueCode!=''? true: false;
+          this.confirmDisabled = true
+          let valid = this.uniqueCode!=''? true: false;
           if(!valid){
             this.$message({
                 message: "零件编码" + this.$t("rules.require"),
                 type: "warning"
             })
-            this.confirmDisabled2 = false
+            this.confirmDisabled = false
             return false
           }
-          
-        taskMgrApi.updateTaskStatus({ "id" : this.tenant.id,"meterialId":this.tenant.meterialId, "uniqueCode":this.uniqueCode, "taskNodeId": this.tenant.taskNodeId, "updateType" : "end", "processType" : "1", "updateUser" : this.$store.state.account.user.id, "positionIndex": this.currentIndex}).then((res) => {
+          if(!this.xbkValid){
+            this.$message({
+	            message: "产线线边库资源不够,请等待资源释放后再上料",
+	            type: "warning"
+	          })
+		        this.confirmDisabled = false
+		        return false
+	        }
+          //this.$confirm('确认?')		
+          let that = this
+          this.$confirm(
+          '确定上料已完成并且舱门已关闭?',
+          this.$t("common.tips"),
+          {
+            distinguishCancelAndClose: true,
+            confirmButtonText: this.$t("common.confirm"),
+            cancelButtonText: this.$t("common.cancel"),
+            type: "warning",
+          }).then(() => {
+              //上料处理
+              this.addMaterial(that)
+          }).catch(()=>{})
+        },
+        addMaterial(that){		
+          taskMgrApi.updateTaskStatus({ "id" : that.tenant.id,"meterialId":that.tenant.meterialId, "uniqueCode":that.uniqueCode, "taskNodeId": that.tenant.taskNodeId, "updateType" : "end", "processType" : "5", "updateUser" : that.$store.state.account.user.id, "positionIndex": that.currentIndex}).then((res) => {
             res = res.data;
-            if (res.isSuccess) {                
-                // 通知列表
-                this.$emit("success");
-                // 通知列表-并关闭弹出框
-                this.$emit("close");
+            if (res.isSuccess) {
+                //写入RFID
+                that.RFIDParams.taskId = that.tenant.id
+                that.RFIDParams.taskNodeId = that.tenant.taskNodeId
+                that.RFIDParams.data.positionIndex = that.currentIndex
+                //写入空值
+                machiningClientApi.write(that.RFIDParams).then(res2 => {				 
+                   if(res2.data.result){
+                      console.log("空值写入成功")	
+                   }
+                });
+                that.RFIDParams.data.content = that.uniqueCode
+                //写入新值
+                machiningClientApi.write(that.RFIDParams).then(res2 => {
+                  if(res2.data.result){
+                      console.log("rfid写入成功")		
+                  }
+                  setTimeout(function(){
+                      //通知列表
+                    that.$emit("success");
+                    //通知列表-并关闭弹出框
+                    that.$emit("close");
+                   }, 1000);
+                    
+                });                
             }
         }).finally(()=>{
-            this.confirmDisabled2 = false
+            that.confirmDisabled = false
         });
-        },
+      },
         // table的当前行值变化后
         handleCurrentChange(val) {
               // 设置当前行
@@ -333,15 +388,24 @@
       },
   
       confirmCode(){
-        taskMgrApi.confirmCode({ "uniqueCode" : this.uniqueCode, "orderId":this.tenant.orderId}).then((res) => {
-          res = res.data;
-          if (res.isSuccess) {
-            //this.uniqueCode = res.data.uniqueCode
+        let valid = this.tenant.completeBatchNo!=''? true: false;
+          if(!valid){
+            this.$message({
+                message: "零件编码" + this.$t("rules.require"),
+                type: "warning"
+            })
             this.confirmDisabled2 = false
+            return false
           }
-        });
-        // this.uniqueCode = this.uuid(32,16)
-        this.confirmDisabled2 = true
+          taskMgrApi.confirmCode({ "completeBatchNo" : this.tenant.completeBatchNo, "orderId":this.tenant.orderId, "procedureSort": this.tenant.procedureSort}).then((res) => {
+            res = res.data;
+            if (res.isSuccess) {            
+              this.confirmDisabled2 = false
+              this.uniqueCode = res.data.uniqueCode
+            }else{             
+              this.confirmDisabled2 = true 
+            }
+          });
       } 
       
     }

+ 5 - 3
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View5.vue

@@ -128,11 +128,11 @@
           </el-row>
   
           <div slot="footer" class="dialog-footer">
-            <el-button v-show="this.active==1 && this.existed==0" size="medium" type="primary" :disabled="callRobotFlag" @click="callRobot" round>呼叫托盘工装</el-button>
-            <el-button v-show="this.active==1 && this.existed==2 && !this.matched" size="medium" type="primary" :disabled="confirmDisabled" @click="callRobot" round>替换托盘工装</el-button>	
+            <el-button v-show="this.active==1 && this.existed==0 && !this.locked" size="medium" type="primary" :disabled="callRobotFlag" @click="callRobot" round>呼叫托盘工装</el-button>
+            <el-button v-show="this.active==1 && this.existed==2 && !this.matched && !this.locked" size="medium" type="primary" :disabled="confirmDisabled" @click="callRobot" round>替换托盘工装</el-button>	
             <el-button plain type="info" @click.native="prev" v-show="this.active>1"  >返回上一步</el-button>
             <el-button type="primary" @click.native="next" v-show="this.active==1 && this.existed==2 && this.matched">已完成,下一步</el-button>
-            <el-button type="primary" :disabled="confirmDisabled" @click.native="submitForm" v-show="this.active>1">上料完成</el-button>
+            <el-button type="primary" :disabled="confirmDisabled" @click.native="submitForm" v-show="this.active>1 && !this.locked">上料完成</el-button>
           </div>
       </div>
     </el-dialog>
@@ -176,6 +176,7 @@
           tenantViewVisible: false,
           callRobotFlag:false,
           xbkValid: true,
+          locked: false,
           unFeedingCount: 0,  //未上料零件数
       	  existed: 0,
           matched: false,  //工装是否匹配
@@ -234,6 +235,7 @@
             this.existed = res.data.existed
 			      this.matched = res.data.matched
             this.confirmDisabled = false
+            this.locked = res.data.locked
             this.xbkValid = res.data.xbkValid
           }
         });        

+ 34 - 3
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View6.vue

@@ -78,7 +78,8 @@
     	</el-row>
 
     	<div slot="footer" class="dialog-footer">
-	      <el-button type="primary" :disabled="confirmDisabled" @click="submitForm">{{ $t('machining.buttons.finished') }}</el-button>
+	      <el-button type="primary" :disabled="confirmDisabled" @click="submitForm(6)">{{ $t('machining.buttons.finished') }}</el-button>
+        <el-button type="primary" :disabled="confirmDisabled" @click="storageForm">{{ $t('machining.buttons.inFinished') }}</el-button>
 	    </div>
     </div>
   </el-dialog>
@@ -102,6 +103,7 @@ export default {
     return {
       screenWidth: 0,
       confirmDisabled: false,
+      callRobotFlag: false,
       width: this.initWidth(),
       tenant: {},
       queryParams: initQueryParams({}),
@@ -176,9 +178,10 @@ export default {
         this.loading = false
       });
     },
-  	submitForm(){
+  	submitForm(type){
+       // 6:工序下料 3:下料        
         this.confirmDisabled = true
-        taskMgrApi.updateTaskStatus({ "id" : this.tenant.id, "updateType" : "end","processType" : "6","updateUser" : this.$store.state.account.user.id}).then((res) => {
+        taskMgrApi.updateTaskStatus({ "id" : this.tenant.id, "updateType" : "end","processType" : type,"updateUser" : this.$store.state.account.user.id}).then((res) => {
             res = res.data;
             if (res.isSuccess) {
                 // 通知列表
@@ -190,6 +193,34 @@ export default {
         this.confirmDisabled = false
       });
   	},
+    storageForm(){
+      machiningClientApi.checkStockNode({"taskNodeId": this.tenant.taskNodeId}).then((res)=>{
+            res = res.data;
+            if (res.isSuccess) {
+              let bool = res.data;              
+              if(bool){                  
+                  this.submitForm("3")   
+              }else{
+                  this.callRobot()
+              }
+            }
+      })
+    },
+    callRobot(){
+      this.callRobotFlag = false     	
+      machiningClientApi.callRobot({ "taskNodeId" : this.tenant.taskNodeId, "callType":"2"}).then((res) => {
+        			res = res.data
+        			if (res.isSuccess) {                
+         				 // 通知列表
+          				this.$emit("success");
+          				// 通知列表-并关闭弹出框
+          				this.$emit("close");
+       				 }
+      			}).finally(()=>{
+        			this.callRobotFlag = true
+       });		 
+		
+    },
     initWidth () {
       this.screenWidth = document.body.clientWidth
       if (this.screenWidth < 550) {

+ 16 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/Index.vue

@@ -36,7 +36,7 @@
 	      <el-button v-has-permission="['technologyVersion:audit']" type="success" icon="el-icon-folder-checked" size="medium" @click="audioBtn()">{{$t("common.audio.audio")}}</el-button>
 	      <el-button v-has-permission="['technologyVersion:set']" type="primary" icon="el-icon-box" size="medium" @click="setUse">{{$t("prepare.buttons.setUse")}}</el-button>
 	      <el-button v-has-permission="['technologyVersion:export']" type="primary" icon="el-icon-download" size="medium" @click="exportFile" >{{$t("prepare.buttons.loadTechn")}}</el-button>
-	      <el-button v-has-permission="['technologyVersion:copy']" type="primary" icon="el-icon-document-copy" size="medium" >{{$t("prepare.buttons.copyVision")}}</el-button>
+	      <el-button v-has-permission="['technologyVersion:copy']" type="primary" icon="el-icon-document-copy" size="medium" @click="cloneVersion" >{{$t("prepare.buttons.copyVision")}}</el-button>
 	      <el-button v-has-permission="['technologyVersion:delete']" type="danger" icon="el-icon-delete" size="medium" @click="deleteOne">{{$t("table.delete")}}</el-button>
     	</el-col>
     </el-row>
@@ -354,6 +354,21 @@ export default {
     		}
     	})
     },
+    cloneVersion(){
+      if (!this.currentRow) {
+        this.$message({
+          message: this.$t("tips.noDataSelected"),
+          type: "warning"
+        })
+        return false
+      }
+      technologyVersionApi.clone({ bomId: this.currentRow.bomId, versionId: this.currentRow.id}).then(response => {
+        const res = response.data
+        if(res.isSuccess) {
+          this.search()
+        }
+      })
+    },
     viewClose () {
       this.tenantViewVisible = false
     },

+ 1 - 1
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/technologyMgr/index.vue

@@ -36,7 +36,7 @@
           <el-input-number @change="test" v-model="row.sort" :min="1" :max="100" :placeholder='$t("common.pleaseEnter")'></el-input-number>
         </template>
       </el-table-column>
-      <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.identifier" :label='item.fieldName' :show-overflow-tooltip="true" v-show="item.identifier!='opid'">
+      <el-table-column v-for="item in tableData.titleList" :key="item.id" :prop="item.identifier" :label='item.fieldName' :show-overflow-tooltip="true" v-if="item.identifier!='opid'">
         <template slot="header">
           <span>{{ item.fieldName }}</span>
           <span v-if="item.identifier!='remark'" class="star">*</span>

+ 1 - 2
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/trayForm/index.vue

@@ -275,8 +275,7 @@
 	  	},
 	  	// 【托盘夹具组-来自上一工序】-函数
 	  	getPreMeterialList(){
-			console.log(this.technology)
-			this.type = this.technology.type
+			console.log(this.technology)			
 	  		technologyMgrApi.getPreProcedureTrayList(this.technology).then(res => {
 	  			console.log("【托盘夹具组-来自上一工序】: ", res)
 	  			res = res.data