2 コミット 297c463f7d ... a7b4af2d83

作者 SHA1 メッセージ 日付
  wang.sq@aliyun.com a7b4af2d83 Merge branch 'master' of http://106.14.142.95:3000/oyq28/imcs_331_web 1 週間 前
  wang.sq@aliyun.com 7bccf80c3e fix:上下刀具站界面优化 1 週間 前

+ 2 - 0
imcs-ui/.gitignore

@@ -1,5 +1,6 @@
 .DS_Store
 node_modules/
+imcs-ui/
 dist/
 zuihou-ui/
 npm-debug.log*
@@ -21,6 +22,7 @@ selenium-debug.log
 *.njsproj
 *.sln
 *.local
+*.imcs-ui/
 
 package-lock.json
 yarn.lock

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

@@ -100,6 +100,10 @@ const apiList = {
       method: 'POST',
       url: `/authority/task/confirmProcedure`
     },
+    cutterRfidConfirmProcedure: {
+      method: 'POST',
+      url: `/authority/task/cutterRfidConfirmProcedure`
+    },
     confirmBaiting: {
       method: 'POST',
       url: `/authority/task/confirmBaiting`
@@ -282,6 +286,12 @@ export default {
       data
     })
   },
+  cutterRfidConfirmProcedure (data) {
+    return axiosApi({
+      ...apiList.cutterRfidConfirmProcedure,
+      data
+    })
+  },
   confirmBaiting (data) {
     return axiosApi({
       ...apiList.confirmBaiting,

+ 3 - 2
imcs-ui/src/views/zuihou/machiningClient/cutToolTasks/Index.vue

@@ -322,7 +322,8 @@ export default {
       this.currentStationCode = current.aka
       this.getStation()
     },
-    getStation() {            
+    getStation() {     
+      console.log("---"+ this.options)       
       stationMgrApi.getCutToolStation({ zoneCode:this.currentStationCode })
         .then((res) => {          
           res = res.data;
@@ -399,7 +400,7 @@ export default {
 	    		if(res.isSuccess){
 	    			this.options = res.data.filter(item=>item.no!='safeguard')
             this.currentStationId = this.options[0].id
-            this.currentStationCode = this.options[0].aka
+            // this.currentStationCode = this.options[0].aka
             
 	    		}
 	    	})        

+ 198 - 61
imcs-ui/src/views/zuihou/machiningClient/cutToolTasks/components/View1.vue

@@ -13,6 +13,7 @@
   				<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;">刀具信息
 				<span style="float:right;margin-right:20px;font-size:14px;">库位编号:{{tenant.code}}</span>
@@ -61,35 +62,50 @@
     		<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="brandName" label='刀具产品' align="center" ></el-table-column>
-		       <!-- 材料牌号 -->
-		      <el-table-column prop="brandNo" label='RFID值' align="center" ></el-table-column>
-			  <!-- 材料名称 -->
-		      <el-table-column prop="goodsId" label='产品ID' align="center"></el-table-column>
-
-			  <el-table-column prop="pointId" label='产品ID' 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"
+			ref="table1"
+			v-loading="loading"
+			:data="tableData1.records"
+			border
+			fit
+			style="width: 100%;"
+			>
+			
+			<el-table-column prop="brandNo" label='刀柄号' align="center" ></el-table-column>
+			<el-table-column prop="brandName" label='刀具名称' align="center" ></el-table-column>
+			<el-table-column prop="pointId" label='起始位置' align="center"></el-table-column>
+			<el-table-column prop="goalType" label='目的设备' align="center">
+				<template slot-scope="scope">
+					<el-select v-model="scope.row.goalType" placeholder="选择设备类型" @change="choose">
+						<el-option v-for="device in cutToolDeviceList" :label="device.name" :value="device.code" :key="device.code" ></el-option>		
+					</el-select>
+				</template>
+			</el-table-column>
+			<el-table-column prop="targetPointId" label='目的位置' align="center">
+				<template slot-scope="scope">
+					<el-select v-model="scope.row.targetPointId" placeholder="选择目标位">								
+						<el-option v-for="position in cutToolStorgeList" :label="position.name" :value="position.pointId" :key="position.pointId"></el-option>		
+					</el-select>
+				</template>
+			</el-table-column>
+			<el-table-column prop="cutGoalNo" label='目的刀位号' align="center">
+				<template slot-scope="scope">
+					<el-input-number v-model="scope.row.cutGoalNo"   :min="0" :max="40"></el-input-number>
+				</template>
+			</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"
 								:preview-src-list="[row.armorPic]"
-      							fit="fill"></el-image>
-						 </div>
+								fit="fill"></el-image>
+						</div>
 					</template>
-			  </el-table-column>
-			  -->
-		    </el-table>
+			</el-table-column>
+			-->
+			</el-table>
     	</el-row>
 
 		<!-- 输入唯一码 -->
@@ -107,12 +123,19 @@
 </template>
 <script>
 	// 【分页】组件
-  import taskMgrApi from "@/api/runManageCenter/taskMgr";
-  import machiningClientApi from "@/api/machiningClient/machiningClient"
-  import stationMgrApi from "@/api/machiningClient/stationMgr"
-  import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
-	// 列表查询的共通参数
-  import { initQueryParams } from '@/utils/commons'
+import taskMgrApi from "@/api/runManageCenter/taskMgr";
+import machiningClientApi from "@/api/machiningClient/machiningClient"
+import stationMgrApi from "@/api/machiningClient/stationMgr"
+import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
+// 列表查询的共通参数
+import { initQueryParams } from '@/utils/commons'
+
+import equipmentMgrApi from "@/api/resourceProductMgr/equipmentMgr"	
+
+import toolbarApi from "@/api/systemMgr/toolbar"
+
+import qs from 'qs'
+
 export default {
   name: 'TaskView',
   components: { },
@@ -157,10 +180,15 @@ export default {
 		currentIndex: 0,  //上下料站默认序号
 	  	spanArr: [],  // 【组序】合并单元格
 	    spanArr2: [],  // 【优先级】合并单元格
+		cutToolDeviceList: [],
+		cutToolStorgeList: [{"name":"请选择","pointId":""}],
     }
   },
   // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
   created() {
+	
+		// 加载列表数据
+		this.fetch()
 	},
   computed: {
     isVisible: {
@@ -189,6 +217,75 @@ export default {
     }
   },
   methods: {
+	fetch () {
+      equipmentMgrApi.getList({})
+        .then((response) => {
+          const res = response.data;
+          if (res.isSuccess) {
+            // 赋值            
+			this.cutToolDeviceList = res.data.filter(item=> {				
+				return item.modeSpecification!=null || item.name.indexOf("刀具") > -1
+			});	
+          }         
+        })
+        .finally(() => (this.loading = false));	     
+	},
+	choose(val){
+		console.log("传参:"+val +"-tableData1.records-"+this.tableData1.records);
+		this.tableData1.records.forEach(item => {
+			this.$set(item, 'targetPointId', '');
+			this.$set(item, 'cutGoalNo', '0');
+		});
+
+		let data = this.tableData1.records[0];
+
+		if(data.pointId!=null || data.pointId!=""){
+			//判断起始设备和目的设备是否一致
+			let params = {"pointId": data.pointId.replace("CT_","")}
+			toolbarApi.getCutToolDevice(qs.stringify(params)).then(response=>{
+			const res = response.data
+			if(res.data == null){
+				this.$message({
+							message: "没有查询到设备",
+							type: 'warning'
+					})
+					return false
+			}
+
+			if(res.isSuccess){
+				let item = this.cutToolDeviceList.filter(item=>item.code==val); 
+				let resourceId = res.data.resourceId					
+				if(resourceId == item[0].id){
+					this.$message({
+							message: "起始设备和目的设备不能一样",
+							type: 'warning'
+					})
+					this.cutToolStorgeList = [];
+					return false
+				} 
+				
+				//
+				let params2 = {"code":val}
+				toolbarApi.cutToolPositionList(qs.stringify(params2)).then(response2=>{
+					const res2 = response2.data
+					this.cutToolStorgeList = [{"name":"请选择","pointId":""}]
+					if(res2.isSuccess){
+						let tempList = res2.data
+						this.cutToolStorgeList = tempList.map(item=>{
+							item.pointId = "CT_"+item.pointId
+							return item;
+						})
+						//console.log(this.cutToolStorgeList)
+					}
+					}).finally(()=>{
+						return true		
+					})
+			}
+			}).finally(()=>{
+				return true		
+			})
+		}			   
+	},
 	getBomList(){
 		bomMgrApi.list({}).then(res => {
     		res = res.data 
@@ -239,51 +336,76 @@ export default {
 	    }
       console.log(this.tenant)
 	  //RFID读取校验
-	  /*
-      taskMgrApi.confirmProcedure({ "taskNodeId":this.tenant.taskNodeId, "trayId": this.tenant.trayId, "clampNo": this.tenant.clampNo}).then((res) => {
+	  
+	  let rfidCutterT = "";
+      taskMgrApi.cutterRfidConfirmProcedure({ "taskNodeId":this.tenant.taskNodeId, "trayId": this.tenant.trayId, "clampNo": this.tenant.clampNo, "code": this.tenant.code , "zoneId": this.tenant.zoneId})
+	  .then((res) => {
           res = res.data         
           if (res.isSuccess) {
-            this.existed = res.data.existed
-			this.matched = res.data.matched
-            this.confirmDisabled = false
-			this.xbkValid = res.data.xbkValid
-			this.locked = res.data.locked
+			this.addCutToolStockInfo(res.data.rfidCutterT)
           }
-        });  */
+        }).catch((e)=>{
+			console.log("异常"+e);
+			this.$message({
+				message: e,
+				type: "error"
+			})	
+		});
+      },	
+	  addCutToolStockInfo(rfidCutterT){
+		if(rfidCutterT == null || rfidCutterT ===""){
+			this.$message({
+				message: "rfid数据读取为空",
+				type: "error"
+			})
+			return null;
+		}
+
+		console.log("rfidCutterT不为空的时候才能往下执行:"+rfidCutterT);
+     
 		this.existed = 1
 		this.matched = true
 		this.confirmDisabled = false
 		this.locked = false
 		this.xbkValid = true
-		this.addFlag = true       
-		
-		stationMgrApi.addCutToolStockInfo({ deviceId: this.tenant.id, RFID:"27"}).then((res) => {          
+		this.addFlag = true  
+
+		stationMgrApi.addCutToolStockInfo({ deviceId: this.tenant.id, rfid:rfidCutterT}).then((res) => {          
           res = res.data;
-          if (res.isSuccess) {			  
+          if (res.isSuccess) {
 			  let dataInfo = res.data[0]	
 			  this.tableData1.records = []			  
 			  this.tableData1.records.push({
 				brandName: dataInfo.brandName,
 				brandNo: dataInfo.brandNo,
 				pointId: dataInfo.pointId,
-				goodsId: dataInfo.goodsId
+				goodsId: dataInfo.goodsId,
+				goalType: '',
+				targetPointId: '',
+				cutGoalNo:'0'
+
 			  })			  	
 			  this.active++  
           }
         }).catch(()=>{});
-
-		
-
-      },	  
+	  } , 
 	prev(){
       if (this.active-- < 0) this.active = 0;
 	},
 	next(){
+		console.log("---"+this.tableData1);
+		this.tableData1.records = this.tableData1
+		this.tableData1.records.forEach(item => {
+			this.$set(item, 'goalType', '');
+			this.$set(item, 'targetPointId', '');
+			this.$set(item, 'cutGoalNo', '0');
+		});
+
 	    // TODO 写入rfid内容(子盘信息和夹具信息)
-		/*
-      taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
-        res = res.data;        
-      }); */
+		
+    //   taskMgrApi.procesRfid({ "id" : this.tenant.id, "clampId" : this.tenant.clampId,rfidType: "write" }).then((res) => {
+    //     res = res.data;        
+    //   }); 
       if (this.active++ > 1) this.active = 0;
       /*
 	  taskMgrApi.getReloadStatus({ "taskNodeId" : this.tenant.taskNodeId}).then((res) => {
@@ -298,10 +420,14 @@ export default {
       // 更新改任务的开始时间
       // TODO 写入rfid内容,工件信息、原材料R
 	    this.confirmDisabled = true			
-      	let valid = this.bBomId != '' && this.orderName != '' ? true: false;
+      	let valid =  this.tableData1.records[0].pointId != '' &&
+					this.tableData1.records[0].goodsId != '' &&
+					this.tableData1.records[0].goalType != '' &&
+					this.tableData1.records[0].targetPointId != '' ? true: false;
+
 	    if(!valid){
           this.$message({
-	          message: "零件编码" + this.$t("rules.require"),
+	          message: "目标设备、目的位置、目的刀位号" + this.$t("rules.require"),
 	          type: "warning"
 	      })		 
 		  this.confirmDisabled = false
@@ -332,19 +458,30 @@ export default {
             }, 500);
 		})
   	},
-	addMaterial(that){		
-        let params = {"orderName":that.orderName,"zoneId":that.tenant.zoneId,"bomId":that.bBomId,"materialId": that.materialId, "start":that.tenant.code}
-        stationMgrApi.addCutToolTask(params).then((res) => {
+	addMaterial(that){	
+		let data = that.tableData1.records[0]; 
+		let params = {"brandName":data.brandName,
+					"brandNo":data.brandNo,
+					"goodsId":data.goodsId,
+					"start": "CT_"+ data.pointId, 
+					"goalType":data.goalType, 
+					"goal":data.targetPointId, 
+					"cutStartNo":'0', 
+					"cutGoalNo":data.cutGoalNo}
+
+		  stationMgrApi.addCutToolTask(params).then((res) => {
           res = res.data;
           if (res.isSuccess) {
-			 //写入RFID			  
               that.loading = false		  
               that.$emit("success");
               //通知列表-并关闭弹出框
               that.$emit("close");
           }
-      }).finally(()=>{
+      }).catch((e)=>{
+		  console.log("错误"+ e)
+	  }).finally(()=>{
 		  that.confirmDisabled = false
+		  that.loading = false	
 	  });
 	},
   	// table的当前行值变化后