<el-table-column label="部门名称" align="center">
<template slot-scope="scope">
<el-cascader filterable :disabled="type === '3' ? true : false" :show-all-levels="false"
:ref="'provinceTree' + scope.row.guid" v-model="scope.row.departmentPath" :props="casPropsProvince"
placeholder="请选择" @change="
handleCasProviceChange($event, scope.row.index, scope.row.guid)
"></el-cascader>
</template>
</el-table-column>
//省公司树属性
casPropsProvince: {
checkStrictly: true,
value: "id",
label: "text",
children: "childrenList",
disabled: "disabled",
leaf: "isLeaf",
lazy: true, //懒加载必须为true
lazyLoad: this.lazyLoadProvince,
},
//树加载事件
lazyLoadProvince(node, resolve) {
let obj = {
parent: node.value,
};
rewardInfor
.getProvinceDeptStructure(obj)
.then((res) => {
if (res.code === 200) {
let result = res.data;
return resolve(result);
} else {
this.$message.error(this.$t("organType.operatorFail"));
}
})
.catch((res) => {
console.error(res.message);
});
},
//树点击事件
handleCasProviceChange(val, index, guid) {
this.provinceList[index].departmentPath = val;
this.provinceList[index].departmentId = val[val.length - 1];
// this.provinceList[index].departmentName = this.$refs['provinceTree' + index].getCheckedNodes()[0].label;
this.provinceList[index].departmentName = this.$refs[
"provinceTree" + guid
].panel.getNodeByValue(val).label;
},