企业信息管理修改为工作流版本

This commit is contained in:
Wayne 2024-05-07 08:44:03 +08:00
parent 9952cabc8f
commit 088ac654a1
8 changed files with 393 additions and 22 deletions

View File

@ -127,7 +127,6 @@ const remainingRouter: AppRouteRecordRaw[] = [
} }
] ]
}, },
{ {
path: '/codegen', path: '/codegen',
component: Layout, component: Layout,
@ -325,6 +324,30 @@ const remainingRouter: AppRouteRecordRaw[] = [
title: '查看 OA 请假', title: '查看 OA 请假',
activeMenu: '/bpm/oa/leave' activeMenu: '/bpm/oa/leave'
} }
},
{
path: 'fta/enterprise/create',
component: () => import('@/views/fta/enterpriseinformation/create.vue'),
name: 'FtaEnterpriseCreate',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '发起 企业信息填报 请假',
activeMenu: '/enterpriseInformation/enterprise-information'
}
},
{
path: 'fta/enterprise/detail',
component: () => import('@/views/fta/enterpriseinformation/detail.vue'),
name: 'FtaEnterpriseDetail',
meta: {
noCache: true,
hidden: true,
canTo: true,
title: '查看 企业信息填报 请假',
activeMenu: '/enterpriseInformation/enterprise-information'
}
} }
] ]
}, },

View File

@ -101,7 +101,7 @@ const formRules = reactive({
const formRef = ref() // Ref const formRef = ref() // Ref
// //
const processDefineKey = 'oa_leave' // Key const processDefineKey = 'oa_leave_new' // Key
const startUserSelectTasks = ref([]) // const startUserSelectTasks = ref([]) //
const startUserSelectAssignees = ref({}) // const startUserSelectAssignees = ref({}) //
const startUserSelectAssigneesFormRef = ref() // Ref const startUserSelectAssigneesFormRef = ref() // Ref

View File

@ -34,9 +34,9 @@
value-format="YYYY-MM-DD HH:mm:ss" value-format="YYYY-MM-DD HH:mm:ss"
/> />
</el-form-item> </el-form-item>
<el-form-item label="审批结果" prop="result"> <el-form-item label="审批结果" prop="status">
<el-select <el-select
v-model="queryParams.result" v-model="queryParams.status"
class="!w-240px" class="!w-240px"
clearable clearable
placeholder="请选择审批结果" placeholder="请选择审批结果"
@ -79,9 +79,9 @@
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column align="center" label="申请编号" prop="id" /> <el-table-column align="center" label="申请编号" prop="id" />
<el-table-column align="center" label="状态" prop="result"> <el-table-column align="center" label="状态" prop="status">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.result" /> <dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -130,7 +130,7 @@
进度 进度
</el-button> </el-button>
<el-button <el-button
v-if="scope.row.result === 1" v-if="scope.row.status === 1"
v-hasPermi="['bpm:oa-leave:create']" v-hasPermi="['bpm:oa-leave:create']"
link link
type="danger" type="danger"
@ -171,7 +171,7 @@ const queryParams = reactive({
type: undefined, type: undefined,
status: undefined, status: undefined,
reason: undefined, reason: undefined,
createTime: [] createTime: [] as []
}) })
const queryFormRef = ref() // const queryFormRef = ref() //

View File

@ -269,7 +269,7 @@ const getProcessInstance = async () => {
return return
} }
processInstance.value = data processInstance.value = data
console.log("获取到的流程实例:",data)
// //
const processDefinition = data.processDefinition const processDefinition = data.processDefinition
if (processDefinition.formType === 10) { if (processDefinition.formType === 10) {

View File

@ -0,0 +1,215 @@
<template>
<el-form
ref="formRef"
v-loading="formLoading"
:model="formData"
:rules="formRules"
label-width="100px"
>
<el-form-item label="企业名称" prop="name">
<el-input v-model="formData.name" placeholder="请输入企业名称" />
</el-form-item>
<el-form-item label="企业法定代表人" prop="legalPerson">
<el-input v-model="formData.legalPerson" placeholder="请输入企业法定代表人" />
</el-form-item>
<el-form-item label="统一信用代码" prop="unifiedCreditCode">
<el-input v-model="formData.unifiedCreditCode" placeholder="请输入统一信用代码" />
</el-form-item>
<el-form-item label="电话" prop="telephone">
<el-input v-model="formData.telephone" placeholder="请输入电话" />
</el-form-item>
<el-form-item label="邮箱" prop="mailbox">
<el-input v-model="formData.mailbox" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="注册地址" prop="registerAddress">
<el-input v-model="formData.registerAddress" placeholder="请输入注册地址" />
</el-form-item>
<el-form-item label="通信地址" prop="communicationAddress">
<el-input v-model="formData.communicationAddress" placeholder="请输入通信地址" />
</el-form-item>
<el-form-item label="经营状态" prop="operateState">
<el-select v-model="formData.operateState" placeholder="请选择经营状态">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ENTERPRISE_OPERATE_STATE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="成立日期" prop="establishDate">
<el-date-picker
v-model="formData.establishDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择成立日期"
/>
</el-form-item>
<el-form-item label="企业类型" prop="enterpriseType">
<el-select v-model="formData.enterpriseType" placeholder="请选择企业类型">
<el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ENTERPRISE_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="企业所属地区" prop="enterpriseBelongingToRegion">
<el-input v-model="formData.enterpriseBelongingToRegion" placeholder="请输入企业所属地区" />
</el-form-item>
<el-form-item label="企业所属行业" prop="enterpriseBelongingToIndustry">
<el-input v-model="formData.enterpriseBelongingToIndustry" placeholder="请输入企业所属行业" />
</el-form-item>
<el-form-item label="登记机关" prop="registerOffice">
<el-input v-model="formData.registerOffice" placeholder="请输入登记机关" />
</el-form-item>
<el-form-item label="经营许可范围" prop="operatePermitRange">
<el-input v-model="formData.operatePermitRange" placeholder="请输入经营许可范围" />
</el-form-item>
<el-col v-if="startUserSelectTasks.length > 0">
<el-card class="mb-10px">
<template #header>指定审批人</template>
<el-form
:model="startUserSelectAssignees"
:rules="startUserSelectAssigneesFormRules"
ref="startUserSelectAssigneesFormRef"
>
<el-form-item
v-for="userTask in startUserSelectTasks"
:key="userTask.id"
:label="`任务【${userTask.name}】`"
:prop="userTask.id"
>
<el-select
v-model="startUserSelectAssignees[userTask.id]"
multiple
placeholder="请选择审批人"
>
<el-option
v-for="user in userList"
:key="user.id"
:label="user.nickname"
:value="user.id"
/>
</el-select>
</el-form-item>
</el-form>
</el-card>
</el-col>
<el-form-item>
<el-button :disabled="formLoading" type="primary" @click="submitForm"> </el-button>
</el-form-item>
</el-form>
</template>
<script lang="ts" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { EnterpriseInformationApi, EnterpriseInformationVO } from '@/api/fta/enterpriseinformation'
import { useTagsViewStore } from '@/store/modules/tagsView'
import * as DefinitionApi from '@/api/bpm/definition'
import * as UserApi from '@/api/system/user'
defineOptions({ name: 'EnterpriseInformationCreate' })
const message = useMessage() //
const { delView } = useTagsViewStore() //
const { push, currentRoute } = useRouter() //
const formLoading = ref(false) // 12
const formData = ref({
id: undefined,
name: undefined,
legalPerson: undefined,
unifiedCreditCode: undefined,
telephone: undefined,
mailbox: undefined,
registerAddress: undefined,
communicationAddress: undefined,
operateState: undefined,
establishDate: undefined,
enterpriseType: undefined,
enterpriseBelongingToRegion: undefined,
enterpriseBelongingToIndustry: undefined,
registerOffice: undefined,
operatePermitRange: undefined,
})
const formRules = reactive({
name: [{ required: true, message: '企业名称不能为空', trigger: 'blur' }],
legalPerson: [{ required: true, message: '企业法定代表人不能为空', trigger: 'blur' }],
unifiedCreditCode: [{ required: true, message: '统一信用代码不能为空', trigger: 'blur' }],
telephone: [{ required: true, message: '电话不能为空', trigger: 'blur' }],
mailbox: [{ required: true, message: '邮箱不能为空', trigger: 'blur' }],
registerAddress: [{ required: true, message: '注册地址不能为空', trigger: 'blur' }],
communicationAddress: [{ required: true, message: '通信地址不能为空', trigger: 'blur' }],
operateState: [{ required: true, message: '经营状态不能为空', trigger: 'change' }],
establishDate: [{ required: true, message: '成立日期不能为空', trigger: 'blur' }],
enterpriseType: [{ required: true, message: '企业类型不能为空', trigger: 'change' }],
enterpriseBelongingToRegion: [{ required: true, message: '企业所属地区不能为空', trigger: 'blur' }],
enterpriseBelongingToIndustry: [{ required: true, message: '企业所属行业不能为空', trigger: 'blur' }],
registerOffice: [{ required: true, message: '登记机关不能为空', trigger: 'blur' }],
operatePermitRange: [{ required: true, message: '经营许可范围不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
//
const processDefineKey = 'fta_enterprise' // Key
const startUserSelectTasks = ref([]) //
const startUserSelectAssignees = ref({}) //
const startUserSelectAssigneesFormRef = ref() // Ref
const startUserSelectAssigneesFormRules = ref({}) // Rules
const userList = ref<any[]>([]) //
/** 提交表单 */
const submitForm = async () => {
//
if (!formRef) return
const valid = await formRef.value.validate()
if (!valid) return
//
if (startUserSelectTasks.value?.length > 0) {
await startUserSelectAssigneesFormRef.value.validate()
}
//
formLoading.value = true
try {
const data = { ...formData.value } as unknown as EnterpriseInformationVO
//
if (startUserSelectTasks.value?.length > 0) {
data.startUserSelectAssignees = startUserSelectAssignees.value
}
await EnterpriseInformationApi.createEnterpriseInformation(data)
message.success('发起成功')
// Tab
delView(unref(currentRoute))
await push({ name: 'EnterpriseInformation' })
} finally {
formLoading.value = false
}
}
/** 初始化 */
onMounted(async () => {
const processDefinitionDetail = await DefinitionApi.getProcessDefinition(
undefined,
processDefineKey
)
if (!processDefinitionDetail) {
message.error('创建企业信息的流程模型未配置,请检查!')
return
}
startUserSelectTasks.value = processDefinitionDetail.startUserSelectTasks
//
if (startUserSelectTasks.value?.length > 0) {
//
for (const userTask of startUserSelectTasks.value) {
startUserSelectAssignees.value[userTask.id] = []
startUserSelectAssigneesFormRules.value[userTask.id] = [
{ required: true, message: '请选择审批人', trigger: 'blur' }
]
}
//
userList.value = await UserApi.getSimpleUserList()
}
})
</script>

View File

@ -0,0 +1,81 @@
<template>
<ContentWrap>
<el-descriptions :column="1" border>
<el-descriptions-item label="企业名称">
{{ detailData.name }}
</el-descriptions-item>
<el-descriptions-item label="企业法定代表人">
{{ detailData.legalPerson }}
</el-descriptions-item>
<el-descriptions-item label="统一信用代码">
{{ detailData.unifiedCreditCode }}
</el-descriptions-item>
<el-descriptions-item label="电话">
{{ detailData.telephone }}
</el-descriptions-item>
<el-descriptions-item label="邮箱">
{{ detailData.mailbox }}
</el-descriptions-item>
<el-descriptions-item label="注册地址">
{{ detailData.registerAddress }}
</el-descriptions-item>
<el-descriptions-item label="通信地址">
{{ detailData.communicationAddress }}
</el-descriptions-item>
<el-descriptions-item label="经营状态">
<dict-tag :type="DICT_TYPE.ENTERPRISE_OPERATE_STATE" :value="detailData.operateState" />
</el-descriptions-item>
<el-descriptions-item label="成立日期">
{{ formatDate(detailData.establishDate, 'YYYY-MM-DD') }}
</el-descriptions-item>
<el-descriptions-item label="企业类型">
<dict-tag :type="DICT_TYPE.ENTERPRISE_TYPE" :value="detailData.enterpriseType" />
</el-descriptions-item>
<el-descriptions-item label="企业所属地区">
{{ detailData.enterpriseBelongingToRegion }}
</el-descriptions-item>
<el-descriptions-item label="企业所属行业">
{{ detailData.enterpriseBelongingToIndustry }}
</el-descriptions-item>
<el-descriptions-item label="登记机关">
{{ detailData.registerOffice }}
</el-descriptions-item>
<el-descriptions-item label="经营许可范围">
{{ detailData.operatePermitRange }}
</el-descriptions-item>
</el-descriptions>
</ContentWrap>
</template>
<script lang="ts" setup>
import { DICT_TYPE } from '@/utils/dict'
import { formatDate } from '@/utils/formatTime'
import { propTypes } from '@/utils/propTypes'
import { EnterpriseInformationApi } from '@/api/fta/enterpriseinformation'
defineOptions({ name: 'FtaEnterpriseDetail' })
const { query } = useRoute() //
const props = defineProps({
id: propTypes.number.def(undefined)
})
const detailLoading = ref(false) //
const detailData = ref<any>({}) //
const queryId = query.id as unknown as number // URL id
/** 获得数据 */
const getInfo = async () => {
detailLoading.value = true
try {
detailData.value = await EnterpriseInformationApi.getEnterpriseInformation(props.id || queryId)
} finally {
detailLoading.value = false
}
}
defineExpose({ open: getInfo }) // open
/** 初始化 **/
onMounted(() => {
getInfo()
})
</script>

View File

@ -117,6 +117,10 @@
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button>
<el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button> <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
<el-button plain type="primary" @click="handleCreate()">
<Icon class="mr-5px" icon="ep:plus" />
发起创建
</el-button>
<el-button <el-button
type="primary" type="primary"
plain plain
@ -142,6 +146,11 @@
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true"> <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="编号" align="center" prop="id" /> <el-table-column label="编号" align="center" prop="id" />
<el-table-column align="center" label="状态" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.BPM_PROCESS_INSTANCE_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column <el-table-column
label="创建时间" label="创建时间"
align="center" align="center"
@ -161,7 +170,11 @@
<dict-tag :type="DICT_TYPE.ENTERPRISE_OPERATE_STATE" :value="scope.row.operateState" /> <dict-tag :type="DICT_TYPE.ENTERPRISE_OPERATE_STATE" :value="scope.row.operateState" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="成立日期" align="center" prop="establishDate" /> <el-table-column label="成立日期" align="center" prop="establishDate">
<template #default="scope">
{{ formatDate(scope.row.establishDate, 'YYYY-MM-DD') }}
</template>
</el-table-column>
<el-table-column label="企业类型" align="center" prop="enterpriseType"> <el-table-column label="企业类型" align="center" prop="enterpriseType">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.ENTERPRISE_TYPE" :value="scope.row.enterpriseType" /> <dict-tag :type="DICT_TYPE.ENTERPRISE_TYPE" :value="scope.row.enterpriseType" />
@ -170,23 +183,29 @@
<el-table-column label="企业所属行业" align="center" prop="enterpriseBelongingToIndustry" /> <el-table-column label="企业所属行业" align="center" prop="enterpriseBelongingToIndustry" />
<el-table-column label="登记机关" align="center" prop="registerOffice" /> <el-table-column label="登记机关" align="center" prop="registerOffice" />
<el-table-column label="经营许可范围" align="center" prop="operatePermitRange" /> <el-table-column label="经营许可范围" align="center" prop="operatePermitRange" />
<el-table-column label="操作" align="center"> <el-table-column align="center" label="操作">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
type="primary" type="primary"
@click="openForm('update', scope.row.id)" @click="handleDetail(scope.row)"
v-hasPermi="['fta:enterprise-information:update']"
> >
编辑 详情
</el-button> </el-button>
<el-button <el-button
link link
type="danger" type="primary"
@click="handleDelete(scope.row.id)" @click="handleProcessDetail(scope.row)"
v-hasPermi="['fta:enterprise-information:delete']"
> >
删除 进度
</el-button>
<el-button
v-if="scope.row.result === 1"
link
type="danger"
@click="cancelLeave(scope.row)"
>
取消
</el-button> </el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -210,12 +229,14 @@ import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { EnterpriseInformationApi, EnterpriseInformationVO } from '@/api/fta/enterpriseinformation' import { EnterpriseInformationApi, EnterpriseInformationVO } from '@/api/fta/enterpriseinformation'
import EnterpriseInformationForm from './EnterpriseInformationForm.vue' import EnterpriseInformationForm from './EnterpriseInformationForm.vue'
import { formatDate } from '@/utils/formatTime'
/** 企业信息 列表 */ /** 企业信息 列表 */
defineOptions({ name: 'EnterpriseInformation' }) defineOptions({ name: 'EnterpriseInformation' })
const message = useMessage() // const message = useMessage() //
const { t } = useI18n() // const { t } = useI18n() //
const router = useRouter() //
const loading = ref(true) // const loading = ref(true) //
const list = ref<EnterpriseInformationVO[]>([]) // const list = ref<EnterpriseInformationVO[]>([]) //
@ -267,6 +288,32 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id) formRef.value.open(type, id)
} }
/** 添加操作 */
const handleCreate = () => {
router.push({ name: 'FtaEnterpriseCreate' })
}
/** 详情操作 */
const handleDetail = (row: EnterpriseInformationVO) => {
router.push({
name: 'FtaEnterpriseDetail',
query: {
id: row.id
}
})
}
/** 审批进度 */
const handleProcessDetail = (row) => {
console.log("审批进度当前行数据:",row.processInstanceId)
router.push({
name: 'BpmProcessInstanceDetail',
query: {
id: row.processInstanceId
}
})
}
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (id: number) => { const handleDelete = async (id: number) => {
try { try {
@ -295,6 +342,14 @@ const handleExport = async () => {
} }
} }
// fix:
watch(
() => router.currentRoute.value,
() => {
getList()
}
)
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
getList() getList()

View File

@ -1,7 +1,4 @@
<template> <template>
<doc-alert title="用户体系" url="https://doc.iocoder.cn/user-center/" />
<doc-alert title="三方登陆" url="https://doc.iocoder.cn/social-user/" />
<doc-alert title="Excel 导入导出" url="https://doc.iocoder.cn/excel-import-and-export/" />
<el-row :gutter="20"> <el-row :gutter="20">
<!-- 左侧部门树 --> <!-- 左侧部门树 -->