Browse Source

Merge remote-tracking branch 'origin/master'

master
DX 1 month ago
parent
commit
dfc60df924
  1. 2
      .env.local
  2. 99
      src/api/qualification/index.ts
  3. 23
      src/components/UploadFile/src/UploadImgs.vue
  4. 1
      src/views/Home/Index.vue
  5. 108
      src/views/enterprises/update.vue
  6. 87
      src/views/qualification/EnterpriseQualificationForm.vue
  7. 59
      src/views/qualification/index.vue

2
.env.local

@ -4,7 +4,7 @@ NODE_ENV=development
VITE_DEV=true
# 请求路径
VITE_BASE_URL='http://188.188.3.232:48080'
VITE_BASE_URL='http://localhost:48080'
#VITE_BASE_URL='http://188.188.4.176:48080'
#VITE_BASE_URL='http://192.168.2.63:48080'

99
src/api/qualification/index.ts

@ -1,47 +1,52 @@
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 })
},
}
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 })
},
// 查询企业资质分页
getEnterpriseQualificationPageEnterprise: async (params: any) => {
return await request.get({ url: `/system/enterprise-qualification/pageEnterprise`, 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 })
},
}

23
src/components/UploadFile/src/UploadImgs.vue

@ -16,15 +16,17 @@
:on-success="uploadSuccess"
list-type="picture-card"
>
<div class="upload-empty">
<slot name="empty">
<Icon icon="ep:plus" />
<!-- <span>请上传图片</span> -->
</slot>
</div>
<div class="upload-empty" v-if="!disabled">
<slot name="empty">
<Icon icon="ep:plus" />
<!-- <span>请上传图片</span> -->
</slot>
</div>
<template #file="{ file }">
<img :src="file.url" class="upload-image" />
<div class="upload-handle" @click.stop>
<div class="handle-icon" @click="imagePreview(file.url!)">
<Icon icon="ep:zoom-in" />
<span>查看</span>
@ -123,7 +125,7 @@ const uploadSuccess: UploadProps['onSuccess'] = (res: any): void => {
//
const index = fileList.value.findIndex((item) => item.response?.data === res.data)
fileList.value.splice(index, 1)
uploadList.value.push({ id: res.data.file_id, url: res.data.url })
uploadList.value.push({ id: res.data.id, url: res.data.url })
if (uploadList.value.length == uploadNumber.value) {
fileList.value.push(...uploadList.value)
uploadList.value = []
@ -189,11 +191,12 @@ const handleExceed = () => {
}
}
:deep(.disabled) {
:deep(.is-disabled) {
.el-upload--picture-card,
.el-upload-dragger {
display: none !important;
cursor: not-allowed;
background: var(--el-disabled-bg-color) !important;
background: var(--el-disabled-bg-color);
border: 1px dashed var(--el-border-color-darker);
&:hover {
@ -202,6 +205,8 @@ const handleExceed = () => {
}
}
.upload-box {
.no-border {
:deep(.el-upload--picture-card) {

1
src/views/Home/Index.vue

@ -22,7 +22,6 @@
</el-card>
</el-col>
<el-col :xl="8" :lg="8" :md="24" :sm="24" :xs="24">
<el-card shadow="hover" class="mb-8px">
<template #header>
月任务概况

108
src/views/enterprises/update.vue

@ -75,12 +75,8 @@
<el-input v-model="formData.introduction" type="textarea" placeholder="请输入企业介绍" />
</el-form-item>
<el-form-item label="企业照片" prop="fileIds">
<UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
</el-form-item>
<el-form-item label="企业资质" prop="fileIds">
<UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
</el-form-item>
<UploadImgs v-model="fileList" :limit="3" height="100px" width="100px" />
</el-form-item>
@ -140,21 +136,59 @@
<SelectUser ref="selectUserRef" @select-user="echoUser" />
</ContentWrap>
<ContentWrap title="资质记录" v-if="formType === 'update'">
<el-card title="资质记录" v-if="formType === 'update'">
<template #header>
<div class="flex items-center justify-between">
<span class="text-16px font-700">资质记录</span>
<el-button type="primary" @click="openQualForm('create')">新增</el-button>
</div>
</template>
<el-table v-loading="loading" :data="qualificationlist" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="资质图片" align="center" fixed="left" prop="files" >
<template #default="scope">
<UploadImgs :disabled="true" v-model="scope.row.files" :limit="3" height="100px" width="100px" />
</template>
</el-table-column>
<el-table-column label="资质编号" align="center" fixed="left" prop="enterpriseAuth" />
<el-table-column label="资质名称" align="center" fixed="left" prop="qualificationName" />
<el-table-column label="资质描述" align="center" fixed="left" prop="qualificationDescription" />
<el-table-column label="资质名称" align="center" fixed="left" prop="qualificationName" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.ENTERPRISES_QUA" :value="scope.row.qualificationName" />
</template>
</el-table-column>
<el-table-column
label="资质到期日期"
align="center"
prop="expiryDate"
:formatter="dateFormatter"
:formatter="dateFormatter2"
width="180px"
/>
</el-table>
</ContentWrap>
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
type="primary"
@click="openQualForm('update', scope.row.id)"
>
编辑
</el-button>
<el-button
link
type="danger"
@click="handQualDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 表单弹窗添加/修改 -->
<EnterpriseQualificationForm ref="formQualRef" @success="getQualificationList" />
<ContentWrap title="执法记录" v-if="formType === 'update'">
<div class="demo-collapse">
<el-collapse v-model="activeNames" @change="handleChange">
@ -203,6 +237,7 @@ import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises'
import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
import { UserVO, getSimpleUserListByUserType } from '@/api/system/user'
import EnterpriseQualificationForm from '@/views/qualification/EnterpriseQualificationForm.vue'
import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections'
@ -212,7 +247,7 @@ import { ElMessage } from 'element-plus'
import SelectUser from './components/SelectUser.vue'
import * as UserApi from '@/api/system/user'
import {useTagsViewStore} from "@/store/modules/tagsView";
import {dateFormatter, formatDate} from "@/utils/formatTime";
import {dateFormatter,dateFormatter2, formatDate} from "@/utils/formatTime";
/** 企业 表单 */
defineOptions({ name: 'UpdateEnterprises' })
@ -251,10 +286,12 @@ const formData = ref({
managerDeptId: undefined,
ides: undefined,
startUserSelectAssignees:undefined,
enterpriseUserId: undefined,
fileIds:[]
enterpriseUserId: undefined
})
const fileList=ref([])
const getEnterpriseUserList = async () => {
const type:number = 2
const data = await getSimpleUserListByUserType(type)
@ -279,6 +316,7 @@ function init() {
EnterprisesApi.getEnterprises(query.id).then((res) => {
selectedUser.value=res.inviterName;
// formData.value.startUserSelectAssignees=res.userId;
fileList.value=res.files;
formData.value = res
})
}else{formType.value = 'create'}
@ -365,6 +403,26 @@ const handleSearch = () => {
}
}
/** 添加/修改操作 */
const formQualRef = ref()
const openQualForm = (type: string, id?: number) => {
formQualRef.value.open(type, id, formData.value.id)
}
/** 删除按钮操作 */
const handQualDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await EnterpriseQualificationApi.deleteEnterpriseQualification(id)
message.success(t('common.delSuccess'))
//
await getQualificationList()
} catch {}
}
onMounted(() => {
init()
//
@ -413,11 +471,15 @@ const submitForm = async () => {
//console.log(formData.value)
//
await formRef.value.validate()
formData.value.enterprisesStatus=1;
//
loading.value = true
try {
const data = formData.value
let data = formData.value
// 1
data.enterprisesStatus = 1 as number;
data.fileIds = (fileList.value || []).map((item: any) => item.id);
if (formType.value == 'create') {
await EnterprisesApi.pccreateEnterprises(data)
message.success(t('common.createSuccess'))
@ -433,6 +495,9 @@ const submitForm = async () => {
emit('success')
} finally {
loading.value = false
//
tagView.delView(route)
router.go(-1)
}
}
@ -469,7 +534,6 @@ const resetForm = () => {
const uploadList: any = ref([])
async function uploadSuccess(res) {
console.log('1111111111111111111');
console.log(res.data.file_id)
fileIds.value.push(res.data.file_id);
if (res) {
@ -496,7 +560,7 @@ async function uploadSuccess(res) {
const getQualificationList = async () => {
loading.value = true
try {
const data = await EnterpriseQualificationApi.getEnterpriseQualificationPage({"enterpriseId":query.id})
const data = await EnterpriseQualificationApi.getEnterpriseQualificationPageEnterprise({"enterpriseId":query.id})
qualificationlist.value = data.list
} finally {
loading.value = false
@ -537,12 +601,6 @@ const getInspectionsLogList = async (insprctionsId) => {
}
}
</script>
<style lang="scss" scoped>

87
src/views/qualification/EnterpriseQualificationForm.vue

@ -8,7 +8,22 @@
v-loading="formLoading"
>
<el-form-item label="选择企业" prop="enterpriseId">
<el-input v-model="formData.enterpriseId" placeholder="请输入企业ID" />
<el-select
v-model="formData.enterpriseId"
filterable
remote
reserve-keyword
placeholder="请输入企业名称搜索"
:remote-method="remoteSearchEnterprise"
:loading="enterpriseLoading"
>
<el-option
v-for="item in enterpriseOptions"
:key="item.id"
:label="item.enterprisesName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="资质名称" prop="qualificationName">
<el-select v-model="formData.qualificationName" placeholder="请选择资质名称">
@ -29,27 +44,25 @@
placeholder="选择资质到期日期"
/>
</el-form-item>
<el-form-item label="资质描述,详细说明资质信息" prop="qualificationDescription">
<!-- <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-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> -->
<el-form-item label="资质编号" prop="enterpriseAuth">
<el-input v-model="formData.enterpriseAuth" placeholder="请输入资质编号" />
<el-input v-model="formData.enterpriseAuth" placeholder="请输入资质编号" />
</el-form-item>
</el-form>
<el-form-item label="资质图片" prop="files">
<UploadImgs v-model="fileIds" :limit="1" />
</el-form-item>
<template #footer>
<el-button @click="submitForm" type="primary" :disabled="formLoading"> </el-button>
<el-button @click="dialogVisible = false"> </el-button>
@ -58,13 +71,15 @@
</template>
<script setup lang="ts">
import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
import { EnterprisesApi } from '@/api/enterprises'
/** 企业资质 表单 */
defineOptions({ name: 'EnterpriseQualificationForm' })
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict'
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
@ -79,27 +94,67 @@ const formData = ref({
createBy: undefined,
handleDate: undefined,
enterpriseAuth: undefined,
files: [] as any[],
})
const formRules = reactive({
qualificationName: [{ required: true, message: '资质名称,例如:排污许可证、环保合格证不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
const fileIds=ref([])
//
const enterpriseLoading = ref(false)
const enterpriseOptions = ref([])
//
const remoteSearchEnterprise = async (query: string) => {
if (query === '') {
enterpriseOptions.value = []
return
}
enterpriseLoading.value = true
try {
const res = await EnterprisesApi.getEnterprisesPage({
pageNo: 1,
pageSize: 5,
enterprisesName: query
})
enterpriseOptions.value = res.list
} finally {
enterpriseLoading.value = false
}
}
/** 打开弹窗 */
const open = async (type: string, id?: number) => {
const open = async (type: string, id?: number,enterpriseId?:number) => {
dialogVisible.value = true
dialogTitle.value = t('action.' + type)
formType.value = type
resetForm()
fileIds.value=[]
//
if (id) {
formLoading.value = true
try {
formData.value = await EnterpriseQualificationApi.getEnterpriseQualification(id)
let res1 = await EnterpriseQualificationApi.getEnterpriseQualification(id)
formData.value = res1;
//
formData.value.qualificationName = parseInt(formData.value.qualificationName)
fileIds.value = res1.files
// ID
//
} finally {
formLoading.value = false
}
}
if (formData.value.enterpriseId || enterpriseId) {
formData.value.enterpriseId = formData.value.enterpriseId || enterpriseId
const res = await EnterprisesApi.getEnterprises(formData.value.enterpriseId)
enterpriseOptions.value = [res]
}
}
defineExpose({ open }) // open
@ -111,7 +166,9 @@ const submitForm = async () => {
//
formLoading.value = true
try {
formData.value.files = fileIds.value.map(f => ( f.id ))
const data = formData.value as unknown as EnterpriseQualificationVO
if (formType.value === 'create') {
await EnterpriseQualificationApi.createEnterpriseQualification(data)
message.success(t('common.createSuccess'))

59
src/views/qualification/index.vue

@ -8,15 +8,7 @@
:inline="true"
label-width="98px"
>
<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"
@ -37,35 +29,7 @@
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"
@ -113,27 +77,14 @@
<!-- 列表 -->
<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="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="资质名称" align="center" prop="qualificationName" >
<template #default="scope">
<dict-tag :type="DICT_TYPE.ENTERPRISES_QUA" :value="scope.row.qualificationName" />
</template>
</el-table-column>
<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="资质到期日期" :formatter="dateFormatter2" align="center" prop="expiryDate" />
<!-- <el-table-column label="办理日期" :formatter="dateFormatter2" align="center" prop="handleDate" /> -->
<el-table-column label="资质编号" align="center" prop="enterpriseAuth" />
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
@ -170,7 +121,7 @@
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import { dateFormatter,dateFormatter2 } from '@/utils/formatTime'
import download from '@/utils/download'
import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
import EnterpriseQualificationForm from './EnterpriseQualificationForm.vue'

Loading…
Cancel
Save