|
@@ -3,15 +3,21 @@ import { computed, onMounted, ref } from "vue";
|
|
import { useRoute } from "vue-router";
|
|
import { useRoute } from "vue-router";
|
|
import PaymentReceipt from "./components/receipt-payment.vue";
|
|
import PaymentReceipt from "./components/receipt-payment.vue";
|
|
import RelatedOrder from "./components/related-order.vue";
|
|
import RelatedOrder from "./components/related-order.vue";
|
|
-import { httpInfo } from "/@/api/InvoiceSales/capitalClaim";
|
|
|
|
|
|
+import {
|
|
|
|
+ httpInfo,
|
|
|
|
+ httpOrderList,
|
|
|
|
+ httpPayAdd
|
|
|
|
+} from "/@/api/InvoiceSales/capitalClaim";
|
|
import { useResponseHandle } from "/@/hooks";
|
|
import { useResponseHandle } from "/@/hooks";
|
|
|
|
|
|
const { query } = useRoute();
|
|
const { query } = useRoute();
|
|
-const responseHandle = useResponseHandle();
|
|
|
|
const tradNo = computed(() => query.id as string);
|
|
const tradNo = computed(() => query.id as string);
|
|
|
|
+const responseHandle = useResponseHandle();
|
|
|
|
|
|
-const treadeDetail = ref<any>({});
|
|
|
|
|
|
+const treadeDetail = ref<Record<string, string>>({});
|
|
|
|
+const treadOrderList = ref<Array<Record<string, string>>>([]);
|
|
|
|
|
|
|
|
+//初始化认领详情
|
|
async function requesetTradeDetail() {
|
|
async function requesetTradeDetail() {
|
|
const { code, message, data } = await httpInfo({
|
|
const { code, message, data } = await httpInfo({
|
|
tradNo: tradNo.value
|
|
tradNo: tradNo.value
|
|
@@ -24,18 +30,51 @@ async function requesetTradeDetail() {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+async function requesetTradeOrderList() {
|
|
|
|
+ const { code, message, data } = await httpOrderList({
|
|
|
|
+ tradNo: tradNo.value
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ responseHandle({
|
|
|
|
+ code,
|
|
|
|
+ message,
|
|
|
|
+ handler: () => (treadOrderList.value = data)
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function initalData() {
|
|
|
|
+ if (!tradNo.value) return;
|
|
|
|
+ requesetTradeDetail();
|
|
|
|
+ requesetTradeOrderList();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//新增销售单付款
|
|
|
|
+async function requesetCreateSalePay(orderArr: any = []) {
|
|
|
|
+ const { code, message } = await httpPayAdd({
|
|
|
|
+ tradNo: tradNo.value,
|
|
|
|
+ orderArr
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ responseHandle({
|
|
|
|
+ code,
|
|
|
|
+ message,
|
|
|
|
+ handler: () => {
|
|
|
|
+ /* 回列表页 */
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
//传入id初始化详情
|
|
//传入id初始化详情
|
|
-onMounted(() => tradNo.value && requesetTradeDetail());
|
|
|
|
|
|
+onMounted(() => initalData());
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
<div class="invoice__content" bg-white>
|
|
<div class="invoice__content" bg-white>
|
|
- <PaymentReceipt />
|
|
|
|
- <RelatedOrder />
|
|
|
|
-
|
|
|
|
- <div flex justify-end mt-3>
|
|
|
|
- <el-button type="primary">保存</el-button>
|
|
|
|
- </div>
|
|
|
|
|
|
+ <PaymentReceipt :trade-info="treadeDetail" />
|
|
|
|
+ <RelatedOrder
|
|
|
|
+ :trade-order-list="treadOrderList"
|
|
|
|
+ @create-btn-click="requesetCreateSalePay"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|