This commit is contained in:
2025-08-28 15:35:19 +08:00
parent 72a8665906
commit 53d5f677c4
5 changed files with 68 additions and 8 deletions

View File

@ -6,7 +6,7 @@ VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
# 李陈杰 209 # 李陈杰 209
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.180:8899'
# 罗成 # 罗成

View File

@ -4,6 +4,7 @@
<el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path"> <el-menu-item v-if="index < visibleNumber" :key="index" :style="{ '--theme': theme }" :index="item.path">
<svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" /> <svg-icon v-if="item.meta && item.meta.icon && item.meta.icon !== '#'" :icon-class="item.meta ? item.meta.icon : ''" />
{{ item.meta?.title }} {{ item.meta?.title }}
<!-- <span class="bage" v-if="item.meta?.title == '我的任务' && total > 0">{{ total }}</span> -->
</el-menu-item> </el-menu-item>
</template> </template>
@ -26,20 +27,27 @@ import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings'; import useSettingsStore from '@/store/modules/settings';
import usePermissionStore from '@/store/modules/permission'; import usePermissionStore from '@/store/modules/permission';
import { RouteRecordRaw } from 'vue-router'; import { RouteRecordRaw } from 'vue-router';
import useUserStore from '@/store/modules/user';
import useNoticeStore from '@/store/modules/notice';
import { pageByTaskWait } from '@/api/workflow/task';
const userStore = useUserStore();
const noticeStore = storeToRefs(useNoticeStore());
// 顶部栏初始数 // 顶部栏初始数
const visibleNumber = ref<number>(-1); const visibleNumber = ref<number>(-1);
// 当前激活菜单的 index // 当前激活菜单的 index
const currentIndex = ref<string>(); const currentIndex = ref<string>();
// 隐藏侧边栏路由 // 隐藏侧边栏路由
const hideList = ['/index', '/user/profile']; const hideList = ['/index', '/user/profile'];
const total = ref(1);
const appStore = useAppStore(); const appStore = useAppStore();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const permissionStore = usePermissionStore(); const permissionStore = usePermissionStore();
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
onMounted(() => {
console.log(33333);
getWaitingList();
});
// 主题颜色 // 主题颜色
const theme = computed(() => settingsStore.theme); const theme = computed(() => settingsStore.theme);
// 所有的路由信息 // 所有的路由信息
@ -158,6 +166,26 @@ onBeforeUnmount(() => {
onMounted(() => { onMounted(() => {
setVisibleNumber(); setVisibleNumber();
}); });
// 获取我的待办
//分页
const getWaitingList = () => {
pageByTaskWait({ pageNum: 1, pageSize: 10 }).then((resp) => {
console.log(resp);
total.value = resp.total;
});
};
//用深度监听 消息
watch(
() => noticeStore.state.value.notices,
(newVal) => {
let time = setTimeout(() => {
getWaitingList();
clearTimeout(time);
}, 500);
},
{ deep: true }
);
</script> </script>
<style lang="scss"> <style lang="scss">
@ -197,4 +225,31 @@ onMounted(() => {
.topmenu-container .svg-icon { .topmenu-container .svg-icon {
margin-right: 4px; margin-right: 4px;
} }
.bage {
position: absolute;
top: 6px;
right: -12px;
padding: 0 6px;
height: 16px;
line-height: 16px;
background: #ff7a7a;
border-radius: 8px;
font-size: 12px;
color: #fff;
white-space: nowrap;
box-sizing: border-box;
}
.el-menu-item .el-menu-item__content {
position: relative;
padding-right: 24px;
}
.menu-title {
display: inline-block;
max-width: calc(100% - 24px);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style> </style>

View File

@ -57,7 +57,9 @@ const props = defineProps({
}); });
const total = ref(0); const total = ref(0);
onMounted(() => { onMounted(() => {
if (onlyOneChild.value.meta?.title == '我的待办') { if (onlyOneChild.value.meta?.title == '我的待办' || props.item.meta?.title == '我的任务') {
console.log(44444444);
getWaitingList(); getWaitingList();
} }
}); });
@ -123,7 +125,8 @@ watch(
() => noticeStore.state.value.notices, () => noticeStore.state.value.notices,
(newVal) => { (newVal) => {
if (onlyOneChild.value.meta?.title == '我的待办') { if (onlyOneChild.value.meta?.title == '我的待办') {
// 延迟1秒 console.log(121212121);
let time = setTimeout(() => { let time = setTimeout(() => {
getWaitingList(); getWaitingList();
clearTimeout(time); clearTimeout(time);

View File

@ -45,7 +45,6 @@ router.beforeEach(async (to, from, next) => {
accessRoutes.forEach((route) => { accessRoutes.forEach((route) => {
if (!isHttp(route.path)) { if (!isHttp(route.path)) {
router.addRoute(route); // 动态添加可访问路由表 router.addRoute(route); // 动态添加可访问路由表
console.log('🚀 ~ route:', route);
} }
}); });
$cache.local.remove('isCheckRole'); $cache.local.remove('isCheckRole');

View File

@ -136,7 +136,9 @@
<!-- 物资名称列 --> <!-- 物资名称列 -->
<el-table-column prop="name" align="center" label="物资名称" width="160"> <el-table-column prop="name" align="center" label="物资名称" width="160">
<template #default="scope"> <template #default="scope">
<el-input v-model="scope.row.name" v-if="scope.row.mrpBaseId" placeholder="请输入物资名称" disabled />
<el-select <el-select
v-else
:disabled="!scope.row.batchNumber" :disabled="!scope.row.batchNumber"
v-model="scope.row.suppliespriceId" v-model="scope.row.suppliespriceId"
placeholder="请选择" placeholder="请选择"
@ -594,7 +596,8 @@ const handleUpdata = () => {
qs: item.qs, qs: item.qs,
arrivalTime: item.arrivalTime, arrivalTime: item.arrivalTime,
remark: item.remark, remark: item.remark,
Remaining: item.Remaining || 0, Remaining: Number(item.remaining) || 0,
// remaining:
quantityError: '', quantityError: '',
batchNumber: item.batchNumber, batchNumber: item.batchNumber,
duplicateError: '', duplicateError: '',