Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	src/views/enterpriseinspections/index.vue
master
DX 1 month ago
parent
commit
8c308624dc
  1. 4
      src/api/enterprises/index.ts
  2. 1
      src/components/UploadFile/src/UploadImgs.vue
  3. 2
      src/router/modules/remaining.ts
  4. 15
      src/views/enterpriseinspections/index.vue
  5. 3
      src/views/enterprises/index.vue
  6. 179
      src/views/enterprises/update.vue
  7. 2
      src/views/task/create.vue
  8. 4
      src/views/task/index.vue
  9. 13
      src/views/wait.vue

4
src/api/enterprises/index.ts

@ -37,12 +37,12 @@ export const EnterprisesApi = {
return await request.post({ url: `/system/enterprise/create`, data }) return await request.post({ url: `/system/enterprise/create`, data })
}, },
// PC新增企业 // PC新增企业
pccreateEnterprises: async (data: EnterprisesVO) => { pccreateEnterprises: async (data: any) => {
return await request.post({ url: `/system/enterprise/pccreate`, data }) return await request.post({ url: `/system/enterprise/pccreate`, data })
}, },
// 修改企业 // 修改企业
updateEnterprises: async (data: EnterprisesVO) => { updateEnterprises: async (data: any) => {
return await request.put({ url: `/system/enterprise/update`, data }) return await request.put({ url: `/system/enterprise/update`, data })
}, },

1
src/components/UploadFile/src/UploadImgs.vue

@ -140,7 +140,6 @@ watch(
fileList.value = [] // fix fileList.value = [] // fix
return return
} }
fileList.value = [] // fileList.value = [] //
fileList.value.push(...val) fileList.value.push(...val)
}, },

2
src/router/modules/remaining.ts

@ -62,7 +62,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
component: () => import('@/views/Home/Index.vue'), component: () => import('@/views/Home/Index.vue'),
name: 'Index', name: 'Index',
meta: { meta: {
title: '首页', title: '驾驶舱',
icon: 'ep:home-filled', icon: 'ep:home-filled',
noCache: false, noCache: false,
affix: true affix: true

15
src/views/enterpriseinspections/index.vue

@ -71,24 +71,16 @@
:show-overflow-tooltip="true" :show-overflow-tooltip="true"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<!-- <el-table-column type="selection" width="55" /> --> <el-table-column type="selection" width="55" />
<!-- <el-table-column label="检查记录ID,主键" align="center" prop="id" /> --> <!-- <el-table-column label="检查记录ID,主键" align="center" prop="id" /> -->
<el-table-column label="企业名称" align="center" prop="enterpriseName" > <el-table-column label="企业名称" align="center" prop="enterpriseName" />
<template #default="scope">
<v-router @click="push({ path: '/enterprises/enterprises', query: { enterpriseId: scope.row.id} })" >{{scope.row.enterpriseName}}</v-router>
</template>
</el-table-column>
<el-table-column label="进度状态" align="center" prop="inspectionStatus"> <el-table-column label="进度状态" align="center" prop="inspectionStatus">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.INSPECTIONS_STATUS" :value="scope.row.inspectionStatus" /> <dict-tag :type="DICT_TYPE.INSPECTIONS_STATUS" :value="scope.row.inspectionStatus" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="任务名称" align="center" prop="taskName"> <el-table-column label="任务名称" align="center" prop="taskName" />
<template #default="scope">
<v-router @click="push({ path: '/task/index', query: { taskId: scope.row.taskId} })" >{{scope.row.taskName}}</v-router>
</template>
</el-table-column>
<el-table-column label="任务类型" align="center" prop="tagList" /> <el-table-column label="任务类型" align="center" prop="tagList" />
<el-table-column label="执法部门" align="center" prop="department" /> <el-table-column label="执法部门" align="center" prop="department" />
<el-table-column label="执法人员" align="center" prop="inspectName" /> <el-table-column label="执法人员" align="center" prop="inspectName" />
@ -168,6 +160,7 @@ const getList = async () => {
loading.value = true loading.value = true
try { try {
const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage(queryParams) const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage(queryParams)
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
} finally { } finally {

3
src/views/enterprises/index.vue

@ -94,8 +94,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> 搜索</el-button> <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="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> 重置</el-button>
@ -191,6 +189,7 @@
/> />
</ContentWrap> </ContentWrap>
<!-- 表单弹窗添加/修改 --> <!-- 表单弹窗添加/修改 -->
</template> </template>

179
src/views/enterprises/update.vue

@ -60,26 +60,17 @@
<el-form-item label="企业介绍" prop="introduction"> <el-form-item label="企业介绍" prop="introduction">
<el-input v-model="formData.introduction" type="textarea" placeholder="请输入企业介绍" /> <el-input v-model="formData.introduction" type="textarea" placeholder="请输入企业介绍" />
</el-form-item> </el-form-item>
<el-form-item label="企业照片" prop="size"> <el-form-item label="企业照片" prop="fileIds">
<InnerUploadImg <UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
:uploadList="uploadList"
@handler-success="uploadSuccess"
ref="uploadRef"
@handler-remove="uploadRemove"
/>
</el-form-item> </el-form-item>
<el-form-item label="企业资质" prop="fileIds">
<el-form-item label="企业资质照片" prop="size"> <UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
<InnerUploadImg
:uploadList="uploadList"
@handler-success="uploadSuccess"
ref="uploadRef"
@handler-remove="uploadRemove"
/>
</el-form-item> </el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate"> <el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker <el-date-picker
v-model="formData.establishmentDate" v-model="formData.establishmentDate"
@ -120,7 +111,6 @@
<el-button type="primary" @click="showMap = false">确定</el-button> <el-button type="primary" @click="showMap = false">确定</el-button>
</template> </template>
</el-dialog> </el-dialog>
<el-form-item label="签到半径" prop="gpsLocation"> <el-form-item label="签到半径" prop="gpsLocation">
<el-input <el-input
v-model="formData.signRadius" v-model="formData.signRadius"
@ -135,26 +125,94 @@
</section> </section>
<SelectUser ref="selectUserRef" @select-user="echoUser" /> <SelectUser ref="selectUserRef" @select-user="echoUser" />
</ContentWrap> </ContentWrap>
<ContentWrap title="资质记录" v-if="formType === 'update'">
<el-table v-loading="loading" :data="qualificationlist" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="资质编号" align="center" fixed="left" prop="enterpriseAuth" />
<el-table-column label="资质名称" align="center" fixed="left" prop="qualificationName" />
<el-table-column label="资质描述" align="center" fixed="left" prop="qualificationDescription" />
<el-table-column
label="资质到期日期"
align="center"
prop="expiryDate"
:formatter="dateFormatter"
width="180px"
/>
</el-table>
</ContentWrap>
<ContentWrap title="执法记录" v-if="formType === 'update'">
<div class="demo-collapse">
<el-collapse v-model="activeNames" @change="handleChange">
<el-collapse-item
v-for="item in inspectionslist"
:key="item.taskId"
:name="item.taskName" @click="getInspectionsLogList(item.id)">
<template #title>
<div class="custom-title">
任务编号 {{item.taskName}}
</div>
<div class="custom-title">
任务名称 {{item.taskName}}
</div>
<div class="custom-title">
计划开始时间 {{formatDate(item.taskStartTime)}}
</div>
<div class="custom-title">
计划结束时间 {{formatDate(item.taskEndTime)}}
</div>
</template>
<el-table v-loading="loading" :data="inspectionsLogList" :stripe="true" :show-overflow-tooltip="true">
<el-table-column label="执法人员" align="center" prop="inspectName" />
<el-table-column label="协同执法" align="center" prop="cooperateWithName" />
<el-table-column label="进度状态" align="center" prop="status">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INSPECTIONS_STATUS" :value="scope.row.status" />
</template>
</el-table-column>
<el-table-column
label="执法时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/>
</el-table>
</el-collapse-item>
</el-collapse>
</div>
</ContentWrap>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict' import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises' import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises'
import { FileInfoApi } from '@/api/enterprises/fileinfo' import { EnterpriseQualificationApi, EnterpriseQualificationVO } from '@/api/qualification'
import { EnterpriseInspectionsApi, EnterpriseInspectionsVO } from '@/api/enterpriseinspections'
import { UploadImgs } from '@/components/UploadFile'
import * as FileApi from '@/api/infra/file'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import SelectUser from './components/SelectUser.vue' import SelectUser from './components/SelectUser.vue'
import * as UserApi from '@/api/system/user' import * as UserApi from '@/api/system/user'
import {useTagsViewStore} from "@/store/modules/tagsView";
import {dateFormatter, formatDate} from "@/utils/formatTime";
/** 企业 表单 */ /** 企业 表单 */
defineOptions({ name: 'UpdateEnterprises' }) defineOptions({ name: 'UpdateEnterprises' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //
const dialogVisible = ref(false) // const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update - const formType = ref('') // create - update -
const selectUserRef = ref() const selectUserRef = ref()
const loading = ref(false) const loading = ref(false)
const selectedUser = ref() const selectedUser = ref()
const router=useRouter()
const route=useRoute()
const tagView=useTagsViewStore()
const fileIds = ref([]);
const qualificationlist = ref([]);
const inspectionslist = ref([]);
const inspectionsLogList = ref([]);
const formData = ref({ const formData = ref({
id: undefined, id: undefined,
@ -174,7 +232,8 @@ const formData = ref({
searchQuery: undefined, searchQuery: undefined,
managerDeptId: undefined, managerDeptId: undefined,
ides: undefined, ides: undefined,
startUserSelectAssignees:undefined startUserSelectAssignees:undefined,
fileIds:[]
}) })
const formRules = reactive({ const formRules = reactive({
type: [{ required: true, message: '企业类型不能为空', trigger: 'change' }], type: [{ required: true, message: '企业类型不能为空', trigger: 'change' }],
@ -222,7 +281,6 @@ const initMap = () => {
zoom: 14 zoom: 14
}) })
// //
window.qq.maps.event.addListener(map, 'click', (event: any) => { window.qq.maps.event.addListener(map, 'click', (event: any) => {
const latLng = event.latLng const latLng = event.latLng
@ -279,12 +337,11 @@ const handleSearch = () => {
} }
} }
onMounted(() => { onMounted(() => {
init() init()
getQualificationList()
getInspectionslList()
//getInspectionsLogList()
const openMapAndInit = async () => { const openMapAndInit = async () => {
if (showMap.value) { if (showMap.value) {
await nextTick() // DOM await nextTick() // DOM
@ -319,20 +376,22 @@ function handlerSelectUser(row) {
/** 提交表单 */ /** 提交表单 */
const emit = defineEmits(['success']) // success const emit = defineEmits(['success']) // success
const submitForm = async () => { const submitForm = async () => {
//console.log(formData.value)
// //
await formRef.value.validate() await formRef.value.validate()
formData.value.enterprisesStatus=1; formData.value.enterprisesStatus=1;
// //
loading.value = true loading.value = true
try { try {
const data = formData.value
const data = formData.value as unknown as EnterprisesVO if (formType.value == 'create') {
if (formType.value === 'create') {
await EnterprisesApi.pccreateEnterprises(data) await EnterprisesApi.pccreateEnterprises(data)
message.success(t('common.createSuccess')) message.success(t('common.createSuccess'))
tagView.delView(route)
router.go(-1)
} else { } else {
await EnterprisesApi.updateEnterprises(data) await EnterprisesApi.updateEnterprises(data)
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
} }
dialogVisible.value = false dialogVisible.value = false
@ -376,8 +435,11 @@ const resetForm = () => {
const uploadList: any = ref([]) const uploadList: any = ref([])
async function uploadSuccess(res) { async function uploadSuccess(res) {
console.log('1111111111111111111');
console.log(res.data.file_id)
fileIds.value.push(res.data.file_id);
if (res) { if (res) {
await FileInfoApi.createFileInfo({ await FileApi.createFile({
unitId: formData.value.id || id.value, unitId: formData.value.id || id.value,
attachmentPath: res.data, attachmentPath: res.data,
attachmentName: res.filename, attachmentName: res.filename,
@ -395,25 +457,49 @@ async function uploadSuccess(res) {
} }
} }
function getCarImg() {
/** 资质查询列表 BY-ZY */
const getQualificationList = async () => {
loading.value = true loading.value = true
FileInfoApi.getFileInfoPage({ unitId: formData.value.id, type: 4 }).then((res) => { try {
uploadList.value = res.list.map((item) => { const data = await EnterpriseQualificationApi.getEnterpriseQualificationPage({"enterpriseId":query.id})
return { qualificationlist.value = data.list
...item, } finally {
url: item.attachmentPath, loading.value = false
name: item.attachmentName
} }
}) }
/** 执法记录查询列表 by zy*/
const getInspectionslList = async () => {
loading.value = true
try {
const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage({"enterpriseId":query.id})
inspectionslist.value = data.list
} finally {
loading.value = false loading.value = false
}) }
} }
function uploadRemove(file) { /** 执法记录查询列表 by zy*/
FileInfoApi.deleteFileInfo(file.id).then(() => { const getInspectionsLogList = async (insprctionsId) => {
ElMessage.success('删除成功') console.log(insprctionsId)
}) loading.value = true
try {
const data = await EnterpriseInspectionsApi.inspectionsLogList({"inspectionsId":insprctionsId})
inspectionsLogList.value = data
} finally {
loading.value = false
}
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -467,4 +553,9 @@ function uploadRemove(file) {
height: 400px; height: 400px;
margin-top: 20px; margin-top: 20px;
} }
.custom-title {
font-size: 14px;
margin: 2% auto;
}
</style> </style>

2
src/views/task/create.vue

@ -413,7 +413,9 @@ async function submitForm() {
const validate = await unref(formRef).validate() const validate = await unref(formRef).validate()
if (validate) { if (validate) {
const data = JSON.parse(JSON.stringify(formData.value)) const data = JSON.parse(JSON.stringify(formData.value))
//1
data.status=1; data.status=1;
console.log("任务类型:",formData.value.taskType)
data.enterpriseIds = formData.value.enterprises.map((i) => i.id) data.enterpriseIds = formData.value.enterprises.map((i) => i.id)
if(data.enterpriseIds.length==0){ if(data.enterpriseIds.length==0){
message.success("温馨提示:请您选择执法对象") message.success("温馨提示:请您选择执法对象")

4
src/views/task/index.vue

@ -104,7 +104,7 @@
</el-table-column> --> </el-table-column> -->
<el-table-column label="任务类型" align="center" prop="taskType"> <el-table-column label="任务类型" align="center" prop="taskType">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_TYPE" :value="scope.row.taskType" /> <el-tag>{{ scope.row.taskTypeName }}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column label="任务优先级" align="center" prop="priority"> <!-- <el-table-column label="任务优先级" align="center" prop="priority">
@ -236,6 +236,7 @@ const { push } = useRouter()
const loading = ref(true) // const loading = ref(true) //
const list = ref<TaskInfoVO[]>([]) // const list = ref<TaskInfoVO[]>([]) //
const total = ref(0) // const total = ref(0) //
const taskTypeMap=ref()
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -270,6 +271,7 @@ const getList = async () => {
} }
} }
// //
const selectEnterprise = async (id: number) => {} const selectEnterprise = async (id: number) => {}

13
src/views/wait.vue

@ -0,0 +1,13 @@
<script setup lang="ts">
</script>
<template>
<div>
<h1>等待页面</h1>
</div>
</template>
<style scoped lang="scss">
</style>
Loading…
Cancel
Save