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. 11
      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. 16
      src/views/work/components/MailDialog.vue
  13. 60
      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) {
return request.del({ url: '/work/favorite/' + mailId})
return request.del({ url: '/favorite/' + mailId})
}
export function listFav(query) {

1
src/components/PoliceSelect.vue

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

11
src/layout/components/Aside.vue

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

4
src/style/public.scss

@ -302,3 +302,7 @@ svg+span {
font-weight: 700;
}
}
.table-container {
border: 1px solid rgba(198, 208, 251, 1);
}

3
src/style/theme.scss

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

3
src/utils/request.ts

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

8
src/utils/util.ts

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

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

@ -1,51 +1,8 @@
<template>
<el-tabs v-model="activeName">
<el-tab-pane label="我的待办" name="todo">
<el-table :data="todos" 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>
<TabsTable :data="todos" @update="todoList" />
</el-tab-pane>
<el-tab-pane label="即将到期" name="due">
<el-table :data="superviseTodos" style="width: 100%" stripe>
@ -193,16 +150,9 @@
</el-tab-pane>
</el-tabs>
<MailDialog
v-model:show="showModel"
:mail-id="activeMailId"
:work-id="activeWorkId"
:work-type="activeWorkType"
@update="todoList"
/>
</template>
<script setup>
import MailDialog from "@/views/work/components/MailDialog.vue";
import TabsTable from "./TabsTable.vue";
import { useDictData } from "@/hooks/useDictOptions";
import { getTodos } from "@/api/work";
@ -230,7 +180,7 @@ const showModel = ref(false);
todoList();
function todoList() {
getTodos({
size: 8,
size: 100,
current: 1,
}).then((data) => {
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-select
v-model="query.source"
placeholder=""
placeholder="请选择信件来源"
clearable
>
<el-option
@ -57,7 +57,7 @@
<el-form-item label="信件等级">
<el-select
v-model="query.mailLevel"
placeholder=""
placeholder="请选择信件等级"
clearable
>
<el-option
@ -85,7 +85,7 @@
<el-form-item label="信件状态">
<el-select
v-model="query.mailState"
placeholder=""
placeholder="请选择信件状态"
clearable
>
<el-option
@ -304,9 +304,6 @@ function handleMailTimeQuery(val) {
}
</script>
<style lang="scss" scoped>
.table-container {
border: 1px solid rgba(198, 208, 251, 1);
}
.success {
padding: 0 8px;
height: 24px;

3
src/views/work/Todo.vue

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

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

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

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

@ -6,9 +6,15 @@
:before-close="handleClose"
>
<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]" />
<el-button type="primary" plain @click="remove(index)">删除</el-button>
<el-button type="primary" plain @click="remove(index)"
>删除</el-button
>
</div>
<el-button type="primary" plain @click="add">添加民警</el-button>
<template #footer>
@ -19,47 +25,57 @@
</el-dialog>
</template>
<script setup>
const props = defineProps({
show: {
type: Boolean,
default: false
default: false,
},
data: {
type: Array,
default: () => []
}
})
const emit = defineEmits(['update:show', 'update:data'])
default: () => [],
},
});
const emit = defineEmits(["update:show", "update:data"]);
const visible = ref(props.show);
watch(visible, (val) => {
emit('update:show', val)
})
watch(() => props.show, (val) => {
visible.value = val
})
const polices = ref([])
emit("update:show", val);
});
watch(
() => props.show,
(val) => {
visible.value = val;
}
);
const polices = ref([]);
function add() {
polices.value.push({})
polices.value.push({});
}
function remove(index) {
polices.value.splice(index, 1)
polices.value.splice(index, 1);
}
function submit() {
const data = polices.value.filter(item => item.empNo).map(item => {
const data = polices.value
.filter((item) => item.empNo)
.map((item) => {
return {
empNo: item.empNo,
name: item.name,
phone: item.phone
}
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>
<style lang="scss" scoped>

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

@ -22,7 +22,7 @@
</el-collapse-item>
<el-collapse-item title="来信反映主要问题" name="2">
<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>
<ThreeHandlingDetail :mail="mail" />

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

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

Loading…
Cancel
Save