业务流程添加重新发起&取消

This commit is contained in:
zhujiyan
2024-06-04 16:54:33 +08:00
parent ed9bce09b3
commit a0c64a4232
19 changed files with 532 additions and 226 deletions

View File

@@ -46,7 +46,10 @@ import addForm from './components/addForm.vue'
import effectProblem from './components/effectProblem/index.vue'
import { planDetailsAudit, sendAlarm } from '@/api/supervision-boot/plan/index'
import { ElMessage } from 'element-plus'
import { useAdminInfo } from '@/stores/adminInfo'
import { cancelPlanFormData } from '@/api/supervision-boot/plan/index'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
defineOptions({
name: 'plan'
})
@@ -169,30 +172,12 @@ const tableStore = new TableStore({
icon: 'el-icon-EditPen',
render: 'basicButton',
click: row => {
console.log(row.processInstanceId,"000000000");
handleDetails(row.processInstanceId)
handleDetails(row.processInstanceId, row.historyInstanceId)
},
disabled: row => {
return !row.processInstanceId
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status == 1 || row.status == 2
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'productSetting',
title: '实施问题',
@@ -216,7 +201,24 @@ const tableStore = new TableStore({
handleAudit(row)
}
},
{
name: 'edit',
title: '重新发起',
type: 'warning',
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return (
row.createBy != adminInfo.$state.id || row.status !=3
)
},
click: row => {
addForms.value.open({
title: '重新发起',
row: row
})
}
},
{
name: 'cancel',
title: '取消',
@@ -224,10 +226,12 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status == 3 || row.status == 2 || row.status == 4
return (
row.createBy != adminInfo.$state.id || row.status != 1
)
},
click: row => {
// cancelLeave(row)
cancelLeave(row)
}
},
{
@@ -299,17 +303,19 @@ onMounted(() => {
tableStore.index()
})
//
const handleDetails = (id: any) => {
const handleDetails = (id: any, historyInstanceId: any) => {
push({
name: 'BpmProcessInstanceDetail',
query: {
id: id
state: {
id: id,
historyInstanceId
}
})
}
/** 提交审核按钮 */
const handleAudit = (row: any) => {
planDetailsAudit({ id: row.planId }).then(res => {
ElMessage.success('提交审核成功!')
tableStore.index()
})
}
@@ -320,6 +326,26 @@ const handleAlarmForm = (row: any) => {
tableStore.index()
})
}
/**取消流程操作*/
const cancelLeave = async (row: any) => {
// 二次确认
const { value } = await ElMessageBox.prompt('请输入取消原因', '取消流程', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /^[\s\S]*.*\S[\s\S]*$/, // 判断非空,且非空格
inputErrorMessage: '取消原因不能为空'
})
// 发起取消
let data = {
id: row.id,
processInstanceId: row.processInstanceId,
reason: value
}
await cancelPlanFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
// 实施问题按钮
const effectProblemList = ref()
const effectProblemForm: any = ref({})
@@ -333,5 +359,4 @@ const handleEffectProblem = (row: any) => {
}
})
}
</script>