|
@@ -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
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
}
|