Browse Source

执法记录相关

master
DX 2 months ago
parent
commit
6674018c75
  1. 5
      src/api/enterpriseinspections/index.ts
  2. 55
      src/views/enterpriseinspections/ChangeUser.vue
  3. 4
      src/views/enterpriseinspections/changeInspections.vue
  4. 29
      src/views/enterpriseinspections/detail.vue
  5. 6
      src/views/task/index.vue

5
src/api/enterpriseinspections/index.ts

@ -50,4 +50,9 @@ export const EnterpriseInspectionsApi = {
return await request.get({ url: `/system/enterprise-inspections/getListByUserIdAndTaskName`, params }) return await request.get({ url: `/system/enterprise-inspections/getListByUserIdAndTaskName`, params })
}, },
// 新增企业检查记录表,用于记录与企业相关的环保检查信息。
passOn: async (data:any) => {
return await request.post({ url: `/system/enterprise-inspections/passOn`, data })
},
} }

55
src/views/enterpriseinspections/ChangeUser.vue

@ -1,8 +1,8 @@
<template> <template>
<Dialog title="任务转发" v-model="dialogVisible"> <Dialog title="任务转发" v-model="dialogVisible">
<el-form :model="form" label-width="auto" style="max-width: 600px"> <el-form :model="formData" label-width="auto" style="max-width: 600px">
<el-form-item label="转发用户" prop="name" style="max-width: 500px"> <el-form-item label="转发用户" prop="name" style="max-width: 500px">
<el-select v-model="form.resUserId" placeholder="请选择用户"> <el-select v-model="formData.userId" placeholder="请选择用户">
<el-option <el-option
v-for="item in userList" v-for="item in userList"
:key="item.id" :key="item.id"
@ -32,7 +32,7 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const formLoading = ref(false) // 12 const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const formData = ref({ const changeForm = ref({
id: undefined, id: undefined,
taskId: undefined, taskId: undefined,
enterpriseId: undefined, enterpriseId: undefined,
@ -51,7 +51,6 @@ const form = reactive({
// }) // })
const formRef = ref() // Ref const formRef = ref() // Ref
const dataValue = ref()
const userList = ref() const userList = ref()
const getUserList = async () => { const getUserList = async () => {
@ -59,39 +58,17 @@ const getUserList = async () => {
userList.value = data userList.value = data
} }
const selectTask = async() => {
const params = {
'userId': form.resUserId,
'taskName': taskName
}
const data = await EnterpriseInspectionsApi.getListByUserIdAndTaskName(params)
console.log('data==============>', data)
}
const formData:any = ref({
userId: undefined,
inspectionsId: []
});
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (data) => { const open = async (inspectionsId) => {
dialogVisible.value = true dialogVisible.value = true
dataValue.value = data formData.value.inspectionsId.push(inspectionsId)
getUserList() getUserList()
// //
// if (id) {
// formLoading.value = true
// try {
// formData.value = await EnterpriseInspectionsApi.getEnterpriseInspections(id)
// } finally {
// formLoading.value = false
// }
// }
} }
defineExpose({ open }) // open defineExpose({ open }) // open
@ -99,18 +76,14 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
// //
await formRef.value.validate() // await formRef.value.validate()
// //
formLoading.value = true formLoading.value = true
try { try {
const data = formData.value as unknown as EnterpriseInspectionsVO
if (formType.value === 'create') { await EnterpriseInspectionsApi.passOn(formData.value)
await EnterpriseInspectionsApi.createEnterpriseInspections(data) message.success(t('更改成功'))
message.success(t('common.createSuccess'))
} else {
await EnterpriseInspectionsApi.updateEnterpriseInspections(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false dialogVisible.value = false
// //
emit('success') emit('success')

4
src/views/enterpriseinspections/changeInspections.vue

@ -36,8 +36,6 @@
</el-form-item> </el-form-item>
<el-table :data="tableData" style="width: 100%"> <el-table :data="tableData" style="width: 100%">
<el-table-column prop="date" label="Date" width="180" /> <el-table-column prop="date" label="Date" width="180" />
<el-table-column prop="name" label="Name" width="180" /> <el-table-column prop="name" label="Name" width="180" />
@ -54,7 +52,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections' import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections'
import { getSimpleUserZGList, UserVO } from '@/api/system/user' import { getSimpleUserZGList } from '@/api/system/user'
/** 企业检查记录表,用于记录与企业相关的环保检查信息。 表单 */ /** 企业检查记录表,用于记录与企业相关的环保检查信息。 表单 */

29
src/views/enterpriseinspections/detail.vue

@ -1,9 +1,9 @@
<template> <template>
<ContentWrap title="" style="padding: 17px;"> <ContentWrap title="" style="padding: 17px;">
<el-descriptions> <el-descriptions>
<el-descriptions-item label="记录编号">{{detailData.id}}</el-descriptions-item> <el-descriptions-item label="记录编号">{{detailData.taskNumber}}</el-descriptions-item>
<el-descriptions-item label="任务名称">{{detailData.taskName}}</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="任务类型">{{tagList}}</el-descriptions-item>
<el-descriptions-item label="企业名称">{{detailData.enterpriseName}}</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.department}}</el-descriptions-item>
<el-descriptions-item label="执法人员"> <el-descriptions-item label="执法人员">
@ -57,7 +57,7 @@
</ContentWrap> </ContentWrap>
<changeUser ref="formRef" @success="getList" /> <changeUser ref="formRef" @success="getList" />
<EnterpriseInspectionsForm ref="formRef" @success="getList" /> <EnterpriseInspectionsForm ref="formRef" @success="getList" />
<changeUser ref="changeUserRef" @success="getList" /> <changeUser ref="changeUserRef" @success="getDetail" />
</template> </template>
<script setup> <script setup>
@ -92,9 +92,15 @@ const openForm = (data) => {
const changeUserRef = ref() const changeUserRef = ref()
const changeUserFun = () => { const changeUserFun = () => {
changeUserRef.value.open() changeUserRef.value.open(detailData.value.id )
} }
// const detailData = ref()
const getDetail = async () => {
const data = await EnterpriseInspectionsApi.getEnterpriseInspections(queryParams.value.inspectionsId)
detailData.value = data
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
@ -118,25 +124,22 @@ const detailData = ref({
id: undefined id: undefined
}) })
const tagList = ref()
/** 初始化 **/ /** 初始化 **/
onMounted(() => { onMounted(() => {
const data = JSON.parse(route.query.data) const data = JSON.parse(route.query.data)
detailData.value = { tagList.value = data.tagList
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 queryParams.value.inspectionsId = data.id
getDetail()
getList() getList()
}) })
</script> </script>

6
src/views/task/index.vue

@ -146,15 +146,14 @@
<el-table-column label="执法对象" align="center" min-width="120px"> <el-table-column label="执法对象" align="center" min-width="120px">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click=" <el-button link type="primary" @click="push({
push({
path: 'create', path: 'create',
query: { query: {
id: scope.row.id id: scope.row.id
} }
}) })
"> ">
<el-Tag type="success">{{scope.row.enterpriseIdes.length}}</el-Tag>&nbsp; <el-Tag type="success">{{scope.row.enterpriseIdes.length}}</el-Tag>&nbsp;
</el-button>&nbsp; </el-button>&nbsp;
</template> </template>
@ -251,6 +250,7 @@ const getList = async () => {
loading.value = true loading.value = true
try { try {
const data = await TaskInfoApi.getTaskInfoPage(queryParams) const data = await TaskInfoApi.getTaskInfoPage(queryParams)
console.log("data==>", data)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {

Loading…
Cancel
Save