Browse Source

企业信息

master
zy 2 months ago
parent
commit
19b86d8b25
  1. 54
      src/api/enterprise/index.ts
  2. 47
      src/api/qualification/index.ts
  3. 4
      src/locales/zh-CN.ts
  4. 1
      src/views/Login/components/useLogin.ts
  5. 171
      src/views/enterprise/EnterpriseForm.vue
  6. 259
      src/views/enterprise/index.vue
  7. 137
      src/views/qualification/EnterpriseQualificationForm.vue
  8. 259
      src/views/qualification/index.vue

54
src/api/enterprise/index.ts

@ -0,0 +1,54 @@
import request from '@/config/axios'
// 企业 VO
export interface EnterpriseVO {
id: number // 企业ID,主键
departmentId: number // 所属部门ID
userId: number // 管辖人员ID
type: string // 企业类型:1.大型、2.中型、3.小型、4.环保重点
region: string // 企业所属区域:1.东区、2.西区、3.北区、4.南区
enterprisesName: string // 企业名称
address: string // 企业地址
contactName: string // 环保负责人姓名
environmentalContactPhone: string // 企业环保负责人联系电话
registrationNumber: string // 企业注册号
introduction: string // 企业图文介绍
establishmentDate: Date // 企业成立时间
gpsLocation: string // 企业经纬度
createBy: string // 创建人
updateBy: string // 修改人
managerDeptId: number // 管理部门
}
// 企业 API
export const EnterpriseApi = {
// 查询企业分页
getEnterprisePage: async (params: any) => {
return await request.get({ url: `/system/enterprise/page`, params })
},
// 查询企业详情
getEnterprise: async (id: number) => {
return await request.get({ url: `/system/enterprise/get?id=` + id })
},
// 新增企业
createEnterprise: async (data: EnterpriseVO) => {
return await request.post({ url: `/system/enterprise/create`, data })
},
// 修改企业
updateEnterprise: async (data: EnterpriseVO) => {
return await request.put({ url: `/system/enterprise/update`, data })
},
// 删除企业
deleteEnterprise: async (id: number) => {
return await request.delete({ url: `/system/enterprise/delete?id=` + id })
},
// 导出企业 Excel
exportEnterprise: async (params) => {
return await request.download({ url: `/system/enterprise/export-excel`, params })
},
}

47
src/api/qualification/index.ts

@ -0,0 +1,47 @@
import request from '@/config/axios'
// 企业资质 VO
export interface EnterpriseQualificationVO {
id: number // 主键
enterpriseId: number // 企业ID
qualificationName: number // 资质名称,例如:排污许可证、环保合格证
expiryDate: Date // 资质到期日期
qualificationDescription: string // 资质描述,详细说明资质信息
updateBy: string // 修改人
createBy: string // 创建人
handleDate: Date // 办理日期
enterpriseAuth: string // 资质编号
}
// 企业资质 API
export const EnterpriseQualificationApi = {
// 查询企业资质分页
getEnterpriseQualificationPage: async (params: any) => {
return await request.get({ url: `/system/enterprise-qualification/page`, params })
},
// 查询企业资质详情
getEnterpriseQualification: async (id: number) => {
return await request.get({ url: `/system/enterprise-qualification/get?id=` + id })
},
// 新增企业资质
createEnterpriseQualification: async (data: EnterpriseQualificationVO) => {
return await request.post({ url: `/system/enterprise-qualification/create`, data })
},
// 修改企业资质
updateEnterpriseQualification: async (data: EnterpriseQualificationVO) => {
return await request.put({ url: `/system/enterprise-qualification/update`, data })
},
// 删除企业资质
deleteEnterpriseQualification: async (id: number) => {
return await request.delete({ url: `/system/enterprise-qualification/delete?id=` + id })
},
// 导出企业资质 Excel
exportEnterpriseQualification: async (params) => {
return await request.download({ url: `/system/enterprise-qualification/export-excel`, params })
},
}

4
src/locales/zh-CN.ts

@ -114,8 +114,8 @@ export default {
small: '小'
},
login: {
welcome: '欢迎使用本系统',
message: '开箱即用的中后台管理系统',
welcome: '欢迎使用智慧生态环保管理平台',
message: '',
tenantname: '租户名称',
username: '用户名',
password: '密码',

1
src/views/Login/components/useLogin.ts

@ -18,6 +18,7 @@ export function useLoginState() {
const getLoginState = computed(() => currentState.value)
function handleBackLogin() {
setLoginState(LoginStateEnum.LOGIN)
}

171
src/views/enterprise/EnterpriseForm.vue

@ -0,0 +1,171 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="所属部门ID" prop="departmentId">
<el-input v-model="formData.departmentId" placeholder="请输入所属部门ID" />
</el-form-item>
<el-form-item label="管辖人员ID" prop="userId">
<el-input v-model="formData.userId" placeholder="请输入管辖人员ID" />
</el-form-item>
<el-form-item label="企业类型:1.大型、2.中型、3.小型、4.环保重点" prop="type">
<el-select v-model="formData.type" placeholder="请选择企业类型:1.大型、2.中型、3.小型、4.环保重点">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="企业所属区域:1.东区、2.西区、3.北区、4.南区" prop="region">
<el-input v-model="formData.region" placeholder="请输入企业所属区域:1.东区、2.西区、3.北区、4.南区" />
</el-form-item>
<el-form-item label="企业名称" prop="enterprisesName">
<el-input v-model="formData.enterprisesName" placeholder="请输入企业名称" />
</el-form-item>
<el-form-item label="企业地址" prop="address">
<el-input v-model="formData.address" placeholder="请输入企业地址" />
</el-form-item>
<el-form-item label="环保负责人姓名" prop="contactName">
<el-input v-model="formData.contactName" placeholder="请输入环保负责人姓名" />
</el-form-item>
<el-form-item label="企业环保负责人联系电话" prop="environmentalContactPhone">
<el-input v-model="formData.environmentalContactPhone" placeholder="请输入企业环保负责人联系电话" />
</el-form-item>
<el-form-item label="企业注册号" prop="registrationNumber">
<el-input v-model="formData.registrationNumber" placeholder="请输入企业注册号" />
</el-form-item>
<el-form-item label="企业图文介绍" prop="introduction">
<el-input v-model="formData.introduction" placeholder="请输入企业图文介绍" />
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker
v-model="formData.establishmentDate"
type="date"
value-format="x"
placeholder="选择企业成立时间"
/>
</el-form-item>
<el-form-item label="企业经纬度" prop="gpsLocation">
<el-input v-model="formData.gpsLocation" placeholder="请输入企业经纬度" />
</el-form-item>
<el-form-item label="创建人" prop="createBy">
<el-input v-model="formData.createBy" placeholder="请输入创建人" />
</el-form-item>
<el-form-item label="修改人" prop="updateBy">
<el-input v-model="formData.updateBy" placeholder="请输入修改人" />
</el-form-item>
<el-form-item label="管理部门" prop="managerDeptId">
<el-input v-model="formData.managerDeptId" placeholder="请输入管理部门" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { EnterpriseApi, EnterpriseVO } from '@/api/enterprise'
/** 企业 表单 */
defineOptions({ name: 'EnterpriseForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
departmentId: undefined,
userId: undefined,
type: undefined,
region: undefined,
enterprisesName: undefined,
address: undefined,
contactName: undefined,
environmentalContactPhone: undefined,
registrationNumber: undefined,
introduction: undefined,
establishmentDate: undefined,
gpsLocation: undefined,
createBy: undefined,
updateBy: undefined,
managerDeptId: undefined,
})
const formRules = reactive({
type: [{ required: true, message: '企业类型:1.大型、2.中型、3.小型、4.环保重点不能为空', trigger: 'change' }],
region: [{ required: true, message: '企业所属区域:1.东区、2.西区、3.北区、4.南区不能为空', trigger: 'blur' }],
enterprisesName: [{ required: true, message: '企业名称不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await EnterpriseApi.getEnterprise(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as EnterpriseVO
if (formType.value === 'create') {
await EnterpriseApi.createEnterprise(data)
message.success(t('common.createSuccess'))
} else {
await EnterpriseApi.updateEnterprise(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
departmentId: undefined,
userId: undefined,
type: undefined,
region: undefined,
enterprisesName: undefined,
address: undefined,
contactName: undefined,
environmentalContactPhone: undefined,
registrationNumber: undefined,
introduction: undefined,
establishmentDate: undefined,
gpsLocation: undefined,
createBy: undefined,
updateBy: undefined,
managerDeptId: undefined,
}
formRef.value?.resetFields()
}
</script>

259
src/views/enterprise/index.vue

@ -0,0 +1,259 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="120px"
style="height: 150px"
>
<el-form-item label="企业名称" prop="enterprisesName">
<el-input
v-model="queryParams.enterprisesName"
placeholder="请输入企业名称"
clearables
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="专管员" prop="userId">
<el-input
v-model="queryParams.userId"
placeholder="请输入专管员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="企业类型" prop="type">
<el-select
v-model="queryParams.type"
placeholder="请选择企业类型"
clearable
class="!w-240px"
>
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="企业地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入企业地址"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="环保负责人姓名" prop="contactName">
<el-input
v-model="queryParams.contactName"
placeholder="请输入环保负责人姓名"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="负责人联系电话" prop="environmentalContactPhone">
<el-input
v-model="queryParams.environmentalContactPhone"
placeholder="请输入企业环保负责人联系电话"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker
v-model="queryParams.establishmentDate"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-220px"
/>
</el-form-item>
<el-form-item>
<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
type="primary"
plain
@click="openForm('create')"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="企业名称" fixed="left" width="180px" align="center" prop="enterprisesName" />
<el-table-column label="企业地址" align="center" width="130px" prop="address" />
<el-table-column label="环保负责人姓名" align="center" width="130px" prop="contactName" />
<el-table-column label="企业环保负责人联系电话" align="center" width="130px" prop="environmentalContactPhone" />
<el-table-column label="企业注册号" align="center" width="130px" prop="registrationNumber" />
<el-table-column label="企业图文介绍" align="center" width="130px" prop="introduction" />
<el-table-column label="企业成立时间" align="center" width="130px" prop="establishmentDate" />
<el-table-column label="企业经纬度" align="center" width="130px" prop="gpsLocation" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="修改人" align="center" prop="updateBy" />
<el-table-column label="管理部门" align="center" prop="managerDeptId" />
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<EnterpriseForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { EnterpriseApi, EnterpriseVO } from '@/api/enterprise'
import EnterpriseForm from './EnterpriseForm.vue'
/** 企业 列表 */
defineOptions({ name: 'Enterprise' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<EnterpriseVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
departmentId: undefined,
userId: undefined,
type: undefined,
region: undefined,
enterprisesName: undefined,
address: undefined,
contactName: undefined,
environmentalContactPhone: undefined,
registrationNumber: undefined,
introduction: undefined,
establishmentDate: [],
gpsLocation: undefined,
createBy: undefined,
createTime: [],
updateBy: undefined,
managerDeptId: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await EnterpriseApi.getEnterprisePage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EnterpriseApi.deleteEnterprise(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EnterpriseApi.exportEnterprise(queryParams)
download.excel(data, '企业.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

137
src/views/qualification/EnterpriseQualificationForm.vue

@ -0,0 +1,137 @@
<template>
<Dialog :title="dialogTitle" v-model="dialogVisible">
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="企业ID" prop="enterpriseId">
<el-input v-model="formData.enterpriseId" placeholder="请输入企业ID" />
</el-form-item>
<el-form-item label="资质名称,例如:排污许可证、环保合格证" prop="qualificationName">
<el-input v-model="formData.qualificationName" placeholder="请输入资质名称,例如:排污许可证、环保合格证" />
</el-form-item>
<el-form-item label="资质到期日期" prop="expiryDate">
<el-date-picker
v-model="formData.expiryDate"
type="date"
value-format="x"
placeholder="选择资质到期日期"
/>
</el-form-item>
<el-form-item label="资质描述,详细说明资质信息" prop="qualificationDescription">
<Editor v-model="formData.qualificationDescription" height="150px" />
</el-form-item>
<el-form-item label="修改人" prop="updateBy">
<el-input v-model="formData.updateBy" placeholder="请输入修改人" />
</el-form-item>
<el-form-item label="创建人" prop="createBy">
<el-input v-model="formData.createBy" placeholder="请输入创建人" />
</el-form-item>
<el-form-item label="办理日期" prop="handleDate">
<el-date-picker
v-model="formData.handleDate"
type="date"
value-format="x"
placeholder="选择办理日期"
/>
</el-form-item>
<el-form-item label="资质编号" prop="enterpriseAuth">
<el-input v-model="formData.enterpriseAuth" placeholder="请输入资质编号" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
</template>
</Dialog>
</template>
<script setup lang="ts">
import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
/** 企业资质 表单 */
defineOptions({ name: 'EnterpriseQualificationForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
enterpriseId: undefined,
qualificationName: undefined,
expiryDate: undefined,
qualificationDescription: undefined,
updateBy: undefined,
createBy: undefined,
handleDate: undefined,
enterpriseAuth: undefined,
})
const formRules = reactive({
qualificationName: [{ required: true, message: '资质名称,例如:排污许可证、环保合格证不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
//
if (id) {
formLoading.value = true
try {
formData.value = await EnterpriseQualificationApi.getEnterpriseQualification(id)
} finally {
formLoading.value = false
}
}
}
defineExpose({ open }) // open
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
//
formLoading.value = true
try {
const data = formData.value as unknown as EnterpriseQualificationVO
if (formType.value === 'create') {
await EnterpriseQualificationApi.createEnterpriseQualification(data)
message.success(t('common.createSuccess'))
} else {
await EnterpriseQualificationApi.updateEnterpriseQualification(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
enterpriseId: undefined,
qualificationName: undefined,
expiryDate: undefined,
qualificationDescription: undefined,
updateBy: undefined,
createBy: undefined,
handleDate: undefined,
enterpriseAuth: undefined,
}
formRef.value?.resetFields()
}
</script>

259
src/views/qualification/index.vue

@ -0,0 +1,259 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="企业ID" prop="enterpriseId">
<el-input
v-model="queryParams.enterpriseId"
placeholder="请输入企业ID"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="资质名称,例如:排污许可证、环保合格证" prop="qualificationName">
<el-input
v-model="queryParams.qualificationName"
placeholder="请输入资质名称,例如:排污许可证、环保合格证"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="资质到期日期" prop="expiryDate">
<el-date-picker
v-model="queryParams.expiryDate"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-220px"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createTime">
<el-date-picker
v-model="queryParams.createTime"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-220px"
/>
</el-form-item>
<el-form-item label="修改人" prop="updateBy">
<el-input
v-model="queryParams.updateBy"
placeholder="请输入修改人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="创建人" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入创建人"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="办理日期" prop="handleDate">
<el-date-picker
v-model="queryParams.handleDate"
value-format="YYYY-MM-DD HH:mm:ss"
type="daterange"
start-placeholder="开始日期"
end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
class="!w-220px"
/>
</el-form-item>
<el-form-item label="资质编号" prop="enterpriseAuth">
<el-input
v-model="queryParams.enterpriseAuth"
placeholder="请输入资质编号"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item>
<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
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['system:enterprise-qualification:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['system:enterprise-qualification:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<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="企业ID" align="center" prop="enterpriseId" />
<el-table-column label="资质名称,例如:排污许可证、环保合格证" align="center" prop="qualificationName" />
<el-table-column label="资质到期日期" align="center" prop="expiryDate" />
<el-table-column label="资质描述,详细说明资质信息" align="center" prop="qualificationDescription" />
<el-table-column
label="创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="修改人" align="center" prop="updateBy" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="办理日期" align="center" prop="handleDate" />
<el-table-column label="资质编号" align="center" prop="enterpriseAuth" />
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['system:enterprise-qualification:update']"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['system:enterprise-qualification:delete']"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<EnterpriseQualificationForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
import EnterpriseQualificationForm from './EnterpriseQualificationForm.vue'
/** 企业资质 列表 */
defineOptions({ name: 'EnterpriseQualification' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<EnterpriseQualificationVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
enterpriseId: undefined,
qualificationName: undefined,
expiryDate: [],
qualificationDescription: undefined,
createTime: [],
updateBy: undefined,
createBy: undefined,
handleDate: [],
enterpriseAuth: undefined,
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await EnterpriseQualificationApi.getEnterpriseQualificationPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
loading.value = false
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
getList()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
/** 添加/修改操作 */
const formRef = ref()
const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EnterpriseQualificationApi.deleteEnterpriseQualification(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EnterpriseQualificationApi.exportEnterpriseQualification(queryParams)
download.excel(data, '企业资质.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>
Loading…
Cancel
Save