Browse Source

执法记录相关

master
DX 2 months ago
parent
commit
30fc245a01
  1. 46
      src/api/enterpriseinspections/index.ts
  2. 1
      src/api/system/taglibrary/index.ts
  3. 1
      src/utils/dict.ts
  4. 96
      src/views/enterpriseinspections/EnterpriseInspectionsForm.vue
  5. 134
      src/views/enterpriseinspections/detail.vue
  6. 201
      src/views/enterpriseinspections/index.vue
  7. 5
      src/views/system/taglibrary/form.vue
  8. 4
      src/views/system/user/UserForm.vue

46
src/api/enterpriseinspections/index.ts

@ -0,0 +1,46 @@
import request from '@/config/axios'
// 企业检查记录表,用于记录与企业相关的环保检查信息。 VO
export interface EnterpriseInspectionsVO {
id: number // 检查记录ID,主键
taskId: number // 任务ID
enterpriseId: number // 企业ID
}
// 企业检查记录表,用于记录与企业相关的环保检查信息。 API
export const EnterpriseInspectionsApi = {
// 查询企业检查记录表,用于记录与企业相关的环保检查信息。分页
getEnterpriseInspectionsPage: async (params: any) => {
return await request.get({ url: `/system/enterprise-inspections/page`, params })
},
// 查询企业检查记录表,用于记录与企业相关的环保检查信息。详情
getEnterpriseInspections: async (id: number) => {
return await request.get({ url: `/system/enterprise-inspections/get?id=` + id })
},
// 新增企业检查记录表,用于记录与企业相关的环保检查信息。
createEnterpriseInspections: async (data: EnterpriseInspectionsVO) => {
return await request.post({ url: `/system/enterprise-inspections/create`, data })
},
// 修改企业检查记录表,用于记录与企业相关的环保检查信息。
updateEnterpriseInspections: async (data: EnterpriseInspectionsVO) => {
return await request.put({ url: `/system/enterprise-inspections/update`, data })
},
// 删除企业检查记录表,用于记录与企业相关的环保检查信息。
deleteEnterpriseInspections: async (id: number) => {
return await request.delete({ url: `/system/enterprise-inspections/delete?id=` + id })
},
// 导出企业检查记录表,用于记录与企业相关的环保检查信息。 Excel
exportEnterpriseInspections: async (params) => {
return await request.download({ url: `/system/enterprise-inspections/export-excel`, params })
},
// 导出企业检查记录表,用于记录与企业相关的环保检查信息。 Excel
inspectionsLogList: async (params:any) => {
return await request.get({ url: `/system/inspections-log/list`, params })
},
}

1
src/api/system/taglibrary/index.ts

@ -8,6 +8,7 @@ export interface TagLibraryVO {
tagLevel: number // 标签层级(一级、二级、三级)
tagType: number // 1、企业标签2、执法标签
sort: number
tagCode: string
}
// 企业标签 API

1
src/utils/dict.ts

@ -139,6 +139,7 @@ export enum DICT_TYPE {
TASK_PRIORITY = 'task_priority',
TASK_EXEC_TIME = 'task_exec_time',
TASK_STATE = 'task_state',
INSPECTIONS_STATUS = 'Inspections_status',
// ========== INFRA 模块 ==========
INFRA_BOOLEAN_STRING = 'infra_boolean_string',
INFRA_JOB_STATUS = 'infra_job_status',

96
src/views/enterpriseinspections/EnterpriseInspectionsForm.vue

@ -0,0 +1,96 @@
<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="taskId">
<el-input v-model="formData.taskId" placeholder="请输入任务ID" />
</el-form-item>
<el-form-item label="企业ID" prop="enterpriseId">
<el-input v-model="formData.enterpriseId" placeholder="请输入企业ID" />
</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 { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections'
/** 企业检查记录表,用于记录与企业相关的环保检查信息。 表单 */
defineOptions({ name: 'EnterpriseInspectionsForm' })
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,
taskId: undefined,
enterpriseId: undefined,
})
const formRules = reactive({
})
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 EnterpriseInspectionsApi.getEnterpriseInspections(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 EnterpriseInspectionsVO
if (formType.value === 'create') {
await EnterpriseInspectionsApi.createEnterpriseInspections(data)
message.success(t('common.createSuccess'))
} else {
await EnterpriseInspectionsApi.updateEnterpriseInspections(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
//
emit('success')
} finally {
formLoading.value = false
}
}
/** 重置表单 */
const resetForm = () => {
formData.value = {
id: undefined,
taskId: undefined,
enterpriseId: undefined,
}
formRef.value?.resetFields()
}
</script>

134
src/views/enterpriseinspections/detail.vue

@ -0,0 +1,134 @@
<template>
<ContentWrap title="" style="padding: 17px;">
<el-descriptions>
<el-descriptions-item label="记录编号">{{detailData.id}}</el-descriptions-item>
<el-descriptions-item label="任务名称">{{detailData.taskName}}</el-descriptions-item>
<el-descriptions-item label="任务类型">{{detailData.tagList}}</el-descriptions-item>
<el-descriptions-item label="企业名称">{{detailData.enterpriseName}}</el-descriptions-item>
<el-descriptions-item label="执法部门">{{detailData.department}}</el-descriptions-item>
<el-descriptions-item label="执法人员">
{{detailData.inspectName}}
<el-tag type="primary">变更</el-tag>
</el-descriptions-item>
</el-descriptions>
</ContentWrap>
<ContentWrap title="">
<el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
<!-- <el-table-column label="检查记录ID,主键" align="center" prop="id" /> -->
<el-table-column label="执法人员" align="center" prop="inspectName" />
<el-table-column label="协同执法" align="center" prop="cooperateWithName" />
<el-table-column
label="执法时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="进度状态" align="center" prop="inspectionStatus">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INSPECTIONS_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
v-if="scope.row.status > 1"
type="primary"
@click="openForm(scope.row.id)"
>
查看
</el-button>
<span v-if="scope.row.status == 1">-</span>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<EnterpriseInspectionsForm ref="formRef" @success="getList" />
</template>
<script setup>
import { EnterpriseInspectionsApi } from '@/api/enterpriseinspections'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import EnterpriseInspectionsForm from './EnterpriseInspectionsForm.vue'
defineOptions({ name: 'EnterpriseInspections' })
import { ref } from 'vue'
const message = ref('Hello, Vue 3!')
const loading = ref(true) //
const list = ref() //
const total = ref(0) //
const queryParams = ref({
inspectionsId: undefined
})
const queryFormRef = ref()
const route = useRoute()
/** 添加/修改操作 */
const formRef = ref()
const openForm = (id) => {
const type = 'create'
formRef.value.open(type, id)
}
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await EnterpriseInspectionsApi.inspectionsLogList(queryParams.value)
list.value = data
total.value = data.total
} finally {
loading.value = false
}
}
const detailData = ref({
enterpriseName: undefined,
taskName: undefined,
tagList: undefined,
department: undefined,
inspectName: undefined,
cooperateWithName: undefined,
id: undefined
})
/** 初始化 **/
onMounted(() => {
const data = JSON.parse(route.query.data)
detailData.value = {
enterpriseName: data.enterpriseName,
taskName: data.taskName,
tagList: data.tagList,
department: data.department,
inspectName: data.inspectName,
cooperateWithName: data.cooperateWithName,
id: data.id
}
queryParams.value.inspectionsId = data.id
getList()
})
</script>
<style scoped></style>

201
src/views/enterpriseinspections/index.vue

@ -0,0 +1,201 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<el-form
class="-mb-15px"
:model="queryParams"
ref="queryFormRef"
:inline="true"
label-width="68px"
>
<el-form-item label="任务标题" prop="taskId">
<el-input
v-model="queryParams.taskId"
placeholder="请输入任务标题"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</el-form-item>
<el-form-item label="企业名称" prop="enterpriseId">
<el-input
v-model="queryParams.enterpriseId"
placeholder="请输入企业名称"
clearable
@keyup.enter="handleQuery"
class="!w-240px"
/>
</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>
<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-inspections:create']"
>
<Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button>
<el-button
type="success"
plain
@click="handleExport"
:loading="exportLoading"
v-hasPermi="['system:enterprise-inspections: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="检查记录ID,主键" align="center" prop="id" /> -->
<el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="进度状态" align="center" prop="inspectionStatus">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INSPECTIONS_STATUS" :value="scope.row.inspectionStatus" />
</template>
</el-table-column>
<el-table-column label="任务名称" align="center" prop="taskName" />
<el-table-column label="任务类型" align="center" prop="tagList" />
<el-table-column label="执法部门" align="center" prop="department" />
<el-table-column label="执法人员" align="center" prop="inspectName" />
<el-table-column label="协同执法" align="center" prop="cooperateWithName" />
<el-table-column
label="执法时间"
align="center"
prop="execTime"
:formatter="dateFormatter"
width="180px"
/>
<el-table-column label="操作" align="center" min-width="120px">
<template #default="scope">
<el-button
link
type="primary"
@click="push({ path: '/task/inspectionsDetail', query: {data: JSON.stringify(scope.row)} })"
>
查看
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<Pagination
:total="total"
v-model:page="queryParams.pageNo"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<EnterpriseInspectionsForm ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download'
import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections'
import EnterpriseInspectionsForm from './EnterpriseInspectionsForm.vue'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
const { push } = useRouter()
/** 企业检查记录表,用于记录与企业相关的环保检查信息。 列表 */
defineOptions({ name: 'EnterpriseInspections' })
const message = useMessage() //
const { t } = useI18n() //
const loading = ref(true) //
const list = ref<EnterpriseInspectionsVO[]>([]) //
const total = ref(0) //
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
taskId: undefined,
enterpriseId: undefined,
createTime: [],
})
const queryFormRef = ref() //
const exportLoading = ref(false) //
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage(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 EnterpriseInspectionsApi.deleteEnterpriseInspections(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await EnterpriseInspectionsApi.exportEnterpriseInspections(queryParams)
download.excel(data, '企业检查记录表,用于记录与企业相关的环保检查信息。.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 初始化 **/
onMounted(() => {
getList()
})
</script>

5
src/views/system/taglibrary/form.vue

@ -26,6 +26,10 @@
<el-input v-model="formData.tagName" placeholder="请输入标签的名称" />
</el-form-item>
<el-form-item label="助记码" prop="tagCode">
<el-input v-model="formData.tagCode" placeholder="助记码" />
</el-form-item>
<el-form-item label="排序" prop="sort">
<el-input v-model="formData.sort" placeholder="排序" />
</el-form-item>
@ -55,6 +59,7 @@ const formData = ref({
tagLevel: undefined,
tagType: null as any,
sort: undefined,
tagCode:undefined,
id: null as any
})
const formRules = reactive({})

4
src/views/system/user/UserForm.vue

@ -12,6 +12,9 @@
<el-form-item label="用户昵称" prop="nickname">
<el-input v-model="formData.nickname" placeholder="请输入用户昵称" />
</el-form-item>
<el-form-item label="真实姓名" prop="realName">
<el-input v-model="formData.realName" placeholder="请输入真实姓名" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="归属部门" prop="deptId">
@ -115,6 +118,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
const formType = ref('') // create - update -
const formData = ref({
nickname: '',
realName: '',
deptId: '',
mobile: '',
email: '',

Loading…
Cancel
Save