Browse Source

Merge remote-tracking branch 'origin/master'

master
zy 2 months ago
parent
commit
57d9ccd3eb
  1. 53
      src/api/enterpriseinspections/index.ts
  2. 1
      src/api/system/taglibrary/index.ts
  3. 8
      src/api/system/user/index.ts
  4. 1
      src/utils/dict.ts
  5. 116
      src/views/enterpriseinspections/EnterpriseInspectionsForm.vue
  6. 187
      src/views/enterpriseinspections/changeInspections.vue
  7. 135
      src/views/enterpriseinspections/detail.vue
  8. 232
      src/views/enterpriseinspections/index.vue
  9. 5
      src/views/system/taglibrary/form.vue
  10. 4
      src/views/system/user/UserForm.vue

53
src/api/enterpriseinspections/index.ts

@ -0,0 +1,53 @@
import request from '@/config/axios'
// 企业检查记录表,用于记录与企业相关的环保检查信息。 VO
export interface EnterpriseInspectionsVO {
id: number // 检查记录ID,主键
taskId: number // 任务ID
enterpriseId: number // 企业ID
tagList: String
}
// 企业检查记录表,用于记录与企业相关的环保检查信息。 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 })
},
//根据 用户id和任务名称查询可以转发的任务
inspectionsLogListByUserAndTaskName: async (params:any) => {
return await request.get({ url: `/system/enterprise-inspections/getListByUserIdAndTaskName`, 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

8
src/api/system/user/index.ts

@ -4,6 +4,7 @@ export interface UserVO {
id: number
username: string
nickname: string
realName: string
deptId: number
postIds: string[]
email: string
@ -80,7 +81,12 @@ export const updateUserStatus = (id: number, status: number) => {
// 获取用户精简信息列表
export const getSimpleUserList = (): Promise<UserVO[]> => {
return request.get({ url: '/system/user/simple-list' })
}
}
// 获取用户精简信息列表
export const getSimpleUserZGList = (): Promise<UserVO[]> => {
return request.get({ url: '/system/user/simple-zg-list' })
}
/**
*

1
src/utils/dict.ts

@ -142,6 +142,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',

116
src/views/enterpriseinspections/EnterpriseInspectionsForm.vue

@ -0,0 +1,116 @@
<template>
<Dialog title="反馈信息" v-model="dialogVisible">
<div class="box">
<div class="img">
<div v-for="item in imgList" :key="item">
<el-image style="width: 180px; height: 180px" :src="item" :preview-src-list="imgList" />
</div>
</div>
<div class="text">{{dataValue.feedBack}}</div>
</div>
<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 dataValue = ref()
const imgList = ref([])
/** 打开弹窗 */
const open = async (data) => {
dialogVisible.value = true
dataValue.value = data
if (data.fileList.length > 0) {
imgList.value = data.fileList.map(i=>i.url)
}
console.log("imgList.value=>", imgList.value)
// //
// 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>
<style scoped>
.box{
display: flex;
flex-direction: column;
.img{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 15px
}
.text{
padding: 15px;
}
}
</style>

187
src/views/enterpriseinspections/changeInspections.vue

@ -0,0 +1,187 @@
<template>
<Dialog title="任务转发" v-model="dialogVisible">
<el-form :model="form" label-width="auto" style="max-width: 600px">
<el-form-item label="转发用户" prop="name" style="max-width: 500px">
<el-select v-model="form.resUserId" placeholder="请选择用户">
<el-option
v-for="item in userList"
:key="item.id"
:label=" item.deptName +'-'+ item.realName "
:value="item.id!"
/>
</el-select>
</el-form-item>
</el-form>
<el-form-item label="目标用户" prop="name" style="max-width: 500px">
<el-select v-model="form.userId" placeholder="请选择目标用户">
<el-option
v-for="item in userList"
:key="item.id"
:label=" item.deptName +'-'+ item.realName "
:value="item.id!"
/>
</el-select>
</el-form-item>
<el-form-item label="任务名称" prop="name">
<el-input
v-model="taskName"
style="width: 240px"
placeholder="请输入任务名称"
clearable
/><el-button type="primary" ></el-button>
</el-form-item>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="Date" width="180" />
<el-table-column prop="name" label="Name" width="180" />
<el-table-column prop="address" label="Address" />
</el-table>
<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'
import { getSimpleUserZGList, UserVO } from '@/api/system/user'
/** 企业检查记录表,用于记录与企业相关的环保检查信息。 表单 */
defineOptions({ name: 'EnterpriseInspectionsForm' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
id: undefined,
taskId: undefined,
enterpriseId: undefined,
})
const taskName = ref()
const tableData = [
{
date: '2016-05-03',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-02',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-04',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
{
date: '2016-05-01',
name: 'Tom',
address: 'No. 189, Grove St, Los Angeles',
},
]
const form = reactive({
userId: '',
resUserId: '',
inspectionsId: [],
})
// const formRules = reactive({
// })
const formRef = ref() // Ref
const dataValue = ref()
const userList = ref()
const getUserList = async () => {
const data = await getSimpleUserZGList();
userList.value = data
}
/** 打开弹窗 */
const open = async (data) => {
dialogVisible.value = true
dataValue.value = data
getUserList()
// //
// 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>
<style scoped>
.box{
display: flex;
flex-direction: column;
.img{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 15px
}
.text{
padding: 15px;
}
}
</style>

135
src/views/enterpriseinspections/detail.vue

@ -0,0 +1,135 @@
<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)"
>
查看
</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'
import { dateFormatter } from '@/utils/formatTime'
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 = (data) => {
formRef.value.open(data)
}
/** 查询列表 */
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>

232
src/views/enterpriseinspections/index.vue

@ -0,0 +1,232 @@
<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 @click="openChangeForm"><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"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" />
<!-- <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" />
<ChangeInspections ref="changeRef" @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 ChangeInspections from './changeInspections.vue'
import { DICT_TYPE } 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 selectedRows = ref([]);
const handleSelectionChange = (selection) => {
selectedRows.value = selection;
console.log('Selected Rows:', selectedRows.value);
};
/** 查询列表 */
const getList = async () => {
loading.value = true
try {
const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage(queryParams)
data.list.forEach(item => {
item.tagList = item.tagList.join()
});
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 changeRef = ref()
const openChangeForm = () => {
changeRef.value.open(selectedRows.value)
}
/** 删除按钮操作 */
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