pull/1/head
Dragon 1 year ago
parent ba7add68c0
commit 1cdebc153a

1
components.d.ts vendored

@ -33,6 +33,7 @@ declare module 'vue' {
NMessageProvider: typeof import('naive-ui')['NMessageProvider'] NMessageProvider: typeof import('naive-ui')['NMessageProvider']
NModal: typeof import('naive-ui')['NModal'] NModal: typeof import('naive-ui')['NModal']
NNotificationProvider: typeof import('naive-ui')['NNotificationProvider'] NNotificationProvider: typeof import('naive-ui')['NNotificationProvider']
NotPassed: typeof import('./src/components/NotPassed.vue')['default']
NPopover: typeof import('naive-ui')['NPopover'] NPopover: typeof import('naive-ui')['NPopover']
NPopselect: typeof import('naive-ui')['NPopselect'] NPopselect: typeof import('naive-ui')['NPopselect']
NScrollbar: typeof import('naive-ui')['NScrollbar'] NScrollbar: typeof import('naive-ui')['NScrollbar']

@ -49,3 +49,15 @@ export async function resetApproval(params: ResetParam) {
params, params,
}) })
} }
/**
*
* @param params
* @returns
*/
export async function repetitionTask() {
return http.request({
url: `/flow/task/repetitionTask`,
method: 'get',
})
}

@ -0,0 +1,213 @@
<script lang="ts" setup>
import { computed, onBeforeMount, reactive, ref, toRefs, unref } from 'vue'
import { useDictionary } from '@/store/modules/dictonary'
import { audit } from '@/api/task/task'
const emit = defineEmits<{
(e: 'commit', rejectId: any, backId: any, isOther: boolean)
}>()
const dictonaryStore = useDictionary()
const state: any = reactive({
detail: {},
})
const { detail } = toRefs(state)
const show = ref(false)
const cardStyle = {
'width': '520px',
'--n-padding-bottom': '10px',
'--n-padding-left': '0px',
}
function showModal(value) {
state.detail = value
show.value = true
}
function closeModal() {
show.value = false
}
defineExpose({
showModal,
})
const backOptions = ref<any[]>([])
const reasonOptions = ref<any[]>([])
const selectBackId = ref(null)
const selectRejectId = ref(null)
const selectItem = ref(null)
const otherValue = ref(null)
const showOther = computed(() => {
return (selectItem.value as any)?.label === '其他'
})
const comomitValue = computed(() => {
return (selectItem.value as any)?.label === '其他' ? otherValue.value : selectRejectId.value
})
async function handleSumbit(e: MouseEvent) {
e.preventDefault()
closeModal()
// selectRejectId.value === 'other'
// emit('commit', unref(comomitValue), unref(selectBackId), showOther.value)
console.log(state.detail)
// const param = {
// formid: formIds,
// taskId: taskIds,
// approvd: false,
// taskComment: idOrDesc,
// taskname: isOther ? tasknames : [''],
// }
// audit(param).then((res) => {
// const { code } = res
// if (code === 'OK')
// reload()
// else message.error(res.message)
// })
}
onBeforeMount(async () => {
const rejectList = await dictonaryStore.fetchTFList()
const backList = await dictonaryStore.fetchBackList()
reasonOptions.value = rejectList
backOptions.value = backList
// TODO name=
//
// reasonOptions.value.push({
// label: '',
// value: 'other',
// })
})
async function selectChange(id) {
console.log(id, 'selectChange')
selectItem.value = reasonOptions.value.find(v => v.id == id)
}
</script>
<template>
<n-modal v-model:show="show" transform-origin="center">
<n-card :style="cardStyle" :bordered="false" size="huge" role="dialog" aria-modal="true">
<div class="wrapper">
<div class="wrapper-header">
<span class="wrapper-left">选择不通过原因</span>
<div class="wrapper-right">
<div class="wrapper-right-close" @pointerdown="closeModal">
<div class="wrapper-right-icon" />
</div>
</div>
</div>
<div class="wrapper-content">
<span>处理方式</span>
<n-select v-model:value="selectBackId" filterable style="margin-top: 10px;" :options="backOptions" />
</div>
<div class="wrapper-content">
<span>不通过原因</span>
<n-select v-model:value="selectRejectId" filterable style="margin-top: 10px;" :options="reasonOptions" @change="selectChange" />
<n-input v-show="showOther" v-model:value="otherValue" type="textarea" placeholder="备注内容" style="margin-top: 10px;" />
</div>
<!-- <div class="wrapper-content">
<n-input
type="textarea"
placeholder="备注内容" v-model="showOther"></n-input>
</div> -->
</div>
<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>
</div>
</template>
</n-card>
</n-modal>
</template>
<style lang="less" scoped>
.wrapper {
&-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px;
}
&-left {
font-weight: bold;
font-size: 16px;
}
&-right {
&-close {
width: 18px;
height: 18px;
cursor: pointer;
}
&-icon {
background: #000;
display: inline-block;
width: 18px;
height: 1px;
transform: rotate(45deg);
-webkit-transform: rotate(45deg);
margin-bottom: 8px;
&:after {
content: '';
display: block;
width: 18px;
height: 1px;
background: #000;
transform: rotate(-90deg);
-webkit-transform: rotate(-90deg);
}
}
}
&-content {
padding: 18px 10px;
}
&-footer {
display: flex;
justify-content: flex-end;
}
&-info {
font-weight: bold;
position: relative;
&:before {
background-color: #1980ff;
content: '';
width: 5px;
border-radius: 2px;
top: 0;
bottom: 0;
position: absolute;
}
}
}
::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-divider:not(.n-divider--vertical)) {
margin-top: 0px;
margin-bottom: 0px;
}
</style>

@ -7,8 +7,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import { debounce, throttle } from 'lodash-es' import { debounce, throttle } from 'lodash-es'
import imagesloaded from 'imagesloaded' import imagesloaded from 'imagesloaded'
import { randomInt } from '@/utils/index' import { randomInt } from '@/utils/index'
import { timeOptions, viewOptions } from '@/config/home' import { viewOptions } from '@/config/home'
import { getPictureList } from '@/api/home/main'
import { dubiousfilelist, removeFiles } from '@/api/task/task' import { dubiousfilelist, removeFiles } from '@/api/task/task'
import { off, on } from '@/utils/domUtils' import { off, on } from '@/utils/domUtils'
@ -24,7 +23,15 @@ const cardStyle = {
} }
const message = useMessage() const message = useMessage()
const timeRange = ref('all') const timeRange = ref('')
const check = ref(false)
const timeOptions = [{
label: '升序',
value: 'asc',
}, {
label: '降序',
value: 'desc',
}]
const timeLabel = computed(() => { const timeLabel = computed(() => {
const item = timeOptions.find((option) => { const item = timeOptions.find((option) => {
return option.value === timeRange.value return option.value === timeRange.value
@ -102,7 +109,7 @@ function randomUrl() {
async function featchList() { async function featchList() {
loading = true loading = true
try { try {
const result = await dubiousfilelist({ ...pagination, search_month: '', search_history: '0' }) const result = await dubiousfilelist({ ...pagination, orderbyname: timeRange.value })
// TODO // TODO
// result.data = Array.from({ length: 30 }) // result.data = Array.from({ length: 30 })
result.pageCount = 1 result.pageCount = 1
@ -233,7 +240,6 @@ function afterLeave() {
} }
onMounted(() => { onMounted(() => {
console.log(789)
show.value && addListeners() show.value && addListeners()
}) })
@ -244,6 +250,12 @@ async function showModal() {
listData.value = list listData.value = list
} }
async function onChange() {
pagination.pageNo = 1
const list = await featchList()
listData.value = list
}
function closeModal(event: MouseEvent) { function closeModal(event: MouseEvent) {
show.value = false show.value = false
} }
@ -258,8 +270,29 @@ async function remove() {
return return
} }
const ids = arr.map(item => item.pictureid).join(',') const ids = arr.map(item => item.id).join(',')
const res = await removeFiles({ pictureid: ids }) const res = await removeFiles({ pictureid: ids })
if (res.code === 'OK') {
message.success('移除成功')
pagination.pageNo = 1
const list = await featchList()
listData.value = list
}
}
function getPercent(pictureid: string, item) {
console.log(item)
const { ocpictureid, pictureresult } = item
const splitId = ocpictureid || ''
const index = splitId.split(',').indexOf(String(pictureid))
const results = (pictureresult || '').split(',')
const percent = results[index] || '0'
const val = Number.parseFloat(percent)
return `${val}%`
}
function showCheck() {
check.value = true
} }
defineExpose({ defineExpose({
@ -279,7 +312,7 @@ function onCheckChange(val: any, item: any) {
@after-enter="afterEnter" @after-leave="afterLeave" @after-enter="afterEnter" @after-leave="afterLeave"
> >
<n-card <n-card
:style="cardStyle" class="card" style="position: fixed;top:64px" :bordered="false" size="huge" role="dialog" :style="cardStyle" class="card card-1" style="position: fixed;top:64px" :bordered="false" size="huge" role="dialog"
aria-modal="true" aria-modal="true"
> >
<div class="wrapper"> <div class="wrapper">
@ -294,9 +327,9 @@ function onCheckChange(val: any, item: any) {
<div class="wrapper-content"> <div class="wrapper-content">
<div class="wrapper-content-form wrapper-m32"> <div class="wrapper-content-form wrapper-m32">
<div> <div>
<n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click"> <n-popselect v-model:value="timeRange" :options="timeOptions" trigger="click" @change="onChange">
<div class="wrapper-content-form-dropdown"> <div class="wrapper-content-form-dropdown">
<span>{{ timeLabel || '时间模式' }}</span> <span>{{ timeLabel || '时间排序' }}</span>
<SvgIcon class="wrapper-content-form-dropdown-gap" name="arrow-botton" size="14" /> <SvgIcon class="wrapper-content-form-dropdown-gap" name="arrow-botton" size="14" />
</div> </div>
</n-popselect> </n-popselect>
@ -311,7 +344,7 @@ function onCheckChange(val: any, item: any) {
<div class="remove" @click="remove"> <div class="remove" @click="remove">
移除可疑文件夹 移除可疑文件夹
</div> </div>
<div class="wrapper-content-form-button"> <div class="wrapper-content-form-button" @click="showCheck">
<SvgIcon style="margin-right: 6px;" size="14" name="tf" /> <SvgIcon style="margin-right: 6px;" size="14" name="tf" />
批量审批 批量审批
</div> </div>
@ -322,8 +355,8 @@ function onCheckChange(val: any, item: any) {
<!-- <n-scrollbar :on-scroll="scrollHandler"> --> <!-- <n-scrollbar :on-scroll="scrollHandler"> -->
<div ref="masonryRef" class="grid"> <div ref="masonryRef" class="grid">
<div <div
v-for="(item, index) in listData" :key="index" :data-id="index" v-for="(item, index) in listData" :key="item.id" :data-id="item.id"
:class="{ 'grid-item-selected': isSelected(index) }" :style="{ height: gridHeight }" class="grid-item" :class="{ 'grid-item-selected': isSelected(item.id) }" :style="{ height: gridHeight }" class="grid-item"
> >
<!-- <img <!-- <img
class="wrapper-content-item-img" class="wrapper-content-item-img"
@ -335,10 +368,14 @@ function onCheckChange(val: any, item: any) {
:class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }" :class="{ 'img-fit': viewMode === 'horizontalVersion', 'img-full': viewMode === '3:4' || viewMode === 'verticalVersion' }"
/> />
<n-checkbox <n-checkbox
v-if="check"
v-model:checked="item.checked" v-model:checked="item.checked"
style="position:absolute;left:20px;top:20px" @click.prevent style="position:absolute;left:20px;top:20px" @click.prevent
@update:checked="onCheckChange($event, item)" @update:checked="onCheckChange($event, item)"
/> />
<!-- <div class="percent">
{{ getPercent(item.pictureid, item) }}
</div> -->
</div> </div>
</div> </div>
<!-- </n-scrollbar> --> <!-- </n-scrollbar> -->
@ -359,6 +396,9 @@ function onCheckChange(val: any, item: any) {
width: 100vw; width: 100vw;
height: calc(100vh - 64px); height: calc(100vh - 64px);
user-select: none; user-select: none;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
/* Standard syntax */ /* Standard syntax */
} }
@ -394,6 +434,10 @@ function onCheckChange(val: any, item: any) {
} }
} }
.img{
border-radius: 8px;
}
.wrapper { .wrapper {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -460,6 +504,21 @@ function onCheckChange(val: any, item: any) {
.grid-item { .grid-item {
width: 214px; width: 214px;
padding: 16px; padding: 16px;
position: relative;
}
.percent {
position: absolute;
text-align: center;
width: 35px;
height: 18px;
opacity: 0.9;
background: #6f92fd;
border-radius: 6px 0px 6px 0px;
z-index: 5;
right: 22px;
top: 22px;
color: #fff;
} }
.grid-item-selected { .grid-item-selected {
@ -467,12 +526,16 @@ function onCheckChange(val: any, item: any) {
} }
.scroll { .scroll {
overflow-y: scroll; overflow-y: auto;
height: calc(100vh - 282px); height: calc(100vh - 282px);
} }
} }
} }
.wrapper-content-form-button{
cursor: pointer;
}
.img-fit { .img-fit {
width: 100%; width: 100%;
overflow: hidden; overflow: hidden;

@ -1,5 +1,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { reactive, ref, toRefs } from 'vue'
import { repetitionTask } from '@/api/final/index'
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'reject', params: any) (e: 'reject', params: any)
@ -11,13 +13,33 @@ const cardStyle = {
'--n-padding-bottom': '10px', '--n-padding-bottom': '10px',
'--n-padding-left': '0px', '--n-padding-left': '0px',
} }
const state: any = reactive({
detail: [],
total: 0,
taskId: '',
})
const { detail, total } = toRefs(state)
const show = ref(false) const show = ref(false)
function showModal() { function showModal(id) {
show.value = true getDetail(id)
} }
async function getDetail(id) {
const res = await repetitionTask()
if (res.code === 'OK') {
state.detail = res.data
state.detail.forEach((item) => {
state.total += item.count
})
show.value = true
}
}
// function showModal() {
// show.value = true
// }
function closeModal() { function closeModal() {
show.value = false show.value = false
} }
@ -47,24 +69,25 @@ defineExpose({
</div> </div>
<div class="wrapper-header"> <div class="wrapper-header">
<span style="font-weight: bold;">任务小结重复任务</span> <span style="font-weight: bold;">任务小结重复任务</span>
<span><span class="count">18</span></span> <span><span class="count">{{ total }}</span></span>
</div> </div>
<div class="wrapper-content"> <div class="wrapper-content">
<n-scrollbar style="max-height: 200px;"> <n-scrollbar style="max-height: 200px;">
<div v-for="i in 2" :key="i" class="item"> <div v-for="item in detail" :key="item.id" class="item">
<div class="imgwrapper" /> <!-- <div class="imgwrapper" /> -->
<img class="imgwrapper" :src="item.imgUrl">
<n-grid x-gap="12" y-gap="0" :cols="12"> <n-grid x-gap="12" y-gap="0" :cols="12">
<n-gi span="4"> <n-gi span="4">
<span style="color:#8b8d8f;">任务小结内容:</span> <span style="color:#8b8d8f;">任务小结内容:</span>
</n-gi> </n-gi>
<n-gi span="8"> <n-gi span="8">
<span>今日去拜访中日友好医院今日去拜访中日友好医院今日去</span> <span>{{ item.content }}</span>
</n-gi> </n-gi>
<n-gi span="4"> <n-gi span="4">
<span style="color:#8b8d8f;">任务重复数量</span> <span style="color:#8b8d8f;">任务重复数量</span>
</n-gi> </n-gi>
<n-gi span="8"> <n-gi span="8">
<span><span class="count">18</span></span> <span><span class="count">{{ item.count }}</span></span>
</n-gi> </n-gi>
</n-grid> </n-grid>
</div> </div>
@ -112,9 +135,9 @@ defineExpose({
height: 70px; height: 70px;
margin-right: 20px; margin-right: 20px;
border-radius: 8px; border-radius: 8px;
background-image: url('../../../assets/images/test.png'); // background-image: url('../../../assets/images/test.png');
background-repeat: no-repeat; // background-repeat: no-repeat;
background-size: cover; // background-size: cover;
} }
.item { .item {

@ -237,8 +237,9 @@ function backHandler() {
async function handleDragEnd(event, item) { async function handleDragEnd(event, item) {
// //
const flag = taskStore.getInFile const flag = taskStore.getInFile
console.log(item)
if (flag) { if (flag) {
const res = await dubiousfileyd({ taskchildid: item.id }) const res = await dubiousfileyd({ pictureid: item.pictureid })
if (res.code === 'OK') { if (res.code === 'OK') {
message.success('加入成功') message.success('加入成功')
getTableData() getTableData()

@ -3,6 +3,7 @@ import { useInfiniteScroll } from '@vueuse/core'
import { reactive, ref, unref, watch } from 'vue' import { reactive, ref, unref, watch } from 'vue'
import ApprovalModal from '../modal/ApprovalModal.vue' import ApprovalModal from '../modal/ApprovalModal.vue'
import ListItem from './ListItem.vue' import ListItem from './ListItem.vue'
import NotPassed from '@/components/NotPassed.vue'
import type { PackageListItem } from '/#/workorder' import type { PackageListItem } from '/#/workorder'
import { isEmpty } from '@/utils' import { isEmpty } from '@/utils'
import { useWorkOrder } from '@/store/modules/workOrder' import { useWorkOrder } from '@/store/modules/workOrder'
@ -27,6 +28,7 @@ const pagination = reactive({
}) })
const approvalModalRef = ref(null) const approvalModalRef = ref(null)
const notPassedRef: any = ref(null)
function showModal(modalRef: any, id) { function showModal(modalRef: any, id) {
const modal = unref(modalRef)! as any const modal = unref(modalRef)! as any
@ -34,8 +36,6 @@ function showModal(modalRef: any, id) {
} }
function selectHandler(id: string, index: number) { function selectHandler(id: string, index: number) {
console.log(id)
console.log(777)
workStore.setActive(index) workStore.setActive(index)
showModal(approvalModalRef, id) showModal(approvalModalRef, id)
} }
@ -102,6 +102,10 @@ function reset() {
workStore.reset() workStore.reset()
} }
function notPass(value) {
notPassedRef.value.showModal(value)
}
async function search(word: string) { async function search(word: string) {
keyword.value = word keyword.value = word
reset() reset()
@ -120,8 +124,8 @@ defineExpose({
</script> </script>
<template> <template>
<ApprovalModal ref="approvalModalRef" /> <ApprovalModal ref="approvalModalRef" @not-pass="notPass" />
<NotPassed ref="notPassedRef" />
<n-spin :show="isLoading"> <n-spin :show="isLoading">
<div ref="el" class="list"> <div ref="el" class="list">
<ListItem <ListItem

@ -6,7 +6,7 @@ import { aiApprovaltools, aiApprovaltoolsClearmark } from '@/api/work/work'
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'reject', params: any) (e: 'reject', params: any)
(e: 'viewrepeat') (e: 'notPass', params: any)
}>() }>()
const dialog = useDialog() const dialog = useDialog()
@ -68,7 +68,7 @@ async function reject() {
} }
async function viewRepeat(e: MouseEvent) { async function viewRepeat(e: MouseEvent) {
emit('viewrepeat') emit('notPass', state.detail)
e.preventDefault() e.preventDefault()
closeModal() closeModal()
} }

Loading…
Cancel
Save