Merge branch 'al'

# Conflicts:
#	src/views/task/content/Content.vue
bak
刘释隆 1 year ago
commit 66b27a4dfa

@ -33,7 +33,7 @@ const svgName = computed(() => {
</div> </div>
<ul class="list-item-detail"> <ul class="list-item-detail">
<li>审批状态<span class="list-item-status">{{ listItem.statshis }}</span></li> <li>审批状态<span class="list-item-status">{{ listItem.statshis }}</span></li>
<li>审批节点{{ listItem.taskname }}</li> <li>审批节点{{ listItem.tasknamehis }}</li>
<li>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li> <li>提交时间{{ format(new Date(), 'yyyy-MM-dd HH:mm:ss') }}</li>
<li>提报人{{ listItem.fromuserid }}</li> <li>提报人{{ listItem.fromuserid }}</li>

@ -1,34 +1,37 @@
<script lang="ts" setup> <script lang="ts" setup>
import { clone } from 'lodash-es' import { getAllfieldList } from "@/api/home/filter";
import { useDialog, useMessage } from 'naive-ui' import { audit } from "@/api/task/task";
import { computed, onUnmounted, reactive, ref, unref, watch } from 'vue' import { getTaskDetailInfo, getTaskDetailPictureList } from "@/api/work/work";
import { isEmpty } from '@/utils' import { useTask } from "@/store/modules/task";
import BatchModal from '../modal/BatchModal.vue' import { useUser } from "@/store/modules/user";
import { audit } from '@/api/task/task' import { isEmpty } from "@/utils";
import { getTaskDetailInfo, getTaskDetailPictureList } from '@/api/work/work' import { hideDownload } from "@/utils/image";
import { useTask } from '@/store/modules/task' import emitter from "@/utils/mitt";
import { useUser } from '@/store/modules/user' import _ from 'lodash';
import { hideDownload } from '@/utils/image' import { clone } from "lodash-es";
import emitter from '@/utils/mitt' import { useDialog, useMessage } from "naive-ui";
import ConfrimModal from '../modal/ConfrimModal.vue' import { computed, onUnmounted, reactive, ref, unref, watch } from "vue";
import CustomSettingModal from '../modal/CustomSettingModal.vue' import BatchModal from "../modal/BatchModal.vue";
import PictureTable from './PictureTable.vue' import ConfrimModal from "../modal/ConfrimModal.vue";
import TaskTable from './TaskTable.vue' import CustomSettingModal from "../modal/CustomSettingModal.vue";
import type { ApprovalParam, PictureSortParam } from '/#/api' import PictureTable from "./PictureTable.vue";
import TaskTable from "./TaskTable.vue";
const batch = ref(false) import type { ApprovalParam, PictureSortParam } from "/#/api";
const selectItems = ref<any[]>([])
const message = useMessage() const batch = ref(false);
const dialog = useDialog() const selectItems = ref<any[]>([]);
const confrimModalRef = ref(null) const message = useMessage();
const batchModalRef = ref(null) const dialog = useDialog();
const totalCount = ref(0) const confrimModalRef = ref(null);
const CustomSettingModalRef = ref(null) const batchModalRef = ref(null);
const totalCount = ref(0);
const CustomSettingModalRef = ref(null);
const taskTableData = ref<any[]>([]);
const sortBy: PictureSortParam = { const sortBy: PictureSortParam = {
orderbyname: 'asc', orderbyname: "asc",
orderbyvalue: 'fromuptime', orderbyvalue: "fromuptime",
} };
function setBatch(value: boolean) { function setBatch(value: boolean) {
if (totalCount.value === 0) if (totalCount.value === 0)
@ -36,40 +39,38 @@ function setBatch(value: boolean) {
batch.value = value batch.value = value
if (value === false) { if (value === false) {
selectItems.value.forEach(item => (item.checked = false)) selectItems.value.forEach((item) => (item.checked = false));
selectItems.value.length = 0 selectItems.value.length = 0;
} }
} }
function onCheckChange(checked: any, item: any) { function onCheckChange(checked: any, item: any) {
const index = selectItems.value.indexOf(item) const index = selectItems.value.indexOf(item);
item.checked = checked item.checked = checked;
if (index === -1 && checked) if (index === -1 && checked) selectItems.value.push(item);
selectItems.value.push(item) else selectItems.value.splice(index, 1);
else selectItems.value.splice(index, 1)
} }
const showActions = computed(() => { const showActions = computed(() => {
return selectItems.value.length > 0 && batch return selectItems.value.length > 0 && batch;
}) });
const taskpagination = reactive({ const taskpagination = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}) });
const taskStore = useTask() const taskStore = useTask();
const overTask = ref<any>(null) const overTask = ref<any>(null);
const taskDetailInfo = ref<any>({}) const taskDetailInfo = ref<any>({});
const taskDetailPictureList = ref<any[]>([]) const taskDetailPictureList = ref<any[]>([]);
const userStore = useUser() const userStore = useUser();
const imageRef = ref<ComponentElRef | null>() const imageRef = ref<ComponentElRef | null>();
let processItems: any[] = [] let processItems: any[] = [];
// states:1234 // states:1234
function validate(items: any[]) { function validate(items: any[]) {
if (items.length === 0) if (items.length === 0) return "至少选中一个任务";
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo // const useInfo = userStore.getUserInfo
// const username = useInfo.loginname // const username = useInfo.loginname
@ -86,175 +87,200 @@ function validate(items: any[]) {
// return '' // return ''
// } // }
return null return null;
} }
function approvalHandler(items?: any) { function approvalHandler(items?: any) {
let cloneItem: any let cloneItem: any;
if (batch.value) { processItems = selectItems.value } if (batch.value) {
else if (overTask.value) { processItems = selectItems.value;
cloneItem = clone(overTask.value) } else if (overTask.value) {
processItems = [cloneItem] cloneItem = clone(overTask.value);
processItems = [cloneItem];
} }
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent))
processItems = items processItems = items;
const msg = validate(processItems) const msg = validate(processItems);
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg);
return return;
} }
dialog.info({ dialog.info({
title: '确认提示', title: "确认提示",
content: '确认给该任务审批为【通过】吗?', content: "确认给该任务审批为【通过】吗?",
positiveText: '确定', positiveText: "确定",
negativeText: '取消', negativeText: "取消",
onPositiveClick: () => { onPositiveClick: () => {
approval() approval();
}, },
onNegativeClick: () => { }, onNegativeClick: () => {},
}) });
} }
function rejectHandler(items?: any) { function rejectHandler(items?: any) {
let cloneItem: any let cloneItem: any;
if (batch.value) { processItems = selectItems.value } if (batch.value) {
else if (overTask.value) { processItems = selectItems.value;
cloneItem = clone(overTask.value) } else if (overTask.value) {
processItems = [cloneItem] cloneItem = clone(overTask.value);
processItems = [cloneItem];
} }
if (items !== undefined && !(items instanceof PointerEvent)) if (items !== undefined && !(items instanceof PointerEvent))
processItems = items processItems = items;
const msg = validate(processItems) const msg = validate(processItems);
if (msg !== null) { if (msg !== null) {
message.error(msg) message.error(msg);
return return;
} }
const modal = unref(confrimModalRef)! as any const modal = unref(confrimModalRef)! as any;
modal.showModal() modal.showModal();
} }
function approval() { function approval() {
const formIds: string[] = processItems.map(item => item.id) const formIds: string[] = processItems.map((item) => item.id);
const taskIds: string[] = processItems.map(item => item.taskId) const taskIds: string[] = processItems.map((item) => item.taskId);
const tasknames: string[] = processItems.map(item => item.taskname) const tasknames: string[] = processItems.map((item) => item.taskname);
const param: ApprovalParam = { const param: ApprovalParam = {
formid: formIds, formid: formIds,
taskId: taskIds, taskId: taskIds,
approvd: true, approvd: true,
taskComment: 'approval', taskComment: "approval",
taskname: tasknames, taskname: tasknames,
} };
doAudit(param) doAudit(param);
} }
function doAudit(param: any) { function doAudit(param: any) {
audit(param).then((res) => { audit(param).then((res) => {
const { code } = res const { code } = res;
processItems.length = 0 processItems.length = 0;
if (code === 'OK') if (code === "OK") emitter.emit("refresh");
emitter.emit('refresh') else message.error(res.message);
else message.error(res.message) });
})
} }
function reject(idOrDesc: string, backId: string, isOther: boolean) { function reject(idOrDesc: string, backId: string, isOther: boolean) {
const formIds: string[] = processItems.map(item => item.id) const formIds: string[] = processItems.map((item) => item.id);
const taskIds: string[] = processItems.map(item => item.taskId) const taskIds: string[] = processItems.map((item) => item.taskId);
const tasknames: string[] = processItems.map(item => item.taskname) const tasknames: string[] = processItems.map((item) => item.taskname);
const param: ApprovalParam = { const param: ApprovalParam = {
formid: formIds, formid: formIds,
taskId: taskIds, taskId: taskIds,
approvd: false, approvd: false,
taskComment: idOrDesc, taskComment: idOrDesc,
taskname: isOther ? tasknames : ['其他'], taskname: isOther ? tasknames : ["其他"],
} };
doAudit(param) doAudit(param);
} }
function showModal(modalRef: any) { function showModal(modalRef: any) {
const modal = unref(modalRef)! as any const modal = unref(modalRef)! as any;
modal.showModal() modal.showModal();
} }
function forwardHandler() { function forwardHandler() {
taskStore.forward() taskStore.forward();
} }
function backHandler() { function backHandler() {
taskStore.back() taskStore.back();
} }
watch(() => [taskStore.activeId], async (newValue, oldValue) => { watch(
const packageid = taskStore.getPackageid () => [taskStore.activeId],
const taskId = taskStore.getActiveId async (newValue, oldValue) => {
const packageid = taskStore.getPackageid;
if (isEmpty(taskId)) const taskId = taskStore.getActiveId;
return
if (isEmpty(taskId)) return;
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid)
let listData = [];
taskDetailInfo.value = await getTaskDetailInfo(taskId, packageid);
const reviewType = 3; //
let res = await getAllfieldList(reviewType);
let fieldList = (res as any)?.data;
console.log(taskDetailInfo.value, "taskDetailInfo");
console.log(fieldList, "fieldList");
let showFieldData = taskDetailInfo.value.ocrPicture;
let showFieldKeys = Object.keys(showFieldData);
for (let i in showFieldKeys) {
let key = showFieldKeys[i];
let currentData = fieldList.find((v) => v.name == key);
if (currentData) {
let item = {
label: currentData.fieldDesc,
value: taskDetailInfo.value.ocrPicture[key],
key: currentData.name,
};
listData.push(item);
}
}
taskTableData.value = _.chunk(listData,2);
console.log(taskTableData.value,'taskTableData')
if (!isEmpty(packageid)) { if (!isEmpty(packageid)) {
const { data, total } = await getTaskDetailPictureList(packageid, taskId, { ...taskpagination, ...sortBy }) const { data, total } = await getTaskDetailPictureList(
taskDetailPictureList.value = data packageid,
totalCount.value = total taskId,
{ ...taskpagination, ...sortBy }
);
taskDetailPictureList.value = data;
totalCount.value = total;
} else {
taskDetailPictureList.value.length = 0;
totalCount.value = 0;
} }
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
} }
}) );
const currentTaskId = computed(() => { const currentTaskId = computed(() => {
const index = taskStore.getCurrentIndex const index = taskStore.getCurrentIndex;
return taskStore.getApprovalList[index]?.formid || '' return taskStore.getApprovalList[index]?.formid || "";
}) });
function overTaskHandle() { function overTaskHandle() {
const item = taskDetailInfo.value const item = taskDetailInfo.value;
if (validate([item]) == null && batch.value === false) if (validate([item]) == null && batch.value === false) overTask.value = item;
overTask.value = item
} }
function leaveTaskHandler() { function leaveTaskHandler() {
overTask.value = null overTask.value = null;
} }
function showActionsModal() { function showActionsModal() {
const modal = unref(CustomSettingModalRef)! as any const modal = unref(CustomSettingModalRef)! as any;
modal.showModal() modal.showModal();
} }
onUnmounted(() => { onUnmounted(() => {
taskStore.reset() taskStore.reset();
}) });
const mark = computed(() => { const mark = computed(() => {
return taskDetailInfo.value.iztrueorfalse === null ? '未标记' : '已标记' return taskDetailInfo.value.iztrueorfalse === null ? "未标记" : "已标记";
}) });
function immersionHandler() { function immersionHandler() {
taskStore.updateImmersion() taskStore.updateImmersion();
} }
function previewHandler(event: MouseEvent) { function previewHandler(event: MouseEvent) {
event.stopImmediatePropagation() event.stopImmediatePropagation();
event.stopPropagation() event.stopPropagation();
if (imageRef.value) if (imageRef.value) (imageRef.value as any).mergedOnClick();
(imageRef.value as any).mergedOnClick()
} }
function getPercent(pictureid: string) { function getPercent(pictureid: string) {
@ -286,12 +312,21 @@ function getPercent(pictureid: string) {
/> />
</div> </div>
<div class="right"> <div class="right">
<div v-show="!showActions" style="display: flex;align-items: center;" @click="setBatch(true)"> <div
v-show="!showActions"
style="display: flex; align-items: center"
@click="setBatch(true)"
>
<div class="btn"> <div class="btn">
<SvgIcon style="margin-right: 6px;" size="14" name="tf" /> <SvgIcon style="margin-right: 6px" size="14" name="tf" />
批量审批 批量审批
</div> </div>
<SvgIcon style="cursor: pointer;" size="20" name="immersion-model" @click="immersionHandler" /> <SvgIcon
style="cursor: pointer"
size="20"
name="immersion-model"
@click="immersionHandler"
/>
</div> </div>
<div v-show="showActions" class="batch"> <div v-show="showActions" class="batch">
<n-button text @click="setBatch(false)"> <n-button text @click="setBatch(false)">
@ -300,11 +335,14 @@ function getPercent(pictureid: string) {
</template> </template>
返回 返回
</n-button> </n-button>
<div style="cursor: pointer;margin-left: 16px;" @click.stop="rejectHandler"> <div
style="cursor: pointer; margin-left: 16px"
@click.stop="rejectHandler"
>
<SvgIcon width="64" height="28" name="a1" /> <SvgIcon width="64" height="28" name="a1" />
</div> </div>
<SvgIcon size="24" name="vs" /> <SvgIcon size="24" name="vs" />
<div style="cursor: pointer;" @click.stop="approvalHandler"> <div style="cursor: pointer" @click.stop="approvalHandler">
<SvgIcon width="64" height="28" name="a2" /> <SvgIcon width="64" height="28" name="a2" />
</div> </div>
</div> </div>
@ -312,21 +350,43 @@ function getPercent(pictureid: string) {
</div> </div>
<div class="wrapper-detail"> <div class="wrapper-detail">
<div <div
class="left" :style="{ 'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})` }" class="left"
@mouseover="overTaskHandle" @mouseleave="leaveTaskHandler" @click="previewHandler" :style="{
'background-image': `url(${taskDetailInfo?.ocrPicture?.imgurl})`,
}"
@mouseover="overTaskHandle"
@mouseleave="leaveTaskHandler"
@click="previewHandler"
> >
<div v-show="overTask" class="action"> <div v-show="overTask" class="action">
<SvgIcon style="cursor: pointer;" width="168" height="48" name="r6" @click.stop="approvalHandler" />
<SvgIcon <SvgIcon
style="cursor: pointer;margin-left: 30px;" width="168" height="48" name="r7" style="cursor: pointer"
width="168"
height="48"
name="r6"
@click.stop="approvalHandler"
/>
<SvgIcon
style="cursor: pointer; margin-left: 30px"
width="168"
height="48"
name="r7"
@click.stop="rejectHandler" @click.stop="rejectHandler"
/> />
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" /> <SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 0"
size="128"
name="jia"
/>
</div> </div>
<div class="mark"> <div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 1" size="128" name="zhen" /> <SvgIcon
v-show="taskDetailInfo?.iztrueorfalse === 1"
size="128"
name="zhen"
/>
</div> </div>
<div class="info"> <div class="info">
<n-grid x-gap="12" y-gap="10" :cols="12"> <n-grid x-gap="12" y-gap="10" :cols="12">
@ -336,7 +396,7 @@ function getPercent(pictureid: string) {
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span style="font-size: bold;font-size: 18px;">{{ mark }}</span> <span style="font-size: bold; font-size: 18px">{{ mark }}</span>
<span>审批状态</span> <span>审批状态</span>
</n-gi> </n-gi>
<n-gi span="4" class="gi1"> <n-gi span="4" class="gi1">
@ -345,7 +405,9 @@ function getPercent(pictureid: string) {
</span> </span>
</n-gi> </n-gi>
<n-gi span="8" class="gi2"> <n-gi span="8" class="gi2">
<span style="font-size: bold;font-size: 18px;">{{ totalCount }}</span> <span style="font-size: bold; font-size: 18px">{{
totalCount
}}</span>
<span>相似匹配</span> <span>相似匹配</span>
</n-gi> </n-gi>
</n-grid> </n-grid>
@ -354,8 +416,12 @@ function getPercent(pictureid: string) {
<SvgIcon color="#FFF" size="16" name="time" /> <SvgIcon color="#FFF" size="16" name="time" />
<span>2023-09-17 13:09:10</span> <span>2023-09-17 13:09:10</span>
</div> </div>
<div style="display: none;"> <div style="display: none">
<n-image ref="imageRef" :img-props="{ onClick: hideDownload }" :src="taskDetailInfo?.ocrPicture?.imgurl" /> <n-image
ref="imageRef"
:img-props="{ onClick: hideDownload }"
:src="taskDetailInfo?.ocrPicture?.imgurl"
/>
</div> </div>
</div> </div>
<div class="right"> <div class="right">
@ -363,13 +429,22 @@ function getPercent(pictureid: string) {
<div class="header"> <div class="header">
<span>相似图片({{ totalCount }})</span> <span>相似图片({{ totalCount }})</span>
<SvgIcon <SvgIcon
style="margin-right: 20px;cursor: pointer;" name="max" size="24" style="margin-right: 20px; cursor: pointer"
name="max"
size="24"
@click="showModal(batchModalRef)" @click="showModal(batchModalRef)"
/> />
</div> </div>
<div class="list"> <div class="list">
<div v-for="(item, index) in taskDetailPictureList" :key="index" class="item"> <div
<div class="img-wrapper" :style="{ 'background-image': `url(${item.imgurl})` }" /> v-for="(item, index) in taskDetailPictureList"
:key="index"
class="item"
>
<div
class="img-wrapper"
:style="{ 'background-image': `url(${item.imgurl})` }"
/>
<div class="check"> <div class="check">
<n-checkbox <n-checkbox
v-show="batch" v-show="batch"
@ -390,9 +465,7 @@ function getPercent(pictureid: string) {
<div class="info-header"> <div class="info-header">
<div class="left_box"> <div class="left_box">
<div class="title"> <div class="title">填报信息</div>
填报信息
</div>
<SvgIcon size="12" name="collapse" /> <SvgIcon size="12" name="collapse" />
</div> </div>
<div class="right_box" @click="showActionsModal"> <div class="right_box" @click="showActionsModal">
@ -402,7 +475,7 @@ function getPercent(pictureid: string) {
</div> </div>
<n-tabs type="line" animated> <n-tabs type="line" animated>
<n-tab-pane name="task-info" tab="任务信息"> <n-tab-pane name="task-info" tab="任务信息">
<TaskTable :data="taskDetailInfo" /> <TaskTable :data="taskDetailInfo" :taskTableData="taskTableData"/>
</n-tab-pane> </n-tab-pane>
<n-tab-pane name="picture-info" tab="图片信息"> <n-tab-pane name="picture-info" tab="图片信息">
<PictureTable :data="taskDetailInfo" /> <PictureTable :data="taskDetailInfo" />
@ -468,7 +541,7 @@ function getPercent(pictureid: string) {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
color: #FFF; color: #fff;
margin-right: 6px; margin-right: 6px;
cursor: pointer; cursor: pointer;
} }
@ -538,7 +611,7 @@ function getPercent(pictureid: string) {
background: rgba(216, 216, 216, 0.4); background: rgba(216, 216, 216, 0.4);
border-radius: 7px; border-radius: 7px;
padding: 10px; padding: 10px;
color: #FFF; color: #fff;
} }
.time { .time {
@ -546,7 +619,7 @@ function getPercent(pictureid: string) {
z-index: 3; z-index: 3;
left: 2%; left: 2%;
bottom: 2%; bottom: 2%;
color: #FFF; color: #fff;
display: flex; display: flex;
align-items: center; align-items: center;
} }
@ -560,7 +633,7 @@ function getPercent(pictureid: string) {
display: flex; display: flex;
align-items: left; align-items: left;
flex-direction: column; flex-direction: column;
justify-content: center justify-content: center;
} }
} }

@ -4,52 +4,20 @@ defineProps({
type: Object as PropType<any>, type: Object as PropType<any>,
required: true, required: true,
}, },
}) taskTableData: {
type: Array,
default: () => [[]],
},
});
</script> </script>
<template> <template>
<table class="description"> <table class="description">
<tr> <tr v-for="(item, index) in taskTableData" :key="index">
<th>拜访终端名称</th> <th>{{ item[0]["label"] }}</th>
<td class="blue"> <td>{{ item[0]["value"] }}</td>
{{ data?.ocrPicture?.field3 }} <th v-if="item.length>1">{{ item[1]["label"] }}</th>
</td> <td v-if="item.length>1">{{ item[1]["value"] }}</td>
<th>定位信息</th>
<td class="blue">
{{ data?.ocrPicture?.field10 }}
</td>
</tr>
<tr>
<th>拜访日期</th>
<td> {{ data?.ocrPicture?.field1 }}</td>
<th>定位距离</th>
<td> {{ data?.ocrPicture?.field12 }}</td>
</tr>
<tr>
<th>拜访小结</th>
<td> {{ data?.ocrPicture?.field8 }}</td>
<th>拜访项目类别</th>
<td> {{ data?.ocrPicture?.field17 }}</td>
</tr>
<tr>
<th>科室名称</th>
<td> {{ data?.ocrPicture?.field7 }}</td>
<th>病例号</th>
<td></td>
</tr>
<tr>
<th>拜访级别</th>
<td> {{ data?.ocrPicture?.field6 }}</td>
<th>下阶段计划</th>
<td></td>
</tr>
<tr>
<th>是否为重复图片</th>
<td> {{ data?.ocrPicture?.field14 }}</td>
<th>附件信息</th>
<td>
<a href="data?.fileannex" download></a>
</td>
</tr> </tr>
</table> </table>
</template> </template>

@ -104,6 +104,7 @@ async function handleSumbit(e: MouseEvent) {
userField += `${v.id},`; userField += `${v.id},`;
} }
}); });
userField = userField.slice(0,userField.length-1);
savefield(props.reviewType, userInfo.id, userField); savefield(props.reviewType, userInfo.id, userField);
e.preventDefault(); e.preventDefault();
closeModal(); closeModal();

@ -104,6 +104,7 @@ async function handleSumbit(e: MouseEvent) {
onList.value.map((v) => { onList.value.map((v) => {
userField += `${v.id},`; userField += `${v.id},`;
}); });
userField = userField.slice(0,userField.length-1);
savefield(props.reviewType, userInfo.id, userField); savefield(props.reviewType, userInfo.id, userField);
e.preventDefault(); e.preventDefault();
closeModal(); closeModal();

Loading…
Cancel
Save