设置班组限制请求

This commit is contained in:
Teo
2025-08-29 14:57:52 +08:00
parent 384eb35d84
commit 5465136879
6 changed files with 24 additions and 6 deletions

View File

@ -6,7 +6,7 @@ VITE_APP_ENV = 'development'
# 开发环境
# 李陈杰 209
VITE_APP_BASE_API = 'http://192.168.110.180:8899'
VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 曾涛
# VITE_APP_BASE_API = 'http://192.168.110.180:8899'
# 罗成

View File

@ -8,14 +8,12 @@
import useSettingsStore from '@/store/modules/settings';
import { handleThemeStyle } from '@/utils/theme';
import useAppStore from '@/store/modules/app';
import { getProjectTeam } from './utils/projectTeam';
const appStore = useAppStore();
onMounted(() => {
nextTick(() => {
// 初始化主题样式
handleThemeStyle(useSettingsStore().theme);
getProjectTeam();
});
});
</script>

View File

@ -134,6 +134,7 @@ export const useUserStore = defineStore('user', () => {
roles.value = projectRole;
const projectPermissions = permissionList.value.find((item) => item.projectId == selectedProject.value?.id)?.projectPermissions || [];
permissions.value = projectPermissions;
getProjectTeam();
};
// 注销

View File

@ -2,7 +2,11 @@ import $cache from '@/plugins/cache';
//获取班组列表
import { listProjectTeam } from '@/api/project/projectTeam';
import { ProjectTeamVO } from '@/api/project/projectTeam/types';
import useUserStore from '@/store/modules/user';
export const getProjectTeam = async () => {
const isPermission = useUserStore().permissions.some((item) => item == 'project:team:list');
if (!isPermission) return;
const { id } = $cache.local.getJSON('selectedProject');
const res = await listProjectTeam({
pageNum: 1,

View File

@ -8,7 +8,7 @@
<el-date-picker v-model="queryParams.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
</el-form-item>
<el-form-item label="产值类型" prop="valueType">
<el-select v-model="queryParams.valueType" placeholder="请选择产值类型">
<el-select v-model="queryParams.valueType" placeholder="全部">
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
@ -113,6 +113,13 @@ import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const month = computed(() => {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth() 从0开始
const currentMonth = `${year}-${month}`;
return currentMonth;
});
const monthPlanList = ref<MonthPlanVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
@ -152,7 +159,8 @@ const data = reactive({
planValue: undefined,
completeValue: undefined,
differenceValue: undefined,
planMonth: undefined,
planMonth: month.value,
valueType: undefined,
planAuditStatus: undefined,
completeAuditStatus: undefined,

View File

@ -80,6 +80,13 @@ import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject);
const month = computed(() => {
const now = new Date();
const year = now.getFullYear();
const month = String(now.getMonth() + 1).padStart(2, '0'); // getMonth() 从0开始
const currentMonth = `${year}-${month}`;
return currentMonth;
});
const monthPlanAuditList = ref<MonthPlanAuditVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
@ -116,7 +123,7 @@ const data = reactive<PageData<MonthPlanAuditForm, MonthPlanAuditQuery>>({
purchaseValue: undefined,
constructionValue: undefined,
totalValue: undefined,
planMonth: undefined,
planMonth: month.value,
params: {}
},
rules: {