diff --git a/plus-ui/.env.development b/plus-ui/.env.development index 26d386dc..8c542b50 100644 --- a/plus-ui/.env.development +++ b/plus-ui/.env.development @@ -5,7 +5,11 @@ VITE_APP_TITLE = 新能源项目管理平台 VITE_APP_ENV = 'development' # 开发环境 -VITE_APP_BASE_API = 'http://192.168.110.6:8899' +VITE_APP_BASE_API = 'http://192.168.110.119:8899' + +# 无人机接口地址 + +VITE_APP_BASE_DRONE_API = 'http://192.168.110.8:9136' # 应用访问路径 例如使用前缀 /admin/ VITE_APP_CONTEXT_PATH = '/' diff --git a/plus-ui/.env.production b/plus-ui/.env.production index 0eb59247..62b1323f 100644 --- a/plus-ui/.env.production +++ b/plus-ui/.env.production @@ -14,7 +14,7 @@ VITE_APP_MONITOR_ADMIN = '/admin/applications' VITE_APP_SNAILJOB_ADMIN = '/snail-job' # 生产环境 -VITE_APP_BASE_API = 'http://192.168.110.5:8899' +VITE_APP_BASE_API = 'http://192.168.110.2:8899' # 是否在打包时开启压缩,支持 gzip 和 brotli VITE_BUILD_COMPRESS = gzip diff --git a/plus-ui/index.html b/plus-ui/index.html index 8b09d746..d1d62af8 100644 --- a/plus-ui/index.html +++ b/plus-ui/index.html @@ -4,7 +4,7 @@ - + 新能源项目管理平台 - 选取文件 - - -
- 请上传 - - - 的文件 -
- - -
  • - - {{ getFileName(file.name) }} - -
    - 删除 + +
    + + 选取文件 + + + +
    + 请上传 + + + 的文件 +
    + + +
  • + + {{ getFileName(file.name) }} + +
    + 删除 +
    +
  • +
    - - + + + + + @@ -57,9 +91,19 @@ const props = defineProps({ // 大小限制(MB) fileSize: propTypes.number.def(5), // 文件类型, 例如['png', 'jpg', 'jpeg'] - fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf']), + fileType: propTypes.array.def(['doc', 'xls', 'ppt', 'txt', 'pdf', 'png', 'jpg', 'jpeg', 'zip']), // 是否显示提示 - isShowTip: propTypes.bool.def(true) + isShowTip: propTypes.bool.def(true), + //是否为施工人员上传 + isConstruction: propTypes.bool.def(false), + //是否为上传zip文件 + isImportInfo: propTypes.bool.def(false), + //ip地址 + uploadUrl: propTypes.string.def('/resource/oss/upload'), + //可拖拽上传 + isDarg: propTypes.bool.def(false), + // 其他参数 + data: propTypes.object.def({}) }); const { proxy } = getCurrentInstance() as ComponentInternalInstance; @@ -68,7 +112,7 @@ const number = ref(0); const uploadList = ref([]); const baseUrl = import.meta.env.VITE_APP_BASE_API; -const uploadFileUrl = ref(baseUrl + '/resource/oss/upload'); // 上传文件服务器地址 +const uploadFileUrl = ref(baseUrl + props.uploadUrl); // 上传文件服务器地址 const headers = ref(globalHeaders()); const fileList = ref([]); @@ -76,9 +120,14 @@ const showTip = computed(() => props.isShowTip && (props.fileType || props.fileS const fileUploadRef = ref(); +const accept = computed(() => { + return props.fileType.map((value) => `.${value}`).join(','); +}); + watch( () => props.modelValue, async (val) => { + if (props.isImportInfo) return; if (val) { let temp = 1; // 首先将值转为数组 @@ -152,11 +201,16 @@ const handleUploadError = () => { // 上传成功回调 const handleUploadSuccess = (res: any, file: UploadFile) => { if (res.code === 200) { - uploadList.value.push({ - name: res.data.fileName, - url: res.data.url, - ossId: res.data.ossId - }); + if (res.data) { + uploadList.value.push({ + name: res.data.fileName, + url: res.data.url, + ossId: res.data.ossId + }); + } else { + uploadList.value.push({}); + } + uploadedSuccessfully(); } else { number.value--; @@ -168,19 +222,38 @@ const handleUploadSuccess = (res: any, file: UploadFile) => { }; // 删除文件 -const handleDelete = (index: number) => { - let ossId = fileList.value[index].ossId; - delOss(ossId); - fileList.value.splice(index, 1); +const handleDelete = async (index: string | number, type?: string) => { + console.log('🚀 ~ handleDelete ~ index:', index); + + await proxy?.$modal.confirm('是否确认删除此文件?').finally(); + if (type === 'ossId') { + delOss(index); + fileList.value = fileList.value.filter((f) => f.ossId !== index); + } else { + let ossId = fileList.value[index].ossId; + delOss(ossId); + index = parseInt(index as string); + fileList.value.splice(index, 1); + } emit('update:modelValue', listToString(fileList.value)); }; // 上传结束处理 const uploadedSuccessfully = () => { + if (props.isImportInfo) { + emit('update:modelValue', 'ok'); + fileUploadRef.value?.clearFiles(); + proxy?.$modal.closeLoading(); + proxy?.$modal.msgSuccess('导入成功'); + return; + } + console.log(number.value, uploadList.value); + if (number.value > 0 && uploadList.value.length === number.value) { fileList.value = fileList.value.filter((f) => f.url !== undefined).concat(uploadList.value); uploadList.value = []; number.value = 0; + emit('update:modelValue', listToString(fileList.value)); proxy?.$modal.closeLoading(); } @@ -210,15 +283,35 @@ const listToString = (list: any[], separator?: string) => { diff --git a/plus-ui/src/components/ImageUpload/index.vue b/plus-ui/src/components/ImageUpload/index.vue index 0778121f..d0f78bd8 100644 --- a/plus-ui/src/components/ImageUpload/index.vue +++ b/plus-ui/src/components/ImageUpload/index.vue @@ -16,6 +16,7 @@ :file-list="fileList" :on-preview="handlePictureCardPreview" :class="{ hide: fileList.length >= limit }" + accept="image/png, image/jpeg, image/jpg" > diff --git a/plus-ui/src/components/ProjectSelector/index.vue b/plus-ui/src/components/ProjectSelector/index.vue index f9e7c3f5..5ba301d8 100644 --- a/plus-ui/src/components/ProjectSelector/index.vue +++ b/plus-ui/src/components/ProjectSelector/index.vue @@ -18,6 +18,7 @@ diff --git a/plus-ui/src/components/TopNav/index.vue b/plus-ui/src/components/TopNav/index.vue index cfe2cd74..fe3aa66e 100644 --- a/plus-ui/src/components/TopNav/index.vue +++ b/plus-ui/src/components/TopNav/index.vue @@ -1,10 +1,10 @@ @@ -69,7 +105,11 @@ - + + + - + + + + + + + + + + + + + + + +
    +
    {{ item.label }}
    +
    + +
    +
    + +
    + +
    + + + + + +
    + +
    + + + + + + + + + + 请输入薪资 + + + + +
    + + + {{ '入场时间:' + item.entryDate }} + + +
    {{ '退场时间:' + item.entryDate }}
    +
    + 退场文件:
    +

    + 备注:{{ item.remark }} +

    +
    +
    +
    +
    + + +
    + + + + + + @@ -274,9 +468,26 @@ import { delConstructionUser, getConstructionUser, listConstructionUser, - updateConstructionUser + updateConstructionUser, + getProjectContractorList, + transferConstructionUser, + updateConstructionUserStatus, + updateConstructionUserPlayCardStatus, + updateConstructionUserPlayCardOneStatus, + updateConstructionUserSalary, + getConstructionUserExit, + dowloadConstructionUserTemplate, + importConstructionUserInfo, + listConstructionMonth } 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'; @@ -284,14 +495,28 @@ import { ContractorVO } from '@/api/project/contractor/types'; import { ProjectTeamVO } from '@/api/project/projectTeam/types'; import ConstructionUserDetail from '@/views/project/constructionUser/component/ConstructionUserDetail.vue'; import { addConstructionBlacklist } from '@/api/project/constructionBlacklist'; +import { listConstructionUserFile, setConstructionUserFile } from '@/api/project/constructionUserFile'; +import { + ConstructionUserFileVO, + ConstructionUserExitVO, + ConstructionUserFileForm, + ConstructionUserFileQuery +} from '@/api/project/constructionUserFile/types'; +import { ElLoadingService } from 'element-plus'; +import type { CalendarDateType, CalendarInstance } from 'element-plus'; +import { AttendanceMonthVO } from '@/api/project/attendance/types'; +import { parseTime } from '@/utils/ruoyi'; +const calendar = ref(); 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')); - +const { type_of_work, user_sex_type, user_clock_type, user_file_type, user_status_type, wage_measure_unit_type } = toRefs( + proxy?.useDict('type_of_work', 'user_sex_type', 'user_clock_type', 'user_file_type', 'user_status_type', 'wage_measure_unit_type') +); // 获取用户 store const userStore = useUserStoreHook(); // 从 store 中获取项目列表和当前选中的项目 const currentProject = computed(() => userStore.selectedProject); +const ProjectTeam = computed(() => userStore.ProjectTeamList); const constructionUserList = ref([]); const buttonLoading = ref(false); const loading = ref(true); @@ -300,14 +525,42 @@ const ids = ref>([]); const single = ref(true); const multiple = ref(true); const total = ref(0); - +const skip = ref(false); +const fileStatus = ref(false); +const showFaceDrawer = ref(false); +const statusDialog = ref(false); +const playCardStatus = ref(false); +const playCardLoding = ref(false); +const playCardCalendar = ref(false); +const salaryStatus = ref(false); +const exitStatus = ref(false); +const calendarDay = ref(null); +const monthValue = ref(null); +const informationStatus = ref(false); +const filePath = ref(''); +const exitList = ref([]); +const changeSalary = ref(''); +const vocationalStatus = ref(null); +const fileList = ref([]); const queryFormRef = ref(); const constructionUserFormRef = ref(); - +const skipName = ref(''); +const calendarList = ref>([]); const dialog = reactive({ visible: false, - title: '' + title: '', + id: undefined }); +const baseUrl = import.meta.env.VITE_APP_BASE_API; +//人员迁移条件 +const skipObject: skipType = reactive({ + id: '', + projectId: '', + contractorId: '' +}); +const contractorList = ref>([]); +//项目列表 +const skipOptions = ref>([]); const initFormData: ConstructionUserForm = { id: undefined, @@ -328,6 +581,7 @@ const initFormData: ConstructionUserForm = { sfzNumber: undefined, sfzStart: undefined, sfzEnd: undefined, + wageMeasureUnit: undefined, sfzSite: undefined, sfzBirth: undefined, nativePlace: undefined, @@ -376,13 +630,88 @@ const data = reactive>({ params: {} }, rules: { - id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], - clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }] + clock: [{ required: true, message: '打卡不能为空', trigger: 'blur' }], + facePic: [{ required: true, message: '人脸照不能为空', trigger: 'blur' }], + userName: [{ required: true, message: '人员姓名不能为空', trigger: 'blur' }], + projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }], + contractorId: [{ required: true, message: '分包公司id不能为空', trigger: 'blur' }], + teamId: [{ required: true, message: '班组id不能为空', trigger: 'blur' }], + phone: [{ required: true, message: '联系电话不能为空', trigger: 'blur' }], + nation: [{ required: true, message: '民族不能为空', trigger: 'blur' }], + sfzFrontPic: [{ required: true, message: '身份证正面图片不能为空', trigger: 'blur' }], + sfzBackPic: [{ required: true, message: '身份证背面图片不能为空', trigger: 'blur' }], + sfzNumber: [{ required: true, message: '身份证号码不能为空', trigger: 'blur' }], + sfzStart: [{ required: true, message: '身份证有效开始期不能为空', trigger: 'blur' }], + sfzEnd: [{ required: true, message: '身份证有效结束期不能为空', trigger: 'blur' }], + sfzSite: [{ required: true, message: '身份证地址不能为空', trigger: 'blur' }], + sfzBirth: [{ required: true, message: '身份证出生日期不能为空', trigger: 'blur' }], + nativePlace: [{ required: true, message: '籍贯不能为空', trigger: 'blur' }], + yhkPic: [{ required: true, message: '银行卡图片不能为空', trigger: 'blur' }], + yhkNumber: [{ required: true, message: '银行卡号不能为空', trigger: 'blur' }], + yhkOpeningBank: [{ required: true, message: '开户行不能为空', trigger: 'blur' }], + typeOfWork: [{ required: true, message: '工种(字典type_of_work)不能为空', trigger: 'blur' }], + wageMeasureUnit: [{ required: true, message: '工资计量单位不能为空', trigger: 'blur' }], + userRole: [{ required: true, message: '用户角色(1=普通用户,2=管理员)不能为空', trigger: 'blur' }] + } +}); + +/** 返回遍历文件对象 */ +const uploadPath = computed(() => { + const list = JSON.parse(JSON.stringify(user_file_type.value)); + for (const item of fileList.value) { + const targetType = item.fileType; + for (let i = 0; i < list.length; i++) { + if (list[i].value == targetType) { + list[i] = { ...list[i], ...item }; // 合并对象 + break; + } + } + } + for (let i = 0; i < list.length; i++) { + if (!list[i].hasOwnProperty('fileType')) { + list[i].fileType = list[i].value; + } + } + console.log(list); + return list; +}); + +/** 返回文件上传状态 */ +const uploadStatusColor = computed(() => (str: string) => { + switch (str) { + case '3': + return 'success'; + case '2': + return 'danger'; + default: + return 'info'; } }); const { queryParams, form, rules } = toRefs(data); +//打卡时间下标 +const playCardIdx = computed(() => (date) => { + return calendarList.value.findIndex((item) => item.clockDate == date.day); +}); + +//打卡状态颜色 +const playCardColor = computed(() => (date) => { + const idx = calendarList.value[playCardIdx.value(date)]?.status; + switch (idx) { + case '1': + return 'green'; + case '2': + return 'orange'; + case '3': + return 'red'; + case '4': + return 'gray'; + default: + return ''; + } +}); + /** 查询施工人员列表 */ const getList = async () => { loading.value = true; @@ -392,6 +721,50 @@ const getList = async () => { loading.value = false; }; +/** 查看打卡记录详情 */ +const handleViewPlayCard = async (idx: number, data: any) => { + if (data.type == 'next-month' || data.type == 'prev-month') { + monthValue.value = data.date; + handleCalendarMonth(monthValue.value); + } + + const statusColor = calendarList.value[idx]?.status; + if (idx == -1 || statusColor == '4' || statusColor == '3') { + return proxy?.$modal.msgWarning('暂无打卡记录数据'); + } + const { downClockTime, downClockPic, upClockTime, upClockPic } = calendarList.value[idx]?.clockList; + ElNotification({ + title: '温馨提示', + dangerouslyUseHTMLString: true, + message: `
    + 头像: +
    + +
    +
    上班打卡时间:${upClockTime ? upClockTime : ''}
    + 头像: +
    + +
    +
    下班打卡时间:${downClockTime ? downClockTime : ''}` + }); +}; + +const selectProject = (e: any) => { + //选中项目筛选出项目下的分包单位并清空分包单位value + contractorList.value = skipOptions.value.filter((item) => item.id == e)[0].contractorList; + skipObject.contractorId = ''; +}; + +const setUnits = async () => { + //人员迁移 + let res = await transferConstructionUser(skipObject); + if (res.code == 200) { + ElMessage.success(res.msg); + skip.value = false; + getList(); + } +}; const contractorOpt = ref(); /** 查询当前项目下的分包公司列表 */ @@ -409,27 +782,45 @@ const getContractorList = async () => { loading.value = false; }; -const projectTeamOpt = ref([]); +const handleMonth = async (e: any) => { + calendarDay.value = e; + handleCalendarMonth(e); +}; -/** 查询当前项目下的班组列表 */ -const getProjectTeamList = async () => { - loading.value = true; - const res = await listProjectTeam({ - pageNum: 1, - pageSize: 20, - orderByColumn: 'createTime', - isAsc: 'desc', - projectId: currentProject.value.id +const handleCalendarMonth = async (e?) => { + let clockMonth; + if (e) { + clockMonth = parseTime(e, '{y}-{m}'); + } + + const res = await listConstructionMonth({ userId: dialog.id, clockMonth }); + calendarList.value = res.data; +}; + +/** 上传安全协议书按钮操作 */ + +const updateProjectFile = async () => { + buttonLoading.value = true; + let fileList = uploadPath.value.map((item) => { + return { + fileId: item.path, + fileType: item.fileType + }; }); - projectTeamOpt.value = res.rows.map((projectTeam: ProjectTeamVO) => ({ - value: projectTeam.id, - label: projectTeam.teamName - })); - loading.value = false; + const data = { + userId: currentUserId.value, + fileList + }; + console.log('🚀 ~ updateProjectFile ~ data:', data); + await setConstructionUserFile(data); + proxy?.$modal.msgSuccess('上传成功'); + buttonLoading.value = false; + fileStatus.value = false; + await getList(); }; const getTeamName = (teamId: string | number) => { - const team = projectTeamOpt.value.find((item: any) => item.value === teamId); + const team = ProjectTeam.value.find((item: any) => item.value === teamId); return team ? team.label : teamId; }; @@ -489,11 +880,74 @@ const handleShowDrawer = (row?: ConstructionUserVO) => { showDetailDrawer.value = true; }; +//打卡按钮 +const handlePlayCard = async (row: ConstructionUserVO) => { + const _id = row?.id || ids.value[0]; + skipName.value = row?.userName; + dialog.id = _id; + await handleCalendarMonth(); + + playCardCalendar.value = true; +}; + +//下载模板 +const downloadTemplate = async () => { + const loadingInstance = ElLoadingService({ + lock: true, + text: 'Loading', + background: 'rgba(0, 0, 0, 0.7)' + }); + const res = await dowloadConstructionUserTemplate({ projectId: currentProject.value.id }); + loadingInstance.close(); +}; + +//导入资料 +const importInformation = async () => {}; + +/** 人员迁移 */ +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 handleToggle = async (row: ConstructionUserVO) => { +// reset(); +// skipName.value = row?.userName; +// const _id = row?.id || ids.value[0]; +// const res = await getConstructionUser(_id); +// Object.assign(form.value, res.data); +// showFaceDrawer.value = true; +// }; + +const handleExit = async (row: ConstructionUserVO) => { + const _id = row?.id || ids.value[0]; + currentUserId.value = _id; + const res = await getConstructionUserExit({ userId: _id }); + exitList.value = res.rows; + exitStatus.value = true; +}; + +//上传按钮 +const handleUpload = async (row: ConstructionUserVO) => { + const _id = row?.id || ids.value[0]; + currentUserId.value = _id; + const res = await listConstructionUserFile({ userId: _id }); + fileList.value = res.data; + fileStatus.value = true; +}; + /** 提交按钮 */ const submitForm = () => { constructionUserFormRef.value?.validate(async (valid: boolean) => { + console.log(valid); if (valid) { buttonLoading.value = true; + form.value.projectId = currentProject.value.id; if (form.value.id) { await updateConstructionUser(form.value).finally(() => (buttonLoading.value = false)); } else { @@ -501,7 +955,10 @@ const submitForm = () => { } proxy?.$modal.msgSuccess('操作成功'); dialog.visible = false; + showFaceDrawer.value = false; await getList(); + } else { + console.log(12); } }); }; @@ -536,14 +993,149 @@ const handleExport = () => { `constructionUser_${new Date().getTime()}.xlsx` ); }; +/** 用户状态编辑操作 */ +const handleEdit = async () => { + if (!vocationalStatus.value) { + proxy?.$modal.msgError('请选择状态'); + return; + } + const data = { + idList: ids.value, + status: vocationalStatus.value + }; + await updateConstructionUserStatus(data); + proxy?.$modal.msgSuccess('修改成功'); + getList(); + ids.value = []; + statusDialog.value = false; +}; + +//打开修改日薪 +const openSalaryDialog = (row: ConstructionUserVO) => { + const _id = row?.id || ids.value[0]; + currentUserId.value = _id; + if (row.salary) { + setSalary(); + return; + } + console.log(row); + salaryStatus.value = true; +}; + +//变更日薪 +const handleSalary = async () => { + if (!changeSalary.value) { + proxy?.$modal.msgError('请输入薪资'); + return; + } + setSalary(); +}; +const setSalary = async () => { + await updateConstructionUserSalary({ id: currentUserId.value, salary: changeSalary.value }); + proxy?.$modal.msgSuccess('修改成功'); + getList(); + changeSalary.value = ''; + salaryStatus.value = false; +}; + +// 批量切换在职状态 +const handlePlayCardStatus = async (e) => { + playCardLoding.value = true; + const clock = e ? 1 : 0; + await updateConstructionUserPlayCardStatus({ projectId: currentProject.value.id, clock }); + proxy?.$modal.msgSuccess('修改成功'); + getList(); + playCardLoding.value = false; +}; + +// 切换在职状态 +const handleClockStatus = async (row: ConstructionUserVO) => { + playCardLoding.value = true; + await updateConstructionUserPlayCardOneStatus({ id: row.id, clock: row.clock }); + proxy?.$modal.msgSuccess('修改成功'); + getList(); + playCardLoding.value = false; +}; + +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); onMounted(() => { getList(); getContractorList(); - getProjectTeamList(); }); - diff --git a/plus-ui/src/views/project/contractor/component/ContractorFileDialog.vue b/plus-ui/src/views/project/contractor/component/ContractorFileDialog.vue index 452b17d8..09c0e37c 100644 --- a/plus-ui/src/views/project/contractor/component/ContractorFileDialog.vue +++ b/plus-ui/src/views/project/contractor/component/ContractorFileDialog.vue @@ -15,9 +15,10 @@ + + + - + + + - - + + + + - - - - + + + + - + + diff --git a/plus-ui/src/views/project/projectTeam/component/UserListDialog.vue b/plus-ui/src/views/project/projectTeam/component/UserListDialog.vue index d0fe1873..42402619 100644 --- a/plus-ui/src/views/project/projectTeam/component/UserListDialog.vue +++ b/plus-ui/src/views/project/projectTeam/component/UserListDialog.vue @@ -14,7 +14,7 @@ 重置 - + @@ -66,8 +66,8 @@ 修改 - - 删除 + + 退场 @@ -85,7 +85,7 @@ - + + + + + + + + + + + + + + + + + @@ -129,8 +150,8 @@ import { } from '@/api/project/projectTeamMember'; import { computed, reactive, ref } from 'vue'; import { useUserStoreHook } from '@/store/modules/user'; -import { listConstructionUser } from '@/api/project/constructionUser'; -import { ConstructionUserQuery, ConstructionUserVO } from '@/api/project/constructionUser/types'; +import { listConstructionUser, delConstructionUserMember } from '@/api/project/constructionUser'; +import { ConstructionUserQuery, ConstructionUserVO, ConstructionUserMembeForm } from '@/api/project/constructionUser/types'; // 获取用户 store const userStore = useUserStoreHook(); @@ -138,10 +159,16 @@ const userStore = useUserStoreHook(); const currentProject = computed(() => userStore.selectedProject); const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { user_post_type } = toRefs(proxy?.useDict('user_post_type')); - +const memberStatus = ref(false); interface Props { projectTeamVo: ProjectTeamVO; } +const memberForm = reactive({ + id: undefined, + filePath: undefined, + remark: undefined, + userName: undefined +}); const props = defineProps(); // 是否可见 @@ -160,6 +187,9 @@ const data = reactive>({ }, rules: { id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }] + }, + memberRules: { + filePath: [{ required: true, message: '请上传退场文件', trigger: 'blur' }] } }); const buttonLoading = ref(false); @@ -170,12 +200,13 @@ const multiple = ref(true); const total = ref(0); const queryFormRef = ref(); const projectTeamMemberFormRef = ref(); +const memberFormRef = ref(); const dialog = reactive({ visible: false, title: '' }); -const { queryParams, form, rules } = toRefs(data); +const { queryParams, form, rules, memberRules } = toRefs(data); const projectTeamMemberList = ref([]); /** 查询项目班组下的成员列表 */ const getList = async () => { @@ -277,6 +308,31 @@ const submitForm = () => { }); }; +/** 确定退场按钮 */ +const submitMemberForm = async () => { + memberFormRef.value?.validate(async (valid: boolean) => { + if (valid) { + buttonLoading.value = true; + await delConstructionUserMember(memberForm).finally(() => (buttonLoading.value = false)); + proxy?.$modal.msgSuccess('操作成功'); + dialog.visible = false; + await getList(); + memberForm.filePath = undefined; + memberForm.remark = undefined; + } + }); + memberStatus.value = false; +}; + +/** 退场按钮操作 */ +const handleExit = async (row?: ProjectTeamMemberVO) => { + const _ids = row?.id || ids.value; + memberForm.userName = row?.memberName; + console.log('🚀 ~ handleDelete ~ row:', row); + memberForm.id = row?.id; + memberStatus.value = true; +}; + /** 删除按钮操作 */ const handleDelete = async (row?: ProjectTeamMemberVO) => { const _ids = row?.id || ids.value; diff --git a/plus-ui/src/views/project/projectTeam/index.vue b/plus-ui/src/views/project/projectTeam/index.vue index ecfb7306..03b9ac91 100644 --- a/plus-ui/src/views/project/projectTeam/index.vue +++ b/plus-ui/src/views/project/projectTeam/index.vue @@ -43,6 +43,11 @@ + + +
    - + @@ -134,7 +139,8 @@ const initFormData: ProjectTeamForm = { projectId: currentProject.value.id, teamName: undefined, isClockIn: undefined, - remark: undefined + remark: undefined, + peopleNumber: undefined }; const data = reactive>({ form: { ...initFormData }, @@ -146,7 +152,8 @@ const data = reactive>({ projectId: currentProject.value.id, teamName: undefined, isClockIn: undefined, - params: {} + params: {}, + peopleNumber: undefined }, rules: { id: [{ required: true, message: '主键id不能为空', trigger: 'blur' }], @@ -257,6 +264,19 @@ const handleExport = () => { `projectTeam_${new Date().getTime()}.xlsx` ); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); onMounted(() => { getList(); diff --git a/plus-ui/src/views/project/workWage/index.vue b/plus-ui/src/views/project/workWage/index.vue index ff160266..c556f587 100644 --- a/plus-ui/src/views/project/workWage/index.vue +++ b/plus-ui/src/views/project/workWage/index.vue @@ -5,20 +5,20 @@ - + - + - + 搜索 重置 @@ -100,7 +100,7 @@ --> - + @@ -110,18 +110,18 @@ - + - + @@ -266,6 +266,7 @@ const submitForm = () => { workWageFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; + form.value.projectId = currentProject.value.id; if (form.value.id) { await updateWorkWage(form.value).finally(() => (buttonLoading.value = false)); } else { @@ -298,6 +299,20 @@ const handleExport = () => { ); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); + onMounted(() => { getList(); }); diff --git a/plus-ui/src/views/safety/questionUserAnswer/index.vue b/plus-ui/src/views/safety/questionUserAnswer/index.vue index 0ceff899..135ae07d 100644 --- a/plus-ui/src/views/safety/questionUserAnswer/index.vue +++ b/plus-ui/src/views/safety/questionUserAnswer/index.vue @@ -4,26 +4,13 @@
    - - + + - - - - - - - - - - - - - - - - - + + + + 搜索 @@ -38,26 +25,25 @@ - diff --git a/plus-ui/src/views/safety/safetyInspection/index.vue b/plus-ui/src/views/safety/safetyInspection/index.vue index 1a5d85d1..aa60eaeb 100644 --- a/plus-ui/src/views/safety/safetyInspection/index.vue +++ b/plus-ui/src/views/safety/safetyInspection/index.vue @@ -5,17 +5,17 @@ - + - + - + @@ -36,7 +36,7 @@ - 批量删除 + 删除 @@ -54,10 +54,10 @@ - - + + @@ -70,7 +70,18 @@ - + + + @@ -119,7 +128,7 @@ - + @@ -149,7 +158,7 @@
    - + @@ -167,11 +176,11 @@ import { SafetyInspectionForm, SafetyInspectionQuery, SafetyInspectionVO } from import { useUserStoreHook } from '@/store/modules/user'; import SafetyInspectionDetailDialog from '@/views/safety/safetyInspection/component/SafetyInspectionDetailDialog.vue'; import { listProjectTeamForeman } from '@/api/project/projectTeam'; -import { ProjectTeamForemanResp } from '@/api/project/projectTeam/types'; +import { foremanQuery, ProjectTeamForemanResp } from '@/api/project/projectTeam/types'; const { proxy } = getCurrentInstance() as ComponentInternalInstance; -const { safety_inspection_violation_type, review_type, reply_type, safety_inspection_type, safety_inspection_check_type } = toRefs( - proxy?.useDict('safety_inspection_violation_type', 'review_type', 'reply_type', 'safety_inspection_type', 'safety_inspection_check_type') +const { safety_inspection_violation_type, review_type, safety_inspection_type, safety_inspection_check_type } = toRefs( + proxy?.useDict('safety_inspection_violation_type', 'review_type', 'safety_inspection_type', 'safety_inspection_check_type') ); // 获取用户 store const userStore = useUserStoreHook(); @@ -254,8 +263,8 @@ const data = reactive>({ const { queryParams, form, rules } = toRefs(data); -const teamOpt = ref(); -const foremanOpt = ref(); +const teamOpt = ref([]); +const foremanOpt = ref([]); const teamList = ref(); /** 查询安全巡检工单列表 */ const getList = async () => { @@ -270,16 +279,17 @@ const getList = async () => { label: team.teamName, value: team.id })); - foremanOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({ - label: team.foremanName, - value: team.foremanId - })); + loading.value = false; }; const changeForeman = (value: string | number) => { - const team = teamList.value.find((team) => team.id === value); - form.value.correctorId = team.foremanId; + const team = teamList.value.filter((team) => team.id === value)[0]; + foremanOpt.value = team.foremanList?.map((foreman: foremanQuery) => ({ + label: foreman.foremanName, + value: foreman.foremanId + })); + form.value.correctorId = ''; }; /** 展开安全巡检工单详情对话框操作 */ @@ -287,6 +297,7 @@ const currentSafetyInspectionId = ref(); const showDetailDialog = ref(false); const handleShowDialog = (row?: SafetyInspectionVO) => { currentSafetyInspectionId.value = row.id; + showDetailDialog.value = true; }; @@ -343,6 +354,7 @@ const submitForm = () => { safetyInspectionFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; + form.value.projectId = currentProject.value.id; if (form.value.id) { await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false)); } else { @@ -375,6 +387,20 @@ const handleExport = () => { ); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); + onMounted(() => { getList(); }); diff --git a/plus-ui/src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue b/plus-ui/src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue index cadd346f..ad971b44 100644 --- a/plus-ui/src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue +++ b/plus-ui/src/views/safety/safetyLog/component/SafetyLogDetailDialog.vue @@ -42,7 +42,7 @@ - + {{ item.originalName }} diff --git a/plus-ui/src/views/safety/safetyLog/index.vue b/plus-ui/src/views/safety/safetyLog/index.vue index ac94e5dc..63607b0b 100644 --- a/plus-ui/src/views/safety/safetyLog/index.vue +++ b/plus-ui/src/views/safety/safetyLog/index.vue @@ -7,6 +7,9 @@ + + + 搜索 重置 @@ -48,7 +51,7 @@
    - + @@ -67,7 +70,7 @@ - + @@ -176,6 +179,7 @@ const initFormData: SafetyLogForm = { stoppageOrOvertime: undefined, otherCondition: undefined, fileId: undefined, + creatorName: undefined, remark: undefined }; const data = reactive>({ @@ -198,6 +202,7 @@ const data = reactive>({ stoppageOrOvertime: undefined, otherCondition: undefined, remark: undefined, + creatorName: undefined, params: {} }, rules: { @@ -278,6 +283,7 @@ const submitForm = () => { safetyLogFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; + form.value.projectId = currentProject.value.id; if (form.value.id) { await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false)); } else { @@ -310,6 +316,20 @@ const handleExport = () => { ); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); + onMounted(() => { getList(); }); diff --git a/plus-ui/src/views/safety/safetyWeeklyReport/index.vue b/plus-ui/src/views/safety/safetyWeeklyReport/index.vue index 2a2decf0..6d31644c 100644 --- a/plus-ui/src/views/safety/safetyWeeklyReport/index.vue +++ b/plus-ui/src/views/safety/safetyWeeklyReport/index.vue @@ -90,7 +90,7 @@ - +
    @@ -231,6 +231,7 @@ const submitForm = () => { safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => { if (valid) { buttonLoading.value = true; + form.value.projectId = currentProject.value.id; if (form.value.id) { await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false)); } else { @@ -263,6 +264,20 @@ const handleExport = () => { ); }; +//监听项目id刷新数据 +const listeningProject = watch( + () => currentProject.value.id, + (nid, oid) => { + queryParams.value.projectId = nid; + form.value.projectId = nid; + getList(); + } +); + +onUnmounted(() => { + listeningProject(); +}); + onMounted(() => { getList(); }); diff --git a/plus-ui/src/views/safety/teamMeeting/component/TeamMeetingDetailDrawer.vue b/plus-ui/src/views/safety/teamMeeting/component/TeamMeetingDetailDrawer.vue index bac76659..9f714b3f 100644 --- a/plus-ui/src/views/safety/teamMeeting/component/TeamMeetingDetailDrawer.vue +++ b/plus-ui/src/views/safety/teamMeeting/component/TeamMeetingDetailDrawer.vue @@ -1,19 +1,19 @@