Files
xl-mobile/src/pages/taskDetails/components/MyBackfill.vue

227 lines
7.7 KiB
Vue
Raw Normal View History

2025-03-28 15:34:00 +08:00
<script setup>
2025-06-20 21:21:58 +08:00
import {defineEmits, reactive, ref, watch, onMounted, nextTick} from "vue";
2025-05-19 19:03:53 +08:00
import XLink from "../../../components/XLink.vue";
import XUpload from "../../../components/XUpload.vue";
import XInput from "../../../components/XInput.vue";
import Api from "../../../api/index.js";
import {showToast} from "../../../utils/uils.js";
import dayjs from "dayjs";
import XCountdown from "../../../components/XCountdown.vue";
2025-06-10 20:43:15 +08:00
import XImage from "../../../components/XImage.vue";
2025-06-13 21:01:33 +08:00
import Resubmit from "./Resubmit.vue";
import ReplyMessageModal from "./replyMessageModal.vue";
2025-03-28 15:34:00 +08:00
2025-06-13 21:01:33 +08:00
const emits = defineEmits(['success']);
2025-05-19 19:03:53 +08:00
const {data} = defineProps({
data: {
type: Object,
default: null,
}
});
const content = reactive([]);
const current = ref(0);
const success = async () => {
const {msg} = await Api.system.addTaskBackfill({
id: data.children.id,
cid: current.value + 1,
2025-06-20 21:21:58 +08:00
content: content.flat(),
2025-05-19 19:03:53 +08:00
type: data.task_content[current.value].is_image,
});
showToast(msg);
2025-06-13 21:01:33 +08:00
emits('success');
2025-05-19 19:03:53 +08:00
}
watch(
() => [data, current],
() => {
2025-06-10 14:04:16 +08:00
if (data.children.back[current.value]?.content_arr) {
2025-06-20 21:21:58 +08:00
setTimeout(() => {
content.length = 0;
content.push(...data.children.back[current.value].content_arr.map(v => [v]));
}, 100);
2025-06-10 14:04:16 +08:00
}
2025-05-19 19:03:53 +08:00
},
{deep: true, immediate: true}
)
2025-06-20 21:21:58 +08:00
const initContent = () => {
content.length = 0;
data.task_content[current.value].data.forEach(v => {
content.push([]);
})
}
onMounted(() => {
initContent();
})
2025-03-28 15:34:00 +08:00
</script>
<template>
<!--我的回填-->
2025-05-19 19:03:53 +08:00
<view class="!flex gap-[24rpx] !mb-[28rpx]">
<view
v-for="(item,index) in data.task_content"
2025-06-20 21:21:58 +08:00
@click="() => {current=index;initContent()}"
2025-05-19 19:03:53 +08:00
:class="['tab-item', index===current?'cur':'']">
回填{{ index + 1 }}
</view>
</view>
<view class="block">
<view class="block-title">
回填指引:
</view>
<view class="block-info">
2025-06-10 20:43:15 +08:00
<x-image :src="data.task_content[current].ts_images_arr[0]"
:list="data.task_content[current].ts_images_arr">
<x-link>查看指引</x-link>
</x-image>
2025-05-19 19:03:53 +08:00
</view>
</view>
<view class="block">
<view class="block-title">
回填时间:
</view>
<view class="block-info">
2025-06-13 21:01:33 +08:00
{{ dayjs(data.task_content[current].start_time).format('YYYY-MM-DD HH:mm') }}
{{ dayjs(data.task_content[current].end_time).format('YYYY-MM-DD HH:mm') }}
2025-05-19 19:03:53 +08:00
</view>
</view>
2025-04-07 18:04:39 +08:00
2025-05-19 19:03:53 +08:00
<view class="block">
<view class="block-title">
倒计时:
</view>
<view class="block-info">
2025-06-13 21:01:33 +08:00
<view v-if="data.children.back[current]">/</view>
<x-countdown v-else :time="dayjs(data.task_content[current].end_time)">
2025-05-19 19:03:53 +08:00
</x-countdown>
</view>
</view>
2025-06-20 21:21:58 +08:00
<view class="block" v-for="(v, index) in data.task_content[current].data">
2025-05-19 19:03:53 +08:00
<view class="block-title">
2025-06-20 21:21:58 +08:00
{{ v.name }}:
2025-05-19 19:03:53 +08:00
</view>
<view class="block-info">
<x-upload
2025-06-13 21:01:33 +08:00
:del="data.children.back[current]"
:single="true"
2025-06-20 21:21:58 +08:00
v-model:files="content[index]"
v-if="v.is_image === 1">
2025-05-19 19:03:53 +08:00
</x-upload>
<x-input v-else v-model:model-value="content[index]" height="64rpx" placeholder="请输入内容"></x-input>
</view>
</view>
2025-06-13 21:01:33 +08:00
<template v-if="data.children.back[current]">
2025-06-16 20:54:42 +08:00
<view class="text-[#165DFF] test-24r py-[32rpx]" v-if="data.children.back[current]?.status === 1">
2025-06-21 15:38:38 +08:00
{{ dayjs(data.children.back[current].back_time * 1000).format('YYYY-MM-DD HH:mm') }}已提交审核通过
2025-06-13 21:01:33 +08:00
</view>
2025-06-16 20:54:42 +08:00
<template v-if="data.children.back[current]?.status === 2">
<view class="text-[#165DFF] test-24r py-[32rpx]" v-if="data.children.back[current]?.operate === 1">
2025-06-21 15:38:38 +08:00
<view>{{
dayjs(data.children.back[current].back_time * 1000).format('YYYY-MM-DD HH:mm')
}}已提交审核拒绝
</view>
2025-06-13 21:01:33 +08:00
<view>请请点击审核沟通查看修改建议</view>
<view>
并于{{ dayjs(data.children.back[current].end_time * 1000).format('YYYY-MM-DD HH:mm') }}前点击下方重新提交本次回填
</view>
</view>
2025-06-16 20:54:42 +08:00
<view class="text-[#165DFF] test-24r py-[32rpx]" v-if="data.children.back[current]?.operate === 2">
2025-06-21 15:38:38 +08:00
<view>{{
dayjs(data.children.back[current].back_time * 1000).format('YYYY-MM-DD HH:mm')
}}已提交审核拒绝
</view>
2025-06-13 21:01:33 +08:00
<view>请请点击审核沟通查看修改建议</view>
<view>
并于{{
dayjs(data.children.back[current].end_time * 1000).format('YYYY-MM-DD HH:mm')
}}前点击下方回复按照要求进行回复
</view>
</view>
</template>
<view class="text-[#165DFF] test-24r py-[32rpx]"
2025-06-16 20:54:42 +08:00
v-if="data.children.back[current]?.status === 0">
2025-06-21 15:38:38 +08:00
{{ dayjs(data.children.back[current].back_time * 1000).format('YYYY-MM-DD HH:mm') }}已提交审核中
2025-06-13 21:01:33 +08:00
</view>
<view class="text-[#165DFF] test-24r py-[32rpx]"
2025-06-16 20:54:42 +08:00
v-if="data.children.back[current]?.status === -1">
2025-06-21 15:38:38 +08:00
{{ dayjs(data.children.back[current].back_time * 1000).format('YYYY-MM-DD HH:mm') }}已提交审核失败
2025-06-13 21:01:33 +08:00
</view>
</template>
<template
2025-06-20 21:21:58 +08:00
v-if="!data.children.back[current] || data.children.back[current]?.operate === 0 || data.children.back[current]?.operate === 3">
<tui-button @click="success"
2025-06-21 15:38:38 +08:00
:disabled="data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1 || data.children.back[current]?.status === 1">
2025-06-13 21:01:33 +08:00
{{
2025-06-21 15:38:38 +08:00
data.children.back[current]?.status === 0 || data.children.back[current]?.status === -1 || data.children.back[current]?.status === 1 ? '已提交' : '提交'
2025-06-13 21:01:33 +08:00
}}
</tui-button>
</template>
<template v-else>
<view class="!flex !w-full gap-[30rpx]">
<view class="!w-[50%]">
<tui-button disabled>已提交</tui-button>
</view>
2025-06-16 20:54:42 +08:00
<view class="!w-[50%]" v-if="data.children.back[current]?.operate === 1">
2025-06-13 21:01:33 +08:00
<resubmit :data="data" :current="current" @success="emits('success')">
<tui-button>重新提交</tui-button>
</resubmit>
</view>
2025-06-16 20:54:42 +08:00
<view class="!w-[50%]" v-if="data.children.back[current]?.operate === 2">
2025-06-13 21:01:33 +08:00
<reply-message-modal :data="data" @success="emits('success')" :backId="data.children.back[current].id">
<tui-button>回复</tui-button>
</reply-message-modal>
</view>
</view>
</template>
2025-03-28 15:34:00 +08:00
</template>
<style scoped lang="scss">
2025-05-19 19:03:53 +08:00
.tab-item {
padding: 12rpx 26rpx;
border-radius: 9999rpx;
background-color: #F7F8FA;
font-size: 24rpx;
color: #4E5969;
transition: 500ms;
}
.cur {
background-color: #E8F3FF;
color: #165DFF;
}
.block {
display: flex;
gap: 20rpx;
margin-bottom: 20rpx;
.block-title {
flex-shrink: 0;
color: rgb(134, 144, 156);
font-size: 24rpx;
font-weight: 500;
line-height: 140%;
letter-spacing: 0;
text-align: left;
width: 160rpx;
}
2025-03-28 15:34:00 +08:00
2025-05-19 19:03:53 +08:00
.block-info {
color: rgb(78, 89, 105);
font-size: 24rpx;
font-weight: 500;
line-height: 140%;
letter-spacing: 0;
}
}
2025-03-28 15:34:00 +08:00
</style>