|
@@ -4,27 +4,18 @@ import { FormConfigType } from '@/components/AForm/type'
|
|
|
import { ToolbarConfigType } from '@/components/AToolbar/type'
|
|
|
import { ColumnConfigType } from '@/components/ATable/type'
|
|
|
import { StrAnyObj, StrAnyObjArr } from '@/typings'
|
|
|
-import { useHandleData } from '@/utils/useHandleData'
|
|
|
-import { getPageApi, getDetailApi, addApi, editApi, deleteApi } from '@/api/system/config'
|
|
|
-import { getDoneListApi, getToDoPageApi } from '@/api/flow/execute'
|
|
|
+import { getDoneListApi, getToDoPageApi, handleApi } from '@/api/flow/execute'
|
|
|
import { getChartApi } from '@/api/flow/definition'
|
|
|
-import { Comment } from '@element-plus/icons-vue'
|
|
|
-import { nextTick } from 'vue'
|
|
|
|
|
|
const modules = import.meta.glob('@/views/**/*.vue')
|
|
|
|
|
|
const queryRef = ref<InstanceType<typeof AForm>>()
|
|
|
-const formRef = ref<InstanceType<typeof AForm>>()
|
|
|
|
|
|
const showQuery = ref<boolean>(true)
|
|
|
const pageTotal = ref<number>(0)
|
|
|
|
|
|
const queryData = ref<StrAnyObj>({ pageNum: 1, pageSize: 10 })
|
|
|
const tableData = ref<StrAnyObjArr>([])
|
|
|
-const formData = ref<StrAnyObj>({})
|
|
|
-
|
|
|
-const dialogTitle = ref<string>('')
|
|
|
-const dialogVisible = ref<boolean>(false)
|
|
|
|
|
|
const chartVisible = ref(false)
|
|
|
const imgUrl = ref('')
|
|
@@ -32,10 +23,12 @@ const imgUrl = ref('')
|
|
|
const doneListVisible = ref(false)
|
|
|
const doneList = ref([])
|
|
|
|
|
|
+const handleData = ref({})
|
|
|
+
|
|
|
const handleVisible = ref(false)
|
|
|
const handleComponent = ref(null)
|
|
|
const businessId = ref(null)
|
|
|
-const handleDisabled = ref(true)
|
|
|
+const taskId = ref(null)
|
|
|
|
|
|
const queryConfig: FormConfigType[] = [
|
|
|
{
|
|
@@ -74,14 +67,6 @@ const toolbarConfig: ToolbarConfigType[] = [
|
|
|
getPage()
|
|
|
}
|
|
|
}
|
|
|
- // {
|
|
|
- // common: 'add',
|
|
|
- // permissions: 'sysConfig:add',
|
|
|
- // click() {
|
|
|
- // dialogVisible.value = true
|
|
|
- // dialogTitle.value = '新增'
|
|
|
- // }
|
|
|
- // }
|
|
|
]
|
|
|
|
|
|
const columnConfig: ColumnConfigType[] = [
|
|
@@ -132,6 +117,7 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
return
|
|
|
}
|
|
|
businessId.value = row.businessId
|
|
|
+ taskId.value = row.id
|
|
|
handleComponent.value = markRaw(defineAsyncComponent(module))
|
|
|
handleVisible.value = true
|
|
|
}
|
|
@@ -158,41 +144,6 @@ const columnConfig: ColumnConfigType[] = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
-const formConfig: FormConfigType[] = [
|
|
|
- {
|
|
|
- type: 'input',
|
|
|
- prop: 'name',
|
|
|
- label: '参数名称',
|
|
|
- rule: [{ required: true, message: '参数名称不能为空', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'input',
|
|
|
- prop: 'code',
|
|
|
- label: '参数编码',
|
|
|
- rule: [{ required: true, message: '参数编码不能为空', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'input',
|
|
|
- prop: 'value',
|
|
|
- label: '参数值',
|
|
|
- rule: [{ required: true, message: '参数键值不能为空', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'radio',
|
|
|
- prop: 'builtin',
|
|
|
- label: '系统内置',
|
|
|
- dict: 'yes_no',
|
|
|
- rule: [{ required: true, message: '系统内置不能为空', trigger: 'blur' }]
|
|
|
- },
|
|
|
- {
|
|
|
- type: 'input',
|
|
|
- prop: 'remark',
|
|
|
- label: '备注',
|
|
|
- itemType: 'textarea',
|
|
|
- rows: 5
|
|
|
- }
|
|
|
-]
|
|
|
-
|
|
|
const doneListColumnConfig: ColumnConfigType[] = [
|
|
|
{
|
|
|
prop: 'nodeName',
|
|
@@ -217,6 +168,21 @@ const doneListColumnConfig: ColumnConfigType[] = [
|
|
|
}
|
|
|
]
|
|
|
|
|
|
+const handleConfig: FormConfigType[] = [
|
|
|
+ {
|
|
|
+ type: 'input',
|
|
|
+ itemType: 'textarea',
|
|
|
+ label: '审批意见',
|
|
|
+ prop: 'message',
|
|
|
+ rows: 5
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: 'slot',
|
|
|
+ label: '审批类型',
|
|
|
+ prop: 'handle'
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
getPage()
|
|
|
})
|
|
@@ -228,27 +194,14 @@ function getPage() {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-function formSubmit() {
|
|
|
- formRef.value?.validate(() => {
|
|
|
- if (formData.value.id) {
|
|
|
- editApi(formData.value).then(() => {
|
|
|
- dialogVisible.value = false
|
|
|
- ElMessage.success('修改成功')
|
|
|
- getPage()
|
|
|
- })
|
|
|
- } else {
|
|
|
- addApi(formData.value).then(() => {
|
|
|
- dialogVisible.value = false
|
|
|
- ElMessage.success('新增成功')
|
|
|
- getPage()
|
|
|
- })
|
|
|
- }
|
|
|
+function handle(handleType) {
|
|
|
+ const message = handleData.value.message
|
|
|
+ handleApi({ taskId: taskId.value, handleType, message }).then(() => {
|
|
|
+ getPage()
|
|
|
+ ElMessage.success('办理成功')
|
|
|
+ this.handleVisible = false
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
-function formClosed() {
|
|
|
- formRef.value?.resetFields()
|
|
|
-}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -270,21 +223,23 @@ function formClosed() {
|
|
|
>
|
|
|
</a-table>
|
|
|
|
|
|
- <a-dialog
|
|
|
- v-model="dialogVisible"
|
|
|
- :title="dialogTitle"
|
|
|
- @submit="formSubmit"
|
|
|
- @closed="formClosed"
|
|
|
- >
|
|
|
- <a-form ref="formRef" v-model="formData" :config="formConfig" :span="24"> </a-form>
|
|
|
- </a-dialog>
|
|
|
-
|
|
|
- <a-dialog title="办理" v-model="handleVisible" width="1200px" :footer="false">
|
|
|
- <component :is="handleComponent" :businessId="businessId" />
|
|
|
- <template #footer>
|
|
|
- <el-button @click="handleVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submit">通 过</el-button>
|
|
|
- </template>
|
|
|
+ <a-dialog title="" v-model="handleVisible" width="1200px" :footer="false">
|
|
|
+ <el-card shadow="always">
|
|
|
+ <template #header>流程明细</template>
|
|
|
+ <component :is="handleComponent" :businessId="businessId" />
|
|
|
+ </el-card>
|
|
|
+
|
|
|
+ <el-card shadow="always" style="margin-top: 20px">
|
|
|
+ <template #header>办理参数</template>
|
|
|
+ <a-form v-model="handleData" :config="handleConfig" :span="24">
|
|
|
+ <template #handle>
|
|
|
+ <el-button type="primary" @click="handle(1)">通 过</el-button>
|
|
|
+ <el-button type="primary" @click="handle(2)">回 退</el-button>
|
|
|
+ <el-button type="primary" @click="handle(3)">拒 绝</el-button>
|
|
|
+ <el-button @click="handleVisible = false">关 闭</el-button>
|
|
|
+ </template>
|
|
|
+ </a-form>
|
|
|
+ </el-card>
|
|
|
</a-dialog>
|
|
|
|
|
|
<a-dialog title="流程图" v-model="chartVisible" width="1200px" :footer="false">
|