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

yangwl
A0010407 7 months ago
parent d7061c5c3d
commit 0ec476ac2e

@ -8,24 +8,32 @@
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-row :gutter="20">
<el-col :span="5" :xs="24">
<el-card>
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<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-scrollbar style="height:500px">
<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-card>
: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"
/>
</el-scrollbar>
</div>
</el-col>
<!--设备数据-->
@ -43,7 +51,7 @@
v-model="queryParams.itemCode"
placeholder="请输入设备编码"
clearable
style="width: 160px"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -52,7 +60,7 @@
v-model="queryParams.itemName"
placeholder="请输入设备名称"
clearable
style="width: 160px"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -62,7 +70,7 @@
v-model="queryParams.groupLine"
filterable
placeholder="请选择组线"
style="width: 160px"
style="width: 170px"
>
<el-option
v-for="item in options"
@ -82,7 +90,11 @@
@click="handleQuery"
>搜索</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-form-item>
@ -111,7 +123,6 @@
align="center"
key="itemCode"
prop="equipmentCode"
v-if="columns[0].visible"
>
</el-table-column>
<el-table-column
@ -119,7 +130,6 @@
align="center"
key="itemTypeCode"
prop="equipmentTypeCode"
v-if="columns[2].visible"
>
</el-table-column>
<el-table-column
@ -127,11 +137,22 @@
align="left"
key="itemName"
prop="equipmentName"
v-if="columns[1].visible"
: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>
<pagination
v-show="total > 0"
:total="total"
@ -161,8 +182,13 @@ import { Message } from "element-ui";
export default {
name: "MdItemSingle",
dicts: [
"equipment_category",
],
data() {
return {
//
typeName: undefined,
treeData: [],
showFlag: false,
//
@ -200,6 +226,7 @@ export default {
{ key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `设备类别`, visible: true },
],
};
},
@ -208,6 +235,15 @@ export default {
this.getEquipmentType();
},
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: {
//
reset() {
@ -234,7 +270,7 @@ export default {
this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode;
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;
@ -267,9 +303,11 @@ export default {
//
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;
}
},
//
@ -316,15 +354,14 @@ export default {
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit("onSelected", this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
this.showFlag = false;
this.cancelEquipmentForm();
this.queryParams.itemCodeGet = "";
}
},
cancelEquipmentForm() {
this.queryParams.equipmentTypeCode = null;
this.typeName = null;
this.getList();
this.showFlag = false;
},

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

@ -8,24 +8,32 @@
center
:before-close="cancelEquipmentForm"
>
<el-row :gutter="20">
<!--分类数据-->
<el-row :gutter="20">
<el-col :span="5" :xs="24">
<el-card>
<span>请选择设备类型</span>
<div class="head-container" style="text-align: center">
<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-scrollbar style="height:500px">
<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-card>
: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"
/>
</el-scrollbar>
</div>
</el-col>
<!--设备数据-->
@ -43,7 +51,7 @@
v-model="queryParams.itemCode"
placeholder="请输入设备编码"
clearable
style="width: 160px"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -52,7 +60,7 @@
v-model="queryParams.itemName"
placeholder="请输入设备名称"
clearable
style="width: 160px"
style="width: 170px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
@ -62,7 +70,7 @@
v-model="queryParams.groupLine"
filterable
placeholder="请选择组线"
style="width: 160px"
style="width: 170px"
>
<el-option
v-for="item in options"
@ -82,7 +90,11 @@
@click="handleQuery"
>搜索</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-form-item>
@ -111,7 +123,6 @@
align="center"
key="itemCode"
prop="equipmentCode"
v-if="columns[0].visible"
>
</el-table-column>
<el-table-column
@ -119,7 +130,6 @@
align="center"
key="itemTypeCode"
prop="equipmentTypeCode"
v-if="columns[2].visible"
>
</el-table-column>
<el-table-column
@ -127,11 +137,22 @@
align="left"
key="itemName"
prop="equipmentName"
v-if="columns[1].visible"
: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>
<pagination
v-show="total > 0"
:total="total"
@ -161,8 +182,13 @@ import { Message } from "element-ui";
export default {
name: "MdItemSingle",
dicts: [
"equipment_category",
],
data() {
return {
//
typeName: undefined,
treeData: [],
showFlag: false,
//
@ -200,6 +226,7 @@ export default {
{ key: 0, label: `设备编码`, visible: true },
{ key: 1, label: `设备名称`, visible: true },
{ key: 2, label: `设备类型`, visible: true },
{ key: 3, label: `设备类别`, visible: true },
],
};
},
@ -208,6 +235,15 @@ export default {
this.getEquipmentType();
},
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: {
//
reset() {
@ -234,7 +270,7 @@ export default {
this.loading = true;
this.queryParams.equipmentCode = this.queryParams.itemCode;
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;
@ -267,9 +303,11 @@ export default {
//
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;
}
},
//
@ -316,15 +354,14 @@ export default {
}
this.selectedRows = this.queryParams.itemCodeGet;
this.$emit("onSelected", this.selectedRows);
this.queryParams.equipmentTypeCode = null;
this.getList();
this.showFlag = false;
this.cancelEquipmentForm();
this.queryParams.itemCodeGet = "";
}
},
cancelEquipmentForm() {
this.queryParams.equipmentTypeCode = null;
this.typeName = null;
this.getList();
this.showFlag = false;
},

@ -1,31 +1,38 @@
<template>
<el-dialog
title="设备选择"
<el-dialog title="设备选择"
v-if="showFlag"
:visible.sync="showFlag"
:modal="false"
:modal= false
width="1100px"
center
: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">
<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-scrollbar style="height:500px">
<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>
: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"
/>
</el-scrollbar>
</div>
</el-col>
<!--设备数据-->
@ -143,7 +150,9 @@ export default {
// components: { Treeselect },
data() {
return {
treeData1: [],
//
typeName: undefined,
treeData: [],
showFlag: false,
//
selectedItemId: undefined,
@ -185,6 +194,14 @@ export default {
this.getEquipmentType();
},
watch: {
//
typeName(val) {
console.log(val);
this.$refs.tree.filter(val);
},
},
methods: {
//
reset() {
@ -219,21 +236,22 @@ export default {
getEquipmentType() {
getEquipmentTypeList().then((response) => {
console.log(response.rows);
this.treeData1 = response.rows;
console.log(this.treeData1);
this.treeData = response.rows;
console.log(this.treeData);
});
},
//
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;
}
},
//
handleNodeClick(data) {
console.log("id", data.id);
this.queryParams.equipmentTypeCode = data.equipmentTypeCode;
console.log(this.equipmentTypeCode);
this.handleQuery();
@ -274,20 +292,17 @@ 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() {
cancelEquipmentForm(){
this.queryParams.equipmentTypeCode = null;
this.typeName = null;
this.getList();
console.log("111111", this.queryParams.equipmentTypeCode);
this.showFlag = false;
},
}
},
};
</script>

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

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

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

Loading…
Cancel
Save