设备分类动态获取

yangwl
A0010407 1 year ago
parent b24299ed66
commit 81617cd17c

@ -94,3 +94,11 @@ export function getWorkCenterList() {
method: 'get'
});
}
// 查询设备类型
export function getEquipmentTypeList() {
return request({
url: '/technology/pro/process/getEquipmentTypeList',
method: 'get'
});
}

@ -9,17 +9,21 @@
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-tree
:data="treeData"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData1"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-card>
</el-col>
<!--设备数据-->
@ -80,7 +84,7 @@
</template>
<script>
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment} from "@/api/technology/process";
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment,getEquipmentTypeList} from "@/api/technology/process";
import { treeselect } from "@/api/wms/equipment";
// import Treeselect from "@riophae/vue-treeselect";
// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -91,30 +95,7 @@ export default {
// components: { Treeselect },
data() {
return {
treeData: [{
id: '1',
label: '设备类别',
children: [{
id: 'equ_type_lg',
label: '料罐'
}, {
id: 'equ_type_cxj',
label: '成型机'
}, {
id: 'equ_type_hf',
label: '烘房'
}, {
id: 'equ_type_spj',
label: '收坯机'
}, {
id: 'equ_type_bzx',
label: '包装线'
},{
id: 'equ_type_dsj',
label: '吊筛机'
}
]
}],
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
@ -133,10 +114,6 @@ export default {
itemTypeOptions: undefined,
//
equipmentTypeCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
@ -145,6 +122,7 @@ export default {
equipmentTypeCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
@ -156,11 +134,10 @@ export default {
},
created() {
this.getList();
// this.getTreeselect();
this.getEquipmentType();
},
methods: {
//
reset() {
this.form = {
@ -193,26 +170,13 @@ export default {
},
/** 查询分类下拉树结构 */
// getTreeselect() {
// treeselect().then(response => {
// this.itemTypeOptions = response.rows;
// console.log(response.rows);
// num = response.total;
// for (let id of response.rows) {
// if(id == 'equ_type_lg'){
// lable = '';
// }else if(id == 'equ_type_hf'){
// lable = '';
// }else if(id == 'equ_type_cpj'){
// lable = '';
// }else if(id == 'equ_type_bzx'){
// lable = '线';
// }else if(id == 'equ_type_cxj'){
// lable = '';
// }
// }
// });
// },
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
});
},
//
filterNode(value, data) {
@ -223,9 +187,11 @@ export default {
//
handleNodeClick(data) {
this.queryParams.equipmentTypeCode = data.id;
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
this.queryParams.equipmentTypeCode = null;
},
/** 搜索按钮操作 */

@ -9,17 +9,21 @@
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="4" :xs="24">
<div class="head-container">
<el-tree
:data="treeData"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
<el-card >
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData1"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id"
:expand-on-click-node="false"
:filter-node-method="filterNode"
ref="tree"
default-expand-all
@node-click="handleNodeClick"
/>
</div>
</el-card>
</el-col>
<!--设备数据-->
@ -80,7 +84,7 @@
</template>
<script>
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment} from "@/api/technology/process";
import { listProcess, getProcess, delProcess, addProcess, updateProcess ,listEquipment,getEquipment,getEquipmentTypeList} from "@/api/technology/process";
import { treeselect } from "@/api/wms/equipment";
// import Treeselect from "@riophae/vue-treeselect";
// import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -91,30 +95,7 @@ export default {
// components: { Treeselect },
data() {
return {
treeData: [{
id: '1',
label: '设备类别',
children: [{
id: 'equ_type_lg',
label: '料罐'
}, {
id: 'equ_type_cxj',
label: '成型机'
}, {
id: 'equ_type_hf',
label: '烘房'
}, {
id: 'equ_type_spj',
label: '收坯机'
}, {
id: 'equ_type_bzx',
label: '包装线'
},{
id: 'equ_type_dsj',
label: '吊筛机'
}
]
}],
treeData1:[],
showFlag:false,
//
selectedItemId: undefined,
@ -133,10 +114,6 @@ export default {
itemTypeOptions: undefined,
//
equipmentTypeCode: undefined,
defaultProps: {
id: "id",
label: "label"
},
//
queryParams: {
pageNum: 1,
@ -145,6 +122,7 @@ export default {
equipmentTypeCode: undefined,
itemTypeId: 0,
itemCodeGet: '',
itemCode : undefined,
},
//
columns: [
@ -156,11 +134,10 @@ export default {
},
created() {
this.getList();
// this.getTreeselect();
this.getEquipmentType();
},
methods: {
//
reset() {
this.form = {
@ -193,26 +170,13 @@ export default {
},
/** 查询分类下拉树结构 */
// getTreeselect() {
// treeselect().then(response => {
// this.itemTypeOptions = response.rows;
// console.log(response.rows);
// num = response.total;
// for (let id of response.rows) {
// if(id == 'equ_type_lg'){
// lable = '';
// }else if(id == 'equ_type_hf'){
// lable = '';
// }else if(id == 'equ_type_cpj'){
// lable = '';
// }else if(id == 'equ_type_bzx'){
// lable = '线';
// }else if(id == 'equ_type_cxj'){
// lable = '';
// }
// }
// });
// },
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
});
},
//
filterNode(value, data) {
@ -223,9 +187,11 @@ export default {
//
handleNodeClick(data) {
this.queryParams.equipmentTypeCode = data.id;
console.log('id',data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
this.queryParams.equipmentTypeCode = null;
},
/** 搜索按钮操作 */

Loading…
Cancel
Save