2024-2-20 设备模块列宽调整+工艺模块线体设备选择调整

yangwl
A0010407 9 months ago
parent 7cf0036628
commit 29a57c951a

@ -173,7 +173,7 @@
label="申领单号"
align="center"
prop="applyCode"
width="200"
width="250"
/>
<el-table-column
label="关联工单号"

@ -8,23 +8,29 @@
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="5" :xs="24">
<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>
<div class="head-container">
<el-input
v-model="typeName"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData"
: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-col>
<!--设备数据-->
@ -96,7 +102,9 @@ export default {
// components: { Treeselect },
data() {
return {
treeData1:[],
//
typeName: undefined,
treeData:[],
showFlag:false,
//
selectedItemId: undefined,
@ -138,26 +146,33 @@ export default {
this.getEquipmentType();
},
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val
},
//
indexMethod(index){
return index+1 ;
},
//
//
indexMethod(index){
return index+1 ;
},
/** 查询设备编码列表*/
getList() {
@ -173,17 +188,17 @@ export default {
/** 查询分类下拉树结构 */
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
this.treeData = response.data;
});
},
//
filterNode(value, data) {
console.log(value, data);
console.log("value:",value,"data:",data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
if(data.equipmentTypeName != null){
return data.equipmentTypeName.indexOf(value) !== -1;
}
},
//
@ -194,11 +209,11 @@ export default {
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
@ -253,10 +268,7 @@ export default {
//
submitEquipmentForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",equipmentCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
@ -264,17 +276,15 @@ export default {
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.cancelEquipmentForm();
this.queryParams.itemCodeGet = "";
},
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.typeName = null;
this.getList();
this.showFlag = false;
}
}
};

@ -8,23 +8,29 @@
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-col :span="5" :xs="24">
<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>
<div class="head-container">
<el-input
v-model="typeName"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-tree
:data="treeData"
: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-col>
<!--设备数据-->
@ -96,7 +102,9 @@ export default {
// components: { Treeselect },
data() {
return {
treeData1:[],
//
typeName: undefined,
treeData:[],
showFlag:false,
//
selectedItemId: undefined,
@ -138,26 +146,33 @@ export default {
this.getEquipmentType();
},
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: {
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
//
reset() {
this.form = {
itemId: null,
itemCode: this.processId,
itemType: null,
};
this.resetForm("form");
},
handleEquipmentSelectionChange (val) {
this.itemList = val
},
//
indexMethod(index){
return index+1 ;
},
//
//
indexMethod(index){
return index+1 ;
},
/** 查询设备编码列表*/
getList() {
@ -173,17 +188,17 @@ export default {
/** 查询分类下拉树结构 */
getEquipmentType() {
getEquipmentTypeList().then(response => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
this.treeData = response.data;
});
},
//
filterNode(value, data) {
console.log(value, data);
console.log("value:",value,"data:",data);
if (!value) return true;
return data.label.indexOf(value) !== -1;
if(data.equipmentTypeName != null){
return data.equipmentTypeName.indexOf(value) !== -1;
}
},
//
@ -194,11 +209,11 @@ export default {
this.handleQuery();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
@ -253,10 +268,7 @@ export default {
//
submitEquipmentForm() {
const data = this.ids;
console.log("数据",data);
const equipmentCode = data.toString();
console.log("拆分数据",equipmentCode);
console.log("原来的数据",this.queryParams.itemCodeGet);
if(this.queryParams.itemCodeGet == ""){
this.queryParams.itemCodeGet = equipmentCode;
}else{
@ -264,17 +276,15 @@ export default {
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit('onSelected', this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.cancelEquipmentForm();
this.queryParams.itemCodeGet = "";
},
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.getList();
console.log('111111',this.queryParams.equipmentTypeCode);
this.showFlag = false;
this.typeName = null;
this.getList();
this.showFlag = false;
}
}
};

Loading…
Cancel
Save