Ver Fonte

上下料站页面代码及功能

oyq28 há 2 anos atrás
pai
commit
4d5d661423

+ 2 - 2
imcs-ui/src/api/machiningClient/machiningClient.js

@@ -94,11 +94,11 @@ const apiList = {
 	},
 	read: {
 		method: 'POST',
-    	url: `http://127.0.0.1:8089/api/ReadRFID`
+    	url: `http://192.168.11.245:8089/api/ReadRFID`
 	},
 	write: {
 		method: 'POST',
-    	url: `http://127.0.0.1:8089/api/WriteRFID`
+    	url: `http://192.168.11.245:8089/api/WriteRFID`
 	},
 }
 

+ 10 - 0
imcs-ui/src/api/runManageCenter/taskMgr.js

@@ -92,6 +92,10 @@ const apiList = {
       method: 'POST',
       url: `/authority/task/updateTaskStatus`
     },
+    confirmCode: {
+      method: 'POST',
+      url: `/authority/task/confirmCode`
+    },
     releaseClamp: {
       method: 'POST',
       url: `/authority/task/releaseClamp`
@@ -254,6 +258,12 @@ export default {
       data
     })
   },
+  confirmCode (data) {
+    return axiosApi({
+      ...apiList.confirmCode,
+      data
+    })
+  },
 
   // 人工上下料拆除夹具
   releaseClamp (data) {

+ 25 - 7
imcs-ui/src/views/zuihou/machiningClient/touchScreen/Index.vue

@@ -250,6 +250,12 @@
 	      	@close="viewClose"
           @success="editSuccess"
 	    />
+      <task-view4
+	      	ref="view4"
+	      	:dialog-visible="view4Visible"
+	      	@close="viewClose"
+          @success="editSuccess"
+	    />
   </div>
 </template>
 
@@ -260,6 +266,7 @@ import TaskView from "./components/View";
 import TaskView1 from "./components/View1";
 import TaskView2 from "./components/View2";
 import TaskView3 from "./components/View3";
+import TaskView4 from "./components/View4";
 import { fullScreen, exitFullScreen, initQueryParams } from "@/utils/commons";
 import stationMgrApi from "@/api/machiningClient/stationMgr";
 import taskMgrApi from "@/api/runManageCenter/taskMgr";
@@ -267,7 +274,7 @@ import machiningClientApi from "@/api/machiningClient/machiningClient"
 import Pagination from "@/components/Pagination"
 export default {
   name: "TouchScreen",
-  components: {Pagination, TaskView,TaskView1,TaskView2,TaskView3 },
+  components: {Pagination, TaskView,TaskView1,TaskView2,TaskView3,TaskView4},
   props: {},
   data() {
     return {
@@ -297,6 +304,7 @@ export default {
       view1Visible: false,
       view2Visible: false,
       view3Visible: false,
+      view4Visible: false,
       isFullSreen: false, // 默认不全屏
       loading: false,
       uniqueCode: "",
@@ -402,12 +410,17 @@ export default {
       this.RFIDParams.data.positionIndex = this.currentStationName.substr(-1)
       let that = this
       machiningClientApi.read(this.RFIDParams).then(res => {         
-         if(res.data.result){
+         if(res.data.result!="false"){
            this.$message({
 		          	 message: "RFID: "+res.data.result,
 		          	 type: "success"
 		      })
            that.uniqueCode = res.data.result
+         }else {
+           this.$message({
+		          	message: "获取RFID数据失败",
+		          	type: "warning"
+		      })
          }
       });
 
@@ -426,20 +439,24 @@ export default {
         //   }
         // })
         // item.procedurePosition = current[0].name;
-        // 只有开始中的页面可以点击进入详情页面操作
-        item.currentStationName = this.currentStationName
+        // 只有开始中的页面可以点击进入详情页面操作         
+        item.currentStationName = this.currentStationName        
         if(item.exeStatus === '2' && item.interfaceType === '04'){
-            if(item.taskName == '上料'){
+            if(item.taskName == '上料' || item.nodeName == '上料' ){
                 this.$refs.view1.setTenant(item)
                 this.view1Visible = true
-            }else if(item.taskName == '人工翻面'){
+            }else if(item.taskName.indexOf('翻面')>-1){
                 item.uniqueCode = this.uniqueCode
                 this.$refs.view2.setTenant(item)
                 this.view2Visible = true
-            }else if(item.taskName == '下料'){
+            }else if(item.taskName.indexOf('下料')>-1){
                 item.uniqueCode = this.uniqueCode
                 this.$refs.view3.setTenant(item)
                 this.view3Visible = true
+            }else if(item.taskName.indexOf('热处理上料')>-1){
+                item.uniqueCode = this.uniqueCode
+                this.$refs.view4.setTenant(item)
+                this.view4Visible = true
             }
         }
 	  },
@@ -447,6 +464,7 @@ export default {
       this.view1Visible = false
       this.view2Visible = false
       this.view3Visible = false
+      this.view4Visible = false
     },
     editSuccess(){
       // this.getStation()

+ 19 - 4
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View1.vue

@@ -9,7 +9,7 @@
     <div class="boxDiv">
     	<!-- 任务信息 -->
         <el-steps :active="active" finish-status="success" simple style="margin:20px 0;">
-  				<el-step title="夹具安装" ></el-step>
+  				<el-step title="工装安装" ></el-step>
   				<el-step title="物料装夹" ></el-step>
 		</el-steps>
 
@@ -214,12 +214,27 @@ export default {
 		  this.confirmDisabled = false
 		  return false
 	    }
+		//this.$confirm('确认?')		
+		this.$confirm(
+        '确定上料已完成并且舱门已关闭?',
+        this.$t("common.tips"),
+        {
+          distinguishCancelAndClose: true,
+          confirmButtonText: this.$t("common.confirm"),
+          cancelButtonText: this.$t("common.cancel"),
+          type: "warning",
+        }).then(() => {
+			//上料处理
+			this.addMaterial()
+		}).catch(()=>{})
+  	},
+	addMaterial(){
 		let that = this
-      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) => {
+        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) => {
           res = res.data;
           if (res.isSuccess) {
 			  //写入RFID
-			  this.RFIDParams.taskId = this.tenant.taskId
+			  this.RFIDParams.taskId = this.tenant.id
 			  this.RFIDParams.taskNodeId = this.tenant.taskNodeId
 			  this.RFIDParams.data.positionIndex = this.currentIndex
 			  //写入空值
@@ -243,7 +258,7 @@ export default {
       }).finally(()=>{
 		  this.confirmDisabled = false
 	  });
-  	},
+	},
   	// table的当前行值变化后
   	handleCurrentChange(val) {
 			// 设置当前行

+ 14 - 3
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View2.vue

@@ -47,8 +47,8 @@
     	<!-- 装夹物料 -->
     	<el-row>
     		<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST1: 拆零件</p>
-        <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >第一步:请物料编码二维码<el-button size="medium" type="primary" :disabled="confirmDisabled" @click="printCode" round>打印物料编码</el-button></p>
-        <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >第二步:请更换托盘工装<el-button  size="medium" type="primary" :disabled="confirmDisabled" @click="callRobot" round>呼叫托盘工装</el-button></p>
+        <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >第一步:请物料编码二维码<el-button size="medium" type="primary" :disabled="confirmDisabled" @click="printCode" round>打印物料编码</el-button></p>
+        <p v-if="this.tenant.trayConf=='3'" class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >第二步:请更换托盘工装<el-button  size="medium" type="primary" :disabled="confirmDisabled" @click="callRobot" round>呼叫托盘工装</el-button></p>
     		<!-- Table数据 -->
 			<el-table
 		      ref="table"
@@ -110,6 +110,16 @@ export default {
       width: this.initWidth(),
       tenant: {},
       queryParams: initQueryParams({}),
+      RFIDParams: {
+		    url: "192.168.11.130",
+		    port: "102",
+		    taskId: "",
+  		  taskNodeId: "",
+  		  data: {
+    		  content: "",
+    		  positionIndex: ""
+  		  }
+	    },
       loading: false,
     	tenantViewVisible: false,
     	tableKey: 0,
@@ -154,7 +164,7 @@ export default {
       });
   	},
     printCode(){
-        this.loading = true        
+        this.loading = true
         taskNodMgrApi.printCode({"uniqueCode" : this.tenant.uniqueCode, "taskNodeId" : this.tenant.taskNodeId }).then((res) => {
         res = res.data;
         if (res.isSuccess) {
@@ -196,6 +206,7 @@ export default {
     },
     setTenant (val) {
       this.tenant = { ...val }
+      console.log(this.tenant)
       // 添加数据
       this.tableData.records = []
       this.tableData.records.push({

+ 13 - 3
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View3.vue

@@ -46,7 +46,7 @@
 
     	<!-- 拆除零件 -->
     	<el-row>
-    		<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST1 拆除零件   <el-button size="small" type="primary" @click.native="release" round>拆除夹具</el-button></p>
+    		<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST1 拆除零件 </p>
     		<!-- Table数据 -->
 			<el-table
 		      ref="table"
@@ -72,8 +72,8 @@
 			</el-table>
     	</el-row>
     	<!-- 拆除夹具 -->
-    	<el-row>
-    		<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;">ST2 拆除夹具</p>
+    	<el-row v-show="false">
+    		<p class="titleP" style="margin-top:15px;color:#000;font-size:18px;">ST2 拆除夹具   <el-button size="small" type="primary" @click.native="release" round>拆除夹具</el-button></p>
     		<el-tag size="medium" style="margin:10px;font-size:15px;"> 人工拆除夹具并放入夹具库</el-tag>
     	</el-row>
 
@@ -105,6 +105,16 @@ export default {
       width: this.initWidth(),
       tenant: {},
       queryParams: initQueryParams({}),
+      RFIDParams: {
+		    url: "192.168.11.130",
+		    port: "102",
+		    taskId: "",
+  		  taskNodeId: "",
+  		  data: {
+    		  content: "",
+    		  positionIndex: ""
+  		  }
+	    },
       loading: false,
     	tenantViewVisible: false,
     	tableKey: 0,

+ 352 - 0
imcs-ui/src/views/zuihou/machiningClient/touchScreen/components/View4.vue

@@ -0,0 +1,352 @@
+<template>
+    <el-dialog
+      :title='$t("common.view")'
+      width="80%"
+      :append-to-body="true"
+      :visible.sync="isVisible"
+      class="tenant-view"
+    >
+      <div class="boxDiv">
+          <!-- 任务信息 -->
+          <el-steps :active="active" finish-status="success" simple style="margin:20px 0;">
+                    <el-step title="申请上料" ></el-step>
+                    <el-step title="上料处理" ></el-step>
+          </el-steps>
+  
+          <el-row v-show="this.active==1">
+              <p style="margin-top:0;text-align:center;font-size:18px;">{{$t("runCenter.form.viewSched.name")}}
+                  <span style="float:right;margin-right:20px;font-size:14px;">{{$t("runCenter.form.viewSched.bomNo")+":"}}{{tenant.no}}</span>
+              </p>
+              <table class="comtable" border="0" cellspacing="0" cellpadding="6">
+                  <tr>
+                      <td class="blodTd" align="center" width="120">{{$t("runCenter.form.viewSched.procedureNo")+":"}}</td>
+                      <td width="200">{{tenant.taskNo}}</td>
+                      <td class="blodTd" align="center" width="120">{{$t("runCenter.form.viewSched.status")+":"}}</td>
+                      <td width="120">
+                           <el-tag v-if="tenant.status == 0" type="info">{{$t("runCenter.common.schedulStatus.noStart")}}</el-tag>
+                              <el-tag v-if="tenant.status == 1" type="">{{$t("runCenter.common.schedulStatus.run")}}</el-tag>
+                              <el-tag v-if="tenant.status == 2" type="success">{{$t("runCenter.common.schedulStatus.finished")}}</el-tag>
+                      </td>
+                  </tr>
+                  <tr>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.procedureDesc")+":"}}</td>
+                      <td>{{tenant.taskName}}</td>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.content")+":"}}</td>
+                      <td width="200">{{tenant.content}}</td>
+                  </tr>
+                  <tr>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.prepareWorkHours")+":"}}</td>
+                      <td>{{tenant.time}}分钟</td>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.procedurePosition")+":"}}</td>
+                      <td>{{tenant.currentStationName}}</td>
+                  </tr>
+                  <tr>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.startTime")+":"}}</td>
+                      <td>{{tenant.startTime}}</td>
+                      <td class="blodTd" align="center">{{$t("runCenter.form.viewSched.endTime")+":"}}</td>
+                      <td>{{tenant.endTime}}</td>
+                  </tr>
+              </table>
+          </el-row>
+  
+          <!-- 安装夹具 -->
+          <el-row v-show="this.active==1">
+              <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST1: 等待工装 <span style="color:red;margin-left:5px;font-size:14px;"></span></p>
+              <!-- Table数据 -->
+              <el-table
+                ref="table"
+                v-loading="loading"
+                :data="tableData.records"
+                border
+                fit
+                style="width: 100%;"
+              >
+                <!-- 编号 -->
+                <el-table-column prop="no" :label='$t("prepare.table.tools.no")' align="center" ></el-table-column>
+                 <!-- 编号 -->
+                <el-table-column prop="type" :label='$t("prepare.table.tools.type")' align="center" ></el-table-column>
+                <!-- 名称 -->
+                <el-table-column prop="name" :label='$t("prepare.table.tools.name")' align="center"></el-table-column>
+  
+              </el-table>
+          </el-row>
+  
+          <!-- 装夹物料 -->
+          <el-row v-show="this.active>1">
+              <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >ST2: 装夹物料</p>
+              <!-- Table数据 -->
+              <el-table
+                ref="table1"
+                v-loading="loading"
+                :data="tableData1.records"
+                border
+                fit
+                style="width: 100%;"
+              >
+                <!-- 材料编码 -->
+                <el-table-column prop="meterialCode" :label='$t("prepare.table.tools.no")' align="center" ></el-table-column>
+                 <!-- 材料牌号 -->
+                <el-table-column prop="tradeMark" :label='$t("prepare.table.tools.type")' align="center" ></el-table-column>
+                <!-- 材料名称 -->
+                <el-table-column prop="equipmentName" :label='$t("prepare.table.tools.name")' align="center"></el-table-column>
+                <!-- 装夹方式 -->
+                <el-table-column prop="clampImg" :label='$t("prepare.table.tools.clampImg")' align="center">
+                      <template slot-scope="{ row }">
+                           <div class="block">
+                               <el-image
+                                    style="width: 60px; height: 60px"
+                                    :src="row.armorPic"
+                                    fit="fill"></el-image>
+                           </div>
+                      </template>
+                </el-table-column>
+              </el-table>
+          </el-row>
+  
+          <!-- 输入唯一码 -->
+          <el-row v-show="this.active>1">
+            <p class="titleP" style="margin-top:15px;color:#000;font-size:18px;" >输入零件编码    <el-button size="small" type="primary" @click.native="confirmCode" round>扫码确认</el-button></p>
+            <el-input v-model="uniqueCode" placeholder="输入零件编码"></el-input>
+  
+          </el-row>
+  
+          <div slot="footer" class="dialog-footer">
+            <el-button type="primary" @click.native="apply" v-show="this.confirmDisabled"  >申请上料</el-button>
+            <el-button type="primary" :disabled="confirmDisabled" @click.native="next" v-show="this.active==1">已完成,下一步</el-button>
+            <el-button type="primary" :disabled="confirmDisabled2" @click.native="submitForm" v-show="this.active>1">上料完成</el-button>
+          </div>
+      </div>
+    </el-dialog>
+  </template>
+  <script>
+      // 【分页】组件
+    import taskMgrApi from "@/api/runManageCenter/taskMgr";
+    import machiningClientApi from "@/api/machiningClient/machiningClient"
+      // 列表查询的共通参数
+      import { initQueryParams } from '@/utils/commons'
+  export default {
+    name: 'TaskView',
+    components: { },
+    props: {
+      dialogVisible: {
+        type: Boolean,
+        default: false
+      }
+    },
+    data () {
+      return {
+        active: 1,
+        screenWidth: 0,
+        confirmDisabled: true,
+        confirmDisabled2: true,
+        width: this.initWidth(),
+        tenant: {},
+        queryParams: initQueryParams({}),        
+        loading: false,
+          uniqueCode: '',
+          tenantViewVisible: false,
+          tableKey: 0,
+            tableData: {
+              total: 0
+            },
+            tableData1: {
+             total: 0
+          },
+            tableData2: [],
+            currentRow: null, // 当前选择的行
+          currentIndex: 0,  //上下料站默认序号
+            spanArr: [],  // 【组序】合并单元格
+          spanArr2: [],  // 【优先级】合并单元格
+      }
+    },
+    // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
+    created() {
+      },
+    computed: {
+      isVisible: {
+        get () {
+          return this.dialogVisible
+        },
+        set () {
+          this.close()
+        }
+      }
+    },
+    mounted () {
+      window.onresize = () => {
+        return (() => {
+          this.width = this.initWidth()
+        })()
+      }
+    },
+    methods: {
+      apply(){
+        let that = this
+        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
+            }
+        });
+      },
+      next(){
+          // TODO 写入rfid内容(子盘信息和夹具信息)
+        taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
+          res = res.data;
+          if (res.isSuccess) {
+          }
+        });
+        if (this.active++ > 1) this.active = 0;
+      },
+        submitForm(){
+        // 更新改任务的开始时间
+        // TODO 写入rfid内容,工件信息、原材料R
+          this.confirmDisabled2 = true
+        let valid = this.uniqueCode!=''? true: false;
+          if(!valid){
+            this.$message({
+                message: "零件编码" + this.$t("rules.require"),
+                type: "warning"
+            })
+            this.confirmDisabled2 = 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) => {
+            res = res.data;
+            if (res.isSuccess) {                
+                // 通知列表
+                this.$emit("success");
+                // 通知列表-并关闭弹出框
+                this.$emit("close");
+            }
+        }).finally(()=>{
+            this.confirmDisabled2 = false
+        });
+        },
+        // table的当前行值变化后
+        handleCurrentChange(val) {
+              // 设置当前行
+          this.currentRow = val;
+        },
+      initWidth () {
+        this.screenWidth = document.body.clientWidth
+        if (this.screenWidth < 550) {
+          return '95%'
+        } else if (this.screenWidth < 990) {
+          return '580px'
+        } else if (this.screenWidth < 1400) {
+          return '600px'
+        } else {
+          return '650px'
+        }
+      },
+      setTenant (val) {
+        this.tenant = { ...val }
+        this.currentIndex = this.tenant.currentStationName.substr(-1)     
+        this.loading = false   
+        if(this.tenant.nodeName == '热处理上料'){
+            this.confirmDisabled = false
+        }else{
+            this.confirmDisabled = true
+        }
+        // 添加数据
+        this.tableData.records = []
+        // 添加数据
+        this.tableData.records.push({
+            no: this.tenant.clampNo,
+            name: this.tenant.clampName
+        })
+  
+        this.tableData1.records = []
+        // 添加数据
+        this.tableData1.records.push({
+            meterialCode: this.tenant.meterialCode,
+            equipmentName: this.tenant.equipmentName,
+            tradeMark: this.tenant.tradeMark,
+            armorPic: this.tenant.armorPic,
+        })       
+  
+      },
+      close () {
+        this.$emit('close')
+      },
+  
+      confirmCode(){
+        taskMgrApi.confirmCode({ "uniqueCode" : this.uniqueCode}).then((res) => {
+          res = res.data;
+          if (res.isSuccess) {
+            //this.uniqueCode = res.data.uniqueCode
+            this.confirmDisabled2 = false
+          }
+        });
+        // this.uniqueCode = this.uuid(32,16)
+        this.confirmDisabled2 = true
+      },
+  
+      uuid(len, radix) {
+        var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');
+        var uuid = [], i;
+        radix = radix || chars.length;
+        if (len) {
+            // Compact form
+            for (i = 0; i < len; i++) uuid[i] = chars[0 | Math.random()*radix];
+        } else {
+            // rfc4122, version 4 form
+            var r;
+  
+            // rfc4122 requires these characters
+            uuid[8] = uuid[13] = uuid[18] = uuid[23] = '-';
+            uuid[14] = '4';
+  
+            // Fill in random data.  At i==19 set the high bits of clock sequence as
+            // per rfc4122, sec. 4.1.5
+            for (i = 0; i < 36; i++) {
+                if (!uuid[i]) {
+                    r = 0 | Math.random()*16;
+                    uuid[i] = chars[(i == 19) ? (r & 0x3) | 0x8 : r];
+                }
+            }
+        }
+  
+        return uuid.join('').toLowerCase();
+      }
+    }
+  }
+  </script>
+  <style lang="scss" scoped>
+      .dialog-footer{
+          text-align: center;
+          padding: 30px;
+      }
+      .titleP{
+          position: relative;
+          font-size: 16px;
+          padding-left: 15px;
+      }
+      .titleP:before{
+          content: '';
+          position: absolute;
+          left: 0;
+          top: 3px;
+          width: 5px;
+          height: 80%;
+          background: #0F79DC;
+      }
+      .comtable{
+          width: 100%;
+          border-left: 1px solid #CCCCCC;
+          border-top: 1px solid #CCCCCC;
+      }
+      .comtable td{
+          border-right: 1px solid #CCCCCC;
+          border-bottom: 1px solid #CCCCCC;
+      }
+      .blodTd{
+          background: #EEEEEE;
+          color: #333333;
+      }
+  </style>
+