|
@@ -5,18 +5,12 @@
|
|
|
</image>
|
|
|
<view class="font-semibold text-32rpx">{{ data.siteName }}</view>
|
|
|
</view>
|
|
|
- <view
|
|
|
- class="mt20rpx bg-white px-24rpx py-28rpx rounded-32rpx"
|
|
|
- v-if="data.appOrderProInfoVerifyVOS"
|
|
|
- >
|
|
|
+ <view class="mt20rpx bg-white px-24rpx py-28rpx rounded-32rpx" v-if="data.appOrderProInfoVerifyVOS">
|
|
|
<wd-checkbox-group v-model="checkedAll">
|
|
|
<!-- 无固定场 -->
|
|
|
<template v-if="type >= GoodsType.noFixed">
|
|
|
<view class="flex items-center">
|
|
|
- <image
|
|
|
- :src="data.productImage"
|
|
|
- class="w200rpx h-200rpx rounded-32rpx min-w-200rpx"
|
|
|
- />
|
|
|
+ <image :src="data.productImage" class="w200rpx h-200rpx rounded-32rpx min-w-200rpx" />
|
|
|
<view class="ml20rpx flex-1">
|
|
|
<view class="text-32rpx">{{ data.productName }}</view>
|
|
|
|
|
@@ -28,47 +22,24 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view
|
|
|
- class="flex items-center justify-between mb20rpx mt24rpx"
|
|
|
- v-for="item in data.appOrderProInfoVerifyVOS"
|
|
|
- :key="item.appOrderProInfo.id"
|
|
|
- >
|
|
|
- <view v-if="item.appOrderProInfo.type != 6"
|
|
|
- >券号:{{ item.appOrderProInfo.ticketNo }}</view
|
|
|
- >
|
|
|
- <wd-checkbox
|
|
|
- :model-value="item.isinId"
|
|
|
- checked-color="#fdd143"
|
|
|
- v-if="item.isinStatus == 0"
|
|
|
- >
|
|
|
+ <view class="flex items-center justify-between mb20rpx mt24rpx" v-for="item in data.appOrderProInfoVerifyVOS"
|
|
|
+ :key="item.appOrderProInfo.id">
|
|
|
+ <view v-if="item.appOrderProInfo.type != 6">券号:{{ item.appOrderProInfo.ticketNo }}</view>
|
|
|
+ <wd-checkbox :model-value="item.isinId" checked-color="#fdd143" v-if="item.isinStatus == 0"
|
|
|
+ :disabled="isType4DefaultChecked">
|
|
|
</wd-checkbox>
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 6"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已退款</wd-tag
|
|
|
- >
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 2"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已使用</wd-tag
|
|
|
- >
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 3"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已到期</wd-tag
|
|
|
- >
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 6" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已退款</wd-tag>
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 2" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已使用</wd-tag>
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 3" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已到期</wd-tag>
|
|
|
</view>
|
|
|
</template>
|
|
|
<!-- 包场 -->
|
|
|
<template v-else>
|
|
|
- <view
|
|
|
- class="flex justify-between items-center w-full mb20rpx"
|
|
|
- v-for="item in data.appOrderProInfoVerifyVOS"
|
|
|
- :key="item.id"
|
|
|
- >
|
|
|
+ <view class="flex justify-between items-center w-full mb20rpx" v-for="item in data.appOrderProInfoVerifyVOS"
|
|
|
+ :key="item.id">
|
|
|
<view>场次</view>
|
|
|
<view class="flex-1">
|
|
|
<view class="flex items-center justify-between ml20rpx">
|
|
@@ -77,29 +48,14 @@
|
|
|
item.appOrderProInfo.price
|
|
|
}}
|
|
|
</view>
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 6"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已退款</wd-tag
|
|
|
- >
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 2"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已使用</wd-tag
|
|
|
- >
|
|
|
- <wd-tag
|
|
|
- v-if="item.appOrderProInfo.orderStatus == 3"
|
|
|
- bg-color="rgba(0,0,0,0.1)"
|
|
|
- color="rgba(0,0,0,0.3)"
|
|
|
- >已到期</wd-tag
|
|
|
- >
|
|
|
- <wd-checkbox
|
|
|
- :model-value="item.isinId"
|
|
|
- checked-color="#fdd143"
|
|
|
- v-if="item.isinStatus == 0"
|
|
|
- ></wd-checkbox>
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 6" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已退款</wd-tag>
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 2" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已使用</wd-tag>
|
|
|
+ <wd-tag v-if="item.appOrderProInfo.orderStatus == 3" bg-color="rgba(0,0,0,0.1)"
|
|
|
+ color="rgba(0,0,0,0.3)">已到期</wd-tag>
|
|
|
+ <wd-checkbox :model-value="item.isinId" checked-color="#fdd143"
|
|
|
+ v-if="item.isinStatus == 0"></wd-checkbox>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -109,9 +65,7 @@
|
|
|
<wd-divider color="#F0F0F0"></wd-divider>
|
|
|
<view class="flex items-center justify-between">
|
|
|
<view class="text-28rpx">消费张数</view>
|
|
|
- <view class="font-semibold text-#FB5B5B"
|
|
|
- >本次核销{{ checkedAll.length }}张</view
|
|
|
- >
|
|
|
+ <view class="font-semibold text-#FB5B5B">本次核销{{ checkedAll.length }}张</view>
|
|
|
</view>
|
|
|
<view class="mt12rpx text-#FB5B5B"> 共{{ AvailableNumber }}张可用</view>
|
|
|
</view>
|
|
@@ -120,14 +74,8 @@
|
|
|
<view>核销前请与顾客确认核销券数</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <fixdbtn
|
|
|
- block
|
|
|
- size="large"
|
|
|
- :disabled="!checkedAll.length"
|
|
|
- v-if="data"
|
|
|
- @click="handleSubmit"
|
|
|
- >确认核销({{ checkedAll.length }})</fixdbtn
|
|
|
- >
|
|
|
+ <fixdbtn block size="large" :disabled="!checkedAll.length" v-if="data" @click="handleSubmit">确认核销({{ checkedAll.length
|
|
|
+ }})</fixdbtn>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
@@ -135,7 +83,7 @@ import { GoodsType } from "@/config";
|
|
|
import { createGlobalLoadingMiddleware } from "@/api/core/middleware";
|
|
|
import router from "@/router";
|
|
|
const { isShowLoging } = storeToRefs(useUserStore());
|
|
|
-const checkedAll = ref([]);
|
|
|
+const checkedAll = ref<string[]>([]);
|
|
|
|
|
|
const { data, send: getOrder } = useRequest(
|
|
|
(id: string) =>
|
|
@@ -151,6 +99,40 @@ const { data, send: getOrder } = useRequest(
|
|
|
console.log(err, "asdasdsad");
|
|
|
router.replace({ name: "error" });
|
|
|
});
|
|
|
+
|
|
|
+// 查找所有 type=4 且可选的项目,默认选中
|
|
|
+const isType4DefaultChecked = ref(false);
|
|
|
+watch(
|
|
|
+ () => data.value,
|
|
|
+ (newData) => {
|
|
|
+ if (newData && newData.appOrderProInfoVerifyVOS) {
|
|
|
+ const isType4 = newData.appOrderProInfoVerifyVOS.some(
|
|
|
+ item => item.appOrderProInfo.type === 4
|
|
|
+ );
|
|
|
+ if (isType4) {
|
|
|
+ // type=4时默认全选并禁用
|
|
|
+ const defaultSelected = newData.appOrderProInfoVerifyVOS
|
|
|
+ .filter(item => item.appOrderProInfo.type === 4 && item.isinStatus === 0)
|
|
|
+ .map(item => item.isinId)
|
|
|
+ .filter((id): id is string => id !== undefined);
|
|
|
+
|
|
|
+ checkedAll.value = [...defaultSelected];
|
|
|
+ isType4DefaultChecked.value = true;
|
|
|
+ } else {
|
|
|
+ // 非type=4时按原逻辑处理
|
|
|
+ const defaultSelected = newData.appOrderProInfoVerifyVOS
|
|
|
+ .filter(item => item.appOrderProInfo.type === 4 && item.isinStatus === 0)
|
|
|
+ .map(item => item.isinId)
|
|
|
+ .filter((id): id is string => id !== undefined);
|
|
|
+
|
|
|
+ checkedAll.value = [...defaultSelected];
|
|
|
+ isType4DefaultChecked.value = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ { immediate: true }
|
|
|
+);
|
|
|
+
|
|
|
const { send: submit } = useRequest(
|
|
|
(orderProInfoIds: string[]) =>
|
|
|
Apis.app.scanCodeVerification({
|
|
@@ -199,11 +181,9 @@ async function handleSubmit() {
|
|
|
margin-bottom: 0px !important;
|
|
|
}
|
|
|
</style>
|
|
|
-<route lang="json">
|
|
|
-{
|
|
|
+<route lang="json">{
|
|
|
"name": "writeOff",
|
|
|
"style": {
|
|
|
"navigationBarTitleText": "扫码核销"
|
|
|
}
|
|
|
-}
|
|
|
-</route>
|
|
|
+}</route>
|