|
|
@@ -1,31 +1,27 @@
|
|
|
<template>
|
|
|
<cwg-page-wrapper>
|
|
|
<view class="order-detail-page">
|
|
|
-
|
|
|
+ <view class="success-icon-wrap">
|
|
|
+ <image v-if="detailData.status === 'success'" src="/static/images/vector.png" alt="" mode="widthFix" />
|
|
|
+ <image v-else-if="detailData.status === 'fail'" src="/static/images/vector2.png" alt="" mode="widthFix" />
|
|
|
+ <image v-else src="/static/images/vector3.png" alt="" mode="widthFix" />
|
|
|
+ <text class="success-text">{{ t(globalStatusText[detailData.status]) }}</text>
|
|
|
+ <text v-if="approveDesc" class="success-text">{{ approveDesc }}</text>
|
|
|
+ </view>
|
|
|
<!-- Content -->
|
|
|
<view class="content">
|
|
|
- <!-- Status Card -->
|
|
|
- <!-- <view class="status-card">
|
|
|
- <view class="status-icon-wrapper">
|
|
|
- <view :class="['status-icon', `status-icon-${orderDetail.orderStatus}`]">
|
|
|
- <uni-icons :type="getOrderStatusIcon(orderDetail.orderStatus)" size="40"
|
|
|
- :color="getOrderStatusColor(orderDetail.orderStatus)" />
|
|
|
- </view>
|
|
|
- </view>
|
|
|
- <text class="status-title">{{ getOrderStatusText(orderDetail.orderStatus) }}</text>
|
|
|
- <text class="status-subtitle">{{ orderDetail.statusMessage }}</text>
|
|
|
- </view> -->
|
|
|
- <!-- Amount Info -->
|
|
|
<view class="section-card">
|
|
|
<view class="section-header">
|
|
|
<uni-icons type="wallet" size="18" color="#2563eb" />
|
|
|
- <text class="section-title">{{ t('card.Form.f37') }}</text>
|
|
|
+ <text class="section-title">{{ t('Ib.Report.Title3') }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
<view class="info-list">
|
|
|
- <view class="info-row" v-for="(item, index) in list.common" :key="index">
|
|
|
- <text class="info-label">{{ item.name }}</text>
|
|
|
- <text class="info-value">{{ item.value }}</text>
|
|
|
+ <view class="info-row" v-if="detailData.merchantOrderNo">
|
|
|
+ <text class="info-label">{{ t('card.Form.f35') }}</text>
|
|
|
+ <view class="info-value-wrapper">
|
|
|
+ <text class="info-value">{{ detailData.merchantOrderNo }}</text>
|
|
|
+ <cwg-icon name="copy" :size="14" color="#9ca3af" @click.stop="copyOrderNo" />
|
|
|
+ </view>
|
|
|
</view>
|
|
|
<view class="info-row">
|
|
|
<text class="info-label">{{ t('card.Form.f37') }}</text>
|
|
|
@@ -34,7 +30,6 @@
|
|
|
<text class="info-valuecurrency">USD</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
-
|
|
|
<view class="info-row">
|
|
|
<text class="info-label">{{ t('card.Form.f30') }}</text>
|
|
|
<text class="info-value">
|
|
|
@@ -42,35 +37,25 @@
|
|
|
<text class="currency">USD</text>
|
|
|
</text>
|
|
|
</view>
|
|
|
-
|
|
|
- <!-- <view class="divider"></view>
|
|
|
-
|
|
|
<view class="info-row">
|
|
|
- <text class="info-label total-label">{{ t('card.Form.f55') }}</text>
|
|
|
- <text class="info-value total-value">
|
|
|
- {{ detailData.actualAmount.toFixed(2) }} <text class="currency">{{ orderDetail.currency || 'USD'
|
|
|
- }}</text>
|
|
|
+ <text class="info-label">{{ t('global.p12') }}</text>
|
|
|
+ <text class="info-value">
|
|
|
+ {{ detailData.exchangeRate ? `1 : ${detailData.exchangeRate}` : '-- ' }}
|
|
|
</text>
|
|
|
- </view> -->
|
|
|
+ </view>
|
|
|
+ <view class="divider"></view>
|
|
|
+ <view class="info-row" v-for="(item, index) in list.common" :key="index">
|
|
|
+ <text class="info-label">{{ item.name }}</text>
|
|
|
+ <text class="info-value">{{ item.value }}</text>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
-
|
|
|
- <!-- Order Info -->
|
|
|
<view class="section-card">
|
|
|
<view class="section-header">
|
|
|
<uni-icons type="list" size="18" color="#2563eb" />
|
|
|
<text class="section-title">{{ getGroupTitle('sender') }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
<view class="info-list">
|
|
|
- <!-- <view class="info-row" v-if="orderDetail.orderNo">
|
|
|
- <text class="info-label">{{ t('card.Form.f35') }}</text>
|
|
|
- <view class="info-value-wrapper">
|
|
|
- <text class="info-value">{{ orderDetail.orderNo }}</text>
|
|
|
- <cwg-icon name="copy" :size="14" color="#9ca3af" @click.stop="copyOrderNo" />
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view class="info-row" v-for="(item, index) in list.sender" :key="index">
|
|
|
<text class="info-label">{{ item.name }}</text>
|
|
|
<text class="info-value">{{ item.value }}</text>
|
|
|
@@ -82,16 +67,7 @@
|
|
|
<uni-icons type="list" size="18" color="#2563eb" />
|
|
|
<text class="section-title">{{ getGroupTitle('receiver') }}</text>
|
|
|
</view>
|
|
|
-
|
|
|
<view class="info-list">
|
|
|
- <!-- <view class="info-row" v-if="orderDetail.orderNo">
|
|
|
- <text class="info-label">{{ t('card.Form.f35') }}</text>
|
|
|
- <view class="info-value-wrapper">
|
|
|
- <text class="info-value">{{ orderDetail.orderNo }}</text>
|
|
|
- <cwg-icon name="copy" :size="14" color="#9ca3af" @click.stop="copyOrderNo" />
|
|
|
- </view>
|
|
|
- </view> -->
|
|
|
-
|
|
|
<view class="info-row" v-for="(item, index) in list.receiver" :key="index">
|
|
|
<text class="info-label">{{ item.name }}</text>
|
|
|
<text class="info-value">{{ item.value }}</text>
|
|
|
@@ -99,52 +75,82 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <view class="content" v-if="complianceStatus">
|
|
|
+ <view>
|
|
|
+ <view class="section-header">
|
|
|
+ <uni-icons type="list" size="18" color="#2563eb" />
|
|
|
+ <text class="section-title">{{ getGroupTitle('submitRfi') }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ <DynamicForm ref="globalFormRef" :fields="complianceItems" :globalForm="globalForm" :step2="true" type="2">
|
|
|
+ </DynamicForm>
|
|
|
+ </view>
|
|
|
+ <!-- Bottom Actions -->
|
|
|
+ <view class="bottom-actions"
|
|
|
+ v-if="(detailData.approveStatus == 1 && detailData.status != 'cancel') || detailData.needSupplement">
|
|
|
+ <view v-if="detailData.approveStatus == 1 && detailData.status != 'cancel'" class="action-btn cancel-btn"
|
|
|
+ @click="cancelOrder">
|
|
|
+ <text class="btn-text">{{ t('global.GlobalOrder.CancelOrder') }}</text>
|
|
|
+ </view>
|
|
|
+ <view v-if="detailData.needSupplement" class="action-btn appeal-btn" @click="appealOrder">
|
|
|
+ <text class="btn-text">{{ t('global.GlobalOrder.submitRfi') }}</text>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</cwg-page-wrapper>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, nextTick, computed } from 'vue'
|
|
|
+import { ref, watch, nextTick, computed } from 'vue'
|
|
|
import { onLoad, onUnload } from '@dcloudio/uni-app';
|
|
|
import { useI18n } from 'vue-i18n';
|
|
|
import useCardStore from '@/stores/use-card-store';
|
|
|
import { ucardApi } from "@/api/ucard";
|
|
|
+import DynamicForm from "./components/DynamicForm.vue";
|
|
|
+import { useOrderFields } from './composable/useOrderFields';
|
|
|
+import { globalApprovalText, globalComplianceText, globalStatusText } from '@/utils/dataMap';
|
|
|
+import useUserStore from "@/stores/use-user-store";
|
|
|
+const { t, locale } = useI18n();
|
|
|
+
|
|
|
+const userStore = useUserStore();
|
|
|
+const approveDesc = ref('');
|
|
|
+const getApproveDesc = () => {
|
|
|
+ const d = detailData.value.approveDesc
|
|
|
+ if (!d) return
|
|
|
+ const c = userStore.reasonsOptions
|
|
|
+ const a = c[d || '']
|
|
|
+ const b = locale.value == 'cn' || locale.value == 'zh' ? a.content : a.enContent
|
|
|
+ if (!b) {
|
|
|
+ reasonsRefusalList()
|
|
|
+ }
|
|
|
+ approveDesc.value = b;
|
|
|
+}
|
|
|
+async function reasonsRefusalList() {
|
|
|
+ try {
|
|
|
+ const res = await ucardApi.reasonsRefusalList();
|
|
|
+ if (res.code === 200) {
|
|
|
+ pickFields(res.data);
|
|
|
|
|
|
-type OrderStatus = 'success' | 'processing' | 'failed' | 'cancelled';
|
|
|
-type ApprovalStatus = 'completed' | 'current' | 'pending';
|
|
|
-
|
|
|
-interface ApprovalStep {
|
|
|
- title: string;
|
|
|
- status: ApprovalStatus;
|
|
|
- operator?: string;
|
|
|
- time?: string;
|
|
|
- remark?: string;
|
|
|
-}
|
|
|
-
|
|
|
-interface OrderDetail {
|
|
|
- category?: 'recharge' | 'transaction' | 'deduction';
|
|
|
- orderNo: string;
|
|
|
- type: string;
|
|
|
- amount: number;
|
|
|
- fee: number;
|
|
|
- actualAmount: number;
|
|
|
- currency?: string;
|
|
|
- orderStatus: OrderStatus;
|
|
|
- statusMessage: string;
|
|
|
- createTime: string;
|
|
|
- completeTime?: string;
|
|
|
- merchant?: string;
|
|
|
- bankCard?: string;
|
|
|
- remark?: string;
|
|
|
- approvalSteps: ApprovalStep[];
|
|
|
-}
|
|
|
-
|
|
|
-// 订单详情数据(默认占位,进入页面后会用缓存覆盖)
|
|
|
-const orderDetail = reactive<OrderDetail>({});
|
|
|
-
|
|
|
-const { t } = useI18n();
|
|
|
-const cardStore = useCardStore();
|
|
|
+ getApproveDesc()
|
|
|
+ } else {
|
|
|
+ uni.$u.toast(res.msg || t("login.msg0"));
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error, 111);
|
|
|
+ }
|
|
|
+}
|
|
|
+function pickFields(source, fields = ['content', 'enContent']) {
|
|
|
+ const result = {}
|
|
|
+ Object.entries(source).forEach(([key, value]) => {
|
|
|
+ result[key] = fields.reduce((acc, f) => {
|
|
|
+ acc[f] = value[f] ?? null
|
|
|
+ return acc
|
|
|
+ }, {})
|
|
|
+ })
|
|
|
+ userStore.saveReasonsOptions(result);
|
|
|
+}
|
|
|
|
|
|
+const cardStore = useCardStore();
|
|
|
const getGroupTitle = (type) => {
|
|
|
const map = {
|
|
|
common: "global.GlobalOrder.common",
|
|
|
@@ -155,61 +161,13 @@ const getGroupTitle = (type) => {
|
|
|
};
|
|
|
return t(map[type] || type);
|
|
|
}
|
|
|
-
|
|
|
-// 获取订单状态图标
|
|
|
-const getOrderStatusIcon = (status: OrderStatus): string => {
|
|
|
- switch (status) {
|
|
|
- case 'success':
|
|
|
- return 'checkmarkempty';
|
|
|
- case 'processing':
|
|
|
- return 'loop';
|
|
|
- case 'failed':
|
|
|
- return 'closeempty';
|
|
|
- case 'cancelled':
|
|
|
- return 'closeempty';
|
|
|
- default:
|
|
|
- return 'info';
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-// 获取订单状态颜色
|
|
|
-const getOrderStatusColor = (status: OrderStatus): string => {
|
|
|
- switch (status) {
|
|
|
- case 'success':
|
|
|
- return '#22c55e';
|
|
|
- case 'processing':
|
|
|
- return '#eab308';
|
|
|
- case 'failed':
|
|
|
- return '#ef4444';
|
|
|
- case 'cancelled':
|
|
|
- return '#9ca3af';
|
|
|
- default:
|
|
|
- return '#9ca3af';
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-// 获取订单状态文本
|
|
|
-const getOrderStatusText = (status: OrderStatus): string => {
|
|
|
- switch (status) {
|
|
|
- case 'success':
|
|
|
- return t('card.Status.t1'); // 成功
|
|
|
- case 'processing':
|
|
|
- return t('card.Status.t3'); // 处理中
|
|
|
- case 'failed':
|
|
|
- return t('card.Status.t2'); // 失败
|
|
|
- case 'cancelled':
|
|
|
- return t('card.Status.t5'); // 待处理 / 已取消,复用状态文案
|
|
|
- default:
|
|
|
- return t('card.Status.t5');
|
|
|
- }
|
|
|
-};
|
|
|
// 复制订单号
|
|
|
const copyOrderNo = () => {
|
|
|
uni.setClipboardData({
|
|
|
- data: orderDetail.orderNo,
|
|
|
+ data: detailData.value.merchantOrderNo,
|
|
|
success: () => {
|
|
|
uni.showToast({
|
|
|
- title: '订单号已复制',
|
|
|
+ title: t('card.Msg.m8') || '复制成功',
|
|
|
icon: 'success'
|
|
|
});
|
|
|
}
|
|
|
@@ -219,191 +177,166 @@ const copyOrderNo = () => {
|
|
|
// 取消订单
|
|
|
const cancelOrder = () => {
|
|
|
uni.showModal({
|
|
|
- title: '确认取消',
|
|
|
- content: '确定要取消此订单吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- uni.showToast({
|
|
|
- title: '订单已取消',
|
|
|
- icon: 'success'
|
|
|
- });
|
|
|
+ title: t('Msg.SystemPrompt'),
|
|
|
+ cancelText: t('common.cancel'),
|
|
|
+ confirmText: t('common.confirm'),
|
|
|
+ content: t('global.GlobalOrder.ConfirmCancelOrder'),
|
|
|
+ success: async (e) => {
|
|
|
+ if (e.confirm) {
|
|
|
+ const res = await ucardApi.globalCancelOrder({ id: detailData.value.id })
|
|
|
+ if (res.code == 200) {
|
|
|
+ // 刷新订单详情
|
|
|
+ uni.showToast({
|
|
|
+ title: t('global.GlobalOrder.CancelOrderSuccess'),
|
|
|
+ icon: 'success'
|
|
|
+ });
|
|
|
+ await getOrderDetail(detailData.value.id);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
};
|
|
|
-
|
|
|
-// 申诉订单
|
|
|
-const appealOrder = () => {
|
|
|
- uni.showToast({
|
|
|
- title: '提交申诉',
|
|
|
- icon: 'none'
|
|
|
+const globalFormRef = ref(null)
|
|
|
+const setRfiInfos = () => {
|
|
|
+ let list = []
|
|
|
+ list = complianceItems.value.filter(item => globalForm.value[item.fieldName])
|
|
|
+ const rfiInfos = list.map((item) => {
|
|
|
+ const { fieldType, rfiId } = item;
|
|
|
+ let rfiValue = undefined;
|
|
|
+ let rfiValueUrl = undefined;
|
|
|
+ if (fieldType === "file") {
|
|
|
+ rfiValueUrl = globalForm.value[item.fieldName]
|
|
|
+ } else {
|
|
|
+ rfiValue = globalForm.value[item.fieldName];
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ rfiId,
|
|
|
+ fieldType,
|
|
|
+ rfiValueUrl,
|
|
|
+ rfiValue,
|
|
|
+ };
|
|
|
});
|
|
|
+ return {
|
|
|
+ orderNo: detailData.value.orderNo,
|
|
|
+ rfiInfos,
|
|
|
+ };
|
|
|
+}
|
|
|
+// 申诉订单
|
|
|
+const appealOrder = async () => {
|
|
|
+ try {
|
|
|
+ const isValid = await globalFormRef.value.validateForm();
|
|
|
+ if (!isValid) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const params = setRfiInfos();
|
|
|
+ const res = await ucardApi.globalSupplementary(params);
|
|
|
+ if (res.code == 200) {
|
|
|
+ await getOrderDetail(detailData.value.id);
|
|
|
+ }
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-const isView = ref(false)
|
|
|
+const isLoading = ref(false) // 接口加载状态
|
|
|
|
|
|
const detailData = ref<any>({})
|
|
|
const list = ref<Record<string, any[]>>({})
|
|
|
|
|
|
const complianceItems = ref<any[]>([])
|
|
|
-const globalForm = reactive<Record<string, any>>({})
|
|
|
+const globalForm = ref<any>({})
|
|
|
|
|
|
const complianceStatus = ref(false)
|
|
|
|
|
|
-// 外部参数
|
|
|
const type = ref<'1' | '2'>('1')
|
|
|
+
|
|
|
+const { fieldGroups } = useOrderFields(detailData)
|
|
|
+
|
|
|
+/** 自动同步字段分组到列表 */
|
|
|
+watch(
|
|
|
+ fieldGroups,
|
|
|
+ (val) => {
|
|
|
+ list.value = { ...val }
|
|
|
+ },
|
|
|
+ { immediate: true, deep: true }
|
|
|
+)
|
|
|
+
|
|
|
+/**
|
|
|
+ * 处理合规字段和状态
|
|
|
+ * 从 detailData 中提取并处理合规相关数据
|
|
|
+ */
|
|
|
+function processComplianceData() {
|
|
|
+ // 处理合规字段
|
|
|
+ complianceItems.value = (detailData.value.dataDtos || []).map(item => {
|
|
|
+ const fieldName = `${item.customerType}_${item.fieldName}`
|
|
|
+
|
|
|
+ if (item.status !== "pending_check" && item.status !== "approved") {
|
|
|
+ globalForm.value[fieldName] =
|
|
|
+ item.fieldType === 'file'
|
|
|
+ ? item.rfiValueUrl
|
|
|
+ : item.rfiValue
|
|
|
+
|
|
|
+ return { ...item, fieldName, disabled: true }
|
|
|
+ } else {
|
|
|
+ if (item.status == "pending" || item.status == "approved") {
|
|
|
+ return {
|
|
|
+ ...item, fieldName,
|
|
|
+ disabled: true,
|
|
|
+ };
|
|
|
+ } else {
|
|
|
+ return { ...item };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // 更新合规状态
|
|
|
+ complianceStatus.value = complianceItems.value.length > 0
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 获取订单详情
|
|
|
+ * 接口返回后会更新 detailData,通过 watch 自动同步到 list
|
|
|
+ */
|
|
|
async function getOrderDetail(id: string | number) {
|
|
|
try {
|
|
|
- isView.value = false
|
|
|
-
|
|
|
+ isLoading.value = true
|
|
|
const res = await ucardApi.globalOrdersDetail({ id })
|
|
|
-
|
|
|
if (res.code !== 200) {
|
|
|
- // ElMessage.error(res.msg)
|
|
|
+ console.warn('获取订单详情失败:', res.msg)
|
|
|
return
|
|
|
}
|
|
|
-
|
|
|
- detailData.value = res.data
|
|
|
- console.log(21312312, detailData.value, [...detailData.value.fieldDtos]);
|
|
|
-
|
|
|
-
|
|
|
- /** 1️⃣ 处理 fieldDtos */
|
|
|
- /** 1️⃣ 处理 fieldDtos */
|
|
|
- /** 1️⃣ 处理 fieldDtos */
|
|
|
- let a = []
|
|
|
- let listData = [...detailData.value.fieldDtos]
|
|
|
- .sort((a, b) => a.sorting - b.sorting)
|
|
|
- listData.map((item) => {
|
|
|
- const key = Object.keys(detailData.value).find(
|
|
|
- (k) => k.toLowerCase() === item.fieldName.toLowerCase()
|
|
|
- )
|
|
|
-
|
|
|
- // const { t } = useI18n()
|
|
|
- let name = item.fieldName // 默认使用字段名
|
|
|
-
|
|
|
- try {
|
|
|
- // 检查国际化键是否存在
|
|
|
- const i18nKey = `global.fieldName.${item.fieldName}.fieldTitle`
|
|
|
- name = t(i18nKey)
|
|
|
- // 如果国际化返回的值和键相同,说明未找到翻译,使用默认值
|
|
|
- if (name === i18nKey) {
|
|
|
- name = item.fieldName
|
|
|
- }
|
|
|
- } catch (error) {
|
|
|
- console.error('国际化处理错误:', error)
|
|
|
- name = item.fieldName
|
|
|
- }
|
|
|
-
|
|
|
- let value = key ? detailData.value[key] : item.fixedValue
|
|
|
-
|
|
|
- // 特殊处理 select 类型字段
|
|
|
- if (
|
|
|
- item.fieldType === 'select' &&
|
|
|
- key &&
|
|
|
- !['transferType', 'payoutMethod'].includes(key)
|
|
|
- ) {
|
|
|
- value = detailData.value[key + 'Value'] || value
|
|
|
- }
|
|
|
- // 确定字段类型,提供默认值
|
|
|
- let type = item.fieldUserType || 'other'
|
|
|
- let b = {
|
|
|
- name,
|
|
|
- value,
|
|
|
- type,
|
|
|
- fieldName: item.fieldName,
|
|
|
- fieldType: item.fieldType,
|
|
|
- options: item.options || null
|
|
|
- }
|
|
|
- if (item.fieldName === 'transferAmount') b.value = value + ' ' + detailData.value.payoutCurrency
|
|
|
- a.push(b)
|
|
|
- return {
|
|
|
- name,
|
|
|
- value,
|
|
|
- type,
|
|
|
- fieldName: item.fieldName,
|
|
|
- fieldType: item.fieldType,
|
|
|
- options: item.options || null
|
|
|
- }
|
|
|
- })
|
|
|
- /** 2️⃣ 分组 */
|
|
|
- const groups: Record<string, any[]> = {}
|
|
|
-
|
|
|
- a.forEach((field) => {
|
|
|
-
|
|
|
- let type = field.type || field.fieldUserType || 'other'
|
|
|
- // if (type === 'common') type = 'sender'
|
|
|
- if (!groups[type]) groups[type] = []
|
|
|
- groups[type].push(field)
|
|
|
- })
|
|
|
-
|
|
|
- list.value = groups
|
|
|
- console.log(list.value, 22222);
|
|
|
-
|
|
|
-
|
|
|
- /** 3️⃣ nextTick 后处理合规字段 */
|
|
|
+ Object.assign(detailData.value, res.data)
|
|
|
await nextTick()
|
|
|
-
|
|
|
- let items: any[] = []
|
|
|
-
|
|
|
- if (detailData.value?.dataDtos) {
|
|
|
- items = detailData.value.dataDtos.map((item) => {
|
|
|
- item.fieldName = `${item.customerType}_${item.fieldName}`
|
|
|
-
|
|
|
- if (item.status !== 'pending_check') {
|
|
|
- globalForm[item.fieldName] =
|
|
|
- item.fieldType === 'file'
|
|
|
- ? item.rfiValueUrl
|
|
|
- : item.rfiValue
|
|
|
-
|
|
|
- return {
|
|
|
- ...item,
|
|
|
- disabled: true
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- return { ...item }
|
|
|
- })
|
|
|
- }
|
|
|
-
|
|
|
- complianceItems.value = items
|
|
|
-
|
|
|
- /** 4️⃣ 合规状态 */
|
|
|
- let status = false
|
|
|
-
|
|
|
- if (type.value === '1') {
|
|
|
- status =
|
|
|
- detailData.value?.complianceStatus !== 'pending_check' &&
|
|
|
- detailData.value?.complianceStatus !== null
|
|
|
- }
|
|
|
-
|
|
|
- if (type.value === '2') {
|
|
|
- status = true
|
|
|
- }
|
|
|
-
|
|
|
- complianceStatus.value = status
|
|
|
- isView.value = true
|
|
|
- } catch (error: any) {
|
|
|
- console.log(error, 12121);
|
|
|
-
|
|
|
- // ElMessage.error(error?.message || 'System Error')
|
|
|
+ processComplianceData()
|
|
|
+ getApproveDesc()
|
|
|
+ } catch (e) {
|
|
|
+ console.error('获取订单详情异常:', e)
|
|
|
} finally {
|
|
|
+ isLoading.value = false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-// 页面加载时,从 store 中读取订单详情
|
|
|
+// 页面加载时,先使用缓存数据渲染,然后获取最新数据
|
|
|
onLoad((e) => {
|
|
|
- console.log(e, 2313);
|
|
|
-
|
|
|
- getOrderDetail(e.id);
|
|
|
-
|
|
|
+ const cachedData = cardStore.detailData
|
|
|
+ if (cachedData) {
|
|
|
+ try {
|
|
|
+ const clonedData = JSON.parse(JSON.stringify(cachedData))
|
|
|
+ detailData.value = clonedData
|
|
|
+ processComplianceData()
|
|
|
+ } catch (error) {
|
|
|
+ console.error('加载缓存数据失败:', error)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.id) {
|
|
|
+ nextTick(() => {
|
|
|
+ getOrderDetail(e.id)
|
|
|
+ })
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
// 离开页面时清空订单详情
|
|
|
onUnload(() => {
|
|
|
- // cardStore.clearOrderDetail();
|
|
|
+ cardStore.clearOrderDetail();
|
|
|
});
|
|
|
</script>
|
|
|
|
|
|
@@ -414,6 +347,26 @@ onUnload(() => {
|
|
|
padding: 0;
|
|
|
}
|
|
|
|
|
|
+.success-icon-wrap {
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ background-color: #ffffff;
|
|
|
+
|
|
|
+ image {
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
+ .success-text {
|
|
|
+ width: 100%;
|
|
|
+ text-align: center;
|
|
|
+ font-size: px2rpx(18);
|
|
|
+ color: #111827;
|
|
|
+ margin-bottom: px2rpx(24);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.order-detail-page {
|
|
|
background-color: #f9fafb;
|
|
|
padding-bottom: px2rpx(80);
|