瀏覽代碼

前端页面功能更新操作

oyq28 1 年之前
父節點
當前提交
ad5531f6cc

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

@@ -51,6 +51,8 @@ export default {
 	  		lockde: "锁定",
 		    warehousing: '入库',
 		    warehousingList: '批量入库',
+			warehousingOutList: '批量出库',
+			batchStockout: '工装出库',
 		    rewuWarehousing: '任务号入库',
 		    unlock: "解锁库位",
 		    locking: "锁定库位",
@@ -191,11 +193,16 @@ export default {
 			inWareFan: '入库方案',
 			inWareConf: '入库设定',
 			inWarePoint: '起始库位',
+			outWareFan: '出库方案',
+			outWareConf: '出库设定',
+			outWarePoint: '目的点位',
 			deviceUnit: '产线选择',
 			robots: '产线机器人',
 			inWareNums: '库位入库数量',
 			inWareType: '入库库位',
 			inWareProd: '入库产品',
+			outWareType: '出库库位',
+			outWareProd: '出库产品',
 			brandName: '产品',
 			specification:'产品信息',
 			guige: '规格',

+ 1 - 0
imcs-ui/src/lang/zh/wmsMenu.js

@@ -43,6 +43,7 @@ export default {
       preservation: '临时保存',
       warehousingPurchase: '新增采购物料',
       warehousingList: '批量入库',
+      warehousingOutList: '批量出库',
       rewuWarehousing: '任务号入库',
       unlock: "解锁库位",
       locking: "锁定库位",

+ 3 - 1
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/Index.vue

@@ -307,6 +307,8 @@
 	  		// 如果值存在
 	  		if(val){
 	  			// 给下面的列表赋值
+				let parentNode = this.$refs.tree.getNode(this.currNode.parentId)
+		  		val.pNodeName = parentNode.data.name
 		  		this.$refs.product.storgeObj = val
 		  		// 加载下面的列表
 		  		this.$refs.product.fetch()
@@ -454,7 +456,7 @@
 	    // 【批量入库】
 	    editList(){		  
 		  this.parentNode = this.$refs.tree.getNode(this.currNode.parentId)
-		  let pNodeName = this.parentNode.data.name		  
+		  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")

+ 3 - 2
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/EditList.vue

@@ -463,13 +463,14 @@ export default {
 	manualTask() {
       this.tenant.manualId = new Date().getTime().toString()
 	  this.tenant.startpointId = String(this.tenant.startpointId)
-	  console.log(this.tenant)	  
+	  console.log(this.tenant)
+	  /*	  
 	  lineSideMgrApi.manualTask(this.tenant).then(response => {
         const res = response.data
         if (res.isSuccess) {
            this.save()
         }
-      })
+      }) */
     },
     // 【库位】下拉数据
     getLocationList(){

+ 13 - 8
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/warehouseProduct/Index.vue

@@ -6,6 +6,7 @@
 		    <el-row class="filter-container">
 		    	<el-col>
 			      <el-button type="success" icon="el-icon-download" size="medium" v-has-permission="['lineSide:stockout']" @click="editOne">{{ $t("lineSide.buttons.warehouseout") }}</el-button>
+				  <el-button type="success" icon="el-icon-download" size="medium" v-has-permission="['lineSide:batchStockout']" @click="editList">{{ $t("lineSide.buttons.batchStockout") }}</el-button>
 			      <el-button type="success" icon="el-icon-upload2" size="medium" v-has-permission="['lineSide:batchStockout']" @click="editOne">{{ $t("lineSide.buttons.rewuWarehouseout") }}</el-button>
 			      <el-button type="success" icon="el-icon-unlock" size="medium" v-has-permission="['lineSide:unlockProduct']" @click="unlockProd">{{ $t("lineSide.buttons.unlockProd") }}</el-button>
 			      <el-button type="danger" icon="el-icon-lock" size="medium" v-has-permission="['lineSide:lockProduct']" @click="lockingProd">{{ $t("lineSide.buttons.lockingProd") }}</el-button>
@@ -323,10 +324,10 @@
      	
      	// 【打印-Dom】-函数
      	printHtml(target) {
-	      	bdhtml = window.document.body.innerHTML;   
-		    sprnstr = "<!--startprint-->";   
-		    eprnstr = "<!--endprint-->";   
-		    prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr)+17);   
+	      	let bdhtml = window.document.body.innerHTML;   
+		    let sprnstr = "<!--startprint-->";   
+		    let eprnstr = "<!--endprint-->";   
+		    let prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr)+17);   
 		    prnhtml = prnhtml.substring(0,prnhtml.indexOf(eprnstr));   
 		    window.document.body.innerHTML=prnhtml;  
 		    window.print();
@@ -436,7 +437,7 @@
 	      	this.dialog.title = this.$t("lineSide.buttons.warehouseout")
 	      	this.dialog.isVisible = true
 	    },
-	    // 【批量库】
+	    // 【批量库】
 	    editList(){
 	    	if (!this.selection.length) {
 	        this.$message({
@@ -452,9 +453,12 @@
 	        })
 	        return
 	      }
-	    	this.$refs.editList.setTenant(this.selection[0], this.currNode, this.dicts)
-	      this.$refs.editList.type = "edit"
-	      this.dialogList.title = this.$t("lineSide.buttons.warehousingList")
+	      		  
+	      this.$refs.editList.type = "add"
+		  console.log(this.storgeObj)
+		  this.$refs.editList.setTenant({storgeObj: this.storgeObj, tableData: this.tableData })
+
+	      this.dialogList.title = this.$t("lineSide.buttons.warehousingOutList")
 	      this.dialogList.isVisible = true
 	    },
 	    fetch (params = {}) {
@@ -463,6 +467,7 @@
 	      this.queryParams.current = params.current ? params.current : this.queryParams.current
 	      this.queryParams.size = params.size ? params.size : this.queryParams.size
 	      // 根据上面选择变化数据
+		  console.log(this.storgeObj)
 	      this.queryParams.model.storgeId = this.storgeObj.id
 	      lineSideMgrApi.page(this.queryParams).then(response => {
 	        const res = response.data

+ 252 - 22
imcs-ui/src/views/zuihou/lineSideLibrary/lineSideMgr/components/warehouseProduct/components/EditList.vue

@@ -9,18 +9,69 @@
   	top="50px"
   >
     <el-form ref="form" :model="tenant" :rules="rules" label-position="right" label-width="130px">
-      <el-form-item label="产品编号:" prop="code">
-          <el-input v-model="tenant.code" placeholder="请输入..."/>
+      <div class="fanganTitle">{{$t("lineSide.form.outWareConf")}}:</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="产品名称:" prop="name">
-          <el-input v-model="tenant.name" placeholder="请输入..."/>
-      </el-form-item>
-      <el-form-item label="库位:" prop="name2">
-          <el-input v-model="tenant.name2" placeholder="请输入..."/>
-      </el-form-item>
-      <el-form-item label="数量:" prop="num">
-          <el-input-number v-model="tenant.num" :min="1" :max="99999999999" label=""></el-input-number>
+      <el-form-item :label='$t("lineSide.form.outWareType")+":"' prop="storgeId">
+        <el-select v-model="tenant.storgeId" :placeholder='$t("common.pleaseSelect")' size="medium" style="width: 50%;" :disabled="true">
+        	<el-option
+			      v-for="item in locationList"
+			      :key="item.id"
+			      :label="item.name"
+			      :value="item.id">
+			    </el-option>
+      	</el-select>
       </el-form-item>
+		  
+    	<div class="fanganTitle">{{$t("lineSide.form.outWareFan")}}:</div>
+          <el-form-item :label='$t("lineSide.form.outWarePoint")+":"' prop="endpointId">
+        	<el-input-number v-model="tenant.endpointId" :min="1" :max="500" @change="checkStock($event)" ></el-input-number>
+      	  </el-form-item>
+      <div class="fanganTitle">{{$t("lineSide.form.outWareProd")}}:</div>
+      <el-row>
+		    <!-- Table数据 -->
+			<el-table
+		      ref="table"
+		      v-loading="loading"
+		      :data="tableData"
+		      border
+		      fit
+		      style="width: 100%;"
+		      highlight-current-row
+    			@current-change="handleCurrentChange"
+		    >
+		      <el-table-column prop="brandNo" :label='$t("lineSide.table.sideProd.brandNo")' align="center" width="200px"></el-table-column>
+		      <el-table-column prop="categoryDesc" :label='$t("lineSide.table.sideBrach.name2")' align="center" width="120px"></el-table-column>
+		      <el-table-column prop="brandName" :label='$t("lineSide.table.sideProd.brandName")' align="center"></el-table-column>
+		      <el-table-column prop="specification" :label='$t("lineSide.table.sideProd.specification")' align="center" width="110px"></el-table-column>
+		      <el-table-column prop="num" :label='$t("lineSide.table.sideProd.num")' align="center" width="150px"></el-table-column>
+		      <el-table-column
+		        :label="$t('table.operation')"
+		        fixed="right"
+		        align="center"
+		        column-key="operation"
+		        width="50px"
+		      >
+		        <template slot-scope="{ row }">
+		          <el-tooltip class="item" :content='$t("common.delete")' effect="dark" placement="top-start">
+			          <i
+			            class="el-icon-delete table-operation"
+			            style="color: #f50;"
+			            @click="singleDelete(row)"
+			          />
+		          </el-tooltip>
+		        </template>
+		      </el-table-column>
+		    </el-table>
+      </el-row>
     </el-form>
     <div slot="footer" class="dialog-footer">
       <el-button plain type="warning" @click="isVisible = false">{{ $t('common.cancel') }}</el-button>
@@ -31,6 +82,14 @@
 <script>
 // 【BOM管理】-API
 import bomMgrApi from "@/api/prepareProductMgr/bomMgr"
+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'
 
 export default {
   name: 'TenantEdit',
@@ -47,17 +106,29 @@ export default {
   data () {
     return {
       type: 'add',
+      loading: false,
+    	currentRow: null, // 当前选中的行      
+	    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(),
       screenWidth: 0,
       width: this.initWidth(),
       confirmDisabled: false,
+      queryParams: initQueryParams({}),      
       dicts:{
         NATION: {}
       },
       roles: [],
       rules: {
         name: [
-        	{ required: true, message: '名称必须填写', trigger: 'blur' }
+        	{ required: true, message: this.$t("rules.require"), trigger: 'blur' }
         ]
       }
     }
@@ -86,11 +157,14 @@ export default {
   methods: {
     initTenant () {
       return {
-        id: '',
-        code: '',
-        name: '',
-        name2: '',
-        num: 1
+        manualId: '',
+		    startpointId: '',
+		    endpointId: '',
+		    startResourceId: '',
+		    endResourceId: '',		
+        	robotResourceId: '',
+		    manualIdType:'general',
+		    deviceUnit: ''
       }
     },
     initWidth () {
@@ -103,16 +177,158 @@ export default {
         return '800px'
       }
     },
-    setTenant (val, currNode, dicts) {
+    selParams(val){
+       let option = this.lineList.find(function(i){
+        return i.no === val
+      })
+	  this.tenant.deviceUnit = option.no
+	},
+  querySearchAsync(queryString, cb) {
+	    var restaurants = this.restaurants;
+	    var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants;
+	
+	    clearTimeout(this.timeout);
+	    this.timeout = setTimeout(() => {
+	      cb(results);
+	    }, 1000 * Math.random());
+	  },
+	  createStateFilter(queryString) {
+	    return (state) => {
+	      return (state.value.toLowerCase().indexOf(queryString.toLowerCase()) > -1);
+	    };
+	  },
+	selStorge(val){
+       let option = this.locationList.find(function(i){
+        return i.id === val
+      })
+	  this.tenant.endpointId = option.no
+	  this.tenant.endResourceId = option.resourceId
+	},
+  loadAll() {
+      lineSideMgrApi.getGoodsList({}).then(res => {
+      	res = res.data 
+        if (res.isSuccess) {
+        	let list = []
+	        res.data.forEach(item => {
+	        	item.value = item.name
+	        	list.push(item)
+	        })
+	        this.restaurants = list
+	        // console.log("自动获取数据33:", this.restaurants)
+        }
+       }).catch(err => {
+          console.log(err)
+        })
+  },
+  setTenant (val) {		
     	if(val){
-    		this.tenant = { ...val }
+    		this.shelvesId = val.storgeObj.shelvesId
+			this.pNodeName = val.storgeObj.pNodeName
+			this.tenant.storgeId = val.storgeObj.id
+			this.tenant.startResourceId = val.storgeObj.resourceId
+			this.tenant.startpointId = val.storgeObj.pointId
+			this.tableData = val.tableData.records			
     	}
-      // 字典表
-      this.dicts = dicts
-    },
+		// 调用数据
+		 this.loadAll()  	
+  		// 【库位类型】
+  		// this.getWareType()
+  		// 获取库位数量
+  		this.getWareNums()
+		this.fetch()     
+    },    
     close () {
       this.$emit('close')
     },
+    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()
+	  },    
+    handleCurrentChange(val){
+  		this.currentRow = val
+  	},
+	handleSelect(obj) {
+	    console.log(obj);
+	    let list = []
+	    this.tableData.map(item => {
+	    	if(item.key == this.currentRow.key){
+	    		// 合并对象
+	    		item = Object.assign(item, obj)
+	    		// 类型
+			    item.goodsType = obj.category
+			    // 物品id
+			    item.goodsId = obj.id
+	    	}
+	    	// console.log("选中的值:", item)
+	    	// 赋值
+	    	list.push(item)
+	    })
+	    
+	    // 重新赋值
+	    this.tableData = list
+	  },
+	checkStock(point){	
+		this.queryParams = initQueryParams({})
+		this.queryParams.model.code = this.zoneCode+"_"+point
+		this.queryParams.model.status = 1 	
+		let bool = true
+		locationMgrApi.checkStock(this.queryParams).then(res => {
+  			res = res.data
+  			if(res.isSuccess){  				
+				if(res.data.total==1){
+					this.tenant.endResourceId = res.data.records[0].id
+					this.tenant.endpointId = String(point)
+				}else{
+					this.$message({
+              			message: "请确认出库库位设备是否存在或是否可用",
+              			type: "warning"
+          			})		
+					bool = false
+				}
+  			}
+  		})
+		return bool
+	},
+    getWareNums(){
+  		locationMgrApi.storgeCount({}).then(res => {
+  			res = res.data 
+  			// console.log(" 获取【可用库位】:", res)
+  			if(res.isSuccess){
+  				this.availableNum = res.data
+  			}
+  		})
+  	},
+    getLocationList(){
+		  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.records.filter(item=>{
+					return item.storgeNum > 0
+				})
+    		}
+    	})
+    },
     reset () {
       // 先清除校验,再清除表单,不然有奇怪的bug
       this.$refs.form.clearValidate()
@@ -120,11 +336,16 @@ export default {
       this.tenant = this.initTenant()
     },
     submitForm () {
+	  if(!this.checkStock(this.tenant.endpointId)){
+		this.confirmDisabled = false
+		return false
+	  } 	
       this.$refs.form.validate((valid) => {
         if (valid) {
           this.confirmDisabled = true
           if (this.type === 'add') {
-            this.save()
+            //this.save()
+			this.manualTask()
           } else {
             this.update()
           }
@@ -132,6 +353,15 @@ export default {
           return false
         }
       })
+    },
+	manualTask() {
+      this.tenant.manualId = new Date().getTime().toString()
+	  lineSideMgrApi.manualTask(this.tenant).then(response => {
+        const res = response.data
+        if (res.isSuccess) {
+           this.save()
+        }
+      }) 
     },
     save () {
       bomMgrApi.save(this.tenant)

+ 2 - 5
imcs-ui/src/views/zuihou/machiningClient/touchScreen/Index.vue

@@ -501,11 +501,8 @@ export default {
                   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
-            }else if(item.taskName.indexOf('上料')>-1 && item.taskName.indexOf('OP')>-1){
+            }else if(item.taskName.indexOf('上料')>-1){
+                //工序上料或热处理上料
                 item.uniqueCode = this.uniqueCode
                 this.$refs.view5.setTenant(item)
                 this.view5Visible = true

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

@@ -82,7 +82,7 @@
 				      ST1: 请申请替换托盘工装
 			      </p>
             <p v-if="!this.matched && this.tenant.trayConf!='3'" class="titleP" style="margin-top:15px;color:#000;font-size:18px;"> 
-				      当前工装与零件不匹配,请先执行1号任务
+				      当前工装与零件不匹配,请先执行前序任务
 			      </p>    
 		     </el-row>
   

+ 14 - 9
imcs-ui/src/views/zuihou/prepareProductMgr/technologyVersion/components/technologyMgr/index.vue

@@ -52,7 +52,7 @@
           </div>
           <!-- 工序名称下拉-->
           <div v-if="!row.isinput&&item.identifier=='name'" :key="item.id">
-            <el-select @change="(name)=>changename(name,row)" v-model="row[item.identifier]" :placeholder='$t("common.pleaseSelect")' filterable style="width: 100%;">
+            <el-select @change="(name)=>changename(name,row)" v-model="row[item.identifier]" :placeholder='$t("common.pleaseSelect")' filterable allow-create style="width: 100%;">
               <el-option v-for="(value,key) in dicts['PROCEDURE_TYPE_NAME']" :key="key" :label="value" :value="value">
               </el-option>
             </el-select>
@@ -495,17 +495,20 @@ export default {
       // this.getSpanArr(this.tableData.data)
     },
     changename(name, obj) {
-      try {
+      try {        
         const keys = this.dictsKeys,
           no = keys.find(
             (ele) => this.dicts["PROCEDURE_TYPE_NAME"][ele] == name
           ),
-          n = no ? no[no.length - 1] : -2;
-        obj["no"] = `OP${obj.xh}${n}`;
-        if (obj.index == 1) obj["no"] = `OP0${n}`;
+          n = no ? no[no.length - 1] : -2; 
+          if (obj.index == 1) {
+            obj["no"] = `OP0${n}`;  
+          }else{       
+            obj["no"] = name.indexOf("上料")>-1? `OP${obj.xh-1}${n}`: `OP${obj.xh}${n}`;
+          }        
         this.getType(n, obj);
       } catch (error) {
-        cosnole.log(error);
+        console.log(error);
       }
     },
     getSpanArr(data) {
@@ -678,8 +681,8 @@ export default {
             }
             if (key == "sort") obj[key] = (item.sort || 101) - i - 1;
             let n = obj.no ? obj.no[obj.no.length - 1] : -2;
-            this.getType(n, obj);
             obj.content = obj.name;
+            this.getType(n, obj);            
           }
           this.tableData.data.push(obj);
           this.getSpanArr(this.tableData.data);
@@ -728,13 +731,15 @@ export default {
         obj["type"] = `下料`;
       }
       if (n == 3) {
-        obj["type"] = `热处理下料`;
+        obj["content"] = `热处理下料`;
+        obj["type"] = `工序下料`;
       }
       if (n == 4) {
         obj["content"] = `三坐标检测`;
       }
       if (n == 8) {
-        obj["type"] = `热处理上料`;
+        obj["content"] = `热处理上料`;
+        obj["type"] = `工序上料`;        
       }
     },
     clear(row) {