|
|
@@ -9,6 +9,7 @@
|
|
|
v-model="radio"
|
|
|
style="margin-left: 10px"
|
|
|
size="small"
|
|
|
+ @change="treeChange"
|
|
|
>
|
|
|
<a-radio-button value="a"> 机构 </a-radio-button>
|
|
|
<a-radio-button value="b"> 人员 </a-radio-button>
|
|
|
@@ -19,8 +20,9 @@
|
|
|
<tree
|
|
|
@getList="chooseUser"
|
|
|
:type="radio"
|
|
|
- @showTab="showTab"
|
|
|
+
|
|
|
:managementSource="1"
|
|
|
+ :list="radio=='a' ?treeData :userTreeData"
|
|
|
></tree>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -323,25 +325,27 @@ export default {
|
|
|
cityList: [],
|
|
|
areaList: [],
|
|
|
storeList: [],
|
|
|
- treeData: [
|
|
|
- { title: "Expand to load", key: "0" },
|
|
|
- { title: "Expand to load", key: "1" },
|
|
|
- { title: "Tree Node", key: "2", isLeaf: true },
|
|
|
- ],
|
|
|
+ // treeData: [
|
|
|
+ // { title: "Expand to load", key: "0" },
|
|
|
+ // { title: "Expand to load", key: "1" },
|
|
|
+ // { title: "Tree Node", key: "2", isLeaf: true },
|
|
|
+ // ],
|
|
|
amount: {},
|
|
|
treeType: "",
|
|
|
radio: "a",
|
|
|
disabled: false,
|
|
|
treeUserId:"",
|
|
|
dateType:"",
|
|
|
- timeType:""
|
|
|
+ timeType:"",
|
|
|
+ treeData: [],
|
|
|
+ userTreeData: [],
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
|
mounted() {
|
|
|
// setTimeout(() => {
|
|
|
// }, 1000);
|
|
|
- // this.getVerification();
|
|
|
+ // this.getUserTree()
|
|
|
},
|
|
|
methods: {
|
|
|
timeChange(val) {
|
|
|
@@ -351,20 +355,48 @@ export default {
|
|
|
this.formState = { ...val };
|
|
|
this.formState.treeUserId = this.treeUserId;
|
|
|
|
|
|
- this.getList();
|
|
|
+ this.getUserTree();
|
|
|
},
|
|
|
- showTab(val) {
|
|
|
- // console.log(val);
|
|
|
+ getUserTree() {
|
|
|
+ // console.log(this.userInfo);
|
|
|
+ this.$API.business
|
|
|
+ .findAgentChanellTree({
|
|
|
+ managementSource: 1,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ if (this.radio == "a") {
|
|
|
+ this.treeType = 1;
|
|
|
+ this.formState.treeUserId = res.data.data.deptList!=null
|
|
|
+ ? res.data.data.deptList.length>0 ?res.data.data.deptList[0].id
|
|
|
+ : "" :''
|
|
|
+ } else {
|
|
|
+ this.treeType = 2;
|
|
|
+ this.formState.treeUserId = res.data.data.userList!=null
|
|
|
+ ? res.data.data.userList.length>0 ?res.data.data.userList[0].id
|
|
|
+ : "" :''
|
|
|
+ }
|
|
|
+ this.agencyId = res.data.data.deptList!=null
|
|
|
+ ? res.data.data.deptList.length>0 ?res.data.data.deptList[0].id
|
|
|
+ : "" :'';
|
|
|
+ this.userId = res.data.data.userList!=null
|
|
|
+ ? res.data.data.userList.length>0 ?res.data.data.userList[0].id
|
|
|
+ : "" :'';
|
|
|
+ this.userTreeData = res.data.data.userList;
|
|
|
+ this.treeData = res.data.data.deptList;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ treeChange() {
|
|
|
if (this.radio == "a") {
|
|
|
this.treeType = 1;
|
|
|
- this.formState.treeUserId = val.agencyId;
|
|
|
+ this.formState.treeUserId = this.agencyId;
|
|
|
} else {
|
|
|
this.treeType = 2;
|
|
|
- this.formState.treeUserId = val.userId;
|
|
|
+ this.formState.treeUserId = this.userId;
|
|
|
}
|
|
|
- this.agencyId = val.agencyId;
|
|
|
-
|
|
|
- this.userId = val.userId;
|
|
|
this.getList();
|
|
|
},
|
|
|
chooseUser(val) {
|
|
|
@@ -417,7 +449,7 @@ export default {
|
|
|
|
|
|
async getVerification() {
|
|
|
this.loading = true;
|
|
|
-
|
|
|
+
|
|
|
this.$API.business
|
|
|
.getBusinessAgentList({
|
|
|
pageNum: this.pagination.current,
|
|
|
@@ -431,7 +463,7 @@ export default {
|
|
|
.then((res) => {
|
|
|
if (res.data.code === 200) {
|
|
|
this.loading = false;
|
|
|
- this.tableList = res.data.data.records;
|
|
|
+ this.tableList = res.data.data?.records || [];
|
|
|
this.pagination = {
|
|
|
current: res.data.data.current,
|
|
|
defaultPageSize: res.data.data.size,
|