Prechádzať zdrojové kódy

Merge branch 'master' of http://106.14.142.95:3000/oyq28/imcs_331_web

wang.sq@aliyun.com 3 dní pred
rodič
commit
a7b4af2d83

+ 20 - 0
imcs-ui/src/api/resourceProductMgr/programCenter.js

@@ -85,6 +85,14 @@ const apiList = {
   import: {
     method: 'POST',
     url: `/authority/program/import`
+  },
+  getCutterCategory: {
+    method: 'POST',
+    url: `/authority/cutterCategory/page`
+  },
+  getBomProcedureTool: {
+    method: 'POST',
+    url: `/authority/cutterCategory/getBomProcedureTool`
   }
 }
 
@@ -219,5 +227,17 @@ export default {
       ...apiList.import,
       data
     })
+  },
+  getCutterCategory (data) {
+    return axiosApi({
+      ...apiList.getCutterCategory,
+      data
+    })
+  },
+  getBomProcedureTool (data) {
+    return axiosApi({
+      ...apiList.getBomProcedureTool,
+      data
+    })
   }
 }

+ 11 - 1
imcs-ui/src/api/systemMgr/toolbar.js

@@ -64,7 +64,11 @@ const apiList = {
   addNodeMsg: {
     method: 'POST',
     url: `/authority/toolbar/addNodeMsg`
-  } 
+  },
+  addOrderTask:{
+    method: 'POST',
+    url: `/authority/toolbar/addOrderTask`
+}, 
 }
 
 export default {
@@ -163,5 +167,11 @@ export default {
       ...apiList.addNodeMsg,
       data
     })
+  },
+  addOrderTask (data) {
+    return axiosApi({
+        ...apiList.addOrderTask,
+        data
+    })
   }
 }

+ 55 - 2
imcs-ui/src/views/zuihou/dispatchMgr/tools/Index.vue

@@ -275,7 +275,7 @@
 			<el-row :gutter="12" >
 				<el-col :xs="2" :sm="4">
 					<el-form-item label="起始位:" prop="start">
-						<el-tooltip content="例如:CT_LAUPT00101" placement="top">
+						<el-tooltip content="例如:CT2_LAUPT00101" placement="top">
                     		<el-input v-model="form11.start" placeholder="起始库位"></el-input>
 					   </el-tooltip>
 					</el-form-item>
@@ -291,7 +291,7 @@
 				</el-col>				
 				<el-col :xs="2" :sm="4">
 					<el-form-item label="目的位:" prop="goal">
-						<el-tooltip content="例如:CT_LAUPT00101" placement="top">
+						<el-tooltip content="例如:CT2_LAUPT00101" placement="top">
                     		<el-select v-model="form11.goal" placeholder="选择目标位">								
 							 	<el-option v-for="position in cutToolStorgeList" :label="position.name" :value="position.pointId" :key="position.pointId" v-if="cutToolStorgeList"></el-option>		
 			  				</el-select>
@@ -315,6 +315,31 @@
 	  </el-form>
 	</el-card>
 
+	<el-card class="box-card">
+        <div slot="header" class="clearfix">自定义订单复原处理</div>
+		<el-form ref="form13" :model="form13" :rules="rules4" label-width="100px">
+			<el-row :gutter="12" >
+				<el-col :xs="2" :sm="5">
+					<el-form-item label="起始位:" prop="start">
+						<el-tooltip content="例如:CT_LAUPT00101" placement="top">
+                    		<el-input v-model="form13.start" placeholder="起始库位"></el-input>
+					   </el-tooltip>
+					</el-form-item>
+				</el-col>							
+				<el-col :xs="2" :sm="5">
+					<el-form-item label="目的位:" prop="goal">
+						<el-tooltip content="例如:CT_LAUPT00101" placement="top">
+                    		<el-input  v-model="form13.goal" placeholder="目的库位"></el-input>
+					   </el-tooltip>
+					</el-form-item>
+				</el-col>																	
+			</el-row>
+			<el-form-item>
+    			<el-button type="primary" @click="addOrderTask" >发送</el-button>    		
+  			</el-form-item>
+	  </el-form>
+	</el-card>
+
 	<el-card class="box-card">
         <div slot="header" class="clearfix">添加动态消息</div>
 		<el-form ref="form12" :model="form12" :rules="rules9" label-width="80px">
@@ -424,6 +449,10 @@
 			count:0,
 			msgType:"1"
 		  },
+		  form13:{
+			start: "",			
+			goal: "",		
+		  },
 		  lineList: [],
 		  typeList: [{"name":"全部","value":"0"},{"name":"FANUC","value":"1"},{"name":"HEIDENHAIN","value":"2"},{"name":"DMG","value":"3"},{"name":"HELLER","value":"4"}],
 	      cutToolDeviceList: [],
@@ -851,6 +880,30 @@
 				}				
 			});
 		},
+		addOrderTask(){					
+			this.$refs.form13.validate((valid) => {
+				if(valid){
+					toolbarApi.addOrderTask(this.form13).then(response=>{
+						const res = response.data
+						if(res.isSuccess){
+							this.$message({
+              					message: this.$t('tips.updateSuccess'),
+              					type: 'success'
+            				})
+						}else{
+							this.$message({
+              					message: res.msg,
+              					type: 'warning'
+            				})
+						}
+					}).finally(()=>{
+					   return true		
+					})				
+				}else{
+					return false
+				}				
+			});
+		},
 		manualTask(){			
 			this.$refs.form7.validate((valid) => {
 				if(valid){

+ 5 - 2
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/TechnologyEdit.vue

@@ -294,7 +294,10 @@ export default {
     		if(item.cncProgram == "1"){
     			list.push(item)
     		}
-    	})
+    	})		
+		if(list.length>0){
+			list[0].bomId = this.processModeling.bomId			
+		}		
     	this.$refs.program.selectedEq = list
     },
     // 把【托盘夹具组】传来的【夹具组】的数据,赋值给子组件【程序-夹具组】
@@ -329,7 +332,7 @@ export default {
         return '800px'
       }
     },
-    setTenant (val, dicts, processModeling) {
+    setTenant (val, dicts, processModeling) {		
     	if(val){
     		this.tenant = { ...val }
     	}

+ 104 - 77
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/programForm/components/ProgramncMgr.vue

@@ -48,7 +48,7 @@
 		      	<el-form-item :label='$t("resource.form.pgContent")+":"' prop="pgContent">
 		        	<el-input v-model="pgContent" :readOnly="true" type="textarea" :rows="6" style="width: 100%;"/>
 		      	</el-form-item>
-		      	<!-- 刀具管理 -->
+		      	<!-- 刀具分组管理 -->
 		      	<div>
 			      	<h2 class="editTitle">{{$t("prepare.common.toolMgr")}}
 			      		<!-- 新增 -->
@@ -58,36 +58,32 @@
 				      	:data="toolList"
 				      	style="width: 100%"
 				    >
-				      	<el-table-column prop="cuttingToolCategory" :label='$t("resource.table.programTool.cuttingToolCategory")'>
+					   <el-table-column prop="partsAlias" label='零件编号'>
 					      	<template slot="header">
-			   					<span>{{$t("resource.table.programTool.cuttingToolCategory")}}</span>
-			   					<span class="star">*</span>
+			   					<span>零件编号</span>			   					
 							</template>
 							<template slot-scope="{ row }">
-					      		<el-select v-model="row.cuttingToolCategory" filterable :placeholder='$t("common.pleaseEnter")'>
-										<el-option
-        									v-for="(item,key,index) in dicts.CUTTING_TOOL_CATEGORY"
-        									:key="index"
-        									:label="item"
-        									:value="key">
-                    </el-option>
-								</el-select>
-					      	</template>
+					      		<span>{{ row.partsNo}}</span>
+					      	</template>							
 				      	</el-table-column>
-				      	<el-table-column prop="useTime" :label='$t("resource.table.programTool.useTime")'>
+
+						  <el-table-column prop="procedureNo" label='工序编号'>
 					      	<template slot="header">
-			   					<span>{{$t("resource.table.programTool.useTime")}}</span>
-			   					<span class="star">*</span>
+			   					<span>工序编号</span>			   					
 							</template>
 							<template slot-scope="{ row }">
-					      		<el-input-number v-model="row.useTime" :min="1" :max="999999999" label='$t("common.pleaseEnter")'></el-input-number>
-					      	</template>
+					      		<span>{{ row.procedureNo}}</span>
+					      	</template>							
 				      	</el-table-column>
-				      	<!--<el-table-column prop="count" :label='$t("resource.table.programTool.count")'>
-					      	<template slot-scope="{ row }">
-					      		<el-input-number v-model="row.count" :min="1" :max="999999999" label="数量"></el-input-number>
-					      	</template>
-				      	</el-table-column>-->
+
+				      	<el-table-column label='刀具数量'>
+					      	<template slot="header">
+			   					<span>刀具数量</span>			   					
+							</template>
+							<template slot-scope="{ row }">
+					      		<span v-if="row.count">{{ row.count}}</span>
+					      	</template>							
+				      	</el-table-column>				      	
 				      	<!-- 操作 -->
 				      	<el-table-column
 					        :label="$t('table.operation')"
@@ -114,6 +110,13 @@
 					        </template>
 				      	</el-table-column>
 				    </el-table>
+					<el-row :gutter="12" v-show="toolList.length>0">
+						<el-col :xs="24">
+							<el-input v-model="cuttingToolNames" :readOnly="true" type="textarea" :rows="8" style="width: 100%;"/>
+						</el-col>
+					</el-row>	
+
+					
 		      	</div>
 
 		    </el-form>
@@ -130,6 +133,7 @@ import programCenterApi from "@/api/resourceProductMgr/programCenter"
 // 【设备(生产资源)】-API
 import productionResourcesMgrApi from "@/api/resourceProductMgr/productionResourcesMgr"
 import attachmentMgrApi from "@/api/Attachment"
+import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
 import db from "@/utils/localstorage";
 import {Base64} from 'js-base64';
 import {initDicts, initQueryParams} from '@/utils/commons'
@@ -151,9 +155,11 @@ export default {
     	selectedEq: [], // 新增和修改的设备[设备]数据-来自·(可执行设备(位置))
     	subBtn: false,
     	formDisabled: false,
-      dicts: {
-        CUTTING_TOOL_CATEGORY: {}
-      },
+      	dicts: {
+        	CUTTING_TOOL_CATEGORY: {}
+      	},
+		cuttingToolCategory:{},
+		cuttingToolNames:"",
     	tableData: [],
     	eqList: [], // 设备下拉类别数据
     	toolList: [], // 刀具列表
@@ -245,36 +251,32 @@ export default {
 
 		// 初始化,【刀具下拉】
 		getToolList(arrs){
+			if(arrs.length == 0)
+			{
+				this.$message.warning('刀具分组数据不存在')			
+				return false;
+		    }
+			let arr = arrs[0].cuttingToolCategory.split("_")
+
 			this.queryParams.current = 1
 			this.queryParams.size = 9999
-			this.queryParams.map.state = 1
-			let arr = this.tenant.resourceIds.split(",")
-			if(arr.length>0){
-				this.queryParams.model.deviceId = arr[0]
-			}
-
-			if(arrs.length > 0){
-				this.queryParams.map.ids = arrs.map(item=>{return item.cuttingToolCategory}).join(',')
-			}
-
-			programCenterApi.toolList(this.queryParams).then(res => {
-	    		res = res.data
-	    		// console.log("【刀具下拉】下拉数据:", res)
-	    		if(res.isSuccess){
-					let arr = []
-					res.data.records.forEach(item =>{
-						const parent = arr.find(cur => cur.label === item.cuttingToolType.data)
-						if(parent){
-                           parent.options.push(item)
-						}else{
-						   let groupObj = {}
-						   groupObj.label = item.cuttingToolType.data
-						   groupObj.options = [item]
-						   arr.push(groupObj)
-						}
-					});
-					this.toolSelectList = arr
-	    		}
+			this.queryParams.model.partsNo = arr[0]
+			this.queryParams.model.procedureNo = arr[1]
+			let that = this
+			  programCenterApi.getCutterCategory(this.queryParams).then(res => {
+	    		res = res.data	    	
+    			if(res.isSuccess){    						
+					that.cuttingToolNames = res.data.records.map(item=>item.cutterName).join('\n')	
+					that.toolList = []							
+					that.toolList.push({
+      				id: arrs[0].id,
+      				cuttingToolCategory: arrs[0].cuttingToolCategory,
+      				partsNo: arr[0],
+					procedureNo: arr[1],      	
+      				count: res.data.total,					
+      				isEdit: false
+      			});
+    		  }	    		
 	    	})
 		},
 
@@ -365,10 +367,19 @@ export default {
 
     // 父组件,设置子组件的值-方法
     setTenant (val, selectedEq) {
-    	// console.log("设备:", val)
+    	 console.log("设备:", selectedEq)
+		 console.log("val:", val)
     	// 表单下拉数据,赋值,动态数据
-    	this.selectedEq = selectedEq;
+    	this.selectedEq = selectedEq;        
 
+	  	bomMgrApi.get({id:this.selectedEq[0].bomId}).then(res => {
+    		console.log("根据id,查询详情BOM:", res.data);
+    		res = res.data
+    		if(res.isSuccess){
+    			this.cuttingToolCategory = res.data
+    		}
+      	})
+		
     	if(val){
     		// 刀具管理
     		this.toolList = val.toolList?val.toolList:new Array();
@@ -405,16 +416,35 @@ export default {
     },
 
     // 【新增】按钮-事件
-    addRes(){
-      this.toolList.push({
-      	key: "WKS_"+ Math.random(),
-      	cuttingToolCategory: '',
-      	toolName: '',
-      	useTime: '',
-      	count: null,
-      	isEdit: true
-      });
-	  this.getToolList([]);
+    addRes(){		
+		if(this.toolList.length>0){
+			this.$message.warning('刀具分组已经存在,请勿重复添加')			
+			return false;
+		}
+
+		this.queryParams.current = 1
+		this.queryParams.size = 9999
+		this.queryParams.model.partsNo = this.cuttingToolCategory.parts_no
+		this.queryParams.model.procedureNo = this.cuttingToolCategory.no
+		let that = this
+		programCenterApi.getCutterCategory(this.queryParams).then(res => {
+    		console.log("根据id,查询详情BOM:", res.data);
+    		res = res.data
+    		if(res.isSuccess){    						
+				that.cuttingToolNames = res.data.records.map(item=>item.cutterName).join('\n')								
+				that.toolList.push({
+      				key: "WKS_"+ Math.random(),
+      				cuttingToolCategory: that.cuttingToolCategory.parts_no+"_"+ that.cuttingToolCategory.no,
+      				partsNo: that.cuttingToolCategory.parts_no,
+					procedureNo: that.cuttingToolCategory.no,      	
+      				count: res.data.total,					
+      				isEdit: false
+      			});
+    		}
+      	})
+
+		 
+
     },
 
     // 【删除】按钮事件
@@ -474,25 +504,22 @@ export default {
       this.$refs.form.validate((valid) => {
 		let bool = true;
 		let msg = ""
-		if(this.toolList.length ==0 && this.toolSelectList.length>0){
+		if(this.toolList.length ==0){
             bool = false
 			msg = "刀具设备不能为空"
-		}else if(this.toolList.length>0) {
+		}else if(this.toolList.length == 1) {
 			this.toolList.forEach(item => {
               if(!item.cuttingToolCategory){
 				 bool = false
 				 msg = "刀具类别不能为空"
 				 return false
 			  }else{
-				  if(idArr.indexOf(item.cuttingToolCategory)<0){
-				  	idArr.push(item.cuttingToolCategory)
-				  }else{
-					bool = false
-				 	msg = "同名类别不能重复选择"
-				    return false
-				  }
+				idArr.push(item.cuttingToolCategory)
 			  }
 			});
+		}else if(this.toolList.length > 1){
+             bool = false
+			 msg = "刀具分组数量大于1"
 		}
         if(!bool){
             this.$message({
@@ -510,7 +537,7 @@ export default {
         	if(obj.toolList && obj.toolList.length > 0){
         		let arr = [];
         		obj.toolList.map(item => {
-        			let target = this.toolSelectList.filter(obj => obj.id = item.cuttingToolCategory)[0];
+        			//let target = this.toolSelectList.filter(obj => obj.id = item.cuttingToolCategory)[0];
         			// 把刀具名称带出来
         			//item.toolName = target.cuttingToolName;
         			// 添加数据
@@ -528,7 +555,7 @@ export default {
 	        	// 添加关键字
 	        	obj.keys = ''+ Math.random();
 	        }
-	        // console.log("Form最终数据:", obj);
+	        console.log("Form最终数据:", obj);
 	        // return false;
         	// 恢复按钮
           	this.confirmDisabled = true;

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

@@ -224,7 +224,7 @@
 		  // 【程序管理】按钮-事件
 	  	addProgram(){
 	  		this.dialogProg.title = this.$t("prepare.common.addProgram"); // this.$t("common.add")
-	  		this.$refs.programnc.type = "add";
+	  		this.$refs.programnc.type = "add";			
 	  		this.$refs.programnc.setTenant(false, this.selectedEq);
 	  		// 打开弹出框
 	  		this.dialogProg.isVisible = true;