Commit a18364fe by qinjianhui

Merge branch 'dev' into 'master'

Dev

See merge request !204
parents 12e1e603 01701ca7
...@@ -57,6 +57,7 @@ declare module 'vue' { ...@@ -57,6 +57,7 @@ declare module 'vue' {
ElTimePicker: typeof import('element-plus/es')['ElTimePicker'] ElTimePicker: typeof import('element-plus/es')['ElTimePicker']
ElTooltip: typeof import('element-plus/es')['ElTooltip'] ElTooltip: typeof import('element-plus/es')['ElTooltip']
ElTree: typeof import('element-plus/es')['ElTree'] ElTree: typeof import('element-plus/es')['ElTree']
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
ElUpload: typeof import('element-plus/es')['ElUpload'] ElUpload: typeof import('element-plus/es')['ElUpload']
Icon: typeof import('./src/components/Icon.vue')['default'] Icon: typeof import('./src/components/Icon.vue')['default']
ImageView: typeof import('./src/components/ImageView.vue')['default'] ImageView: typeof import('./src/components/ImageView.vue')['default']
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
"unplugin-auto-import": "^0.17.5", "unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5", "unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"vite": "^5.1.4" "vite": "^5.1.4",
"vite-plugin-compression": "^0.5.1"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -4320,6 +4321,20 @@ ...@@ -4320,6 +4321,20 @@
"node": ">=0.8" "node": ">=0.8"
} }
}, },
"node_modules/fs-extra": {
"version": "10.1.0",
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-10.1.0.tgz",
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
"dev": true,
"dependencies": {
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^2.0.0"
},
"engines": {
"node": ">=12"
}
},
"node_modules/fs.realpath": { "node_modules/fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/fs.realpath/-/fs.realpath-1.0.0.tgz",
...@@ -4509,6 +4524,12 @@ ...@@ -4509,6 +4524,12 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/graceful-fs": {
"version": "4.2.11",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==",
"dev": true
},
"node_modules/graphemer": { "node_modules/graphemer": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz", "resolved": "https://registry.npmmirror.com/graphemer/-/graphemer-1.4.0.tgz",
...@@ -4842,6 +4863,18 @@ ...@@ -4842,6 +4863,18 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/jsonfile": {
"version": "6.2.1",
"resolved": "https://registry.npmmirror.com/jsonfile/-/jsonfile-6.2.1.tgz",
"integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==",
"dev": true,
"dependencies": {
"universalify": "^2.0.0"
},
"optionalDependencies": {
"graceful-fs": "^4.1.6"
}
},
"node_modules/keyv": { "node_modules/keyv": {
"version": "4.5.4", "version": "4.5.4",
"resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz", "resolved": "https://registry.npmmirror.com/keyv/-/keyv-4.5.4.tgz",
...@@ -6201,6 +6234,15 @@ ...@@ -6201,6 +6234,15 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/universalify": {
"version": "2.0.1",
"resolved": "https://registry.npmmirror.com/universalify/-/universalify-2.0.1.tgz",
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
"dev": true,
"engines": {
"node": ">= 10.0.0"
}
},
"node_modules/unplugin": { "node_modules/unplugin": {
"version": "1.16.1", "version": "1.16.1",
"resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.16.1.tgz", "resolved": "https://registry.npmmirror.com/unplugin/-/unplugin-1.16.1.tgz",
...@@ -6516,6 +6558,20 @@ ...@@ -6516,6 +6558,20 @@
} }
} }
}, },
"node_modules/vite-plugin-compression": {
"version": "0.5.1",
"resolved": "https://registry.npmmirror.com/vite-plugin-compression/-/vite-plugin-compression-0.5.1.tgz",
"integrity": "sha512-5QJKBDc+gNYVqL/skgFAP81Yuzo9R+EAf19d+EtsMF/i8kFUpNi3J/H01QD3Oo8zBQn+NzoCIFkpPLynoOzaJg==",
"dev": true,
"dependencies": {
"chalk": "^4.1.2",
"debug": "^4.3.3",
"fs-extra": "^10.0.0"
},
"peerDependencies": {
"vite": ">=2.0.0"
}
},
"node_modules/vscode-uri": { "node_modules/vscode-uri": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz", "resolved": "https://registry.npmmirror.com/vscode-uri/-/vscode-uri-3.1.0.tgz",
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
"unplugin-auto-import": "^0.17.5", "unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5", "unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"vite": "^5.1.4" "vite": "^5.1.4",
"vite-plugin-compression": "^0.5.1"
} }
} }
import axios from './axios'
import type { BasePaginationData, BaseRespData } from '@/types/api'
import type { CancelOrderProcessStateGroupMap } from '@/types/api/cancelOrderProcess'
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 getCancelOrderProcessStateGroupMapApi() {
return axios.get<never, BaseRespData<CancelOrderProcessStateGroupMap>>(
'factory/podOrderOperationForReclaim/findStateGroupMap',
)
}
export function getCancelOrderProcessListApi(
data: Record<string, unknown>,
currentPage: number,
pageSize: number,
alreadyInStock: boolean,
) {
const body = normalizePodOrderQueryPayload({ ...data })
return axios.post<never, BasePaginationData<operateOrderListData>>(
'factory/podOrderOperationForReclaim/list_page',
{ ...body, currentPage, pageSize, alreadyInStock },
)
}
export function getOperationInfoByNoApi(operationNo: string) {
return axios.get<never, BaseRespData<operateOrderListData>>(
`factory/podOrderOperationForReclaim/getByOperationNo?operationNo=${operationNo}`,
)
}
export function completeDeliveryByCancelOrderProcessApi(data: {
operationNo: string
inboundType: number
warehouseId: number
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podOrderOperationForReclaim/storeAfterScan',
data,
)
}
...@@ -6,15 +6,15 @@ import type { ...@@ -6,15 +6,15 @@ import type {
LogListData, LogListData,
operateOrderListData, operateOrderListData,
PickCompleteData, PickCompleteData,
PickFailData,
ProductListData, ProductListData,
RestockData, RestockData,
SearchForm, SearchForm,
StatusTreeNode, StatusTreeNode,
} from '@/types/api/factoryOrderNew/factoryOrderNew' } from '@/types/api/factoryOrderNew'
import { ResultInfoDataItem } from '@/types/api/order/common' import { ResultInfoDataItem } from '@/types/api/order/common'
import { ExportParams } from '@/types/api/order/factoryOrderNew' import { ExportParams } from '@/types/api/order/factoryOrderNew'
import type { OrderData } from '@/types/api/podMakeOrder' import type { OrderData } from '@/types/api/podMakeOrder'
import type { LogisticsData } from '@/types/api/podCnOrder'
import type { PrintData } from '@/types/api/podOrder' import type { PrintData } from '@/types/api/podOrder'
function normalizePodOrderQueryPayload( function normalizePodOrderQueryPayload(
data: Record<string, unknown>, data: Record<string, unknown>,
...@@ -44,6 +44,7 @@ export function getFactoryOrderNewListApi( ...@@ -44,6 +44,7 @@ export function getFactoryOrderNewListApi(
status?: string, status?: string,
subStatus?: number, subStatus?: number,
pauseReason?: number, pauseReason?: number,
cancelSubType?: number,
) { ) {
const body = normalizePodOrderQueryPayload({ ...data } as Record< const body = normalizePodOrderQueryPayload({ ...data } as Record<
string, string,
...@@ -58,6 +59,7 @@ export function getFactoryOrderNewListApi( ...@@ -58,6 +59,7 @@ export function getFactoryOrderNewListApi(
status, status,
acceptedStatus: subStatus, acceptedStatus: subStatus,
pauseReason, pauseReason,
cancelSubType,
}, },
) )
} }
...@@ -112,6 +114,14 @@ export function getFactoryOrderNewLogApi(id: number | string) { ...@@ -112,6 +114,14 @@ export function getFactoryOrderNewLogApi(id: number | string) {
}, },
) )
} }
export function getOperationOrderByIdApi(id: number | string) {
return axios.get<never, BaseRespData<operateOrderListData[]>>(
'factory/podOrderOperation/getByPodOrderId',
{
params: { podOrderId: id },
},
)
}
export function refreshProductInfoApi(data: { export function refreshProductInfoApi(data: {
orderIds?: number | string orderIds?: number | string
...@@ -257,13 +267,6 @@ export function replenishmentCompleteApi(ids: (number | string)[]) { ...@@ -257,13 +267,6 @@ export function replenishmentCompleteApi(ids: (number | string)[]) {
) )
} }
export function pickFailApi(ids: (number | string)[]) {
return axios.post<never, BaseRespData<PickFailData[]>>(
'factory/podOrderOperation/listByIds',
{ ids },
)
}
export function getCardLayoutListApi( export function getCardLayoutListApi(
data: Record<string, unknown>, data: Record<string, unknown>,
currentPage: number, currentPage: number,
...@@ -308,6 +311,23 @@ export function getSuspendStatisticsApi( ...@@ -308,6 +311,23 @@ export function getSuspendStatisticsApi(
) )
} }
/** 已取消列表子 tab 数量统计(与挂起 suspendStatistics 用法一致) */
export function getCancelledOrderStatisticsApi(
data: SearchForm,
currentPage: number,
pageSize: number,
cancelSubType?: number,
) {
const body = normalizePodOrderQueryPayload({ ...data } as Record<
string,
unknown
>)
return axios.post<never, BaseRespData<Record<string, number>>>(
'factory/podOrder/cancelledStatistics',
{ ...body, currentPage, pageSize, cancelSubType },
)
}
export function getSuspendDetailApi(id: number | string) { export function getSuspendDetailApi(id: number | string) {
return axios.get<never, BaseRespData<ProductListData[]>>( return axios.get<never, BaseRespData<ProductListData[]>>(
'factory/podOrderPauseControl/get', 'factory/podOrderPauseControl/get',
...@@ -467,6 +487,26 @@ export function syncReceiverAddress(data: number[]) { ...@@ -467,6 +487,26 @@ export function syncReceiverAddress(data: number[]) {
) )
} }
export function getLogisticsCalculation(id: number) {
return axios.get<never, BaseRespData<never>>(
'factory/podOrder/getLogisticsCalculation',
{ params: { id } },
)
}
export function changeLogisticsApi(params: {
updateByIdParam: {
id: string | number
dataVersion: number
}
logisticsTrialCalculation: LogisticsData
}) {
return axios.post<never, BaseRespData<never>>(
'factory/podOrder/changeLogistics',
params,
)
}
export function updateReceiverAddressApi(data: object) { export function updateReceiverAddressApi(data: object) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podOrder/updateReceiverAddress', 'factory/podOrder/updateReceiverAddress',
...@@ -590,3 +630,19 @@ export function exportFactoryOrderInfo(data: ExportParams) { ...@@ -590,3 +630,19 @@ export function exportFactoryOrderInfo(data: ExportParams) {
data, data,
) )
} }
export function interceptUpdateApi(ids: (string | number)[]) {
return axios.post<never, BaseRespData<ResultInfoDataItem[]>>(
'factory/podOrder/factoryOrderUnblock',
ids,
)
}
export function interceptSuccessApi(
data: { factoryOrderNumber: string; suspendSussessType: number }[],
) {
return axios.post<never, BaseRespData<ResultInfoDataItem[]>>(
'factory/podOrder/factoryOrderBlockSuccess',
data,
)
}
...@@ -66,6 +66,24 @@ export function getOrderList( ...@@ -66,6 +66,24 @@ export function getOrderList(
}, },
) )
} }
export function getOrderTrackingList(
params: SearchForm,
currentPage: number,
pageSize: number,
orderTracking?: boolean,
) {
return axios.post<never, BasePaginationData<PodUsOrderListData>>(
'/factory/podJomallOrderUs/get-order-tracking-list',
{
...params,
currentPage,
pageSize,
orderTracking,
},
)
}
export function handleExceptionOrderApi(orderIds: number[]) { export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders', 'factory/podJomallOrderUs/processExceptionOrders',
......
...@@ -107,6 +107,14 @@ const router = createRouter({ ...@@ -107,6 +107,14 @@ const router = createRouter({
import('@/views/order/factoryOrderNew/index.vue'), 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', path: '/pod-cn-order/orderTracking',
meta: { meta: {
title: 'POD(CN)订单跟踪', title: 'POD(CN)订单跟踪',
......
...@@ -151,6 +151,11 @@ const menu: MenuItem[] = [ ...@@ -151,6 +151,11 @@ const menu: MenuItem[] = [
id: 12, id: 12,
label: '工厂订单(NEW)', label: '工厂订单(NEW)',
}, },
// {
// index: '/order/cancel-order-process',
// id: 13,
// label: '取消后订单处理',
// },
], ],
}, },
{ {
......
export interface CancelOrderProcessStateGroupMap {
alreadyInStock: number
NotInStock: number
}
import type { PaginationData } from '@/types/api'
export interface StatusTreeNode { export interface StatusTreeNode {
status: string status: string
statusName: string statusName: string
...@@ -271,3 +272,9 @@ export interface PickFailData { ...@@ -271,3 +272,9 @@ export interface PickFailData {
afterOutOccupied?: number afterOutOccupied?: number
afterOutAvailable?: number afterOutAvailable?: number
} }
export type CardLayoutListFetcher = (
payload: Record<string, unknown>,
currentPage: number,
pageSize: number,
) => Promise<PaginationData<operateOrderListData>>
...@@ -92,6 +92,8 @@ export interface FactoryOrderNewListData { ...@@ -92,6 +92,8 @@ export interface FactoryOrderNewListData {
source?: string source?: string
logisticsCompanyName?: string logisticsCompanyName?: string
logisticsCompanyCode?: string logisticsCompanyCode?: string
logisticsWayId?: number | string
logisticsWayName?: string
selfOwned?: boolean selfOwned?: boolean
createTime?: string createTime?: string
updateTime?: string updateTime?: string
......
...@@ -85,7 +85,7 @@ import { ...@@ -85,7 +85,7 @@ import {
} from '@/api/logistics' } from '@/api/logistics'
import { createLogisticsOrdersApi } from '@/api/podCnOrder' import { createLogisticsOrdersApi } from '@/api/podCnOrder'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew/factoryOrderNew' import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew'
const createLogisticDialogVisible = ref(false) const createLogisticDialogVisible = ref(false)
const props = defineProps<{ const props = defineProps<{
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { updateCustomDeclarationInfoApi } from '@/api/podCnOrder' import { updateCustomDeclarationInfoApi } from '@/api/podCnOrder'
import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew/factoryOrderNew' import { FactoryOrderNewListData } from '@/types/api/factoryOrderNew'
import { import {
CustomDeclarationInfoForm, CustomDeclarationInfoForm,
PodCnOrderListData, PodCnOrderListData,
......
...@@ -196,7 +196,7 @@ import { ...@@ -196,7 +196,7 @@ import {
printPickPdfByBatchNumberApi, printPickPdfByBatchNumberApi,
printProductionPdfByBatchNumberApi, printProductionPdfByBatchNumberApi,
} from '@/api/factoryOrderNew' } 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 type { PaginationData } from '@/types/api'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import ArrangeDialog from './ArrangeDialog.vue' import ArrangeDialog from './ArrangeDialog.vue'
......
...@@ -293,19 +293,32 @@ import { ...@@ -293,19 +293,32 @@ import {
getFactoryOrderNewLogApi, getFactoryOrderNewLogApi,
} from '@/api/factoryOrderNew' } from '@/api/factoryOrderNew'
import type { PaginationData } from '@/types/api' import type { PaginationData } from '@/types/api'
import type { CardLayoutListFetcher } from '@/types/api/factoryOrderNew'
import usePageList from '@/utils/hooks/usePageList' 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 type { LogListData } from '@/types/api/order'
import LogList from '@/components/LogList.vue' import LogList from '@/components/LogList.vue'
import RightClickMenu from '@/components/RightClickMenu.vue' import RightClickMenu from '@/components/RightClickMenu.vue'
import platformJson from '../../../../json/platform.json' import platformJson from '../../../../json/platform.json'
const props = defineProps<{ const props = defineProps<{
status: string status?: string
queryPayload: Record<string, unknown> queryPayload?: Record<string, unknown>
initPageSize?: number 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<{ const emit = defineEmits<{
'selection-change': [items: operateOrderListData[]] 'selection-change': [items: operateOrderListData[]]
'view-detail': [item: operateOrderListData] 'view-detail': [item: operateOrderListData]
...@@ -324,9 +337,9 @@ const { ...@@ -324,9 +337,9 @@ const {
initPageSize: props.initPageSize || 100, initPageSize: props.initPageSize || 100,
initLoad: false, initLoad: false,
query: async (current, size) => { query: async (current, size) => {
const payload = { const payload = buildListPayload()
...props.queryPayload, if (props.fetchList) {
status: props.status === 'ALL' ? undefined : props.status, return props.fetchList(payload, current, size)
} }
const res = await getCardLayoutListApi(payload, current, size) const res = await getCardLayoutListApi(payload, current, size)
return res.data as unknown as PaginationData<operateOrderListData> return res.data as unknown as PaginationData<operateOrderListData>
...@@ -411,13 +424,20 @@ const rightChange = (code: string) => { ...@@ -411,13 +424,20 @@ const rightChange = (code: string) => {
const openLogDialog = async (item: operateOrderListData) => { const openLogDialog = async (item: operateOrderListData) => {
if (!item.podOrderId) return if (!item.podOrderId) return
const loading = ElLoading.service({
fullscreen: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try { try {
const res = await getFactoryOrderNewLogApi(item.podOrderId as number) const res = await getFactoryOrderNewLogApi(item.podOrderId as number)
logList.value = (res.data || []) as unknown as LogListData[] logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true logVisible.value = true
} catch (e) { } catch (e) {
// ignore // ignore
} } finally {
loading.close()
}
} }
const clearSelection = () => { const clearSelection = () => {
......
...@@ -257,7 +257,7 @@ import platformJson from '../../../../json/platform.json' ...@@ -257,7 +257,7 @@ import platformJson from '../../../../json/platform.json'
import type { import type {
operateOrderListData, operateOrderListData,
PickCompleteData, PickCompleteData,
} from '@/types/api/factoryOrderNew/factoryOrderNew' } from '@/types/api/factoryOrderNew'
const emit = defineEmits(['adjustPickOrderSuccess']) const emit = defineEmits(['adjustPickOrderSuccess'])
const props = defineProps<{ const props = defineProps<{
......
...@@ -123,7 +123,7 @@ import { ...@@ -123,7 +123,7 @@ import {
replenishmentCompleteApi, replenishmentCompleteApi,
markStockOutOfApi, markStockOutOfApi,
} from '@/api/factoryOrderNew' } 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 { BaseRespData } from '@/types/api'
import type { import type {
InterProductList, InterProductList,
......
...@@ -71,7 +71,7 @@ import { ref } from 'vue' ...@@ -71,7 +71,7 @@ import { ref } from 'vue'
import { ElMessage, ElMessageBox, ElLoading } from 'element-plus' import { ElMessage, ElMessageBox, ElLoading } from 'element-plus'
import BigNumber from 'bignumber.js' import BigNumber from 'bignumber.js'
import { pickCompleteByIdsDataApi } from '@/api/factoryOrderNew' 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 TableView from '@/components/TableView.vue'
import _ from 'lodash' import _ from 'lodash'
import CreateOutboundDialog from './CreateOutboundDialog.vue' import CreateOutboundDialog from './CreateOutboundDialog.vue'
......
...@@ -63,7 +63,7 @@ const formRef = ref<FormInstance>() ...@@ -63,7 +63,7 @@ const formRef = ref<FormInstance>()
const orderIds = ref<(number | string)[]>([]) const orderIds = ref<(number | string)[]>([])
const suspendReasons = [ const suspendReasons = [
{ label: '客户拦截', value: 1 }, // { label: '客户拦截', value: 1 },
{ label: '地址异常', value: 2 }, { label: '地址异常', value: 2 },
{ label: '素材异常', value: 3 }, { label: '素材异常', value: 3 },
{ label: '其他', value: 4 }, { label: '其他', value: 4 },
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
import { reactive } from 'vue' import { reactive } from 'vue'
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import { getRestockListApi, restockCheckApi } from '@/api/factoryOrderNew' 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 TableView from '@/components/TableView.vue'
import usePageList from '@/utils/hooks/usePageList' import usePageList from '@/utils/hooks/usePageList'
......
...@@ -50,8 +50,11 @@ export function useOrderBatchActions(options: UseOrderBatchActionsOptions) { ...@@ -50,8 +50,11 @@ export function useOrderBatchActions(options: UseOrderBatchActionsOptions) {
const res = await action.api(ids) const res = await action.api(ids)
if (res.code !== 200) return if (res.code !== 200) return
if (action.successText) ElMessage.success(action.successText) if (action.successText) ElMessage.success(action.successText)
if (action.onSuccess) await action.onSuccess(res) if (action.onSuccess) {
await refreshCurrentView({ isRefreshTree: !!action.refreshTree }) await action.onSuccess(res)
} else {
await refreshCurrentView({ isRefreshTree: !!action.refreshTree })
}
if (action.onAfter) await action.onAfter() if (action.onAfter) await action.onAfter()
} catch (e) { } catch (e) {
console.error(e) console.error(e)
......
...@@ -141,8 +141,6 @@ export function useOrderDictionaries() { ...@@ -141,8 +141,6 @@ export function useOrderDictionaries() {
getUserMark(), getUserMark(),
getCustomTagList(), getCustomTagList(),
getLogisticsCompanyAllCodelist(), getLogisticsCompanyAllCodelist(),
getReceiverCountryList(),
loadWarehouseList(),
]) ])
} }
......
...@@ -5,8 +5,9 @@ import { ...@@ -5,8 +5,9 @@ import {
getFactoryOrderNewDetailApi, getFactoryOrderNewDetailApi,
getFactoryOrderNewListApi, getFactoryOrderNewListApi,
getFactoryOrderNewLogApi, getFactoryOrderNewLogApi,
getOperationOrderByIdApi,
} from '@/api/factoryOrderNew' } from '@/api/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew/factoryOrderNew' import type { SearchForm } from '@/types/api/factoryOrderNew'
import type { import type {
FactoryOrderNewListData, FactoryOrderNewListData,
LogListData, LogListData,
...@@ -23,6 +24,7 @@ interface UseOrderListAndDetailOptions { ...@@ -23,6 +24,7 @@ interface UseOrderListAndDetailOptions {
getQueryPayload: () => Record<string, unknown> getQueryPayload: () => Record<string, unknown>
getListPageAcceptedSubStatus: () => number | undefined getListPageAcceptedSubStatus: () => number | undefined
suspendedSubTab: Ref<number> suspendedSubTab: Ref<number>
cancelledSubTab: Ref<number>
} }
export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
...@@ -34,11 +36,13 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -34,11 +36,13 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
getQueryPayload, getQueryPayload,
getListPageAcceptedSubStatus, getListPageAcceptedSubStatus,
suspendedSubTab, suspendedSubTab,
cancelledSubTab,
} = options } = options
const subLoading = ref(false) const subLoading = ref(false)
const activeTab = ref<'product' | 'log'>('product') const activeTab = ref<'product' | 'operation' | 'log'>('product')
const productList = ref<ProductListData[]>([]) const productList = ref<ProductListData[]>([])
const operationOrderList = ref<operateOrderListData[]>([])
const logList = ref<LogListData[]>([]) const logList = ref<LogListData[]>([])
const tableRef = ref() const tableRef = ref()
const currentRow = ref<FactoryOrderNewListData | null>(null) const currentRow = ref<FactoryOrderNewListData | null>(null)
...@@ -73,6 +77,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -73,6 +77,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
} = usePageList<FactoryOrderNewListData>({ } = usePageList<FactoryOrderNewListData>({
query: (page, size) => { query: (page, size) => {
const isSuspendTree = treeStatus.value === 'SUSPEND' const isSuspendTree = treeStatus.value === 'SUSPEND'
const isCancelled = status.value === 'CANCELLED'
return getFactoryOrderNewListApi( return getFactoryOrderNewListApi(
buildListQueryBody(), buildListQueryBody(),
page, page,
...@@ -80,6 +85,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -80,6 +85,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
status.value === 'ALL' ? undefined : status.value, status.value === 'ALL' ? undefined : status.value,
getListPageAcceptedSubStatus(), getListPageAcceptedSubStatus(),
isSuspendTree ? suspendedSubTab.value : undefined, isSuspendTree ? suspendedSubTab.value : undefined,
isCancelled ? cancelledSubTab.value : undefined,
).then(async (res) => { ).then(async (res) => {
const records = res.data.records || [] const records = res.data.records || []
await nextTick(() => { await nextTick(() => {
...@@ -101,6 +107,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -101,6 +107,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
selectedRows.value = [] selectedRows.value = []
cardSelectList.value = [] cardSelectList.value = []
productList.value = [] productList.value = []
operationOrderList.value = []
logList.value = [] logList.value = []
currentRow.value = null currentRow.value = null
listSortProp.value = null listSortProp.value = null
...@@ -160,9 +167,12 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -160,9 +167,12 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
cardSelectList.value = items cardSelectList.value = items
} }
const getOrderDetailsById = async (tabName?: 'product' | 'log') => { const getOrderDetailsById = async (
tabName?: 'product' | 'operation' | 'log',
) => {
if (!currentRow.value) { if (!currentRow.value) {
productList.value = [] productList.value = []
operationOrderList.value = []
logList.value = [] logList.value = []
return return
} }
...@@ -181,6 +191,11 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -181,6 +191,11 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
productList.value = Array.isArray(productRes.data) productList.value = Array.isArray(productRes.data)
? productRes.data ? productRes.data
: [] : []
} else if (effectiveTab === 'operation') {
operationOrderList.value = []
const opRes = await getOperationOrderByIdApi(id)
if (opRes.code !== 200) return
operationOrderList.value = opRes.data
} else { } else {
logList.value = [] logList.value = []
// const logRes = isSuspend // const logRes = isSuspend
...@@ -200,6 +215,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -200,6 +215,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
watch(currentRow, (row) => { watch(currentRow, (row) => {
if (!row) { if (!row) {
productList.value = [] productList.value = []
operationOrderList.value = []
logList.value = [] logList.value = []
return return
} }
...@@ -217,7 +233,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -217,7 +233,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
const handleTabClick = (tab: TabsPaneContext) => { const handleTabClick = (tab: TabsPaneContext) => {
if (!currentRow.value) return if (!currentRow.value) return
const name = tab?.props?.name as 'product' | 'log' | undefined const name = tab?.props?.name as 'product' | 'operation' | 'log' | undefined
void getOrderDetailsById(name) void getOrderDetailsById(name)
} }
...@@ -225,6 +241,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) { ...@@ -225,6 +241,7 @@ export function useOrderListAndDetail(options: UseOrderListAndDetailOptions) {
subLoading, subLoading,
activeTab, activeTab,
productList, productList,
operationOrderList,
logList, logList,
tableRef, tableRef,
currentRow, currentRow,
......
import { computed, ref, nextTick } from 'vue' import { computed, ref, nextTick } from 'vue'
import { import {
getCancelledOrderStatisticsApi,
getPodOrderAcceptedStatisticsApi, getPodOrderAcceptedStatisticsApi,
getPodOrderStateGroupListApi, getPodOrderStateGroupListApi,
getSuspendStatisticsApi, getSuspendStatisticsApi,
} from '@/api/factoryOrderNew' } from '@/api/factoryOrderNew'
import type { StatusTreeNode } from '@/types/api/order/factoryOrderNew' import type { StatusTreeNode } from '@/types/api/order/factoryOrderNew'
import type { SearchForm } from '@/types/api/factoryOrderNew'
interface UseOrderStatusTreeOptions { interface UseOrderStatusTreeOptions {
getQueryPayload: () => Record<string, unknown> getQueryPayload: () => Record<string, unknown>
currentPage: { value: number } currentPage: { value: number }
pageSize: { value: number } pageSize: { value: number }
onClearTableState: () => void
onRefreshCurrentView: () => void
} }
export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
...@@ -19,8 +19,6 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -19,8 +19,6 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
getQueryPayload, getQueryPayload,
currentPage, currentPage,
pageSize, pageSize,
onClearTableState,
onRefreshCurrentView,
} = options } = options
const cardLayoutStatuses = [ const cardLayoutStatuses = [
...@@ -46,12 +44,19 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -46,12 +44,19 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
acceptedOutOfStockCount: 0, acceptedOutOfStockCount: 0,
}) })
const suspendedTabs = ref([ const suspendedTabs = ref([
{ label: '客户拦截', key: 'customerInterceptCount', value: 1, count: 0 }, { label: '客户拦截-取消订单', key: 'customerInterceptCount', value: 1, count: 0 },
{ label: '地址异常', key: 'addressExceptionCount', value: 2, count: 0 }, { label: '地址异常', key: 'addressExceptionCount', value: 2, count: 0 },
{ label: '素材异常', key: 'materialExceptionCount', value: 3, count: 0 }, { label: '素材异常', key: 'materialExceptionCount', value: 3, count: 0 },
{ label: '其他', key: 'otherReasonCount', value: 4, count: 0 }, { label: '其他', key: 'otherReasonCount', value: 4, count: 0 },
]) ])
const suspendedSubTab = ref(1) const suspendedSubTab = ref(1)
/** 已取消:子 tab 与 list_page 的 cancelSubType 取值 1/2/3 对应 */
const cancelledTabs = ref([
{ label: '客户拦截', key: 'customerInterceptCount', value: 1, count: 0 },
{ label: '协商取消', key: 'mutualAgreeCancelCount', value: 2, count: 0 },
{ label: '其他', key: 'otherReasonCount', value: 3, count: 0 },
])
const cancelledSubTab = ref(1)
const treeRef = ref() const treeRef = ref()
const isCardLayout = computed(() => cardLayoutStatuses.includes(status.value)) const isCardLayout = computed(() => cardLayoutStatuses.includes(status.value))
...@@ -107,6 +112,25 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -107,6 +112,25 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
} }
} }
const getCancelledCounts = async () => {
try {
const res = await getCancelledOrderStatisticsApi(
getQueryPayload() as SearchForm,
currentPage.value,
pageSize.value,
cancelledSubTab.value,
)
if (res.code !== 200 || !res.data) return
const data = res.data || {}
cancelledTabs.value = cancelledTabs.value.map((tab) => ({
...tab,
count: data[String(tab.key)] ?? 0,
}))
} catch (e) {
console.error(e)
}
}
const loadStatusTreeCounts = async () => { const loadStatusTreeCounts = async () => {
try { try {
const res = await getPodOrderStateGroupListApi() const res = await getPodOrderStateGroupListApi()
...@@ -121,22 +145,6 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -121,22 +145,6 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
} }
} }
const handleStatusNodeClick = (node: StatusTreeNode) => {
status.value = node.status
if (node.status !== 'PENDING_RECEIVE') {
pendingAcceptSubTab.value = 'PENDING_RECEIVE'
}
if (node.status !== 'SUSPEND') {
suspendedSubTab.value = 1
}
onClearTableState()
if (!isSpecialLayout.value) {
onRefreshCurrentView()
}
if (node.status === 'SUSPEND') {
void getSuspendCounts()
}
}
const handlePendingAcceptTabClick = ( const handlePendingAcceptTabClick = (
tab: 'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK', tab: 'PENDING_RECEIVE' | 'ACCEPT_FAIL_OUT_OF_STOCK',
...@@ -160,6 +168,8 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -160,6 +168,8 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
pendingAcceptCounts, pendingAcceptCounts,
suspendedTabs, suspendedTabs,
suspendedSubTab, suspendedSubTab,
cancelledTabs,
cancelledSubTab,
treeRef, treeRef,
isCardLayout, isCardLayout,
isSpecialLayout, isSpecialLayout,
...@@ -167,9 +177,9 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) { ...@@ -167,9 +177,9 @@ export function useOrderStatusTree(options: UseOrderStatusTreeOptions) {
getListPageAcceptedSubStatus, getListPageAcceptedSubStatus,
getPendingReceiveCounts, getPendingReceiveCounts,
getSuspendCounts, getSuspendCounts,
getCancelledCounts,
loadStatusTreeCounts, loadStatusTreeCounts,
handleStatusNodeClick,
handlePendingAcceptTabClick, handlePendingAcceptTabClick,
toggleExpand, toggleExpand
} }
} }
...@@ -13,7 +13,7 @@ import { ...@@ -13,7 +13,7 @@ import {
import { import {
getListCraftApi, getListCraftApi,
getProductionClientApi, getProductionClientApi,
getOrderList, getOrderTrackingList,
getOperationLogApi, getOperationLogApi,
getOrderTabData, getOrderTabData,
getfaceSimplexFileApi, getfaceSimplexFileApi,
...@@ -44,7 +44,7 @@ import { convertToChinaTime } from '@/utils/index' ...@@ -44,7 +44,7 @@ import { convertToChinaTime } from '@/utils/index'
import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts' import { useEnterKeyTrigger } from '@/utils/hooks/useEnterKeyTrigger.ts'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
const tabName = ref<string>('1')
const [searchForm, resetSearchForm] = useValue<SearchForm>({ const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: 1, timeType: 1,
shopNumber: '', shopNumber: '',
...@@ -539,7 +539,7 @@ const getOrderListFn = async () => { ...@@ -539,7 +539,7 @@ const getOrderListFn = async () => {
}) })
const { currentPage, pageSize } = pagination.value const { currentPage, pageSize } = pagination.value
try { try {
const { data } = await getOrderList( const { data } = await getOrderTrackingList(
{ {
...searchForm.value, ...searchForm.value,
startTime: startTime:
...@@ -711,6 +711,12 @@ function changeChinaTime(zone: string) { ...@@ -711,6 +711,12 @@ function changeChinaTime(zone: string) {
}) })
} }
const tabChange = () => {
if(tabName.value==='2'){
operationLog()
}
}
const handleRadioGroupClick = (event: Event) => { const handleRadioGroupClick = (event: Event) => {
const target = event.target as HTMLElement const target = event.target as HTMLElement
const radioButton = target.closest('.el-radio-button') const radioButton = target.closest('.el-radio-button')
...@@ -790,14 +796,6 @@ useEnterKeyTrigger({ ...@@ -790,14 +796,6 @@ useEnterKeyTrigger({
}, },
}) })
watch(
() => currentRowId.value,
(newValue, oldValue) => {
if (newValue !== oldValue) {
operationLog()
}
},
)
loadTabData() loadTabData()
loadProductionClient() loadProductionClient()
getUserMark() getUserMark()
...@@ -1198,8 +1196,8 @@ onMounted(() => { ...@@ -1198,8 +1196,8 @@ onMounted(() => {
</template> </template>
<template #other> <template #other>
<div class="bottom-table"> <div class="bottom-table">
<el-tabs> <el-tabs v-model="tabName" @tab-change="tabChange">
<el-tab-pane label="商品明细"> <el-tab-pane name="1" label="商品明细">
<TableView <TableView
ref="goodsRef" ref="goodsRef"
v-loading="goodsLoading" v-loading="goodsLoading"
...@@ -1212,7 +1210,7 @@ onMounted(() => { ...@@ -1212,7 +1210,7 @@ onMounted(() => {
</template> </template>
</TableView> </TableView>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="操作日志" @tab-click="operationLog"> <el-tab-pane name="2" label="操作日志" >
<div> <div>
<el-button <el-button
:type="zoneType === 'Asia/Shanghai' ? 'primary' : ''" :type="zoneType === 'Asia/Shanghai' ? 'primary' : ''"
......
...@@ -65,7 +65,14 @@ ...@@ -65,7 +65,14 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { PodCnOrderListData, LogisticsData } from '@/types/api/podCnOrder' import { LogisticsData } from '@/types/api/podCnOrder'
export interface ChangeWayRowData {
id?: number | string
version?: number
logisticsWayId?: number | string | null
logisticsWayName?: string
}
const isChangeWay = ref(false) const isChangeWay = ref(false)
const isChangeWayLoading = ref(false) const isChangeWayLoading = ref(false)
const changeWayRow = ref<LogisticsData>({} as LogisticsData) const changeWayRow = ref<LogisticsData>({} as LogisticsData)
...@@ -76,13 +83,13 @@ const wayDialogTitle = ref('') ...@@ -76,13 +83,13 @@ const wayDialogTitle = ref('')
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
rowData: PodCnOrderListData | null rowData: ChangeWayRowData | null
getTableFn?: (...args: any[]) => any getTableFn?: (...args: any[]) => any
submitFn?: (...args: any[]) => any submitFn?: (...args: any[]) => any
changeLogisticsApi?: (...args: any[]) => any changeLogisticsApi?: (...args: any[]) => any
}>(), }>(),
{ {
rowData: () => ({} as PodCnOrderListData), rowData: () => ({} as ChangeWayRowData),
getTableFn: () => {}, getTableFn: () => {},
submitFn: () => {}, submitFn: () => {},
changeLogisticsApi: () => {}, changeLogisticsApi: () => {},
......
...@@ -4,13 +4,27 @@ import Components from 'unplugin-vue-components/vite' ...@@ -4,13 +4,27 @@ import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers' import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import vueJsx from '@vitejs/plugin-vue-jsx' import vueJsx from '@vitejs/plugin-vue-jsx'
import compression from 'vite-plugin-compression'
// https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: '/', base: '/',
server:{
proxy: {
'/api/': {
target: 'http://172.16.17.244:8060',
},
},
},
plugins: [ plugins: [
vue(), vue(),
compression({
ext: '.gz', // 生成的文件扩展名
compressionOptions: { level: 9 }, // 压缩级别,1-9,越高压缩率越大
algorithm: 'gzip', // 压缩算法,可选 'gzip' | 'brotli'
threshold: 51200, // 阈值:小于100kb的文件不压缩(压缩后反而可能变大)
filter:/\.(js|css|html|svg|json)$/i , // 排除已经压缩过的文件(图片、视频、压缩包本身)
deleteOriginFile: false, // 不要删除原始源文件,默认false,避免回退问题
}),
vueJsx(), vueJsx(),
AutoImport({ AutoImport({
imports: ['vue', 'vue-router', 'pinia'], imports: ['vue', 'vue-router', 'pinia'],
......
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