赵鹏 1 month ago
parent
commit
76d16fc23a
  1. 4
      src/api/enterprises/index.ts
  2. 1
      src/components/UploadFile/src/UploadImgs.vue
  3. 2
      src/router/modules/remaining.ts
  4. 4
      src/views/enterpriseinspections/index.vue
  5. 3
      src/views/enterprises/index.vue
  6. 183
      src/views/enterprises/update.vue
  7. 2
      src/views/task/create.vue
  8. 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 })
},
// PC新增企业
pccreateEnterprises: async (data: EnterprisesVO) => {
pccreateEnterprises: async (data: any) => {
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 })
},

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

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

2
src/router/modules/remaining.ts

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

4
src/views/enterpriseinspections/index.vue

@ -161,8 +161,6 @@ const getList = async () => {
try {
const data = await EnterpriseInspectionsApi.getEnterpriseInspectionsPage(queryParams)
list.value = data.list
total.value = data.total
} finally {
@ -226,4 +224,4 @@ const handleExport = async () => {
onMounted(() => {
getList()
})
</script>
</script>

3
src/views/enterprises/index.vue

@ -94,8 +94,6 @@
/>
</el-select>
</el-form-item>
<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>
@ -191,6 +189,7 @@
/>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
</template>

183
src/views/enterprises/update.vue

@ -60,26 +60,17 @@
<el-form-item label="企业介绍" prop="introduction">
<el-input v-model="formData.introduction" type="textarea" placeholder="请输入企业介绍" />
</el-form-item>
<el-form-item label="企业照片" prop="size">
<InnerUploadImg
:uploadList="uploadList"
@handler-success="uploadSuccess"
ref="uploadRef"
@handler-remove="uploadRemove"
/>
<el-form-item label="企业照片" prop="fileIds">
<UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
</el-form-item>
<el-form-item label="企业资质照片" prop="size">
<InnerUploadImg
:uploadList="uploadList"
@handler-success="uploadSuccess"
ref="uploadRef"
@handler-remove="uploadRemove"
/>
<el-form-item label="企业资质" prop="fileIds">
<UploadImgs v-model="formData.fileIds" :limit="3" height="100px" width="100px" />
</el-form-item>
<el-form-item label="企业成立时间" prop="establishmentDate">
<el-date-picker
v-model="formData.establishmentDate"
@ -120,7 +111,6 @@
<el-button type="primary" @click="showMap = false">确定</el-button>
</template>
</el-dialog>
<el-form-item label="签到半径" prop="gpsLocation">
<el-input
v-model="formData.signRadius"
@ -135,26 +125,94 @@
</section>
<SelectUser ref="selectUserRef" @select-user="echoUser" />
</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>
<script setup lang="ts">
import { getStrDictOptions, DICT_TYPE } from '@/utils/dict'
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 SelectUser from './components/SelectUser.vue'
import * as UserApi from '@/api/system/user'
import {useTagsViewStore} from "@/store/modules/tagsView";
import {dateFormatter, formatDate} from "@/utils/formatTime";
/** 企业 表单 */
defineOptions({ name: 'UpdateEnterprises' })
const { t } = useI18n() //
const message = useMessage() //
const dialogVisible = ref(false) //
const dialogTitle = ref('') //
const formLoading = ref(false) // 12
const formType = ref('') // create - update -
const selectUserRef = ref()
const loading = ref(false)
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({
id: undefined,
@ -174,7 +232,8 @@ const formData = ref({
searchQuery: undefined,
managerDeptId: undefined,
ides: undefined,
startUserSelectAssignees:undefined
startUserSelectAssignees:undefined,
fileIds:[]
})
const formRules = reactive({
type: [{ required: true, message: '企业类型不能为空', trigger: 'change' }],
@ -188,7 +247,7 @@ const { query } = useRoute()
function init() {
if (query.id) {
// id 'update'
formType.value = 'update'
formType.value = 'update'
EnterprisesApi.getEnterprises(query.id).then((res) => {
selectedUser.value=res.inviterName;
// formData.value.startUserSelectAssignees=res.userId;
@ -222,7 +281,6 @@ const initMap = () => {
zoom: 14
})
//
window.qq.maps.event.addListener(map, 'click', (event: any) => {
const latLng = event.latLng
@ -279,12 +337,11 @@ const handleSearch = () => {
}
}
onMounted(() => {
init()
getQualificationList()
getInspectionslList()
//getInspectionsLogList()
const openMapAndInit = async () => {
if (showMap.value) {
await nextTick() // DOM
@ -319,20 +376,22 @@ function handlerSelectUser(row) {
/** 提交表单 */
const emit = defineEmits(['success']) // success
const submitForm = async () => {
//console.log(formData.value)
//
await formRef.value.validate()
formData.value.enterprisesStatus=1;
//
loading.value = true
try {
const data = formData.value as unknown as EnterprisesVO
if (formType.value === 'create') {
const data = formData.value
if (formType.value == 'create') {
await EnterprisesApi.pccreateEnterprises(data)
message.success(t('common.createSuccess'))
tagView.delView(route)
router.go(-1)
} else {
await EnterprisesApi.updateEnterprises(data)
message.success(t('common.updateSuccess'))
}
dialogVisible.value = false
@ -376,8 +435,11 @@ const resetForm = () => {
const uploadList: any = ref([])
async function uploadSuccess(res) {
console.log('1111111111111111111');
console.log(res.data.file_id)
fileIds.value.push(res.data.file_id);
if (res) {
await FileInfoApi.createFileInfo({
await FileApi.createFile({
unitId: formData.value.id || id.value,
attachmentPath: res.data,
attachmentName: res.filename,
@ -395,25 +457,49 @@ async function uploadSuccess(res) {
}
}
function getCarImg() {
/** 资质查询列表 BY-ZY */
const getQualificationList = async () => {
loading.value = true
FileInfoApi.getFileInfoPage({ unitId: formData.value.id, type: 4 }).then((res) => {
uploadList.value = res.list.map((item) => {
return {
...item,
url: item.attachmentPath,
name: item.attachmentName
}
})
try {
const data = await EnterpriseQualificationApi.getEnterpriseQualificationPage({"enterpriseId":query.id})
qualificationlist.value = data.list
} finally {
loading.value = false
})
}
}
function uploadRemove(file) {
FileInfoApi.deleteFileInfo(file.id).then(() => {
ElMessage.success('删除成功')
})
/** 执法记录查询列表 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
}
}
/** 执法记录查询列表 by zy*/
const getInspectionsLogList = async (insprctionsId) => {
console.log(insprctionsId)
loading.value = true
try {
const data = await EnterpriseInspectionsApi.inspectionsLogList({"inspectionsId":insprctionsId})
inspectionsLogList.value = data
} finally {
loading.value = false
}
}
</script>
<style lang="scss" scoped>
@ -467,4 +553,9 @@ function uploadRemove(file) {
height: 400px;
margin-top: 20px;
}
.custom-title {
font-size: 14px;
margin: 2% auto;
}
</style>

2
src/views/task/create.vue

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

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