From 6373b97e75f2e251aa61f8d72b9a169af7ac84d7 Mon Sep 17 00:00:00 2001 From: Teo <2642673902@qq.com> Date: Mon, 31 Mar 2025 18:00:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=97=E8=A1=A8=E5=92=8C?= =?UTF-8?q?=E5=88=86=E5=8C=85=E5=8D=95=E4=BD=8D=E4=BB=A5=E5=8F=8A=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E4=BA=BA=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/project/constructionUser/index.ts | 24 +- src/api/project/constructionUser/types.ts | 40 +++ src/api/project/contractor/types.ts | 5 + src/api/project/project/types.ts | 62 ++++- src/components/amap/index.vue | 136 ++++++++++ src/views/project/constructionUser/index.vue | 73 +++++- src/views/project/contractor/index.vue | 15 +- src/views/project/project/index.vue | 258 +++++++++++++++---- 8 files changed, 532 insertions(+), 81 deletions(-) create mode 100644 src/components/amap/index.vue diff --git a/src/api/project/constructionUser/index.ts b/src/api/project/constructionUser/index.ts index d8a162a..f86ff14 100644 --- a/src/api/project/constructionUser/index.ts +++ b/src/api/project/constructionUser/index.ts @@ -1,6 +1,6 @@ import request from '@/utils/request'; import { AxiosPromise } from 'axios'; -import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types'; +import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO, skipType } from '@/api/project/constructionUser/types'; /** * 查询施工人员列表 @@ -27,6 +27,28 @@ export const getConstructionUser = (id: string | number): AxiosPromise { + return request({ + url: '/project/constructionUser/change/project', + method: 'put', + data: data + }); +}; + +/** + * 查询项目以及项目下的分包公司列表 + */ +export const getProjectContractorList = () => { + return request({ + url: '/project/project/list/project/contractorList', + method: 'get' + }); +}; + /** * 新增施工人员 * @param data diff --git a/src/api/project/constructionUser/types.ts b/src/api/project/constructionUser/types.ts index 7e85a84..502fb62 100644 --- a/src/api/project/constructionUser/types.ts +++ b/src/api/project/constructionUser/types.ts @@ -183,6 +183,46 @@ export interface ConstructionUserVO { createTime: string; } +export interface skipType { + /** + * 项目id + */ + projectId: string | number; + + /** + * 分包id + */ + contractorId: string | number; + id: string | number; +} + +export interface skipOptionType { + /** + * 名称 + */ + projectName: string | number; + + /** + * id + */ + id: string | number; + /** + * 子项 + */ + contractorList: Array; +} +export interface skipTeamType { + /** + * 名称 + */ + name: string | number; + + /** + * id + */ + id: string | number; +} + export interface ConstructionUserForm extends BaseEntity { /** * 主键id diff --git a/src/api/project/contractor/types.ts b/src/api/project/contractor/types.ts index eb7658b..ed0421d 100644 --- a/src/api/project/contractor/types.ts +++ b/src/api/project/contractor/types.ts @@ -51,6 +51,11 @@ export interface ContractorForm extends BaseEntity { */ id?: string | number; + /** + * 主键id + */ + projectId?: string | number; + /** * 公司名称 */ diff --git a/src/api/project/project/types.ts b/src/api/project/project/types.ts index a789b4e..e7c9cdb 100644 --- a/src/api/project/project/types.ts +++ b/src/api/project/project/types.ts @@ -37,12 +37,12 @@ export interface ProjectVO { /** * 项目类型 */ - type: string; + projectType: string; /** * 项目类型(1光伏 2风电) */ - isType: number; + projectCategory: number; /** * 删除时间 @@ -115,6 +115,18 @@ export interface ProjectVO { createTime: string; } +export interface locationType { + /** + * 经度 + */ + lng: string; + // 纬度 + lat: string; + // 逆地理编码地址 + + projectSite: string; +} + export interface ProjectForm extends BaseEntity { /** * @@ -146,6 +158,16 @@ export interface ProjectForm extends BaseEntity { */ picUrl?: string; + /** + * 经度 + */ + lng?: string; + + /** + * 纬度 + */ + lat?: string; + /** * 备注 */ @@ -154,12 +176,12 @@ export interface ProjectForm extends BaseEntity { /** * 项目类型 */ - type?: string; + projectType?: string; /** * 项目类型(1光伏 2风电) */ - isType?: number; + projectCategory?: number; /** * 删除时间 @@ -197,9 +219,14 @@ export interface ProjectForm extends BaseEntity { onStreamTime?: string; /** - * 打卡范围(09:00,18:00) + * 打卡开始时间(09:00,18:00) */ - punchRange?: string; + playCardStart?: string; + + /** + * 打卡结束时间(09:00,18:00) + */ + playCardEnd?: string; /** * 设计总量 @@ -256,12 +283,12 @@ export interface ProjectQuery extends PageQuery { /** * 项目类型 */ - type?: string; + projectType?: string; /** * 项目类型(1光伏 2风电) */ - isType?: number; + projectCategory?: number; /** * 删除时间 @@ -273,6 +300,16 @@ export interface ProjectQuery extends PageQuery { */ projectSite?: string; + /** + * 经度 + */ + lng?: string; + + /** + * 纬度 + */ + lat?: string; + /** * 负责人 */ @@ -299,9 +336,14 @@ export interface ProjectQuery extends PageQuery { onStreamTime?: string; /** - * 打卡范围(09:00,18:00) + * 打卡开始时间(09:00,18:00) */ - punchRange?: string; + playCardStart?: string; + + /** + * 打卡结束时间(09:00,18:00) + */ + playCardEnd?: string; /** * 设计总量 diff --git a/src/components/amap/index.vue b/src/components/amap/index.vue new file mode 100644 index 0000000..73c6c2c --- /dev/null +++ b/src/components/amap/index.vue @@ -0,0 +1,136 @@ + + + + diff --git a/src/views/project/constructionUser/index.vue b/src/views/project/constructionUser/index.vue index c078ed7..0797240 100644 --- a/src/views/project/constructionUser/index.vue +++ b/src/views/project/constructionUser/index.vue @@ -115,6 +115,9 @@ 黑名单 + + 人员迁移 + 删除 @@ -265,6 +268,24 @@ + + + + + + + + + + + + + @@ -274,9 +295,18 @@ import { delConstructionUser, getConstructionUser, listConstructionUser, - updateConstructionUser + updateConstructionUser, + getProjectContractorList, + transferConstructionUser } from '@/api/project/constructionUser'; -import { ConstructionUserForm, ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types'; +import { + ConstructionUserForm, + ConstructionUserQuery, + ConstructionUserVO, + skipType, + skipOptionType, + skipTeamType +} from '@/api/project/constructionUser/types'; import { useUserStoreHook } from '@/store/modules/user'; import { listContractor } from '@/api/project/contractor'; import { listProjectTeam } from '@/api/project/projectTeam'; @@ -300,15 +330,25 @@ const ids = ref>([]); const single = ref(true); const multiple = ref(true); const total = ref(0); - +const skip = ref(false); const queryFormRef = ref(); const constructionUserFormRef = ref(); - +const skipName = ref(''); const dialog = reactive({ visible: false, title: '' }); +//人员迁移条件 +const skipObject: skipType = reactive({ + id: '', + projectId: '', + contractorId: '' +}); +const contractorList = ref>([]); +//项目列表 +const skipOptions = ref>([]); + const initFormData: ConstructionUserForm = { id: undefined, openid: undefined, @@ -392,6 +432,21 @@ const getList = async () => { loading.value = false; }; +const selectProject = (e: any) => { + //选中项目筛选出项目下的分包单位 + contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList; +}; + +const setUnits = async () => { + //人员迁移 + console.log('🚀 ~ setUnits ~ skipObject:', skipObject); + let res = await transferConstructionUser(skipObject); + if (res.code == 200) { + ElMessage.success(res.msg); + skip.value = false; + getList(); + } +}; const contractorOpt = ref(); /** 查询当前项目下的分包公司列表 */ @@ -489,6 +544,16 @@ const handleShowDrawer = (row?: ConstructionUserVO) => { showDetailDrawer.value = true; }; +/** 人员迁移 */ +const handleChange = async (row: ConstructionUserVO) => { + const _id = row?.id || ids.value[0]; + skipName.value = row?.userName; + skipObject.id = _id; + const res = await getProjectContractorList(); + skipOptions.value = res.data; + skip.value = true; +}; + /** 提交按钮 */ const submitForm = () => { constructionUserFormRef.value?.validate(async (valid: boolean) => { diff --git a/src/views/project/contractor/index.vue b/src/views/project/contractor/index.vue index 2658040..96e4409 100644 --- a/src/views/project/contractor/index.vue +++ b/src/views/project/contractor/index.vue @@ -122,16 +122,6 @@ const contractorFormRef = ref(); const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 const currentProject = computed(() => userStore.selectedProject); -//监听项目改变 -// watch( -// () => currentProject.value, -// (newId, oldId) => { -// /* ... */ -// queryParams.value.projectId=newId.id -// // getList() - -// } -// ) const dialog = reactive({ visible: false, title: '' @@ -145,7 +135,8 @@ const initFormData: ContractorForm = { custodian: undefined, custodianPhone: undefined, fileMap: undefined, - remark: undefined + remark: undefined, + projectId: currentProject.value.id }; const data = reactive>({ form: { ...initFormData }, @@ -172,7 +163,7 @@ const { queryParams, form, rules } = toRefs(data); /** 查询分包单位列表 */ const getList = async () => { loading.value = true; - + const res = await listContractor(queryParams.value); contractorList.value = res.rows; total.value = res.total; diff --git a/src/views/project/project/index.vue b/src/views/project/project/index.vue index f6e2dbe..92d710d 100644 --- a/src/views/project/project/index.vue +++ b/src/views/project/project/index.vue @@ -52,10 +52,14 @@ - - + + + + @@ -82,44 +86,136 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
+
基础信息
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 获取经纬度 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
打卡设置
+ + + + + + + + + + + + + + + + + + + +
+ + + + +