diff --git a/src/views/device/faultReport/selectSingleEquipment.vue b/src/views/device/faultReport/selectSingleEquipment.vue index bf9dee9..846b883 100644 --- a/src/views/device/faultReport/selectSingleEquipment.vue +++ b/src/views/device/faultReport/selectSingleEquipment.vue @@ -8,24 +8,32 @@ center :before-close="cancelEquipmentForm" > - - + - - 请选择设备类型: -
+
+ +
+
+ -
- + :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" + /> + +
@@ -43,7 +51,7 @@ v-model="queryParams.itemCode" placeholder="请输入设备编码" clearable - style="width: 160px" + style="width: 170px" @keyup.enter.native="handleQuery" /> @@ -52,7 +60,7 @@ v-model="queryParams.itemName" placeholder="请输入设备名称" clearable - style="width: 160px" + style="width: 170px" @keyup.enter.native="handleQuery" /> @@ -62,7 +70,7 @@ v-model="queryParams.groupLine" filterable placeholder="请选择组线" - style="width: 160px" + style="width: 170px" > 搜索 - 重置 @@ -111,7 +123,6 @@ align="center" key="itemCode" prop="equipmentCode" - v-if="columns[0].visible" > + + + - { + 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; }, diff --git a/src/views/device/outsourceWorkOrder/selectSingleEquipment.vue b/src/views/device/outsourceWorkOrder/selectSingleEquipment.vue index 898f78a..9dc421a 100644 --- a/src/views/device/outsourceWorkOrder/selectSingleEquipment.vue +++ b/src/views/device/outsourceWorkOrder/selectSingleEquipment.vue @@ -4,28 +4,36 @@ v-if="showFlag" :visible.sync="showFlag" :modal="false" - width="1100px" + width="1200px" center :before-close="cancelEquipmentForm" > - - + - - 请选择设备类型: -
+
+ +
+
+ -
- + :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" + /> + +
@@ -43,7 +51,7 @@ v-model="queryParams.itemCode" placeholder="请输入设备编码" clearable - style="width: 240px" + style="width: 170px" @keyup.enter.native="handleQuery" /> @@ -52,10 +60,28 @@ v-model="queryParams.itemName" placeholder="请输入设备名称" clearable - style="width: 240px" + style="width: 170px" @keyup.enter.native="handleQuery" /> + + + 搜索 - 重置 @@ -93,7 +123,6 @@ align="center" key="itemCode" prop="equipmentCode" - v-if="columns[0].visible" >
+ + + - { + 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; }, }, diff --git a/src/views/device/repairOrder/selectSingleEquipment.vue b/src/views/device/repairOrder/selectSingleEquipment.vue index 5ba78bf..9dc421a 100644 --- a/src/views/device/repairOrder/selectSingleEquipment.vue +++ b/src/views/device/repairOrder/selectSingleEquipment.vue @@ -8,24 +8,32 @@ center :before-close="cancelEquipmentForm" > - - + - - 请选择设备类型: -
+
+ +
+
+ -
- + :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" + /> + +
@@ -43,7 +51,7 @@ v-model="queryParams.itemCode" placeholder="请输入设备编码" clearable - style="width: 160px" + style="width: 170px" @keyup.enter.native="handleQuery" /> @@ -52,7 +60,7 @@ v-model="queryParams.itemName" placeholder="请输入设备名称" clearable - style="width: 160px" + style="width: 170px" @keyup.enter.native="handleQuery" /> @@ -62,7 +70,7 @@ v-model="queryParams.groupLine" filterable placeholder="请选择组线" - style="width: 160px" + style="width: 170px" > 搜索 - 重置 @@ -111,7 +123,6 @@ align="center" key="itemCode" prop="equipmentCode" - v-if="columns[0].visible" >
+ + + - { + 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; }, diff --git a/src/views/device/sparePartsApplicationRecord/selectSingleEquipment.vue b/src/views/device/sparePartsApplicationRecord/selectSingleEquipment.vue index cfa2750..b444352 100644 --- a/src/views/device/sparePartsApplicationRecord/selectSingleEquipment.vue +++ b/src/views/device/sparePartsApplicationRecord/selectSingleEquipment.vue @@ -1,31 +1,38 @@