Browse Source

优化用户审核功能,添加企业部门列表获取,调整样式和逻辑

master
parent
commit
27ce3d83c2
  1. 11
      src/api/system/user/index.ts
  2. 7
      src/components/ContentWrap/src/ContentWrap.vue
  3. 2
      src/components/DictTag/src/DictTag.vue
  4. 3
      src/views/Login/SocialLogin.vue
  5. 3
      src/views/Login/components/QrCodeForm.vue
  6. 143
      src/views/enterpriseinspections/EnterpriseInspectionsForm.vue
  7. 54
      src/views/enterpriseinspections/detail.vue
  8. 42
      src/views/enterpriseinspections/index.vue
  9. 2
      src/views/system/taglibrary/index.vue
  10. 2
      src/views/task/index.vue

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

@ -113,10 +113,7 @@ export const getExamieList = (audit: number) => {
*
*/
export function examineUser(data) {
console.log('data=>', data)
return request.put({ url: '/system/user/user_audit', data })
return request.put({url: '/system/user/user_audit', data})
}
// 专管员列表
@ -128,3 +125,11 @@ export const getEnterpriseManager = () => {
export const deptByMenu = () => {
return request.get({ url: '/system/user/deptByMenu' })
}
/**
*
*/
export const getDeptByEnterprise = () => {
return request.get({ url: '/system/user/enterprise_manager_dept_list' })
}

7
src/components/ContentWrap/src/ContentWrap.vue

@ -34,3 +34,10 @@ defineProps({
<slot></slot>
</ElCard>
</template>
<style lang="scss" scoped>
:deep(.el-card__header) {
border-bottom: none;
padding-bottom: 0;
}
</style>

2
src/components/DictTag/src/DictTag.vue

@ -91,6 +91,4 @@ export default defineComponent({
})
</script>
<style scoped lang="scss">
</style>

3
src/views/Login/SocialLogin.vue

@ -320,6 +320,9 @@ const handleLogin = async (params) => {
onMounted(() => {
getCookie()
tryLogin()
})
onUnmounted(()=>{
})
</script>

3
src/views/Login/components/QrCodeForm.vue

@ -121,10 +121,11 @@ onMounted(() => {
// getCookie()
getimg()
})
onUnmounted(() => {
onBeforeUnmount(() => {
//
clearInterval(intervalId.value)
})
</script>
<style lang="scss" scoped>
.expired-text {

143
src/views/enterpriseinspections/EnterpriseInspectionsForm.vue

@ -1,109 +1,76 @@
<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>
<Dialog title="结果反馈" v-model="dialogVisible" width="800" top="5vh">
<section class="content-wrapper">
<section>
<section class="label">处理意见</section>
<section class="line-height-24px text-16px color-#303133"> {{ detail.feedBack }} </section>
</section>
<section>
<section class="label">照片取证</section>
<section class="image-wrapper">
<el-image
v-for="(photo, index) in detail.fileList"
:initial-index="index"
:preview-src-list="detail.fileList.map((i) => i.url)"
:key="photo.id"
:src="photo.url"
class="img"
/>
</section>
</section>
</section>
</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 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 detail = ref()
/** 打开弹窗 */
const open = async (data) => {
const open = async (param: any) => {
detail.value = param
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
</script>
/** 提交表单 */
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'))
<style scoped lang="scss">
.content-wrapper {
display: grid;
grid-template-rows: 1fr;
grid-template-columns: 1.5fr 1fr;
grid-gap: 20px;
padding-bottom: 20px;
.label {
margin-bottom: 20px;
font-size: 16px;
display: flex;
flex-flow: row nowrap;
gap: 8px;
line-height: 24px;
align-items: center;
color: #303133;
&::before {
content: '';
display: block;
width: 3px;
height: 16px;
background-color: var(--el-color-primary);
}
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 {
.image-wrapper {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
gap: 15px;
}
.text {
padding: 15px;
flex-flow: row wrap;
gap: 20px;
.img {
width: 120px;
height: 120px;
border-radius: 4px;
}
}
}
</style>

54
src/views/enterpriseinspections/detail.vue

@ -1,12 +1,23 @@
<template>
<ContentWrap title="" style="padding: 17px">
<ContentWrap title="任务状况">
<section class="grid grid-cols-3 grid-rows-2 gap-20px">
<section class="item">
<section class="label">任务名称</section>
<section>
{{ detailData.taskName }}
</section>
<el-button type="primary" link text>详情</el-button>
<el-button
type="primary"
link
text
@click="
push({
path: `/enterprises/update`,
query: { id: detailData.enterpriseId }
})
"
>详情
</el-button>
</section>
<section class="item">
<section class="label">任务类型</section>
@ -19,7 +30,18 @@
<section class="item">
<section class="label">企业名称</section>
<section>{{ detailData.enterpriseName }} </section>
<el-button type="primary" link text>详情</el-button>
<el-button
type="primary"
link
text
@click="
push({
path: `/enterprises/update`,
query: { id: detailData.enterpriseId }
})
"
>详情
</el-button>
</section>
<section class="item">
<section class="label">所属部门</section>
@ -42,7 +64,7 @@
</section>
</section>
</ContentWrap>
<ContentWrap title="">
<ContentWrap title="执法流程">
<el-table v-loading="loading" :data="list" :show-overflow-tooltip="true">
<el-table-column label="执法人员" prop="inspectName" />
<el-table-column label="协同执法" prop="cooperateWithName" />
@ -91,15 +113,21 @@ const queryFormRef = ref()
const detailRef = ref()
const route = useRoute()
const formRef = ref()
const { push } = useRouter()
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
inspectionsId: route.query.id
})
const openForm = (data) => {
formRef.value.open(data)
}
const detailData = ref({
enterpriseName: undefined,
taskName: undefined,
tagList: undefined,
department: undefined,
inspectName: undefined,
cooperateWithName: undefined,
id: undefined
})
const changeUserRef = ref()
//
@ -128,16 +156,6 @@ const getList = async () => {
}
}
const detailData = ref({
enterpriseName: undefined,
taskName: undefined,
tagList: undefined,
department: undefined,
inspectName: undefined,
cooperateWithName: undefined,
id: undefined
})
onMounted(() => {
getDetail(route.query.id)
getList(route.query.id)

42
src/views/enterpriseinspections/index.vue

@ -3,22 +3,27 @@
<section class="flex flex-col gap-20px">
<!-- 搜索工作栏 -->
<el-form :model="queryParams" ref="queryFormRef" :inline="true" class="formClass">
<el-form-item label="" prop="taskId">
<el-form-item label="" prop="enterpriseName">
<el-input
v-model="queryParams.taskName"
v-model="queryParams.enterpriseName"
placeholder="请输入企业名称"
clearable
@keyup.enter="handleQuery"
:prefix-icon="Search"
/>
</el-form-item>
<el-form-item label="" prop="enterpriseId">
<el-select v-model="queryParams.deptId" placeholder="请选择部门">
<el-option />
<el-form-item label="" prop="departmentId">
<el-select v-model="queryParams.departmentId" placeholder="请选择部门">
<el-option
v-for="item in deptList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="enterpriseId">
<el-select v-model="queryParams.deptId" placeholder="请选择进度状态">
<el-form-item label="" prop="inspectionsStatus">
<el-select v-model="queryParams.inspectionsStatus" placeholder="请选择进度状态">
<el-option
v-for="dict in getDictOptions(DICT_TYPE.INSPECTIONS_STATUS)"
:key="dict.value"
@ -27,8 +32,8 @@
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="enterpriseId">
<el-select v-model="queryParams.deptId" placeholder="请选择执法人员" filterable>
<el-form-item label="" prop="userId">
<el-select v-model="queryParams.userId" placeholder="请选择执法人员" filterable clearable>
<el-option
v-for="item in userList"
:key="item.id"
@ -122,7 +127,7 @@ import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpr
import EnterpriseInspectionsForm from './EnterpriseInspectionsForm.vue'
import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import { Search } from '@element-plus/icons-vue'
import { getSimpleUserZGList } from '@/api/system/user'
import { getSimpleUserZGList, getDeptByEnterprise } from '@/api/system/user'
const { push } = useRouter()
@ -137,10 +142,13 @@ const total = ref(0) // 列表的总页数
const queryParams = reactive({
pageNo: 1,
pageSize: 10,
taskName: undefined,
enterpriseName: undefined
enterpriseName: undefined,
inspectionsStatus: undefined,
departmentId: undefined,
userId: undefined
})
const userList = ref()
const deptList = ref()
const queryFormRef = ref() //
const exportLoading = ref(false) //
const formRef = ref()
@ -169,10 +177,12 @@ const resetQuery = () => {
handleQuery()
}
/** 查询用户列表 */
const getUserlist = async () => {
userList.value = await getSimpleUserZGList()
/** 查询搜索项列表 */
const getSearchOption = async () => {
userList.value = await getSimpleUserZGList({})
deptList.value = await getDeptByEnterprise()
}
/** 导出按钮操作 */
const handleExport = async () => {
try {
@ -188,7 +198,7 @@ const handleExport = async () => {
}
}
getUserlist()
getSearchOption()
/** 初始化 **/
onMounted(() => {

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

@ -14,7 +14,7 @@
placeholder="请输入标签的名称"
clearable
@keyup.enter.prevent="handleQuery"
class="!w-240px"
class="!w-370px"
/>
</el-form-item>
<el-form-item label="">

2
src/views/task/index.vue

@ -85,7 +85,7 @@
<el-table-column label="任务名称" align="left" prop="title" width="200" />
<el-table-column label="任务类型" align="left" prop="taskType">
<template #default="scope">
<el-tag>{{ scope.row.taskTypeName }}</el-tag>
<el-tag size="nimi" round>{{ scope.row.taskTypeName }}</el-tag>
</template>
</el-table-column>
<el-table-column label="发布部门" align="left" prop="deptName" />

Loading…
Cancel
Save