|
|
@ -8,13 +8,20 @@
|
|
|
|
: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-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,7 +31,6 @@
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
@node-click="handleNodeClick"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</el-card>
|
|
|
|
|
|
|
|
</el-col>
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
<!--设备数据-->
|
|
|
|
<!--设备数据-->
|
|
|
@ -96,7 +102,9 @@ export default {
|
|
|
|
// components: { Treeselect },
|
|
|
|
// components: { Treeselect },
|
|
|
|
data() {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
treeData1:[],
|
|
|
|
//类型名称
|
|
|
|
|
|
|
|
typeName: undefined,
|
|
|
|
|
|
|
|
treeData:[],
|
|
|
|
showFlag:false,
|
|
|
|
showFlag:false,
|
|
|
|
// 选中数组
|
|
|
|
// 选中数组
|
|
|
|
selectedItemId: undefined,
|
|
|
|
selectedItemId: undefined,
|
|
|
@ -138,6 +146,14 @@ export default {
|
|
|
|
this.getEquipmentType();
|
|
|
|
this.getEquipmentType();
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch: {
|
|
|
|
|
|
|
|
// 根据名称筛选部门树
|
|
|
|
|
|
|
|
typeName(val) {
|
|
|
|
|
|
|
|
console.log(val);
|
|
|
|
|
|
|
|
this.$refs.tree.filter(val);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
methods: {
|
|
|
|
// 表单重置
|
|
|
|
// 表单重置
|
|
|
|
reset() {
|
|
|
|
reset() {
|
|
|
@ -153,11 +169,10 @@ export default {
|
|
|
|
this.itemList = val
|
|
|
|
this.itemList = val
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 生成表头序号
|
|
|
|
//生成表头序号
|
|
|
|
indexMethod(index){
|
|
|
|
indexMethod(index){
|
|
|
|
return index+1 ;
|
|
|
|
return index+1 ;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询设备编码列表*/
|
|
|
|
/** 查询设备编码列表*/
|
|
|
|
getList() {
|
|
|
|
getList() {
|
|
|
@ -173,17 +188,17 @@ export default {
|
|
|
|
/** 查询分类下拉树结构 */
|
|
|
|
/** 查询分类下拉树结构 */
|
|
|
|
getEquipmentType() {
|
|
|
|
getEquipmentType() {
|
|
|
|
getEquipmentTypeList().then(response => {
|
|
|
|
getEquipmentTypeList().then(response => {
|
|
|
|
console.log(response.rows);
|
|
|
|
this.treeData = response.data;
|
|
|
|
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;
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
// 节点单击事件
|
|
|
|
// 节点单击事件
|
|
|
@ -253,10 +268,7 @@ export default {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
submitEquipmentForm() {
|
|
|
|
submitEquipmentForm() {
|
|
|
|
const data = this.ids;
|
|
|
|
const data = this.ids;
|
|
|
|
console.log("数据",data);
|
|
|
|
|
|
|
|
const equipmentCode = data.toString();
|
|
|
|
const equipmentCode = data.toString();
|
|
|
|
console.log("拆分数据",equipmentCode);
|
|
|
|
|
|
|
|
console.log("原来的数据",this.queryParams.itemCodeGet);
|
|
|
|
|
|
|
|
if(this.queryParams.itemCodeGet == ""){
|
|
|
|
if(this.queryParams.itemCodeGet == ""){
|
|
|
|
this.queryParams.itemCodeGet = equipmentCode;
|
|
|
|
this.queryParams.itemCodeGet = equipmentCode;
|
|
|
|
}else{
|
|
|
|
}else{
|
|
|
@ -264,16 +276,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();
|
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|