Merge pull request 'feat:相似图片详情' (#272) from fix/change_task into test
Reviewed-on: #272pull/274/head
commit
81affcbfdc
@ -0,0 +1,439 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { difference } from 'lodash-es'
|
||||||
|
import { chunk, clone } from 'lodash-es'
|
||||||
|
import {
|
||||||
|
computed,
|
||||||
|
defineEmits,
|
||||||
|
defineProps,
|
||||||
|
onMounted,
|
||||||
|
onUnmounted,
|
||||||
|
ref,
|
||||||
|
watch,
|
||||||
|
} from 'vue'
|
||||||
|
import { VueDraggable } from 'vue-draggable-plus'
|
||||||
|
import { workPackageMap } from '@/config/workorder'
|
||||||
|
import { useUser } from '@/store/modules/user'
|
||||||
|
import { TASK_STATUS_OBJ } from '@/enums/index'
|
||||||
|
import {
|
||||||
|
getTaskDetailInfo,
|
||||||
|
} from '@/api/task/task'
|
||||||
|
import { getAllfieldList, getfieldList } from '@/api/home/filter'
|
||||||
|
import { useKeydown } from '@/hooks/event/useKeydown'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
reviewType: {
|
||||||
|
type: Number,
|
||||||
|
default: () => 1,
|
||||||
|
require: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const show = ref(false)
|
||||||
|
const detailobj=ref(null)
|
||||||
|
const taskDetailInfo = ref<any>({})
|
||||||
|
const taskTableData = ref<any[]>([])
|
||||||
|
const userStore = useUser()
|
||||||
|
const emit = defineEmits(['passfun','nopassfun'])
|
||||||
|
async function showModal(item:any,packid,imgid){
|
||||||
|
getTableData()
|
||||||
|
taskDetailInfo.value = await getTaskDetailInfo(item.id,packid, imgid)
|
||||||
|
detailobj.value=item
|
||||||
|
show.value=true
|
||||||
|
}
|
||||||
|
|
||||||
|
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 blueList = [
|
||||||
|
'拜访终端名称',
|
||||||
|
'定位信息',
|
||||||
|
'拜访日期',
|
||||||
|
'定位距离',
|
||||||
|
'拜访小结',
|
||||||
|
'拜访项目类别',
|
||||||
|
]
|
||||||
|
|
||||||
|
fieldList.forEach((v) => {
|
||||||
|
if (userFieldList.includes(v.name)) {
|
||||||
|
let locationobj = { address: '' }
|
||||||
|
|
||||||
|
if (v.name == 'location' && taskDetailInfo.value.ocrPicture[v.name] != null && taskDetailInfo.value.ocrPicture[v.name] != 'null') {
|
||||||
|
locationobj = JSON.parse(
|
||||||
|
taskDetailInfo.value.ocrPicture ? taskDetailInfo.value.ocrPicture[v.name] : {},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
const item = {
|
||||||
|
label: v.fieldDesc,
|
||||||
|
value:
|
||||||
|
v.name == 'location'
|
||||||
|
? locationobj.address
|
||||||
|
: taskDetailInfo.value.ocrPicture
|
||||||
|
? taskDetailInfo.value.ocrPicture[v.name]
|
||||||
|
: '',
|
||||||
|
key: v.name,
|
||||||
|
blue: blueList.includes(v.fieldDesc),
|
||||||
|
}
|
||||||
|
listData.push(item)
|
||||||
|
}
|
||||||
|
return v
|
||||||
|
})
|
||||||
|
taskTableData.value = chunk(listData, 2)
|
||||||
|
console.log(taskDetailInfo)
|
||||||
|
}
|
||||||
|
function closeModal(){
|
||||||
|
show.value=false
|
||||||
|
}
|
||||||
|
function passfun(e= taskDetailInfo.value ){
|
||||||
|
emit('passfun', e);
|
||||||
|
}
|
||||||
|
function nopassfun(e= taskDetailInfo.value){
|
||||||
|
emit('nopassfun', e);
|
||||||
|
}
|
||||||
|
useKeydown('c', () => {
|
||||||
|
|
||||||
|
closeModal()
|
||||||
|
})
|
||||||
|
useKeydown('p p', () => {
|
||||||
|
passfun()
|
||||||
|
})
|
||||||
|
useKeydown('x x', () => {
|
||||||
|
nopassfun()
|
||||||
|
})
|
||||||
|
|
||||||
|
onMounted(async () => {
|
||||||
|
|
||||||
|
})
|
||||||
|
onUnmounted(() => {
|
||||||
|
|
||||||
|
})
|
||||||
|
defineExpose({
|
||||||
|
showModal,
|
||||||
|
closeModal,passfun,nopassfun,taskDetailInfo
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<n-modal v-model:show="show" transform-origin="center">
|
||||||
|
<n-card
|
||||||
|
class="cardstyle"
|
||||||
|
:bordered="false"
|
||||||
|
size="huge"
|
||||||
|
role="dialog"
|
||||||
|
aria-modal="true"
|
||||||
|
>
|
||||||
|
<div class="wrapper">
|
||||||
|
<span class="wrapper-title" style="color: #333">任务ID:{{detailobj.fromTaskName}}</span>
|
||||||
|
</div>
|
||||||
|
<div style="display:flex;margin-top:25px">
|
||||||
|
<div
|
||||||
|
class="left"
|
||||||
|
:style="
|
||||||
|
{
|
||||||
|
backgroundImage: `url(${detailobj?.imgUrl })`,
|
||||||
|
}
|
||||||
|
|
||||||
|
"
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
class="right"
|
||||||
|
>
|
||||||
|
<n-scrollbar style="max-height: 100%">
|
||||||
|
<div
|
||||||
|
style="
|
||||||
|
font-size: 22px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: #0d0b22;
|
||||||
|
white-space: nowrap;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
|
||||||
|
"
|
||||||
|
>
|
||||||
|
<n-ellipsis style="font-size:22px">
|
||||||
|
{{ detailobj.fromTaskName }}
|
||||||
|
</n-ellipsis>
|
||||||
|
</div>
|
||||||
|
<div class="tags">
|
||||||
|
<div
|
||||||
|
v-if="detailobj?.historyStates == 1"
|
||||||
|
class="tag tag-submiting"
|
||||||
|
>
|
||||||
|
待审批
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="
|
||||||
|
detailobj?.historyStates == 2
|
||||||
|
|| detailobj?.historyStates == 3
|
||||||
|
"
|
||||||
|
class="tag tag-submited"
|
||||||
|
>
|
||||||
|
已审批
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="detailobj?.historyStates == 2"
|
||||||
|
class="tag tag-passed"
|
||||||
|
>
|
||||||
|
{{ TASK_STATUS_OBJ[detailobj.historyStates] }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-else-if="taskDetailInfo?.userapprove?.historyStates == 3"
|
||||||
|
class="tag tag-not-passed"
|
||||||
|
>
|
||||||
|
{{ TASK_STATUS_OBJ[detailobj?.historyStates] }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<n-divider class="divider-line" />
|
||||||
|
<div :style="{ width: '100%' }">
|
||||||
|
<div
|
||||||
|
v-for="(item, index) in taskTableData"
|
||||||
|
:key="index"
|
||||||
|
:style="{ width: '100%' }"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
v-if="item[0].label == '拜访终端名称'"
|
||||||
|
:style="{ display: 'flex', height: '100%', width: '100%' }"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
width: '100px',
|
||||||
|
borderRight: '2px solid',
|
||||||
|
marginTop: '4px',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ item[0].label }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
:style="{
|
||||||
|
marginLeft: '15px',
|
||||||
|
fontSize: '16px',
|
||||||
|
textOverflow: 'ellipsis',
|
||||||
|
paddingTop: '2px',
|
||||||
|
}"
|
||||||
|
>
|
||||||
|
{{ item[0].value }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="!(item[0].label == '拜访终端名称')" class="viewlabel">
|
||||||
|
{{ item[0].label }}
|
||||||
|
</div>
|
||||||
|
<div v-if="!(item[0].label == '拜访终端名称')" class="viewvalue">
|
||||||
|
{{ item[0].value }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="item[1] && !(item[1].label == '拜访终端名称')"
|
||||||
|
class="viewlabel"
|
||||||
|
>
|
||||||
|
{{ item[1].label }}
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
v-if="item[1] && !(item[1].label == '拜访终端名称')"
|
||||||
|
class="viewvalue"
|
||||||
|
>
|
||||||
|
{{ item[1].value }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</n-scrollbar>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<n-divider class="divider-line" />
|
||||||
|
<div class="btnlist">
|
||||||
|
<n-button type="info" @click="passfun"> 通过 </n-button>
|
||||||
|
<n-button type="error" @click="nopassfun"> 不通过</n-button>
|
||||||
|
<n-button @click="closeModal">取消</n-button>
|
||||||
|
</div>
|
||||||
|
</n-card>
|
||||||
|
</n-modal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.wrapper {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
border-bottom: 1px solid #e8e8e8;
|
||||||
|
padding-bottom: 32px;
|
||||||
|
|
||||||
|
&-title {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-bar {
|
||||||
|
width: 100%;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-footer {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
&-info {
|
||||||
|
font-weight: bold;
|
||||||
|
position: relative;
|
||||||
|
color: #333333;
|
||||||
|
font-size: 14px;
|
||||||
|
|
||||||
|
&:before {
|
||||||
|
background-color: #507afd;
|
||||||
|
content: "";
|
||||||
|
width: 5px;
|
||||||
|
border-radius: 2px;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0;
|
||||||
|
position: absolute;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.dragcardStyle {
|
||||||
|
--n-padding-bottom: 0px !important;
|
||||||
|
--n-padding-left: 0px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cardstyle {
|
||||||
|
width: 1200px;
|
||||||
|
height: 678px;
|
||||||
|
--n-padding-bottom: 20px;
|
||||||
|
--n-padding-left: 24px;
|
||||||
|
}
|
||||||
|
.left{
|
||||||
|
width: 65%;
|
||||||
|
height: 456px;
|
||||||
|
// flex: 0.6;
|
||||||
|
background-size: auto 100%;
|
||||||
|
background-position: center;
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
border-radius: 8px;
|
||||||
|
position: relative;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
.right{
|
||||||
|
width: 30%;
|
||||||
|
//flex:0.4;
|
||||||
|
margin-left: 16px;
|
||||||
|
height: 463px;
|
||||||
|
.viewlabel {
|
||||||
|
margin-top: 10px;
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
|
font-weight: Regular;
|
||||||
|
text-align: left;
|
||||||
|
color: #999999;
|
||||||
|
line-height: 20px;
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
.viewvalue {
|
||||||
|
font-size: 14px;
|
||||||
|
font-family: PingFang SC, PingFang SC-Regular;
|
||||||
|
font-weight: Regular;
|
||||||
|
text-align: left;
|
||||||
|
color: #333333;
|
||||||
|
line-height: 20px;
|
||||||
|
height: 100%;
|
||||||
|
margin: 3px 0 10px 0;
|
||||||
|
max-width: 650px;
|
||||||
|
}
|
||||||
|
.tags {
|
||||||
|
display: flex;
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag {
|
||||||
|
border: 1px solid #d8d8d8;
|
||||||
|
box-sizing: border-box;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: #666666;
|
||||||
|
margin-right: 12px;
|
||||||
|
padding: 4px 8px;
|
||||||
|
font-size: 12px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-submited {
|
||||||
|
color: #507afd;
|
||||||
|
border: 1px solid #507afd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-submiting {
|
||||||
|
color: #ffb800;
|
||||||
|
border: 1px solid #ffb800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-passed {
|
||||||
|
color: #02c984;
|
||||||
|
border: 1px solid #02c984;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-not-passed {
|
||||||
|
color: #ff7575;
|
||||||
|
border: 1px solid #ff7575;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tag-approved {
|
||||||
|
color: #507afd;
|
||||||
|
border: 1px solid #507afd;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.textbtnStyle {
|
||||||
|
cursor: pointer;
|
||||||
|
color: #1980ff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btnlist{
|
||||||
|
width: 220px;
|
||||||
|
display: flex;
|
||||||
|
float: right;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep(.n-card.n-card--content-segmented > .n-card__content:not(:first-child)) {
|
||||||
|
border: 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep(.n-card > .n-card-header) {
|
||||||
|
--n-padding-top: 0px;
|
||||||
|
--n-padding-bottom: 12px;
|
||||||
|
}
|
||||||
|
::v-deep(.n-card > .n-card-header .n-card-header__main) {
|
||||||
|
font-weight: lighter !important;
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
::v-deep(.n-scrollbar) {
|
||||||
|
border-top: none !important;
|
||||||
|
}
|
||||||
|
::v-deep(.n-button--info-type) {
|
||||||
|
background: #507afd !important;
|
||||||
|
}
|
||||||
|
::v-deep(.checkAll .n-checkbox.n-checkbox--indeterminate .n-checkbox-box) {
|
||||||
|
background: none;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
::v-deep(.checkAll .n-checkbox-box__border) {
|
||||||
|
border: 1px solid #e8e8e8 !important;
|
||||||
|
}
|
||||||
|
::v-deep(.checkAll .n-checkbox-icon) {
|
||||||
|
border: 3px solid #fff;
|
||||||
|
background: #1980ff;
|
||||||
|
}
|
||||||
|
::v-deep(.checkAll .n-checkbox-icon svg) {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
::v-deep(.n-card-header__main) {
|
||||||
|
color: #666 !important;
|
||||||
|
}
|
||||||
|
::v-deep(.n-button--secondary) {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #cad2dd !important;
|
||||||
|
}
|
||||||
|
::v-deep(.n-button--secondary):hover {
|
||||||
|
background-color: #fff !important;
|
||||||
|
border: 1px solid #cad2dd !important;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue