Browse Source

执法记录相关

master
DX 2 months ago
parent
commit
0023ee786c
  1. 2
      src/api/enterpriseinspections/index.ts
  2. 147
      src/views/enterpriseinspections/ChangeUser.vue
  3. 31
      src/views/enterpriseinspections/changeInspections.vue
  4. 11
      src/views/enterpriseinspections/detail.vue
  5. 2
      src/views/enterpriseinspections/index.vue

2
src/api/enterpriseinspections/index.ts

@ -46,7 +46,7 @@ export const EnterpriseInspectionsApi = {
},
//根据 用户id和任务名称查询可以转发的任务
inspectionsLogListByUserAndTaskName: async (params:any) => {
getListByUserIdAndTaskName: async (params:any) => {
return await request.get({ url: `/system/enterprise-inspections/getListByUserIdAndTaskName`, params })
},

147
src/views/enterpriseinspections/ChangeUser.vue

@ -0,0 +1,147 @@
<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>
<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 form = reactive({
userId: '',
resUserId: '',
inspectionsId: [],
taskName: ''
})
// const formRules = reactive({
// })
const formRef = ref() // Ref
const dataValue = ref()
const userList = ref()
const getUserList = async () => {
const data = await getSimpleUserZGList();
userList.value = data
}
const selectTask = async() => {
const params = {
'userId': form.resUserId,
'taskName': taskName
}
const data = await EnterpriseInspectionsApi.getListByUserIdAndTaskName(params)
console.log('data==============>', 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>

31
src/views/enterpriseinspections/changeInspections.vue

@ -24,13 +24,15 @@
</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 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>
@ -99,6 +101,7 @@ const form = reactive({
userId: '',
resUserId: '',
inspectionsId: [],
taskName: ''
})
// const formRules = reactive({
@ -113,6 +116,20 @@ 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 open = async (data) => {

11
src/views/enterpriseinspections/detail.vue

@ -8,7 +8,7 @@
<el-descriptions-item label="执法部门">{{detailData.department}}</el-descriptions-item>
<el-descriptions-item label="执法人员">
{{detailData.inspectName}}
<el-tag type="primary">变更</el-tag>
<el-tag type="primary" @click="changeUserFun">变更</el-tag>
</el-descriptions-item>
</el-descriptions>
</ContentWrap>
@ -55,7 +55,9 @@
@pagination="getList"
/>
</ContentWrap>
<changeUser ref="formRef" @success="getList" />
<EnterpriseInspectionsForm ref="formRef" @success="getList" />
<changeUser ref="changeUserRef" @success="getList" />
</template>
<script setup>
@ -63,6 +65,8 @@
import { EnterpriseInspectionsApi } from '@/api/enterpriseinspections'
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import EnterpriseInspectionsForm from './EnterpriseInspectionsForm.vue'
import changeUser from './ChangeUser.vue'
import { dateFormatter } from '@/utils/formatTime'
@ -86,6 +90,11 @@ const openForm = (data) => {
formRef.value.open(data)
}
const changeUserRef = ref()
const changeUserFun = () => {
changeUserRef.value.open()
}
/** 查询列表 */
const getList = async () => {

2
src/views/enterpriseinspections/index.vue

@ -40,7 +40,7 @@
<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 @click="openChangeForm"><Icon icon="ep:refresh" class="mr-5px" /> 任务转发</el-button> -->
<el-button
type="primary"
plain

Loading…
Cancel
Save