成套设备新增设备名称字段
This commit is contained in:
parent
330f40f25f
commit
8027d196b2
|
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
<el-table :data="tempList" border>
|
<el-table :data="tempList" border>
|
||||||
<el-table-column align="center" label="序号" type="index" />
|
<el-table-column align="center" label="序号" type="index" />
|
||||||
|
<el-table-column prop="typeName" align="center" label="设备名称" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="deviceType"
|
prop="deviceType"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -156,6 +157,7 @@ export default {
|
||||||
deviceInfo: [],
|
deviceInfo: [],
|
||||||
},
|
},
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
deviceName: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
@ -182,6 +184,10 @@ export default {
|
||||||
//主体设备选择
|
//主体设备选择
|
||||||
selMainDevice(val) {
|
selMainDevice(val) {
|
||||||
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
|
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
|
||||||
|
this.recursionGetDeviceName(
|
||||||
|
this.deviceTypeTreeNew,
|
||||||
|
val[val.length - 2],
|
||||||
|
)
|
||||||
|
|
||||||
if (checkNode.length < 1) return
|
if (checkNode.length < 1) return
|
||||||
|
|
||||||
|
|
@ -191,6 +197,7 @@ export default {
|
||||||
deviceNum: '', // 数量
|
deviceNum: '', // 数量
|
||||||
deviceAscription: '主体设备', // 所属类型
|
deviceAscription: '主体设备', // 所属类型
|
||||||
ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备
|
ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备
|
||||||
|
typeName: this.deviceName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tempList.length === 0) {
|
if (this.tempList.length === 0) {
|
||||||
|
|
@ -215,6 +222,10 @@ export default {
|
||||||
// 配套设备选择
|
// 配套设备选择
|
||||||
selAssortDevice(val) {
|
selAssortDevice(val) {
|
||||||
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
|
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
|
||||||
|
this.recursionGetDeviceName(
|
||||||
|
this.deviceTypeTreeNew,
|
||||||
|
val[val.length - 2],
|
||||||
|
)
|
||||||
|
|
||||||
if (checkNode.length < 1) return
|
if (checkNode.length < 1) return
|
||||||
|
|
||||||
|
|
@ -224,6 +235,7 @@ export default {
|
||||||
deviceNum: '', // 数量
|
deviceNum: '', // 数量
|
||||||
deviceAscription: '配套设备', // 所属类型
|
deviceAscription: '配套设备', // 所属类型
|
||||||
ascriptionType: 2, // 所属类型 1 主体设备 2 配套设备
|
ascriptionType: 2, // 所属类型 1 主体设备 2 配套设备
|
||||||
|
typeName: this.deviceName,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 先判断当前所选的配套设备是否已选择为主体设备
|
// 先判断当前所选的配套设备是否已选择为主体设备
|
||||||
|
|
@ -331,6 +343,21 @@ export default {
|
||||||
this.$emit('openHomePage')
|
this.$emit('openHomePage')
|
||||||
this.tempList = []
|
this.tempList = []
|
||||||
},
|
},
|
||||||
|
// 递归获取设备名称
|
||||||
|
recursionGetDeviceName(list, id) {
|
||||||
|
try {
|
||||||
|
list.map((e) => {
|
||||||
|
if (e.id == id) {
|
||||||
|
this.deviceName = e.label
|
||||||
|
throw new Error()
|
||||||
|
} else {
|
||||||
|
if (e.children && e.children.length > 0) {
|
||||||
|
this.recursionGetDeviceName(e.children, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export const config = {
|
||||||
columnsList: [
|
columnsList: [
|
||||||
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
|
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
|
||||||
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
|
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
|
||||||
{ t_width: '', t_props: 'totalNum', t_label: '配套设备种类数量' },
|
{ t_width: '', t_label: '配套设备种类数量', t_slot: 'totalNum' },
|
||||||
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
|
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
|
||||||
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
|
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@
|
||||||
>
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
<template slot-scope="{ data }" slot="totalNum">
|
||||||
|
{{ data.totalNum }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 列表操作栏 -->
|
<!-- 列表操作栏 -->
|
||||||
<template slot="handle" slot-scope="{ data }">
|
<template slot="handle" slot-scope="{ data }">
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
<el-table :data="tempList" border>
|
<el-table :data="tempList" border>
|
||||||
<el-table-column align="center" label="序号" type="index" />
|
<el-table-column align="center" label="序号" type="index" />
|
||||||
|
<el-table-column prop="typeName" align="center" label="设备名称" />
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="deviceType"
|
prop="deviceType"
|
||||||
align="center"
|
align="center"
|
||||||
|
|
@ -156,6 +157,7 @@ export default {
|
||||||
deviceInfo: [],
|
deviceInfo: [],
|
||||||
},
|
},
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
|
deviceName: '',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|
@ -183,14 +185,19 @@ export default {
|
||||||
selMainDevice(val) {
|
selMainDevice(val) {
|
||||||
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
|
const checkNode = this.$refs['mainDeviceRef'].getCheckedNodes()
|
||||||
|
|
||||||
|
this.recursionGetDeviceName(
|
||||||
|
this.deviceTypeTreeNew,
|
||||||
|
val[val.length - 2],
|
||||||
|
)
|
||||||
if (checkNode.length < 1) return
|
if (checkNode.length < 1) return
|
||||||
|
|
||||||
const mainDeviceObj = {
|
const mainDeviceObj = {
|
||||||
deviceType: checkNode[0].label, // 设备名称
|
deviceType: checkNode[0].label, // 设备型号
|
||||||
deviceTypeId: val[val.length - 1], // 设备Id
|
deviceTypeId: val[val.length - 1], // 设备Id
|
||||||
deviceNum: '', // 数量
|
deviceNum: '', // 数量
|
||||||
deviceAscription: '主体设备', // 所属类型
|
deviceAscription: '主体设备', // 所属类型
|
||||||
ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备
|
ascriptionType: 1, // 所属类型 1 主体设备 2 配套设备
|
||||||
|
typeName: this.deviceName,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.tempList.length === 0) {
|
if (this.tempList.length === 0) {
|
||||||
|
|
@ -215,6 +222,10 @@ export default {
|
||||||
// 配套设备选择
|
// 配套设备选择
|
||||||
selAssortDevice(val) {
|
selAssortDevice(val) {
|
||||||
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
|
const checkNode = this.$refs['assortDeviceRef'].getCheckedNodes()
|
||||||
|
this.recursionGetDeviceName(
|
||||||
|
this.deviceTypeTreeNew,
|
||||||
|
val[val.length - 2],
|
||||||
|
)
|
||||||
|
|
||||||
if (checkNode.length < 1) return
|
if (checkNode.length < 1) return
|
||||||
|
|
||||||
|
|
@ -224,6 +235,7 @@ export default {
|
||||||
deviceNum: '', // 数量
|
deviceNum: '', // 数量
|
||||||
deviceAscription: '配套设备', // 所属类型
|
deviceAscription: '配套设备', // 所属类型
|
||||||
ascriptionType: 2, // 所属类型 1 主体设备 2 配套设备
|
ascriptionType: 2, // 所属类型 1 主体设备 2 配套设备
|
||||||
|
typeName: this.deviceName,
|
||||||
}
|
}
|
||||||
|
|
||||||
// 先判断当前所选的配套设备是否已选择为主体设备
|
// 先判断当前所选的配套设备是否已选择为主体设备
|
||||||
|
|
@ -331,6 +343,22 @@ export default {
|
||||||
this.$emit('openHomePage')
|
this.$emit('openHomePage')
|
||||||
this.tempList = []
|
this.tempList = []
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// 递归获取设备名称
|
||||||
|
recursionGetDeviceName(list, id) {
|
||||||
|
try {
|
||||||
|
list.map((e) => {
|
||||||
|
if (e.id == id) {
|
||||||
|
this.deviceName = e.label
|
||||||
|
throw new Error()
|
||||||
|
} else {
|
||||||
|
if (e.children && e.children.length > 0) {
|
||||||
|
this.recursionGetDeviceName(e.children, id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ export const config = {
|
||||||
columnsList: [
|
columnsList: [
|
||||||
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
|
{ t_width: '', t_props: 'wholeTypeName', t_label: '成套设备名称', },
|
||||||
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
|
{ t_width: '', t_props: 'typeModelName', t_label: '主体设备', },
|
||||||
{ t_width: '', t_props: 'totalNum', t_label: '配套设备种类数量' },
|
{ t_width: '', t_label: '配套设备种类数量', t_slot: 'totalNum' },
|
||||||
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
|
{ t_width: '', t_props: 'nickName', t_label: '创建人', },
|
||||||
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
|
{ t_width: '', t_props: 'createTime', t_label: '创建日期', },
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,9 @@
|
||||||
>
|
>
|
||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
<template slot-scope="{ data }" slot="totalNum">
|
||||||
|
{{ data.totalNum }}
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- 列表操作栏 -->
|
<!-- 列表操作栏 -->
|
||||||
<template slot="handle" slot-scope="{ data }">
|
<template slot="handle" slot-scope="{ data }">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue