设置班组限制请求

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 # 李陈杰 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' # VITE_APP_BASE_API = 'http://192.168.110.180:8899'
# 罗成 # 罗成

View File

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

View File

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

View File

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

View File

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

View File

@ -80,6 +80,13 @@ import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook(); const userStore = useUserStoreHook();
// 从 store 中获取项目列表和当前选中的项目 // 从 store 中获取项目列表和当前选中的项目
const currentProject = computed(() => userStore.selectedProject); 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 monthPlanAuditList = ref<MonthPlanAuditVO[]>([]);
const buttonLoading = ref(false); const buttonLoading = ref(false);
const loading = ref(true); const loading = ref(true);
@ -116,7 +123,7 @@ const data = reactive<PageData<MonthPlanAuditForm, MonthPlanAuditQuery>>({
purchaseValue: undefined, purchaseValue: undefined,
constructionValue: undefined, constructionValue: undefined,
totalValue: undefined, totalValue: undefined,
planMonth: undefined, planMonth: month.value,
params: {} params: {}
}, },
rules: { rules: {