diff --git a/src/api/labelManage/labelManage.js b/src/api/labelManage/labelManage.js index 9c96519..109d350 100644 --- a/src/api/labelManage/labelManage.js +++ b/src/api/labelManage/labelManage.js @@ -86,4 +86,33 @@ export function getBusUserrLabelStatistics(query) { method: 'post', data: query }) +} + +// 导入复训记录 +export function importRecurrentTraining(data) { + return request({ + url: '/admin/busRecurrentTraining/import', + method: 'post', + data, + headers: { + 'Content-Type': 'multipart/form-data' + } + }) +} + +// 获取当前用户复训记录 +export function currentUserRecurrentTraining(data) { + return request({ + url: '/admin/busRecurrentTraining/list', + method: 'post', + data + }) +} + +// 获取用户生效标签 +export function getUserLabels() { + return request({ + url: '/admin/busUserLabel/getUserLabels', + method: 'post', + }) } \ No newline at end of file diff --git a/src/assets/images/messageIcon.png b/src/assets/images/messageIcon.png new file mode 100644 index 0000000..a0488b5 Binary files /dev/null and b/src/assets/images/messageIcon.png differ diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index ec956b6..d91378e 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -35,6 +35,10 @@ --> + + + +
@@ -45,10 +49,10 @@ 个人中心 - + 退出登录 - + @@ -68,6 +72,8 @@ + \ No newline at end of file diff --git a/src/views/labelManage/adminApproval/index.vue b/src/views/labelManage/adminApproval/index.vue index 88897fd..23c29ce 100644 --- a/src/views/labelManage/adminApproval/index.vue +++ b/src/views/labelManage/adminApproval/index.vue @@ -55,9 +55,15 @@ - +
+ + + 导入复训记录 + +
- + @@ -140,6 +150,7 @@ import { getBusDependencyPage } from "@/api/system/dependency" import { getSysSectionPage } from "@/api/system/section" import { submitBusUserLabel } from "@/api/labelManage/labelManage" import { getUserCertificateList } from "@/api/qualification/myQualifications" +import { currentUserRecurrentTraining } from "@/api/labelManage/labelManage" import { useRouter } from 'vue-router' import moment from 'moment' @@ -255,6 +266,16 @@ const getSysSectionData = () => { }) } +const userRecurrentTrainingData = ref([]) +// 获取本人当年复训数据 +const getCurrentUserRecurrentTraining = () => { + currentUserRecurrentTraining({ workNo: ruleForm.value.workNo }).then(res => { + if (res.code == 200) { + userRecurrentTrainingData.value = res.data + } + }) +} + // 姓名选择事件 const selectChanged = async (value) => { const curUser = allUsers.value.find(item => item.userId == value) @@ -269,7 +290,9 @@ const selectChanged = async (value) => { ruleForm.value.dependencyId = curUser.dependencyId; ruleForm.value.escUserName = curUser.escUserName; - if (ruleForm.value.labelId) { + if(curUser.workNo) getCurrentUserRecurrentTraining() + + if (ruleForm.value.labelId) { requiredQualifications.value = qualificationsMap[ruleForm.value.labelId] || []; loading.value = true; const res = await getUserQualification(); @@ -279,7 +302,7 @@ const selectChanged = async (value) => { tableData.value = res.filter(item => requiredQualifications.value.some(qualification => item.qualificationName === qualification - )) + )) } } @@ -334,6 +357,11 @@ const handleCancel = () => { const handleSubmit = () => { proxy.$refs["ruleFormRef"].validate(valid => { if (valid) { + if (userRecurrentTrainingData.value.length == 0) { + proxy.$modal.msgError(`未找到您的复训信息,不能提交申请!`) + return false; + } + const qualificArr = tableData.value.filter(item => item.certificateUrl) console.log('是否有资质证书', qualificArr) if (qualificArr.length < requiredQualifications.value.length) { diff --git a/src/views/qualification/escTask/components/LableReApplyForm.vue b/src/views/qualification/escTask/components/LableReApplyForm.vue index 606303b..006ec0a 100644 --- a/src/views/qualification/escTask/components/LableReApplyForm.vue +++ b/src/views/qualification/escTask/components/LableReApplyForm.vue @@ -79,8 +79,18 @@
-
申请信息
+
今年复训信息
+ + + + + + + +
+
+
申请信息
@@ -104,7 +114,7 @@ @@ -114,7 +124,7 @@ @@ -140,6 +150,7 @@ import { getBusDependencyPage } from "@/api/system/dependency" import { getSysSectionPage } from "@/api/system/section" import { getBusUserLabelDetail, reApplyBusUserLabel } from "@/api/labelManage/labelManage" import { getUserCertificateList } from "@/api/qualification/myQualifications" +import { currentUserRecurrentTraining } from "@/api/labelManage/labelManage" import { useRouter } from 'vue-router' import moment from 'moment' @@ -272,6 +283,17 @@ const getSysSectionData = () => { }) } + +const userRecurrentTrainingData = ref([]) +// 获取本人当年复训数据 +const getCurrentUserRecurrentTraining = () => { + currentUserRecurrentTraining({ workNo: ruleForm.value.workNo }).then(res => { + if (res.code == 200) { + userRecurrentTrainingData.value = res.data + } + }) +} + // 姓名选择事件 const selectChanged = async (value) => { const curUser = allUsers.value.find(item => item.userId == value) @@ -286,6 +308,8 @@ const selectChanged = async (value) => { ruleForm.value.dependencyId = curUser.dependencyId; ruleForm.value.escUserName = curUser.escUserName; + if (curUser.workNo) getCurrentUserRecurrentTraining() + if (ruleForm.value.labelId) { requiredQualifications.value = qualificationsMap[ruleForm.value.labelId] || []; loading.value = true; diff --git a/src/views/qualification/myQualifications/components/LableApplyForm.vue b/src/views/qualification/myQualifications/components/LableApplyForm.vue index 8c294b2..040fabe 100644 --- a/src/views/qualification/myQualifications/components/LableApplyForm.vue +++ b/src/views/qualification/myQualifications/components/LableApplyForm.vue @@ -59,8 +59,18 @@
-
申请信息
+
今年复训信息
+ + + + + + + +
+
+
申请信息
@@ -115,6 +125,7 @@ import { getBusDependencyPage } from "@/api/system/dependency" import { getSysSectionPage } from "@/api/system/section" import { submitBusUserLabel } from "@/api/labelManage/labelManage" import { getCurrentUserList } from "@/api/qualification/myQualifications" +import { currentUserRecurrentTraining } from "@/api/labelManage/labelManage" import moment from 'moment' const emit = defineEmits(['refresh']) @@ -149,12 +160,13 @@ onMounted(() => { getBusDependencyData() getDeptTree() getSysSectionData() + getCurrentUserRecurrentTraining() }); // 获取当前登录用户详情 const getUserInfos = () => { getUserInfo().then(response => { console.log('用户详情', response) - if (response.code == 200) { + if (response.code == 200) { ruleForm.value.node = 0 ruleForm.value.userId = response.data.userId ruleForm.value.workNo = response.data.workNo @@ -216,6 +228,16 @@ const getSysSectionData = () => { }) } +const userRecurrentTrainingData = ref([]) +// 获取本人当年复训数据 +const getCurrentUserRecurrentTraining = () => { + currentUserRecurrentTraining({}).then(res => { + if (res.code == 200) { + userRecurrentTrainingData.value = res.data + } + }) +} + // 申请标签选择 const handleChoseLabl = async (val) => { loading.value = true; @@ -270,19 +292,24 @@ const handleCancel = () => { const handleSubmit = () => { proxy.$refs["ruleFormRef"].validate(valid => { if (valid) { - const qualificArr = tableData.value.filter(item=> item.certificateUrl) + if (userRecurrentTrainingData.value.length == 0) { + proxy.$modal.msgError(`未找到您的复训信息,不能提交申请!`) + return false; + } + + const qualificArr = tableData.value.filter(item => item.certificateUrl) console.log('是否有资质证书', qualificArr) - if(qualificArr.length < requiredQualifications.value.length) { + if (qualificArr.length < requiredQualifications.value.length) { proxy.$modal.msgError(`资质证书不全,请在"高压资质培训信息"上传资质证书!`) return false; } - const qualificStateArr = tableData.value.filter(item=> item.status == 2) + const qualificStateArr = tableData.value.filter(item => item.status == 2) console.log('是否有资质证书', qualificStateArr) - if(qualificStateArr.length > 0) { + if (qualificStateArr.length > 0) { proxy.$modal.msgError(`资质过期,请更新资质证书后再申请!`) return false; } - ruleForm.value.qualificationCertificateIds = tableData.value.map(item=> item.id) + ruleForm.value.qualificationCertificateIds = tableData.value.map(item => item.id) console.log('sdafasdfas', ruleForm.value) submitBusUserLabel(ruleForm.value).then(res => { if (res.code == 200) { diff --git a/src/views/qualification/myQualifications/components/LableReApplyForm.vue b/src/views/qualification/myQualifications/components/LableReApplyForm.vue index d52352e..fd3d977 100644 --- a/src/views/qualification/myQualifications/components/LableReApplyForm.vue +++ b/src/views/qualification/myQualifications/components/LableReApplyForm.vue @@ -59,8 +59,18 @@
-
申请信息
+
今年复训信息
+ + + + + + + +
+
+
申请信息
@@ -83,7 +93,7 @@ @@ -92,7 +102,7 @@ 长期 @@ -144,17 +154,18 @@ const tableData = ref([]) const baseUrl = import.meta.env.VITE_APP_BASE_API // 初始化 -onMounted(() => { +onMounted(() => { getBusDependencyData() getDeptTree() getSysSectionData() -}); + getCurrentUserRecurrentTraining() +}); // 获取详情 const getLableDetailInfo = (_id) => { getBusUserLabelDetail(_id).then(res => { if (res.code == 200) { - ruleForm.value = res.data + ruleForm.value = res.data ruleForm.value.node = 0 tableData.value = res.data.userQualificationCertificateList console.log('标签详情', ruleForm.value) @@ -210,6 +221,17 @@ const getSysSectionData = () => { }) } + +const userRecurrentTrainingData = ref([]) +// 获取本人当年复训数据 +const getCurrentUserRecurrentTraining = () => { + currentUserRecurrentTraining({}).then(res => { + if (res.code == 200) { + userRecurrentTrainingData.value = res.data + } + }) +} + // 申请标签选择 const handleChoseLabl = async (val) => { loading.value = true; @@ -264,19 +286,19 @@ const handleCancel = () => { const handleSubmit = () => { proxy.$refs["ruleFormRef"].validate(valid => { if (valid) { - const qualificArr = tableData.value.filter(item=> item.certificateUrl) + const qualificArr = tableData.value.filter(item => item.certificateUrl) console.log('是否有资质证书', qualificArr) - if(qualificArr.length < requiredQualifications.value.length) { + if (qualificArr.length < requiredQualifications.value.length) { proxy.$modal.msgError(`资质证书不全,请在"高压资质培训信息"上传资质证书!`) return false; } - const qualificStateArr = tableData.value.filter(item=> item.status == 2) + const qualificStateArr = tableData.value.filter(item => item.status == 2) console.log('是否有资质证书', qualificStateArr) - if(qualificStateArr.length > 0) { + if (qualificStateArr.length > 0) { proxy.$modal.msgError(`资质过期,请更新资质证书后再申请!`) return false; } - ruleForm.value.qualificationCertificateIds = tableData.value.map(item=> item.id) + ruleForm.value.qualificationCertificateIds = tableData.value.map(item => item.id) console.log('sdafasdfas', ruleForm.value) reApplyBusUserLabel(ruleForm.value).then(res => { if (res.code == 200) { diff --git a/src/views/qualification/myQualifications/index.vue b/src/views/qualification/myQualifications/index.vue index 43b259a..c40e824 100644 --- a/src/views/qualification/myQualifications/index.vue +++ b/src/views/qualification/myQualifications/index.vue @@ -67,8 +67,8 @@ 资质名称 - CESC+LLP -
+ {{ myLabel }} + @@ -100,6 +100,8 @@ import QualificationTrain from './components/QualificationTrain.vue' import VehicleTrain from './components/VehicleTrain.vue' import QualificationApply from './components/QualificationApply.vue' import LableApply from './components/LableApply.vue' + +import { getUserLabels } from "@/api/labelManage/labelManage" // import { addMenu, delMenu, getMenu, listMenu, updateMenu } from "@/api/system/menu" import { getUserInfo } from "@/api/system/user" import jobNumberIcon from '@/assets/images/job-number-icon.png' @@ -110,6 +112,7 @@ const baseUrl = import.meta.env.VITE_APP_BASE_API // 初始化 onMounted(() => { getUserInfos() + getCurrentUserRecurrentTraining() }); // 获取当前登录用户详情 @@ -119,6 +122,15 @@ const getUserInfos = () => { if (response.code == 200) curUserInfo.value = response.data }) } +// 获取当前用户有效标签 +const myLabel = ref('-') +const getCurrentUserRecurrentTraining = () => { + getUserLabels().then(res => { + if(res.code == 200) { + myLabel.value = res.data ? res.data : '-' + } + }) +} // 按钮组配置 const ToolOptions = ref(['高压资质培训信息', '高压车型培训信息', '资质申请', '标签申请'])