Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
66d09708f7
  1. 2
      src/api/work/fav.ts
  2. 1
      src/components/PoliceSelect.vue
  3. 13
      src/layout/components/Aside.vue
  4. 4
      src/style/public.scss
  5. 3
      src/style/theme.scss
  6. 3
      src/utils/request.ts
  7. 8
      src/utils/util.ts
  8. 58
      src/views/home/components/MailTable.vue
  9. 135
      src/views/home/components/TabsTable.vue
  10. 9
      src/views/work/Done.vue
  11. 3
      src/views/work/Todo.vue
  12. 20
      src/views/work/components/MailDialog.vue
  13. 68
      src/views/work/components/templates/CoHandlingPoliceEdit.vue
  14. 2
      src/views/work/components/templates/MailApprovalDetail.vue
  15. 20
      src/views/work/components/templates/ThreeHandling.vue

2
src/api/work/fav.ts

@ -5,7 +5,7 @@ export function addFav(mailId) {
} }
export function delFav(mailId) { export function delFav(mailId) {
return request.del({ url: '/work/favorite/' + mailId}) return request.del({ url: '/favorite/' + mailId})
} }
export function listFav(query) { export function listFav(query) {

1
src/components/PoliceSelect.vue

@ -32,7 +32,6 @@ const emit = defineEmits(['update:data', 'select'])
function remoteMethod(query) { function remoteMethod(query) {
const chinesePattern = /[\u4e00-\u9fa5]/; const chinesePattern = /[\u4e00-\u9fa5]/;
console.log(chinesePattern.test(query), query)
if (!query || !chinesePattern.test(query)) { if (!query || !chinesePattern.test(query)) {
return return
} }

13
src/layout/components/Aside.vue

@ -9,12 +9,12 @@
> >
<div class="menu-item" :active="active === index"> <div class="menu-item" :active="active === index">
<section class="flex v-center"> <section class="flex v-center">
<icon :name="route.meta.icon" :size="50" /> <icon :name="route.meta.icon" :size="50" />
<span>{{ route.meta.title }}</span> <span>{{ route.meta.title }}</span>
</section> </section>
<el-button link size="small" v-if="route.children?.length"> <el-button link size="small" v-if="route.children?.length">
<template #icon> <template #icon>
<icon name="el-icon-ArrowDownBold" /> <icon name="el-icon-ArrowDownBold" :expand="route.meta.isExpand" />
</template> </template>
</el-button> </el-button>
</div> </div>
@ -25,7 +25,7 @@
(asideCollapse || (asideCollapse ||
(!asideCollapse && route.meta.isExpand)) (!asideCollapse && route.meta.isExpand))
" "
:expand="route.meta.isExpand"
> >
<div class="second-menu-container"> <div class="second-menu-container">
<div <div
@ -141,6 +141,13 @@ aside {
} }
.el-button { .el-button {
color: #656fac; color: #656fac;
.el-icon {
transition: .3s;
transform: rotate(-90deg);
&[expand=true] {
transform: rotate(0);
}
}
} }
} }
.second-menu { .second-menu {

4
src/style/public.scss

@ -301,4 +301,8 @@ svg+span {
&:hover { &:hover {
font-weight: 700; font-weight: 700;
} }
}
.table-container {
border: 1px solid rgba(198, 208, 251, 1);
} }

3
src/style/theme.scss

@ -10,5 +10,8 @@
'danger': ( 'danger': (
'base': #F60000, 'base': #F60000,
), ),
'warning': (
'base': #D05200,
),
) )
); );

3
src/utils/request.ts

@ -94,7 +94,8 @@ function ajax(url: string, options: Options) {
const request = { const request = {
get, get,
post, post,
put put,
del
} }
export default request; export default request;

8
src/utils/util.ts

@ -220,12 +220,12 @@ export function getFlowTagType(flowName) {
if (flowName === '待签收' || flowName === '信件退回') { if (flowName === '待签收' || flowName === '信件退回') {
return 'danger' return 'danger'
} }
if (flowName === '待下发' || flowName === '待签收(协办)') { if (flowName === '待下发' || flowName === '待签收(协办)' || flowName === '联系群众') {
return 'success'
}
if (flowName === '联系群众') {
return 'warning' return 'warning'
} }
if (flowName === '已办结') {
return 'success'
}
return '' return ''
} }

58
src/views/home/components/MailTable.vue

@ -1,51 +1,8 @@
<template> <template>
<el-tabs v-model="activeName"> <el-tabs v-model="activeName">
<el-tab-pane label="我的待办" name="todo"> <el-tab-pane label="我的待办" name="todo">
<el-table :data="todos" style="width: 100%" stripe> <TabsTable :data="todos" @update="todoList" />
<el-table-column
prop="mailTime"
label="来信时间"
align="center"
width="180"
/>
<el-table-column
prop="contactName"
label="姓名"
align="center"
width="120"
/>
<el-table-column
prop="contactPhone"
label="联系电话"
width="120"
/>
<el-table-column
prop="content"
label="信件内容"
show-overflow-tooltip
/>
<el-table-column prop="mailState" label="信件状态">
<template #default="{ row }">
<span>{{
getDictLable(dictData.mail_state, row.mailState)
}}</span>
</template>
</el-table-column>
<el-table-column label="流程节点">
<template #default="{ row }">
<el-tag :type="getFlowTagType(row.flowName)">{{
row.flowName
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="{ row }">
<el-button type="primary" link @click="handleMail(row)"
>立即处理</el-button
>
</template>
</el-table-column>
</el-table>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="即将到期" name="due"> <el-tab-pane label="即将到期" name="due">
<el-table :data="superviseTodos" style="width: 100%" stripe> <el-table :data="superviseTodos" style="width: 100%" stripe>
@ -193,16 +150,9 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<MailDialog
v-model:show="showModel"
:mail-id="activeMailId"
:work-id="activeWorkId"
:work-type="activeWorkType"
@update="todoList"
/>
</template> </template>
<script setup> <script setup>
import MailDialog from "@/views/work/components/MailDialog.vue"; import TabsTable from "./TabsTable.vue";
import { useDictData } from "@/hooks/useDictOptions"; import { useDictData } from "@/hooks/useDictOptions";
import { getTodos } from "@/api/work"; import { getTodos } from "@/api/work";
@ -230,7 +180,7 @@ const showModel = ref(false);
todoList(); todoList();
function todoList() { function todoList() {
getTodos({ getTodos({
size: 8, size: 100,
current: 1, current: 1,
}).then((data) => { }).then((data) => {
todos.value = data.records; todos.value = data.records;

135
src/views/home/components/TabsTable.vue

@ -0,0 +1,135 @@
<template>
<div class="tabs">
<header class="flex gap">
<div :active="active === '全部'" @click="getRows('全部')">
<span>全部</span>
</div>
<div v-for="item in tabs" :key="item.name" :active="active === item.name" @click="getRows(item.name)">
<el-badge :value="item.total" class="item">
<span>{{ item.name }}</span>
</el-badge>
</div>
</header>
<div>
<el-table :data="rows.slice(0, Math.min(rows.length, 8))" style="width: 100%" stripe>
<el-table-column
prop="mailTime"
label="来信时间"
align="center"
width="180"
/>
<el-table-column
prop="contactName"
label="姓名"
align="center"
width="120"
/>
<el-table-column
prop="contactPhone"
label="联系电话"
width="120"
/>
<el-table-column
prop="content"
label="信件内容"
show-overflow-tooltip
/>
<el-table-column prop="mailState" label="信件状态">
<template #default="{ row }">
<span>{{
getDictLable(dictData.mail_state, row.mailState)
}}</span>
</template>
</el-table-column>
<el-table-column label="流程节点">
<template #default="{ row }">
<el-tag :type="getFlowTagType(row.flowName)">{{
row.flowName
}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="{ row }">
<el-button type="primary" link @click="handleMail(row)"
>立即处理</el-button
>
</template>
</el-table-column>
</el-table>
</div>
</div>
<MailDialog
v-model:show="showModel"
:mail-id="activeMailId"
:work-id="activeWorkId"
:work-type="activeWorkType"
@update="emits('update')"
/>
</template>
<script setup>
import MailDialog from "@/views/work/components/MailDialog.vue";
import { useDictData } from "@/hooks/useDictOptions";
const { dictData } = useDictData(["mail_state"]);
import { getDictLable, getFlowTagType } from "@/utils/util";
const tabs = ref([]);
const active = ref('全部')
const rows = ref([])
const showModel = ref(false);
const props = defineProps({
data: {
type: Array,
default: () => []
}
})
const emits = defineEmits(['update'])
watch(() => props.data, (data) => {
getRows(active.value)
const flowNames = [...new Set(data.map(item => item.flowName))];
tabs.value = flowNames.map(name => ({
name,
total: data.filter(item => item.flowName == name).length
}))
})
function getRows(name) {
active.value = name
if (name == '全部') {
rows.value = props.data
return
}
rows.value = props.data.filter(item => item.flowName == name)
}
const activeMailId = ref("");
const activeWorkId = ref(0);
const activeWorkType = ref("");
function handleMail(row) {
showModel.value = true;
activeMailId.value = row.mailId;
activeWorkId.value = row.id;
activeWorkType.value = row.workType;
}
</script>
<style lang="scss" scoped>
header {
border-bottom: 1px solid var(--primary-color);
> div {
font-size: 18px;
font-weight: 400;
padding: 10px 12px 6px;
border-bottom: 4px solid transparent;
&:hover, &[active=true] {
font-weight: 700;
border-color: var(--primary-color);
cursor: pointer;
}
.el-badge {
padding-right: 6px;
}
}
}
</style>

9
src/views/work/Done.vue

@ -22,7 +22,7 @@
<el-form-item label="信件来源"> <el-form-item label="信件来源">
<el-select <el-select
v-model="query.source" v-model="query.source"
placeholder="" placeholder="请选择信件来源"
clearable clearable
> >
<el-option <el-option
@ -57,7 +57,7 @@
<el-form-item label="信件等级"> <el-form-item label="信件等级">
<el-select <el-select
v-model="query.mailLevel" v-model="query.mailLevel"
placeholder="" placeholder="请选择信件等级"
clearable clearable
> >
<el-option <el-option
@ -85,7 +85,7 @@
<el-form-item label="信件状态"> <el-form-item label="信件状态">
<el-select <el-select
v-model="query.mailState" v-model="query.mailState"
placeholder="" placeholder="请选择信件状态"
clearable clearable
> >
<el-option <el-option
@ -304,9 +304,6 @@ function handleMailTimeQuery(val) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.table-container {
border: 1px solid rgba(198, 208, 251, 1);
}
.success { .success {
padding: 0 8px; padding: 0 8px;
height: 24px; height: 24px;

3
src/views/work/Todo.vue

@ -310,9 +310,6 @@ function handleMailTimeQuery(val) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.table-container {
border: 1px solid rgba(198, 208, 251, 1);
}
.success { .success {
padding: 0 8px; padding: 0 8px;
height: 24px; height: 24px;

20
src/views/work/components/MailDialog.vue

@ -307,9 +307,9 @@
(mail.extensionState !== 'applying' && (mail.extensionState !== 'applying' &&
mail.extensionState !== 'completion') mail.extensionState !== 'completion')
" "
:disabled=" :disabled="loading ||
mail.extensionState === 'applying' && (mail.extensionState === 'applying' &&
action.key === 'applicationCompleted' action.key === 'applicationCompleted')
" "
>{{ action.btnLabel }}</el-button >{{ action.btnLabel }}</el-button
> >
@ -659,7 +659,6 @@ async function handleAction(key) {
}; };
loading.value = true; loading.value = true;
flowNext(requestBody).then(() => { flowNext(requestBody).then(() => {
debugger
// //
if (completionBtnFlag.value || props.workType === 'dept_countersign') { if (completionBtnFlag.value || props.workType === 'dept_countersign') {
emits("update"); emits("update");
@ -705,13 +704,11 @@ async function handleAction(key) {
// //
function handleFav() { function handleFav() {
if (!isFav.value) { if (!isFav.value) {
addFav(props.mailId).then(() => { isFav.value = true;
isFav.value = true; addFav(props.mailId)
});
} else { } else {
delFav(props.mailId).then(() => { isFav.value = false;
isFav.value = false; delFav(props.mailId)
});
} }
} }
@ -813,6 +810,9 @@ function getTotalTime() {
&.active { &.active {
--el-button-bg-color: #c20921; --el-button-bg-color: #c20921;
} }
&:focus {
background-color: var(--el-button-bg-color);
}
} }
.close-btn:hover { .close-btn:hover {
:deep() { :deep() {

68
src/views/work/components/templates/CoHandlingPoliceEdit.vue

@ -6,9 +6,15 @@
:before-close="handleClose" :before-close="handleClose"
> >
<h2>协办民警</h2> <h2>协办民警</h2>
<div class="flex gap-16 mb-20" v-for="(item, index) in polices" :key="index"> <div
class="flex gap-16 mb-20"
v-for="(item, index) in polices"
:key="index"
>
<police-select v-model:data="polices[index]" /> <police-select v-model:data="polices[index]" />
<el-button type="primary" plain @click="remove(index)">删除</el-button> <el-button type="primary" plain @click="remove(index)"
>删除</el-button
>
</div> </div>
<el-button type="primary" plain @click="add">添加民警</el-button> <el-button type="primary" plain @click="add">添加民警</el-button>
<template #footer> <template #footer>
@ -19,47 +25,57 @@
</el-dialog> </el-dialog>
</template> </template>
<script setup> <script setup>
const props = defineProps({ const props = defineProps({
show: { show: {
type: Boolean, type: Boolean,
default: false default: false,
}, },
data: { data: {
type: Array, type: Array,
default: () => [] default: () => [],
} },
}) });
const emit = defineEmits(['update:show', 'update:data']) const emit = defineEmits(["update:show", "update:data"]);
const visible = ref(props.show); const visible = ref(props.show);
watch(visible, (val) => { watch(visible, (val) => {
emit('update:show', val) emit("update:show", val);
}) });
watch(() => props.show, (val) => { watch(
visible.value = val () => props.show,
}) (val) => {
const polices = ref([]) visible.value = val;
}
);
const polices = ref([]);
function add() { function add() {
polices.value.push({}) polices.value.push({});
} }
function remove(index) { function remove(index) {
polices.value.splice(index, 1) polices.value.splice(index, 1);
} }
function submit() { function submit() {
const data = polices.value.filter(item => item.empNo).map(item => { const data = polices.value
return { .filter((item) => item.empNo)
empNo: item.empNo, .map((item) => {
name: item.name, return {
phone: item.phone empNo: item.empNo,
} name: item.name,
}) phone: item.phone,
console.log('data', data) };
emit('update:data', data) })
visible.value = false .reduce((prev, curr) => {
// prev id
if (!prev.find((item) => item.empNo === curr.empNo)) {
prev.push(curr);
}
return prev;
}, []);
emit("update:data", data);
visible.value = false;
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

2
src/views/work/components/templates/MailApprovalDetail.vue

@ -22,7 +22,7 @@
</el-collapse-item> </el-collapse-item>
<el-collapse-item title="来信反映主要问题" name="2"> <el-collapse-item title="来信反映主要问题" name="2">
<div class="content">{{ mail.content }}</div> <div class="content">{{ mail.content }}</div>
<FileList :files="mail.attachments" v-if="mail.attachments.length" /> <FileList :files="mail.attachments" v-if="mail.attachments && mail.attachments.length" />
</el-collapse-item> </el-collapse-item>
</el-collapse> </el-collapse>
<ThreeHandlingDetail :mail="mail" /> <ThreeHandlingDetail :mail="mail" />

20
src/views/work/components/templates/ThreeHandling.vue

@ -3,7 +3,7 @@
<div class="flex gap-20"> <div class="flex gap-20">
<div <div
class="flex gap v-center" class="flex gap v-center"
v-for="item in data.coHandingPolices" v-for="item in data.coHandlingPolices"
:key="item.empNo" :key="item.empNo"
> >
<icon name="local-icon-police" :size="20" /> <icon name="local-icon-police" :size="20" />
@ -369,7 +369,7 @@
<CoHandlingPoliceEdit <CoHandlingPoliceEdit
v-model:show="coHandlingPoliceShow" v-model:show="coHandlingPoliceShow"
v-model:data="data.coHandingPolices" v-model:data="data.coHandlingPolices"
/> />
</template> </template>
<script setup> <script setup>
@ -548,10 +548,26 @@ const step = ref(1);
watch( watch(
() => props.mail.flowKey, () => props.mail.flowKey,
() => { () => {
updateStep(); updateStep();
} }
); );
watch(
() => props.mail.coHandlingPolices,
(val) => updateCoHandlingPolices);
if (props.mail.coHandlingPolices) {
updateCoHandlingPolices()
}
function updateCoHandlingPolices() {
const data = { ...props.data};
data.coHandlingPolices = props.mail.coHandlingPolices
emits("update:data", data);
}
const depts = ref([]); const depts = ref([]);
updateStep(); updateStep();
function updateStep() { function updateStep() {

Loading…
Cancel
Save