feat: 部分确认收货
This commit is contained in:
@@ -118,6 +118,14 @@
|
||||
@close="closeDelayShipmentPopup"
|
||||
@submit="handleDelayShipmentSubmit"
|
||||
/>
|
||||
<ReceiveItemPopup
|
||||
ref="receiveItemPopupRef"
|
||||
:order-no="props.data.no || ''"
|
||||
:order-data="props.data"
|
||||
:delay-records="state.delayRecords"
|
||||
@close="closeReceiveItemPopup"
|
||||
@submit="handleReceiveItemSubmit"
|
||||
/>
|
||||
</template>
|
||||
<script setup>
|
||||
import {
|
||||
@@ -140,6 +148,7 @@
|
||||
import card_orderBan from '@/components/card_orderBan/card_orderBan.vue';
|
||||
import AiOrderActionBar from '@/components/orderItem/AiOrderActionBar.vue';
|
||||
import ShipmentPopup from '@/components/orderItem/ShipmentPopup.vue';
|
||||
import ReceiveItemPopup from '@/components/orderItem/ReceiveItemPopup.vue';
|
||||
import AfterSaleApi from '@/sheep/api/trade/afterSale';
|
||||
import sheep from '@/sheep';
|
||||
import {
|
||||
@@ -150,6 +159,7 @@
|
||||
cancelOrder as cancelAiOrderRequest,
|
||||
cancelOpenOrder,
|
||||
getAiOrderDelayRecords,
|
||||
receiveItem,
|
||||
} from '@/sheep/api/ai';
|
||||
let emit = defineEmits(['downData']);
|
||||
let { proxy } = getCurrentInstance();
|
||||
@@ -289,8 +299,10 @@
|
||||
|
||||
const nowShipmentPopupRef = ref();
|
||||
const delayShipmentPopupRef = ref();
|
||||
const receiveItemPopupRef = ref();
|
||||
const closeNowShipmentPopup = () => {};
|
||||
const closeDelayShipmentPopup = () => {};
|
||||
const closeReceiveItemPopup = () => {};
|
||||
const openDelayShipmentPopup = async (data) => {
|
||||
const id = resolveAiOrderId(data);
|
||||
if (!id) {
|
||||
@@ -423,6 +435,14 @@
|
||||
};
|
||||
|
||||
const confirmReceiveOrder = async () => {
|
||||
if (Number(currentStatus.value) === 15) {
|
||||
const orderId = resolveAiOrderId(props.data);
|
||||
if (orderId && !state.delayRecordsLoaded) {
|
||||
await loadDelayRecords(true);
|
||||
}
|
||||
receiveItemPopupRef.value?.open?.();
|
||||
return;
|
||||
}
|
||||
const id = resolveAiOrderId(props.data);
|
||||
if (!id) return;
|
||||
const req = Number(props.data?.type) === 5 ? giftConfirmReceive : aiConfirmReceive;
|
||||
@@ -432,6 +452,22 @@
|
||||
}
|
||||
};
|
||||
|
||||
const handleReceiveItemSubmit = async ({ items }) => {
|
||||
if (!Array.isArray(items) || items.length === 0) {
|
||||
uni.showToast({
|
||||
title: '请选择要确认收货的商品',
|
||||
icon: 'none',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { code } = await receiveItem({ items });
|
||||
if (code === 0) {
|
||||
receiveItemPopupRef.value?.close?.();
|
||||
state.delayRecordsLoaded = false;
|
||||
emit('downData');
|
||||
}
|
||||
};
|
||||
|
||||
const goPay = () => {
|
||||
const id = resolveAiOrderId(props.data);
|
||||
const payOrderId = props.data?.payOrderId;
|
||||
|
||||
Reference in New Issue
Block a user