zuoyepiaoguanbi&role

This commit is contained in:
shijing 2022-07-22 10:55:15 +08:00
parent 117617a026
commit 8df5338155
5 changed files with 129 additions and 59 deletions

View File

@ -53,6 +53,7 @@
show-checkbox show-checkbox
:data="menu.list" :data="menu.list"
:props="menu.props" :props="menu.props"
check-strictly="true"
:default-checked-keys="menu.checked" :default-checked-keys="menu.checked"
@check="handleChange" @check="handleChange"
></el-tree> ></el-tree>

View File

@ -81,12 +81,13 @@
}, },
handleShow(row) { handleShow(row) {
let cateType = row.workflow_.key; let cateType = row.workflow_.key;
let projectId=''; let projectId='',operation=null;
if(cateType==='visit'){ if(cateType==='visit'){
projectId = row.ticket_data.visit; projectId = row.ticket_data.visit;
}else if(cateType==='rparty'){ }else if(cateType==='rparty'){
projectId = row.ticket_data.rpj; projectId = row.ticket_data.rpj;
}else{ }else{
operation = row.ticket_data.operation?row.ticket_data.operation:null;
projectId = row.ticket_data.opl; projectId = row.ticket_data.opl;
} }
this.$router.push({ this.$router.push({
@ -95,7 +96,8 @@
id: row.id, id: row.id,
type: 'show', type: 'show',
projectId: projectId, projectId: projectId,
catetype:cateType catetype:cateType,
operation:operation
}, },
}); });
}, },

View File

@ -138,21 +138,21 @@
}, },
// //
handleDetail(row){ handleDetail(row){
debugger; let projectId='',operation=null;
console.log(row)
let projectId = '';
let catetype = row.workflow_.key; let catetype = row.workflow_.key;
if(catetype==='visit'){ if(catetype==='visit'){
projectId=row.ticket_data.visit; projectId=row.ticket_data.visit;
}else if(catetype==='Fire'){ }else if(catetype==='Fire'){
projectId=row.ticket_data.opl; projectId=row.ticket_data.opl;
operation = row.ticket_data.operation?row.ticket_data.operation:null;
} }
this.$router.push({ this.$router.push({
name: "visitdetail", name: "visitdetail",
query: { query: {
id: row.id, id: row.id,
projectId:projectId, projectId:projectId,
catetype:row.workflow_.key catetype:row.workflow_.key,
operation:operation
}, },
}); });
}, },

View File

@ -83,15 +83,17 @@
<el-descriptions-item label="工单流水号:"> <el-descriptions-item label="工单流水号:">
{{ticketDetail.sn }} {{ticketDetail.sn }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="许可证编号:"> <el-descriptions-item label="作业名称:">
{{oplDetail.number }} {{oplDetail.name }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="许可证类别:"> <el-descriptions-item label="作业地点:">
{{oplDetail.cate_name}} {{oplDetail.place}}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="作业状态:">
<el-descriptions-item label="级别:"> {{state_[oplDetail.state]}}
{{oplDetail.level }} </el-descriptions-item>
<el-descriptions-item label="生产状态:">
{{oplDetail.state_work }}
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="开始时间:"> <el-descriptions-item label="开始时间:">
{{oplDetail.start_time }} {{oplDetail.start_time }}
@ -101,7 +103,7 @@
</el-descriptions-item> </el-descriptions-item>
</el-descriptions> </el-descriptions>
<div style="text-align: center"> <div style="text-align: center">
<el-link type="primary" @click="showMoreInfo"> 更多信息 </el-link> <el-link type="primary" @click="showMoreInfo"> 作业许可证详情 </el-link>
</div> </div>
<show-dialog v-if="rpjShow" ref="showDialog"></show-dialog> <show-dialog v-if="rpjShow" ref="showDialog"></show-dialog>
</el-card> </el-card>
@ -126,6 +128,46 @@
</div> </div>
</div> </div>
</el-card> </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;"> <el-card style="margin-left: 10px;">
<work-details ref="workDetails" :ticket="ticketId"></work-details> <work-details ref="workDetails" :ticket="ticketId"></work-details>
</el-card> </el-card>
@ -161,7 +203,9 @@
<el-button class="filter-item" type="primary" @click="deliverNodeHandler('1')">确定</el-button> <el-button class="filter-item" type="primary" @click="deliverNodeHandler('1')">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
<el-drawer :size="'50%'" v-model="showLimited" title="作业许可证详情">
<sc-fire :id="projectId"></sc-fire>
</el-drawer>
</template> </template>
<script> <script>
@ -190,7 +234,9 @@
employeeLists: [], employeeLists: [],
operationBtn: [], operationBtn: [],
form:{ form:{
suggestion:'' suggestion:'',
reason:'',
review:'',
}, },
addForm:{ addForm:{
suggestion:'', suggestion:'',
@ -202,6 +248,7 @@
}, },
rpjShow:false, rpjShow:false,
limitedAdd:false, limitedAdd:false,
showLimited:false,
limitedDeliver:false, limitedDeliver:false,
limitedUserSelect:false, limitedUserSelect:false,
purpose_: { purpose_: {
@ -223,6 +270,9 @@
40: "进行中", 40: "进行中",
50: "已完成", 50: "已完成",
}, },
reasonOption:['作业正常结束','因计划改变停止作业','因发生异常终止作业','其他'],
reviewOption:['现场已清理','人员已清点','火种已熄灭','其他'],
// reviewOption:['','','',''],
}; };
}, },
created(){ created(){
@ -230,6 +280,7 @@
this.type = this.$route.query.type; this.type = this.$route.query.type;
this.projectId = this.$route.query.projectId; this.projectId = this.$route.query.projectId;
this.cateType = this.$route.query.catetype; this.cateType = this.$route.query.catetype;
this.operation = this.$route.query.operation;
}, },
mounted() { mounted() {
@ -239,8 +290,11 @@
}else if(this.cateType==='rparty'){ }else if(this.cateType==='rparty'){
this.getRpj(); this.getRpj();
}else{ }else{
debugger; if(this.operation!==null){
this.getOpl(); this.getOperation();
}else{
this.getOpl();
}
} }
this.getticketItem(); this.getticketItem();
this.getBtns(); this.getBtns();
@ -279,13 +333,24 @@
this.rpjDetail = res; this.rpjDetail = res;
}); });
}, },
// //
getOpl(){ getOpl(){
this.$API.opm.opl.read.req(this.projectId).then((res) => { this.$API.opm.opl.read.req(this.projectId).then((res) => {
debugger; debugger;
this.oplDetail = res; this.oplDetail = res;
}); });
}, },
//
getOperation(){
debugger;
this.$API.opm.operation.read.req(this.operation).then((res) => {
debugger;
this.oplDetail = res;
});
},
showMoreInfo(){
this.showLimited = true;
},
//-start //-start
addNode(){ addNode(){
this.limitedAdd = true; this.limitedAdd = true;

View File

@ -29,9 +29,13 @@
<el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column> <el-table-column label="创建时间" prop="create_time" min-width="150"></el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="220"> <el-table-column label="操作" fixed="right" align="center" width="220">
<template #default="scope"> <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-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-divider direction="vertical"></el-divider>
<el-link <el-link
type="primary" type="primary"
@ -54,7 +58,7 @@
<div class="svgWrapper"> <div class="svgWrapper">
<div class="svgItem">工作流流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div> <div class="svgItem">工作流流程图<i class="el-dialog__close el-icon el-icon-close" @click="closeMark"></i></div>
<div style="width: 90%;margin: auto;"> <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> </svg>
</div> </div>
</div> </div>
@ -80,7 +84,7 @@
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="查看权限校验"> <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>
<el-form-item label="展现表单字段"> <el-form-item label="展现表单字段">
<el-transfer <el-transfer
@ -107,6 +111,7 @@
<script> <script>
import dagreD3 from 'dagre-d3' import dagreD3 from 'dagre-d3'
import * as d3 from 'd3' import * as d3 from 'd3'
export default { export default {
name: 'index', name: 'index',
data() { data() {
@ -118,6 +123,7 @@
search: { search: {
keyword: null keyword: null
}, },
mySvgHeight: null,
editId: null, editId: null,
isSaving: false, isSaving: false,
limitedVisible: false, limitedVisible: false,
@ -134,7 +140,7 @@
sn_prefix: "", sn_prefix: "",
description: "", description: "",
view_permission_check: true, view_permission_check: true,
display_form_str:[], display_form_str: [],
title_template: "", title_template: "",
content_template: "", content_template: "",
}, },
@ -163,34 +169,34 @@
this.type = 'add'; this.type = 'add';
this.limitedVisible = true; this.limitedVisible = true;
}, },
submitHandle() {
submitHandle() {
let that = this; let that = this;
this.$refs.addForm.validate((valid) => { this.$refs.addForm.validate((valid) => {
if (valid) { if (valid) {
that.isSaveing = true; that.isSaveing = true;
that.submit(); that.submit();
} }
}) })
}, },
async submit(){ async submit() {
let that = this; let that = this;
let res = null; let res = null;
try{ try {
if (that.type === 'add') { 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 { } 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.isSaveing = false;
that.limitedVisible = false; that.limitedVisible = false;
that.$refs.table.refresh(); that.$refs.table.refresh();
}catch (e) { } catch (e) {
that.isSaveing = false; that.isSaveing = false;
} }
}, },
// //
workflowEdit(row) { workflowEdit(row) {
this.type = 'edit'; this.type = 'edit';
@ -202,13 +208,13 @@
// //
workflowShow(row) { workflowShow(row) {
let workflow = sessionStorage.getItem('jinYuWorkflowId'); let workflow = sessionStorage.getItem('jinYuWorkflowId');
if(workflow){ if (workflow) {
sessionStorage.removeItem('jinYuWorkflowId'); sessionStorage.removeItem('jinYuWorkflowId');
sessionStorage.setItem('jinYuWorkflowId',row.id); sessionStorage.setItem('jinYuWorkflowId', row.id);
}else{ } else {
sessionStorage.setItem('jinYuWorkflowId',row.id); 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'}) // this.$alert(res.message, "", {type: 'error'})
} }
}, },
// //
selectionChange(selection) { selectionChange(selection) {
this.selection = selection; this.selection = selection;
}, },
// //
upsearch() { upsearch() {
}, },
//ID //ID
filterTree(id) { filterTree(id) {
var target = null; var target = null;
function filter(tree) { function filter(tree) {
tree.forEach(item => { tree.forEach(item => {
if (item.id == id) { if (item.id == id) {
@ -244,10 +254,10 @@
} }
}) })
} }
filter(this.$refs.table.tableData);
filter(this.$refs.table.tableData)
return target return target
}, },
// //
handleSaveSuccess(data, type) { handleSaveSuccess(data, type) {
if (type == 'add') { if (type == 'add') {
@ -256,6 +266,7 @@
this.$refs.table.refresh() this.$refs.table.refresh()
} }
}, },
handleWatch(scope) { handleWatch(scope) {
debugger; debugger;
let that = this; let that = this;
@ -271,12 +282,11 @@
marginy: 20, marginy: 20,
}); });
//state //state
this.$API.wf.workflow.states.req(workFlow).then((response) => { that.$API.wf.workflow.states.req(workFlow).then((response) => {
if (!response.err_msg) { if (!response.err_msg) {
let nodes = response; let nodes = response;
// //
nodes.forEach((item) => { nodes.forEach((item) => {
debugger;
g.setNode(item.id, { g.setNode(item.id, {
// //
label: item.name, label: item.name,
@ -290,20 +300,12 @@
ry: 5 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) { if (!res.err_msg) {
let transitionList = res; let transitionList = res;
debugger;
transitionList.forEach((transition0) => { transitionList.forEach((transition0) => {
if (transition0.condition_expression.length > 0) { if (transition0.condition_expression.length > 0) {
debugger;
g.setNode(transition0.source_state_.id + 100000, { g.setNode(transition0.source_state_.id + 100000, {
label: "条件表达式", label: "条件表达式",
style: "stroke: #000;fill: #afa", style: "stroke: #000;fill: #afa",
@ -329,11 +331,8 @@
style: "fill:#ffffff;stroke:#c0c1c3;stroke-width:1.5px" // 线 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(); let render = new dagreD3.render();
// svg g. // svg g.
@ -341,6 +340,7 @@
let svgGroup = svg.append('g'); let svgGroup = svg.append('g');
// . // .
render(d3.select("svg g"), g); render(d3.select("svg g"), g);
that.mySvgHeight = document.getElementsByClassName('nodes')[0].getBoundingClientRect().height + 50;
} else { } else {
} }
}); });
@ -363,21 +363,23 @@
border: 1px solid #dcdfe6; border: 1px solid #dcdfe6;
margin-bottom: 10px; margin-bottom: 10px;
} }
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 15px; width: 10px;
} }
::-webkit-scrollbar-track { ::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .2);
background-color: #fefefe; background-color: #fefefe;
border-radius: 7px; border-radius: 5px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
border-radius: 7px; border-radius: 5px;
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5); -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .5);
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.svgMark { .svgMark {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -395,8 +397,8 @@
.svgWrapper { .svgWrapper {
background: #fff; background: #fff;
width: 800px; width: 800px;
margin:0 auto; margin: 5vh auto;
height: 100vh; height: 90vh;
text-align: center; text-align: center;
border-radius: 2px; border-radius: 2px;
overflow-y: scroll; overflow-y: scroll;