审批管理修改

This commit is contained in:
2025-08-21 11:01:38 +08:00
parent b6dfdbf203
commit 963744c321
3 changed files with 520 additions and 363 deletions

View File

@@ -21,55 +21,104 @@
align="center" align="center"
width="50"> width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowDefId" prop="ticketsId"
header-align="center" header-align="center"
align="center" align="center"
label="流程定义ID"> label="工单ID">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowDefName"
header-align="center" header-align="center"
align="center" align="center"
label="流程名称"> label="小车类型">
<template slot-scope="scope">
{{ dictData[0] | findByValue(scope.row.carType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="userName"
header-align="center" header-align="center"
align="center" align="center"
label="发起人"> label="异常类型">
<template slot-scope="scope">
{{ dictData[1] | findByValue(scope.row.errorType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="startDate"
header-align="center" header-align="center"
align="center" align="center"
label="发起时间"> label="合同编号">
<template slot-scope="scope">
{{ dictData[2] | findByValue(scope.row.contractId) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="endDate"
header-align="center" header-align="center"
align="center" align="center"
label="结束时间"> label="客户">
<template slot-scope="scope">
{{ dictData[3] | findByValue(scope.row.clientId) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowProceId" prop="description"
header-align="center" header-align="center"
align="center" align="center"
label="实例ID"> label="故障描述">
</el-table-column>
<el-table-column
prop="deptPeople"
header-align="center"
align="center"
min-width="90px"
label="工单对接人">
</el-table-column>
<el-table-column
prop="deptPhone"
header-align="center"
align="center"
min-width="100px"
label="客户联系电话">
</el-table-column>
<el-table-column
prop="createUser"
header-align="center"
align="center"
label="创建者">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
min-width="90px"
label="创建时间">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="工单状态">
<template slot-scope="scope">
{{ statusOpt | findByValue(scope.row.status) }}
</template>
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
min-width="100px"
label="工单审批完成时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="150" width="170"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.ticketsId)">修改</el-button>
<el-button type="text" size="small" @click="showFlowHandle(scope.row.flowProceId)">查看流程进度</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.ticketsId)">删除</el-button>
<el-button v-if="!scope.row.status" type="text" size="small" @click="startFlowHandle(scope.row.ticketsId)">指派</el-button>
<el-button type="text" size="small" @click="$router.push(`/tickets-detail?id=${scope.row.ticketsId}`)">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -82,50 +131,59 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
<el-dialog <el-dialog
title="流程审批" title="发起流程"
:visible.sync="dialogVisible" :visible.sync="dialogFormVisible"
width="30%"> width="30%">
<div style="height: auto;margin-bottom: 30px;"> <el-form :model="flowForm" label-width="100px" class="demo-dynamic">
<el-form label-width="100px" class="demo-dynamic"> <el-form-item
<el-form-item> v-for="(form) in dynamiForm"
<el-button type="primary" @click="submitFlowComplete()">审批通过</el-button> :label="form.name"
</el-form-item> :key="form.key"
</el-form> :prop="form.key"
</div> >
<el-select v-if="form.type == 'assignee'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateUsers'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateGroups'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in roles"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="dialogFormVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="submitStartFlow()">提交</el-button>
</span>
</el-dialog> </el-dialog>
<el-dialog
title="流程图"
:visible.sync="dialogActiveVisible"
width="50%">
<div style="height: auto;margin-bottom: 30px;">
<img :src="$imgBasePath+'downloadFlowActiveImg?procId='+procInsId+'&t='+new Date()" height="auto">
</div>
<div style="padding: 50px;">
<el-steps direction="vertical" >
<el-step
v-for="item in hiTasks"
:key="item.id"
:status="item.status"
:title="item.taskNodeName+' 审批人:' + item.assigneeName +' ' + item.startTime" style="margin-bottom: 10px;"></el-step>
</el-steps>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from '../tickets/tickets-add-or-update'
import { apiUtils } from '@/utils/dict'
export default { export default {
data () { data () {
return { return {
procInsId:'',
dataForm: { dataForm: {
key: '' key: ''
}, },
@@ -137,11 +195,20 @@
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false,
dialogVisible:false, dictConfigs: [{url: '/car/car/list', type: 'list', value: 'carId', label: 'carName'}, {type: 'dict', code: 'error_type'}, {url: '/flow/contract/list', type: 'list', value: 'contractId', label: 'contractNumber'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
dialogActiveVisible:false, dictData: [],
id:'' dialogFormVisible: false,
flowForm:{ticketsId: null},
dynamiForm:[],
users: [],
roles: [],
statusOpt: [{value: '0', label: '未开始'}, {value: '1', label: '已指派'}, {value: '2', label: '处理中'}, {value: '3', label: '已完成'}]
} }
}, },
mixins: [apiUtils],
components: {
AddOrUpdate
},
activated () { activated () {
this.getDataList() this.getDataList()
}, },
@@ -150,9 +217,10 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/flw/instance/myCompleteTaskList'), url: this.$http.adornUrl('/tickets/tickets/listType'),
method: 'get', method: 'post',
params: this.$http.adornParams({ params: this.$http.adornData({
'type': 'FINISH',
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'key': this.dataForm.key 'key': this.dataForm.key
@@ -168,71 +236,6 @@
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
approveHandle(id){
this.id = id
this.dialogVisible = true
},
showFlowHandle(procInsId){
this.procInsId = procInsId
// 通过流程实例id查询对应的流转记录
this.$http({
url: this.$http.adornUrl(`/flw/instance/getCompleteHiTaskInstance/${this.procInsId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dialogActiveVisible = true
this.hiTasks = data.data
}
})
},
submitFlowComplete(){
// 做审批通过的操作
this.$http({
url: this.$http.adornUrl(`/flw/instance/completeFlow/${this.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dialogVisible = false
this.getDataList();
}
})
},
claimHandle(id){
this.$confirm('确定要拾取当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/claimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
unclaimHandle(id){
this.$confirm('确定要归还当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/unclaimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
@@ -248,10 +251,17 @@
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.ticketsId
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -259,7 +269,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/flow/flwdemodel/delete'), url: this.$http.adornUrl('/tickets/tickets/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
@@ -277,6 +287,45 @@
} }
}) })
}).catch(() => {}) }).catch(() => {})
},
startFlowHandle(id){
this.flowForm = {}
this.flowForm.ticketsId = id
this.$http({
url: this.$http.adornUrl('/flow/deploy/flowDef'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dynamiForm = [...data.data]
this.users = [...data.users]
this.roles = [...data.roles]
this.dialogFormVisible = true
}
})
},
submitStartFlow(){
// 提交表单数据
this.$http({
url: this.$http.adornUrl(`/flw/instance/startFlowInstance`),
method: 'get',
params: this.$http.adornParams(this.flowForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.flowForm = {}
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
} }
} }
} }

View File

@@ -21,49 +21,104 @@
align="center" align="center"
width="50"> width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowDefId" prop="ticketsId"
header-align="center" header-align="center"
align="center" align="center"
label="流程定义ID"> label="工单ID">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowDefName"
header-align="center" header-align="center"
align="center" align="center"
label="流程名称"> label="小车类型">
<template slot-scope="scope">
{{ dictData[0] | findByValue(scope.row.carType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="startDate"
header-align="center" header-align="center"
align="center" align="center"
label="发起时间"> label="异常类型">
<template slot-scope="scope">
{{ dictData[1] | findByValue(scope.row.errorType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="endDate"
header-align="center" header-align="center"
align="center" align="center"
label="结束时间"> label="合同编号">
<template slot-scope="scope">
{{ dictData[2] | findByValue(scope.row.contractId) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="flowProceId"
header-align="center" header-align="center"
align="center" align="center"
label="实例ID"> label="客户">
<template slot-scope="scope">
{{ dictData[3] | findByValue(scope.row.clientId) }}
</template>
</el-table-column>
<el-table-column
prop="description"
header-align="center"
align="center"
label="故障描述">
</el-table-column>
<el-table-column
prop="deptPeople"
header-align="center"
align="center"
min-width="90px"
label="工单对接人">
</el-table-column>
<el-table-column
prop="deptPhone"
header-align="center"
align="center"
min-width="100px"
label="客户联系电话">
</el-table-column>
<el-table-column
prop="createUser"
header-align="center"
align="center"
label="创建者">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
min-width="90px"
label="创建时间">
</el-table-column>
<el-table-column
prop="status"
header-align="center"
align="center"
label="工单状态">
<template slot-scope="scope">
{{ statusOpt | findByValue(scope.row.status) }}
</template>
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
min-width="100px"
label="工单审批完成时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="150" width="170"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.ticketsId)">修改</el-button>
<el-button type="text" size="small" @click="showFlowHandle(scope.row.flowProceId)">查看流程进度</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.ticketsId)">删除</el-button>
<el-button v-if="!scope.row.status" type="text" size="small" @click="startFlowHandle(scope.row.ticketsId)">指派</el-button>
<el-button type="text" size="small" @click="$router.push(`/tickets-detail?id=${scope.row.ticketsId}`)">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -76,66 +131,83 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
<el-dialog <el-dialog
title="流程审批" title="发起流程"
:visible.sync="dialogVisible" :visible.sync="dialogFormVisible"
width="30%"> width="30%">
<div style="height: auto;margin-bottom: 30px;"> <el-form :model="flowForm" label-width="100px" class="demo-dynamic">
<el-form label-width="100px" class="demo-dynamic"> <el-form-item
<el-form-item> v-for="(form) in dynamiForm"
<el-button type="primary" @click="submitFlowComplete()">审批通过</el-button> :label="form.name"
</el-form-item> :key="form.key"
</el-form> :prop="form.key"
</div> >
<el-select v-if="form.type == 'assignee'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateUsers'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateGroups'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in roles"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="dialogFormVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="submitStartFlow()">提交</el-button>
</span>
</el-dialog> </el-dialog>
<el-dialog
title="流程图"
:visible.sync="dialogActiveVisible"
width="50%">
<div style="height: auto;margin-bottom: 30px;">
<img :src="$imgBasePath+'downloadFlowActiveImg?procId='+procInsId+'&t='+new Date()" height="auto">
</div>
<div style="padding: 50px;">
<el-steps direction="vertical" >
<el-step
v-for="item in hiTasks"
:key="item.id"
:status="item.status"
:title="item.taskNodeName+' 审批人:' + item.assigneeName +' ' + item.startTime" style="margin-bottom: 10px;"></el-step>
</el-steps>
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from '../tickets/tickets-add-or-update'
import { apiUtils } from '@/utils/dict'
export default { export default {
data () { data () {
return { return {
procInsId:'',
dataForm: { dataForm: {
key: '' key: ''
}, },
dataList: [], dataList: [],
hiTasks:[],
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
totalPage: 0, totalPage: 0,
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false,
dialogVisible:false, dictConfigs: [{url: '/car/car/list', type: 'list', value: 'carId', label: 'carName'}, {type: 'dict', code: 'error_type'}, {url: '/flow/contract/list', type: 'list', value: 'contractId', label: 'contractNumber'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
dialogActiveVisible:false, dictData: [],
id:'' dialogFormVisible: false,
flowForm:{ticketsId: null},
dynamiForm:[],
users: [],
roles: [],
statusOpt: [{value: '0', label: '未开始'}, {value: '1', label: '已指派'}, {value: '2', label: '处理中'}, {value: '3', label: '已完成'}]
} }
}, },
mixins: [apiUtils],
components: {
AddOrUpdate
},
activated () { activated () {
this.getDataList() this.getDataList()
}, },
@@ -144,9 +216,10 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/flw/instance/myStartTaskList'), url: this.$http.adornUrl('/tickets/tickets/listType'),
method: 'get', method: 'post',
params: this.$http.adornParams({ params: this.$http.adornData({
'type': 'ASSIGN',
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'key': this.dataForm.key 'key': this.dataForm.key
@@ -162,71 +235,6 @@
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
approveHandle(id){
this.id = id
this.dialogVisible = true
},
showFlowHandle(procInsId){
this.procInsId = procInsId
// 通过流程实例id查询对应的流转记录
this.$http({
url: this.$http.adornUrl(`/flw/instance/getHiTaskInstance/${this.procInsId}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dialogActiveVisible = true
this.hiTasks = data.data
}
})
},
submitFlowComplete(){
// 做审批通过的操作
this.$http({
url: this.$http.adornUrl(`/flw/instance/completeFlow/${this.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dialogVisible = false
this.getDataList();
}
})
},
claimHandle(id){
this.$confirm('确定要拾取当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/claimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
unclaimHandle(id){
this.$confirm('确定要归还当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/unclaimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
@@ -242,10 +250,17 @@
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.ticketsId
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -253,7 +268,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/flow/flwdemodel/delete'), url: this.$http.adornUrl('/tickets/tickets/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
@@ -271,6 +286,45 @@
} }
}) })
}).catch(() => {}) }).catch(() => {})
},
startFlowHandle(id){
this.flowForm = {}
this.flowForm.ticketsId = id
this.$http({
url: this.$http.adornUrl('/flow/deploy/flowDef'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dynamiForm = [...data.data]
this.users = [...data.users]
this.roles = [...data.roles]
this.dialogFormVisible = true
}
})
},
submitStartFlow(){
// 提交表单数据
this.$http({
url: this.$http.adornUrl(`/flw/instance/startFlowInstance`),
method: 'get',
params: this.$http.adornParams(this.flowForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.flowForm = {}
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
} }
} }
} }

View File

@@ -22,71 +22,103 @@
width="50"> width="50">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="taskId" prop="ticketsId"
header-align="center" header-align="center"
align="center" align="center"
label="任务编号"> label="工单ID">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="taskName"
header-align="center" header-align="center"
align="center" align="center"
label="任务名称"> label="小车类型">
<template slot-scope="scope">
{{ dictData[0] | findByValue(scope.row.carType) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="taskDefKey"
header-align="center" header-align="center"
align="center" align="center"
label="任务KEY"> label="异常类型">
</el-table-column> <template slot-scope="scope">
{{ dictData[1] | findByValue(scope.row.errorType) }}
<el-table-column </template>
prop="startUserName"
header-align="center"
align="center"
label="流程发起人">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="startTime"
header-align="center" header-align="center"
align="center" align="center"
label="流程发起时间"> label="合同编号">
<template slot-scope="scope">
{{ dictData[2] | findByValue(scope.row.contractId) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="procDefId"
header-align="center" header-align="center"
align="center" align="center"
label="流程定义ID"> label="客户">
<template slot-scope="scope">
{{ dictData[3] | findByValue(scope.row.clientId) }}
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="procInsId" prop="description"
header-align="center" header-align="center"
align="center" align="center"
label="流程实例ID"> label="故障描述">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="assigneeName" prop="deptPeople"
header-align="center" header-align="center"
align="center" align="center"
label="审批人"> min-width="90px"
label="工单对接人">
</el-table-column>
<el-table-column
prop="deptPhone"
header-align="center"
align="center"
min-width="100px"
label="客户联系电话">
</el-table-column>
<el-table-column
prop="createUser"
header-align="center"
align="center"
label="创建者">
</el-table-column>
<el-table-column
prop="createTime"
header-align="center"
align="center"
min-width="90px"
label="创建时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="status" prop="status"
header-align="center" header-align="center"
align="center" align="center"
label="审批类型"> label="工单状态">
<template slot-scope="scope">
{{ statusOpt | findByValue(scope.row.status) }}
</template>
</el-table-column>
<el-table-column
prop="updateTime"
header-align="center"
align="center"
min-width="100px"
label="工单审批完成时间">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
fixed="right" fixed="right"
header-align="center" header-align="center"
align="center" align="center"
width="150" width="170"
label="操作"> label="操作">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" v-if="scope.row.assigneeName !== null" size="small" @click="approveHandle(scope.row.taskId)">审批</el-button> <el-button type="text" size="small" @click="addOrUpdateHandle(scope.row.ticketsId)">修改</el-button>
<el-button type="text" v-if="scope.row.status == 1 && scope.row.assigneeName === null" size="small" @click="claimHandle(scope.row.taskId)">拾取</el-button> <el-button type="text" size="small" @click="deleteHandle(scope.row.ticketsId)">删除</el-button>
<el-button type="text" v-if="scope.row.status == 1 && scope.row.assigneeName !== null" size="small" @click="unclaimHandle(scope.row.taskId)">归还</el-button> <el-button v-if="!scope.row.status" type="text" size="small" @click="startFlowHandle(scope.row.ticketsId)">指派</el-button>
<el-button type="text" size="small" @click="showFlowHandle(scope.row.procInsId)">查看流程进度</el-button> <el-button type="text" size="small" @click="$router.push(`/tickets-detail?id=${scope.row.ticketsId}`)">详情</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -99,38 +131,59 @@
:total="totalPage" :total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" :dictData="dictData" @refreshDataList="getDataList"></add-or-update>
<el-dialog <el-dialog
title="流程审批" title="发起流程"
:visible.sync="dialogVisible" :visible.sync="dialogFormVisible"
width="30%"> width="30%">
<div style="height: auto;margin-bottom: 30px;"> <el-form :model="flowForm" label-width="100px" class="demo-dynamic">
<el-form label-width="100px" class="demo-dynamic"> <el-form-item
<el-form-item> v-for="(form) in dynamiForm"
<el-button type="primary" @click="submitFlowComplete()">审批通过</el-button> :label="form.name"
</el-form-item> :key="form.key"
</el-form> :prop="form.key"
</div> >
<el-select v-if="form.type == 'assignee'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateUsers'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in users"
:key="item.userId"
:label="item.nickname+'['+item.username+']'"
:value="item.userId">
</el-option>
</el-select>
<el-select v-if="form.type == 'candidateGroups'" v-model="flowForm[form.key]" placeholder="请选择">
<el-option
v-for="item in roles"
:key="item.roleId"
:label="item.roleName"
:value="item.roleId">
</el-option>
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button size="mini" @click="dialogFormVisible = false">取消</el-button>
<el-button size="mini" type="primary" @click="submitStartFlow()">提交</el-button>
</span>
</el-dialog> </el-dialog>
<el-dialog
title="流程图"
:visible.sync="dialogActiveVisible"
width="50%">
<div style="height: auto;margin-bottom: 30px;">
<img :src="$imgBasePath+'downloadFlowActiveImg?procId='+procInsId+'&t='+new Date()" height="auto">
</div>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import AddOrUpdate from '../tickets/tickets-add-or-update'
import { apiUtils } from '@/utils/dict'
export default { export default {
data () { data () {
return { return {
procInsId:'',
dataForm: { dataForm: {
key: '' key: ''
}, },
@@ -141,11 +194,20 @@
dataListLoading: false, dataListLoading: false,
dataListSelections: [], dataListSelections: [],
addOrUpdateVisible: false, addOrUpdateVisible: false,
dialogVisible:false, dictConfigs: [{url: '/car/car/list', type: 'list', value: 'carId', label: 'carName'}, {type: 'dict', code: 'error_type'}, {url: '/flow/contract/list', type: 'list', value: 'contractId', label: 'contractNumber'}, {url: '/client/client/list', type: 'list', value: 'clientId', label: 'clientName'}],
dialogActiveVisible:false, dictData: [],
id:'' dialogFormVisible: false,
flowForm:{ticketsId: null},
dynamiForm:[],
users: [],
roles: [],
statusOpt: [{value: '0', label: '未开始'}, {value: '1', label: '已指派'}, {value: '2', label: '处理中'}, {value: '3', label: '已完成'}]
} }
}, },
mixins: [apiUtils],
components: {
AddOrUpdate
},
activated () { activated () {
this.getDataList() this.getDataList()
}, },
@@ -154,9 +216,10 @@
getDataList () { getDataList () {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/flw/instance/myTodoTaskList'), url: this.$http.adornUrl('/tickets/tickets/listType'),
method: 'get', method: 'post',
params: this.$http.adornParams({ params: this.$http.adornData({
'type': 'TO_BE_DONE',
'page': this.pageIndex, 'page': this.pageIndex,
'limit': this.pageSize, 'limit': this.pageSize,
'key': this.dataForm.key 'key': this.dataForm.key
@@ -172,61 +235,6 @@
this.dataListLoading = false this.dataListLoading = false
}) })
}, },
approveHandle(id){
this.id = id
this.dialogVisible = true
},
showFlowHandle(procInsId){
this.procInsId = procInsId
this.dialogActiveVisible = true
},
submitFlowComplete(){
// 做审批通过的操作
this.$http({
url: this.$http.adornUrl(`/flw/instance/completeFlow/${this.id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dialogVisible = false
this.getDataList();
}
})
},
claimHandle(id){
this.$confirm('确定要拾取当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/claimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
unclaimHandle(id){
this.$confirm('确定要归还当前的任务吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl(`/flw/instance/unclaimTask/${id}`),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.getDataList();
}
})
}).catch(() => {})
},
// 每页数 // 每页数
sizeChangeHandle (val) { sizeChangeHandle (val) {
this.pageSize = val this.pageSize = val
@@ -242,10 +250,17 @@
selectionChangeHandle (val) { selectionChangeHandle (val) {
this.dataListSelections = val this.dataListSelections = val
}, },
// 新增 / 修改
addOrUpdateHandle (id) {
this.addOrUpdateVisible = true
this.$nextTick(() => {
this.$refs.addOrUpdate.init(id)
})
},
// 删除 // 删除
deleteHandle (id) { deleteHandle (id) {
var ids = id ? [id] : this.dataListSelections.map(item => { var ids = id ? [id] : this.dataListSelections.map(item => {
return item.id return item.ticketsId
}) })
this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', { this.$confirm(`确定对[id=${ids.join(',')}]进行[${id ? '删除' : '批量删除'}]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@@ -253,7 +268,7 @@
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.$http({ this.$http({
url: this.$http.adornUrl('/flow/flwdemodel/delete'), url: this.$http.adornUrl('/tickets/tickets/delete'),
method: 'post', method: 'post',
data: this.$http.adornData(ids, false) data: this.$http.adornData(ids, false)
}).then(({data}) => { }).then(({data}) => {
@@ -271,6 +286,45 @@
} }
}) })
}).catch(() => {}) }).catch(() => {})
},
startFlowHandle(id){
this.flowForm = {}
this.flowForm.ticketsId = id
this.$http({
url: this.$http.adornUrl('/flow/deploy/flowDef'),
method: 'get',
params: this.$http.adornParams()
}).then(({data}) => {
if (data && data.code === 0) {
this.dynamiForm = [...data.data]
this.users = [...data.users]
this.roles = [...data.roles]
this.dialogFormVisible = true
}
})
},
submitStartFlow(){
// 提交表单数据
this.$http({
url: this.$http.adornUrl(`/flw/instance/startFlowInstance`),
method: 'get',
params: this.$http.adornParams(this.flowForm)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.dialogFormVisible = false
this.flowForm = {}
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
} }
} }
} }