This commit is contained in:
parent
cac7fc5ef1
commit
38935f76cc
|
|
@ -122,9 +122,18 @@
|
|||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="6">
|
||||
<el-form-item label="产权单位" prop="propertyUnitId">
|
||||
<el-select
|
||||
<el-col :span="6" v-if="hasChildrenPropertyUnit">
|
||||
<el-form-item label="产权单位" prop="propertyUnitIds">
|
||||
<el-cascader
|
||||
clearable
|
||||
v-model="queryParams.propertyUnitIds"
|
||||
placeholder="请选择工序"
|
||||
:options="propertyUnitList"
|
||||
:props="{ label: 'label', value: 'id', children: 'children' }"
|
||||
style="width: 100%"
|
||||
@change="handleUnitChange"
|
||||
/>
|
||||
<!-- <el-select
|
||||
v-model="queryParams.propertyUnitId"
|
||||
placeholder="请选择产权单位"
|
||||
clearable
|
||||
|
|
@ -132,7 +141,7 @@
|
|||
style="width: 100%"
|
||||
>
|
||||
<el-option v-for="item in propertyUnitList" :key="item.id" :label="item.label" :value="item.id" />
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
|
|
@ -795,6 +804,7 @@ export default {
|
|||
queryParams: {
|
||||
province: undefined, // 省份
|
||||
propertyUnitId: undefined, // 产权单位
|
||||
propertyUnitIds: [],
|
||||
name: undefined, // 装备名称
|
||||
specificationModel: undefined, // 规格型号
|
||||
major: undefined, // 专业
|
||||
|
|
@ -942,7 +952,27 @@ export default {
|
|||
],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
hasChildrenPropertyUnit() {
|
||||
const check = (list = []) => {
|
||||
return list.some(item => {
|
||||
return (
|
||||
Array.isArray(item.children) &&
|
||||
item.children.length > 0
|
||||
) || check(item.children)
|
||||
})
|
||||
}
|
||||
return check(this.propertyUnitList)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleUnitChange(value) {
|
||||
if (value.length === 0) {
|
||||
this.queryParams.propertyUnitId = undefined
|
||||
return
|
||||
}
|
||||
this.queryParams.propertyUnitId = value[value.length - 1]
|
||||
},
|
||||
// 初始化:获取前两级节点的所有 key
|
||||
initDefaultExpandedKeys() {
|
||||
const keys = []
|
||||
|
|
|
|||
Loading…
Reference in New Issue