2024-2-27 设备模块+工艺模块 设备选择页面修改

master
A0010407 9 months ago
parent d7061c5c3d
commit 0ec476ac2e

@ -8,24 +8,32 @@
center center
: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"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-scrollbar style="height:500px">
<el-tree <el-tree
:data="treeData" :data="treeData"
:props="{ id: 'equipmentTypeCode', label: 'equipmentTypeName' }" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </el-scrollbar>
</el-card> </div>
</el-col> </el-col>
<!--设备数据--> <!--设备数据-->
@ -43,7 +51,7 @@
v-model="queryParams.itemCode" v-model="queryParams.itemCode"
placeholder="请输入设备编码" placeholder="请输入设备编码"
clearable clearable
style="width: 160px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -52,7 +60,7 @@
v-model="queryParams.itemName" v-model="queryParams.itemName"
placeholder="请输入设备名称" placeholder="请输入设备名称"
clearable clearable
style="width: 160px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -62,7 +70,7 @@
v-model="queryParams.groupLine" v-model="queryParams.groupLine"
filterable filterable
placeholder="请选择组线" placeholder="请选择组线"
style="width: 160px" style="width: 170px"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -82,7 +90,11 @@
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
style="padding-right:10px"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
@ -111,7 +123,6 @@
align="center" align="center"
key="itemCode" key="itemCode"
prop="equipmentCode" prop="equipmentCode"
v-if="columns[0].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -119,7 +130,6 @@
align="center" align="center"
key="itemTypeCode" key="itemTypeCode"
prop="equipmentTypeCode" prop="equipmentTypeCode"
v-if="columns[2].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -127,11 +137,22 @@
align="left" align="left"
key="itemName" key="itemName"
prop="equipmentName" prop="equipmentName"
v-if="columns[1].visible"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="设备类别"
align="left"
prop="equipmentCategory"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.equipment_category"
:value="scope.row.equipmentCategory"
/>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -161,8 +182,13 @@ import { Message } from "element-ui";
export default { export default {
name: "MdItemSingle", name: "MdItemSingle",
dicts: [
"equipment_category",
],
data() { data() {
return { return {
//
typeName: undefined,
treeData: [], treeData: [],
showFlag: false, showFlag: false,
// //
@ -200,6 +226,7 @@ export default {
{ key: 0, label: `设备编码`, visible: true }, { key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true }, { key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true }, { key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `设备类别`, visible: true },
], ],
}; };
}, },
@ -208,6 +235,15 @@ export default {
this.getEquipmentType(); this.getEquipmentType();
}, },
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: { methods: {
// //
reset() { reset() {
@ -234,7 +270,7 @@ export default {
this.loading = true; this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode; this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName; this.queryParams.equipmentName = this.queryParams.itemName;
getEquipmentList(this.queryParams).then((response) => { getEquList(this.queryParams).then((response) => {
this.itemList = response.rows; this.itemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -267,9 +303,11 @@ export default {
// //
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;
}
}, },
// //
@ -316,15 +354,14 @@ 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();
this.showFlag = false;
this.queryParams.itemCodeGet = ""; this.queryParams.itemCodeGet = "";
} }
}, },
cancelEquipmentForm() { cancelEquipmentForm() {
this.queryParams.equipmentTypeCode = null; this.queryParams.equipmentTypeCode = null;
this.typeName = null;
this.getList(); this.getList();
this.showFlag = false; this.showFlag = false;
}, },

@ -4,28 +4,36 @@
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal="false" :modal="false"
width="1100px" width="1200px"
center center
: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"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-scrollbar style="height:500px">
<el-tree <el-tree
:data="treeData1" :data="treeData"
:props="{ id: 'equipmentTypeCode', label: 'equipmentTypeName' }" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </el-scrollbar>
</el-card> </div>
</el-col> </el-col>
<!--设备数据--> <!--设备数据-->
@ -43,7 +51,7 @@
v-model="queryParams.itemCode" v-model="queryParams.itemCode"
placeholder="请输入设备编码" placeholder="请输入设备编码"
clearable clearable
style="width: 240px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -52,10 +60,28 @@
v-model="queryParams.itemName" v-model="queryParams.itemName"
placeholder="请输入设备名称" placeholder="请输入设备名称"
clearable clearable
style="width: 240px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="组线" prop="groupLine">
<template>
<el-select
v-model="queryParams.groupLine"
filterable
placeholder="请选择组线"
style="width: 170px"
>
<el-option
v-for="item in options"
:key="item.equipmentCode"
:label="item.equipmentName"
:value="item.equipmentCode"
>
</el-option>
</el-select>
</template>
</el-form-item>
<el-form-item> <el-form-item>
<el-button <el-button
type="primary" type="primary"
@ -64,7 +90,11 @@
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
style="padding-right:10px"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
@ -93,7 +123,6 @@
align="center" align="center"
key="itemCode" key="itemCode"
prop="equipmentCode" prop="equipmentCode"
v-if="columns[0].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -101,7 +130,6 @@
align="center" align="center"
key="itemTypeCode" key="itemTypeCode"
prop="equipmentTypeCode" prop="equipmentTypeCode"
v-if="columns[2].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -109,11 +137,22 @@
align="left" align="left"
key="itemName" key="itemName"
prop="equipmentName" prop="equipmentName"
v-if="columns[1].visible"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="设备类别"
align="left"
prop="equipmentCategory"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.equipment_category"
:value="scope.row.equipmentCategory"
/>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -134,15 +173,23 @@
import { import {
getEquipmentList, getEquipmentList,
getEquipmentTypeList, getEquipmentTypeList,
getGroupLineList,
} from "@/api/device/faultReport"; } from "@/api/device/faultReport";
import {getEquList} from "@/api/device/plan";
import { treeselect } from "@/api/wms/equipment";
import { Message } from "element-ui"; import { Message } from "element-ui";
export default { export default {
name: "MdItemSingle", name: "MdItemSingle",
// components: { Treeselect }, dicts: [
"equipment_category",
],
data() { data() {
return { return {
treeData1: [], //
typeName: undefined,
treeData: [],
showFlag: false, showFlag: false,
// //
selectedItemId: undefined, selectedItemId: undefined,
@ -172,12 +219,14 @@ export default {
itemCode: undefined, itemCode: undefined,
equipmentCode: null, equipmentCode: null,
equipmentName: null, equipmentName: null,
groupLine: null,
}, },
// //
columns: [ columns: [
{ key: 0, label: `设备编码`, visible: true }, { key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true }, { key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true }, { key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `设备类别`, visible: true },
], ],
}; };
}, },
@ -186,13 +235,23 @@ 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: null,
itemType: null, itemType: null,
groupLine :null,
}; };
this.resetForm("form"); this.resetForm("form");
}, },
@ -211,48 +270,66 @@ export default {
this.loading = true; this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode; this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName; this.queryParams.equipmentName = this.queryParams.itemName;
getEquipmentList(this.queryParams).then((response) => { getEquList(this.queryParams).then((response) => {
this.itemList = response.rows;
this.total = response.total;
this.loading = false;
});
//线
getGroupLineList().then((response) => {
this.options = response.rows;
});
},
//
getEquList() {
this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName;
getEquList(this.queryParams).then((response) => {
this.itemList = response.rows; this.itemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
/** 查询分类下拉树结构 */ /** 查询分类下拉树结构 */
getEquipmentType() { getEquipmentType() {
getEquipmentTypeList().then((response) => { getEquipmentTypeList().then((response) => {
console.log(response.rows); this.treeData = response.rows;
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;
}
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
console.log("id", data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode; this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode); console.log(this.queryParams.equipmentTypeCode);
this.handleQuery(); this.queryParams.pageNum = 1;
this.getList();
}, },
/** 搜索按钮操作 */ /** 搜索按钮操作 */
handleQuery() { handleQuery() {
this.queryParams.pageNum = 1; this.queryParams.pageNum = 1;
this.getList(); this.getEquList();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.queryParams.equipmentTypeCode = null; this.queryParams.equipmentTypeCode = null;
this.resetForm("queryForm"); this.resetForm("queryForm");
this.handleQuery(); this.queryParams.pageNum = 1;
this.getList()
}, },
// //
@ -266,7 +343,7 @@ export default {
submitEquipmentForm() { submitEquipmentForm() {
const data = this.ids; const data = this.ids;
if (data.length > 1) { if (data.length > 1) {
Message.warning("只能选择一个修机器,请勿选择多个!"); Message.warning("只能选择一个修机器,请勿选择多个!");
} else { } else {
const equipmentCode = data.toString(); const equipmentCode = data.toString();
if (this.queryParams.itemCodeGet == "") { if (this.queryParams.itemCodeGet == "") {
@ -277,18 +354,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.typeName = null;
this.getList(); this.getList();
console.log("111111", this.queryParams.equipmentTypeCode);
this.showFlag = false; this.showFlag = false;
}, },
}, },

@ -8,24 +8,32 @@
center center
: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"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-scrollbar style="height:500px">
<el-tree <el-tree
:data="treeData" :data="treeData"
:props="{ id: 'equipmentTypeCode', label: 'equipmentTypeName' }" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </el-scrollbar>
</el-card> </div>
</el-col> </el-col>
<!--设备数据--> <!--设备数据-->
@ -43,7 +51,7 @@
v-model="queryParams.itemCode" v-model="queryParams.itemCode"
placeholder="请输入设备编码" placeholder="请输入设备编码"
clearable clearable
style="width: 160px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -52,7 +60,7 @@
v-model="queryParams.itemName" v-model="queryParams.itemName"
placeholder="请输入设备名称" placeholder="请输入设备名称"
clearable clearable
style="width: 160px" style="width: 170px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
@ -62,7 +70,7 @@
v-model="queryParams.groupLine" v-model="queryParams.groupLine"
filterable filterable
placeholder="请选择组线" placeholder="请选择组线"
style="width: 160px" style="width: 170px"
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
@ -82,7 +90,11 @@
@click="handleQuery" @click="handleQuery"
>搜索</el-button >搜索</el-button
> >
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" <el-button
icon="el-icon-refresh"
size="mini"
@click="resetQuery"
style="padding-right:10px"
>重置</el-button >重置</el-button
> >
</el-form-item> </el-form-item>
@ -111,7 +123,6 @@
align="center" align="center"
key="itemCode" key="itemCode"
prop="equipmentCode" prop="equipmentCode"
v-if="columns[0].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -119,7 +130,6 @@
align="center" align="center"
key="itemTypeCode" key="itemTypeCode"
prop="equipmentTypeCode" prop="equipmentTypeCode"
v-if="columns[2].visible"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -127,11 +137,22 @@
align="left" align="left"
key="itemName" key="itemName"
prop="equipmentName" prop="equipmentName"
v-if="columns[1].visible"
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
/> />
<el-table-column
label="设备类别"
align="left"
prop="equipmentCategory"
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
<dict-tag
:options="dict.type.equipment_category"
:value="scope.row.equipmentCategory"
/>
</template>
</el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
@ -161,8 +182,13 @@ import { Message } from "element-ui";
export default { export default {
name: "MdItemSingle", name: "MdItemSingle",
dicts: [
"equipment_category",
],
data() { data() {
return { return {
//
typeName: undefined,
treeData: [], treeData: [],
showFlag: false, showFlag: false,
// //
@ -200,6 +226,7 @@ export default {
{ key: 0, label: `设备编码`, visible: true }, { key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true }, { key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true }, { key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `设备类别`, visible: true },
], ],
}; };
}, },
@ -208,6 +235,15 @@ export default {
this.getEquipmentType(); this.getEquipmentType();
}, },
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: { methods: {
// //
reset() { reset() {
@ -234,7 +270,7 @@ export default {
this.loading = true; this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode; this.queryParams.equipmentCode = this.queryParams.itemCode;
this.queryParams.equipmentName = this.queryParams.itemName; this.queryParams.equipmentName = this.queryParams.itemName;
getEquipmentList(this.queryParams).then((response) => { getEquList(this.queryParams).then((response) => {
this.itemList = response.rows; this.itemList = response.rows;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
@ -267,9 +303,11 @@ export default {
// //
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;
}
}, },
// //
@ -316,15 +354,14 @@ 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();
this.showFlag = false;
this.queryParams.itemCodeGet = ""; this.queryParams.itemCodeGet = "";
} }
}, },
cancelEquipmentForm() { cancelEquipmentForm() {
this.queryParams.equipmentTypeCode = null; this.queryParams.equipmentTypeCode = null;
this.typeName = null;
this.getList(); this.getList();
this.showFlag = false; this.showFlag = false;
}, },

@ -1,31 +1,38 @@
<template> <template>
<el-dialog <el-dialog title="设备选择"
title="设备选择"
v-if="showFlag" v-if="showFlag"
:visible.sync="showFlag" :visible.sync="showFlag"
:modal="false" :modal= false
width="1100px" width="1100px"
center center
: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"
placeholder="请输入设备类型名称"
clearable
size="small"
prefix-icon="el-icon-search"
style="margin-bottom: 20px"
/>
</div>
<div class="head-container" style="text-align: center">
<el-scrollbar style="height:500px">
<el-tree <el-tree
:data="treeData1" :data="treeData"
:props="{ id: 'equipmentTypeCode', label: 'equipmentTypeName' }" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</div> </el-scrollbar>
</el-card> </div>
</el-col> </el-col>
<!--设备数据--> <!--设备数据-->
@ -143,7 +150,9 @@ export default {
// components: { Treeselect }, // components: { Treeselect },
data() { data() {
return { return {
treeData1: [], //
typeName: undefined,
treeData: [],
showFlag: false, showFlag: false,
// //
selectedItemId: undefined, selectedItemId: undefined,
@ -185,6 +194,14 @@ export default {
this.getEquipmentType(); this.getEquipmentType();
}, },
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: { methods: {
// //
reset() { reset() {
@ -219,21 +236,22 @@ export default {
getEquipmentType() { getEquipmentType() {
getEquipmentTypeList().then((response) => { getEquipmentTypeList().then((response) => {
console.log(response.rows); console.log(response.rows);
this.treeData1 = response.rows; this.treeData = response.rows;
console.log(this.treeData1); console.log(this.treeData);
}); });
}, },
// //
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;
}
}, },
// //
handleNodeClick(data) { handleNodeClick(data) {
console.log("id", data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode; this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode); console.log(this.equipmentTypeCode);
this.handleQuery(); this.handleQuery();
@ -274,20 +292,17 @@ 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.typeName = null;
this.getList(); this.getList();
console.log("111111", this.queryParams.equipmentTypeCode);
this.showFlag = false; this.showFlag = false;
}, }
}, },
}; };
</script> </script>

@ -17,10 +17,10 @@
style="width: 150px" style="width: 150px"
/> />
</el-form-item> </el-form-item>
<el-form-item label="规格型号" prop="spareMode"> <el-form-item label="备品备件名称" prop="materialDesc">
<el-input <el-input
v-model="queryParams.spareMode" v-model="queryParams.materialDesc"
placeholder="请输入规格型号" placeholder="请输入备品备件名称"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
style="width: 150px" style="width: 150px"

@ -20,7 +20,8 @@
/> />
</div> </div>
<div class="head-container" style="text-align: center"> <div class="head-container" style="text-align: center">
<el-tree <el-scrollbar style="height:500px">
<el-tree
:data="treeData" :data="treeData"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
@ -30,6 +31,7 @@
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</el-scrollbar>
</div> </div>
</el-col> </el-col>

@ -20,7 +20,8 @@
/> />
</div> </div>
<div class="head-container" style="text-align: center"> <div class="head-container" style="text-align: center">
<el-tree <el-scrollbar style="height:500px">
<el-tree
:data="treeData" :data="treeData"
:props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}" :props = "{id:'equipmentTypeCode',label:'equipmentTypeName'}"
node-key="id" node-key="id"
@ -30,6 +31,7 @@
default-expand-all default-expand-all
@node-click="handleNodeClick" @node-click="handleNodeClick"
/> />
</el-scrollbar>
</div> </div>
</el-col> </el-col>

Loading…
Cancel
Save