diff --git a/src/api/project/constructionUser/types.ts b/src/api/project/constructionUser/types.ts index d237cd3..b2d4d58 100644 --- a/src/api/project/constructionUser/types.ts +++ b/src/api/project/constructionUser/types.ts @@ -289,7 +289,7 @@ export interface ConstructionUserForm extends BaseEntity { remark?: string; } -export interface ConstructionUserQuery extends PageQuery { +export interface ConstructionUserQuery extends PageRequest { /** * 微信id */ @@ -325,6 +325,11 @@ export interface ConstructionUserQuery extends PageQuery { */ teamId?: string | number; + /** + * 不在班组id + */ + notTeamId?: string | number; + /** * 状态(0在职 1离职) */ diff --git a/src/api/project/contractor/types.ts b/src/api/project/contractor/types.ts index 9acd322..c0e2573 100644 --- a/src/api/project/contractor/types.ts +++ b/src/api/project/contractor/types.ts @@ -33,7 +33,6 @@ export interface ContractorVO { * 备注 */ remark: string; - } export interface ContractorForm extends BaseEntity { @@ -71,11 +70,9 @@ export interface ContractorForm extends BaseEntity { * 备注 */ remark?: string; - } -export interface ContractorQuery extends PageQuery { - +export interface ContractorQuery extends PageRequest { /** * 公司名称 */ @@ -101,11 +98,8 @@ export interface ContractorQuery extends PageQuery { */ custodianPhone?: string; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/api/project/project/types.ts b/src/api/project/project/types.ts index 53c8a8a..c249b06 100644 --- a/src/api/project/project/types.ts +++ b/src/api/project/project/types.ts @@ -222,7 +222,7 @@ export interface ProjectForm extends BaseEntity { isDelete?: number; } -export interface ProjectQuery extends PageQuery { +export interface ProjectQuery extends PageRequest { /** * 项目名称 */ diff --git a/src/api/project/projectTeam/types.ts b/src/api/project/projectTeam/types.ts index 6021f9d..c1bf0b9 100644 --- a/src/api/project/projectTeam/types.ts +++ b/src/api/project/projectTeam/types.ts @@ -23,7 +23,6 @@ export interface ProjectTeamVO { * 备注 */ remark: string; - } export interface ProjectTeamForm extends BaseEntity { @@ -51,11 +50,9 @@ export interface ProjectTeamForm extends BaseEntity { * 备注 */ remark?: string; - } -export interface ProjectTeamQuery extends PageQuery { - +export interface ProjectTeamQuery extends PageRequest { /** * 项目id */ @@ -71,11 +68,8 @@ export interface ProjectTeamQuery extends PageQuery { */ isClockIn?: number; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/api/project/projectTeamMember/types.ts b/src/api/project/projectTeamMember/types.ts index 72835b4..ef47fc3 100644 --- a/src/api/project/projectTeamMember/types.ts +++ b/src/api/project/projectTeamMember/types.ts @@ -28,7 +28,6 @@ export interface ProjectTeamMemberVO { * 备注 */ remark: string; - } export interface ProjectTeamMemberForm extends BaseEntity { @@ -61,11 +60,9 @@ export interface ProjectTeamMemberForm extends BaseEntity { * 备注 */ remark?: string; - } -export interface ProjectTeamMemberQuery extends PageQuery { - +export interface ProjectTeamMemberQuery extends PageRequest { /** * 班组id */ @@ -86,11 +83,8 @@ export interface ProjectTeamMemberQuery extends PageQuery { */ postId?: string | number; - /** - * 日期范围参数 - */ - params?: any; + /** + * 日期范围参数 + */ + params?: any; } - - - diff --git a/src/views/project/constructionUser/index.vue b/src/views/project/constructionUser/index.vue index f60a39e..efe0860 100644 --- a/src/views/project/constructionUser/index.vue +++ b/src/views/project/constructionUser/index.vue @@ -8,13 +8,19 @@ - + + + - + + + - + + + 搜索 @@ -59,12 +65,12 @@ - + + - @@ -90,23 +96,19 @@ - + @@ -123,17 +125,10 @@ - - - - - - - - - - - + + + + @@ -145,16 +140,16 @@ - + - + - + @@ -168,20 +163,15 @@ - - + + + + - - - - - - - - - - - + + + + @@ -206,8 +196,11 @@ import { updateConstructionUser } from '@/api/project/constructionUser'; import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types'; - import { useUserStoreHook } from '@/store/modules/user'; +import { listContractor } from '@/api/project/contractor'; +import { listProjectTeam } from '@/api/project/projectTeam'; +import { ContractorVO } from '@/api/project/contractor/types'; +import { ProjectTeamVO } from '@/api/project/projectTeam/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { type_of_work, user_sex_type, user_clock_type } = toRefs(proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type')); @@ -266,8 +259,10 @@ const initFormData: ConstructionUserForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, + sortField: 'createTime', + sortOrder: 'descend', openid: undefined, nickName: undefined, pacePhoto: undefined, @@ -298,8 +293,7 @@ const data = reactive>({ }, rules: { id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], - sex: [{ required: true, message: '0:保密 1:男 2女不能为空', trigger: 'change' }], - clock: [{ required: true, message: '打卡(0启用打卡 1禁止打卡)不能为空', trigger: 'blur' }] + clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }] } }); @@ -309,11 +303,53 @@ const { queryParams, form, rules } = toRefs(data); const getList = async () => { loading.value = true; const res = await listConstructionUser(queryParams.value); - constructionUserList.value = res.rows; - total.value = res.total; + constructionUserList.value = res.data.records; + total.value = res.data.total; loading.value = false; }; +const contractorOpt = ref(); + +/** 查询当前项目下的分包公司列表 */ +const getContractorList = async () => { + loading.value = true; + const res = await listContractor({ + current: 1, + pageSize: 20, + sortField: 'createTime', + sortOrder: 'descend' + }); + contractorOpt.value = res.data.records.map((contractor: ContractorVO) => ({ + value: contractor.id, + label: contractor.name + })); + loading.value = false; +}; + +const projectTeamOpt = ref(); + +/** 查询当前项目下的班组列表 */ +const getProjectTeamList = async () => { + loading.value = true; + const res = await listProjectTeam({ + current: 1, + pageSize: 20, + sortField: 'createTime', + sortOrder: 'descend', + projectId: currentProject.value.id + }); + projectTeamOpt.value = res.data.records.map((projectTeam: ProjectTeamVO) => ({ + value: projectTeam.id, + label: projectTeam.teamName + })); + loading.value = false; +}; + +const getTeamName = (teamId: string | number) => { + const team = projectTeamOpt.value.find((item: any) => item.value === teamId); + return team ? team.label : teamId; +}; + /** 取消按钮 */ const cancel = () => { reset(); @@ -328,7 +364,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNum = 1; + queryParams.value.current = 1; getList(); }; @@ -401,5 +437,7 @@ const handleExport = () => { onMounted(() => { getList(); + getContractorList(); + getProjectTeamList(); }); diff --git a/src/views/project/contractor/index.vue b/src/views/project/contractor/index.vue index 69be2cb..8d4ca56 100644 --- a/src/views/project/contractor/index.vue +++ b/src/views/project/contractor/index.vue @@ -62,17 +62,17 @@ - + @@ -141,7 +141,7 @@ const initFormData: ContractorForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, name: undefined, principal: undefined, @@ -162,7 +162,7 @@ const getList = async () => { loading.value = true; const res = await listContractor(queryParams.value); contractorList.value = res.data.records; - total.value = res.total; + total.value = res.data.total; loading.value = false; }; @@ -180,7 +180,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNum = 1; + queryParams.value.current = 1; getList(); }; diff --git a/src/views/project/project/index.vue b/src/views/project/project/index.vue index 526dea7..3d0866c 100644 --- a/src/views/project/project/index.vue +++ b/src/views/project/project/index.vue @@ -53,7 +53,6 @@ - diff --git a/src/views/project/projectTeam/index.vue b/src/views/project/projectTeam/index.vue index 5f53063..cc05200 100644 --- a/src/views/project/projectTeam/index.vue +++ b/src/views/project/projectTeam/index.vue @@ -23,13 +23,13 @@ 新增 - 修改 + + 修改 - 删除 + + 删除 @@ -43,23 +43,25 @@ - + + + - + @@ -81,7 +83,7 @@ - + @@ -92,7 +94,7 @@ import { useUserStoreHook } from '@/store/modules/user'; import UserListDialog from '@/views/project/projectTeam/component/UserListDialog.vue'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; - +const { team_clock_type } = toRefs(proxy?.useDict('team_clock_type')); // 获取用户 store const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 @@ -106,7 +108,13 @@ const single = ref(true); const multiple = ref(true); const total = ref(0); const userListVisible = ref(); -const currentRow = ref(); +const currentRow = ref({ + id: undefined, + projectId: undefined, + teamName: undefined, + isClockIn: undefined, + remark: undefined +}); const queryFormRef = ref(); const projectTeamFormRef = ref(); @@ -126,8 +134,10 @@ const initFormData: ProjectTeamForm = { const data = reactive>({ form: { ...initFormData }, queryParams: { - pageNum: 1, + current: 1, pageSize: 10, + sortField: 'createTime', + sortOrder: 'descend', projectId: currentProject.value.id, teamName: undefined, isClockIn: undefined, @@ -164,7 +174,7 @@ const reset = () => { /** 搜索按钮操作 */ const handleQuery = () => { - queryParams.value.pageNum = 1; + queryParams.value.current = 1; getList(); }; diff --git a/src/views/project/projectTeamMember/index.vue b/src/views/project/projectTeamMember/index.vue deleted file mode 100644 index 78503c9..0000000 --- a/src/views/project/projectTeamMember/index.vue +++ /dev/null @@ -1,272 +0,0 @@ - - -