|
@@ -28,6 +28,7 @@ const getTitle = computed(() => titleMap[formType.value]);
|
|
|
const invoiceDataList = ref<any[]>([{}]);
|
|
const invoiceDataList = ref<any[]>([{}]);
|
|
|
const certificateDataList = ref<any[]>([]);
|
|
const certificateDataList = ref<any[]>([]);
|
|
|
const buyerPhotoDataList = ref<any[]>([]);
|
|
const buyerPhotoDataList = ref<any[]>([]);
|
|
|
|
|
+const coupon2sid = ref(''); // 优惠券id
|
|
|
|
|
|
|
|
const [BaseForm, baseFormApi] = useVbenForm({
|
|
const [BaseForm, baseFormApi] = useVbenForm({
|
|
|
showDefaultActions: false,
|
|
showDefaultActions: false,
|
|
@@ -247,11 +248,15 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const filePrefix = await getFilePrefix();
|
|
const filePrefix = await getFilePrefix();
|
|
|
|
|
+
|
|
|
|
|
+ // 先执行获取订单详情
|
|
|
|
|
+ await getOrderDetail(data.value.row.ordersid, baseFormApi);
|
|
|
|
|
+
|
|
|
|
|
+ // 订单详情获取完成后,再并行执行剩余3个函数
|
|
|
const results = await Promise.allSettled([
|
|
const results = await Promise.allSettled([
|
|
|
- getOrderDetail(data.value.row.ordersid, baseFormApi),
|
|
|
|
|
getOrderInvoice(data.value.row.ordersid, filePrefix),
|
|
getOrderInvoice(data.value.row.ordersid, filePrefix),
|
|
|
- getOrderCertificate(data.value.row.ordersid, filePrefix),
|
|
|
|
|
- getOrderBuyerPhoto(data.value.row.ordersid, filePrefix),
|
|
|
|
|
|
|
+ getOrderCertificate(coupon2sid.value, filePrefix),
|
|
|
|
|
+ getOrderBuyerPhoto(coupon2sid.value, filePrefix),
|
|
|
]);
|
|
]);
|
|
|
|
|
|
|
|
// 更新schema
|
|
// 更新schema
|
|
@@ -272,7 +277,7 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
(item) => item.fieldName === 'buyerPhotoAttachments',
|
|
(item) => item.fieldName === 'buyerPhotoAttachments',
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
- // 首先添加购买人照片
|
|
|
|
|
|
|
+ // 首先添加购机者照片
|
|
|
// 如果不存在,则添加购买人自拍附件字段
|
|
// 如果不存在,则添加购买人自拍附件字段
|
|
|
if (!hasBuyerPhotoAttachments && buyerPhotoDataList.value.length > 0) {
|
|
if (!hasBuyerPhotoAttachments && buyerPhotoDataList.value.length > 0) {
|
|
|
baseFormApi.setState({
|
|
baseFormApi.setState({
|
|
@@ -296,7 +301,7 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
}),
|
|
}),
|
|
|
),
|
|
),
|
|
|
fieldName: 'buyerPhotoAttachments',
|
|
fieldName: 'buyerPhotoAttachments',
|
|
|
- label: '购买人照片',
|
|
|
|
|
|
|
+ label: '购机者照片',
|
|
|
// formItemClass: 'lg:col-span-2',
|
|
// formItemClass: 'lg:col-span-2',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -315,15 +320,15 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
'暂无',
|
|
'暂无',
|
|
|
),
|
|
),
|
|
|
fieldName: 'buyerPhotoAttachments',
|
|
fieldName: 'buyerPhotoAttachments',
|
|
|
- label: '购买人照片',
|
|
|
|
|
|
|
+ label: '购机者照片',
|
|
|
// formItemClass: 'lg:col-span-2',
|
|
// formItemClass: 'lg:col-span-2',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 然后添加证书附件
|
|
|
|
|
- // 如果不存在,则添加证书附件字段
|
|
|
|
|
|
|
+ // 然后添加证件附件
|
|
|
|
|
+ // 如果不存在,则添加证件附件字段
|
|
|
if (
|
|
if (
|
|
|
!hasCertificateAttachments &&
|
|
!hasCertificateAttachments &&
|
|
|
certificateDataList.value.length > 0
|
|
certificateDataList.value.length > 0
|
|
@@ -349,7 +354,7 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
}),
|
|
}),
|
|
|
),
|
|
),
|
|
|
fieldName: 'certificateAttachments',
|
|
fieldName: 'certificateAttachments',
|
|
|
- label: '证书附件',
|
|
|
|
|
|
|
+ label: '证件附件',
|
|
|
// formItemClass: 'lg:col-span-2',
|
|
// formItemClass: 'lg:col-span-2',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -368,7 +373,7 @@ const [Modal, modalApi] = useVbenModal({
|
|
|
'暂无',
|
|
'暂无',
|
|
|
),
|
|
),
|
|
|
fieldName: 'certificateAttachments',
|
|
fieldName: 'certificateAttachments',
|
|
|
- label: '证书附件',
|
|
|
|
|
|
|
+ label: '证件附件',
|
|
|
// formItemClass: 'lg:col-span-2',
|
|
// formItemClass: 'lg:col-span-2',
|
|
|
},
|
|
},
|
|
|
],
|
|
],
|
|
@@ -568,9 +573,11 @@ const getOrderDetail = async (ordersid: string, formApi: ExtendedFormApi) => {
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
formApi.setValues(detailData);
|
|
formApi.setValues(detailData);
|
|
|
|
|
+
|
|
|
|
|
+ coupon2sid.value = detailData.coupon2sid;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 获取订单发票附件
|
|
|
|
|
|
|
+// 获取发票附件
|
|
|
const getOrderInvoice = async (ordersid: string, filePrefix: string) => {
|
|
const getOrderInvoice = async (ordersid: string, filePrefix: string) => {
|
|
|
const invoiceData = await getAttachmentListApi({
|
|
const invoiceData = await getAttachmentListApi({
|
|
|
attlsh: ordersid,
|
|
attlsh: ordersid,
|
|
@@ -588,11 +595,11 @@ const getOrderInvoice = async (ordersid: string, filePrefix: string) => {
|
|
|
invoiceDataList.value = invoiceData.Data;
|
|
invoiceDataList.value = invoiceData.Data;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 获取订单证件附件
|
|
|
|
|
-const getOrderCertificate = async (ordersid: string, filePrefix: string) => {
|
|
|
|
|
|
|
+// 获取购机者证件附件
|
|
|
|
|
+const getOrderCertificate = async (coupon2sid: string, filePrefix: string) => {
|
|
|
const certificateData = await getAttachmentListApi({
|
|
const certificateData = await getAttachmentListApi({
|
|
|
- attlsh: ordersid,
|
|
|
|
|
- attmodel: 'orders_identity',
|
|
|
|
|
|
|
+ attlsh: coupon2sid,
|
|
|
|
|
+ attmodel: 'coupon_identity',
|
|
|
pageindex: 1,
|
|
pageindex: 1,
|
|
|
rows: 10,
|
|
rows: 10,
|
|
|
});
|
|
});
|
|
@@ -606,11 +613,11 @@ const getOrderCertificate = async (ordersid: string, filePrefix: string) => {
|
|
|
certificateDataList.value = certificateData.Data;
|
|
certificateDataList.value = certificateData.Data;
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-// 获取购买人自拍附件
|
|
|
|
|
-const getOrderBuyerPhoto = async (ordersid: string, filePrefix: string) => {
|
|
|
|
|
|
|
+// 获取购机者自拍附件
|
|
|
|
|
+const getOrderBuyerPhoto = async (coupon2sid: string, filePrefix: string) => {
|
|
|
const buyerPhotoData = await getAttachmentListApi({
|
|
const buyerPhotoData = await getAttachmentListApi({
|
|
|
- attlsh: ordersid,
|
|
|
|
|
- attmodel: 'orders_buyer',
|
|
|
|
|
|
|
+ attlsh: coupon2sid,
|
|
|
|
|
+ attmodel: 'coupon_buyer',
|
|
|
pageindex: 1,
|
|
pageindex: 1,
|
|
|
rows: 10,
|
|
rows: 10,
|
|
|
});
|
|
});
|