From 9f0800c1e478faf073828ef7fd21867706129b05 Mon Sep 17 00:00:00 2001 From: xielue Date: Thu, 31 Aug 2023 23:01:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/login/loginActions.vue | 28 ++++++++++++++++++ src/pages/Middle/Mold/Touch/Reporting.vue | 36 +++++++++++++++-------- src/pages/login/Login.vue | 5 +++- src/router/async/base.map.js | 4 +-- src/router/async/config.async.js | 2 +- src/router/index.js | 7 ++--- src/utils/routerUtil.js | 4 +++ 7 files changed, 66 insertions(+), 20 deletions(-) diff --git a/src/components/login/loginActions.vue b/src/components/login/loginActions.vue index 8f1f461..8ef0eee 100644 --- a/src/components/login/loginActions.vue +++ b/src/components/login/loginActions.vue @@ -48,6 +48,34 @@ export default { return USER_MODEL == "AdminUser"; }, + initRoutes() { + + let routesConfig = { }; + + if(process.env.VUE_APP_BEID == 1){ + routesConfig = { + router: "touch", + children:[ + {router:'TouchMesReporting'} + ] + }; + + } + else if(process.env.VUE_APP_BEID == 5){ + routesConfig= { + router: "touch", + children:[ + {router:'TouchMoldHome'}, + {router:'TouchMoldReporting'}, + {router:'TouchMoldSend'}, + ] + }; + } + + this.setRoutesConfig(routesConfig) + loadRoutes([routesConfig]) + }, + afterLoginSuccess({ closeOthers, token, access_expire, uid, msg = '登录成功', pushTo = '/dashboard/workplace' }) { setAuthorization({ token: token, expireAt: new Date(access_expire * 1000) }) // 设置token diff --git a/src/pages/Middle/Mold/Touch/Reporting.vue b/src/pages/Middle/Mold/Touch/Reporting.vue index 184763c..cce73a4 100644 --- a/src/pages/Middle/Mold/Touch/Reporting.vue +++ b/src/pages/Middle/Mold/Touch/Reporting.vue @@ -25,16 +25,19 @@

工艺布产工序

-
+
-
{{ item.moldname }}
-
{{ item.name }}
+
部件:{{ item.component_detail ? item.component_detail.name : '' }}
+
工序:{{ item.process_detail ? item.process_detail.name : '' }}
+ +
状态:{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" :"未发料") }}
发料 - 报工 + + 报工
@@ -100,7 +103,7 @@ export default { // 是否编辑模式 isEdit: false, - detailsData: [{moldname:'模具1' ,name: '工序1' }, { moldname:'模具2' ,name: '工序2' }], + detailsData: [], formOptions2: { data: { @@ -221,7 +224,8 @@ export default { ], tableDataStaff: [], tableDataProcesses: [], - tableDataOrders: [] + tableDataOrders: [], + allDetailsData: [] }; @@ -299,8 +303,9 @@ export default { useBigInt: true, }).then(a => { this.loading = false - this.tableDataOrders = a.data.mold_production_order || []; + this.tableDataOrders =JSON.parse(JSON.stringify( a.data.mold_production_order || [])); + this.allDetailsData = JSON.parse(JSON.stringify(a.data.mold_production_order_component_processes || [])); }).catch((a) => { this.loading = false this.$mk.error(a.data.msg); @@ -434,7 +439,14 @@ export default { this.formOptions2.data = data2 this.formOptions3.data = data3 - this.detailsData = row.mold_production_order_component_processes; + let ds = []; + this.allDetailsData.forEach(item => { + if ((item.production_id + '') == (row.id + '')) { + ds.push(item); + } + }) + console.log(ds) + this.detailsData = ds; }, cellClickEventStaff({ row }) { this.selectStaff({ data: row }) @@ -453,7 +465,7 @@ export default { "store_id": 0, "beid": parseInt(process.env.VUE_APP_BEID), "company_token": process.env.VUE_APP_COMPANYTOKEN, - "id": item.id, + "id": this.$mk.toBigInt(item.id), "company_id": parseInt(process.env.VUE_APP_COMPANY_ID) }, useBigInt: true, @@ -461,7 +473,7 @@ export default { console.log(a) if (a.code == 200) { this.$mk.success("报工成功"); - item.is_send = 1; + item.is_complete = 1; } else { @@ -472,7 +484,7 @@ export default { }, pageSend(item) { - + console.log(item) this.$mk.post({ url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/sendMaterial`, loading: "发料中...", @@ -482,7 +494,7 @@ export default { "store_id": 0, "beid": parseInt(process.env.VUE_APP_BEID), "company_token": process.env.VUE_APP_COMPANYTOKEN, - "id": item.id, + "id": this.$mk.toBigInt(item.id), "company_id": parseInt(process.env.VUE_APP_COMPANY_ID) }, useBigInt: true, diff --git a/src/pages/login/Login.vue b/src/pages/login/Login.vue index 2d00609..cde71d3 100644 --- a/src/pages/login/Login.vue +++ b/src/pages/login/Login.vue @@ -147,7 +147,10 @@ export default { this.form.setFieldsValue({ name: this.user.mobile, password: this.user.password - }) + }); + + this.$refs.loginActions.initRoutes({ }); + }, 1000) }) // loadsh的pick方法 diff --git a/src/router/async/base.map.js b/src/router/async/base.map.js index 8f2ce01..b1bd72b 100644 --- a/src/router/async/base.map.js +++ b/src/router/async/base.map.js @@ -141,8 +141,8 @@ const view = { TouchMoldHome : { name: '触摸屏首页', path: '/touch/moldhome', - component: () => import('@/pages/Middle/Mold/Touch/index') - }, + component: () => import('@/pages/Middle/Mold/Touch/Reporting') + }, TouchMoldReporting : { name: '报工', path: '/touch/moldreporting', diff --git a/src/router/async/config.async.js b/src/router/async/config.async.js index a9fa65a..75f8018 100644 --- a/src/router/async/config.async.js +++ b/src/router/async/config.async.js @@ -4,7 +4,7 @@ import {parseRoutes} from '@/utils/routerUtil' // 异步路由配置 const routesConfig = [ 'login', - 'root', + 'root', { router: 'exp404', path: '*', diff --git a/src/router/index.js b/src/router/index.js index 494a82d..05fd161 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -26,10 +26,9 @@ if (Authorization != null) { const Permission = result.data.data.permission store.commit('account/setPermissions', Permission) // 将权限信息存入vuex } - }) - + }) getRoutesConfig().then(result => { // 获取路由配置 - // console.log("=================result:"+result) + console.log("=================result:"+result) if (result.data.data != null) { const routesConfig = result.data.data; console.log(routesConfig) @@ -98,7 +97,7 @@ Vue.use(Router) // 不需要登录拦截的路由配置 const loginIgnore = { // 登录白名单 names: ['404', '403'], //根据路由名称匹配 - paths: ['/login','/touch','/touch/index','/touch/mesreporting'], //根据路由fullPath匹配 + paths: ['/login','/touch','/touch/index','/touch/mesreporting','/touch/moldhome'], //根据路由fullPath匹配 /** * 判断路由是否包含在该配置中 * @param route vue-router 的 route 对象 diff --git a/src/utils/routerUtil.js b/src/utils/routerUtil.js index 2dd7b73..50da6f6 100644 --- a/src/utils/routerUtil.js +++ b/src/utils/routerUtil.js @@ -166,6 +166,8 @@ console.log(mergeMenus) * @param routesConfig {RouteConfig[]} 路由配置 */ function loadRoutes(routesConfig) { // 加载路由 + + // 应用配置 const { router, store, i18n } = appOptions @@ -223,6 +225,8 @@ function loadRoutes(routesConfig) { // 加载路由 formatRoutes(finalRoutes) router.options = { ...router.options, routes: finalRoutes } // 路由配置 router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由 + + router.addRoutes(finalRoutes) // 添加路由