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

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

@@ -19,9 +19,22 @@ import TableHeader from '@/components/table/header/index.vue'
import { useRouter } from 'vue-router'
import { useDictData } from '@/stores/dictData'
import { getLoadTypeUserList } from '@/api/process-boot/interference'
import { ElMessage } from 'element-plus'
import { ElMessageBox } from 'element-plus/es'
import { cancelTerminalFormData } from '@/api/supervision-boot/terminal/index'
import addForm from './addForm.vue'
import { useAdminInfo } from '@/stores/adminInfo'
//获取登陆用户姓名和部门
const adminInfo = useAdminInfo()
const dictData = useDictData()
const { push } = useRouter()
const { push, beforeEach } = useRouter()
beforeEach((to, from) => {
if (from.path == '/bpm/instanceDetail') {
if (to.path == '/admin/terminalNetwotk') {
console.log('终端1111')
}
}
})
const TableHeaderRef = ref()
const tableRef = ref()
const areaOptionList = dictData.getBasicData('jibei_area')
@@ -134,7 +147,7 @@ const tableStore = new TableStore({
icon: 'el-icon-Open',
render: 'basicButton',
disabled: row => {
return row.status == 1 || row.status == 2
return row.createBy != adminInfo.$state.id || row.status != 3
},
click: row => {
addForms.value.open({
@@ -150,10 +163,10 @@ 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)
}
}
]
@@ -179,7 +192,26 @@ const addFormModel = () => {
})
}, 0)
}
/**取消流程操作*/
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 cancelTerminalFormData(data)
ElMessage.success('取消成功')
// 加载数据
tableStore.index()
}
const exportEvent = () => {
let form = JSON.parse(JSON.stringify(tableStore.table.params))
form.pageNum = 1