工作站添加线边库设置

This commit is contained in:
JinLu.Yin 2022-09-10 10:49:36 +08:00
parent 02d8ad6462
commit dae9a87b06

View File

@ -194,7 +194,7 @@
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-col :span="8">
<el-form-item label="所属工序" prop="processId">
<el-select v-model="form.processId" placeholder="请选择工序">
<el-option
@ -206,7 +206,17 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="8">
<el-form-item label="线边库">
<el-cascader v-model="warehouseInfo"
:options="warehouseOptions"
:props="warehouseProps"
@change="handleWarehouseChanged"
>
</el-cascader>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="是否启用" prop="enableFlag">
<el-radio-group v-model="form.enableFlag" disabled v-if="optType=='view'">
<el-radio
@ -288,7 +298,7 @@ import Workstationworker from "./components/worker";
//
import WorkStationTool from "./components/tool";
import {getTreeList} from "@/api/mes/wm/warehouse"
import {listAllProcess} from "@/api/mes/pro/process";
import {genCode} from "@/api/system/autocode/rule";
import { listAllWorkshop } from "@/api/mes/md/workshop";
@ -301,6 +311,13 @@ export default {
//
autoGenFlag:false,
optType: undefined,
warehouseInfo:[],
warehouseOptions:[],
warehouseProps:{
multiple: false,
value: 'pId',
label: 'pName',
},
//
loading: true,
//
@ -336,6 +353,9 @@ export default {
processId: null,
processCode: null,
processName: null,
warehouseId: null,
locationId: null,
areaId: null,
enableFlag: null,
},
//
@ -358,6 +378,7 @@ export default {
this.getList();
this.getWorkshops();
this.getProcess();
this.getWarehouseList();
},
methods: {
/** 查询工作站列表 */
@ -381,6 +402,32 @@ export default {
this.processOptions = response.data;
});
},
//
getWarehouseList(){
getTreeList().then( response =>{
this.warehouseOptions = response.data;
this.warehouseOptions.map(w =>{
w.children.map(l =>{
let lstr =JSON.stringify(l.children).replace(/locationId/g,'lId').replace(/areaId/g, 'pId').replace(/areaName/g,'pName');
l.children = JSON.parse(lstr);
});
let wstr = JSON.stringify(w.children).replace(/warehouseId/g,'wId').replace(/locationId/g, 'pId').replace(/locationName/g,'pName');
w.children = JSON.parse(wstr);
});
let ostr=JSON.stringify(this.warehouseOptions).replace(/warehouseId/g,'pId').replace(/warehouseName/g, 'pName');
this.warehouseOptions = JSON.parse(ostr);
});
},
//
handleWarehouseChanged(obj){
if(obj !=null){
this.form.warehouseId = obj[0];
this.form.locationId = obj[1];
this.form.areaId = obj[2];
}
},
//
cancel() {
this.open = false;
@ -399,6 +446,9 @@ export default {
processId: null,
processCode: null,
processName: null,
warehouseId: null,
locationId: null,
areaId: null,
enableFlag: 'Y',
remark: null,
createBy: null,