|
|
@ -4,18 +4,26 @@
|
|
|
|
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
|
|
|
|
|
|
|
|
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">
|
|
|
|
<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"
|
|
|
@ -24,8 +32,8 @@
|
|
|
|
default-expand-all
|
|
|
|
default-expand-all
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
|
|
|
|
</el-scrollbar>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</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;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|