feat: 支持取消分配储位与状态展示
This commit is contained in:
parent
67bd0bb7c5
commit
411df459f5
@ -136,11 +136,28 @@ export function orderPendingOrderAllocateStorage(
|
|||||||
} as any)
|
} as any)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function orderPendingOrderCancelAllocateStorage(
|
||||||
|
data: PendingOrderAllocateStorageParams
|
||||||
|
): Promise<any> {
|
||||||
|
return request({
|
||||||
|
url: '/system',
|
||||||
|
method: 'post',
|
||||||
|
params: {
|
||||||
|
method: 'order.pendingOrder.cancelAllocateStorage',
|
||||||
|
v,
|
||||||
|
timestamp: Date.now()
|
||||||
|
},
|
||||||
|
data,
|
||||||
|
isSystemApi: true
|
||||||
|
} as any)
|
||||||
|
}
|
||||||
|
|
||||||
export const orderPendingOrder = {
|
export const orderPendingOrder = {
|
||||||
list: orderPendingOrderList,
|
list: orderPendingOrderList,
|
||||||
reverseReviewOrder: orderPendingOrderReverseReviewOrder,
|
reverseReviewOrder: orderPendingOrderReverseReviewOrder,
|
||||||
markPendingOutboundOrder: orderPendingOrderMarkPendingOutboundOrder,
|
markPendingOutboundOrder: orderPendingOrderMarkPendingOutboundOrder,
|
||||||
cancelOrder: orderPendingOrderCancelOrder,
|
cancelOrder: orderPendingOrderCancelOrder,
|
||||||
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
allocateExpressCode: orderPendingOrderAllocateExpressCode,
|
||||||
allocateStorage: orderPendingOrderAllocateStorage
|
allocateStorage: orderPendingOrderAllocateStorage,
|
||||||
|
cancelAllocateStorage: orderPendingOrderCancelAllocateStorage
|
||||||
}
|
}
|
||||||
|
|||||||
@ -41,7 +41,7 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { reactive, ref } from 'vue'
|
import { reactive, ref } from 'vue'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(e: 'success', data: any): void
|
(e: 'success', data: any): void
|
||||||
|
|||||||
@ -157,18 +157,18 @@ export const deliveryAvailableFields = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
export const deliveryColumns = [
|
export const deliveryColumns = [
|
||||||
{ prop: 'delivery_order_code', label: '配送单号', width: '170' },
|
|
||||||
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
{ prop: 'shop_nick', label: '店铺名称', width: '140' },
|
||||||
|
{ prop: 'delivery_order_code', label: '配送单号', width: '170' },
|
||||||
{ prop: 'source_platform_code', label: '平台来源', width: '100' },
|
{ prop: 'source_platform_code', label: '平台来源', width: '100' },
|
||||||
{ prop: 'name', label: '收货人', width: '100' },
|
{ prop: 'name', label: '收货人', width: '100' },
|
||||||
{ prop: 'mobile', label: '手机号', width: '120' },
|
{ prop: 'mobile', label: '手机号', width: '120' },
|
||||||
{ prop: 'status', label: '订单状态', width: '100' },
|
{ prop: 'status', label: '订单状态', width: '100' },
|
||||||
{ prop: 'outbound_status', label: '出库状态', width: '100' },
|
{ prop: 'outbound_status', label: '出库状态', width: '100' },
|
||||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||||
{ prop: 'storage_status', label: '分配状态', width: '100' },
|
{ prop: 'storage_status', label: '储位', width: '100' },
|
||||||
{ prop: 'post_status', label: '快递状态', width: '100' },
|
{ prop: 'post_status', label: '快递', width: '100' },
|
||||||
{ prop: 'pick_status', label: '拣货状态', width: '100' },
|
{ prop: 'pick_status', label: '拣货', width: '100' },
|
||||||
{ prop: 'pack_status', label: '打包状态', width: '100' },
|
{ prop: 'pack_status', label: '打包', width: '100' },
|
||||||
{ prop: 'logistics_name', label: '物流公司', width: '120' },
|
{ prop: 'logistics_name', label: '物流公司', width: '120' },
|
||||||
{ prop: 'express_code', label: '物流单号', width: '160' },
|
{ prop: 'express_code', label: '物流单号', width: '160' },
|
||||||
{ prop: 'is_urgency', label: '紧急', width: '80' },
|
{ prop: 'is_urgency', label: '紧急', width: '80' },
|
||||||
|
|||||||
@ -144,7 +144,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import { orderDeliveryOrder } from '@/api/order.deliveryorder/orderdeliveryOrder'
|
import { orderDeliveryOrder } from '@/api/order.deliveryOrder/orderdeliveryOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
deliveryAvailableFields,
|
deliveryAvailableFields,
|
||||||
|
|||||||
@ -217,7 +217,7 @@ import ScanBox from '@/components/ScanBox/index.vue'
|
|||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import * as indexApi from '@/api/index/index'
|
import * as indexApi from '@/api/index/index'
|
||||||
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
import { orderExpectionOrder } from '@/api/order.expectionorder/orderexpectionorder'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
expectionColumns,
|
expectionColumns,
|
||||||
|
|||||||
@ -148,7 +148,7 @@ import { computed, nextTick, onMounted, reactive, ref } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import { orderOutboundOrder } from '@/api/order.outboundorder/orderoutboundOrder'
|
import { orderOutboundOrder } from '@/api/order.outboundOrder/orderoutboundOrder'
|
||||||
import {
|
import {
|
||||||
outboundAvailableFields,
|
outboundAvailableFields,
|
||||||
outboundColumns,
|
outboundColumns,
|
||||||
|
|||||||
@ -29,6 +29,16 @@
|
|||||||
>
|
>
|
||||||
分配储位
|
分配储位
|
||||||
</el-button>
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
:disabled="!hasSelection"
|
||||||
|
:loading="storageAllocateLoading"
|
||||||
|
@click="openStorageCancelDialog"
|
||||||
|
>
|
||||||
|
取消分配储位
|
||||||
|
</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="small"
|
size="small"
|
||||||
type="success"
|
type="success"
|
||||||
@ -92,7 +102,12 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-storage_status="{ row }">
|
<template #column-storage_status="{ row }">
|
||||||
{{ translateOrderField('storage_status', row.storage_status) }}
|
<el-tag
|
||||||
|
:type="['fin', 'done', 'finished'].includes(row.storage_status) ? 'success' : ['padding', 'pending', 'pedding', 'processing'].includes(row.storage_status) ? 'warning' : ['error', 'failed'].includes(row.storage_status) ? 'danger' : 'info'"
|
||||||
|
size="small"
|
||||||
|
>
|
||||||
|
{{ translateOrderField('storage_status', row.storage_status) }}
|
||||||
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #column-print_status="{ row }">
|
<template #column-print_status="{ row }">
|
||||||
@ -175,7 +190,7 @@
|
|||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
v-model="storageDialogVisible"
|
v-model="storageDialogVisible"
|
||||||
title="按订单批量分配储位"
|
:title="storageDialogMode === 'cancel' ? '按订单批量取消分配储位' : '按订单批量分配储位'"
|
||||||
width="520px"
|
width="520px"
|
||||||
align-center
|
align-center
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
@ -193,14 +208,14 @@
|
|||||||
<el-form-item label="已选订单数">
|
<el-form-item label="已选订单数">
|
||||||
<span>{{ storagePendingOrderIds.length }} 条</span>
|
<span>{{ storagePendingOrderIds.length }} 条</span>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="允许存储储位">
|
<el-form-item v-if="storageDialogMode !== 'cancel'" label="允许存储储位">
|
||||||
<el-switch v-model="storageForm.allowStorageLocation" active-text="是" inactive-text="否" />
|
<el-switch v-model="storageForm.allowStorageLocation" active-text="是" inactive-text="否" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button @click="storageDialogVisible = false">取消</el-button>
|
<el-button @click="storageDialogVisible = false">取消</el-button>
|
||||||
<el-button type="primary" :loading="storageAllocateLoading" @click="submitStorageAllocate">
|
<el-button type="primary" :loading="storageAllocateLoading" @click="submitStorageAllocate">
|
||||||
开始分配
|
{{ storageDialogMode === 'cancel' ? '确认取消' : '开始分配' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
@ -213,7 +228,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import { orderPendingOrder } from '@/api/order.pendingorder/orderpendingOrder'
|
import { orderPendingOrder } from '@/api/order.pendingOrder/orderpendingOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
pendingCloums,
|
pendingCloums,
|
||||||
@ -257,6 +272,7 @@ const allocateDialogVisible = ref(false)
|
|||||||
const allocatePendingRows = ref<any[]>([])
|
const allocatePendingRows = ref<any[]>([])
|
||||||
|
|
||||||
const storageDialogVisible = ref(false)
|
const storageDialogVisible = ref(false)
|
||||||
|
const storageDialogMode = ref<'allocate' | 'cancel'>('allocate')
|
||||||
/** 打开储位弹窗时快照的订单 ID,避免提交前勾选变化 */
|
/** 打开储位弹窗时快照的订单 ID,避免提交前勾选变化 */
|
||||||
const storagePendingOrderIds = ref<Array<number | string>>([])
|
const storagePendingOrderIds = ref<Array<number | string>>([])
|
||||||
const storageForm = reactive<{
|
const storageForm = reactive<{
|
||||||
@ -405,9 +421,9 @@ function getSelectedIds() {
|
|||||||
.filter((id: any) => id !== undefined && id !== null)
|
.filter((id: any) => id !== undefined && id !== null)
|
||||||
}
|
}
|
||||||
|
|
||||||
function openStorageAllocateDialog() {
|
function openStorageDialog(mode: 'allocate' | 'cancel') {
|
||||||
if (!selectionRows.value.length) {
|
if (!selectionRows.value.length) {
|
||||||
ElMessage.warning('请先勾选需要分配储位的订单')
|
ElMessage.warning(mode === 'cancel' ? '请先勾选需要取消分配储位的订单' : '请先勾选需要分配储位的订单')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const ids = getSelectedIds()
|
const ids = getSelectedIds()
|
||||||
@ -415,12 +431,22 @@ function openStorageAllocateDialog() {
|
|||||||
ElMessage.error('选中行缺少订单 id,请刷新后重试')
|
ElMessage.error('选中行缺少订单 id,请刷新后重试')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
storageDialogMode.value = mode
|
||||||
storagePendingOrderIds.value = [...ids]
|
storagePendingOrderIds.value = [...ids]
|
||||||
storageForm.allowStorageLocation = false
|
storageForm.allowStorageLocation = false
|
||||||
storageDialogVisible.value = true
|
storageDialogVisible.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openStorageAllocateDialog() {
|
||||||
|
openStorageDialog('allocate')
|
||||||
|
}
|
||||||
|
|
||||||
|
function openStorageCancelDialog() {
|
||||||
|
openStorageDialog('cancel')
|
||||||
|
}
|
||||||
|
|
||||||
function resetStorageAllocateDialog() {
|
function resetStorageAllocateDialog() {
|
||||||
|
storageDialogMode.value = 'allocate'
|
||||||
storagePendingOrderIds.value = []
|
storagePendingOrderIds.value = []
|
||||||
storageForm.allowStorageLocation = false
|
storageForm.allowStorageLocation = false
|
||||||
}
|
}
|
||||||
@ -428,38 +454,35 @@ function resetStorageAllocateDialog() {
|
|||||||
async function submitStorageAllocate() {
|
async function submitStorageAllocate() {
|
||||||
const order_ids = [...storagePendingOrderIds.value]
|
const order_ids = [...storagePendingOrderIds.value]
|
||||||
if (!order_ids.length || storageAllocateLoading.value) return
|
if (!order_ids.length || storageAllocateLoading.value) return
|
||||||
try {
|
|
||||||
await ElMessageBox.confirm(
|
const isCancel = storageDialogMode.value === 'cancel'
|
||||||
`确定对 ${order_ids.length} 条订单发起储位分配吗?`,
|
|
||||||
'确认',
|
|
||||||
{ type: 'warning' }
|
|
||||||
)
|
|
||||||
} catch {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
storageAllocateLoading.value = true
|
storageAllocateLoading.value = true
|
||||||
try {
|
try {
|
||||||
const payload: Record<string, any> = {
|
const payload: Record<string, any> = isCancel
|
||||||
order_ids,
|
? { order_ids }
|
||||||
allowStorageLocation: storageForm.allowStorageLocation
|
: {
|
||||||
}
|
order_ids,
|
||||||
const res = await orderPendingOrder.allocateStorage(payload)
|
allowStorageLocation: storageForm.allowStorageLocation
|
||||||
|
}
|
||||||
|
const res = isCancel
|
||||||
|
? await orderPendingOrder.cancelAllocateStorage(payload)
|
||||||
|
: await orderPendingOrder.allocateStorage(payload)
|
||||||
const ok =
|
const ok =
|
||||||
res &&
|
res &&
|
||||||
(res.code === 1 || res.code === 200 || res.flag === 'success')
|
(res.code === 1 || res.code === 200 || res.flag === 'success')
|
||||||
if (ok) {
|
if (ok) {
|
||||||
ElMessage.success(res.message || '储位分配已提交')
|
ElMessage.success(res.message || (isCancel ? '取消分配储位已提交' : '储位分配已提交'))
|
||||||
storageDialogVisible.value = false
|
storageDialogVisible.value = false
|
||||||
upperTable.value?.clearSelection?.()
|
upperTable.value?.clearSelection?.()
|
||||||
selectionRows.value = []
|
selectionRows.value = []
|
||||||
hasSelection.value = false
|
hasSelection.value = false
|
||||||
await loadData()
|
await loadData()
|
||||||
} else {
|
} else {
|
||||||
ElMessage.error(res?.message || '储位分配失败')
|
ElMessage.error(res?.message || (isCancel ? '取消分配储位失败' : '储位分配失败'))
|
||||||
}
|
}
|
||||||
} catch {
|
} catch {
|
||||||
ElMessage.error('储位分配失败')
|
ElMessage.error(isCancel ? '取消分配储位失败' : '储位分配失败')
|
||||||
} finally {
|
} finally {
|
||||||
storageAllocateLoading.value = false
|
storageAllocateLoading.value = false
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,7 +122,7 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
|||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
import { orderReviewOrder } from '@/api/order.revieworder/orderreviewOrder'
|
import { orderReviewOrder } from '@/api/order.reviewOrder/orderreviewOrder'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
reviewAvailableFields,
|
reviewAvailableFields,
|
||||||
|
|||||||
@ -264,7 +264,7 @@ import {
|
|||||||
printFormConfig,
|
printFormConfig,
|
||||||
addReceivingFields
|
addReceivingFields
|
||||||
} from './receiving-config'
|
} from './receiving-config'
|
||||||
import * as templateApi from '@/api/setting.printtemplate/printTemplate'
|
import * as templateApi from '@/api/setting.printTemplate/printTemplate'
|
||||||
import * as stationApi from '@/api/print/print'
|
import * as stationApi from '@/api/print/print'
|
||||||
import JsBarcode from 'jsbarcode'
|
import JsBarcode from 'jsbarcode'
|
||||||
import * as XLSX from 'xlsx'
|
import * as XLSX from 'xlsx'
|
||||||
|
|||||||
@ -732,7 +732,7 @@
|
|||||||
import { ref, reactive, onMounted, computed } from 'vue'
|
import { ref, reactive, onMounted, computed } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { Search, Plus, Refresh, QuestionFilled } from '@element-plus/icons-vue'
|
import { Search, Plus, Refresh, QuestionFilled } from '@element-plus/icons-vue'
|
||||||
import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind, storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields, storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig, storeWarehouseAdjustPrintQuantity, listApiConfig } from '@/api/storewarehouse.store/storeWarehouse'
|
import { storeWarehouseList, storeWarehouseSign, storeWarehouseUnbind, storeWarehouseRename, storeWarehouseGetPolicyConfig, storeWarehouseGetPolicyConfigFields, storeWarehouseSavePolicyConfig, saveApiConfig, storeWarehouseDeleteQimenConfig, storeWarehouseAdjustPrintQuantity, listApiConfig } from '@/api/storeWarehouse.store/storeWarehouse'
|
||||||
import { listInterfaceTypes } from '@/api/index/index'
|
import { listInterfaceTypes } from '@/api/index/index'
|
||||||
import ScanBox from '@/components/ScanBox/index.vue'
|
import ScanBox from '@/components/ScanBox/index.vue'
|
||||||
import UpperTable from '@/components/UpperTable/index.vue'
|
import UpperTable from '@/components/UpperTable/index.vue'
|
||||||
|
|||||||
@ -271,7 +271,7 @@ import {
|
|||||||
expressInterfaceList,
|
expressInterfaceList,
|
||||||
expressInterfaceListByWarehousePlatformCode,
|
expressInterfaceListByWarehousePlatformCode,
|
||||||
expressInterfaceUpdate
|
expressInterfaceUpdate
|
||||||
} from '@/api/setting.expressinterface/expressInterface'
|
} from '@/api/setting.expressInterface/expressInterface'
|
||||||
import { useUserStore } from '@/stores/modules/user'
|
import { useUserStore } from '@/stores/modules/user'
|
||||||
|
|
||||||
type ExpressOption = { code: string; name: string; label?: string }
|
type ExpressOption = { code: string; name: string; label?: string }
|
||||||
|
|||||||
@ -53,7 +53,7 @@ import { ref, computed, onMounted } from 'vue'
|
|||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage } from 'element-plus'
|
||||||
import { Document, Folder } from '@element-plus/icons-vue'
|
import { Document, Folder } from '@element-plus/icons-vue'
|
||||||
import TemplateEditor from './components/TemplateEditor.vue'
|
import TemplateEditor from './components/TemplateEditor.vue'
|
||||||
import * as TemplatesApi from '@/api/setting.printtemplate/printTemplate'
|
import * as TemplatesApi from '@/api/setting.printTemplate/printTemplate'
|
||||||
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
import { usePrintTemplateStore } from '@/stores/modules/printTemplate'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user