Browse Source

任务

master
DX 2 weeks ago
parent
commit
da000f72b7
  1. 2
      src/api/system/taglibrary/index.ts
  2. 89
      src/views/task/create copy 2.vue
  3. 194
      src/views/task/index.vue

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

@ -15,7 +15,7 @@ export interface TagLibraryVO {
export const TagLibraryApi = { export const TagLibraryApi = {
// 查询企业标签分页 // 查询企业标签分页
getTagLibraryPage: async (params: any) => { getTagLibraryPage: async (params: any) => {
return await request.get({ url: `/system/tag-library/page`, params }) return await request.get({ url: `/system/tag-library/pageInfo`, params })
}, },
// 查询企业标签分页 // 查询企业标签分页

89
src/views/task/create copy 2.vue

@ -75,6 +75,23 @@
<div class="wrapper-down"> <div class="wrapper-down">
<div class="title">执法范围</div> <div class="title">执法范围</div>
<div class="box"> <div class="box">
<div>
<el-input
v-model="enterprise.queryParams.enterprisesName"
placeholder="请输入企业名称" size="large"
/>
<el-select v-model="enterprise.queryParams.userId" placeholder="请选择执法人员" size="large" filterable clearable>
<el-option
v-for="dict in userList"
:key="dict.id"
:label="dict.deptName +'_'+ dict.realName"
:value="dict.id"
/>
</el-select>
</div>
<div> <div>
<el-select <el-select
v-model="enterprise.queryParams.qy" v-model="enterprise.queryParams.qy"
@ -89,26 +106,7 @@
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
<el-input
v-model="enterprise.queryParams.enterprisesName"
placeholder="请输入企业名称" size="large"
/>
</div>
<div>
<el-select
v-model="enterprise.queryParams.hy"
placeholder="请选择行业"
clearable
size="large"
>
<el-option
v-for="dict in hyList"
:key="dict.id"
:label="dict.tagName"
:value="dict.tagName"
/>
</el-select>
<div class="btn"> <div class="btn">
<el-button type="primary" plain size="large" @click="handleQuery"> <el-button type="primary" plain size="large" @click="handleQuery">
@ -121,14 +119,23 @@
</div> </div>
<div> <div>
<el-select v-model="enterprise.queryParams.userId" placeholder="请选择执法人员" size="large" filterable clearable>
<el-select
v-model="enterprise.queryParams.hy"
placeholder="请选择行业列别"
clearable
size="large"
multiple
filterable
>
<el-option <el-option
v-for="dict in userList" v-for="dict in hyList"
:key="dict.id" :key="dict.id"
:label="dict.deptName +'_'+ dict.realName" :label="dict.tagName"
:value="dict.id" :value="dict.tagName"
/> />
</el-select> </el-select>
<div class="btn2"> <div class="btn2">
<el-button @click="insertEnterprise" type="primary" size="large"> <el-button @click="insertEnterprise" type="primary" size="large">
<el-icon><Sort /></el-icon> &nbsp; <el-icon><Sort /></el-icon> &nbsp;
@ -154,7 +161,7 @@
</template> </template>
<el-table-column type="selection" width="30" :reserve-selection="true"/> <el-table-column type="selection" width="30" :reserve-selection="true"/>
<el-table-column property="enterprisesName" label="企业名称" min-width="100" /> <el-table-column property="enterprisesName" label="企业名称" min-width="100" />
<el-table-column property="region" label="区域"> <el-table-column property="region" label="所属区域">
<template #default="scope"> <template #default="scope">
{{ {{
getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA).find( getStrDictOptions(DICT_TYPE.ENTERPRISES_AREA).find(
@ -163,7 +170,7 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="enterprisesName" label="行业"> <el-table-column property="enterprisesName" label="行业类别">
<template #default="scope"> <template #default="scope">
{{ {{
scope.row.tagListName && scope.row.tagListName &&
@ -174,30 +181,12 @@
}} }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="enterprisesName" label="生态"> <el-table-column property="inviterName" label="执法人员" min-width="100" >
<template #default="scope"> <template #default="scope">
{{ {{scope.row.inviterName}} | {{scope.row.inviterNameDept}}
scope.row.tagListName &&
scope.row.tagListName
.filter((item) => item.value == 2)
.map((item) => item.label)
.join(', ')
}}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column property="enterprisesName" label="类型"> <el-table-column label="操作" align="left" >
<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="执法人员" min-width="100" />
<el-table-column label="操作" align="center" min-width="80px">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -456,7 +445,6 @@ const filterList = (list: EnterprisesVO[]) => {
const { enterprisesName, qy, hy, userId } = enterprise.value.queryParams; const { enterprisesName, qy, hy, userId } = enterprise.value.queryParams;
return list.filter(item => { return list.filter(item => {
if (item.tagList) { if (item.tagList) {
// //
@ -465,7 +453,12 @@ const filterList = (list: EnterprisesVO[]) => {
// //
const typeMatch = qy ? item.region == qy : true; const typeMatch = qy ? item.region == qy : true;
// //
const hyMatch = hy ? item.tagList.includes(hy) : true
let test = hy.filter(h => item.tagList.includes(h))
console.log('test', test)
const hyMatch = hy ? hy.filter(h => item.tagList.includes(h)) : true
const userIdMatch = userId ? item.userId == userId : true const userIdMatch = userId ? item.userId == userId : true

194
src/views/task/index.vue

@ -1,14 +1,14 @@
<template> <template>
<ContentWrap style="align-items: center; display: flex; padding: 25px 0;"> <ContentWrap style="padding: 10px;">
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<el-form <el-form
class="formClass" class="formClass"
:model="queryParams" :model="queryParams"
ref="queryFormRef" ref="queryFormRef"
:inline="true" :inline="true"
label-width="108px" size="large"
> >
<el-form-item label="任务标题" prop="title"> <el-form-item label="" prop="title">
<el-input <el-input
v-model="queryParams.title" v-model="queryParams.title"
placeholder="请输入任务标题" placeholder="请输入任务标题"
@ -17,7 +17,22 @@
class="!w-240px" class="!w-240px"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="任务状态" prop="taskType"> <el-form-item label="" prop="taskType">
<el-select
v-model="queryParams.taskType"
placeholder="请选择任务类型"
clearable
class="!w-240px"
>
<el-option
v-for="dict in taskTypeList"
:key="dict.id"
:label="dict.tagName"
:value="dict.id"
/>
</el-select>
</el-form-item>
<el-form-item label="" prop="taskType">
<el-select <el-select
v-model="queryParams.status" v-model="queryParams.status"
placeholder="请选择任务状态" placeholder="请选择任务状态"
@ -31,8 +46,9 @@
:value="dict.value" :value="dict.value"
/> />
</el-select> </el-select>
</el-form-item> --> </el-form-item>
<el-form-item label="任务类型" prop="taskType">
<el-form-item label="" prop="taskType">
<el-select <el-select
v-model="queryParams.taskType" v-model="queryParams.taskType"
placeholder="请选择任务类型" placeholder="请选择任务类型"
@ -47,29 +63,36 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="任务时间" prop="startDate"> <el-form-item label="" prop="startDate" style="width: 100%;">
<el-date-picker <el-select
v-model="queryParams.startDate" v-model="queryParams.selectWeek"
value-format="YYYY-MM-DD HH:mm:ss" placeholder="请选择日期范围"
type="daterange" clearable
start-placeholder="开始日期" class="!w-240px"
end-placeholder="结束日期" >
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" <el-option
class="!w-220px" v-for="dict in getIntDictOptions(DICT_TYPE.SELECT_WEEK)"
/> :key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</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>
</el-form-item>
<el-form-item class="mergeClass" >
<el-button <el-button
type="primary" type="primary"
plain plain
v-hasPermi="['system:task-info:create']" v-hasPermi="['system:task-info:create']"
@click="push({ path: '/task/create' })" @click="push({ path: '/task/create' })"
> >
<Icon icon="ep:plus" class="mr-5px" /> 创建任务 <Icon icon="ep:plus" class="mr-5px" /> 新增
</el-button> </el-button>
<el-button <!-- <el-button
type="success" type="success"
plain plain
@click="handleExport" @click="handleExport"
@ -77,7 +100,7 @@
v-hasPermi="['system:task-info:export']" v-hasPermi="['system:task-info:export']"
> >
<Icon icon="ep:download" class="mr-5px" /> 导出 <Icon icon="ep:download" class="mr-5px" /> 导出
</el-button> </el-button> -->
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -97,67 +120,28 @@
<dict-tag :type="DICT_TYPE.TASK_STATE" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.TASK_STATE" :value="scope.row.status" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="执法对象" align="left" min-width="100px">
<!-- <el-table-column label="执行周期" align="center" prop="execCycle">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_EXEC_TIME" :value="scope.row.execCycle" /> {{new Set(scope.row.enterpriseIdes?.map(e => e.type)).size }}个区域 ,
</template> {{scope.row.enterpriseIdes.length}}家企业
</el-table-column> -->
<!-- <el-table-column label="任务优先级" align="center" prop="priority">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_PRIORITY" :value="scope.row.priority" />
</template>
</el-table-column> -->
</template>
</el-table-column>
<el-table-column <el-table-column
label="开始时间" label="执行时间"
align="center" align="left"
prop="startDate" prop="startDate"
:formatter="dateFormatter3" >
/>
<el-table-column
label="结束时间"
align="center"
prop="endDate"
:formatter="dateFormatter3"
/>
<!-- <el-table-column
label="任务创建时间"
align="center"
prop="createTime"
:formatter="dateFormatter"
width="180px"
/> -->
<el-table-column label="创建人" align="left" prop="createName" />
<!-- <el-table-column label="父任务id" align="center" prop="parentId" />
<el-table-column label="父子任务类型" align="center" prop="parentType">
<template #default="scope">
<dict-tag :type="DICT_TYPE.TASK_TYPE_PARENT" :value="scope.row.parentType" />
</template>
</el-table-column> -->
<!-- <el-table-column label="执行到第几" align="center" prop="taskStep" /> -->
<el-table-column label="执法对象" align="left" min-width="50px">
<template #default="scope"> <template #default="scope">
{{scope.row.startDate}}
<el-button link type="primary" @click=" {{ getDictLabel(DICT_TYPE.TASK_NOTICE_TIME, scope.row.execCycle) }}
push({
path: 'create',
query: {
id: scope.row.id
}
})
">
<el-Tag type="success">{{scope.row.enterpriseIdes.length}}</el-Tag>&nbsp;
</el-button>&nbsp;
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="" align="center" min-width="120px"> <el-table-column label="操作选项" align="left" min-width="50px">
<template #default="scope"> <template #default="scope">
<el-button <el-button
link link
@ -175,36 +159,6 @@
> >
详情 详情
</el-button> </el-button>
<el-button
link
type="primary"
@click="taskExec(scope.row)"
v-if="scope.row.status == 1"
v-hasPermi="['system:task-info:update']"
>
立即执行
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['system:task-info:delete']"
v-if="scope.row.status == 1"
>
删除
</el-button>
<el-button
link
type="danger"
@click="handleDelete(scope.row.id)"
v-hasPermi="['system:task-info:audit']"
v-if="scope.row.status == 0"
>
审核
</el-button>
<!-- <el-button link type="primary" @click="openForm(scope.row.id)"> 详情 </el-button> --> <!-- <el-button link type="primary" @click="openForm(scope.row.id)"> 详情 </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
@ -226,9 +180,8 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getIntDictOptions, DICT_TYPE } from '@/utils/dict' import { getDictLabel, DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { dateFormatter3 } from '@/utils/formatTime'
import { dateFormatter } from '@/utils/formatTime'
import download from '@/utils/download' import download from '@/utils/download'
import { TaskInfoApi, TaskInfoVO } from '@/api/system/taskinfo' import { TaskInfoApi, TaskInfoVO } from '@/api/system/taskinfo'
@ -263,13 +216,18 @@ const queryParams = reactive({
parentId: undefined, parentId: undefined,
parentType: undefined, parentType: undefined,
taskStep: undefined, taskStep: undefined,
taskTotal: undefined taskTotal: undefined,
selectWeek: undefined
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //
const taskTypeList:any = ref([]) const taskTypeList:any = ref([])
const mydateFormatter3 = ()=> {
}
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -278,13 +236,16 @@ const getList = async () => {
list.value = data.list list.value = data.list
total.value = data.total total.value = data.total
// //
const params = { const params = {
tagType: 2 tagType: 2,
pageSize: -1
} }
const tag = await TagLibraryApi.getTagLibraryPage(params) const tag = await TagLibraryApi.getTagLibraryPage(params)
taskTypeList.value = tag[0].children taskTypeList.value = tag.list
} finally { } finally {
loading.value = false loading.value = false
@ -363,9 +324,22 @@ onMounted(() => {
<style scoped lang="scss"> <style scoped lang="scss">
.formClass { .formClass {
display: grid; display: grid;
grid-template-columns: 1fr 1fr 1fr 2fr; grid-template-columns: 1fr 1fr 1fr 1fr;
grid-template-rows: 1fr; grid-template-rows: 2fr;
align-items: center; align-items: center;
row-gap: 20px;
column-gap: 40px;
.mergeClass {
grid-column: 2 span;
:deep(.el-form-item__content) {
display: flex !important;
justify-content:flex-end !important;
}
}
:deep(.el-form-item) { :deep(.el-form-item) {
margin: 0 !important; margin: 0 !important;

Loading…
Cancel
Save