成套设备新增设备名称字段

This commit is contained in:
BianLzhaoMin 2024-07-19 16:09:50 +08:00
parent 330f40f25f
commit 8027d196b2
6 changed files with 64 additions and 3 deletions

View File

@ -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>

View File

@ -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: '创建日期', },
], ],

View File

@ -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 }">

View File

@ -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>

View File

@ -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: '创建日期', },
], ],

View File

@ -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 }">