|
|
|
@ -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;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|