动火作业工作流测试

This commit is contained in:
shijing 2022-07-22 14:02:33 +08:00
parent 8df5338155
commit 243e29568e
8 changed files with 288 additions and 254 deletions

View File

@ -176,7 +176,13 @@ export default {
req: async function(id){
return await http.get( `${config.API_URL}/wf/ticketflow/${id}/`);
}
}
},
retryScript: {
name: "重试脚本",
req: async function(id){
return await http.post(`${config.API_URL}/wf/ticket/${id}/retry_script/`);
}
},
},
field:{
list: {

View File

@ -51,7 +51,6 @@
data() {
return {
list: [],
actstate_: {
0: "草稿中",
1: "进行中",
@ -81,14 +80,14 @@
},
handleShow(row) {
let cateType = row.workflow_.key;
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;
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({
name: "visitdetail",
@ -96,8 +95,8 @@
id: row.id,
type: 'show',
projectId: projectId,
catetype:cateType,
operation:operation
catetype: cateType,
operation: operation
},
});
},

View File

@ -1,92 +1,103 @@
<template>
<el-container>
<el-main class="nopadding">
<scTable
ref="table"
:data="list"
row-key="id"
stripe
highlightCurrentRow
hidePagination
>
<el-table-column label="ID" prop="id"></el-table-column>
<el-table-column label="工单标题" prop="title"></el-table-column>
<el-table-column label="流水号" prop="sn"></el-table-column>
<el-table-column label="当前状态">
<template #default="scope">
{{ scope.row.state_.name }}
</template>
</el-table-column>
<el-table-column label="进行状态" prop="sort">
<template #default="scope">
{{ actstate_[scope.row.act_state] }}
</template>
</el-table-column>
<el-table-column label="关联工作流" prop="title">
<template #default="scope">
{{ scope.row.workflow_.name }}
</template>
</el-table-column>
<el-table-column label="处理人类型">
<template #default="scope">
{{ participant_[scope.row.participant_type] }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button link size="small" @click="handleShow(scope.row)">查看详情</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<el-container>
<el-main class="nopadding">
<scTable
ref="table"
:data="list"
row-key="id"
stripe
highlightCurrentRow
hidePagination
>
<el-table-column label="ID" prop="id"></el-table-column>
<el-table-column label="工单标题" prop="title"></el-table-column>
<el-table-column label="流水号" prop="sn"></el-table-column>
<el-table-column label="当前状态">
<template #default="scope">
{{ scope.row.state_.name }}
</template>
</el-table-column>
<el-table-column label="进行状态" prop="sort">
<template #default="scope">
{{ actstate_[scope.row.act_state] }}
</template>
</el-table-column>
<el-table-column label="关联工作流" prop="title">
<template #default="scope">
{{ scope.row.workflow_.name }}
</template>
</el-table-column>
<el-table-column label="处理人类型">
<template #default="scope">
{{ participant_[scope.row.participant_type] }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="120">
<template #default="scope">
<el-button link size="small" @click="handleShow(scope.row)">查看详情</el-button>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
</template>
<script>
export default {
name: "state",
data() {
return {
list:[],
export default {
name: "state",
data() {
return {
list: [],
actstate_: {
0: "草稿中",
1: "进行中",
2: "被退回",
3: "被撤回",
4: "已完成",
5: "已关闭",
},
participant_: {
0: "无处理人",
1: "个人",
2: "多人",
},
};
},
mounted() {
this.getList();
},
methods: {
async getList() {
let res = await this.$API.wf.ticket.list.req({ category: "cc",page:0 });
console.log(res);
this.list = res;
},
handleShow(row) {
this.$router.push({
name: "visitdetail",
query: {
id: row.id,
type: 'show',
projectId: row.ticket_data.visit,
catetype : row.workflow_.key
},
});
},
},
};
actstate_: {
0: "草稿中",
1: "进行中",
2: "被退回",
3: "被撤回",
4: "已完成",
5: "已关闭",
},
participant_: {
0: "无处理人",
1: "个人",
2: "多人",
},
};
},
mounted() {
this.getList();
},
methods: {
async getList() {
let res = await this.$API.wf.ticket.list.req({category: "cc", page: 0});
console.log(res);
this.list = res;
},
handleShow(row) {
let cateType = row.workflow_.key;
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({
name: "visitdetail",
query: {
id: row.id,
type: 'show',
projectId: projectId,
catetype: cateType,
operation: operation
},
});
},
},
};
</script>
<style scoped>

View File

@ -42,14 +42,6 @@
>
处理
</el-link>
<!--多人处理直接接单-->
<!--<el-link
v-if="scope.row.state_.distribute_type===1&&scope.row.participant_type===2"
type="primary"
@click="handleDetail(scope.row)"
>
接单
</el-link>-->
<el-button v-if="scope.row.state_.distribute_type===1&&scope.row.participant_type===2"
type="text" size="small" @click="handleAccept(scope.row)">
接单
@ -68,39 +60,11 @@
<el-dialog v-model="limitedFlowLogs" title="工单日志">
<ticket-log ref="ticketLogs" :ticket="ticketId"></ticket-log>
</el-dialog>
<!--<el-dialog v-model="limitedFlowLogs" title="工单日志">
<el-table
:data="floeLogs"
fit
stripe
style="width: 100%;border-top:1px solid #EBEEF5;"
>
<el-table-column label="工单标题">
<template #defalut="scope">
<span v-if="scope.row.ticket_data">{{scope.row.ticket_data.title}}</span>
</template>
</el-table-column>
<el-table-column label="进行状态">
<template #defalut="scope">
<span v-if="scope.row.state_">{{scope.row.state_.name}}</span>
</template>
</el-table-column>
<el-table-column label="操作人">
<template #default="scope">
<span v-if="scope.row.participant_">{{ scope.row.participant_.name }}</span>
</template>
</el-table-column>
<el-table-column label="操作意见" prop="suggestion">
</el-table-column>
<el-table-column label="更新时间" prop="update_time">
</el-table-column>
</el-table>
</el-dialog>-->
</template>
<script>
import ticketLog from "./details.vue";
export default {
components: {
ticketLog,
@ -122,9 +86,9 @@
1: "个人",
2: "多人",
},
floeLogs:[],
ticketId:'',
limitedFlowLogs:false,
floeLogs: [],
ticketId: '',
limitedFlowLogs: false,
};
},
mounted() {
@ -137,22 +101,22 @@
this.list = res;
},
//
handleDetail(row){
let projectId='',operation=null;
handleDetail(row) {
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;
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,
operation:operation
projectId: projectId,
catetype: row.workflow_.key,
operation: operation
},
});
},
@ -162,10 +126,10 @@
let id = row.id;
this.ticketId = row.id;
that.limitedFlowLogs = true;
that.$API.wf.ticket.ticketFlow.req({ticket:id}).then(res => {
that.$API.wf.ticket.ticketFlow.req({ticket: id}).then(res => {
if (res.err_msg) {
}else{
} else {
that.floeLogs = res.results;
}
})

View File

@ -76,7 +76,7 @@
data() {
return {
list: [],
userId:this.$TOOL.data.get("USER_INFO").id,
userId: this.$TOOL.data.get("USER_INFO").id,
actstate_: {
0: "草稿中",
1: "进行中",
@ -95,8 +95,8 @@
},
handleLabel: '撤回原因',
handleTitle: '撤回工单',
ticketId:null,
limitedRetreat:false,
ticketId: null,
limitedRetreat: false,
};
},
mounted() {
@ -105,13 +105,24 @@
},
methods: {
handleShow(row) {
let cateType = row.workflow_.key;
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({
name: "visitdetail",
query: {
id: row.id,
type: 'show',
projectId: row.ticket_data.visit,
catetype:row.workflow_.key
projectId: projectId,
catetype: cateType,
operation: operation
},
});
},
@ -137,7 +148,7 @@
handleSubmit() {
let res = '';
let that = this;
that.$confirm('确认'+that.handleTitle+'吗?', "温馨提示", {
that.$confirm('确认' + that.handleTitle + '吗?', "温馨提示", {
confirmButtonText: "确认",
cancelButtonText: "取消",
type: "warning",
@ -148,9 +159,9 @@
} else {
res = that.$API.wf.ticket.ticketClose.req(that.ticketId, that.handleForm);
}
if(res.err_msg){
if (res.err_msg) {
that.getList();
}else{
} else {
that.limitedRetreat = false;
that.getList();
}

View File

@ -1,8 +1,16 @@
<template>
<el-container>
<el-main class="nopadding">
<el-card style="margin-bottom: 10px">
<el-card style="margin-bottom: 10px;position: relative">
<work-step ref="workStep"></work-step>
<el-button
class="ticketRetry"
v-if="type!=='show'&&ticketDetail.state_&&ticketDetail.state_.name==='任务执行'"
@click="reStart"
type="primary"
>
重新执行
</el-button>
</el-card>
<el-card style="margin-left: 10px; margin-bottom: 10px" v-if="cateType==='visit'">
<el-descriptions title="来访信息" :column="3">
@ -74,7 +82,7 @@
</el-descriptions-item>
</el-descriptions>
<div style="text-align: center">
<el-link type="primary" @click="showMore"> 更多信息 </el-link>
<el-link type="primary" @click="showMore"> 更多信息</el-link>
</div>
<show-dialog v-if="rpjShow" ref="showDialog"></show-dialog>
</el-card>
@ -103,7 +111,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>
@ -111,43 +119,23 @@
<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-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; 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-form-item label="作业情况:" v-if="ticketDetail.state_&&ticketDetail.state_.name==='作业负责人关闭'">
<el-select v-model="form.close_note" placeholder="选择关闭原因">
<el-option
v-for="item in reasonOption"
:key="item"
:label="item"
:value="item"
v-for="item in noteOption"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="关闭确认:">
<el-checkbox-group v-model="form.review">
<el-form-item label="关闭处理:" v-if="ticketDetail.state_&&ticketDetail.state_.name==='作业负责人关闭'">
<el-checkbox-group v-model="form.close_dos">
<el-checkbox
v-for="(item, index) in reviewOption"
v-for="(item, index) in dosOption"
:key="index"
:label="item"
>{{ item }}
:label="item.id"
>{{ item.name }}
</el-checkbox>
</el-checkbox-group>
</el-form-item>
@ -156,15 +144,22 @@
</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>
<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>
<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>
<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>
@ -177,7 +172,8 @@
<el-form ref="Form" :model="addForm" label-width="100px" label-position="right">
<el-form-item label="处理人">
<el-input style="width: 50%;" v-model="userName" disabled placeholder="选择处理人"></el-input>
<scUserSelect v-model="addForm.toadd_user" :closable="true" :multiple="false" @handlerSubmit="addNodeHandlerSubmit"></scUserSelect>
<scUserSelect v-model="addForm.toadd_user" :closable="true" :multiple="false"
@handlerSubmit="addNodeHandlerSubmit"></scUserSelect>
</el-form-item>
<el-form-item label="加签原因">
<el-input type="textarea" :rows="3" v-model="addForm.suggestion" placeholder="加签原因"/>
@ -233,24 +229,24 @@
visitDetail: [],
employeeLists: [],
operationBtn: [],
form:{
suggestion:'',
reason:'',
review:'',
form: {
suggestion: '',
close_note: '',
close_dos: [],
},
addForm:{
suggestion:'',
toadd_user:'',
addForm: {
suggestion: '',
toadd_user: '',
},
deliverForm:{
suggestion:'',
target_user:'',
deliverForm: {
suggestion: '',
target_user: '',
},
rpjShow:false,
limitedAdd:false,
showLimited:false,
limitedDeliver:false,
limitedUserSelect:false,
rpjShow: false,
limitedAdd: false,
showLimited: false,
limitedDeliver: false,
limitedUserSelect: false,
purpose_: {
10: "参观",
20: "拜访",
@ -270,12 +266,16 @@
40: "进行中",
50: "已完成",
},
reasonOption:['作业正常结束','因计划改变停止作业','因发生异常终止作业','其他'],
reviewOption:['现场已清理','人员已清点','火种已熄灭','其他'],
// reviewOption:['','','',''],
noteOption: [
{id: 10, name: '作业正常结束'},
{id: 20, name: '因计划改变停止作业'},
{id: 30, name: '因发生异常终止作业'},
{id: 40, name: '其他'},
],
dosOption: [],
};
},
created(){
created() {
this.ticketId = this.$route.query.id;
this.type = this.$route.query.type;
this.projectId = this.$route.query.projectId;
@ -285,25 +285,37 @@
},
mounted() {
debugger;
if(this.cateType==='visit'){
if (this.cateType === 'visit') {
this.getVisit();
}else if(this.cateType==='rparty'){
} else if (this.cateType === 'rparty') {
this.getRpj();
}else{
if(this.operation!==null){
} else {
if (this.operation !== null) {
this.getOperation();
}else{
} else {
this.getOpl();
}
this.getCloseDos();
}
this.getticketItem();
this.getBtns();
},
methods: {
showMore(){
//
getCloseDos() {
this.$API.system.dict.list
.req({page: 0, type__code: "close_options"})
.then((res) => {
let dosOption = res.filter(item => {
return item.is_used
});
this.dosOption = dosOption.slice(0, 3)
});
},
showMore() {
this.rpjShow = true;
this.$nextTick(()=>{
this.$refs.showDialog.open().setData({id:this.projectId});
this.$nextTick(() => {
this.$refs.showDialog.open().setData({id: this.projectId});
})
},
//
@ -313,8 +325,8 @@
});
},
//
getBtns(){
this.$API.wf.ticket.ticketTransitions.req(this.ticketId).then(res=>{
getBtns() {
this.$API.wf.ticket.ticketTransitions.req(this.ticketId).then(res => {
this.operationBtn = res;
})
},
@ -327,68 +339,70 @@
},
//
getRpj(){
getRpj() {
this.$API.rpm.rpj.item.req(this.projectId).then((res) => {
debugger;
this.rpjDetail = res;
});
},
//
getOpl(){
getOpl() {
this.$API.opm.opl.read.req(this.projectId).then((res) => {
debugger;
this.oplDetail = res;
});
},
//
getOperation(){
getOperation() {
debugger;
this.$API.opm.operation.read.req(this.operation).then((res) => {
debugger;
this.oplDetail = res;
});
},
showMoreInfo(){
showMoreInfo() {
this.showLimited = true;
},
//-start
addNode(){
addNode() {
this.limitedAdd = true;
},
addCancel(){
addCancel() {
this.limitedAdd = false;
},
addNodeHandlerSubmit(data) {
this.addForm.toadd_user=data.id;
this.userName=data.name;
this.addForm.toadd_user = data.id;
this.userName = data.name;
},
addNodeHandler(index){
addNodeHandler(index) {
let res = null;
if(index==='1'){
res = this.$API.wf.ticket.addNode.req(this.ticketId,this.addForm);
}else{
res = this.$API.wf.ticket.addNodeEnd.req(this.ticketId,this.form);
if (index === '1') {
res = this.$API.wf.ticket.addNode.req(this.ticketId, this.addForm);
} else {
res = this.$API.wf.ticket.addNodeEnd.req(this.ticketId, this.form);
}
if(res.err_msg){}else{
if (res.err_msg) {
} else {
this.limitedAdd = false;
this.$router.push("dutywork");
}
},
//-end
//-start
deliverNode(){
deliverNode() {
this.limitedDeliver = true;
},
deliverCancel(){
deliverCancel() {
this.limitedDeliver = false;
},
deliverHandlerSubmit(data) {
this.deliverForm.target_user=data.id;
this.userName=data.name;
this.deliverForm.target_user = data.id;
this.userName = data.name;
},
deliverNodeHandler(){
this.$API.wf.ticket.ticketDeliver.req(this.ticketId,this.deliverForm).then(res=>{
if(res.err_msg){}else{
deliverNodeHandler() {
this.$API.wf.ticket.ticketDeliver.req(this.ticketId, this.deliverForm).then(res => {
if (res.err_msg) {
} else {
this.limitedDeliver = false;
this.$router.push("dutywork");
}
@ -396,20 +410,38 @@
},
//-end
//
operationSubmit(id){
operationSubmit(id) {
let params = new Object();
params.transition = id;
params.ticket_data = {};
params.suggestion = this.form.suggestion;
this.$API.wf.ticket.ticketHandle.req(this.ticketId,params).then(res=>{
if(res.err_msg){}else{
if (this.ticketDetail.state_.name === '作业负责人关闭') {
params.ticket_data.close_note = this.form.close_note;
params.ticket_data.close_dos = this.form.close_dos;
}
this.$API.wf.ticket.ticketHandle.req(this.ticketId, params).then(res => {
if (res.err_msg) {
} else {
this.$router.push("dutywork");
}
})
},
reStart() {
this.$API.wf.ticket.retryScript.req(this.ticketId).then(res => {
if (res.err_msg) {
} else {
this.$router.push("dutywork");
}
});
},
},
};
</script>
<style scoped>
.ticketRetry {
right: 20px;
top: 30px;
position: absolute;
}
</style>

View File

@ -49,7 +49,6 @@
data() {
return {
list: [],
actstate_: {
0: "草稿中",
1: "进行中",
@ -75,13 +74,24 @@
this.list = res;
},
handleShow(row) {
let cateType = row.workflow_.key;
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({
name: "visitdetail",
query: {
id: row.id,
type: 'show',
projectId: row.ticket_data.visit,
catetype: row.workflow_.key
projectId: projectId,
catetype: cateType,
operation: operation
},
});
},

View File

@ -17,9 +17,9 @@
<scTable ref="table" :apiObj="apiObj" row-key="id">
<el-table-column label="#" type="index"></el-table-column>
<el-table-column label="ID" prop="id" min-width="120"></el-table-column>
<el-table-column label="工作流名称" prop="name" min-width="250"></el-table-column>
<el-table-column label="标识" prop="key" min-width="250"></el-table-column>
<el-table-column label="工单查看权限校验" prop="view_permission_check" min-width="150">
<el-table-column label="工作流名称" prop="name" min-width="200"></el-table-column>
<el-table-column label="标识" prop="key" min-width="100"></el-table-column>
<el-table-column label="工单查看权限校验" prop="view_permission_check" min-width="120">
<template #default="scope">
<span v-if="scope.row.view_permission_check"></span>
<span v-else></span>
@ -27,7 +27,7 @@
</el-table-column>
<el-table-column label="工作流描述" prop="description" 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="250">
<template #default="scope">
<el-button link size="small" type="primary" @click="workflowShow(scope.row)"
v-auth="'workflow.update'">配置
@ -254,6 +254,7 @@
}
})
}
filter(this.$refs.table.tableData);
return target
},