|
|
@@ -85,7 +85,7 @@
|
|
|
<span class="info-label">采购事由</span><span class="info-value">{{ orderInfo.purchaseReason || '-' }}</span>
|
|
|
</div>
|
|
|
<div class="info-row">
|
|
|
- <span class="info-label">费用类型</span><span class="info-value">{{ orderInfo.costType || '-' }}</span>
|
|
|
+ <span class="info-label">费用类型</span><span class="info-value">{{ getDictLabel(fee_type, orderInfo.expenseType) || '-' }}</span>
|
|
|
</div>
|
|
|
<div class="info-row">
|
|
|
<span class="info-label">订单备注</span><span class="info-value">{{ orderInfo.remark || '-' }}</span>
|
|
|
@@ -136,7 +136,8 @@ import type { OrderCustomerFlowNodeLink } from '@/api/pc/enterprise/orderTypes';
|
|
|
|
|
|
const router = useRouter();
|
|
|
const route = useRoute();
|
|
|
-
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { fee_type } = toRefs<any>(proxy?.useDict('fee_type'));
|
|
|
// 格式化时间为 "2026/3/17 上午10:49" 格式
|
|
|
const formatTime = (timeStr: string): string => {
|
|
|
if (!timeStr) return '';
|
|
|
@@ -163,22 +164,21 @@ const progressSteps = ref<{ title: string; icon: any; desc: string; time: string
|
|
|
// 订单时间信息(用于流程节点时间显示)
|
|
|
const orderTimeInfo = reactive({
|
|
|
createTime: '', // 订单创建时间(提交订单节点)
|
|
|
- updateTime: '' // 订单更新时间(完成节点)
|
|
|
+ updateTime: '' // 订单更新时间(完成节点)
|
|
|
});
|
|
|
|
|
|
// 根据 handlerId(逗号分隔的多个ID)解析审批人名称
|
|
|
// 单人:返回姓名;多人:返回"xx或xx审核"
|
|
|
const resolveHandlerName = async (handlerId: string): Promise<string> => {
|
|
|
if (!handlerId) return '';
|
|
|
- const ids = handlerId.split(',').map((s) => s.trim()).filter(Boolean);
|
|
|
+ const ids = handlerId
|
|
|
+ .split(',')
|
|
|
+ .map((s) => s.trim())
|
|
|
+ .filter(Boolean);
|
|
|
if (ids.length === 0) return '';
|
|
|
try {
|
|
|
- const results = await Promise.all(
|
|
|
- ids.map((id) => getContactInfo(String(id)).catch(() => null))
|
|
|
- );
|
|
|
- const names = results
|
|
|
- .map((res: any) => res?.data?.contactName || '')
|
|
|
- .filter(Boolean);
|
|
|
+ const results = await Promise.all(ids.map((id) => getContactInfo(String(id)).catch(() => null)));
|
|
|
+ const names = results.map((res: any) => res?.data?.contactName || '').filter(Boolean);
|
|
|
if (names.length === 0) return '';
|
|
|
if (names.length === 1) return names[0];
|
|
|
return names.join('或') + '审核';
|
|
|
@@ -187,11 +187,10 @@ const resolveHandlerName = async (handlerId: string): Promise<string> => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-
|
|
|
// 加载审批流程节点
|
|
|
const loadFlowNodes = async () => {
|
|
|
try {
|
|
|
- const res = await getOrderFlowNodes(orderId.value) as any;
|
|
|
+ const res = (await getOrderFlowNodes(orderId.value)) as any;
|
|
|
if (res.code === 200) {
|
|
|
const apiNodes: OrderCustomerFlowNodeLink[] = res.data || [];
|
|
|
|
|
|
@@ -201,9 +200,7 @@ const loadFlowNodes = async () => {
|
|
|
];
|
|
|
|
|
|
// 并行解析所有节点的审批人名称
|
|
|
- const handlerNames = await Promise.all(
|
|
|
- apiNodes.map((node) => resolveHandlerName(node.handlerId || node.handlerName || ''))
|
|
|
- );
|
|
|
+ const handlerNames = await Promise.all(apiNodes.map((node) => resolveHandlerName(node.handlerId || node.handlerName || '')));
|
|
|
|
|
|
apiNodes.forEach((node, idx) => {
|
|
|
steps.push({
|
|
|
@@ -249,6 +246,7 @@ const orderInfo = reactive({
|
|
|
receiverPhone: '',
|
|
|
deliveryTime: '',
|
|
|
purchaseReason: '',
|
|
|
+ expenseType: '',
|
|
|
costType: '',
|
|
|
remark: ''
|
|
|
});
|
|
|
@@ -276,10 +274,14 @@ const loadOrderDetail = async () => {
|
|
|
orderInfo.deliveryTime = order.expectedDeliveryTime || '';
|
|
|
orderInfo.purchaseReason = order.purchaseReason || '';
|
|
|
orderInfo.remark = order.remark || '';
|
|
|
+ orderInfo.expenseType = order.expenseType || '';
|
|
|
|
|
|
// 保存订单时间信息(用于流程节点时间显示)
|
|
|
orderTimeInfo.createTime = order.createTime || '';
|
|
|
orderTimeInfo.updateTime = order.updateTime || '';
|
|
|
+ if (order.orderStatus == 5) {
|
|
|
+ currentStep.value = progressSteps.value.length - 1;
|
|
|
+ }
|
|
|
// 获取商品信息
|
|
|
const productsRes = await getOrderProducts([orderId.value]);
|
|
|
if (productsRes.code === 200 && productsRes.rows) {
|
|
|
@@ -325,6 +327,12 @@ const loadOrderDetail = async () => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const getDictLabel = (dictOptions: any[], value: string) => {
|
|
|
+ if (!dictOptions || !value) return value;
|
|
|
+ const dict = dictOptions.find((item) => item.value === value);
|
|
|
+ return dict ? dict.label : value;
|
|
|
+};
|
|
|
+
|
|
|
onMounted(async () => {
|
|
|
const paramId = route.query.orderId;
|
|
|
// 直接使用字符串,不转换为数字,避免精度丢失
|