|
@@ -65,7 +65,7 @@
|
|
|
|
|
|
<el-table-column prop="name" :label='$t("prepare.table.tools.name")' align="center">
|
|
|
<template slot-scope="{ row }">
|
|
|
- <el-button size="small" type="primary" @click.native="print(row)" round >打印零件编码</el-button>
|
|
|
+ <el-button size="small" type="primary" @click.native="printCode(row)" round >打印零件编码</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
@@ -86,7 +86,9 @@
|
|
|
<script>
|
|
|
// 列表查询的共通参数
|
|
|
import { initQueryParams } from '@/utils/commons'
|
|
|
- import taskMgrApi from "@/api/runManageCenter/taskMgr";
|
|
|
+ import taskMgrApi from "@/api/runManageCenter/taskMgr"
|
|
|
+ import taskNodMgrApi from "@/api/machiningClient/machiningClient"
|
|
|
+ import machiningClientApi from "@/api/machiningClient/machiningClient"
|
|
|
export default {
|
|
|
name: 'TaskView',
|
|
|
components: { },
|
|
@@ -150,28 +152,20 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
- print(row){
|
|
|
- // TODO 等待伟立调试
|
|
|
- let code = row.uniqueCode
|
|
|
-
|
|
|
- var socket = null
|
|
|
- try{
|
|
|
- socket = new WebSocket('ws://192.168.170.69:8888')
|
|
|
- socket.onopen= function(){
|
|
|
- console.log("连接成功!")
|
|
|
- socket.send(code)
|
|
|
- }
|
|
|
- socket.onmessage= function(msg){console.log(msg)}
|
|
|
- socket.onerror = function(e){alert("连接失败:"+e)}
|
|
|
- socket.onclose= function(e){
|
|
|
- console.log("连接关闭:"+ e.code)
|
|
|
- socket.close()
|
|
|
- }
|
|
|
- }catch(ex){
|
|
|
- alert('连接异常'+ex);
|
|
|
- return;
|
|
|
- }
|
|
|
- },
|
|
|
+ printCode(row){
|
|
|
+ this.loading = true
|
|
|
+ taskNodMgrApi.printCode({"uniqueCode" : this.tenant.uniqueCode, "taskNodeId" : row.taskNodeId }).then((res) => {
|
|
|
+ res = res.data;
|
|
|
+ if (res.isSuccess) {
|
|
|
+ // 通知列表
|
|
|
+ this.$emit("success");
|
|
|
+ // // 通知列表-并关闭弹出框
|
|
|
+ // this.$emit("close");
|
|
|
+ }
|
|
|
+ }).finally(()=>{
|
|
|
+ this.loading = false
|
|
|
+ });
|
|
|
+ },
|
|
|
submitForm(){
|
|
|
this.confirmDisabled = true
|
|
|
taskMgrApi.updateTaskStatus({ "id" : this.tenant.id, "updateType" : "end","processType" : "3","updateUser" : this.$store.state.account.user.id}).then((res) => {
|
|
@@ -208,6 +202,22 @@ export default {
|
|
|
tradeMark: this.tenant.tradeMark,
|
|
|
armorPic: this.tenant.armorPic,
|
|
|
})
|
|
|
+
|
|
|
+ if(!this.tenant.uniqueCode){
|
|
|
+ this.RFIDParams.taskId = this.tenant.id
|
|
|
+ this.RFIDParams.taskNodeId = this.tenant.taskNodeId
|
|
|
+ this.RFIDParams.data.positionIndex = this.tenant.currentStationName.substr(-1)
|
|
|
+ let that = this
|
|
|
+ machiningClientApi.read(this.RFIDParams).then(res => {
|
|
|
+ if(res.data.result){
|
|
|
+ this.$message({
|
|
|
+ message: "RFID: "+res.data.result,
|
|
|
+ type: "success"
|
|
|
+ })
|
|
|
+ that.tenant.uniqueCode = res.data.result
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
close () {
|
|
|
this.$emit('close')
|