Explorar o código

前端页面业务处理

oyq28 %!s(int64=2) %!d(string=hai) anos
pai
achega
d64f97c901

+ 7 - 1
imcs-ui/src/api/lineSideLibrary/lineSideMgr.js

@@ -73,7 +73,7 @@ const apiList = {
   },
   manualTask: {
     method: 'POST',
-    url: `/authority/handMode/manualTask`
+    url: `/authority/workpiece/handMode/manualTask`
   },
 }
 
@@ -194,5 +194,11 @@ export default {
       ...apiList.import,
       data
     })
+  },
+  manualTask (data) {
+    return axiosApi({
+      ...apiList.manualTask,
+      data
+    })
   }
 }

+ 10 - 1
imcs-ui/src/api/lineSideLibrary/locationMgr.js

@@ -35,7 +35,10 @@ const apiList = {
     method: 'POST',
     url: `/authority/storge/storgeCount`
   },
-
+  checkStock: {
+    method: 'POST',
+    url: `/authority/productionresource/page`
+  },
   // 设置可选的托盘
   setValidTray: {
     method: 'POST',
@@ -110,6 +113,12 @@ export default {
       data
     })
   },
+  checkStock (data) {
+    return axiosApi({
+      ...apiList.checkStock,
+      data
+    })
+  },
 
   // 设置可选的托盘
   setValidTray (data) {

+ 4 - 0
imcs-ui/src/lang/zh/lineSide.js

@@ -189,6 +189,10 @@ export default {
 			wareType: '库位类型',
 			useWare: '可用库位',
 			inWareFan: '入库方案',
+			inWareConf: '入库设定',
+			inWarePoint: '起始库位',
+			deviceUnit: '产线选择',
+			robots: '产线机器人',
 			inWareNums: '库位入库数量',
 			inWareType: '入库库位',
 			inWareProd: '入库产品',

+ 6 - 10
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/Index.vue

@@ -216,6 +216,7 @@
 	        TenantStatusEnum: {}
 	      },
 	      currNode: {}, //当前选择的树数据
+		  parentNode: {},
 	      filterText: '',
 	      treeData: [],
         defaultProps: {
@@ -321,7 +322,7 @@
      		// console.log("data == ", data)
      		// console.log("checkData == ", checkData)
      		// 当前选中的Node
-     		this.currNode = data
+     		this.currNode = data			
      		// 永远只选择一个CheckBox节点
 	  		this.$refs.tree.setCheckedKeys([data.id])
 	  		// 加载列表数据
@@ -451,16 +452,11 @@
 	      this.dialog.isVisible = true
 	    },
 	    // 【批量入库】
-	    editList(){
-	    	/*if (!this.currentRow) {
-	        this.$message({
-	          message: this.$t("tips.unSelected"),
-	          type: "warning"
-	        })
-	        return
-	      }*/
-	    	// this.$refs.editList.setTenant(this.currentRow, this.currNode, this.dicts)
+	    editList(){		  
+		  this.parentNode = this.$refs.tree.getNode(this.currNode.parentId)
+		  let pNodeName = this.parentNode.data.name		  
 	      this.$refs.editList.type = "add"
+		  this.$refs.editList.setTenant({shelvesId: this.currNode.id, pNodeName:pNodeName})
 	      this.dialogList.title = this.$t("lineSide.buttons.warehousingList")
 	      this.dialogList.isVisible = true
 	    },

+ 4 - 16
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/Edit.vue

@@ -220,14 +220,12 @@ export default {
     submitForm () {
       this.$refs.form.validate((valid) => {
         if (valid) {
-          this.confirmDisabled = true
-          /*
+          this.confirmDisabled = true          
           if (this.type === 'add') {
-            this.save()
+            this.save()            
           } else {
             this.update()
-          } */
-          this.manualTask()
+          }          
         } else {
           return false
         }
@@ -242,8 +240,7 @@ export default {
             this.$message({
               message: this.$t('tips.createSuccess'),
               type: 'success'
-            })
-            //this.manualTask()
+            })            
             // 通知列表
 	          this.$emit("success");
 	          // 通知列表-并关闭弹出框
@@ -274,15 +271,6 @@ export default {
           return true
         })
     },
-    manualTask() {
-      let params = {manualId: new Date().getTime(), startpointId:"365",endpointId:this.tenant.no, startResourceId:"1496364001796292608",endResourceId:"1496360976922968064",robotResourceId:"1496360341817262080",manualIdType:"general",deviceUnit:"safeguard"}
-      lineSideMgrApi.manualTask(params).then(response => {
-        const res = response.data
-        if (res.isSuccess) {
-           return true
-        }
-      });
-    },
     // 【库位】下拉数据
     getLocationList(){
     	locationMgrApi.getList({}).then(res => {

+ 119 - 24
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/EditList.vue

@@ -10,12 +10,24 @@
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
     	<!--<div class="tixingNums">{{$t("lineSide.form.useWare")}}:{{availableNum}}{{$t("lineSide.common.lit")}}</div>-->
+        <div class="fanganTitle">{{$t("lineSide.form.inWareConf")}}:</div>
+		  <el-form-item :label='$t("lineSide.form.deviceUnit")+":"' prop="deviceUnit">
+        	  <el-select v-model="tenant.deviceUnit" placeholder="选择产线" :disabled="true">
+				<el-option v-for="deviceUnit in lineList " :label="deviceUnit.name" :value="deviceUnit.no" :key="deviceUnit.no" ></el-option>		
+			  </el-select>
+      	  </el-form-item>
+		  <el-form-item :label='$t("lineSide.form.robots")+":"' prop="robotResourceId">
+        	  <el-select v-model="tenant.robotResourceId" placeholder="选择产线机器人"  :disabled="true">
+				<el-option v-for="robot in robotList " :label="robot.name" :value="robot.id" :key="robot.id" ></el-option>		
+			  </el-select>
+      	  </el-form-item>
+		   <el-form-item :label='$t("lineSide.form.inWarePoint")+":"' prop="startpointId">
+        	<el-input-number v-model="tenant.startpointId" :min="1" :max="500" @change="checkStock($event)" ></el-input-number>
+      	  </el-form-item>
     	<div class="fanganTitle">{{$t("lineSide.form.inWareFan")}}:</div>
-      <!--<el-form-item :label='$t("lineSide.form.inWareNums")+":"' prop="LocationNum">
-        <el-input-number v-model="tenant.LocationNum" :min="1" :max="99999999"></el-input-number>
-      </el-form-item>-->
+
       <el-form-item :label='$t("lineSide.form.inWareType")+":"' prop="storgeId">
-        <el-select v-model="tenant.storgeId" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 50%;">
+        <el-select v-model="tenant.storgeId" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 50%;" @change="selStorge($event)">
         	<el-option
 			      v-for="item in locationList"
 			      :key="item.id"
@@ -43,7 +55,7 @@
 		      highlight-current-row
     			@current-change="handleCurrentChange"
 		    >
-		      <el-table-column prop="brandNo" :label='$t("lineSide.table.sideBrach.name")' align="center" width="160px">
+		      <el-table-column prop="brandNo" :label='$t("lineSide.table.sideBrach.name")' align="center" width="200px">
 		      	<template slot-scope="{ row }">
 		      		<el-autocomplete
 		      			v-if="row.isEdit"
@@ -93,14 +105,15 @@
   </el-dialog>
 </template>
 <script>
-// 【夹具管理】-API
-import trayMgrApi from "@/api/prepareProductMgr/trayMgr"
+import areaMgrApi from "@/api/resourceProductMgr/areaMgr"
 // 【仓库类型管理】-API
 import warehouseTypeMgrApi from "@/api/modelingCenter/warehouseTypeMgr"
 // 【边线库管理】-API
 import lineSideMgrApi from "@/api/lineSideLibrary/lineSideMgr"
 // 【库位管理】-API
 import locationMgrApi from "@/api/lineSideLibrary/locationMgr"
+import { initQueryParams } from '@/utils/commons'
+import qs from "qs"
 export default {
   name: 'TenantEdit',
   props: {
@@ -118,8 +131,13 @@ export default {
     	loading: false,
     	currentRow: null, // 当前选中的行
       type: 'add',
+	  shelvesId: '',
+	  pNodeName: '',
+	  zoneCode: '',
       availableNum: 23, // 数量
       tableData: [],
+	  lineList: [],
+	  robotList: [{id:"1496352097438793728",name:"舱体_机器人",abbreviate:"舱体",code:"CT"},{id:"1496360341817262080",name:"保障中心_伺服舵机",abbreviate:"保障中心",code:"BZ"},{id:"1496350084294508544",name:"框体_机器人",abbreviate:"框体",code:"KT"}],
       locationList: [],  // 【库位】下拉数据
       wareTypeList: [], // 库位类型下拉数据
       tenant: this.initTenant(),
@@ -127,6 +145,7 @@ export default {
       width: this.initWidth(),
       confirmDisabled: false,
       roles: [],
+	  queryParams: initQueryParams({}),
       rules: {
         name: [
         	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
@@ -140,14 +159,7 @@ export default {
   },
   // 实例已经在内存中创建好,此时data和methods已将ok,如果要操作data中的数据或是调用methods中的方法,最早只能在created中操作
   created() {
-  	// 调用数据
-  	this.loadAll()
-  	// 获取库位
-  	this.getLocationList()
-  	// 【库位类型】
-  	// this.getWareType()
-  	// 获取库位数量
-  	this.getWareNums()
+  	
 	},
   computed: {
     isVisible: {
@@ -165,10 +177,29 @@ export default {
       return (() => {
         this.width = this.initWidth()
       })()
-    }
+    }	
   },
-  methods: {
-  	// 获取【可用库位】-函数
+  methods: {  	
+	checkStock(point){	
+		this.queryParams = initQueryParams({})
+		this.queryParams.model.code = this.zoneCode+"_"+point
+		this.queryParams.model.status = 1 	
+		locationMgrApi.checkStock(this.queryParams).then(res => {
+  			res = res.data
+  			if(res.isSuccess){  				
+				if(res.data.total==1){
+					this.tenant.startResourceId = res.data.records[0].id
+					this.tenant.startpointId = String(point)
+				}else{
+					this.$message({
+              			message: "请确认入库库位设备是否存在或是否可用",
+              			type: "warning"
+          			})		
+				}
+  			}
+  		})
+	},
+	// 获取【可用库位】-函数
   	getWareNums(){
   		locationMgrApi.storgeCount({}).then(res => {
   			res = res.data 
@@ -294,7 +325,13 @@ export default {
     },
     initTenant () {
       return {
-      	inWareNums: 1,
+		manualId: '',
+		startpointId: '',
+		endpointId: '',
+		startResourceId: '',		
+        robotResourceId: '',
+		manualIdType:'general',
+		deviceUnit: ''
       }
     },
     initWidth () {
@@ -307,10 +344,30 @@ export default {
         return '800px'
       }
     },
-    setTenant (val) {
+	selParams(val){
+       let option = this.lineList.find(function(i){
+        return i.no === val
+      })
+	  this.tenant.deviceUnit = option.no
+	},
+	selStorge(val){
+       let option = this.locationList.find(function(i){
+        return i.id === val
+      })
+	  this.tenant.endpointId = option.no
+	},
+    setTenant (val) {		
     	if(val){
-    		this.tenant = { ...val }
+    		this.shelvesId = val.shelvesId
+			this.pNodeName = val.pNodeName
     	}
+		// 调用数据
+		this.loadAll()  	
+  		// 【库位类型】
+  		// this.getWareType()
+  		// 获取库位数量
+  		this.getWareNums()
+		this.fetch()
     },
     close () {
       this.$emit('close')
@@ -322,6 +379,26 @@ export default {
       this.tenant = this.initTenant()
       this.tableData = []  	//清空【规格】数据
     },
+	fetch(){	    	
+		    areaMgrApi.page(this.queryParams).then(res => {
+	    		res = res.data
+	    		if(res.isSuccess){
+	    			this.lineList = res.data.records
+					let that = this
+					let obj = this.lineList.find(item=>{
+						return that.pNodeName.indexOf(item.abbreviate)>-1
+					})
+					let robot = this.robotList.find(item=>{						
+						return that.pNodeName.indexOf(item.abbreviate)>-1
+					})					
+					this.tenant.deviceUnit = obj.no
+					this.tenant.robotResourceId = robot.id
+					this.zoneCode = robot.code
+	    		}
+	    	})
+			// 获取库位
+			this.getLocationList()
+	    },
     submitForm () {
     	// 添加夹紧位置数据
     	this.tenant.stockBrandList = this.tableData
@@ -331,7 +408,8 @@ export default {
         if (valid) {
           this.confirmDisabled = true
           if (this.type === 'add') {
-            this.save()
+            //this.save()
+			this.manualTask()
           } else {
             this.update()
           }
@@ -379,14 +457,31 @@ export default {
           this.confirmDisabled = false
           return true
         })
+    },
+	manualTask() {
+      this.tenant.manualId = new Date().getTime().toString()
+	  this.tenant.startpointId = String(this.tenant.startpointId)
+	  console.log(this.tenant)	  
+	  lineSideMgrApi.manualTask(this.tenant).then(response => {
+        const res = response.data
+        if (res.isSuccess) {
+           this.save()
+        }
+      })
     },
     // 【库位】下拉数据
     getLocationList(){
-    	locationMgrApi.getList({}).then(res => {
+		this.queryParams = initQueryParams({})
+		this.queryParams.model.shelvesId = this.shelvesId
+		this.queryParams.model.lockStatus = 1
+		this.queryParams.size = 100		
+    	locationMgrApi.page(this.queryParams).then(res => {			
     		res = res.data 
     		console.log("【库位】下拉数据: ", res.data)
     		if(res.isSuccess){
-    			this.locationList = res.data
+    			this.locationList = res.data.records.filter(item=>{
+					return item.storgeNum === 0
+				})
     		}
     	})
     }

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

@@ -283,7 +283,7 @@ export default {
       },
     callRobot(){
       this.callRobotFlag = true
-      taskNodMgrApi.callRobot({ "taskNodeId" : this.tenant.taskNodeId}).then((res) => {
+      machiningClientApi.callRobot({ "taskNodeId" : this.tenant.taskNodeId}).then((res) => {
         res = res.data;
         if (res.isSuccess) {
           // 通知列表