diff --git a/hb_client/.env.production b/hb_client/.env.production index 484e806..d214255 100644 --- a/hb_client/.env.production +++ b/hb_client/.env.production @@ -3,4 +3,5 @@ ENV = 'production' # base api VUE_APP_BASE_API = 'http://47.95.0.242:2222/api' +#VUE_APP_BASE_API = 'http://127.0.0.1:8000/api' diff --git a/hb_client/src/App.vue b/hb_client/src/App.vue index b06679a..e50cc4e 100644 --- a/hb_client/src/App.vue +++ b/hb_client/src/App.vue @@ -14,9 +14,19 @@ export default { }, data(){ return{ - isRouterAlive:true + isRouterAlive:true, + timer:null } }, + mounted(){ + // this.$store.dispatch("user/getCount", {}) + this.timer = window.setInterval(() => { + setTimeout(() => { + this.$store.dispatch("user/getCount", {}) + },0) + },30000) + + }, methods:{ reload(){ this.isRouterAlive=false; @@ -24,6 +34,9 @@ export default { this.isRouterAlive=true; }) }, + }, + destroyed() { + clearInterval(this.timer) } } @@ -36,4 +49,9 @@ export default { .el-step__title.is-process{ color: #409EFF; } + .navbarBadge .el-badge__content.is-fixed{ + top: 15px; + right: 18px; + } + diff --git a/hb_client/src/api/testModel.js b/hb_client/src/api/testModel.js index fc6204e..3cbdb33 100644 --- a/hb_client/src/api/testModel.js +++ b/hb_client/src/api/testModel.js @@ -1,7 +1,7 @@ import request from '@/utils/request' export function faceLogin(data) { return request({ - url: '/system/facelogin/', + url: '/hrm/facelogin/', method: 'post', data }) diff --git a/hb_client/src/api/workflow.js b/hb_client/src/api/workflow.js index 137b132..001df7e 100644 --- a/hb_client/src/api/workflow.js +++ b/hb_client/src/api/workflow.js @@ -163,13 +163,45 @@ export function ticketAccpet(id,data) { }) } //撤回工单,允许创建人在指定状态撤回工单至初始状态 -export function getTicketRetreat(id,data) { +export function ticketRetreat(id,data) { return request({ url: `/wf/ticket/${id}/retreat/`, method: 'post', data }) } +//关闭工单,仅允许创建人在初始状态关闭工单 +export function ticketAddNode(id,data) { + return request({ + url: `/wf/ticket/${id}/add_node/`, + method: 'post', + data + }) +} +//加签 +export function ticketClose(id,data) { + return request({ + url: `/wf/ticket/${id}/close/`, + method: 'post', + data + }) +} +//加签 +export function ticketAddNodeEnd(id,data) { + return request({ + url: `/wf/ticket/${id}/add_node_end/`, + method: 'post', + data + }) +} +//工单删除 +export function ticketDestory(data) { + return request({ + url: `/wf/ticket/destory/`, + method: 'post', + data + }) +} //工单详情 export function getTicketDetail(id) { return request({ @@ -193,3 +225,18 @@ export function getTicketFlowlog(id) { method: 'get' }) } +//工单代办数量 +export function getCount(data) { + return request({ + url: `/wf/ticket/duty_agg/`, + method: 'get', + params:data + }) +} +//工单代办数量 +export function getCodes() { + return request({ + url: `/wf/participant_from_code`, + method: 'get' + }) +} diff --git a/hb_client/src/layout/components/Navbar.vue b/hb_client/src/layout/components/Navbar.vue index 7cb30fd..1ba9bc9 100644 --- a/hb_client/src/layout/components/Navbar.vue +++ b/hb_client/src/layout/components/Navbar.vue @@ -6,6 +6,9 @@
@@ -15,6 +24,7 @@ @@ -92,4 +114,35 @@ export default { .mobile .fixed-header { width: 100%; } + .floatDiv{ + position: fixed; + z-index: 3000; + bottom: 10vh; + right: 5vh; + width: 50px; + height: 50px; + cursor: pointer; + text-align: center; + line-height: 50px; + border-radius: 26px; + border: 2px solid #409EFF; + } + .typeWrap{ + display: none; + background: #ffffff; + padding: 10px; + box-shadow: 0 0 7px 2px #d3dce6; + position: absolute; + right: 60px; + bottom: 0; + } + .floatDiv:hover>.typeWrap{ + display: block; + } + .detailItem{ + height: 30px; + color: #888888; + line-height: 30px; + width: max-content; + } diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 0cd776d..e7da4f0 100644 --- a/hb_client/src/router/index.js +++ b/hb_client/src/router/index.js @@ -86,13 +86,13 @@ export const asyncRoutes = [ component: Layout, redirect: '/mtm/material/', name: 'mtm', - meta: { title: '制造管理', icon: 'example', perms: ['procurement_set'] }, + meta: { title: '制造管理', icon: 'example', perms: ['mtm_manage'] }, children: [ { path: 'material', name: 'material', component: () => import('@/views/mtm/material'), - meta: { title: '物料清单', icon: 'example', perms: ['vendor_manage'] } + meta: { title: '物料清单', icon: 'example', perms: ['mtm_material'] } } , { @@ -106,7 +106,7 @@ export const asyncRoutes = [ path: 'process', name: 'process', component: () => import('@/views/mtm/process'), - meta: { title: '工序管理', icon: 'example', perms: ['vendor_manage'] } + meta: { title: '工序管理', icon: 'example', perms: ['mtm_process'] } }, { path: 'step/:id', @@ -127,7 +127,7 @@ export const asyncRoutes = [ path: '/mtm/productprocess/', name: 'productprocess', component: () => import('@/views/mtm/productprocess'), - meta: { title: '产品管理', icon: 'example', perms: ['vendor_manage'] } + meta: { title: '产品管理', icon: 'example', perms: ['mtm_productprocess'] } }, ] } @@ -137,7 +137,7 @@ export const asyncRoutes = [ component: Layout, redirect: '/pm/plan', name: 'pm', - meta: { title: '生产管理', icon: 'example', perms: ['equipment_set'] }, + meta: { title: '生产管理', icon: 'example', perms: ['pm_manage'] }, children: [ { path: 'plan', @@ -157,13 +157,13 @@ export const asyncRoutes = [ path: 'resources', name: 'resources', component: () => import('@/views/pm/resources'), - meta: { title: '生产资源配置', icon: 'example', perms: ['index_manage'] } + meta: { title: '生产资源配置', icon: 'example', perms: ['pm_resources'] } }, { path: 'testitem', name: 'testitem', component: () => import('@/views/pm/plan'), - meta: { title: '生产作业管理', icon: 'example', perms: ['index_manage'] } + meta: { title: '生产作业管理', icon: 'example', perms: ['pm_testitem'] } } ] } @@ -194,31 +194,31 @@ export const asyncRoutes = [ component: Layout, redirect: '/em/equipment', name: 'em', - meta: { title: '设备管理', icon: 'example', perms: ['equipment_set'] }, + meta: { title: '设备管理', icon: 'example', perms: ['em_manage'] }, children: [ { path: 'equipment', name: 'equipment', component: () => import('@/views/em/equipment'), - meta: { title: '生产设备', icon: 'example', perms: ['index_manage'] } + meta: { title: '生产设备', icon: 'example', perms: ['em_equipment'] } }, { path: 'detection ', name: 'detection ', component: () => import('@/views/em/detection'), - meta: { title: '监视和测量设备', icon: 'example', perms: ['index_manage'] } + meta: { title: '监视和测量设备', icon: 'example', perms: ['em_detection'] } }, { path: 'record', name: 'record', component: () => import('@/views/em/record'), - meta: { title: '校准检定记录', icon: 'example', perms: ['index_manage'] } + meta: { title: '校准检定记录', icon: 'example', perms: ['em_record'] } }, { path: 'detection ', name: 'detection ', component: () => import('@/views/em/detection'), - meta: { title: '运维记录', icon: 'example', perms: ['index_manage'] } + meta: { title: '运维记录', icon: 'example', perms: ['em_detection'] } } ] }, @@ -349,32 +349,39 @@ export const asyncRoutes = [ component: Layout, redirect: '/workflow/index', name: 'workflow', - meta: { title: '工作流', icon: 'example', perms: ['workflow_set'] }, + meta: { title: '工作流', icon: 'example', perms: ['workflow_manage'] }, children: [ { path: 'index', name: 'index', component: () => import('@/views/workflow/index'), - meta: { title: '工作流配置', icon: 'example', perms: ['workflow_manage'] } + meta: { title: '工作流配置', icon: 'example', perms: ['workflow_index'] } }, { path: 'ticket', name: 'ticket', component: () => import('@/views/workflow/ticket'), - meta: { title: '工单管理', icon: 'example', perms: ['workflow_manage'] }, + meta: { title: '工单管理', icon: 'example' ,noCache: true, perms: ['workflow_ticket'] }, + }, + { + path: 'workFlowTickets', + name: 'workFlowTickets', + component: () => import('@/views/workflow/workFlowTickets'), + meta: { title: '工单管理', icon: 'example' ,noCache: true,}, + hidden: true }, { path: 'configuration', name: 'configuration', component: () => import('@/views/workflow/configuration'), - meta: { title: '人员信息详情', icon: 'example', perms: ['workflow_manage'] }, + meta: { title: '人员信息详情', icon: 'example' }, hidden: true }, { path: 'ticketHandle', name: 'ticketHandle', component: () => import('@/views/workflow/ticketHandle'), - meta: { title: '工单处理', icon: 'example', perms: ['workflow_manage'] }, + meta: { title: '工单处理', icon: 'example',noCache: true,}, hidden: true }, ] diff --git a/hb_client/src/store/getters.js b/hb_client/src/store/getters.js index 566e457..3ff47b0 100644 --- a/hb_client/src/store/getters.js +++ b/hb_client/src/store/getters.js @@ -5,6 +5,7 @@ const getters = { avatar: state => state.user.avatar, name: state => state.user.name, perms: state => state.user.perms, + count: state => state.user.count, size: state => state.app.size, permission_routes: state => state.permission.routes, visitedViews: state => state.tagsView.visitedViews, diff --git a/hb_client/src/store/modules/user.js b/hb_client/src/store/modules/user.js index 0f1d024..c8c3190 100644 --- a/hb_client/src/store/modules/user.js +++ b/hb_client/src/store/modules/user.js @@ -1,4 +1,5 @@ import { login, logout, getInfo } from '@/api/user' +import { getCount } from '@/api/workflow' import { getToken, setToken, removeToken } from '@/utils/auth' import { resetRouter } from '@/router' @@ -7,6 +8,7 @@ const getDefaultState = () => { token: getToken(), name: '', avatar: '', + count: {}, perms: [] } } @@ -28,6 +30,9 @@ const mutations = { }, SET_PERMS: (state, perms) => { state.perms = perms + }, + SET_COUNT: (state, count) => { + state.count = count } } @@ -90,15 +95,27 @@ const actions = { }, // remove token - resetToken({ commit }) { + resetToken({ commit },data) { return new Promise(resolve => { - removeToken() // must remove token first - commit('RESET_STATE') + removeToken(); // must remove token first + commit('RESET_STATE'); + commit('SET_TOKEN', data.access); + setToken(data.access); resolve() }) }, setSize({ commit }, size) { commit('SET_SIZE', size) + }, + getCount({ commit }) { + return new Promise((resolve, reject) => { + getCount({}).then((res) => { + commit('SET_COUNT', res.data); + resolve() + }).catch(error => { + reject(error) + }) + }) } } diff --git a/hb_client/src/styles/index.scss b/hb_client/src/styles/index.scss index 059de63..d80b15e 100644 --- a/hb_client/src/styles/index.scss +++ b/hb_client/src/styles/index.scss @@ -86,21 +86,21 @@ div:focus { .el-dialog__header { padding: 10px 10px 6px; } -// .el-dialog{ -// display: flex; -// flex-direction: column; -// margin:0 !important; -// position:absolute; -// top:50%; -// left:50%; -// transform:translate(-50%,-50%); -// /*height:600px;*/ -// max-height:calc(100% - 30px); -// max-width:calc(100% - 30px); -// } + .el-dialog{ + display: flex; + flex-direction: column; + margin:0 !important; + position:absolute; + top:50%; + left:50%; + transform:translate(-50%,-50%); + /*height:600px;*/ + max-height:calc(100% - 30px); + max-width:calc(100% - 30px); + } .el-dialog .el-dialog__body{ - // flex:1; - // overflow: auto; + flex:1; + overflow: auto; padding: 8px 12px; } diff --git a/hb_client/src/views/dashboard/index.vue b/hb_client/src/views/dashboard/index.vue index bfd075e..5dc8de5 100644 --- a/hb_client/src/views/dashboard/index.vue +++ b/hb_client/src/views/dashboard/index.vue @@ -1,5 +1,9 @@