|
@@ -9,7 +9,7 @@ import SectionHeading from '@designer-hub/app/src/components/section-heading.vue
|
|
|
import BottomAppBar from '@/components/bottom-app-bar.vue'
|
|
|
import DataForm from '@/components/data-form.vue'
|
|
|
// eslint-disable-next-line import/named
|
|
|
-import { appTaskReport, getTaskDetail } from '@/core/libs/requests'
|
|
|
+import {appTaskReport, getTaskDetail, taskReceive} from '@/core/libs/requests'
|
|
|
import { useUserStore } from '@/store'
|
|
|
import { storeToRefs } from 'pinia'
|
|
|
import dayjs from 'dayjs'
|
|
@@ -59,15 +59,26 @@ const submitTask = async (data) => {
|
|
|
uni.hideLoading()
|
|
|
publishState.value = false
|
|
|
}
|
|
|
-// {
|
|
|
-// "id": 5092,
|
|
|
-// "taskId": 24266,
|
|
|
-// "brokerId": 22306,
|
|
|
-// "reason": "不香",
|
|
|
-// "remark": "你猜",
|
|
|
-// "num": 0,
|
|
|
-// "crateTime": ""
|
|
|
-// }
|
|
|
+const acceptingOrders = async () => {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: true,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ initData()
|
|
|
+}
|
|
|
+const acceptingNoOrders = async () => {
|
|
|
+ uni.showLoading()
|
|
|
+ const res = await taskReceive({
|
|
|
+ brokerId: userInfo.value.userId,
|
|
|
+ taskId: taskDetails.value.id,
|
|
|
+ orders: false,
|
|
|
+ })
|
|
|
+ uni.hideLoading()
|
|
|
+ initData()
|
|
|
+}
|
|
|
onLoad(async (query: { taskId: string }) => {
|
|
|
taskId.value = query.taskId
|
|
|
await initData()
|
|
@@ -264,6 +275,7 @@ onLoad(async (query: { taskId: string }) => {
|
|
|
<template v-if="taskDetails?.finalType == 1 && taskDetails?.receive">
|
|
|
<div class="flex items-center justify-between gap-3">
|
|
|
<div
|
|
|
+ @click="acceptingNoOrders"
|
|
|
class="grow shrink basis-0 px-5 py-3 bg-[#f2f3ff] rounded-md justify-center items-center gap-1 flex"
|
|
|
>
|
|
|
<div
|
|
@@ -273,6 +285,7 @@ onLoad(async (query: { taskId: string }) => {
|
|
|
</div>
|
|
|
</div>
|
|
|
<div
|
|
|
+ @click="acceptingOrders"
|
|
|
class="grow shrink basis-0 px-5 py-3 bg-[#2357e9] rounded-md justify-center items-center gap-1 flex"
|
|
|
>
|
|
|
<div
|