From 22b52686bc61b956d3f55640bc4ffb4833ad377e Mon Sep 17 00:00:00 2001 From: shijing Date: Fri, 15 Oct 2021 16:03:50 +0800 Subject: [PATCH] ticketdelete --- hb_client/src/api/workflow.js | 34 +- hb_client/src/router/index.js | 43 +- hb_client/src/styles/index.scss | 28 +- hb_client/src/views/login/index.vue | 5 +- hb_client/src/views/workflow/index.vue | 52 +- hb_client/src/views/workflow/state.vue | 554 +++++++++--------- hb_client/src/views/workflow/ticket.vue | 228 +++++-- hb_client/src/views/workflow/ticketHandle.vue | 206 ++++++- .../src/views/workflow/workFlowTickets.vue | 197 +++++++ 9 files changed, 933 insertions(+), 414 deletions(-) create mode 100644 hb_client/src/views/workflow/workFlowTickets.vue diff --git a/hb_client/src/api/workflow.js b/hb_client/src/api/workflow.js index 137b132..069f700 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({ diff --git a/hb_client/src/router/index.js b/hb_client/src/router/index.js index 4b8ad23..c021e2c 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,25 +137,25 @@ 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', name: 'plan', component: () => import('@/views/pm/plan'), - meta: { title: '生产计划管理', icon: 'example', perms: ['index_manage'] } + meta: { title: '生产计划管理', icon: 'example', perms: ['pm_plan'] } }, { 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'] } } ] }, @@ -164,31 +164,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'] } } ] }, @@ -319,32 +319,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/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/login/index.vue b/hb_client/src/views/login/index.vue index f9ad27a..07fd8f8 100644 --- a/hb_client/src/views/login/index.vue +++ b/hb_client/src/views/login/index.vue @@ -37,6 +37,7 @@ name="password" tabindex="2" auto-complete="on" + id="passwordInput" @keyup.enter.native="handleLogin" >创建时间 :{{watchedCreateTime}}

- + @@ -278,7 +278,7 @@ export default { }); }, handleTicket(scope){ - this.$router.push({name:"ticket",params:{workflow:scope.row.id}}) + this.$router.push({name:"workFlowTickets",params:{workflow:scope.row.id}}) }, async confirm(form) { debugger; @@ -321,12 +321,12 @@ export default { that.limitedWatch = true; that.$nextTick(()=>{ var g = new dagreD3.graphlib.Graph().setGraph({ - align: 'DL', + rankdir: 'DL', nodesep: 100, - edgesep: 100, - ranksep: 50, - marginx: 0, - marginy: 50, + edgesep: 10,//两条线之间的距离 + ranksep: 50,//节点之间的距离 + marginx: 160, + marginy: 20, }); //获取state得到节点 getWfStateList(workFlow).then((response) => { @@ -343,8 +343,6 @@ export default { //节点样式 style: "fill:#fff;stroke:#000", labelStyle: "fill:#000;", - // width: 83, - // height: 40, rx :5,//矩形节点圆角度 ry :5 }); @@ -356,9 +354,8 @@ export default { getWfTransitionList(workFlow).then((res)=>{ if(res.data){ let transitionList = res.data; - transitionList.forEach((transitions)=>{ - let transition0 = transitions; - if (transition0.condition_expression.length>3){ + transitionList.forEach((transition0)=>{ + if (transition0.condition_expression.length>0){ debugger; g.setNode(transition0.source_state_.id+100000, {label: "条件表达式",style: "stroke: #000;fill: #afa", shape: "diamond"}); g.setEdge(transition0.source_state_.id, transition0.source_state_.id+100000, { @@ -366,7 +363,7 @@ export default { label: transition0.name, style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" }); - let condition_expression = JSON.parse(transition0.condition_expression); + let condition_expression = transition0.condition_expression; condition_expression.forEach(condition_expression0=>{ g.setEdge(transition0.source_state_.id+100000, condition_expression0.target_state, { label: condition_expression0.label, @@ -386,7 +383,6 @@ export default { g.nodes().forEach(function (v) { console.log("Node " + v + ": " + JSON.stringify(g.node(v))); }); - // 创建渲染器 let render = new dagreD3.render(); // 选择 svg 并添加一个g元素作为绘图容器. @@ -399,6 +395,7 @@ export default { } }); + }) }, closeMark(){ @@ -415,33 +412,25 @@ export default { this.hasJsonFlag = true }, onError(value) { - // console.log("json错误了value:", value); this.hasJsonFlag = false }, onJsonChange1 (value) { - // console.log('更改value:', value); // 实时保存 this.onJsonSave1(value) }, onJsonSave1 (value) { - // console.log('保存value:', value); this.display_form_str = value this.hasJsonFlag1 = true }, onError1(value) { - // console.log("json错误了value:", value); this.hasJsonFlag1 = false }, // 检查json checkJson(){ if (this.hasJsonFlag == false){ - // console.log("json验证失败") - // this.$message.error("json验证失败") alert("限制表达式json验证失败") return false } else { - // console.log("json验证成功") - // this.$message.success("json验证成功") alert("限制表达式json验证成功") return true } @@ -449,13 +438,9 @@ export default { // 检查json checkJson2(){ if (this.hasJsonFlag1 == false){ - // console.log("json验证失败") - // this.$message.error("json验证失败") alert("展现表单字段json验证失败") return false } else { - // console.log("json验证成功") - // this.$message.success("json验证成功") alert("展现表单字段json1验证成功") return true } @@ -464,6 +449,19 @@ export default { };
- -
- 新增 -
+
+ 新增 + +
- - + + - - diff --git a/hb_client/src/views/workflow/ticket.vue b/hb_client/src/views/workflow/ticket.vue index f3e13ea..c482c7f 100644 --- a/hb_client/src/views/workflow/ticket.vue +++ b/hb_client/src/views/workflow/ticket.vue @@ -61,10 +61,13 @@ @@ -107,7 +110,12 @@ @@ -150,10 +158,11 @@ @@ -197,7 +206,7 @@ @@ -224,25 +233,27 @@ - - +
+ + +
+
- + - - - - - + + + +
- 取消 - 确定 + 取消 + 确定
@@ -337,13 +348,49 @@ 确认 + + + + + + + + + + + + + + + + + +