gps
This commit is contained in:
		| @ -6,9 +6,9 @@ VITE_APP_ENV = 'development' | ||||
|  | ||||
| # 开发环境 | ||||
| # 李陈杰 209 | ||||
| VITE_APP_BASE_API = 'http://192.168.110.149: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' | ||||
| # 罗成 | ||||
| # VITE_APP_BASE_API = 'http://192.168.110.188:8899' | ||||
| # 朱银 | ||||
|  | ||||
| @ -203,3 +203,31 @@ export const importConstructionUserInfo = (file: string) => { | ||||
|     data: { file } | ||||
|   }); | ||||
| }; | ||||
|  | ||||
|  | ||||
| // 获取项目列表 | ||||
| export const ProjectList = (query) => { | ||||
|   return request({ | ||||
|     url: '/contractor/constructionUser/projectList', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| // 获取班组列表 | ||||
| export const TeamList = (query) => { | ||||
|   return request({     | ||||
|     url: '/contractor/constructionUser/teamList', | ||||
|     method: 'get', | ||||
|     params: query | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| // 班组分配 | ||||
| export const TeamDistribution = (data) => { | ||||
|   return request({ | ||||
|     url: '/contractor/constructionUser/addTeam', | ||||
|     method: 'post', | ||||
|     data: data | ||||
|   }); | ||||
| }; | ||||
| @ -182,6 +182,8 @@ export interface ConstructionUserVO { | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   createTime: string; | ||||
|  | ||||
|   sysUserId: string | number; | ||||
| } | ||||
| export interface skipType { | ||||
|   /** | ||||
|  | ||||
| @ -72,3 +72,12 @@ export const delProjectTeam = (id: string | number | Array<string | number>) => | ||||
|     method: 'delete' | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| // 获取项目得打卡范围 | ||||
| export const getProjectTeamClockIn = (params) => { | ||||
|   return request({ | ||||
|     url: '/project/projectTeam/rangeList', | ||||
|     method: 'get', | ||||
|     params | ||||
|   }); | ||||
| }; | ||||
| @ -55,6 +55,11 @@ export interface ProjectTeamForm extends BaseEntity { | ||||
|    * 备注 | ||||
|    */ | ||||
|   remark?: string; | ||||
|    | ||||
|   /** | ||||
|    * 创建时间 | ||||
|    */ | ||||
|   punchRangeList?: []; | ||||
| } | ||||
|  | ||||
| export interface ProjectTeamQuery extends PageQuery { | ||||
|  | ||||
| @ -120,6 +120,9 @@ const createEarth = () => { | ||||
|       } | ||||
|     } | ||||
|     loadBaseMap(earth.viewer) | ||||
|     YJ.Global.CesiumContainer(window.Earth1, { | ||||
|       compass: false, //罗盘 | ||||
|     }); | ||||
|     // YJ.Global.flyTo(earth, view); | ||||
|     // YJ.Global.setDefaultView(earth.viewer, view) | ||||
|   }) | ||||
|  | ||||
| @ -1,18 +1,314 @@ | ||||
| <template> | ||||
|   <div class="text-center py-10"> | ||||
|     <el-button type="primary" @click="handleGoBack">返回上一页</el-button> | ||||
|   <div class="p5" style="width: 100%;height: calc(100vh - 84px);" v-loading="loading"> | ||||
|     <div id="TrajectoryEarth" style="width: 100%;height: 100%;"></div> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| <script setup name="EmptyPage" lang="ts"> | ||||
| import { useRouter } from 'vue-router'; | ||||
| <script setup name="equipmentGPS"> | ||||
| import { ref, onMounted, onUnmounted } from 'vue'; | ||||
|  | ||||
| const router = useRouter(); | ||||
| const loading = ref(true); | ||||
| let earthInstance = null; | ||||
| let data = [ | ||||
|   { | ||||
|     "lng": 106.45637808828741, | ||||
|     "lat": 29.5597535878972, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.45971817314378, | ||||
|     "lat": 29.54708008996366, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.4594902314301, | ||||
|     "lat": 29.53682043192008, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.47398277208025, | ||||
|     "lat": 29.5448688679258, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.4793889453858, | ||||
|     "lat": 29.549294608101395, | ||||
|     "alt": 0.0016450895529057888 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.49100748408087, | ||||
|     "lat": 29.551808876409023, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.5040076285079, | ||||
|     "lat": 29.55321574288158, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51355510567937, | ||||
|     "lat": 29.546776414794298, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51838453732344, | ||||
|     "lat": 29.537721996213506, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51457768703192, | ||||
|     "lat": 29.524855377287736, | ||||
|     "alt": 0.0009144105438296915 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.52872030672225, | ||||
|     "lat": 29.53289655789934, | ||||
|     "alt": 0.0005979679117487334 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.53493249730421, | ||||
|     "lat": 29.541341118458874, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.53390022310705, | ||||
|     "lat": 29.54848036964581, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.53471751083796, | ||||
|     "lat": 29.55380771856629, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.53518023558718, | ||||
|     "lat": 29.560247052020156, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.52470634506619, | ||||
|     "lat": 29.560148336926677, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.52527983360243, | ||||
|     "lat": 29.55240114606003, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51837614087053, | ||||
|     "lat": 29.557734494325807, | ||||
|     "alt": 0.0021893863172707047 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51573052195917, | ||||
|     "lat": 29.564878142363643, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.50951515081469, | ||||
|     "lat": 29.556427329943944, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.5076746620389, | ||||
|     "lat": 29.565884717127823, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.50341642164544, | ||||
|     "lat": 29.558842113740727, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.50065453145776, | ||||
|     "lat": 29.567897073636868, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.49328990493458, | ||||
|     "lat": 29.558741275828908, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.49363360765534, | ||||
|     "lat": 29.57333026493932, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51905977395505, | ||||
|     "lat": 29.57828423907017, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.51145952743101, | ||||
|     "lat": 29.584527208426245, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.49372239119027, | ||||
|     "lat": 29.58774998459616, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.48214171543982, | ||||
|     "lat": 29.580866974898736, | ||||
|     "alt": 0.006089177027688381 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.48801515807557, | ||||
|     "lat": 29.57049465877845, | ||||
|     "alt": 0 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.47638485150803, | ||||
|     "lat": 29.571501851940585, | ||||
|     "alt": 0.0011061005102942808 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.47903303165843, | ||||
|     "lat": 29.562542838689904, | ||||
|     "alt": 0.0011137835517156711 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.4645244823306, | ||||
|     "lat": 29.56868284644567, | ||||
|     "alt": 0.00008251706068442191 | ||||
|   }, | ||||
|   { | ||||
|     "lng": 106.47108853087332, | ||||
|     "lat": 29.555194220499004, | ||||
|     "alt": 0 | ||||
|   }, | ||||
| ] | ||||
|  | ||||
| // 返回上一页 | ||||
| const handleGoBack = () => { | ||||
|   router.go(-1); | ||||
|  | ||||
| // 创建地球 | ||||
| const createEarth = () => { | ||||
|   if (!window.YJ) { | ||||
|     ElMessage.error('YJ库未加载,请检查依赖'); | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   window.YJ.on({ | ||||
|     ws: true, | ||||
|     // host: getIP(), // 资源所在服务器地址 | ||||
|     // username: this.loginForm.username, // 用户名 | ||||
|     // password: md5pass, // 密码 | ||||
|   }).then((res) => { | ||||
|     loading.value = false; | ||||
|     // 创建地球实例 | ||||
|     earthInstance = new YJ.YJEarth('TrajectoryEarth'); | ||||
|     window.Earth3 = earthInstance; | ||||
|  | ||||
|     // 开启右键和左键点击事件 | ||||
|     YJ.Global.openRightClick(window.Earth3); | ||||
|     YJ.Global.openLeftClick(window.Earth3); | ||||
|  | ||||
|     // 设置初始视角 | ||||
|     const view = { | ||||
|       position: { | ||||
|         lng: 102.03643298211526, | ||||
|         lat: 34.393586474501, | ||||
|         alt: 11298179.51993155 | ||||
|       }, | ||||
|       orientation: { | ||||
|         heading: 360, | ||||
|         pitch: -89.94481747201486, | ||||
|         roll: 0 | ||||
|       } | ||||
|     }; | ||||
|  | ||||
|     YJ.Global.CesiumContainer(window.Earth3, { | ||||
|       compass: false, //罗盘 | ||||
|     }); | ||||
|     // 加载底图 | ||||
|     loadBaseMap(earthInstance.viewer); | ||||
|  | ||||
|     // 可以取消注释以下代码来设置初始视角 | ||||
|     // YJ.Global.flyTo(earthInstance, view); | ||||
|     // YJ.Global.setDefaultView(earthInstance.viewer, view) | ||||
|     renderRange(data); | ||||
|   }).catch((err) => { | ||||
|     console.error('初始化地球失败:', err); | ||||
|     ElMessage.error('初始化地球失败,请稍后重试'); | ||||
|   }); | ||||
| }; | ||||
|  | ||||
| // 加载底图 | ||||
| const loadBaseMap = (viewer) => { | ||||
|   if (!viewer || !Cesium) { | ||||
|     ElMessage.error('Cesium库未加载,请检查依赖'); | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   try { | ||||
|     // 创建瓦片提供器 | ||||
|     const imageryProvider = new Cesium.UrlTemplateImageryProvider({ | ||||
|       url: 'https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}', | ||||
|       fileExtension: 'png', | ||||
|       minimumLevel: 0, | ||||
|       maximumLevel: 18, | ||||
|       projection: Cesium.WebMercatorProjection, | ||||
|       credit: new Cesium.Credit('卫星图数据来源') | ||||
|     }); | ||||
|  | ||||
|     // 添加图层到视图 | ||||
|     viewer.imageryLayers.addImageryProvider(imageryProvider); | ||||
|   } catch (err) { | ||||
|     console.error('加载底图失败:', err); | ||||
|     ElMessage.error('加载底图失败'); | ||||
|   } | ||||
| }; | ||||
|  | ||||
| // 渲染轨迹 | ||||
| const renderRange = (data) => { | ||||
|   if (!data || data.length === 0) { | ||||
|     ElMessage.warning('无轨迹数据可渲染'); | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   if (!earthInstance || !earthInstance.viewer) { | ||||
|     ElMessage.error('地球实例未初始化'); | ||||
|     return; | ||||
|   } | ||||
|  | ||||
|   try { | ||||
|     const positions = data.map((point) => { | ||||
|       return Cesium.Cartesian3.fromDegrees(point.lng, point.lat, point.alt || 0); | ||||
|     }); | ||||
|  | ||||
|     const entity = earthInstance.viewer.entities.add({ | ||||
|       polyline: { | ||||
|         positions: positions, | ||||
|         width: 5, | ||||
|         material: Cesium.Color.RED, | ||||
|         clampToGround: true | ||||
|       } | ||||
|     }); | ||||
|  | ||||
|     // 调整视角以适应轨迹 | ||||
|     earthInstance.viewer.flyTo(entity); | ||||
|   } catch (err) { | ||||
|     console.error('渲染轨迹失败:', err); | ||||
|     ElMessage.error('渲染轨迹失败'); | ||||
|   } | ||||
| }; | ||||
|  | ||||
|  | ||||
| //  | ||||
| onMounted(() => { | ||||
|   createEarth(); | ||||
| }); | ||||
|  | ||||
| //  | ||||
| onUnmounted(() => { | ||||
|   if (earthInstance) { | ||||
|     earthInstance.destroy(); | ||||
|     earthInstance = null; | ||||
|     window.Earth3 = null; | ||||
|   } | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <style scoped></style> | ||||
| <style></style> | ||||
|  | ||||
| @ -12,7 +12,7 @@ | ||||
| </template> | ||||
|  | ||||
| <script setup> | ||||
| import { ref, onMounted, watch, defineEmits, defineProps } from 'vue'; | ||||
| import { ref, onMounted, watch, defineEmits, defineProps,onUnmounted } from 'vue'; | ||||
| import { ElMessage } from 'element-plus'; | ||||
| import { | ||||
|     addAttendanceRange, | ||||
| @ -265,6 +265,15 @@ onMounted(() => { | ||||
| defineExpose({ | ||||
|     show | ||||
| }); | ||||
|  | ||||
| //  | ||||
| onUnmounted(() => { | ||||
|     if (earthInstance) { | ||||
|         earthInstance.destroy(); | ||||
|         earthInstance = null; | ||||
|         window.Earth2 = null; | ||||
|     } | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| <style scoped> | ||||
|  | ||||
| @ -80,6 +80,11 @@ | ||||
|             <el-option v-for="item in team_clock_type" :key="item.value" :label="item.label" :value="item.value" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="打卡范围" prop="punchRangeList" v-if="form.isClockIn == 1"> | ||||
|           <el-select v-model="form.punchRangeList" multiple clearable placeholder="请选择打卡范围"> | ||||
|             <el-option v-for="item in projectTeamRangeList" :key="item.id" :label="item.punchName" :value="item.id" /> | ||||
|           </el-select> | ||||
|         </el-form-item> | ||||
|         <el-form-item label="备注" prop="remark"> | ||||
|           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | ||||
|         </el-form-item> | ||||
| @ -98,13 +103,15 @@ | ||||
| </template> | ||||
|  | ||||
| <script setup name="ProjectTeam" lang="ts"> | ||||
| import { addProjectTeam, delProjectTeam, getProjectTeam, listProjectTeam, updateProjectTeam } from '@/api/project/projectTeam'; | ||||
| import { addProjectTeam, delProjectTeam, getProjectTeam, listProjectTeam, updateProjectTeam,getProjectTeamClockIn } from '@/api/project/projectTeam'; | ||||
| import { ProjectTeamForm, ProjectTeamQuery, ProjectTeamVO } from '@/api/project/projectTeam/types'; | ||||
| 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<any>(proxy?.useDict('team_clock_type')); | ||||
| console.log(team_clock_type); | ||||
|  | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| // 从 store 中获取项目列表和当前选中的项目 | ||||
| @ -117,6 +124,7 @@ const ids = ref<Array<string | number>>([]); | ||||
| const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
| const projectTeamRangeList = ref([]); | ||||
| const currentRow = ref<ProjectTeamVO>({ | ||||
|   id: undefined, | ||||
|   projectId: undefined, | ||||
| @ -140,7 +148,8 @@ const initFormData: ProjectTeamForm = { | ||||
|   teamName: undefined, | ||||
|   isClockIn: undefined, | ||||
|   remark: undefined, | ||||
|   peopleNumber: undefined | ||||
|   peopleNumber: undefined, | ||||
|   punchRangeList: undefined | ||||
| }; | ||||
| const data = reactive<PageData<ProjectTeamForm, ProjectTeamQuery>>({ | ||||
|   form: { ...initFormData }, | ||||
| @ -171,6 +180,14 @@ const getList = async () => { | ||||
|   total.value = res.total; | ||||
|   loading.value = false; | ||||
| }; | ||||
| /** 获取该项目的打开范围 "*/  | ||||
| const getClockIn = async () => { | ||||
|   if(currentProject.value?.id){ | ||||
|     const res = await getProjectTeamClockIn({projectId:currentProject.value?.id}); | ||||
|     projectTeamRangeList.value = res.rows | ||||
|   } | ||||
| }; | ||||
|  | ||||
|  | ||||
| /** 取消按钮 */ | ||||
| const cancel = () => { | ||||
| @ -280,5 +297,6 @@ onUnmounted(() => { | ||||
|  | ||||
| onMounted(() => { | ||||
|   getList(); | ||||
|   getClockIn(); | ||||
| }); | ||||
| </script> | ||||
|  | ||||
| @ -5,6 +5,11 @@ | ||||
|       <div v-show="showSearch" class="mb-[10px]"> | ||||
|         <el-card shadow="hover"> | ||||
|           <el-form ref="queryFormRef" :model="queryParams" :inline="true"> | ||||
|             <el-form-item label="项目名称" prop="projectId"> | ||||
|               <el-select v-model="queryParams.projectId" clearable placeholder="全部"> | ||||
|                 <el-option v-for="item in projectList" :key="item.value" :label="item.projectName" :value="item.id" /> | ||||
|               </el-select> | ||||
|             </el-form-item> | ||||
|             <el-form-item label="人员姓名" prop="userName"> | ||||
|               <el-input v-model="queryParams.userName" placeholder="请输入人员姓名" clearable @keyup.enter="handleQuery" /> | ||||
|             </el-form-item> | ||||
| @ -156,6 +161,7 @@ | ||||
|               </el-button> | ||||
|               <!-- <el-button link type="primary" icon="Switch" @click="handleToggle(scope.row)"> 切换人脸 </el-button> --> | ||||
|               <el-button link type="primary" icon="Switch" @click="handleChange(scope.row)"> 人员迁移 </el-button> | ||||
|               <el-button link type="primary" icon="Switch" @click="handleAssign(scope.row)"> 分配班组 </el-button> | ||||
|               <el-button link type="primary" icon="ChatLineSquare" @click="handleExit(scope.row)"> 入退场记录 </el-button> | ||||
|               <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" | ||||
|                 v-hasPermi="['contractor:constructionUser:remove']"> | ||||
| @ -443,6 +449,30 @@ | ||||
|         </template> | ||||
|       </el-calendar> | ||||
|     </el-dialog> | ||||
|     <el-dialog draggable :title="skipName + '-人员分配'" v-model="personnelAllocation" width="500px"> | ||||
|       <el-form-item label="所属项目" label-width="130px"> | ||||
|         <el-select v-model="personnelAllocationObject.projectId" @change="selectProject1" placeholder="请选择所属项目" style="width: 240px"> | ||||
|           <el-option v-for="item in projectList" :key="item.id" :label="item.projectName" :value="item.id" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="岗位" label-width="130px"> | ||||
|         <el-select v-model="personnelAllocationObject.postId" placeholder="请选择岗位" style="width: 240px"> | ||||
|           <el-option v-for="item in user_post_type" :key="item.value" :label="item.label" :value="item.value" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <el-form-item label="班组" label-width="130px"> | ||||
|         <el-select v-model="personnelAllocationObject.teamId" :disabled="!personnelAllocationObject.projectId" placeholder="请选择分包单位" | ||||
|           style="width: 240px"> | ||||
|           <el-option v-for="item in teamList" :key="item.id" :label="item.teamName" :value="item.id" /> | ||||
|         </el-select> | ||||
|       </el-form-item> | ||||
|       <template #footer> | ||||
|         <div class="dialog-footer"> | ||||
|           <el-button type="primary" @click="handlePersonnelAllocation">确认</el-button> | ||||
|           <el-button @click="personnelAllocation = false"> 取消 </el-button> | ||||
|         </div> | ||||
|       </template> | ||||
|     </el-dialog> | ||||
|   </div> | ||||
| </template> | ||||
|  | ||||
| @ -462,7 +492,10 @@ import { | ||||
|   getConstructionUserExit, | ||||
|   dowloadConstructionUserTemplate, | ||||
|   importConstructionUserInfo, | ||||
|   listConstructionMonth | ||||
|   listConstructionMonth, | ||||
|   ProjectList, | ||||
|   TeamList, | ||||
|   TeamDistribution | ||||
| } from '@/api/project/constructionUser'; | ||||
| import { | ||||
|   ConstructionUserForm, | ||||
| @ -494,8 +527,8 @@ import { parseTime } from '@/utils/ruoyi'; | ||||
|  | ||||
| const calendar = ref<CalendarInstance>(); | ||||
| const { proxy } = getCurrentInstance() as ComponentInternalInstance; | ||||
| const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs<any>( | ||||
|   proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type') | ||||
| const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type,user_post_type } = toRefs<any>( | ||||
|   proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type','user_post_type') | ||||
| ); | ||||
| // 获取用户 store | ||||
| const userStore = useUserStoreHook(); | ||||
| @ -511,6 +544,7 @@ const single = ref(true); | ||||
| const multiple = ref(true); | ||||
| const total = ref(0); | ||||
| const skip = ref(false); | ||||
| const personnelAllocation = ref(false); | ||||
| const fileStatus = ref(false); | ||||
| const showFaceDrawer = ref(false); | ||||
| const statusDialog = ref(false); | ||||
| @ -531,6 +565,10 @@ const queryFormRef = ref<ElFormInstance>(); | ||||
| const constructionUserFormRef = ref<ElFormInstance>(); | ||||
| const skipName = ref(''); | ||||
| const calendarList = ref<Array<AttendanceMonthVO>>([]); | ||||
| // 项目列表 | ||||
| const projectList = ref([]); | ||||
| // 班组列表 | ||||
| const teamList = ref([]); | ||||
| const dialog = reactive<DialogOption>({ | ||||
|   visible: false, | ||||
|   title: '', | ||||
| @ -543,6 +581,14 @@ const skipObject: skipType = reactive({ | ||||
|   projectId: '', | ||||
|   contractorId: '' | ||||
| }); | ||||
| // 人员分配 | ||||
| const personnelAllocationObject = reactive({ | ||||
|   memberId: null, | ||||
|   projectId: '', | ||||
|   teamId: '', | ||||
|   postId: '', | ||||
| }); | ||||
|  | ||||
| const contractorList = ref<Array<skipTeamType>>([]); | ||||
| //项目列表 | ||||
| const skipOptions = ref<Array<skipOptionType>>([]); | ||||
| @ -661,6 +707,13 @@ const uploadPath = computed(() => { | ||||
|   return list; | ||||
| }); | ||||
|  | ||||
| // 获取项目列表 | ||||
| const getProjectList = async () => { | ||||
|   const res = await ProjectList({}); | ||||
|   projectList.value = res.rows; | ||||
|   projectList.value.unshift({ id: '', projectName: '全部' }); | ||||
| }; | ||||
|  | ||||
| /** 返回文件上传状态 */ | ||||
| const uploadStatusColor = computed(() => (str: string) => { | ||||
|   switch (str) { | ||||
| @ -825,7 +878,7 @@ const reset = () => { | ||||
| /** 搜索按钮操作 */ | ||||
| const handleQuery = () => { | ||||
|   queryParams.value.pageNum = 1; | ||||
|   if (contractorOpt.value.length == 1) queryParams.value.contractorId = contractorOpt.value[0].value; | ||||
|   // if (contractorOpt.value.length == 1) queryParams.value.contractorId = contractorOpt.value[0].value; | ||||
|   getList(); | ||||
| }; | ||||
|  | ||||
| @ -1053,6 +1106,36 @@ const listeningProject = watch( | ||||
|     getContractorList(); | ||||
|   } | ||||
| ); | ||||
| // 分配班组 | ||||
| const handleAssign = async (row: ConstructionUserVO) => { | ||||
|   const _id = row?.id || ids.value[0]; | ||||
|   currentUserId.value = _id; | ||||
|   personnelAllocationObject.memberId = row?.sysUserId; | ||||
|   personnelAllocation.value = true; | ||||
| }; | ||||
| // 选择项目1 | ||||
| const selectProject1 = (e: any) => { | ||||
|   // 请求班组 | ||||
|   getTeamList(personnelAllocationObject.projectId); | ||||
|    | ||||
| }; | ||||
| const getTeamList = async (projectId) => { | ||||
|   const res = await TeamList({ | ||||
|     projectId, | ||||
|     pageNum: 1, | ||||
|     pageSize: 100 | ||||
|   }); | ||||
|   teamList.value = res.rows; | ||||
| }; | ||||
| // 人员分配 | ||||
| const handlePersonnelAllocation = async () => { | ||||
|   let res = await TeamDistribution(personnelAllocationObject); | ||||
|   if (res.code == 200) { | ||||
|     ElMessage.success(res.msg); | ||||
|     personnelAllocation.value = false; | ||||
|     getList(); | ||||
|   } | ||||
| }; | ||||
|  | ||||
| onUnmounted(() => { | ||||
|   listeningProject(); | ||||
| @ -1060,6 +1143,7 @@ onUnmounted(() => { | ||||
|  | ||||
| onMounted(() => { | ||||
|   getContractorList(); | ||||
|   getProjectList(); | ||||
| }); | ||||
| </script> | ||||
| <style scoped lang="scss"> | ||||
|  | ||||
		Reference in New Issue
	
	Block a user