Commit 58d7286f by qinjianhui

feat: 刷新商品信息功能

parent 6f1cd812
......@@ -90,10 +90,13 @@ export function getFactoryOrderNewLogApi(id: number | string) {
)
}
export function refreshProductInfoApi(ids: (number | string)[]) {
export function refreshProductInfoApi(data: {
orderIds?: (number | string)[]
productIds?: (number | string)[]
}) {
return axios.post<never, BaseRespData<void>>(
'factory/podOrderProduct/refreshProductInfo',
{ ids },
data,
)
}
......@@ -395,15 +398,12 @@ export function listByNoPodOrderApi(params: {
no: string
logisticsCompanyCode?: string
}) {
return axios.get<never, BaseRespData<never>>(
'factory/podOrder/listByNo',
{ params },
)
return axios.get<never, BaseRespData<never>>('factory/podOrder/listByNo', {
params,
})
}
export function orderWeighingPodOrderApi(
params: unknown,
) {
export function orderWeighingPodOrderApi(params: unknown) {
return axios.post<never, BaseRespData<never>>(
'factory/podOrder/orderWeighing',
params as {
......
......@@ -1421,13 +1421,28 @@ const handleCancelOrder = () => {
if (!ensureSelection()) return
cancelOrderDialogRef.value?.open(getSelectedIds())
}
const handleRefreshProductInfo = async () =>
executeBatchAction({
getIds: getSelectedIds,
api: refreshProductInfoApi,
confirmText: '确定刷新商品信息吗?',
successText: '刷新商品信息成功',
const handleRefreshProductInfo = async () => {
try {
await ElMessageBox.confirm('确定刷新商品信息吗?', '提示', {
type: 'warning',
confirmButtonText: '确认',
cancelButtonText: '取消',
})
} catch {
return
}
try {
const res = await refreshProductInfoApi({
orderIds: !isCardLayout.value ? getSelectedIds() : undefined,
productIds: isCardLayout.value ? getSelectedIds() : undefined,
})
if (res.code !== 200) return
ElMessage.success('刷新商品信息成功')
refreshCurrentView()
} catch (e) {
console.error(e)
}
}
const handleTransferOldFlow = async () => {
try {
await executeBatchAction({
......
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