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. 4
      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 })
},
// 新增企业检查记录表,用于记录与企业相关的环保检查信息。
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>
<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-select v-model="form.resUserId" placeholder="请选择用户">
<el-select v-model="formData.userId" placeholder="请选择用户">
<el-option
v-for="item in userList"
:key="item.id"
@ -32,7 +32,7 @@ const message = useMessage() // 消息弹窗
const dialogVisible = ref(false) //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const formData = ref({
const changeForm = ref({
id: undefined,
taskId: undefined,
enterpriseId: undefined,
@ -51,7 +51,6 @@ const form = reactive({
// })
const formRef = ref() // Ref
const dataValue = ref()
const userList = ref()
const getUserList = async () => {
@ -59,39 +58,17 @@ const getUserList = async () => {
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
dataValue.value = data
formData.value.inspectionsId.push(inspectionsId)
getUserList()
// //
// if (id) {
// formLoading.value = true
// try {
// formData.value = await EnterpriseInspectionsApi.getEnterpriseInspections(id)
// } finally {
// formLoading.value = false
// }
// }
}
defineExpose({ open }) // open
@ -99,18 +76,14 @@ defineExpose({ open }) // 提供 open 方法,用于打开弹窗
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//
await formRef.value.validate()
// 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'))
}
await EnterpriseInspectionsApi.passOn(formData.value)
message.success(t('更改成功'))
dialogVisible.value = false
//
emit('success')

4
src/views/enterpriseinspections/changeInspections.vue

@ -36,8 +36,6 @@
</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" />
@ -54,7 +52,7 @@
</template>
<script setup lang="ts">
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>
<ContentWrap title="" style="padding: 17px;">
<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.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.department}}</el-descriptions-item>
<el-descriptions-item label="执法人员">
@ -57,7 +57,7 @@
</ContentWrap>
<changeUser ref="formRef" @success="getList" />
<EnterpriseInspectionsForm ref="formRef" @success="getList" />
<changeUser ref="changeUserRef" @success="getList" />
<changeUser ref="changeUserRef" @success="getDetail" />
</template>
<script setup>
@ -92,9 +92,15 @@ const openForm = (data) => {
const changeUserRef = ref()
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 () => {
@ -118,25 +124,22 @@ const detailData = ref({
id: undefined
})
const tagList = ref()
/** 初始化 **/
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
}
tagList.value = data.tagList
queryParams.value.inspectionsId = data.id
getDetail()
getList()
})
</script>

4
src/views/task/index.vue

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

Loading…
Cancel
Save