Browse Source

BUG修复

master
wxc 2 years ago
parent
commit
e05ecdf83a
  1. BIN
      public/imgs/support.png
  2. BIN
      public/imgs/support1.png
  3. 4
      src/api/mail.ts
  4. 80
      src/components/FileList.vue
  5. 39
      src/layout/components/Header.vue
  6. 80
      src/layout/components/NoticeMessage.vue
  7. 6
      src/views/work/Todo.vue
  8. 247
      src/views/work/components/MailDialog.vue
  9. 18
      src/views/work/components/templates/CoHandlingPoliceEdit.vue
  10. 6
      src/views/work/components/templates/DeptSelectForm.vue
  11. 7
      src/views/work/components/templates/ExtensionDetail.vue
  12. 19
      src/views/work/components/templates/ThreeHandling.vue

BIN
public/imgs/support.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

BIN
public/imgs/support1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

4
src/api/mail.ts

@ -18,4 +18,8 @@ export function getMailCategoryTree() {
export function addMail(body) {
return request.post({ url: '/mail/add', body})
}
export function addCoHandling(body) {
return request.post({ url: '/mail/coHandling/add', body})
}

80
src/components/FileList.vue

@ -54,7 +54,11 @@
</section>
</div>
</el-scrollbar>
<div class="file-content flex center v-center" @click="preview = false" @wheel="wheel">
<div
class="file-content flex center v-center"
@click="preview = false"
@wheel="wheel"
>
<div
class="img-container flex center"
v-if="activeFile.type.indexOf('image') > -1"
@ -63,7 +67,13 @@
:src="`${VITE_API_URL}/api/file/stream/${activeFile.filepath}`"
ref="imgRef"
@click.stop
:style="{transform: `rotate(${rotate}deg) scale(${scale})`}"
:style="{
transform: `rotate(${rotate}deg) scale(${scale}) translate(${translateX}px, ${translateY}px)`,
}"
@mousedown="mousedown"
@mousemove="mousemove"
@mouseup="mouseup"
draggable="false"
/>
<button
class="rotate-left-btn pointer"
@ -169,7 +179,8 @@ import "@vue-office/excel/lib/index.css";
import VueOfficeDocx from "@vue-office/docx";
import VueOfficeExcel from "@vue-office/excel";
import { nextTick, onMounted } from "vue";
import emitter from "@/utils/bus";
import { watch } from "vue";
const { VITE_API_URL } = process.env;
const router = useRouter();
@ -195,11 +206,15 @@ watch(
}
);
const preview = ref(false);
const activeFile = ref({});
const fileRrror = ref(false);
const rotate = ref(0);
const scale = ref(0);
const translateX = ref(0);
const translateY = ref(0);
let moveFlag = false;
let initialX = 0;
let initialY = 0;
function prev() {
const index = fileList.value.indexOf(activeFile.value);
if (index === 0) {
@ -216,33 +231,69 @@ function next() {
filePreview(fileList.value[index + 1]);
}
}
const preview = ref(false);
watch(preview, (val) => {
if (!val) {
//
emitter.emit("turnOnNoticeSound");
}
})
function filePreview(file) {
preview.value = true;
fileRrror.value = false;
activeFile.value = file;
rotate.value = 0;
scale.value = 1;
translateX.value = 0;
translateY.value = 0;
moveFlag = false;
// ()
if (file.type.indexOf('audio') > -1) {
//
emitter.emit("turnOffNoticeSound");
}
}
function wheel(event) {
if (activeFile.value.type.indexOf('image') === -1) {
return
if (activeFile.value.type.indexOf("image") === -1) {
return;
}
if (event.deltaY > 0) {
scale.value += 0.08;
if (event.deltaY > 0 && scale.value > 0.5) {
scale.value -= 0.1;
}
if (event.deltaY < 0 && scale.value > 0.2) {
scale.value -= 0.08;
if (event.deltaY < 0) {
scale.value += 0.1;
}
}
function mousedown() {
moveFlag = true;
initialX = event.clientX;
initialY = event.clientY;
}
function mousemove(event) {
if (!moveFlag) {
return;
}
translateX.value += event.clientX - initialX;
console.log("x", translateX.value);
translateY.value += event.clientY - initialY;
initialX = event.clientX;
initialY = event.clientY;
}
function mouseup(event) {
moveFlag = false;
}
function rotateLeft() {
rotate.value += 90
console.log(rotate.value)
rotate.value += 90;
console.log(rotate.value);
}
function rotateRight() {
rotate.value -= 90
rotate.value -= 90;
}
function getIconName(filetype) {
@ -373,6 +424,9 @@ function getDocFilepath() {
img {
max-height: 100%;
display: block;
&:hover {
cursor: pointer;
}
}
}
.error {

39
src/layout/components/Header.vue

@ -1,5 +1,5 @@
<template>
<header class="flex v-center between">
<header class="flex v-center between main-header">
<div class="logo flex v-center">
<a href="/">
<img src="/logo.png" alt="" />
@ -30,11 +30,12 @@
<div class="overlay" v-if="supportShow" @click="supportShow = false">
<div class="position-center support-box">
<div>
<img src="/imgs/support.png" alt="" />
</div>
<header class="flex">
<span>技术支持</span>
<img src="/imgs/support1.png" alt="" />
</header>
<div class="support-content" @click.stop>
<p>业务服务热线0731 - 82587735周警官 </p>
<p>业务服务热线0731 - 82587735警官 </p>
<p>技术服务热线13787166867李经理 18867391894 杨姣</p>
</div>
</div>
@ -66,7 +67,7 @@ function handleLogout() {
</script>
<style lang="scss" scoped>
header {
header.main-header {
background-color: #162582;
color: #fff;
height: var(--header-height);
@ -112,18 +113,30 @@ header {
}
}
.support-box {
img {
width: 500px;
width: 800px;
header {
width: 100%;
height: 160px;
line-height: 160px;
background: linear-gradient( 270deg, #1227BB 0%, #3BA2CF 100%);
span {
width: 50%;
box-sizing: border-box;
padding-left: 48px;
color: #fff;
font-size: 38px;
font-weight: 700;
}
}
.support-content {
padding: 20px 16px;
padding: 32px 20px;
background-color: #fff;
font-size: 14px;
font-weight: 700;
font-size: 16px;
color: #333;
p {
margin-top: 1em;
margin-bottom: .5em;
}
}
}
</style>

80
src/layout/components/NoticeMessage.vue

@ -6,34 +6,49 @@
<icon name="el-icon-BellFilled" :size="32" v-else />
<div class="ml-20">{{ notice.content }}</div>
<audio src="/mp3/todo.mp3" ref="todoAudioRef" ></audio>
<audio src="/mp3/todo.mp3" ref="todoAudioRef"></audio>
<audio loop ref="newMailAudioRef">
<source :src="NewMailMp3" type="audio/mpeg" />
</audio>
</div>
</template>
<script setup>
import {
ElMessageBox
} from 'element-plus'
import NewMailMp3 from '/mp3/new-mail.mp3'
import { ElMessageBox } from "element-plus";
import NewMailMp3 from "/mp3/new-mail.mp3";
import { initSocket } from "@/utils/socket";
import emitter from "@/utils/bus";
import { noticeTotal, getNewMailAudio } from "@/api/notice";
import { onMounted } from 'vue';
import { onMounted } from "vue";
initSocket();
const todoAudioRef = ref();
let enableSound = true;
emitter.on("notice", () => {
console.log("notice event");
getNoticeTotal();
todoAudioRef.value.play();
if (enableSound) {
todoAudioRef.value?.play();
}
});
emitter.on("workDone", () => {
getNewMailAudioFlag()
getNewMailAudioFlag();
});
emitter.on("turnOffNoticeSound", () => {
console.log("turnOnNoticeSound");
enableSound = false;
if (!newMailAudioRef.value.paused) {
newMailAudioRef.value.pause();
}
});
emitter.on("turnOnNoticeSound", () => {
enableSound = true;
if (newMailAudio.value && newMailAudioRef.value.paused) {
newMailAudioRef.value.play();
}
});
const total = ref(0);
@ -44,38 +59,45 @@ function getNoticeTotal() {
if (data.notice) {
notice.value = data.notice;
} else {
notice.value = {}
notice.value = {};
}
});
getNewMailAudioFlag()
getNewMailAudioFlag();
}
getNoticeTotal();
const newMailAudioRef = ref()
const newMailAudioRef = ref();
const newMailAudio = ref(false);
watch(newMailAudio, (val) => {
nextTick(() => {
console.log(newMailAudioRef.value, val)
if (val && newMailAudioRef.value.paused) {
newMailAudioRef.value.play().then(() => {
}).catch(() => {
console.log("播放失败")
ElMessageBox.confirm('需要获取浏览器的声音播放权限!', '温馨提示', {
confirmButtonText: '确认授权',
showCancelButton: false,
type: 'warning',
showClose: false,
closeOnClickModal: false
}).then(() => {
newMailAudioRef.value.play()
})
})
if (val && newMailAudioRef.value.paused && enableSound) {
setTimeout(() => {
newMailAudioRef.value
.play()
.then(() => {})
.catch(() => {
console.log("播放失败");
ElMessageBox.confirm(
"需要获取浏览器的声音播放权限!",
"温馨提示",
{
confirmButtonText: "确认授权",
showCancelButton: false,
type: "warning",
showClose: false,
closeOnClickModal: false,
}
).then(() => {
newMailAudioRef.value.play();
});
});
}, 3000);
} else {
newMailAudioRef.value.pause()
newMailAudioRef.value.pause();
}
})
})
});
});
function getNewMailAudioFlag() {
getNewMailAudio().then((data) => {

6
src/views/work/Todo.vue

@ -92,11 +92,7 @@
<el-table-column prop="mailTime" label="来信时间" align="center" width="160" />
<el-table-column label="信件来源" align="center" width="90">
<template #default="{ row }">
<span>{{
dictData.mail_source.filter(
(item) => item.value === row.source
)[0].name
}}</span>
<span>{{ getDictLable(dictData.mail_source, row.source) }}</span>
</template>
</el-table-column>
<el-table-column prop="contactName" label="姓名" align="center" width="80" />

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

@ -69,7 +69,10 @@
style="height: 100%; padding: 0 20px 0 40px"
ref="leftContainerRef"
>
<div class="timer flex center" v-if="flowNode.key !== 'completion'">
<div
class="timer flex center"
v-if="flowNode.key !== 'completion'"
>
<div
v-if="mail.flowRemainingTime > 0"
style="height: 210px"
@ -135,8 +138,9 @@
>
<span>
<span class="second mr-8">总耗时</span>
<span style="color: var(--primary-color)">{{ getTotalTime() }}</span>
<span style="color: var(--primary-color)">{{
getTotalTime()
}}</span>
</span>
<el-button
type="primary"
@ -156,13 +160,26 @@
<span class="mr-8">{{
getFlowHandler(item)
}}</span>
<span class="primary">{{
<span class="primary mr-16">{{
item.flowAfterName
}}</span>
<el-tooltip
effect="dark"
:content="item.remark"
placement="top-start"
v-if="item.remark"
>
<span class="primary"
>详情</span
>
</el-tooltip>
</div>
<div
v-if="item.flowKey !== 'first_sign'"
class="flow-time"
:danger="
item.consumingTime >
item.limitedTime
"
>
<span class="second mr-8"
>用时</span
@ -189,7 +206,9 @@
<el-col :span="19" style="height: 100%">
<el-scrollbar max-height="100%" class="main-container">
<MailReturnDetail
v-if="mailReturns.length && workType === 'processing'"
v-if="
mailReturns.length && workType === 'processing'
"
:mailReturns="mailReturns"
/>
<template v-if="webComponents.indexOf('Comments') > -1">
@ -200,8 +219,12 @@
>
<MainContactInfo :mail="mail" />
</template>
<template
v-if="webComponents.indexOf('MailTypeForm') > -1 && !disabled"
v-if="
webComponents.indexOf('MailTypeForm') > -1 &&
!disabled
"
>
<MailTypeForm
ref="mailTypeFormRef"
@ -209,8 +232,39 @@
:mailId="mailId"
/>
</template>
<div class="card-info flex mb-4" v-if="mail.firstDistributeInfo?.mainDept?.name">
<div class="col" style="width: 33%">
<label>主责单位</label>
<span>{{ mail.firstDistributeInfo?.mainDept?.name }}</span>
</div>
<div class="col" style="width: 33%" v-if="mail.firstDistributeInfo?.secondDept1?.name">
<label>次责单位1</label>
<span>{{ mail.firstDistributeInfo?.secondDept1?.name }}</span>
</div>
<div class="col" style="width: 33%" v-if="mail.firstDistributeInfo?.secondDept2?.name">
<label>次责单位2</label>
<span>{{ mail.firstDistributeInfo?.secondDept2?.name }}</span>
</div>
</div>
<div class="card-info flex" v-if="mail.secondDistributeInfo?.mainDept?.name">
<div class="col" style="width: 33%">
<label>主责单位</label>
<span>{{ mail.secondDistributeInfo?.mainDept?.name }}</span>
</div>
<div class="col" style="width: 33%" v-if="mail.secondDistributeInfo?.secondDept1?.name">
<label>次责单位1</label>
<span>{{ mail.secondDistributeInfo?.secondDept1?.name }}</span>
</div>
<div class="col" style="width: 33%" v-if="mail.secondDistributeInfo?.secondDept2?.name">
<label>次责单位2</label>
<span>{{ mail.secondDistributeInfo?.secondDept2?.name }}</span>
</div>
</div>
<template
v-if="webComponents.indexOf('DeptSelectForm') > -1 && !disabled"
v-if="
webComponents.indexOf('DeptSelectForm') > -1 &&
!disabled
"
>
<DeptSelectForm
ref="deptSelectFormRef"
@ -220,6 +274,7 @@
"
:flowKey="flowNode.key"
:mail="mail"
:workType="workType"
/>
</template>
<ExtensionDetail
@ -230,21 +285,22 @@
"
/>
<template
v-if="
webComponents.indexOf('ThreeHandling') > -1"
v-if="webComponents.indexOf('ThreeHandling') > -1"
>
<ThreeHandling
v-model:data="requestData"
@update:data="(data) => requestData = data"
@update:data="(data) => (requestData = data)"
@update="getDetail"
:mail="mail"
:limitedTime="flowNode.limitedTime"
ref="threeHandlingRef"
v-if="!disabled && (workType === 'processing' || workType === 'co_handling')"
/>
<ThreeHandlingDetail
v-else
:mail="mail"
v-if="
!disabled &&
(workType === 'processing' ||
workType === 'co_handling')
"
/>
<ThreeHandlingDetail v-else :mail="mail" />
</template>
<template
v-if="
@ -287,11 +343,11 @@
/>
</template>
<template
v-if="webComponents.indexOf('CompletionDetail') > -1"
v-if="
webComponents.indexOf('CompletionDetail') > -1
"
>
<CompletionDetail
:mail="mail"
/>
<CompletionDetail :mail="mail" />
</template>
<div style="height: 20px"></div>
</el-scrollbar>
@ -301,7 +357,13 @@
<footer class="flex between">
<div></div>
<div v-if="!disabled && !completionBtnFlag">
<template v-if="workType === 'processing' || workType === 'co_handling'">
<template
v-if="
workType === 'processing' ||
workType === 'co_handling' ||
workType === 'secondary'
"
>
<template v-for="action in actions" :key="action.key">
<el-button
:type="action.btnType"
@ -313,9 +375,10 @@
(mail.extensionState !== 'applying' &&
mail.extensionState !== 'completion')
"
:disabled="loading ||
:disabled="
loading ||
(mail.extensionState === 'applying' &&
action.key === 'applicationCompleted')
action.key === 'applicationCompleted')
"
>{{ action.btnLabel }}</el-button
>
@ -357,7 +420,11 @@
>
</template>
</div>
<el-button type="primary" size="large" v-if="completionBtnFlag" @click="handleAction('confirmedCompletion')"
<el-button
type="primary"
size="large"
v-if="completionBtnFlag"
@click="handleAction('confirmedCompletion')"
>办结处理</el-button
>
</footer>
@ -370,7 +437,8 @@
v-model:data="requestData"
:mail="mail"
@submit="(key) => handleAction(key)"
@close="completeShow = false"/>
@close="completeShow = false"
/>
<ReviewComments
v-model="approvedShow"
@ -568,7 +636,7 @@ watch(
() => props.mailId,
(val) => {
getDetail();
requestData.value = {}
requestData.value = {};
}
);
@ -606,7 +674,7 @@ const countersignFormRef = ref();
const coHandlingRef = ref();
async function handleAction(key) {
console.log('key', key)
console.log("key", key);
if (!key) {
return;
}
@ -648,12 +716,11 @@ async function handleAction(key) {
}
if (key !== "applyExtensionSubmit") {
if (threeHandlingRef.value) {
if (key == 'save') {
if (key == "save") {
await threeHandlingRef.value.getData();
} else {
await threeHandlingRef.value.validate();
}
}
}
}
@ -672,60 +739,65 @@ async function handleAction(key) {
data: requestData.value,
};
loading.value = true;
flowNext(requestBody).then(() => {
//
if (completionBtnFlag.value || props.workType === 'dept_countersign') {
emits("update");
feedback.msgSuccess("操作成功");
visible.value = false;
return
}
if (key === "applyExtensionSubmit") {
emits("update");
getDetail();
messageRef.value.showMessage("已成功申请延期");
return;
}
if (key === "save") {
flowNext(requestBody)
.then(() => {
loading.value = false;
messageRef.value.showMessage("保存成功");
return;
}
//
emits("update");
if (
key !== "returnSubmit" &&
(flowNode.value.key.indexOf("sign") > -1 ||
flowNode.value.key === "contact_writer" ||
flowNode.value.key === "interview_writer")
) {
getDetail();
if (flowNode.value.key.indexOf("sign") > -1) {
messageRef.value.showMessage("信件签收成功");
} else {
messageRef.value.showMessage("保存成功,进入下一步");
//
if (
completionBtnFlag.value ||
props.workType === "dept_countersign"
) {
emits("update");
feedback.msgSuccess("操作成功");
visible.value = false;
return;
}
} else {
if (key === "countersign") {
if (key === "applyExtensionSubmit") {
emits("update");
getDetail();
messageRef.value.showMessage("已成功申请延期");
return;
}
feedback.msgSuccess("操作成功");
visible.value = false;
}
}).catch(() => {
loading.value = false;
emits("update");
});
if (key === "save") {
messageRef.value.showMessage("保存成功");
return;
}
//
emits("update");
if (
key !== "returnSubmit" &&
(flowNode.value.key.indexOf("sign") > -1 ||
flowNode.value.key === "contact_writer" ||
flowNode.value.key === "interview_writer")
) {
getDetail();
if (flowNode.value.key.indexOf("sign") > -1) {
messageRef.value.showMessage("信件签收成功");
} else {
messageRef.value.showMessage("保存成功,进入下一步");
}
} else {
if (key === "countersign") {
getDetail();
}
feedback.msgSuccess("操作成功");
visible.value = false;
}
})
.catch(() => {
loading.value = false;
emits("update");
});
}
//
function handleFav() {
if (!isFav.value) {
isFav.value = true;
addFav(props.mailId)
addFav(props.mailId);
} else {
isFav.value = false;
delFav(props.mailId)
delFav(props.mailId);
}
}
@ -773,23 +845,29 @@ function handleExtensionApproval(returnFlag) {
function getTotalTime() {
if (!flows.value.length) {
return ''
return "";
}
const sum = flows.value.map(item => item.consumingTime).reduce((a, b) => a + b)
const sum = flows.value
.map((item) => item.consumingTime)
.reduce((a, b) => a + b);
return formatTimeText(sum);
}
function handleExtensionApprovalSubmit() {
feedback.confirm('申请延期审批通过').then(() => {
handleExtensionApproval(false)
})
feedback.confirm("申请延期审批通过").then(() => {
handleExtensionApproval(false);
});
}
function getFlowHandler(item) {
if (item.handlerRoleId === 1 || item.handlerRoleId === 2 || item.handlerRoleId === 3) {
return `${item.handlerDeptName}专班 ${item.handlerName}`
if (
item.handlerRoleId === 1 ||
item.handlerRoleId === 2 ||
item.handlerRoleId === 3
) {
return `${item.handlerDeptName}专班 ${item.handlerName}`;
}
return `${item.handlerDeptName} ${item.handlerName}`
return `${item.handlerDeptName} ${item.handlerName}`;
}
</script>
<style lang="scss" scoped>
@ -894,6 +972,12 @@ function getFlowHandler(item) {
background-color: #f5f6ff;
border-left: 2px solid #00d050;
padding-left: 20px;
&[danger="true"] {
border-color: #ff0000;
span {
color: #ff0000;
}
}
}
.flow-info {
position: relative;
@ -958,5 +1042,10 @@ footer {
--el-button-disabled-border-color: #b0b0b0;
--el-button-disabled-text-color: #fff;
}
.card-info {
background: #f4f5ff;
border: 1px solid rgba(195, 202, 245, 1);
padding: 12px 20px;
}
}
</style>

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

@ -27,18 +27,24 @@
</template>
<script setup>
import { listByCoHanding } from '@/api/perms/admin'
import { addCoHandling } from "@/api/mail";
import feedback from "@/utils/feedback";
const props = defineProps({
show: {
type: Boolean,
default: false,
},
mailId: {
type: String,
default: "",
},
data: {
type: Array,
default: () => [],
},
});
const emit = defineEmits(["update:show", "update:data"]);
const emit = defineEmits(["update:show", "submit"]);
const visible = ref(props.show);
watch(visible, (val) => {
@ -86,8 +92,14 @@ function submit() {
mobile: item.mobile,
};
});
emit("update:data", data);
visible.value = false;
addCoHandling({
mailId: props.mailId,
polices: data
}).then(() => {
visible.value = false;
feedback.msgSuccess("提交成功");
emit('submit')
})
}
</script>
<style lang="scss" scoped>

6
src/views/work/components/templates/DeptSelectForm.vue

@ -29,7 +29,7 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-if="workType !== 'secondary'">
<el-form-item
label="主办层级"
prop="mainDeptLevel"
@ -135,6 +135,10 @@ const props = defineProps({
type: Object,
default: {},
},
workType: {
type: String,
default: '',
},
});
const form = ref({

7
src/views/work/components/templates/ExtensionDetail.vue

@ -1,6 +1,6 @@
<template>
<div
class="card mb-10"
class="card-info mb-10"
>
<header class="flex">
<span class="primary">延期申请中</span>
@ -45,10 +45,7 @@ function getComment() {
}
</script>
<style lang="scss" scoped>
.card {
background: #f4f5ff;
border: 1px solid rgba(195, 202, 245, 1);
padding: 12px 20px;
.card-info {
header {
margin-bottom: 20px;
.primary {

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

@ -1,5 +1,5 @@
<template>
<div class="flex between mb-20 card">
<div class="flex between mb-20 card-info">
<div class="flex gap-20">
<div
class="flex gap v-center"
@ -381,7 +381,9 @@
<CoHandlingPoliceEdit
v-model:show="coHandlingPoliceShow"
v-model:data="data.coHandlingPolices"
:data="data.coHandlingPolices"
:mailId="mail.id"
@submit="update"
/>
</template>
<script setup>
@ -539,7 +541,12 @@ const props = defineProps({
default: 0,
},
});
const emits = defineEmits(["update:data"]);
const emits = defineEmits(["update:data", "update"]);
function update() {
console.log('update')
emits('update')
}
if (props.mail.simpleFlowFlag) {
threeSteps.value = [
@ -753,12 +760,6 @@ defineExpose({
});
</script>
<style lang="scss" scoped>
.card {
background: #f4f5ff;
border: 1px solid rgba(195, 202, 245, 1);
padding: 12px 20px;
}
.step {
width: 100%;

Loading…
Cancel
Save