【接单】 新增# 订单状态为已完成时添加上传拍照按钮

dev1.0
kaeery 2025-01-22 15:52:02 +08:00
parent 2f9cc36776
commit 73ed247bec
6 changed files with 49 additions and 20 deletions

View File

@ -28,6 +28,7 @@
:appointTime="item.appointTime"
:appointTimeStartStr="item.appointTimeStart"
:isDispatch="item.isDispatch"
:uploadServiceImgBtn="item.uploadServiceImgBtn"
@refresh="queryList"
/>
</order-card>
@ -36,10 +37,10 @@
</template>
<script lang="ts" setup>
import { ref, watch, nextTick, shallowRef, unref } from 'vue'
import orderCard from './order-card.vue'
import orderFooter from '@/components/order-footer/index.vue'
import { apiStaffOrderLists } from '@/api/order'
import orderFooter from '@/components/order-footer/index.vue'
import { nextTick, ref, shallowRef, unref, watch } from 'vue'
import orderCard from './order-card.vue'
const props = withDefaults(
defineProps<{

View File

@ -125,18 +125,26 @@
</view>
<view
v-if="orderData.serviceImages"
class="card bg-white card normal text-base flex flex-col gap-[12rpx] rounded-[12rpx]"
>
<text>服务照片</text>
<view class="flex gap-[12rpx] flex-wrap">
<u-image
v-for="(image, index) in orderData.serviceImages"
:key="index"
:src="image"
width="200"
height="200"
@click="handlePreviewImage(index)"
></u-image>
<template v-if="orderData.serviceImages?.length > 0">
<u-image
v-for="(image, index) in orderData.serviceImages"
:key="index"
:src="image"
width="200"
height="200"
@click="handlePreviewImage(index)"
></u-image>
</template>
<template v-else>
<view class="text-center w-full">
<u-empty text="暂无上传图片" mode="data"></u-empty>
</view>
</template>
</view>
</view>
<!-- Main End -->

View File

@ -94,6 +94,7 @@ onMounted(() => {
})
/** Life Cycle End **/
const setFileList = computed(() => list => {
if (!list) return []
return list.map((item: string) => {
return {
url: item

View File

@ -26,7 +26,7 @@
</template>
<script setup lang="ts">
import { apiStaffOrderDetail } from '@/api/order'
import { apiServiceImages, apiStaffOrderDetail } from '@/api/order'
import { toast } from '@/utils/util'
import { onLoad } from '@dcloudio/uni-app'
import { ref } from 'vue'
@ -46,7 +46,7 @@ onLoad(option => {
const initOrderDetail = async () => {
const result = await apiStaffOrderDetail({ id: formData.value.id })
formData.value.orderStatus = result.orderStatus
formData.value.serviceImages = result.serviceImages
formData.value.serviceImages = result.serviceImages ?? []
}
const handleSubmit = async () => {
@ -54,10 +54,11 @@ const handleSubmit = async () => {
if (!serviceImages.length) return toast('请上传服务图片')
try {
const data = {
...formData.value
...formData.value,
serviceImages
}
await apiServiceImages(data)
toast('提交成功', 'success')
toast('提交成功')
uni.navigateBack()
} catch (error) {}
}

View File

@ -59,12 +59,19 @@
<!-- 联系客户 -->
<template v-if="mobile && (confirmService || verification)">
<button
<!-- <button
class="Btn flex-1 mr-2 bg-white text-sm text-black leading-[70rpx] h-[70rpx] rounded-full"
@click.stop="handleCustomerMobile()"
>
联系客户
</button>
</button> -->
<view
class="px-[24rpx] items-center flex-1 mr-2 bg-white text-sm text-black leading-[70rpx] h-[70rpx] rounded-full"
style="border: 1px solid rgb(187, 187, 187)"
@click.stop="handleCustomerMobile()"
>
<u-icon size="40" name="phone"></u-icon>
</view>
</template>
<!-- 去支付 -->
@ -115,7 +122,7 @@
class="bg-primary text-sm text-white leading-[70rpx] h-[70rpx] rounded-full"
@click.stop="handleNavigate"
>
拍照上传
</button>
</view>
@ -141,6 +148,15 @@
</view>
</u-modal>
</template>
<!-- 已完成 -->
<template v-if="uploadServiceImgBtn && orderStatus == 3">
<button
class="bg-primary text-sm text-white leading-[70rpx] h-[70rpx] rounded-full"
@click.stop="handleNavigate"
>
拍照上传
</button>
</template>
</view>
<u-popup
v-model="showConfirmPop"
@ -251,6 +267,7 @@ const props = withDefaults(
staffMobile?: string | null //
contract: number | null
goodsId?: number | string
uploadServiceImgBtn: number | string | boolean
}>(),
{
orderId: '',
@ -273,7 +290,8 @@ const props = withDefaults(
isDispatch: 0, // 0= 1= 0
staffMobile: '',
contract: null,
goodsId: ''
goodsId: '',
uploadServiceImgBtn: false
}
)
const code = ref<number | string>('') //

View File

@ -87,7 +87,7 @@
</template>
<!-- 我的核销码 -->
<template v-if="orderData.orderStatus === 2">
<template v-if="orderData.orderStatus === 2 && orderData?.staff?.id">
<view class="card normal text-base">
<view class="">
<view>我的核销码</view>