This commit is contained in:
xielue 2023-08-31 23:01:06 +08:00
parent 3fa4e6e86c
commit 9f0800c1e4
7 changed files with 66 additions and 20 deletions

View File

@ -48,6 +48,34 @@ export default {
return USER_MODEL == "AdminUser"; 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' }) { afterLoginSuccess({ closeOthers, token, access_expire, uid, msg = '登录成功', pushTo = '/dashboard/workplace' }) {
setAuthorization({ token: token, expireAt: new Date(access_expire * 1000) }) // token setAuthorization({ token: token, expireAt: new Date(access_expire * 1000) }) // token

View File

@ -25,16 +25,19 @@
<h4>工艺布产工序</h4> <h4>工艺布产工序</h4>
<div v-for="item in detailsData" :key="item"> <div v-for="item in detailsData" :key="item.id">
<div class="gx-item"> <div class="gx-item">
<div class="gx-item-col"> <div class="gx-item-col">
<div>{{ item.moldname }}</div> <div>部件{{ item.component_detail ? item.component_detail.name : '' }}</div>
<div>{{ item.name }}</div> <div>工序{{ item.process_detail ? item.process_detail.name : '' }}</div>
<div>状态{{ item.is_complete ? "已完成" : (item.is_send ? "已发料" :"未发料") }}</div>
</div> </div>
<div class="gx-item-col"> <div class="gx-item-col">
<a-button type="primary" @click="pageSend(item)" v-if="item.is_send !== 1">发料</a-button> <a-button type="primary" @click="pageSend(item)" v-if="item.is_send !== 1">发料</a-button>
<a-button type="primary" @click="pageReport(item)" v-if="item.is_send === 1">报工</a-button>
<a-button type="primary" @click="pageReport(item)" v-if="item.is_send && item.is_complete !== 1">报工</a-button>
</div> </div>
</div> </div>
</div> </div>
@ -100,7 +103,7 @@ export default {
// //
isEdit: false, isEdit: false,
detailsData: [{moldname:'模具1' ,name: '工序1' }, { moldname:'模具2' ,name: '工序2' }], detailsData: [],
formOptions2: { formOptions2: {
data: { data: {
@ -221,7 +224,8 @@ export default {
], ],
tableDataStaff: [], tableDataStaff: [],
tableDataProcesses: [], tableDataProcesses: [],
tableDataOrders: [] tableDataOrders: [],
allDetailsData: []
}; };
@ -299,8 +303,9 @@ export default {
useBigInt: true, useBigInt: true,
}).then(a => { }).then(a => {
this.loading = false 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) => { }).catch((a) => {
this.loading = false this.loading = false
this.$mk.error(a.data.msg); this.$mk.error(a.data.msg);
@ -434,7 +439,14 @@ export default {
this.formOptions2.data = data2 this.formOptions2.data = data2
this.formOptions3.data = data3 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 }) { cellClickEventStaff({ row }) {
this.selectStaff({ data: row }) this.selectStaff({ data: row })
@ -453,7 +465,7 @@ export default {
"store_id": 0, "store_id": 0,
"beid": parseInt(process.env.VUE_APP_BEID), "beid": parseInt(process.env.VUE_APP_BEID),
"company_token": process.env.VUE_APP_COMPANYTOKEN, "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) "company_id": parseInt(process.env.VUE_APP_COMPANY_ID)
}, },
useBigInt: true, useBigInt: true,
@ -461,7 +473,7 @@ export default {
console.log(a) console.log(a)
if (a.code == 200) { if (a.code == 200) {
this.$mk.success("报工成功"); this.$mk.success("报工成功");
item.is_send = 1; item.is_complete = 1;
} else { } else {
@ -472,7 +484,7 @@ export default {
}, },
pageSend(item) { pageSend(item) {
console.log(item)
this.$mk.post({ this.$mk.post({
url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/sendMaterial`, url: `${BASE_URL.BASE_URL}/MoldProductionOrder/Get/TouchScreen/v1/mold/production/order/touchScreen/sendMaterial`,
loading: "发料中...", loading: "发料中...",
@ -482,7 +494,7 @@ export default {
"store_id": 0, "store_id": 0,
"beid": parseInt(process.env.VUE_APP_BEID), "beid": parseInt(process.env.VUE_APP_BEID),
"company_token": process.env.VUE_APP_COMPANYTOKEN, "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) "company_id": parseInt(process.env.VUE_APP_COMPANY_ID)
}, },
useBigInt: true, useBigInt: true,

View File

@ -147,7 +147,10 @@ export default {
this.form.setFieldsValue({ this.form.setFieldsValue({
name: this.user.mobile, name: this.user.mobile,
password: this.user.password password: this.user.password
}) });
this.$refs.loginActions.initRoutes({ });
}, 1000) }, 1000)
}) // loadshpick }) // loadshpick

View File

@ -141,7 +141,7 @@ const view = {
TouchMoldHome : { TouchMoldHome : {
name: '触摸屏首页', name: '触摸屏首页',
path: '/touch/moldhome', path: '/touch/moldhome',
component: () => import('@/pages/Middle/Mold/Touch/index') component: () => import('@/pages/Middle/Mold/Touch/Reporting')
}, },
TouchMoldReporting : { TouchMoldReporting : {
name: '报工', name: '报工',

View File

@ -27,9 +27,8 @@ if (Authorization != null) {
store.commit('account/setPermissions', Permission) // 将权限信息存入vuex store.commit('account/setPermissions', Permission) // 将权限信息存入vuex
} }
}) })
getRoutesConfig().then(result => { // 获取路由配置 getRoutesConfig().then(result => { // 获取路由配置
// console.log("=================result:"+result) console.log("=================result:"+result)
if (result.data.data != null) { if (result.data.data != null) {
const routesConfig = result.data.data; const routesConfig = result.data.data;
console.log(routesConfig) console.log(routesConfig)
@ -98,7 +97,7 @@ Vue.use(Router)
// 不需要登录拦截的路由配置 // 不需要登录拦截的路由配置
const loginIgnore = { // 登录白名单 const loginIgnore = { // 登录白名单
names: ['404', '403'], //根据路由名称匹配 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 对象 * @param route vue-router route 对象

View File

@ -166,6 +166,8 @@ console.log(mergeMenus)
* @param routesConfig {RouteConfig[]} 路由配置 * @param routesConfig {RouteConfig[]} 路由配置
*/ */
function loadRoutes(routesConfig) { // 加载路由 function loadRoutes(routesConfig) { // 加载路由
// 应用配置 // 应用配置
const { router, store, i18n } = appOptions const { router, store, i18n } = appOptions
@ -223,6 +225,8 @@ function loadRoutes(routesConfig) { // 加载路由
formatRoutes(finalRoutes) formatRoutes(finalRoutes)
router.options = { ...router.options, routes: finalRoutes } // 路由配置 router.options = { ...router.options, routes: finalRoutes } // 路由配置
router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由 router.matcher = new Router({ ...router.options, routes: [] }).matcher // 重置路由
router.addRoutes(finalRoutes) // 添加路由 router.addRoutes(finalRoutes) // 添加路由