Commit a96bb2d7 by qinjianhui

feat: 工厂订单取消后处理功能开发

parent 72632338
import axios from './axios'
import type { BasePaginationData } from '@/types/api'
import type { operateOrderListData } from '@/types/api/factoryOrderNew'
function normalizePodOrderQueryPayload(
data: Record<string, unknown>,
): Record<string, unknown> {
const { receiverCountry, ...rest } = data
if (!Array.isArray(receiverCountry)) {
return data
}
return {
...rest,
...(receiverCountry.length
? { receiverCountry: receiverCountry.join(',') }
: {}),
}
}
export function getCancelOrderProcessListApi(
data: Record<string, unknown>,
currentPage: number,
pageSize: number,
) {
const body = normalizePodOrderQueryPayload({ ...data })
return axios.post<never, BasePaginationData<operateOrderListData>>(
'factory/podOrderOperation/list_page',
{ ...body, status: 'PENDING_SCHEDULE', currentPage, pageSize },
)
}
......@@ -11,7 +11,7 @@ import type {
RestockData,
SearchForm,
StatusTreeNode,
} from '@/types/api/factoryOrderNew/factoryOrderNew'
} from '@/types/api/factoryOrderNew'
import { ResultInfoDataItem } from '@/types/api/order/common'
import { ExportParams } from '@/types/api/order/factoryOrderNew'
import type { OrderData } from '@/types/api/podMakeOrder'
......
......@@ -107,6 +107,14 @@ const router = createRouter({
import('@/views/order/factoryOrderNew/index.vue'),
},
{
path:'/order/cancel-order-process',
meta: {
title: '取消后订单处理',
},
component: () =>
import('@/views/order/cancelOrderProcess/index.vue'),
},
{
path: '/pod-cn-order/orderTracking',
meta: {
title: 'POD(CN)订单跟踪',
......
......@@ -151,6 +151,11 @@ const menu: MenuItem[] = [
id: 12,
label: '工厂订单(NEW)',
},
{
index: '/order/cancel-order-process',
id: 13,
label: '取消后订单处理',
},
],
},
{
......
import type { PaginationData } from '@/types/api'
export interface StatusTreeNode {
status: string
statusName: string
......@@ -271,3 +272,9 @@ export interface PickFailData {
afterOutOccupied?: number
afterOutAvailable?: number
}
export type CardLayoutListFetcher = (
payload: Record<string, unknown>,
currentPage: number,
pageSize: number,
) => Promise<PaginationData<operateOrderListData>>
......@@ -85,7 +85,7 @@ import {
} from '@/api/logistics'
import { createLogisticsOrdersApi } from '@/api/podCnOrder'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew'
const createLogisticDialogVisible = ref(false)
const props = defineProps<{
......
......@@ -57,7 +57,7 @@
</template>
<script setup lang="ts">
import { updateCustomDeclarationInfoApi } from '@/api/podCnOrder'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew'
import {
CustomDeclarationInfoForm,
PodCnOrderListData,
......
......@@ -196,7 +196,7 @@ import {
printPickPdfByBatchNumberApi,
printProductionPdfByBatchNumberApi,
} from '@/api/factoryOrderNew'
import type { BatchManageData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { BatchManageData } from '@/types/api/factoryOrderNew'
import type { PaginationData } from '@/types/api'
import TableView from '@/components/TableView.vue'
import ArrangeDialog from './ArrangeDialog.vue'
......
......@@ -293,19 +293,32 @@ import {
getFactoryOrderNewLogApi,
} from '@/api/factoryOrderNew'
import type { PaginationData } from '@/types/api'
import type { CardLayoutListFetcher } from '@/types/api/factoryOrderNew'
import usePageList from '@/utils/hooks/usePageList'
import { operateOrderListData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import { operateOrderListData } from '@/types/api/factoryOrderNew'
import type { LogListData } from '@/types/api/order'
import LogList from '@/components/LogList.vue'
import RightClickMenu from '@/components/RightClickMenu.vue'
import platformJson from '../../../../json/platform.json'
const props = defineProps<{
status: string
queryPayload: Record<string, unknown>
status?: string
queryPayload?: Record<string, unknown>
initPageSize?: number
fetchList?: CardLayoutListFetcher
}>()
const buildListPayload = () => {
const payload = { ...props.queryPayload }
if (props.fetchList || props.status === undefined) {
return payload
}
return {
...payload,
status: props.status === 'ALL' ? undefined : props.status,
}
}
const emit = defineEmits<{
'selection-change': [items: operateOrderListData[]]
'view-detail': [item: operateOrderListData]
......@@ -324,9 +337,9 @@ const {
initPageSize: props.initPageSize || 100,
initLoad: false,
query: async (current, size) => {
const payload = {
...props.queryPayload,
status: props.status === 'ALL' ? undefined : props.status,
const payload = buildListPayload()
if (props.fetchList) {
return props.fetchList(payload, current, size)
}
const res = await getCardLayoutListApi(payload, current, size)
return res.data as unknown as PaginationData<operateOrderListData>
......@@ -411,13 +424,20 @@ const rightChange = (code: string) => {
const openLogDialog = async (item: operateOrderListData) => {
if (!item.podOrderId) return
const loading = ElLoading.service({
fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await getFactoryOrderNewLogApi(item.podOrderId as number)
logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true
} catch (e) {
// ignore
}
logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true
} catch (e) {
// ignore
} finally {
loading.close()
}
}
const clearSelection = () => {
......
......@@ -257,7 +257,7 @@ import platformJson from '../../../../json/platform.json'
import type {
operateOrderListData,
PickCompleteData,
} from '@/types/api/factoryOrderNew/factoryOrderNew'
} from '@/types/api/factoryOrderNew'
const emit = defineEmits(['adjustPickOrderSuccess'])
const props = defineProps<{
......
......@@ -123,7 +123,7 @@ import {
replenishmentCompleteApi,
markStockOutOfApi,
} from '@/api/factoryOrderNew'
import type { PickCompleteData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { PickCompleteData } from '@/types/api/factoryOrderNew'
import type { BaseRespData } from '@/types/api'
import type {
InterProductList,
......
......@@ -71,7 +71,7 @@ import { ref } from 'vue'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'
import BigNumber from 'bignumber.js'
import { pickCompleteByIdsDataApi } from '@/api/factoryOrderNew'
import type { PickCompleteData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { PickCompleteData } from '@/types/api/factoryOrderNew'
import TableView from '@/components/TableView.vue'
import _ from 'lodash'
import CreateOutboundDialog from './CreateOutboundDialog.vue'
......
......@@ -63,7 +63,7 @@
import { reactive } from 'vue'
import { ElMessage } from 'element-plus'
import { getRestockListApi, restockCheckApi } from '@/api/factoryOrderNew'
import type { RestockData } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { RestockData } from '@/types/api/factoryOrderNew'
import TableView from '@/components/TableView.vue'
import usePageList from '@/utils/hooks/usePageList'
......
......@@ -141,8 +141,6 @@ export function useOrderDictionaries() {
getUserMark(),
getCustomTagList(),
getLogisticsCompanyAllCodelist(),
getReceiverCountryList(),
loadWarehouseList(),
])
}
......
......@@ -7,7 +7,7 @@ import {
getFactoryOrderNewLogApi,
getOperationOrderByIdApi,
} from '@/api/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew'
import type {
FactoryOrderNewListData,
LogListData,
......
......@@ -6,7 +6,7 @@ import {
getSuspendStatisticsApi,
} from '@/api/factoryOrderNew'
import type { StatusTreeNode } from '@/types/api/order/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew'
interface UseOrderStatusTreeOptions {
getQueryPayload: () => Record<string, unknown>
......
......@@ -1189,6 +1189,8 @@ const {
craftList,
warehouseList,
productTypeGroups,
getReceiverCountryList,
loadWarehouseList,
loadAllDictionaries,
} = useOrderDictionaries()
......@@ -2925,6 +2927,8 @@ onMounted(() => {
loadStatusTreeCounts()
loadAllDictionaries()
getLogisticsWay()
getReceiverCountryList()
loadWarehouseList()
// 仅用于消除 TS 插件的 unused-vars 警告:template refs 会绑定这两个变量
void treeRef.value
void tableRef.value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment