|
@@ -15,6 +15,7 @@ import dayjs from 'dayjs'
|
|
import { DataFormSchema } from '../../../../components/data-form'
|
|
import { DataFormSchema } from '../../../../components/data-form'
|
|
import { ComponentExposed } from 'vue-component-type-helpers'
|
|
import { ComponentExposed } from 'vue-component-type-helpers'
|
|
import { useTask } from '../../../../composables/task'
|
|
import { useTask } from '../../../../composables/task'
|
|
|
|
+import { requestToast } from '@designer-hub/app/src/core/utils/common'
|
|
|
|
|
|
const { getBgClass, getColor, getTypeTitle, getBgStyle } = useTask()
|
|
const { getBgClass, getColor, getTypeTitle, getBgStyle } = useTask()
|
|
const taskId = ref()
|
|
const taskId = ref()
|
|
@@ -51,41 +52,46 @@ const customerRules = ref({
|
|
const initData = async () => {
|
|
const initData = async () => {
|
|
await setTaskDetails()
|
|
await setTaskDetails()
|
|
}
|
|
}
|
|
-const submitTask = async (data) => {
|
|
|
|
- uni.showLoading()
|
|
|
|
- const { valid } = await dataFormRef.value.validate()
|
|
|
|
|
|
+const submitTask = async () => {
|
|
|
|
+ await uni.showLoading()
|
|
|
|
+ const { valid } = await dataFormRef.value!.validate()
|
|
if (!valid) {
|
|
if (!valid) {
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
return
|
|
return
|
|
}
|
|
}
|
|
console.log(formData.value)
|
|
console.log(formData.value)
|
|
- const res = await appTaskReport({
|
|
|
|
- brokerId: userInfo.value.userId,
|
|
|
|
- taskId: taskId.value,
|
|
|
|
- ...formData.value,
|
|
|
|
- })
|
|
|
|
|
|
+ await requestToast(
|
|
|
|
+ () =>
|
|
|
|
+ appTaskReport({
|
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
|
+ taskId: taskId.value,
|
|
|
|
+ ...formData.value,
|
|
|
|
+ }),
|
|
|
|
+ { success: true, successTitle: '上报成功' },
|
|
|
|
+ )
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
|
|
+ await setTaskDetails()
|
|
publishState.value = false
|
|
publishState.value = false
|
|
}
|
|
}
|
|
const acceptingOrders = async () => {
|
|
const acceptingOrders = async () => {
|
|
- uni.showLoading()
|
|
|
|
|
|
+ await uni.showLoading()
|
|
const res = await taskReceive({
|
|
const res = await taskReceive({
|
|
brokerId: userInfo.value.userId,
|
|
brokerId: userInfo.value.userId,
|
|
taskId: taskDetails.value.id,
|
|
taskId: taskDetails.value.id,
|
|
orders: true,
|
|
orders: true,
|
|
})
|
|
})
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
- initData()
|
|
|
|
|
|
+ await initData()
|
|
}
|
|
}
|
|
const acceptingNoOrders = async () => {
|
|
const acceptingNoOrders = async () => {
|
|
- uni.showLoading()
|
|
|
|
|
|
+ await uni.showLoading()
|
|
const res = await taskReceive({
|
|
const res = await taskReceive({
|
|
brokerId: userInfo.value.userId,
|
|
brokerId: userInfo.value.userId,
|
|
taskId: taskDetails.value.id,
|
|
taskId: taskDetails.value.id,
|
|
orders: false,
|
|
orders: false,
|
|
})
|
|
})
|
|
uni.hideLoading()
|
|
uni.hideLoading()
|
|
- initData()
|
|
|
|
|
|
+ await initData()
|
|
}
|
|
}
|
|
onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
taskId.value = query?.taskId
|
|
taskId.value = query?.taskId
|
|
@@ -116,14 +122,18 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
<div class="flex flex-row items-center justify-start gap-2">
|
|
<div class="flex flex-row items-center justify-start gap-2">
|
|
<div style="width: 50px; height: 50px">
|
|
<div style="width: 50px; height: 50px">
|
|
<wd-circle
|
|
<wd-circle
|
|
- :model-value="(taskDetails.completedNum / taskDetails.storeQuantity) * 100"
|
|
|
|
|
|
+ :model-value="
|
|
|
|
+ ((taskDetails?.completedNum ?? 0) / (taskDetails?.storeQuantity ?? 0)) * 100
|
|
|
|
+ "
|
|
:size="50"
|
|
:size="50"
|
|
:color="getColor(Number(taskDetails?.taskType))"
|
|
:color="getColor(Number(taskDetails?.taskType))"
|
|
:clockwise="false"
|
|
:clockwise="false"
|
|
>
|
|
>
|
|
<div class="flex flex-col items-center">
|
|
<div class="flex flex-col items-center">
|
|
<div class="w-[29.20px] h-[18.39px] text-black text-sm font-medium font-['DIN']">
|
|
<div class="w-[29.20px] h-[18.39px] text-black text-sm font-medium font-['DIN']">
|
|
- {{ (taskDetails.completedNum / taskDetails.storeQuantity) * 100 }}%
|
|
|
|
|
|
+ {{
|
|
|
|
+ ((taskDetails?.completedNum ?? 0) / (taskDetails?.storeQuantity ?? 0)) * 100
|
|
|
|
+ }}%
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
class="w-[22.71px] h-[10.82px] text-black/60 text-[7px] font-normal font-['PingFang_SC']"
|
|
class="w-[22.71px] h-[10.82px] text-black/60 text-[7px] font-normal font-['PingFang_SC']"
|
|
@@ -161,7 +171,7 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
<div class="flex items-center justify-center flex-col">
|
|
<div class="flex items-center justify-center flex-col">
|
|
<div class="text-black/60 text-xs font-normal font-['PingFang_SC']">累计完成</div>
|
|
<div class="text-black/60 text-xs font-normal font-['PingFang_SC']">累计完成</div>
|
|
<div class="text-black/90 text-lg font-medium font-['DIN'] leading-normal">
|
|
<div class="text-black/90 text-lg font-medium font-['DIN'] leading-normal">
|
|
- {{ taskDetails?.completedNum }}
|
|
|
|
|
|
+ {{ taskDetails?.completedNum ?? 0 }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
@@ -247,26 +257,28 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
<div class="mr-2.5 w-1 h-4 rotate-180 bg-[#2357e9] rounded-[20px]"></div>
|
|
<div class="mr-2.5 w-1 h-4 rotate-180 bg-[#2357e9] rounded-[20px]"></div>
|
|
<SectionHeading title="数据明细" size="base"></SectionHeading>
|
|
<SectionHeading title="数据明细" size="base"></SectionHeading>
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 到店打卡-->
|
|
<div v-if="taskDetails?.finalType == '1'" class="flex flex-col gap-4 mt-5">
|
|
<div v-if="taskDetails?.finalType == '1'" class="flex flex-col gap-4 mt-5">
|
|
- <template v-for="item in taskDetails?.brokerList" :key="item.id">
|
|
|
|
- <div class="flex gap-2.5 p-3.5 bg-[#f7fbff] items-center rounded-[10px]">
|
|
|
|
- <img class="w-11 h-11 rounded-full" :src="item.headImgUrl" />
|
|
|
|
- <div class="flex-1 flex flex-col gap-2">
|
|
|
|
- <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-normal">
|
|
|
|
- {{ item.brokerName }}
|
|
|
|
- </div>
|
|
|
|
- <div class="text-black/30 text-sm font-normal font-['PingFang_SC'] leading-none">
|
|
|
|
- {{ item.finalTypeName }}{{ item.shopNames }}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- <div class="h-full flex items-start">
|
|
|
|
- <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
|
|
- {{ dayjs(item.createTime).format('YYYY/MM/DD HH:mm') }}
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <!-- <template v-for="item in taskDetails?.brokerList" :key="item.id">-->
|
|
|
|
+ <!-- <div class="flex gap-2.5 p-3.5 bg-[#f7fbff] items-center rounded-[10px]">-->
|
|
|
|
+ <!-- <wd-img width="44" height="44" round :src="item.headImgUrl" />-->
|
|
|
|
+ <!-- <div class="flex-1 flex flex-col gap-2">-->
|
|
|
|
+ <!-- <div class="text-black/60 text-sm font-normal font-['PingFang_SC'] leading-normal">-->
|
|
|
|
+ <!-- {{ item.brokerName }}-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- <div class="text-black/30 text-sm font-normal font-['PingFang_SC'] leading-none">-->
|
|
|
|
+ <!-- {{ item.finalTypeName }}{{ item.shopNames }}-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- <div class="h-full flex items-start">-->
|
|
|
|
+ <!-- <div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">-->
|
|
|
|
+ <!-- {{ dayjs(item.createTime).format('YYYY/MM/DD HH:mm') }}-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </div>-->
|
|
|
|
+ <!-- </template>-->
|
|
</div>
|
|
</div>
|
|
|
|
+ <!-- 上报-->
|
|
<div v-else>
|
|
<div v-else>
|
|
<template v-for="(item, i) in taskDetails?.reportList" :key="i">
|
|
<template v-for="(item, i) in taskDetails?.reportList" :key="i">
|
|
<div class="bg-[#f7fbff] rounded-[10px] py-[22px] px-[16px] mt-[20px]">
|
|
<div class="bg-[#f7fbff] rounded-[10px] py-[22px] px-[16px] mt-[20px]">
|
|
@@ -274,8 +286,21 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
<div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
<div class="text-black/40 text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
{{ dayjs(item.createTime).format('YYYY/MM/DD HH:mm') }}
|
|
{{ dayjs(item.createTime).format('YYYY/MM/DD HH:mm') }}
|
|
</div>
|
|
</div>
|
|
- <div class="text-[#2357e9] text-xs font-normal font-['PingFang_SC'] leading-normal">
|
|
|
|
- {{ item.status == '0' ? '审核通过' : item.status == '1' ? '审核中' : '驳回' }}
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="text-xs font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
+ :class="
|
|
|
|
+ { '0': 'text-[#16b032]', '1': 'text-[#2357e9]', '2': 'text-#ff2d2d' }[
|
|
|
|
+ String(item.status)
|
|
|
|
+ ]
|
|
|
|
+ "
|
|
|
|
+ >
|
|
|
|
+ {{
|
|
|
|
+ String(item.status) === '0'
|
|
|
|
+ ? '审核通过'
|
|
|
|
+ : String(item.status) === '1'
|
|
|
|
+ ? '审核中'
|
|
|
|
+ : '驳回'
|
|
|
|
+ }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="mt-[7px]">
|
|
<div class="mt-[7px]">
|
|
@@ -297,6 +322,12 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
{{ item.remark }}
|
|
{{ item.remark }}
|
|
</span>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
|
|
+ <template v-if="String(item.status) === '2'">
|
|
|
|
+ <div class="bg-[#e6e8f1] my-4 border-[0.5px] border-solid border-[#e6e8f1]"></div>
|
|
|
|
+ <div class="text-[#ff2d2d] text-xs font-normal font-['PingFang SC'] leading-none">
|
|
|
|
+ 原因:{{ item.reason }}
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
@@ -328,29 +359,27 @@ onLoad(async (query?: Record<string | 'taskId', string>) => {
|
|
</div>
|
|
</div>
|
|
</BottomAppBar>
|
|
</BottomAppBar>
|
|
</template>
|
|
</template>
|
|
- <template v-else>
|
|
|
|
|
|
+ <template v-if="!taskDetails?.receive && String(taskDetails?.finalType) === '2'">
|
|
<BottomAppBar fixed placeholder>
|
|
<BottomAppBar fixed placeholder>
|
|
- <template v-if="!taskDetails?.receive && String(taskDetails.finalType) === '2'">
|
|
|
|
- <div class="px-5 py-3 bg-[#2357e9] rounded-md justify-center items-center gap-1">
|
|
|
|
- <div
|
|
|
|
- @click="publishState = true"
|
|
|
|
- class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
- >
|
|
|
|
- 上报
|
|
|
|
- </div>
|
|
|
|
|
|
+ <div class="px-5 py-3 bg-[#2357e9] rounded-md justify-center items-center gap-1">
|
|
|
|
+ <div
|
|
|
|
+ @click="publishState = true"
|
|
|
|
+ class="text-center text-white text-base font-normal font-['PingFang_SC'] leading-normal"
|
|
|
|
+ >
|
|
|
|
+ 上报
|
|
</div>
|
|
</div>
|
|
- </template>
|
|
|
|
|
|
+ </div>
|
|
</BottomAppBar>
|
|
</BottomAppBar>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<wd-action-sheet v-model="publishState" title="" @close="publishState = false">
|
|
<wd-action-sheet v-model="publishState" title="" @close="publishState = false">
|
|
<view class="flex flex-col p-4 mt-4">
|
|
<view class="flex flex-col p-4 mt-4">
|
|
- <data-form
|
|
|
|
|
|
+ <DataForm
|
|
ref="dataFormRef"
|
|
ref="dataFormRef"
|
|
:schema="customerSchema"
|
|
:schema="customerSchema"
|
|
:rules="customerRules"
|
|
:rules="customerRules"
|
|
v-model="formData"
|
|
v-model="formData"
|
|
- ></data-form>
|
|
|
|
|
|
+ ></DataForm>
|
|
<div><wd-button block :round="false" @click="submitTask">提交</wd-button></div>
|
|
<div><wd-button block :round="false" @click="submitTask">提交</wd-button></div>
|
|
</view>
|
|
</view>
|
|
</wd-action-sheet>
|
|
</wd-action-sheet>
|