Browse Source

24/10/10

main
wxc 1 year ago
parent
commit
011ab99b1c
  1. 0
      README.md
  2. 5
      src/api/system/dict.ts
  3. 6
      src/api/system/police.ts
  4. 38
      src/components/dict-select.vue
  5. 2
      src/components/file/upload-group.vue
  6. 28
      src/components/negative/add.vue
  7. 2
      src/components/negative/verify-description.vue
  8. 87
      src/components/negative/verify.vue
  9. 19
      src/components/police-select.vue
  10. 24
      src/stores/modules/catch.ts
  11. 4
      src/views/Home.vue
  12. 2
      src/views/system/Depart.vue
  13. 14
      src/views/system/Dict.vue
  14. 87
      src/views/system/Holiday.vue
  15. 32
      src/views/system/Police.vue
  16. 41
      src/views/work/Done.vue
  17. 21
      src/views/work/Query.vue
  18. 17
      src/views/work/Todo.vue

0
src/README.md → README.md

5
src/api/system/dict.ts

@ -47,3 +47,8 @@ export function listDictDataAll(dictType) {
});
}
export function listDictProblemSourceTree() {
return request.get({
url: `/dict/problemSource`
});
}

6
src/api/system/police.ts

@ -27,6 +27,12 @@ export function listPoliceAll(departId) {
});
}
export function listPoliceLeader(departId) {
return request.get({
url: `/police/${departId}/leader`
});
}
export function getPoliceAuths(idCode) {
return request.get({
url: `/police/auth/${idCode}`

38
src/components/dict-select.vue

@ -0,0 +1,38 @@
<template>
<template v-if="select.includes(name)">
<el-select clearable>
<el-option
v-for="item in data[name]"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
</template>
<template v-else-if="selectTree.includes(name)">
<el-tree-select :data="data" :props="{value: 'id'}" node-key="id" clearable filterable @current-change="(nodeData, node) => change(nodeData)" />
</template>
</template>
<script setup>
import useCatchStore from '@/stores/modules/catch'
const props = defineProps({
name: {
type: String,
required: true,
},
});
const emit = defineEmits(['change'])
const select = ["businessType", "suspectProblem", "processingStatus"];
const selectTree = ["problemSources"];
const catchStore = useCatchStore();
const data = select.includes(props.name) ? catchStore.getDicts([props.name]) : catchStore.getDictProblemSources()
function change(nodeData) {
emit('change', nodeData)
}
</script>
<style lang="scss" scoped>
</style>

2
src/components/file/upload-group.vue

@ -331,7 +331,6 @@ function handleUpdateFileClass() {
}
function handleSubmit() {
debugger;
emit(
"update:files",
fileList.value.filter((item) => item.filePath)
@ -340,6 +339,7 @@ function handleSubmit() {
}
function remove(index) {
debugger
const files = [...props.files];
files.splice(index, 1);
emit("update:files", files);

28
src/components/negative/add.vue

@ -21,24 +21,10 @@
trigger: ['blur'],
}"
>
<el-select
v-model="form.problemSourcesCode"
@change="
(val) =>
(form.problemSources =
dict.problemSources.filter(
(item) =>
item.dictValue === val
)[0].dictLabel)
"
>
<el-option
v-for="item in dict.problemSources"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
<dict-select name="problemSources" v-model="form.problemSourcesCode" @change="
(nodeData) =>
(form.problemSources = nodeData.label)
" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -141,6 +127,7 @@
v-model="form.involveProblemCode"
multiple
@change="handleSelectInvolveProblem"
clearable
>
<el-option
v-for="item in dict.suspectProblem"
@ -183,6 +170,10 @@
<el-form-item
label="问题涉及单位"
prop="involveDepartId"
:rules="{
required: true,
message: '请选择问题涉及单位'
}"
>
<depart-tree-select
v-model="form.involveDepartId"
@ -498,7 +489,6 @@ import useCatchStore from "@/stores/modules/catch";
const catchStore = useCatchStore();
const dict = catchStore.getDicts([
"problemSources",
"businessType",
"suspectProblem",
"policeType",

2
src/components/negative/verify-description.vue

@ -53,7 +53,7 @@
<div class="row" v-for="(problem, index) in blame.problems">
<div class="col col-24">
<label>问题类型{{ index + 1 }}</label>
<span>{{ problem.oneLevelContent }} / {{ problem.twoLevelContent }}</span>
<span>{{ problem.oneLevelContent }} / {{ problem.twoLevelContent }} / {{ problem.threeLevelContent }}</span>
</div>
</div>
<div class="row">

87
src/components/negative/verify.vue

@ -268,7 +268,7 @@
>
<el-form-item
:label="`问题类型${j + 1}`"
:prop="`blames.${index}.problems.${j}.oneLevelCode`"
:prop="`blames.${index}.problems.${j}.threeLevelCode`"
:rules="{
required: true,
message: '请选择问题类型',
@ -276,7 +276,7 @@
}"
>
<el-tree-select
v-model="problem.twoLevelCode"
v-model="problem.threeLevelCode"
:data="dictContent"
:props="{
label: 'name',
@ -287,11 +287,12 @@
filterable
accordion
style="width: 420px"
@current-change="(nodeData, node) => handleChangeProblem(node, problem)"
/>
<el-button
type="danger"
plain
:icon="Delete"
circle
@click="item.problems.splice(j, 1)"
class="ml-10"
@ -300,6 +301,11 @@
<icon name="el-icon-Delete" />
</template>
</el-button>
<div class="ml-16">
<span>{{ problem.oneLevelContent }}</span>
<span>{{ problem.twoLevelContent ? ' / ' + problem.twoLevelContent : '' }}</span>
<span>{{ problem.threeLevelContent ? ' / ' + problem.threeLevelContent : '' }}</span>
</div>
</el-form-item>
</el-col>
</el-row>
@ -566,6 +572,7 @@
item.leadIdCode = police.idCode;
}
"
:isLeader="true"
/>
</el-form-item>
</el-col>
@ -847,7 +854,65 @@
</el-form-item>
</el-col>
</el-row>
<el-form-item
:prop="`blames.${index}.problems`"
:rules="{
required: true,
message: '请添加问题类型',
trigger: ['blur'],
}"
v-if="form.checkStatus !== InspectCase.FALSE"
>
<el-row style="width: 100%">
<el-col
:span="24"
v-for="(problem, j) in item.problems"
:key="j"
>
<el-form-item
:label="`问题类型${j + 1}`"
:prop="`blames.${index}.problems.${j}.threeLevelCode`"
:rules="{
required: true,
message: '请选择问题类型',
trigger: ['blur'],
}"
>
<el-tree-select
v-model="problem.threeLevelCode"
:data="dictContent"
:props="{
label: 'name',
value: 'code',
}"
node-key="code"
clearable
filterable
accordion
style="width: 420px"
@current-change="(nodeData, node) => handleChangeProblem(node, problem)"
/>
<el-button
type="danger"
plain
circle
@click="item.problems.splice(j, 1)"
class="ml-10"
>
<template #icon>
<icon name="el-icon-Delete" />
</template>
</el-button>
<div class="ml-16">
<span>{{ problem.oneLevelContent }}</span>
<span>{{ problem.twoLevelContent ? ' / ' + problem.twoLevelContent : '' }}</span>
<span>{{ problem.threeLevelContent ? ' / ' + problem.threeLevelContent : '' }}</span>
</div>
</el-form-item>
</el-col>
</el-row>
</el-form-item>
<div
class="flex center mb-20"
v-if="form.checkStatus !== InspectCase.FALSE"
@ -998,10 +1063,8 @@
<p>自动回访结果不满意时请提供所队的回访录音</p>
<p>单位或个人所开展的其他相关工作证明材料</p>
</div>
<div
v-if="negative.problemSourcesCode === ProblemSources.JDGL"
></div>
<div style="width: 100%" class="mb-10">
<div v-if="negative.problemSourcesCode === ProblemSources.JDGL"></div>
<div style="width: 100%" class="mb-10 mt-10">
<file-upload-group v-model:files="form.files" :problemSourcesCode="negative.problemSourcesCode" />
</div>
<file-list :files="form.files" />
@ -1198,6 +1261,16 @@ function handleChangeSubjectiveAspect(val, item) {
}
function handleChangeProblem(node, problem) {
if (node.level === 3) {
problem.threeLevelContent = node.label
problem.oneLevelCode = node.parent.parent.key
problem.oneLevelContent = node.parent.parent.label
problem.twoLevelCode = node.parent.key
problem.twoLevelContent = node.parent.label
}
}
const formRef = ref(null);
async function validate() {

19
src/components/police-select.vue

@ -20,15 +20,16 @@
>
<template #default="{ item }">
<span class="mr-8">{{ item.name }}</span>
<span style="color: #999; font-size: 12px">{{
<span style="color: #999; font-size: 12px" class="mr-8">{{
item.empNo
}}</span>
<el-tag size="small">{{ item.position }}</el-tag>
</template>
</el-select-v2>
</div>
</template>
<script setup>
import { listPoliceAll } from "@/api/system/police";
import { listPoliceAll, listPoliceLeader } from "@/api/system/police";
import { HostLevel } from "@/enums/dictEnums";
const props = defineProps({
@ -43,6 +44,10 @@ const props = defineProps({
type: String,
required: true,
},
isLeader: {
type: Boolean,
default: false
}
});
const emit = defineEmits("update:modelValue", "change");
@ -60,11 +65,13 @@ watch(departId, () => {
getPolices();
});
function getPolices() {
async function getPolices() {
if (departId.value) {
listPoliceAll(departId.value).then((data) => {
polices.value = data;
});
if (props.isLeader) {
polices.value = await listPoliceLeader(departId.value)
} else {
polices.value = await listPoliceAll(departId.value)
}
}
}

24
src/stores/modules/catch.ts

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { listDictDataAll } from '@/api/system/dict'
import { listDictDataAll, listDictProblemSourceTree } from '@/api/system/dict'
import { listDictContentTree } from '@/api/system/dictContent'
import { departTree } from '@/api/system/depart'
import { listFlowNode } from '@/api/work/flowNode'
@ -7,17 +7,20 @@ import { listFlowNode } from '@/api/work/flowNode'
export interface CatchState {
dict: Record<string, any>,
dictContent: any[],
dictProblemSources: any[],
departs: any[],
flowNodes: any[]
}
// 判定是否已请求缓存
let departCatchFlag = true;
const dictCatchFlag = {};
let dictProblemSourcesFlag = true;
const useCatchStore = defineStore({
id: 'catch',
state: ():CatchState => ({
dict: {},
dictContent: [],
dictProblemSources: [],
departs: [],
flowNodes: []
}),
@ -48,7 +51,7 @@ const useCatchStore = defineStore({
return this.dict[key]
},
getDictContent() {
if (!this.dictContent.length) {
if (!this.dictProblemSources.length) {
const refresh = async () => {
const res = await Promise.allSettled<Promise<any>>([listDictContentTree()])
res.forEach((item) => {
@ -63,6 +66,23 @@ const useCatchStore = defineStore({
}
return this.dictContent
},
getDictProblemSources() {
if (!this.dictProblemSources.length && dictProblemSourcesFlag) {
dictProblemSourcesFlag = false;
const refresh = async () => {
const res = await Promise.allSettled<Promise<any>>([listDictProblemSourceTree()])
res.forEach((item) => {
if (item.status == 'fulfilled') {
item.value.forEach(item => {
this.dictProblemSources.push(item)
})
}
})
}
refresh()
}
return this.dictProblemSources
},
getDeparts() {
if (!this.departs.length && departCatchFlag) {
departCatchFlag = false

4
src/views/Home.vue

@ -8,9 +8,7 @@
v-for="(item, index) in flowNumber"
:key="index"
>
<section
class="flex column v-center overall-item pointer"
>
<section class="flex column v-center overall-item pointer">
<div>
<icon
:name="`local-icon-${item.icon}`"

2
src/views/system/Depart.vue

@ -37,12 +37,12 @@
:load="load"
:expand-row-keys="['12630']"
>
<el-table-column label="单位简称" prop="shortName" />
<el-table-column
label="单位全称"
prop="name"
show-overflow-tooltip
/>
<el-table-column label="单位简称" prop="shortName" />
<el-table-column label="编码" prop="code" />
<el-table-column label="排序" prop="orderNo" width="80" />
<el-table-column label="最后更新时间" prop="updatedAt" width="200" />

14
src/views/system/Dict.vue

@ -17,8 +17,8 @@
</template>
新增字典</el-button>
<div>
<el-button type="primary">查询</el-button>
<el-button>重置</el-button>
<el-button type="primary" @click="getList">查询</el-button>
<el-button @click="reset">重置</el-button>
</div>
</div>
</header>
@ -264,7 +264,7 @@ import feedback from '@/utils/feedback'
const dicts = ref([]);
const query = ref({
current: 1,
size: 10,
size: 10
});
const total = ref(0);
function getList() {
@ -275,6 +275,14 @@ function getList() {
}
getList();
function reset() {
query.value = {
current: 1,
size: 10
}
getList()
}
const subShow = ref(false);
const activeDict = ref({});
function openSub(item) {

87
src/views/system/Holiday.vue

@ -0,0 +1,87 @@
<template>
<div class="container">
<header>
<el-form :label-width="120">
<el-form-item label="年份"></el-form-item>
</el-form>
</header>
<div>
<el-row :gutter="20">
<el-col :span="8" v-for="month in months" :key="month">
<div class="calendar-month">
<header>{{ year }}{{ month }}</header>
<div class="calendar-week flex wrap">
<div class="calendar-cell calendar-cell_week flex center" v-for="week in weeks" :key="week">
<div class="cell">{{ week }}</div>
</div>
<div class="calendar-cell flex center" v-for="(item, index) in getMonthDays(month)" :key="index">
<div class="cell">{{ item.day }}</div>
</div>
</div>
</div>
</el-col>
</el-row>
</div>
</div>
</template>
<script setup>
import moment from 'moment'
const year = ref(2024);
const holiday = ref([]);
const months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
const weeks = ["一", "二", "三", "四", "五", "六", "日"];
function getMonthDays(month) {
const days = [];
const beginDay = moment([year.value, month - 1]).startOf('month');
const beginDayOfWeek = beginDay.day();
const endDay = moment([year.value, month - 1]).endOf('month');
// const endDayOfWeek = endDay.day();
for (let i = 0; i < beginDayOfWeek ? beginDayOfWeek - 1 : 6; i++) {
days.push({})
}
for (let i = 1; i <= endDay.date(); i++) {
days.push({
day: i,
flag: false
})
}
return days;
}
</script>
<style lang="scss" scoped>
.calendar-month {
background: #fbfcff;
box-shadow: inset 0px -1px 0px 0px #e9ebfd;
border: 1px solid #e9ebfd;
margin-bottom: 20px;
padding: 20px;
header {
font-size: 18px;
margin-bottom: 10px;
font-weight: 700;
}
}
.calendar-cell {
width: 14.26%;
text-align: center;
margin-bottom: 16px;
font-weight: 700;
.cell {
width: 36px;
height: 36px;
line-height: 36px;
border-radius: 50%;
&:hover {
background-color: #eee;
cursor: pointer;
}
}
&.calendar-cell_week {
color: #777;
font-family: SourceHanSansCN, SourceHanSansCN;
}
}
</style>

32
src/views/system/Police.vue

@ -9,6 +9,7 @@
placeholder="请输入警员姓名"
v-model="query.name"
clearable
style="width: 220px"
/>
</el-form-item>
</el-col>
@ -18,6 +19,7 @@
placeholder="请输入"
v-model="query.empNo"
clearable
style="width: 220px"
/>
</el-form-item>
</el-col>
@ -27,6 +29,7 @@
placeholder="请输入身份证号码"
v-model="query.idCode"
clearable
style="width: 220px"
/>
</el-form-item>
</el-col>
@ -36,14 +39,15 @@
placeholder="请输入电话"
v-model="query.phone"
clearable
style="width: 220px"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属单位">
<div class="flex gap v-center" style="width: 100%">
<div style="width: 280px">
<depart-tree-select v-model="query.departId" />
<div style="width: 220px">
<depart-tree-select v-model="query.departId" />
</div>
<el-checkbox v-model="query.departBranch" label="当前单位及所有子单位" size="large" />
</div>
@ -81,16 +85,9 @@
<el-table-column label="警号" prop="empNo" width="100" show-overflow-tooltip />
<el-table-column label="所属单位" prop="departName" show-overflow-tooltip />
<el-table-column label="所属单位简称" prop="departShortName" show-overflow-tooltip />
<el-table-column label="职位" prop="job" width="200" />
<el-table-column label="职位" prop="position" width="120" />
<el-table-column label="身份证" prop="idCode" width="200" />
<el-table-column label="电话" prop="mobile" width="200" />
<el-table-column label="人员状态" width="160">
<template #default="{ row }">
<el-tag v-if="row.personStatus">{{
row.personStatus
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" width="200">
<template #default="{ row }">
<el-button type="primary" link @click="handleEdit(row)" v-perms="['police:add']"
@ -190,11 +187,22 @@
message: '请选择所属单位',
trigger: ['blur'],
}"
v-if="form.id !== '12630'"
>
<depart-tree-select v-model="form.orgId" />
</el-form-item>
<el-form-item label="身份证" prop="">
<el-form-item
label="职位"
prop="position"
>
<el-select v-model="form.position" clearable>
<el-option value="正职">正职</el-option>
<el-option value="副职">副职</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份证" prop="idCode" :rules="{
required: true,
message: '请输入身份证'
}">
<el-input placeholder="请输入" v-model="form.idCode" />
</el-form-item>
<el-form-item label="电话" prop="mobile">

41
src/views/work/Done.vue

@ -15,38 +15,17 @@
</el-col>
<el-col :span="6">
<el-form-item label="问题来源">
<el-select v-model="query.problemSourcesCode" clearable>
<el-option
v-for="item in dict.problemSources"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
<dict-select name="problemSources" v-model="query.problemSourcesCode" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="业务类别">
<el-select v-model="query.businessTypeCode" clearable>
<el-option
v-for="item in dict.businessType"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
<dict-select name="businessType" v-model="query.businessType" />
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="涉嫌问题">
<el-select v-model="query.involveProblem" clearable>
<el-option
v-for="item in dict.suspectProblem"
:key="item.id"
:label="item.dictLabel"
:value="item.dictLabel"
/>
</el-select>
<dict-select name="suspectProblem" v-model="query.involveProblem" />
</el-form-item>
</el-col>
<el-col :span="6">
@ -73,14 +52,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="办理状态">
<el-select v-model="query.processingStatus" clearable>
<el-option
v-for="item in dict.processingStatus"
:key="item.id"
:label="item.dictLabel"
:value="item.dictLabel"
/>
</el-select>
<dict-select name="processingStatus" v-model="query.processingStatus" />
</el-form-item>
</el-col>
</el-row>
@ -194,8 +166,9 @@ import { listDones } from '@/api/work'
import { getDictLable } from '@/utils/util'
import useCatchStore from '@/stores/modules/catch'
const dict = useCatchStore().getDicts(['problemSources', 'businessType', 'suspectProblem', 'processingStatus'])
console.log(dict)
const catchStore = useCatchStore();
const dict = catchStore.getDicts(['businessType', 'suspectProblem', 'processingStatus'])
const dictProblemSources = catchStore.getDictProblemSources();
const dones = ref([])
const query = ref({

21
src/views/work/Query.vue

@ -110,20 +110,11 @@
<div class="form-row flex v-center">
<label class="text-center">其他选项</label>
<div class="flex gap-20">
<el-select
size="small"
<el-tree-select :data="dictProblemSources" :props="{value: 'id'}" node-key="id" v-model="query.problemSourcesCode" clearable filterable size="small"
style="width: 146px"
placeholder="问题来源"
clearable
v-model="query.problemSourcesCode"
>
<el-option
v-for="item in dict.problemSources"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
placeholder="问题来源" />
<el-select
size="small"
style="width: 146px"
@ -209,7 +200,7 @@
</div>
</el-form>
<div class="flex end mt-20 mb-26">
<!-- <el-button type="primary">导出</el-button> -->
<el-button type="primary">数据导出</el-button>
<div>
<el-button type="primary" @click="getList">
<template #icon
@ -404,13 +395,13 @@ import useCatchStore from "@/stores/modules/catch";
const catchStore = useCatchStore();
const dict = catchStore.getDicts([
"problemSources",
"businessType",
"inspectCase",
"isRectify",
"processingStatus",
]);
const flowNodes = catchStore.getFlowNodes();
const dictProblemSources = catchStore.getDictProblemSources();
const queryCrumbs = ref([]);
const queryItems = ref([]);

17
src/views/work/Todo.vue

@ -15,17 +15,7 @@
</el-col>
<el-col :span="6">
<el-form-item label="问题来源">
<el-select
v-model="query.problemSourcesCode"
clearable
>
<el-option
v-for="item in dict.problemSources"
:key="item.id"
:label="item.dictLabel"
:value="item.dictValue"
/>
</el-select>
<el-tree-select :data="dictProblemSources" :props="{value: 'id'}" node-key="id" v-model="query.problemSourcesCode" clearable filterable />
</el-form-item>
</el-col>
<el-col :span="6">
@ -255,12 +245,11 @@ import useCatchStore from "@/stores/modules/catch";
const catchStore = useCatchStore();
const dict = catchStore.getDicts([
"problemSources",
"businessType",
"suspectProblem",
"processingStatus"
]);
const flowNodes = catchStore.getFlowNodes();
const dictProblemSources = catchStore.getDictProblemSources();
const todos = ref([]);
const query = ref({
@ -272,7 +261,7 @@ const loading = ref(true);
function getList() {
loading.value = true;
listTodos().then((data) => {
listTodos(query.value).then((data) => {
todos.value = data.records;
total.value = data.total;
loading.value = false;

Loading…
Cancel
Save