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

yangwl
A0010407 9 months ago
parent 7cf0036628
commit 29a57c951a

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

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

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

Loading…
Cancel
Save