Merge pull request 'shen' (#23) from shen into test

Reviewed-on: #23
pull/24/head
shenhailong 1 year ago
commit be5d95f683

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>自定义列</title>
<defs>
<rect id="path-1" x="0" y="0" width="64" height="64"></rect>
</defs>
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
<g id="PrevailCloud-Design-图标集" transform="translate(-1986.000000, -6758.000000)">
<g id="自定义列" transform="translate(1986.000000, 6758.000000)">
<mask id="mask-2" fill="white">
<use xlink:href="#path-1"></use>
</mask>
<g id="蒙版"></g>
<path d="M36.9854854,42.6064492 C37.5377701,42.6064492 37.9854854,43.0541645 37.9854854,43.6064492 L37.9854854,56 C37.9854854,56.5522847 37.5377701,57 36.9854854,57 L33.9854854,57 C33.4332006,57 32.9854854,56.5522847 32.9854854,56 L32.985,52.303 L7,52.3032246 C6.44771525,52.3032246 6,51.8555094 6,51.3032246 L6,48.3032246 C6,47.7509399 6.44771525,47.3032246 7,47.3032246 L32.985,47.303 L32.9854854,43.6064492 C32.9854854,43.0541645 33.4332006,42.6064492 33.9854854,42.6064492 L36.9854854,42.6064492 Z M54.4637884,47.3032246 C55.0160731,47.3032246 55.4637884,47.7509399 55.4637884,48.3032246 L55.4637884,51.3032246 C55.4637884,51.8555094 55.0160731,52.3032246 54.4637884,52.3032246 L44.6371044,52.3032246 C44.0848196,52.3032246 43.6371044,51.8555094 43.6371044,51.3032246 L43.6371044,48.3032246 C43.6371044,47.7509399 44.0848196,47.3032246 44.6371044,47.3032246 L54.4637884,47.3032246 Z M29.8824782,24.8032246 C30.4347629,24.8032246 30.8824782,25.2509399 30.8824782,25.8032246 L30.882,29.5 L57,29.5 C57.5522847,29.5 58,29.9477153 58,30.5 L58,33.5 C58,34.0522847 57.5522847,34.5 57,34.5 L30.882,34.5 L30.8824782,38.1967754 C30.8824782,38.7490601 30.4347629,39.1967754 29.8824782,39.1967754 L26.8824782,39.1967754 C26.3301934,39.1967754 25.8824782,38.7490601 25.8824782,38.1967754 L25.8824782,25.8032246 C25.8824782,25.2509399 26.3301934,24.8032246 26.8824782,24.8032246 L29.8824782,24.8032246 Z M19.2308592,29.5 C19.7831439,29.5 20.2308592,29.9477153 20.2308592,30.5 L20.2308592,33.5 C20.2308592,34.0522847 19.7831439,34.5 19.2308592,34.5 L7,34.5 C6.44771525,34.5 6,34.0522847 6,33.5 L6,30.5 C6,29.9477153 6.44771525,29.5 7,29.5 L19.2308592,29.5 Z M36.9854854,7 C37.5377701,7 37.9854854,7.44771525 37.9854854,8 L37.9854854,20.3935508 C37.9854854,20.9458355 37.5377701,21.3935508 36.9854854,21.3935508 L33.9854854,21.3935508 C33.4332006,21.3935508 32.9854854,20.9458355 32.9854854,20.3935508 L32.985,16.696 L7,16.6967754 C6.44771525,16.6967754 6,16.2490601 6,15.6967754 L6,12.6967754 C6,12.1444906 6.44771525,11.6967754 7,11.6967754 L32.985,11.696 L32.9854854,8 C32.9854854,7.44771525 33.4332006,7 33.9854854,7 L36.9854854,7 Z M54.4637884,11.6967754 C55.0160731,11.6967754 55.4637884,12.1444906 55.4637884,12.6967754 L55.4637884,15.6967754 C55.4637884,16.2490601 55.0160731,16.6967754 54.4637884,16.6967754 L44.6371044,16.6967754 C44.0848196,16.6967754 43.6371044,16.2490601 43.6371044,15.6967754 L43.6371044,12.6967754 C43.6371044,12.1444906 44.0848196,11.6967754 44.6371044,11.6967754 L54.4637884,11.6967754 Z" id="形状结合" fill="#666666" fill-rule="nonzero" mask="url(#mask-2)"></path>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.3 KiB

@ -30,8 +30,8 @@ const rules = {
}
const formData = reactive({
disposeTypeId: '',
failCauseId: '',
disposeTypeId: '262403670085013522',
failCauseId: '260402999231251188',
comment: '',
})
@ -149,7 +149,7 @@ async function selectChange(id) {
<n-select v-model:value="formData.failCauseId" filterable :options="failCauseOptions" @change="selectChange" />
</n-form-item>
<n-form-item v-show="showOther" class="form-item-area" label="" path="">
<n-input v-model:value="formData.comment" type="textarea" placeholder="备注内容" />
<n-input v-model:value="formData.comment" placeholder-class="pl" type="textarea" placeholder="备注内容" />
</n-form-item>
</div>
</n-form>
@ -157,9 +157,9 @@ async function selectChange(id) {
<template #footer>
<div class="wrapper-footer">
<n-button type="info" @click="handleSumbit">
</n-button>
<n-button secondary style="margin-left:15px" @click="closeModal">
<n-button secondary class="btn" style="margin-left:15px" @click="closeModal">
取消
</n-button>
</div>
@ -219,6 +219,7 @@ async function selectChange(id) {
.form-item-area{
margin-top: -30px;
}
}
::v-deep(.n-card__content) {
@ -234,4 +235,13 @@ async function selectChange(id) {
margin-top: 0px;
margin-bottom: 0px;
}
::v-deep(.n-input__placeholder) {
color: #333333!important;
}
.btn{
border: 1px solid #cad2dd;
background-color: #fff;
}
</style>

@ -46,7 +46,7 @@ const emit = defineEmits(['changeShow'])
function changeContent() {
emit('changeShow')
}
const checkedRowKeys = ref([])
const dicStore = useDictionary()
const izstatusList = ref([])
const router = useRouter()
@ -170,6 +170,9 @@ async function getColumns() {
type: 'selection',
fixed: 'left',
width: 50,
disabled(row: any) {
return row.states !== 2
},
},
]
@ -602,22 +605,6 @@ function actionHandler(action: any, row: any) {
function validate(items: any[]) {
if (items.length === 0)
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo
// const username = useInfo.loginname
// for (const item of items) {
// const { iztrueorfalse, states, assignee } = item
// if (iztrueorfalse === null)
// return ''
// else if (states !== 2)
// return ''
// else if (assignee !== username)
// return ''
// }
return null
}
@ -663,47 +650,47 @@ function singleApproval(row) {
doAudit(param)
}
//
function batchApproval() {
const items = getSelectItems()
const items: any = getSelectItems()
const msg = validate(items)
if (msg !== null) {
message.error(msg)
return
}
dialog.info({
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
approval(items)
},
onNegativeClick: () => {},
console.log(items)
const list: any = []
items.forEach((item) => {
list.push({
formId: item.id,
taskId: item.taskId,
taskName: item.fromtaskname,
})
})
}
// function approval(items) {
// const formIds: string[] = items.map(item => item.id)
// const taskIds: string[] = items.map(item => item.taskId)
// const tasknames: string[] = items.map(item => item.taskname)
const param = {
result: true,
comment: '',
disposeType: '',
disposeTypeId: '',
failCauseId: '',
failCauseName: '',
flowTaskInfoList: list,
}
// const param: ApprovalParam = {
// formid: formIds,
// taskId: taskIds,
// approvd: true,
// taskComment: 'approval',
// taskname: tasknames,
// }
doAudit(param)
}
// doAudit(param)
// }
//
function batchReject() {
const items: any = getSelectItems()
rejectHandler(items)
}
//
function rejectHandler(list) {
const msg = validate(list)
if (msg !== null) {
message.error(msg)
return
@ -713,24 +700,10 @@ function rejectHandler(list) {
modal.showModal(list)
}
function reject(idOrDesc: string, backId: string, isOther: boolean) {
const items = getSelectItems()
const formIds: string[] = items.map(item => item.id)
const taskIds: string[] = items.map(item => item.fromtaskid)
const tasknames: string[] = items.map(item => item.fromtaskname)
const param: ApprovalParam = {
formid: formIds,
taskId: taskIds,
approvd: false,
taskComment: idOrDesc,
taskname: isOther ? tasknames : ['其他'],
}
doAudit(param)
}
function reload() {
selectionIds.value = []
checkedRowKeys.value = []
const { page, pageSize } = unref(tableRef.value?.pagination) as PaginationProps
query(page!, pageSize!)
}
@ -786,10 +759,15 @@ function doAudit(param: any) {
<NButton class="xjcc" text @click="showModal(repeatModalRef)">
小结查重
</NButton>
<div class="btn" @click="batchApproval">
<div class="batch">
<img class="btn-approval btn-left" src="@/assets/images/task/btn-not-pass.png" alt="" @click.stop="batchReject">
<SvgIcon size="24" name="vs" />
<img class="btn-approval" src="@/assets/images/task/btn-pass.png" alt="" @click.stop="batchApproval">
</div>
<!-- <div class="btn" @click="batchApproval">
<SvgIcon style="margin-right: 6px" size="14" name="tf" />
批量审批
</div>
</div> -->
<n-popover
ref="popover"
:style="{ padding: '0px' }"
@ -832,13 +810,14 @@ function doAudit(param: any) {
<SvgIcon
style="cursor: pointer"
size="18"
name="setting"
name="column"
@click="showModal(customTabelRef)"
/>
</div>
<div class="wrapper-content">
<NDataTable
ref="tableRef"
v-model:checked-row-keys="checkedRowKeys"
remote
:columns="columnsRef"
:scroll-x="1250"
@ -874,6 +853,21 @@ function doAudit(param: any) {
.color-red{
color: #FF4E4F!important;
}
.batch {
display: flex;
align-items: center;
.btn-approval{
width: 68px;
height: 28px;
cursor: pointer;
}
.btn-left{
margin-left: 16px;
}
}
.wrapper {
display: flex;
flex: 1;

@ -1,28 +1,28 @@
<script lang="ts" setup>
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from "vue";
import { chunk, clone } from "lodash-es";
import { useDialog, useMessage } from "naive-ui";
import { useRoute } from "vue-router";
import BatchModal from "../modal/BatchModal.vue";
import CustomSettingModal from "../modal/CustomSettingModal.vue";
import PictureTable from "./PictureTable.vue";
import TaskTable from "./TaskTable.vue";
import History from "./History.vue";
import NotPassed from "@/components/Approval/NotPassed.vue";
import { getAllfieldList, getfieldList } from "@/api/home/filter";
import { TASK_STATUS_OBJ } from "@/enums/index";
import { computed, onMounted, onUnmounted, reactive, ref, unref, watch } from 'vue'
import { chunk, clone } from 'lodash-es'
import { useDialog, useMessage } from 'naive-ui'
import { useRoute } from 'vue-router'
import BatchModal from '../modal/BatchModal.vue'
import CustomSettingModal from '../modal/CustomSettingModal.vue'
import PictureTable from './PictureTable.vue'
import TaskTable from './TaskTable.vue'
import History from './History.vue'
import NotPassed from '@/components/Approval/NotPassed.vue'
import { getAllfieldList, getfieldList } from '@/api/home/filter'
import { TASK_STATUS_OBJ } from '@/enums/index'
import {
audit,
dubiousfileyd,
getSimilarityList,
getTaskDetailInfo,
} from "@/api/task/task";
import { useTask } from "@/store/modules/task";
import { useUser } from "@/store/modules/user";
import { isEmpty } from "@/utils";
import { formatToDateHMS } from "@/utils/dateUtil";
import { hideDownload } from "@/utils/image";
} from '@/api/task/task'
import { useTask } from '@/store/modules/task'
import { useUser } from '@/store/modules/user'
import { isEmpty } from '@/utils'
import { formatToDateHMS } from '@/utils/dateUtil'
import { hideDownload } from '@/utils/image'
const emit = defineEmits(['setAsideItemName'])
const batch = ref(false)
@ -39,57 +39,61 @@ const taskTableData = ref<any[]>([])
const route = useRoute()
const sortBy: any = {
orderType: "desc",
orderName: "similarityScore",
};
orderType: 'desc',
orderName: 'similarityScore',
}
function setBatch(value: boolean) {
if (totalCount.value === 0) return;
if (totalCount.value === 0)
return
batch.value = value;
batch.value = value
if (value === false)
selectItems.value = []
}
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[] = []
onMounted(() => {
window.addEventListener("keydown", handleKeydown);
window.addEventListener('keydown', handleKeydown)
if (route.query.id) {
taskId.value = route.query.id;
packageId.value = route.query.packageid;
getDetail();
taskId.value = route.query.id
packageId.value = route.query.packageid
getDetail()
}
});
})
//
function handleKeydown(event) {
if (event.key === "ArrowLeft") backHandler();
if (event.key === 'ArrowLeft')
backHandler()
//
else if (event.key === "ArrowRight") forwardHandler();
else if (event.key === 'ArrowRight')
forwardHandler()
//
}
@ -101,7 +105,8 @@ function currentTaskId() {
// states:1234
function validate(items: any[]) {
if (items.length === 0) return "至少选中一个任务";
if (items.length === 0)
return '至少选中一个任务'
// const useInfo = userStore.getUserInfo
// const username = useInfo.loginname
@ -118,56 +123,58 @@ function validate(items: any[]) {
// return ''
// }
return null;
return null
}
function approvalHandler(items?: any) {
let cloneItem: any;
let cloneItem: any
if (batch.value) {
processItems = selectItems.value;
} else if (overTask.value) {
cloneItem = clone(overTask.value);
processItems = [cloneItem];
processItems = selectItems.value
}
else if (overTask.value) {
cloneItem = clone(overTask.value)
processItems = [cloneItem]
}
if (items !== undefined && !(items instanceof PointerEvent)) processItems = items;
if (items !== undefined && !(items instanceof PointerEvent))
processItems = items
const msg = validate(processItems);
const msg = validate(processItems)
if (msg !== null) {
message.error(msg);
return;
message.error(msg)
return
}
const list: any = [];
const list: any = []
processItems.forEach((item) => {
list.push({
formId: item.id,
taskId: item.taskId,
taskName: item.fromTaskName,
});
});
})
})
const param = {
result: true,
comment: "",
disposeType: "",
disposeTypeId: "",
failCauseId: "",
failCauseName: "",
comment: '',
disposeType: '',
disposeTypeId: '',
failCauseId: '',
failCauseName: '',
flowTaskInfoList: list,
};
}
dialog.info({
title: "确认提示",
content: "确认给该任务审批为【通过】吗?",
positiveText: "确定",
negativeText: "取消",
title: '确认提示',
content: '确认给该任务审批为【通过】吗?',
positiveText: '确定',
negativeText: '取消',
onPositiveClick: () => {
doAudit(param);
doAudit(param)
},
onNegativeClick: () => {},
});
})
}
function rejectHandler(items?: any) {
@ -188,53 +195,54 @@ function doAudit(param: any) {
setBatch(false)
reloadList(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()
}
async function handleDragEnd(event, item) {
//
const flag = taskStore.getInFile;
const flag = taskStore.getInFile
if (flag) {
const res = await dubiousfileyd({ pictureid: item.pictureid });
if (res.code === "OK") {
message.success("加入成功");
getTableData();
} else {
message.error(res.message);
const res = await dubiousfileyd({ pictureid: item.pictureId })
if (res.code === 'OK') {
message.success('加入成功')
getTableData()
}
taskStore.setInFile(false);
else {
message.error(res.message)
}
taskStore.setInFile(false)
}
}
async function getTableData() {
const useInfo = userStore.getUserInfo;
const listData = [];
const reviewType = 3; //
let res = await getAllfieldList(reviewType);
const fieldList = (res as any)?.data;
res = await getfieldList(reviewType, useInfo.id);
const userFieldList = (res as any)?.data.userFieldFixed;
const useInfo = userStore.getUserInfo
const listData = []
const reviewType = 3 //
let res = await getAllfieldList(reviewType)
const fieldList = (res as any)?.data
res = await getfieldList(reviewType, useInfo.id)
const userFieldList = (res as any)?.data.userFieldFixed
const blueList = [
"拜访终端名称",
"定位信息",
"拜访日期",
"定位距离",
"拜访小结",
"拜访项目类别",
];
'拜访终端名称',
'定位信息',
'拜访日期',
'定位距离',
'拜访小结',
'拜访项目类别',
]
fieldList.map((v) => {
if (userFieldList.includes(v.name)) {
const item = {
@ -242,11 +250,11 @@ async function getTableData() {
value: taskDetailInfo.value.ocrPicture[v.name],
key: v.name,
blue: blueList.includes(v.fieldDesc),
};
listData.push(item);
}
listData.push(item)
}
});
taskTableData.value = chunk(listData, 2);
})
taskTableData.value = chunk(listData, 2)
}
async function getImgList() {
@ -255,49 +263,51 @@ async function getImgList() {
...taskpagination,
...sortBy,
pictureId: taskDetailInfo.value.ocrPicture.id,
});
taskDetailPictureList.value = data;
totalCount.value = total;
} else {
taskDetailPictureList.value.length = 0;
totalCount.value = 0;
})
taskDetailPictureList.value = data
totalCount.value = total
}
else {
taskDetailPictureList.value.length = 0
totalCount.value = 0
}
}
function overTaskHandle() {
const item = taskDetailInfo.value;
const item = taskDetailInfo.value
if (item?.userapprove?.statshis === 2 || item?.userapprove?.statshis == 3) {
overTask.value = null;
return;
overTask.value = null
return
}
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();
window.removeEventListener("keydown", handleKeydown);
});
taskStore.reset()
window.removeEventListener('keydown', handleKeydown)
})
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).src)
(imageRef.value as any).mergedOnClick();
(imageRef.value as any).mergedOnClick()
}
watch(
@ -313,10 +323,10 @@ watch(
//
async function getDetail() {
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value);
setBatch(false);
getTableData();
getImgList();
taskDetailInfo.value = await getTaskDetailInfo(taskId.value, packageId.value)
setBatch(false)
getTableData()
getImgList()
}
function reloadList(param, text) {
@ -386,14 +396,14 @@ function reloadList(param, text) {
src="@/assets/images/task/btn-not-pass.png"
alt=""
@click.stop="rejectHandler"
/>
>
<SvgIcon size="24" name="vs" />
<img
class="btn-approval"
src="@/assets/images/task/btn-pass.png"
alt=""
@click.stop="approvalHandler"
/>
>
</div>
</div>
</div>
@ -438,13 +448,13 @@ function reloadList(param, text) {
class="img-status"
src="@/assets/images/task/pass.png"
alt=""
/>
>
<img
v-show="taskDetailInfo?.userapprove?.statshis === 3"
class="img-status"
src="@/assets/images/task/not_pass.png"
alt=""
/>
>
</div>
<div class="mark">
<SvgIcon v-show="taskDetailInfo?.iztrueorfalse === 0" size="128" name="jia" />
@ -460,7 +470,7 @@ function reloadList(param, text) {
<n-grid x-gap="12" y-gap="10" :cols="12">
<n-gi span="4" class="gi1">
<span>
<img class="icon-status" src="@/assets/images/task/status.png" alt="" />
<img class="icon-status" src="@/assets/images/task/status.png" alt="">
</span>
</n-gi>
<n-gi span="8" class="gi2">
@ -475,7 +485,7 @@ function reloadList(param, text) {
class="icon-status"
src="@/assets/images/task/similarity.png"
alt=""
/>
>
</span>
</n-gi>
<n-gi span="8" class="gi2">
@ -541,13 +551,13 @@ function reloadList(param, text) {
class="tag-status"
src="@/assets/images/task/tag-pass.png"
alt=""
/>
>
<img
v-if="item.historyStates === 3"
class="tag-status"
src="@/assets/images/task/tag-not-pass.png"
alt=""
/>
>
<div class="time">
<div class="time-item">
<SvgIcon class="svg-time" color="#FFF" size="8" name="camera-time" />

@ -19,7 +19,7 @@ defineProps({
<tr>
<th>图片名称</th>
<td class="blue">
{{ data?.pictureInfo?.imgname }}
{{ data?.pictureInfo?.imgName }}
</td>
<th>图片格式</th>
<td class="blue">

Loading…
Cancel
Save