Commit 201850fa authored by 沈翠玲's avatar 沈翠玲

分配

parent 1164b2c9
...@@ -200,6 +200,7 @@ ...@@ -200,6 +200,7 @@
import { RefreshRight } from '@element-plus/icons-vue'; import { RefreshRight } from '@element-plus/icons-vue';
import { ElInputNumber, ElMessage } from 'element-plus'; import { ElInputNumber, ElMessage } from 'element-plus';
import Decimal from 'decimal.js'; import Decimal from 'decimal.js';
import { useUserStore } from '@/stores/modules/user';
import { import {
getLoanDistribute, getLoanDistribute,
distributeLoan, distributeLoan,
...@@ -214,7 +215,7 @@ ...@@ -214,7 +215,7 @@
import { useAuthStore } from '@/stores/modules/auth'; import { useAuthStore } from '@/stores/modules/auth';
const emits = defineEmits(['success']); const emits = defineEmits(['success']);
const { authButtonListGet } = useAuthStore(); // 获取用户权限列表 const { authButtonListGet } = useAuthStore(); // 获取用户权限列表
const userStore = useUserStore();
const data = ref([]); const data = ref([]);
const mytransfer = ref(); const mytransfer = ref();
const tabledata = ref([]); const tabledata = ref([]);
...@@ -247,10 +248,19 @@ ...@@ -247,10 +248,19 @@
}); });
}; };
const getTree = () => { const getTree = () => {
let name = ''
if (userStore.userInfo?.tenants && userStore.userInfo?.tenants.length > 0) {
if (userStore.userInfo?.tenants.length < 2) {
name = userStore.userInfo?.tenants[0].name
} else {
name = userStore.tenant.name
}
}
getTenantPage({ getTenantPage({
current: 1, current: 1,
size: 999999999, size: 999999999,
status: 'enable', status: 'enable',
name: name || null
}).then((res) => { }).then((res) => {
if (res.success) { if (res.success) {
data.value = res.result.content; data.value = res.result.content;
...@@ -295,11 +305,12 @@ ...@@ -295,11 +305,12 @@
currentTenant.value = null; currentTenant.value = null;
}; };
const openModal = (param, select) => { const openModal = (param, select) => {
console.log('select', select);
lonsArr.value = select; lonsArr.value = select;
showModal.value = true; showModal.value = true;
pageParams.value = param; pageParams.value = param;
currentAllBtn.value = null; currentAllBtn.value = null;
console.log('sadasda')
getTree(); getTree();
step.value = 0; step.value = 0;
if (!authButtonListGet.includes('allcation_for_tenant')) { if (!authButtonListGet.includes('allcation_for_tenant')) {
...@@ -318,6 +329,15 @@ ...@@ -318,6 +329,15 @@
SaveBol.value = false; SaveBol.value = false;
currentTenant.value = null; currentTenant.value = null;
editRowIndex.value = -1; editRowIndex.value = -1;
if (userStore.userInfo?.tenants && userStore.userInfo?.tenants.length > 0) {
if (userStore.userInfo?.tenants.length < 2) {
handleNodeClick(userStore.userInfo?.tenants[0])
currentTenant.value = userStore.userInfo?.tenants[0].id;
} else {
handleNodeClick(userStore.tenant)
currentTenant.value = userStore.tenant.id;
}
}
tabledata.value = []; tabledata.value = [];
alltabledata.value = []; alltabledata.value = [];
checked1.value = false; checked1.value = false;
...@@ -421,7 +441,6 @@ ...@@ -421,7 +441,6 @@
param = { ...pageParams.value }; param = { ...pageParams.value };
} }
getStatisis(param, currentTenant.value); getStatisis(param, currentTenant.value);
getTenantUsers({tenantId: data1.id, roleCode: 'CPE'}).then(res => { getTenantUsers({tenantId: data1.id, roleCode: 'CPE'}).then(res => {
if (res.success && res.result) { if (res.success && res.result) {
alltabledata.value = res.result alltabledata.value = res.result
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment