Merge branch 'al'

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

@ -33,7 +33,7 @@ const svgName = computed(() => {
</div>
<ul class="list-item-detail">
<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>提报人{{ listItem.fromuserid }}</li>

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

@ -4,52 +4,20 @@ defineProps({
type: Object as PropType<any>,
required: true,
},
})
taskTableData: {
type: Array,
default: () => [[]],
},
});
</script>
<template>
<table class="description">
<tr>
<th>拜访终端名称</th>
<td class="blue">
{{ data?.ocrPicture?.field3 }}
</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 v-for="(item, index) in taskTableData" :key="index">
<th>{{ item[0]["label"] }}</th>
<td>{{ item[0]["value"] }}</td>
<th v-if="item.length>1">{{ item[1]["label"] }}</th>
<td v-if="item.length>1">{{ item[1]["value"] }}</td>
</tr>
</table>
</template>

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

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

Loading…
Cancel
Save