获取级联label的值
{
title: "分部分项:",
key: "sub_item",
rule: {required: true, message: '请选择分部分项', trigger: 'blur'},
renderContent (h, item, form) {
return (
<el-cascader disabled={ vm.title != '新增' && vm.title != '编辑' } placeholder={ '请选择分部分项' } props={ {label:'name', value: 'id', emitPath: false} } options={ vm.sub_itemo_ptions } ref={ 'sub_ref' } value={ form.sub_item } onChange={ (res) => vm.subChange(res, form) }></el-cascader>
)
}
}
subChange(v, form) {
if (!v) return
form.sub_item = v
this.clearFormList(form)
this.$nextTick(() => {
let obj = this.$refs.xtFormRef.$refs.sub_ref.getCheckedNodes() || []
if (obj.length) {
form.sub_item_name = obj[0].pathLabels.join('/')
form.unit_project = obj[0].data.labels.project
form.branch_project = obj[0].data.labels.branch
form.subitem_project = obj[0].data.labels.subitem
form.position = obj[0].data.labels.subitem_unit
}
})
},
|