zuoyepiaoguanbi&role
This commit is contained in:
parent
117617a026
commit
8df5338155
|
|
@ -53,6 +53,7 @@
|
|||
show-checkbox
|
||||
:data="menu.list"
|
||||
:props="menu.props"
|
||||
check-strictly="true"
|
||||
:default-checked-keys="menu.checked"
|
||||
@check="handleChange"
|
||||
></el-tree>
|
||||
|
|
|
|||
|
|
@ -81,12 +81,13 @@
|
|||
},
|
||||
handleShow(row) {
|
||||
let cateType = row.workflow_.key;
|
||||
let projectId='';
|
||||
let projectId='',operation=null;
|
||||
if(cateType==='visit'){
|
||||
projectId = row.ticket_data.visit;
|
||||
}else if(cateType==='rparty'){
|
||||
projectId = row.ticket_data.rpj;
|
||||
}else{
|
||||
operation = row.ticket_data.operation?row.ticket_data.operation:null;
|
||||
projectId = row.ticket_data.opl;
|
||||
}
|
||||
this.$router.push({
|
||||
|
|
@ -95,7 +96,8 @@
|
|||
id: row.id,
|
||||
type: 'show',
|
||||
projectId: projectId,
|
||||
catetype:cateType
|
||||
catetype:cateType,
|
||||
operation:operation
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -138,21 +138,21 @@
|
|||
},
|
||||
//处理
|
||||
handleDetail(row){
|
||||
debugger;
|
||||
console.log(row)
|
||||
let projectId = '';
|
||||
let projectId='',operation=null;
|
||||
let catetype = row.workflow_.key;
|
||||
if(catetype==='visit'){
|
||||
projectId=row.ticket_data.visit;
|
||||
}else if(catetype==='Fire'){
|
||||
projectId=row.ticket_data.opl;
|
||||
operation = row.ticket_data.operation?row.ticket_data.operation:null;
|
||||
}
|
||||
this.$router.push({
|
||||
name: "visitdetail",
|
||||
query: {
|
||||
id: row.id,
|
||||
projectId:projectId,
|
||||
catetype:row.workflow_.key
|
||||
catetype:row.workflow_.key,
|
||||
operation:operation
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
|
|||
|
|
@ -83,15 +83,17 @@
|
|||
<el-descriptions-item label="工单流水号:">
|
||||
{{ticketDetail.sn }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="许可证编号:">
|
||||
{{oplDetail.number }}
|
||||
<el-descriptions-item label="作业名称:">
|
||||
{{oplDetail.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="许可证类别:">
|
||||
{{oplDetail.cate_name}}
|
||||
<el-descriptions-item label="作业地点:">
|
||||
{{oplDetail.place}}
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="级别:">
|
||||
{{oplDetail.level }}
|
||||
<el-descriptions-item label="作业状态:">
|
||||
{{state_[oplDetail.state]}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="生产状态:">
|
||||
{{oplDetail.state_work }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="开始时间:">
|
||||
{{oplDetail.start_time }}
|
||||
|
|
@ -101,7 +103,7 @@
|
|||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<div style="text-align: center">
|
||||
<el-link type="primary" @click="showMoreInfo"> 更多信息 </el-link>
|
||||
<el-link type="primary" @click="showMoreInfo"> 作业许可证详情 </el-link>
|
||||
</div>
|
||||
<show-dialog v-if="rpjShow" ref="showDialog"></show-dialog>
|
||||
</el-card>
|
||||
|
|
@ -126,6 +128,46 @@
|
|||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-left: 10px; margin-bottom: 10px" v-if="type!=='show'">
|
||||
<scTitle title="作业票关闭"></scTitle>
|
||||
<el-form :model="form" ref="addForm" label-width="100px" label-position="left">
|
||||
<el-form-item label="关闭原因:">
|
||||
<el-select v-model="form.reason" placeholder="选择关闭原因">
|
||||
<el-option
|
||||
v-for="item in reasonOption"
|
||||
:key="item"
|
||||
:label="item"
|
||||
:value="item"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="关闭确认:">
|
||||
<el-checkbox-group v-model="form.review">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in reviewOption"
|
||||
:key="index"
|
||||
:label="item"
|
||||
>{{ item }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="处理意见">
|
||||
<el-input v-model="form.suggestion" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div v-if="ticketDetail.in_add_node" style="text-align: right">
|
||||
<el-button v-if="ticketDetail.in_add_node" class="filter-item" type="primary" @click="addNodeHandler('2')">加签处理</el-button>
|
||||
</div>
|
||||
<div v-else style="display: flex;justify-content: space-between;">
|
||||
<div>
|
||||
<el-button type="primary" @click="addNode">加签</el-button>
|
||||
<el-button v-if="ticketDetail.state_&&ticketDetail.state_.enable_deliver" type="primary" plain @click="deliverNode">转交</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-button v-for="item in operationBtn" :key="item.id" class="filter-item" :type="item.attribute_type===2?'danger':'primary'" @click="operationSubmit(item.id)">{{item.name}}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card style="margin-left: 10px;">
|
||||
<work-details ref="workDetails" :ticket="ticketId"></work-details>
|
||||
</el-card>
|
||||
|
|
@ -161,7 +203,9 @@
|
|||
<el-button class="filter-item" type="primary" @click="deliverNodeHandler('1')">确定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<el-drawer :size="'50%'" v-model="showLimited" title="作业许可证详情">
|
||||
<sc-fire :id="projectId"></sc-fire>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
|
@ -190,7 +234,9 @@
|
|||
employeeLists: [],
|
||||
operationBtn: [],
|
||||
form:{
|
||||
suggestion:''
|
||||
suggestion:'',
|
||||
reason:'',
|
||||
review:'',
|
||||
},
|
||||
addForm:{
|
||||
suggestion:'',
|
||||
|
|
@ -202,6 +248,7 @@
|
|||
},
|
||||
rpjShow:false,
|
||||
limitedAdd:false,
|
||||
showLimited:false,
|
||||
limitedDeliver:false,
|
||||
limitedUserSelect:false,
|
||||
purpose_: {
|
||||
|
|
@ -223,6 +270,9 @@
|
|||
40: "进行中",
|
||||
50: "已完成",
|
||||
},
|
||||
reasonOption:['作业正常结束','因计划改变停止作业','因发生异常终止作业','其他'],
|
||||
reviewOption:['现场已清理','人员已清点','火种已熄灭','其他'],
|
||||
// reviewOption:['现场已清理','人员已清点','火种已熄灭','其他'],
|
||||
};
|
||||
},
|
||||
created(){
|
||||
|
|
@ -230,6 +280,7 @@
|
|||
this.type = this.$route.query.type;
|
||||
this.projectId = this.$route.query.projectId;
|
||||
this.cateType = this.$route.query.catetype;
|
||||
this.operation = this.$route.query.operation;
|
||||
|
||||
},
|
||||
mounted() {
|
||||
|
|
@ -239,8 +290,11 @@
|
|||
}else if(this.cateType==='rparty'){
|
||||
this.getRpj();
|
||||
}else{
|
||||
debugger;
|
||||
this.getOpl();
|
||||
if(this.operation!==null){
|
||||
this.getOperation();
|
||||
}else{
|
||||
this.getOpl();
|
||||
}
|
||||
}
|
||||
this.getticketItem();
|
||||
this.getBtns();
|
||||
|
|
@ -279,13 +333,24 @@
|
|||
this.rpjDetail = res;
|
||||
});
|
||||
},
|
||||
//作业详情
|
||||
//许可证详情
|
||||
getOpl(){
|
||||
this.$API.opm.opl.read.req(this.projectId).then((res) => {
|
||||
debugger;
|
||||
this.oplDetail = res;
|
||||
});
|
||||
},
|
||||
//作业详情
|
||||
getOperation(){
|
||||
debugger;
|
||||
this.$API.opm.operation.read.req(this.operation).then((res) => {
|
||||
debugger;
|
||||
this.oplDetail = res;
|
||||
});
|
||||
},
|
||||
showMoreInfo(){
|
||||
this.showLimited = true;
|
||||
},
|
||||
//加签处理-start
|
||||
addNode(){
|
||||
this.limitedAdd = true;
|
||||
|
|
|
|||
|
|
@ -29,9 +29,13 @@
|
|||
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="220">
|
||||
<template #default="scope">
|
||||
<el-button link size="small" type="primary" @click="workflowShow(scope.row)" v-auth="'workflow.update'">配置</el-button>
|
||||
<el-button link size="small" type="primary" @click="workflowShow(scope.row)"
|
||||
v-auth="'workflow.update'">配置
|
||||
</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-button link size="small" type="primary" @click="workflowEdit(scope.row)" v-auth="'workflow.update'">编辑</el-button>
|
||||
<el-button link size="small" type="primary" @click="workflowEdit(scope.row)"
|
||||
v-auth="'workflow.update'">编辑
|
||||
</el-button>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link
|
||||
type="primary"
|
||||
|
|
@ -54,7 +58,7 @@
|
|||
<div class="svgWrapper">
|
||||
<div class="svgItem">工作流流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div>
|
||||
<div style="width: 90%;margin: auto;">
|
||||
<svg height=1800 id="mySvg" style="width:100%!important;">
|
||||
<svg :height='mySvgHeight' id="mySvg" style="width:100%!important;">
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -80,7 +84,7 @@
|
|||
></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="查看权限校验">
|
||||
<el-switch v-model="addForm.view_permission_check" ></el-switch>
|
||||
<el-switch v-model="addForm.view_permission_check"></el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="展现表单字段">
|
||||
<el-transfer
|
||||
|
|
@ -107,6 +111,7 @@
|
|||
<script>
|
||||
import dagreD3 from 'dagre-d3'
|
||||
import * as d3 from 'd3'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
data() {
|
||||
|
|
@ -118,6 +123,7 @@
|
|||
search: {
|
||||
keyword: null
|
||||
},
|
||||
mySvgHeight: null,
|
||||
editId: null,
|
||||
isSaving: false,
|
||||
limitedVisible: false,
|
||||
|
|
@ -134,7 +140,7 @@
|
|||
sn_prefix: "",
|
||||
description: "",
|
||||
view_permission_check: true,
|
||||
display_form_str:[],
|
||||
display_form_str: [],
|
||||
title_template: "",
|
||||
content_template: "",
|
||||
},
|
||||
|
|
@ -163,34 +169,34 @@
|
|||
this.type = 'add';
|
||||
this.limitedVisible = true;
|
||||
},
|
||||
submitHandle() {
|
||||
|
||||
submitHandle() {
|
||||
let that = this;
|
||||
this.$refs.addForm.validate((valid) => {
|
||||
if (valid) {
|
||||
that.isSaveing = true;
|
||||
that.submit();
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
async submit(){
|
||||
async submit() {
|
||||
let that = this;
|
||||
let res = null;
|
||||
try{
|
||||
try {
|
||||
if (that.type === 'add') {
|
||||
res = await that.$API.wf.workflow.create.req(that.addForm)
|
||||
res = await that.$API.wf.workflow.create.req(that.addForm)
|
||||
} else {
|
||||
res = await that.$API.wf.workflow.update.req(that.editId, that.addForm);
|
||||
res = await that.$API.wf.workflow.update.req(that.editId, that.addForm);
|
||||
}
|
||||
that.isSaveing = false;
|
||||
that.limitedVisible = false;
|
||||
that.$refs.table.refresh();
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
that.isSaveing = false;
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
//编辑工作流
|
||||
workflowEdit(row) {
|
||||
this.type = 'edit';
|
||||
|
|
@ -202,13 +208,13 @@
|
|||
//工作流配置
|
||||
workflowShow(row) {
|
||||
let workflow = sessionStorage.getItem('jinYuWorkflowId');
|
||||
if(workflow){
|
||||
if (workflow) {
|
||||
sessionStorage.removeItem('jinYuWorkflowId');
|
||||
sessionStorage.setItem('jinYuWorkflowId',row.id);
|
||||
}else{
|
||||
sessionStorage.setItem('jinYuWorkflowId',row.id);
|
||||
sessionStorage.setItem('jinYuWorkflowId', row.id);
|
||||
} else {
|
||||
sessionStorage.setItem('jinYuWorkflowId', row.id);
|
||||
}
|
||||
this.$router.push({path:'/wf/configuration'});
|
||||
this.$router.push({path: '/wf/configuration'});
|
||||
},
|
||||
|
||||
//删除工作流
|
||||
|
|
@ -223,17 +229,21 @@
|
|||
// this.$alert(res.message, "提示", {type: 'error'})
|
||||
}
|
||||
},
|
||||
|
||||
//表格选择后回调事件
|
||||
selectionChange(selection) {
|
||||
this.selection = selection;
|
||||
},
|
||||
|
||||
//搜索
|
||||
upsearch() {
|
||||
|
||||
},
|
||||
|
||||
//根据ID获取树结构
|
||||
filterTree(id) {
|
||||
var target = null;
|
||||
|
||||
function filter(tree) {
|
||||
tree.forEach(item => {
|
||||
if (item.id == id) {
|
||||
|
|
@ -244,10 +254,10 @@
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
filter(this.$refs.table.tableData)
|
||||
filter(this.$refs.table.tableData);
|
||||
return target
|
||||
},
|
||||
|
||||
//本地更新数据
|
||||
handleSaveSuccess(data, type) {
|
||||
if (type == 'add') {
|
||||
|
|
@ -256,6 +266,7 @@
|
|||
this.$refs.table.refresh()
|
||||
}
|
||||
},
|
||||
|
||||
handleWatch(scope) {
|
||||
debugger;
|
||||
let that = this;
|
||||
|
|
@ -271,12 +282,11 @@
|
|||
marginy: 20,
|
||||
});
|
||||
//获取state得到节点
|
||||
this.$API.wf.workflow.states.req(workFlow).then((response) => {
|
||||
that.$API.wf.workflow.states.req(workFlow).then((response) => {
|
||||
if (!response.err_msg) {
|
||||
let nodes = response;
|
||||
// 添加节点
|
||||
nodes.forEach((item) => {
|
||||
debugger;
|
||||
g.setNode(item.id, {
|
||||
// 节点标签
|
||||
label: item.name,
|
||||
|
|
@ -290,20 +300,12 @@
|
|||
ry: 5
|
||||
});
|
||||
});
|
||||
debugger;
|
||||
console.log(g.nodes());
|
||||
g.nodes().forEach(function (v) {
|
||||
debugger;
|
||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||
});
|
||||
//获取流转得到线 链接关系
|
||||
this.$API.wf.workflow.transitions.req(workFlow).then((res) => {
|
||||
that.$API.wf.workflow.transitions.req(workFlow).then((res) => {
|
||||
if (!res.err_msg) {
|
||||
let transitionList = res;
|
||||
debugger;
|
||||
transitionList.forEach((transition0) => {
|
||||
if (transition0.condition_expression.length > 0) {
|
||||
debugger;
|
||||
g.setNode(transition0.source_state_.id + 100000, {
|
||||
label: "条件表达式",
|
||||
style: "stroke: #000;fill: #afa",
|
||||
|
|
@ -329,11 +331,8 @@
|
|||
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 根据后台数据来改变连线的颜色
|
||||
});
|
||||
}
|
||||
})
|
||||
g.nodes().length - 1
|
||||
g.nodes().forEach(function (v) {
|
||||
console.log("Node " + v + ": " + JSON.stringify(g.node(v)));
|
||||
});
|
||||
g.nodes().length - 1;
|
||||
// 创建渲染器
|
||||
let render = new dagreD3.render();
|
||||
// 选择 svg 并添加一个g元素作为绘图容器.
|
||||
|
|
@ -341,6 +340,7 @@
|
|||
let svgGroup = svg.append('g');
|
||||
// 在绘图容器上运行渲染器生成流程图.
|
||||
render(d3.select("svg g"), g);
|
||||
that.mySvgHeight = document.getElementsByClassName('nodes')[0].getBoundingClientRect().height + 50;
|
||||
} else {
|
||||
}
|
||||
});
|
||||
|
|
@ -363,21 +363,23 @@
|
|||
border: 1px solid #dcdfe6;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 15px;
|
||||
width: 10px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
|
||||
background-color: #fefefe;
|
||||
border-radius: 7px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
border-radius: 7px;
|
||||
border-radius: 5px;
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
|
||||
.svgMark {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
|
@ -395,8 +397,8 @@
|
|||
.svgWrapper {
|
||||
background: #fff;
|
||||
width: 800px;
|
||||
margin:0 auto;
|
||||
height: 100vh;
|
||||
margin: 5vh auto;
|
||||
height: 90vh;
|
||||
text-align: center;
|
||||
border-radius: 2px;
|
||||
overflow-y: scroll;
|
||||
|
|
|
|||
Loading…
Reference in New Issue