Browse Source

企业详情

master
parent
commit
b1acf632aa
  1. 2
      src/App.vue
  2. 104
      src/api/enterprises/index.ts
  3. 2
      src/api/login/index.ts
  4. 3
      src/components/Dialog/src/Dialog.vue
  5. 25
      src/components/UploadFile/src/UploadImgs.vue
  6. 1
      src/config/axios/config.ts
  7. 10
      src/utils/dict.ts
  8. 3
      src/views/enterprises/EnterprisesForm.vue
  9. 161
      src/views/enterprises/detailEnterprises.vue
  10. 100
      src/views/enterprises/index.vue
  11. 8
      src/views/qualification/index.vue
  12. 6
      src/views/system/dict/index.vue
  13. 2
      src/views/system/task/index.vue

2
src/App.vue

@ -22,7 +22,7 @@ const setDefaultTheme = () => {
}
appStore.setIsDark(isDarkTheme)
}
setDefaultTheme()
// setDefaultTheme()
</script>
<template>
<ConfigGlobal :size="currentSize">

104
src/api/enterprises/index.ts

@ -1,52 +1,52 @@
import request from '@/config/axios'
// 企业 VO
export interface EnterprisesVO {
id: number // 企业ID,主键
departmentId: number // 所属部门ID
userId: number // 邀请人
type: string // 企业类型
region: string // 企业所属区域
enterprisesName: string // 企业名称
address: string // 企业地址
contactName: string // 环保负责人姓名
environmentalContactPhone: string // 企业环保负责人联系电话
registrationNumber: string // 企业注册号
introduction: string // 企业图文介绍
establishmentDate: Date // 企业成立时间
gpsLocation: string // 企业经纬度
managerDeptId: number // 管理部门
}
// 企业 API
export const EnterprisesApi = {
// 查询企业分页
getEnterprisesPage: async (params: any) => {
return await request.get({ url: `/system/enterprises/page`, params })
},
// 查询企业详情
getEnterprises: async (id: number) => {
return await request.get({ url: `/system/enterprises/get?id=` + id })
},
// 新增企业
createEnterprises: async (data: EnterprisesVO) => {
return await request.post({ url: `/system/enterprises/create`, data })
},
// 修改企业
updateEnterprises: async (data: EnterprisesVO) => {
return await request.put({ url: `/system/enterprises/update`, data })
},
// 删除企业
deleteEnterprises: async (id: number) => {
return await request.delete({ url: `/system/enterprises/delete?id=` + id })
},
// 导出企业 Excel
exportEnterprises: async (params) => {
return await request.download({ url: `/system/enterprises/export-excel`, params })
},
}
import request from '@/config/axios'
// 企业 VO
export interface EnterprisesVO {
id: number // 企业ID,主键
departmentId: number // 所属部门ID
userId: number // 邀请人
type: string // 企业类型
region: string // 企业所属区域
enterprisesName: string // 企业名称
address: string // 企业地址
contactName: string // 环保负责人姓名
environmentalContactPhone: string // 企业环保负责人联系电话
registrationNumber: string // 企业注册号
introduction: string // 企业图文介绍
establishmentDate: Date // 企业成立时间
gpsLocation: string // 企业经纬度
managerDeptId: number // 管理部门
}
// 企业 API
export const EnterprisesApi = {
// 查询企业分页
getEnterprisesPage: async (params: any) => {
return await request.get({ url: `/system/enterprise/page`, params })
},
// 查询企业详情
getEnterprises: async (id: number) => {
return await request.get({ url: `/system/enterprise/get?id=` + id })
},
// 新增企业
createEnterprises: async (data: EnterprisesVO) => {
return await request.post({ url: `/system/enterprise/create`, data })
},
// 修改企业
updateEnterprises: async (data: EnterprisesVO) => {
return await request.put({ url: `/system/enterprise/update`, data })
},
// 删除企业
deleteEnterprises: async (id: number) => {
return await request.delete({ url: `/system/enterprise/delete?id=` + id })
},
// 导出企业 Excel
exportEnterprises: async (params) => {
return await request.download({ url: `/system/enterprise/export-excel`, params })
},
}

2
src/api/login/index.ts

@ -1,5 +1,5 @@
import request from '@/config/axios'
import { getRefreshToken } from '@/utils/auth'
// import { getRefreshToken } from '@/utils/auth'
import type { RegisterVO, UserLoginVO } from './types'
export interface SmsCodeVO {

3
src/components/Dialog/src/Dialog.vue

@ -11,7 +11,8 @@ const props = defineProps({
fullscreen: propTypes.bool.def(true),
width: propTypes.oneOfType([String, Number]).def('40%'),
scroll: propTypes.bool.def(false), // maxHeight
maxHeight: propTypes.oneOfType([String, Number]).def('400px')
maxHeight: propTypes.oneOfType([String, Number]).def('400px'),
})
const getBindValue = computed(() => {

25
src/components/UploadFile/src/UploadImgs.vue

@ -10,7 +10,7 @@
:drag="drag"
:http-request="httpRequest"
:limit="limit"
:multiple="true"
:multiple="false"
:on-error="uploadError"
:on-exceed="handleExceed"
:on-success="uploadSuccess"
@ -86,9 +86,9 @@ const props = defineProps({
const { uploadUrl, httpRequest } = useUpload()
const fileList = ref<UploadUserFile[]>([])
const fileList = ref<any>([])
const uploadNumber = ref<number>(0)
const uploadList = ref<UploadUserFile[]>([])
const uploadList = ref<any>([])
/**
* @description 文件上传之前判断
* @param rawFile 上传的文件
@ -123,7 +123,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({ name: res.data, url: res.data })
uploadList.value.push({ id: res.data.file_id, url: res.data.url })
if (uploadList.value.length == uploadNumber.value) {
fileList.value.push(...uploadList.value)
uploadList.value = []
@ -142,26 +142,19 @@ watch(
}
fileList.value = [] //
fileList.value.push(
...(val as string[]).map((url) => ({ name: url.substring(url.lastIndexOf('/') + 1), url }))
)
fileList.value.push(...val)
},
{ immediate: true, deep: true }
)
//
const emitUpdateModelValue = () => {
let result: string[] = fileList.value.map((file) => file.url!)
let result = fileList.value
emit('update:modelValue', result)
}
//
const handleRemove = (uploadFile: UploadFile) => {
fileList.value = fileList.value.filter(
(item) => item.url !== uploadFile.url || item.name !== uploadFile.name
)
emit(
'update:modelValue',
fileList.value.map((file) => file.url!)
)
const handleRemove = (uploadFile) => {
fileList.value = fileList.value.filter((item) => item.id !== uploadFile.id)
emit('update:modelValue', fileList.value)
}
//

1
src/config/axios/config.ts

@ -25,4 +25,5 @@ const config: {
default_headers: 'application/json'
}
export { config }

10
src/utils/dict.ts

@ -112,7 +112,9 @@ export enum DICT_TYPE {
COMMON_STATUS = 'common_status',
TERMINAL = 'terminal', // 终端
DATE_INTERVAL = 'date_interval', // 数据间隔
//========== 企业 ==========
ENTERPRISES_AREA = 'enterprises_area',
ENTERPRISES_TYPE = 'enterprises_type',
// ========== SYSTEM 模块 ==========
SYSTEM_USER_SEX = 'system_user_sex',
SYSTEM_MENU_TYPE = 'system_menu_type',
@ -132,12 +134,6 @@ export enum DICT_TYPE {
USER_AUDIT_TYPE = 'user_audit_type',
WX_USER_TYPE = 'wx_user_type',
TAG_TYPE = 'tag_type',
// ========== 企业 模块 ==========
ENTERPRISES_TYPE='enterprises_type',
ENTERPRISES_AREA='enterprises_area',
// ========== INFRA 模块 ==========
INFRA_BOOLEAN_STRING = 'infra_boolean_string',
INFRA_JOB_STATUS = 'infra_job_status',

3
src/views/enterprises/EnterprisesForm.vue

@ -53,7 +53,6 @@
@handler-remove="uploadRemove"
/>
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker
v-model="formData.establishmentDate"
@ -81,7 +80,7 @@
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises'
import { FileInfoApi } from '@/api/enterprises/fileinfo'
import { ElMessage,ElLoading } from 'element-plus'
import { ElMessage } from 'element-plus'
/** 企业 表单 */
defineOptions({ name: 'EnterprisesForm' })

161
src/views/enterprises/detailEnterprises.vue

@ -1,107 +1,49 @@
<template>
<ContentWrap>
<el-form
ref="formRef"
:model="formData"
:rules="formRules"
label-width="100px"
v-loading="formLoading"
>
<el-form-item label="企业名称" prop="enterprisesName">
<el-input v-model="formData.enterprisesName" placeholder="请输入企业名称" readonly="true"/>
</el-form-item>
<el-form-item label="企业类型" prop="type">
<el-select v-model="formData.type" placeholder="请选择企业类型" readonly="true" >
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
<el-input v-model="formData.enterprisesName" placeholder="请输入企业名称" readonly="true"/>
</el-form-item>
<el-form-item label="企业所属区域" prop="region">
<el-select v-model="formData.region" placeholder="请选择企业所属区域">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="企业地址" prop="address">
<el-input v-model="formData.address" type="textarea" placeholder="请输入企业地址" readonly="true"/>
</el-form-item>
<el-form-item label="环保负责人姓名" prop="contactName">
<el-input v-model="formData.contactName" placeholder="请输入环保负责人姓名" readonly="true" />
</el-form-item>
<el-form-item label="企业环保负责人联系电话" prop="environmentalContactPhone">
<el-input v-model="formData.environmentalContactPhone" placeholder="请输入企业环保负责人联系电话" readonly="true" />
</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" type="textarea" placeholder="请输入企业介绍" />
</el-form-item>
<el-form-item label="企业照片" prop="size">
<InnerUploadImg
:uploadList="uploadList"
@handler-success="uploadSuccess"
ref="uploadRef"
@handler-remove="uploadRemove"
/>
</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="managerDeptId">
<el-select v-model="formData.managerDeptId" placeholder="请选择管理部门">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="资质整明" prop="managerDeptId">
<el-select v-model="formData.managerDeptId" placeholder="请选择管理部门">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
<el-form-item label="执法记录" prop="managerDeptId">
<el-select v-model="formData.managerDeptId" placeholder="请选择管理部门">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
</el-form>
</ContentWrap>
</template>s
<section class="flex flex-col gap-5">
<section class="flex gap-10px">
<span >企业名称</span>
<span>{{ formData.enterprisesName }} </span>
</section>
<section class="flex gap-10px">
<span>企业类型</span>
<span>{{ getDictLabel(DICT_TYPE.ENTERPRISES_TYPE, formData.type) }} </span>
</section>
<section class="flex gap-10px">
<span>企业所属区域</span>
<span>{{ getDictLabel(DICT_TYPE.ENTERPRISES_AREA, formData.region) }} </span>
</section>
<section class="flex gap-10px">
<span>企业地址</span>
<span>{{ formData.address }} </span>
</section>
<section class="flex gap-10px">
<span>负责人</span>
<span>{{ formData.contactName }} {{ formData.environmentalContactPhone }}</span>
</section>
<section class="flex gap-10px">
<span>成立时间</span>
<span>{{ formData.establishmentDate }}</span>
</section>
<section class="flex gap-10px">
<span>成立时间</span>
<span>{{ formData.establishmentDate }}</span>
</section>
<section class="flex gap-10px">
<span>企业介绍</span>
<span>{{ formData.introduction }}</span>
</section>
<section class="flex gap-10px">
<span>图片介绍</span>
<img v-for="img in formData.files" :src="img.url" :key="img.id" alt="" />
</section>
</section>
</template>
s
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { EnterprisesApi, EnterprisesVO, } from '@/api/enterprises'
import { FileInfoApi } from '@/api/enterprises/fileinfo'
import { ElMessage,ElLoading } from 'element-plus'
import { getDictLabel, DICT_TYPE } from '@/utils/dict'
import { EnterprisesApi } from '@/api/enterprises'
/** 企业 表单 */
const formLoading = ref(false) // 12
const formData = ref({
id: undefined,
departmentId: undefined,
@ -117,21 +59,16 @@ const formData = ref({
establishmentDate: undefined,
gpsLocation: undefined,
managerDeptId: undefined,
ides:undefined
ides: undefined
})
const formRules = reactive({
type: [{ required: true, message: '企业类型不能为空', trigger: 'change' }],
enterprisesName: [{ required: true, message: '企业名称不能为空', trigger: 'blur' }],
})
const formRef = ref() // Ref
const route=useRoute()
function getDetail(){
EnterprisesApi.getEnterprises(route.query.id as any).then(res=>{
formData.value=res
const route = useRoute()
function getDetail() {
EnterprisesApi.getEnterprises(route.query.id as any).then((res) => {
formData.value = res
})
}
getDetail()
getDetail()
</script>

100
src/views/enterprises/index.vue

@ -17,16 +17,16 @@
class="!w-240px"
/>
</el-form-item>
<!-- <el-form-item label="邀请人" prop="userId">-->
<!-- <el-select-->
<!-- v-model="queryParams.userId"-->
<!-- placeholder="请选择邀请人"-->
<!-- clearable-->
<!-- class="!w-240px"-->
<!-- >-->
<!-- <el-option label="请选择字典生成" value="" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="邀请人" prop="userId">-->
<!-- <el-select-->
<!-- v-model="queryParams.userId"-->
<!-- placeholder="请选择邀请人"-->
<!-- clearable-->
<!-- class="!w-240px"-->
<!-- >-->
<!-- <el-option label="请选择字典生成" value="" />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label="企业类型" prop="type">
<el-select
v-model="queryParams.type"
@ -58,7 +58,6 @@
</el-select>
</el-form-item>
<el-form-item label="企业注册号" prop="registrationNumber">
<el-input
v-model="queryParams.registrationNumber"
@ -80,25 +79,13 @@
/>
</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')"
>
<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"
>
<el-button type="success" plain @click="handleExport" :loading="exportLoading">
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
</el-form-item>
@ -108,7 +95,6 @@
<!-- 列表 -->
<ContentWrap>
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="企业名称" align="center" fixed="left" prop="enterprisesName" />
<el-table-column label="邀请人" align="center" prop="userId" />
<el-table-column label="企业类型" align="center" prop="type">
@ -124,7 +110,11 @@
<el-table-column label="企业地址" align="center" prop="address" />
<el-table-column label="环保负责人姓名" align="center" prop="contactName" />
<el-table-column label="企业环保负责人联系电话" align="center" prop="environmentalContactPhone" />
<el-table-column
label="企业环保负责人联系电话"
align="center"
prop="environmentalContactPhone"
/>
<el-table-column label="企业注册号" align="center" prop="registrationNumber" />
<el-table-column label="企业图文介绍" align="center" prop="introduction" />
<!-- <el-table-column label="企业成立时间" align="center" prop="establishmentDate" />
@ -139,38 +129,16 @@
<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 link type="primary" @click="openForm('update', scope.row.id)">
编辑
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
<el-button link type="danger" @click="handleDelete(scope.row.id)"> 删除 </el-button>
<el-button link type="danger" @click="detailformRef(scope.row.id)"> 详情 </el-button>
<el-button
link
type="danger"
@click="detailformRef(scope.row.id)"
>
详情
</el-button>
<!-- <router-link :to="'/enterprises/detailEnterprises/' + scope.row.type">-->
<!-- <el-button link type="primary">详情</el-button>-->
<!-- </router-link>-->
<!-- <router-link :to="'/enterprises/detailEnterprises/' + scope.row.type">-->
<!-- <el-button link type="primary">详情</el-button>-->
<!-- </router-link>-->
</template>
</el-table-column>
</el-table>
@ -219,7 +187,7 @@ const queryParams = reactive({
establishmentDate: [],
gpsLocation: undefined,
createTime: [],
managerDeptId: undefined,
managerDeptId: undefined
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
@ -236,7 +204,6 @@ const getList = async () => {
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.pageNo = 1
@ -255,23 +222,18 @@ const openForm = (type: string, id?: number) => {
formRef.value.open(type, id)
}
/*详情*/
const { push } = useRouter() //
const detailformRef = ( id?: number) => {
push({
path:'/enterprises/detailEnterprises',
query:{
id
}
})
const detailformRef = (id?: number) => {
push({
path: '/enterprises/detailEnterprises',
query: {
id
}
})
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {

8
src/views/qualification/index.vue

@ -93,7 +93,7 @@
type="primary"
plain
@click="openForm('create')"
v-hasPermi="['system:enterprise-qualification:create']"
v-hasPermi="['system:enterprises-qualification:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
@ -102,7 +102,7 @@
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['system:enterprise-qualification:export']"
v-hasPermi="['system:enterprises-qualification:export']"
>
<Icon icon="ep:download" class="mr-5px" /> 导出
</el-button>
@ -135,7 +135,7 @@
link
type="primary"
@click="openForm('update', scope.row.id)"
v-hasPermi="['system:enterprise-qualification:update']"
v-hasPermi="['system:enterprises-qualification:update']"
>
编辑
</el-button>
@ -143,7 +143,7 @@
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['system:enterprise-qualification:delete']"
v-hasPermi="['system:enterprises-qualification:delete']"
>
删除
</el-button>

6
src/views/system/dict/index.vue

@ -90,6 +90,12 @@
<el-table-column align="center" label="字典编号" prop="id" />
<el-table-column align="center" label="字典名称" prop="name" show-overflow-tooltip />
<el-table-column align="center" label="字典类型" prop="type" width="300" />
<el-table-column align="center" label="字典类型(大写)" prop="type" width="300">
<template #default="{ row }">
{{ row.type.toUpperCase() }}
</template>
</el-table-column>
<el-table-column align="center" label="状态" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.COMMON_STATUS" :value="scope.row.status" />

2
src/views/system/task/index.vue

@ -141,7 +141,7 @@
<script setup>
import TaskForm from "./form.vue";
import ChooseCompany from '@/BusinessCom/ChooseCompany/index.vue'
// import ChooseCompany from '@/BusinessCom/ChooseCompany/index.vue'
const { proxy } = getCurrentInstance();
const { task_period_type } = proxy.useDict("task_period_type");

Loading…
Cancel
Save