This commit is contained in:
bb_pan 2025-06-18 08:59:18 +08:00
parent 84a3419032
commit 8c3867a385
3 changed files with 32 additions and 3 deletions

View File

@ -50,9 +50,11 @@ import {
updateTeamProjectApi, updateTeamProjectApi,
getToolsLedgerDetailsListApi, getToolsLedgerDetailsListApi,
} from '@/services/index' } from '@/services/index'
import { getBmTeamList } from '@/services/back.js'
import { useMemberStore } from '@/stores' import { useMemberStore } from '@/stores'
const memberStore = useMemberStore() const memberStore = useMemberStore()
const userInfo = ref({}) const userInfo = ref({})
const isTeamLeader = ref(false)
const todayDatas = reactive({ const todayDatas = reactive({
normalNum: '', // normalNum: '', //
@ -70,6 +72,14 @@ const isUsingList = ref([
{ path: 'teamWarning', src: 'teamWarning', isShow: true }, { path: 'teamWarning', src: 'teamWarning', isShow: true },
]) ])
function jumpUrl(path) { function jumpUrl(path) {
if (isTeamLeader.value && (path == 'toolsOut' || path == 'toolsBack' || path == 'toolsLedger')) {
//
uni.showToast({
title: '当前账号权限不足, 请联系材料站长',
icon: 'none',
})
return
}
if (path == 'toolsOut') { if (path == 'toolsOut') {
const params = { const params = {
isOut: true, isOut: true,
@ -151,12 +161,29 @@ const getToolsLedgerDetailsList = async () => {
} }
} }
//
const getTeamList = async () => {
try {
const res = await getBmTeamList({ isAll: 0 })
console.log('🚀 ~ getTeamList ~ res:', res)
if (res.data.length > 0) {
// res.data teamLeaderIdCard userInfo.value.userName isTeamLeader true
isTeamLeader.value = res.data.some((item) => item.teamLeaderIdCard == userInfo.value.userName)
console.log('🚀 ~ getTeamList ~ isTeamLeader.value:', isTeamLeader.value)
}
} catch (error) {
console.log('🚀 ~ getTeamList ~ error:', error)
}
}
// //
onShow(async () => { onShow(async () => {
userInfo.value = memberStore.userInfo || {} userInfo.value = memberStore.userInfo || {}
// console.log('🚀 ~ onShow ~ userInfo.value:', userInfo.value)
getToolsLedgerDetailsList() getToolsLedgerDetailsList()
await Promise.all([getUserInfoByUserName(), projectInfoList()]) await Promise.all([getUserInfoByUserName(), projectInfoList()])
getUserInfoByIdCard() getUserInfoByIdCard()
getTeamList()
}) })
</script> </script>

View File

@ -98,7 +98,8 @@ const back = () => {
// //
const getTeamList = async () => { const getTeamList = async () => {
try { try {
const res = await getBmTeamList({ isAll: 0 }) const idCard = uni.getStorageSync('idCard') || ''
const res = await getBmTeamList({ isAll: 0, idCard })
if (res.data.length > 0) { if (res.data.length > 0) {
teamList.value = res.data.map((item) => { teamList.value = res.data.map((item) => {
return { return {

View File

@ -118,7 +118,8 @@ onMounted(() => {
// //
const getTeamList = async () => { const getTeamList = async () => {
try { try {
const res = await getBmTeamList({ isAll: 0 }) const idCard = uni.getStorageSync('idCard') || ''
const res = await getBmTeamList({ isAll: 0, idCard })
if (res.data.length > 0) { if (res.data.length > 0) {
teamList.value = res.data.map((item) => { teamList.value = res.data.map((item) => {
return { return {