Browse Source

创建任务页面优化

master
DX 4 weeks ago
parent
commit
667ccbcfde
  1. 4
      src/api/enterprises/index.ts
  2. 5
      src/api/system/taglibrary/index.ts
  3. 480
      src/views/task/create copy.vue
  4. 182
      src/views/task/createEnterprise.vue

4
src/api/enterprises/index.ts

@ -27,6 +27,10 @@ export const EnterprisesApi = {
return await request.get({ url: `/system/enterprise/pcpage`, params })
},
getEnterpriseByUserId: async (params: any) => {
return await request.get({ url: `/system/enterprise/getEnterpriseByUserId`, params })
},
// 查询企业详情
getEnterprises: async (id: any) => {
return await request.get({ url: `/system/enterprise/get?id=` + id })

5
src/api/system/taglibrary/index.ts

@ -38,6 +38,11 @@ export const TagLibraryApi = {
return await request.delete({ url: `/system/tag-library/delete?id=` + id })
},
// 删除企业标签
tagLibraryList: async (codeList: string) => {
return await request.get({ url: `/system/tag-library/list?` + codeList })
},
// 导出企业标签 Excel
exportTagLibrary: async (params) => {
return await request.download({ url: `/system/tag-library/export-excel`, params })

480
src/views/task/create copy.vue

@ -46,21 +46,21 @@
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="标签" prop="tags" style="width: 100%">-->
<!-- <el-tree-select-->
<!-- v-model="formData.tags"-->
<!-- :data="tagList"-->
<!-- check-strictly-->
<!-- :render-after-expand="false"-->
<!-- placeholder="请选择标签"-->
<!-- node-key="id"-->
<!-- show-checkbox-->
<!-- multiple-->
<!-- :props="{-->
<!-- label: 'tagName'-->
<!-- }"-->
<!-- />-->
<!-- </el-form-item>-->
<!-- <el-form-item label="标签" prop="tags" style="width: 100%">-->
<!-- <el-tree-select-->
<!-- v-model="formData.tags"-->
<!-- :data="tagList"-->
<!-- check-strictly-->
<!-- :render-after-expand="false"-->
<!-- placeholder="请选择标签"-->
<!-- node-key="id"-->
<!-- show-checkbox-->
<!-- multiple-->
<!-- :props="{-->
<!-- label: 'tagName'-->
<!-- }"-->
<!-- />-->
<!-- </el-form-item>-->
<el-form-item label="描述" prop="description" style="width: 100%">
<el-input
type="textarea"
@ -78,17 +78,21 @@
<!-- <template #header> </template> -->
<section class="select-area" v-loading="loading">
<section>
<el-form :model="enterprise.queryParams" ref="queryFormRef" :inline="true" label-width="0" class="search-form">
<el-form
:model="enterprise.queryParams"
ref="queryFormRef"
:inline="true"
label-width="0"
class="search-form"
>
<div class="form-container">
<el-form-item label="" prop="region" class="form-item">
<el-select
v-model="enterprise.queryParams.region"
v-model="enterprise.queryParams.qy"
placeholder="请选择所属区域"
clearable
@clear="handleQuery"
@change="handleQuery"
>
<el-option
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA)"
:key="dict.value"
:label="dict.label"
@ -98,112 +102,116 @@
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="enterprise.queryParams.type"
v-model="enterprise.queryParams.hy"
placeholder="请选择行业"
clearable
@change="handleQuery"
@clear="handleQuery"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in hyList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="enterprise.queryParams.type"
v-model="enterprise.queryParams.st"
placeholder="请选择生态"
clearable
@change="handleQuery"
@clear="handleQuery"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in stList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="enterprise.queryParams.type"
placeholder="请选择类型"
clearable
@change="handleQuery"
@clear="handleQuery"
v-model="enterprise.queryParams.wr"
placeholder="请选择污染程度"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in wrList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="enterprisesName" class="form-item">
<el-input
v-model="enterprise.queryParams.enterprisesName"
v-model="enterprise.queryParams.inviterName"
placeholder="请选择执法人员"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="" prop="enterprisesName" class="form-item">
<el-input
v-model="enterprise.queryParams.enterprisesName"
placeholder="请输入企业名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item class="form-item">
<el-form-item class="form-item">
<el-button @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
</el-button>
<el-button @click="resetQuery" class="mr-10px">
<Icon icon="ep:refresh" class="mr-5px" /> 重置 </el-button
>
<Icon icon="ep:refresh" class="mr-5px" /> 重置
</el-button>
</el-form-item>
<el-form-item class="action-buttons" >
<el-form-item class="action-buttons">
<el-button @click="insertEnterprise" type="primary">
<el-icon><CirclePlus /></el-icon> &nbsp;
</el-button>
</el-form-item>
</div>
</el-form>
<section class="enterprise-area">
<section class="enterprise-area" style="border: 1px solid #ebeef5">
<el-table
ref="multipleTableRef"
:data="enterprise.list"
@selection-change="handleSelectionChange"
style="width: 100%; border: 1px solid #EBEEF5; "
:cell-style="{ borderBottom: '1px solid #EBEEF5' }"
:header-cell-style="{
borderBottom: '1px solid #EBEEF5',
backgroundColor: '#F5F7FA'
}"
ref="multipleTableRef"
:data="enterprise.list"
@selection-change="handleSelectionChange"
:cell-style="{ borderBottom: '1px solid #EBEEF5' }"
:header-cell-style="{
borderBottom: '1px solid #EBEEF5',
backgroundColor: '#F5F7FA'
}"
>
<template #empty>
<div class="no-data">
<el-image src="/src/assets/imgs/no_data.png" style="width: 120px;" />
<p>暂无数据</p>
</div>
</template>
<el-table-column type="selection" width="30"/>
<el-table-column property="enterprisesName" label="企业名称" min-width="100" />
<template #empty>
<div class="no-data">
<el-image src="/src/assets/imgs/no_data.png" style="width: 120px" />
<p>暂无数据</p>
</div>
</template>
<el-table-column type="selection" width="30" />
<el-table-column property="enterprisesName" label="企业名称" min-width="100" />
<el-table-column property="region" label="区域" min-width="100">
<template #default="scope">
{{ getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA).find(dict => dict.value == scope.row.region)?.label || '未知区域' }}
{{
getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA).find(
(dict) => dict.value == scope.row.region
)?.label || '未知区域'
}}
</template>
</el-table-column>
</el-table-column>
<el-table-column property="enterprisesName" label="行业" min-width="100" />
<el-table-column property="enterprisesName" label="生态" min-width="100" />
<el-table-column property="enterprisesName" label="类型" min-width="100" />
<el-table-column property="enterprisesName" label="执法人员" min-width="100" />
<el-table-column label="操作" align="center" min-width="80px">
<template #default="scope">
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
>
删除
</el-button>
</template>
</el-table-column>
</el-table>
</section>
<pagination
@ -218,26 +226,33 @@
</section>
<div class="footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button
type="primary" @click="submitForm" v-hasPermi="['system:enterprise-inspections:audit']">审核通过</el-button>
<el-button
<el-button
type="primary"
@click="submitForm"
v-hasPermi="['system:enterprise-inspections:audit']"
>审核通过</el-button
>
<el-button
type="danger"
@click="submitForm"
v-hasPermi="['system:enterprise-inspections:audit']"
>删除</el-button>
>删除</el-button
>
</div>
</section>
</ContentWrap>
<CreateEnterprise ref="formRef"/>
<CreateEnterprise ref="formRef" @success="getList" />
</template>
<script setup lang="ts">
import { DICT_TYPE, getIntDictOptions, getStrDictOptions } from '@/utils/dict'
import { TagLibraryApi } from '@/api/system/taglibrary'
import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises'
import { TaskInfoApi } from '@/api/system/taskinfo'
import { useTagsViewStore} from '@/store/modules/tagsView'
import {defaultProps} from "@/utils/tree";
import { useTagsViewStore } from '@/store/modules/tagsView'
import { defaultProps } from '@/utils/tree'
import CreateEnterprise from './createEnterprise.vue'
import { cloneDeep } from 'lodash-es';
defineOptions({ name: 'CreateTask' })
const loading = ref(false)
@ -261,9 +276,9 @@ const formData = ref({
tags: [],
enterprises: [] as any
})
const router=useRouter()
const route=useRoute()
const tagView=useTagsViewStore()
const router = useRouter()
const route = useRoute()
const tagView = useTagsViewStore()
const message = useMessage() //
const formRules = reactive({
title: [{ required: true, message: '任务标题不能为空', trigger: 'blur' }],
@ -276,72 +291,179 @@ const formRules = reactive({
],
planTime: [{ required: true, message: '时间周期不能为空', trigger: 'blur' }]
})
const {query}=useRoute()
const { query } = useRoute()
const formRef = ref() // Ref`
const tagList = ref([])
const queryFormRef = ref() //
const enterprise = ref({
list: ref<EnterprisesVO[]>(),
list: [] as any,
queryParams: reactive({
pageNo: 1,
pageSize: 9,
enterprisesName: undefined,
qy: undefined,
hy: undefined,
st: undefined,
wr: undefined,
inviterName: undefined
}),
total: ref(0) as any
})
const handleDelete = (id: number) => {
//
const targetIndex = enterprise.value.list.findIndex(item => item.id === id);
if (targetIndex === -1) return;
//
enterprise.value.list.splice(targetIndex, 1);
enterprise_copy.value = cloneDeep(enterprise.value);
enterprise.value.total = enterprise.value.list.length
//
const { pageNo, pageSize } = enterprise.value.queryParams;
const itemsOnCurrentPage = enterprise.value.list.slice(
(pageNo - 1) * pageSize,
pageNo * pageSize
);
if (itemsOnCurrentPage.length === 0 && pageNo > 1) {
enterprise.value.queryParams.pageNo = pageNo - 1;
}
}
const enterprise_copy = ref({
list: [] as any,
queryParams: reactive({
pageNo: 1,
pageSize: 9,
enterprisesName: undefined,
type: undefined,
region: undefined,
registrationNumber: undefined,
id:undefined
qy: undefined,
hy: undefined,
st: undefined,
wr: undefined,
inviterName: undefined
}),
total: ref(0)
total: ref(0) as any
})
//
const isAllConditionsEmpty = computed(() => {
const params = enterprise.value.queryParams;
return (
!params.enterprisesName &&
!params.qy &&
!params.hy &&
!params.st &&
!params.wr &&
!params.inviterName
);
});
/** 搜索按钮操作 */
const handleQuery = () => {
enterprise.value.queryParams.pageNo = 1
getEnterPriseList()
const list = filterList(enterprise.value.list)
console.log('listlist', list)
enterprise.value.list = list
enterprise.value.total = list?.length
}
//
const filterList = (list: EnterprisesVO[]) => {
if (isAllConditionsEmpty.value) return enterprise_copy.value.list; //
if (list.length > 0) {
const { enterprisesName, qy, hy, st, wr , inviterName } = enterprise.value.queryParams;
return list.filter(item => {
//
const nameMatch = enterprisesName ?
item.enterprisesName?.toLowerCase().includes(enterprisesName.toLowerCase()) : true;
//
const typeMatch = qy ? item.region == qy : true;
//
// const regionMatch = hy ? item.region === region : true;
// //
// const regNumMatch = registrationNumber ?
// item.registrationNumber === registrationNumber : true;
// // ID
// const idMatch = id !== undefined ? item.id === id : true;
// return nameMatch && typeMatch && regionMatch && regNumMatch && idMatch;
return nameMatch && typeMatch
});
}
}
// //
// const filteredData = computed(() => {
// return filterList(enterprise.value.list);
// });
//
// const pagedData = computed(() => {
// const { pageNo, pageSize } = enterprise.value.queryParams;
// const start = (pageNo - 1) * pageSize;
// const end = start + pageSize;
// return filteredData.value.slice(start, end);
// });
// //
// watch(filteredData, (newList) => {
// enterprise.value.total = newList.length;
// }, { immediate: true });
const insertEnterprise = () => {
formRef.value.open()
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value.resetFields()
handleQuery()
}
//
const hyList:any = ref([])
//
const stList:any = ref([])
//
const wrList:any = ref([])
/**
* 获取标签列表
*/
function getTagList() {
TagLibraryApi.getTagLibraryPage({tagType:2}).then((res) => {
tagList.value = res
})
async function getTagList() {
const codeList = 'codeList=hy&codeList=st&codeList=wr'
const data = await TagLibraryApi.tagLibraryList(codeList)
hyList.value = data[0].children
stList.value = data[1].children
wrList.value = data[2].children
}
const defaultProps = {
label: 'tagName', // 使 'name'
children: 'children', // 使 'children'
};
/**
* 获取企业列表
*/
async function getEnterPriseList() {
loading.value = true
try {
const data = await EnterprisesApi.getEnterprisesPage(enterprise.value.queryParams)
enterprise.value.list = data.list
enterprise.value.total = data.total
} finally {
loading.value = false
}
children: 'children' // 使 'children'
}
/**
* 全选
*/
async function selectAll() {
loading.value = true
const data = JSON.parse(JSON.stringify(enterprise.value.queryParams));
data.pageSize = -1
delete data.pageNo
const { list } = await EnterprisesApi.getEnterprisesPage(data)
const data = JSON.parse(JSON.stringify(enterprise.value.queryParams))
data.pageSize = -1
delete data.pageNo
const { list } = await EnterprisesApi.getEnterprisesPage(data)
const arr = [...formData.value.enterprises, ...list]
formData.value.enterprises = uniqueFunc(arr, 'id')
loading.value = false
@ -351,9 +473,9 @@ async function selectAll() {
*/
async function cancelAll() {
loading.value = true
const data = JSON.parse(JSON.stringify(enterprise.value.queryParams));
const data = JSON.parse(JSON.stringify(enterprise.value.queryParams))
data.pageSize = -1
delete data.pageNo
delete data.pageNo
const { list } = await EnterprisesApi.getEnterprisesPage(data)
if (list) {
formData.value.enterprises = formData.value.enterprises.filter((e) => {
@ -394,58 +516,64 @@ async function submitForm() {
if (validate) {
const data = JSON.parse(JSON.stringify(formData.value))
//1
data.status=1;
console.log("任务类型:",formData.value.taskType)
data.status = 1
console.log('任务类型:', formData.value.taskType)
data.enterpriseIds = formData.value.enterprises.map((i) => i.id)
if(data.enterpriseIds.length==0){
message.success("温馨提示:请您选择执法对象")
}else{
if(data.status<2){
data.startDate = data.planTime[0]
data.endDate = data.planTime[1]
if (data.id) {
TaskInfoApi.updateTaskInfo(data).then(() => {
message.success('操作成功')
tagView.delView(route)
router.go(-1)
})
} else {
TaskInfoApi.createTaskInfo(data).then(() => {
message.success('操作成功')
tagView.delView(route)
router.go(-1)
})
}
}else{
message.success('温馨提示:该任务已经执行,无法再进行修改')
}
if (data.enterpriseIds.length == 0) {
message.success('温馨提示:请您选择执法对象')
} else {
if (data.status < 2) {
data.startDate = data.planTime[0]
data.endDate = data.planTime[1]
if (data.id) {
TaskInfoApi.updateTaskInfo(data).then(() => {
message.success('操作成功')
tagView.delView(route)
router.go(-1)
})
} else {
TaskInfoApi.createTaskInfo(data).then(() => {
message.success('操作成功')
tagView.delView(route)
router.go(-1)
})
}
} else {
message.success('温馨提示:该任务已经执行,无法再进行修改')
}
}
}
}
function init(){
if(query.id){
TaskInfoApi.getTaskInfo(query.id).then(res=>{
formData.value=res
formData.value.planTime=[formData.value.startDate,formData.value.endDate]
formData.value.enterprises=res.enterpriseIdes
formData.value.tags=res.taskTagIdes.map(t=>t.tagId)
})
}
function init() {
if (query.id) {
TaskInfoApi.getTaskInfo(query.id).then((res) => {
formData.value = res
formData.value.planTime = [formData.value.startDate, formData.value.endDate]
formData.value.enterprises = res.enterpriseIdes
formData.value.tags = res.taskTagIdes.map((t) => t.tagId)
})
}
}
function getList(data) {
enterprise.value.list.push(...data)
enterprise.value.total = enterprise.value.list.length
enterprise_copy.value = cloneDeep(enterprise.value);
}
// getEnterPriseList()
getTagList()
onMounted(()=>{
init()
onMounted(() => {
init()
})
</script>
<style scoped lang="scss">
::v-deep .ContentWrap .el-card__header {
text-decoration: none !important; /* 去除下划线 */
border-bottom: 0px solid #ebeef5 !important;
padding-left: 20px;
::v-deep(.el-card__header) {
border-bottom: 0;
}
::v-deep(.taskForm .el-form) {
@ -462,33 +590,28 @@ onMounted(()=>{
.enterprise-area {
flex: 1;
gap: 10px;
margin: 0 20px; //
overflow-x: hidden; //
width: calc(100% - 40px); //
:deep(.el-table) {
width: 100% !important; //
margin: 0 20px; //
overflow-x: hidden; //
width: calc(100% - 40px); //
::v-deep(.el-table) {
width: 100% !important; //
.el-table__cell {
text-align: center;
}
}
:deep(.no-data) {
padding: 30px 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
p {
margin-top: 10px;
color: #909399;
}
}
.enterprise {
cursor: pointer;
box-shadow: 0 0 1px 1px #eaeaea;
@ -545,7 +668,7 @@ onMounted(()=>{
.select-area {
display: grid;
grid-template-rows: 1fr;
grid-template-columns: minmax(0, 1fr);
grid-template-columns: minmax(0, 1fr);
grid-gap: 20px;
::v-deep(.select-area .el-form) {
margin-bottom: 15px;
@ -561,56 +684,51 @@ onMounted(()=>{
margin-bottom: 10px;
}
}
.search-form {
background-color: #fff;
padding: 20px 20px 0px 20px;
border-radius: 4px;
position: relative;
margin: 0 20px; // margin
margin: 0 20px; // margin
.form-container {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 24px;
margin-bottom: 20px;
}
.form-item {
margin: 0;
width: 100%;
:deep(.el-input),
:deep(.el-select) {
width: 100%;
}
}
.action-buttons {
position: absolute;
right: 10px;
bottom: 0px;
}
.button-container {
display: flex;
justify-content: center;
gap: 8px;
}
}
.pagination-container {
display: flex;
justify-content: right;
margin: 10px; //
}
.footer {
display: flex;
justify-content: center; //
gap: 8px; //
padding-top: 20px;
margin: 10px; //
margin: 10px; //
}
}
</style>
</style>

182
src/views/task/createEnterprise.vue

@ -11,77 +11,88 @@
<div class="search-area">
<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="0" class="search-form">
<div class="form-container">
<el-form-item label="" prop="enterprisesName" class="form-item">
<el-input
v-model="queryParams.enterprisesName"
placeholder="请输入企业名称"
/>
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-form-item label="" prop="region" class="form-item">
<el-select
v-model="queryParams.type"
placeholder="请选择企业规模"
v-model="queryParams.region"
placeholder="请选择所属区域"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="queryParams.type"
placeholder="请选择企业规模"
v-model="queryParams.hy"
placeholder="请选择行业"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in hyList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="type" class="form-item">
<el-form-item label="" prop="region" class="form-item">
<el-select
v-model="queryParams.type"
placeholder="请选择企业规模"
v-model="queryParams.st"
placeholder="请选择生态"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in stList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="region" class="form-item">
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="queryParams.region"
placeholder="请选择所属区域"
v-model="queryParams.wr"
placeholder="请选择污染程度"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
v-for="dict in wrList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="region" class="form-item">
<el-form-item label="" prop="type" class="form-item">
<el-select
v-model="queryParams.region"
placeholder="请选择所属区域"
v-model="queryParams.inviterName"
placeholder="请选择执法人员"
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA)"
v-for="dict in getStrDictOptions(DICT_TYPE.ENTERPRISES_TYPE)"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="enterprisesName" class="form-item">
<el-input
v-model="queryParams.enterprisesName"
placeholder="请输入企业名称"
/>
</el-form-item>
<el-form-item class="form-item">
<el-button @click="handleQuery">
<Icon icon="ep:search" class="mr-5px" /> 搜索
@ -113,13 +124,25 @@
{{ getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA).find(dict => dict.value == scope.row.region)?.label || '未知区域' }}
</template>
</el-table-column>
<el-table-column property="enterprisesName" label="行业" />
<el-table-column property="enterprisesName" label="生态" />
<el-table-column property="enterprisesName" label="类型" />
<el-table-column property="enterprisesName" label="执法人员" />
<el-table-column property="enterprisesName" label="行业" >
<template #default="scope">
{{ scope.row.tagListName && scope.row.tagListName.filter(item => item.value == 1).map(item => item.label).join(', ') }}
</template>
</el-table-column>
<el-table-column property="enterprisesName" label="生态">
<template #default="scope">
{{ scope.row.tagListName && scope.row.tagListName.filter(item => item.value == 2).map(item => item.label).join(', ') }}
</template>
</el-table-column>
<el-table-column property="enterprisesName" label="类型">
<template #default="scope">
{{ scope.row.tagListName && scope.row.tagListName.filter(item => item.value == 4).map(item => item.label).join(', ') }}
</template>
</el-table-column>
<el-table-column property="inviterName" label="执法人员" />
</el-table>
<!-- 分页 -->
<!-- 分页 -->
<div class="pagination-container">
<pagination
@ -144,10 +167,9 @@
<script setup lang="ts">
import { DICT_TYPE, getStrDictOptions } from '@/utils/dict'
import { EnterprisesApi, EnterprisesVO } from '@/api/enterprises'
import {TagLibraryVO, TagLibraryApi} from '@/api/system/taglibrary'
import { array } from 'vue-types'
const loading = ref(true) //
const emit = defineEmits(['update:modelValue', 'success'])
const props = defineProps({
modelValue: {
@ -155,7 +177,6 @@ const props = defineProps({
default: false
}
})
const enterprise = ref({
list: ref<EnterprisesVO[]>(),
queryParams: reactive({
@ -169,60 +190,53 @@ const enterprise = ref({
}),
total: ref(0)
})
const queryParams = ref({
enterprisesName: undefined,
type: '',
hy: undefined,
st: undefined,
wr: undefined,
region: undefined,
registrationNumber: undefined,
inviterName:undefined,
// registrationNumber: undefined,
id:undefined
})
//
const visible = ref(false) //
// ... ...
//
const handleClose = () => {
visible.value = false
}
const selectedEnterprises = ref<EnterprisesVO[]>([]);
const handleSelectionChange = (selectedItems: EnterprisesVO[]) => {
selectedEnterprises.value = selectedItems;
}
//
const confirmSelect = () => {
emit('success', selectedEnterprises.value)
}
//
const handleConfirm = () => {
// TODO:
visible.value = false
emit('success')
}
}
/**
* 获取企业列表
*/
async function getEnterPriseList() {
loading.value = true
console.log('enterprise.value.queryParams', enterprise.value.queryParams)
try {
const data = await EnterprisesApi.getEnterprisesPage(enterprise.value.queryParams)
const data = await EnterprisesApi.getEnterpriseByUserId(enterprise.value.queryParams)
enterprise.value.list = data.list
enterprise.value.total = data.total
} finally {
loading.value = false
}
}
//
const open = async () => {
// TODO:
@ -234,17 +248,51 @@ const open = async () => {
registrationNumber: undefined,
id: undefined
}
}
/** 搜索按钮操作 */
const handleQuery = () => {
enterprise.value.queryParams.pageNo = 1
getEnterPriseList()
}
getEnterPriseList()
/** 重置按钮操作 */
const resetQuery = () => {
// queryFormRef.value.resetFields()
// handleQuery()
}
//
const hyList:any = ref([])
//
const stList:any = ref([])
//
const wrList:any = ref([])
async function init() {
try {
const codeList = 'codeList=hy&codeList=st&codeList=wr'
const data = await TagLibraryApi.tagLibraryList(codeList)
hyList.value = data[0].children
stList.value = data[1].children
wrList.value = data[2].children
} finally {
}
}
getEnterPriseList()
onMounted(()=>{
init()
})
defineExpose({ open })
</script>
<style scoped lang="scss">
.enterprise-container {
// ... ...
.search-form {
background-color: #fff;
padding: 20px 20px 0px 20px;
@ -267,7 +315,6 @@ defineExpose({ open })
width: 100%;
}
}
.action-buttons {
position: absolute;
right: 10px;
@ -280,13 +327,11 @@ defineExpose({ open })
gap: 8px;
}
}
.pagination-container {
display: flex;
justify-content: right;
margin-top: 20px; //
}
.footer {
display: flex;
justify-content: center; //
@ -294,8 +339,5 @@ defineExpose({ open })
padding-top: 20px;
margin-top: 20px; //
}
}
</style>
Loading…
Cancel
Save