This commit is contained in:
andy 2026-06-01 14:03:25 +08:00
parent 2caa3e0fa0
commit 0fcc849bce
4 changed files with 43 additions and 23 deletions

View File

@ -118,10 +118,16 @@ const routes: RouteRecordRaw[] = [
}, },
//运营管理 //运营管理
{ {
path: 'biz/product', path: 'biz/orderItem',
name: 'product', name: 'orderItem',
component: () => import('@/views/biz/product/index.vue'), component: () => import('@/views/biz/orderItem/index.vue'),
meta: { title: '商品管理', icon: 'ListOutline' } meta: { title: '生产订单', icon: 'ListOutline' }
},
{
path: 'biz/orderProcessPlan',
name: 'orderProcessPlan',
component: () => import('@/views/biz/orderProcessPlan/index.vue'),
meta: { title: '工序计划', icon: 'ListOutline' }
}, },
{ {
path: 'biz/user', path: 'biz/user',
@ -203,8 +209,14 @@ const routes: RouteRecordRaw[] = [
component: () => import('@/views/test/test/index.vue'), component: () => import('@/views/test/test/index.vue'),
meta: { title: '测试菜单', icon: 'StarOutline' } meta: { title: '测试菜单', icon: 'StarOutline' }
}, },
// 开发工具
{ {
path: 'biz/submitLog',
name: 'submitLog',
component: () => import('@/views/biz/submitLog/index.vue'),
meta: { title: '派工工单汇报记录', icon: 'ListOutline' }
},
{
// 开发工具
path: 'tool/gen', path: 'tool/gen',
name: 'ToolGen', name: 'ToolGen',
component: () => import('@/views/tool/gen/index.vue'), component: () => import('@/views/tool/gen/index.vue'),
@ -228,7 +240,7 @@ const routes: RouteRecordRaw[] = [
{ {
path: '/:pathMatch(.*)', path: '/:pathMatch(.*)',
component: () => import('@/views/error/404.vue'), component: () => import('@/views/error/404.vue'),
meta: { title: '404', requiresAuth: false } // meta: { title: '404', requiresAuth: false }
} }
] ]
@ -335,30 +347,35 @@ export function resetRouter() {
// 路由守卫 // 路由守卫
router.beforeEach(async (to, _from, next) => { router.beforeEach(async (to, _from, next) => {
console.log('路由测试');
const userStore = useUserStore() const userStore = useUserStore()
//document.title = `${to.meta.title || ''} - CSY Admin` //document.title = `${to.meta.title || ''} - CSY Admin`
if (to.meta.requiresAuth === false) {
if (!userStore.token) {
//next({ name: 'Login', query: { redirect: to.fullPath } })
next() next()
return return
} }
if (!userStore.token) {
next({ name: 'Login', query: { redirect: to.fullPath } })
return
}
if (userStore.init) { if (userStore.init) {
try { try {
await userStore.getInfo() await userStore.getInfo()
// 添加动态路由(只添加新的,不影响已有的) // 添加动态路由(只添加新的,不影响已有的)
addDynamicRoutes(userStore.menus) addDynamicRoutes(userStore.menus)
//userStore.setinit(false) userStore.setinit(false)
userStore.init = false // userStore.init = false
next({ ...to, replace: true }) next({ ...to, replace: true })
//return //return
} catch (error) { } catch (error) {
userStore.logout() userStore.logout()
userStore.init = false //userStore.init = false
//userStore.setinit(true) userStore.setinit(true)
next({ name: 'Login' }) next({ name: 'Login' })
//return //return
} }

View File

@ -119,7 +119,7 @@
<n-gi> <n-gi>
<n-form-item label="项目名称" path="projectName"> <n-form-item label="项目名称" path="projectName">
<n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目名称" /> <n-input v-if="formData.id" v-model:value="formData.projectName" disabled placeholder="请选择项目名称" />
<n-input v-else v-model:value="formData.projectName" placeholder="请选择产品名称" /> <n-input v-else v-model:value="formData.projectName" @input="gongxu" placeholder="请选择产品名称" />
</n-form-item> </n-form-item>
</n-gi> </n-gi>
<n-gi> <n-gi>
@ -664,7 +664,10 @@ let planList = ref<any>([])
function gongxu(){ function gongxu(){
if(formData.productionCode){ if(formData.productionCode){
planList.value.splice(0) planList.value.splice(0)
orderItemApi.preCreation({productionCode:formData.productionCode}).then((rps:any) => { orderItemApi.preCreation({
//productionCode:formData.productionCode
projectCode:formData.projectCode
}).then((rps:any) => {
planList.value = rps.planList?rps.planList:[] planList.value = rps.planList?rps.planList:[]
}) })
}else{ }else{

View File

@ -38,12 +38,12 @@
<template #icon><n-icon><AddOutline /></n-icon></template> <template #icon><n-icon><AddOutline /></n-icon></template>
新增 新增
</n-button> </n-button>
<n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete" size="small"> <!-- <n-button type="error" :disabled="selectedIds.length === 0" @click="handleBatchDelete" size="small">
<template #icon><n-icon><TrashOutline /></n-icon></template> <template #icon><n-icon><TrashOutline /></n-icon></template>
删除 删除
</n-button> </n-button> -->
</n-space> </n-space>
<n-button-group size="large"> <!-- <n-button-group size="large">
<n-button type="success" @click="importModalVisible = true" size="small"> <n-button type="success" @click="importModalVisible = true" size="small">
<template #icon><n-icon><CloudUploadOutline /></n-icon></template> <template #icon><n-icon><CloudUploadOutline /></n-icon></template>
导入 导入
@ -52,7 +52,7 @@
<template #icon><n-icon><DownloadOutline /></n-icon></template> <template #icon><n-icon><DownloadOutline /></n-icon></template>
导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }} 导出{{ selectedIds.length > 0 ? `(${selectedIds.length})` : '' }}
</n-button> </n-button>
</n-button-group> </n-button-group> -->
</div> </div>
<!-- 表格 --> <!-- 表格 -->

View File

@ -20,8 +20,8 @@ export default defineConfig({
port: 3000, port: 3000,
proxy: { proxy: {
'/api': { '/api': {
target:'http://192.168.6.107:8080', //'http://192.168.5.230:8888', //target:'http://192.168.6.107:8080', //'http://192.168.5.230:8888',
//target:'http://192.168.5.230:8888', target:'http://192.168.5.230:8888',
changeOrigin: true changeOrigin: true
}, },
'/druid': { '/druid': {