- 迁移:inbound_orders / outbound_orders 增加 subsidiary_id 与索引,按仓库回填 - 单据货主由仓库决定:创建写入、改仓库同步,接口不接受直写 subsidiary_id - 入库单/出库单列表返回 subsidiary_name 并新增货主筛选;详情/编辑/删除/审核/ 推送/完成/取消/恢复/作废/驳回与明细接口统一加货主越界 403 - 出入库记录按仓库归属货主:列表与导出收窄、返回 subsidiary_id/subsidiary_name、 新增货主列与筛选 - 导出:入库单/出库单/出入库记录新增货主列并按所在公司权限收窄 - 新增 resolveAccountNameMap:列表/详情返回 creator_name/auditor_name/voider_name, 创建人展示员工名称(principal_users.name),不再回退成邮箱账号 - 前端:三个列表新增货主列与筛选,创建人/作废人展示改为员工名称 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1060 lines
46 KiB
Vue
1060 lines
46 KiB
Vue
<script setup lang="ts">
|
||
import { computed, onMounted, reactive, ref } from 'vue'
|
||
import { useRoute, useRouter } from 'vue-router'
|
||
import { ElMessage, ElMessageBox, type FormInstance, type FormRules } from 'element-plus'
|
||
import {
|
||
outboundOrderApi,
|
||
type OutboundOrder,
|
||
type OutboundItemPayload,
|
||
} from '@/api/outboundOrder'
|
||
import type { StockItemLine } from '@/api/stockOrder'
|
||
import { getWarehouseOptions, type WarehouseOption } from '@/api/warehouse'
|
||
import { getShops, type ShopItem } from '@/api/shop'
|
||
import { getExpressCompanyOptions, type ExpressCompanyOption } from '@/api/expressCompany'
|
||
import { type ProductSearchItem } from '@/api/product'
|
||
import SplitLayout from '@/components/SplitLayout.vue'
|
||
import ExportButton from '@/components/ExportButton.vue'
|
||
import DataTable from '@/components/DataTable.vue'
|
||
import ListPager from '@/components/ListPager.vue'
|
||
import VirtualSelect from '@/components/VirtualSelect.vue'
|
||
import ProductSelect from '@/components/ProductSelect.vue'
|
||
import { DEFAULT_PAGE_SIZE, useListPage } from '@/composables/useListPage'
|
||
import { getPrincipalSubsidiaryOptions } from '@/api/principalSubsidiary'
|
||
import { formatDateTime } from '@/utils/datetime'
|
||
|
||
const STATUS_LABELS: Record<number, string> = {
|
||
1: '待出库', 2: '已审核', 3: '已推送', 4: '已完成', 5: '已作废', 9: '已取消',
|
||
}
|
||
const STATUS_TAGS: Record<number, string> = { 1: 'info', 2: 'warning', 3: 'primary', 4: 'success', 5: 'danger', 9: 'danger' }
|
||
|
||
const TYPE_OPTIONS = [
|
||
{ label: '普通出库单(PTCK)', value: 'PTCK' },
|
||
{ label: '调拨出库(DBCK)', value: 'DBCK' },
|
||
{ label: 'B2B出库(B2BCK)', value: 'B2BCK' },
|
||
{ label: '其他出库(QTCK)', value: 'QTCK' },
|
||
{ label: '采购退货出库单(CGTH)', value: 'CGTH' },
|
||
]
|
||
const INV_TYPE_OPTIONS = [
|
||
{ label: '正品(ZP)', value: 'ZP' },
|
||
{ label: '残次(CC)', value: 'CC' },
|
||
]
|
||
|
||
const warehouses = ref<WarehouseOption[]>([])
|
||
const warehouseSelectOptions = computed(() =>
|
||
warehouses.value.map((w) => ({ label: `${w.code} ${w.name}`, value: w.id })),
|
||
)
|
||
const shops = ref<ShopItem[]>([])
|
||
const shopSelectOptions = computed(() =>
|
||
shops.value.map((s) => ({ label: `${s.code} ${s.name}`, value: s.id })),
|
||
)
|
||
/** 快递公司字典(仅启用,供「物流公司」下拉,对齐 WMS stockout.create 的 deliveryOrder.logisticsCode) */
|
||
const expressCompanies = ref<ExpressCompanyOption[]>([])
|
||
/** 货主(下属公司)下拉:所在公司权限只给自己所属公司 */
|
||
const subsidiaryOptions = ref<{ id: number; name: string }[]>([])
|
||
|
||
/* -------------------- 列表 -------------------- */
|
||
const query = reactive({
|
||
page: 1,
|
||
pageSize: DEFAULT_PAGE_SIZE,
|
||
bill_no: '',
|
||
status: '' as string | number,
|
||
outbound_type: '' as string | number,
|
||
subsidiary_id: '' as string | number,
|
||
})
|
||
const { loading, list, total, elapsed, fetchList, search, handlePageChange, handleSizeChange } = useListPage({
|
||
query,
|
||
fetcher: () => {
|
||
const params: Record<string, unknown> = { ...query }
|
||
if (!params.bill_no) delete params.bill_no
|
||
if (params.status === '') delete params.status
|
||
if (params.outbound_type === '') delete params.outbound_type
|
||
if (params.subsidiary_id === '') delete params.subsidiary_id
|
||
return outboundOrderApi.getList(params)
|
||
},
|
||
})
|
||
async function fetchOptions() {
|
||
try { warehouses.value = await getWarehouseOptions() } catch { warehouses.value = [] }
|
||
try { shops.value = (await getShops({ pageSize: 200 })).list } catch { shops.value = [] }
|
||
try { expressCompanies.value = await getExpressCompanyOptions() } catch { expressCompanies.value = [] }
|
||
try { subsidiaryOptions.value = await getPrincipalSubsidiaryOptions({ mine: 1 }) } catch { subsidiaryOptions.value = [] }
|
||
}
|
||
function reset() {
|
||
query.bill_no = ''
|
||
query.status = ''
|
||
query.outbound_type = ''
|
||
query.subsidiary_id = ''
|
||
search()
|
||
}
|
||
|
||
/** 导出筛选条件(与列表筛选同一套条件,字段名与后端 outbound_order 类型对齐) */
|
||
const exportFilters = computed(() => ({
|
||
bill_no: query.bill_no.trim(),
|
||
status: query.status,
|
||
outbound_type: query.outbound_type,
|
||
subsidiary_id: query.subsidiary_id,
|
||
}))
|
||
function typeLabel(row: OutboundOrder) {
|
||
return TYPE_OPTIONS.find((o) => o.value === row.outbound_type)?.label || String(row.outbound_type)
|
||
}
|
||
/** 是否已录入明细:无明细不允许审核 */
|
||
function hasItems(row: { item_kind?: number | string | null }) {
|
||
return Number(row.item_kind) > 0
|
||
}
|
||
|
||
/* -------------------- 新增 / 编辑 单据头 -------------------- */
|
||
const route = useRoute()
|
||
const router = useRouter()
|
||
const dialogVisible = ref(false)
|
||
const submitting = ref(false)
|
||
const formRef = ref<FormInstance>()
|
||
const editId = ref<number | null>(null)
|
||
|
||
/**
|
||
* 单据头表单初值。
|
||
* 快递公司与收件人字段对齐 WMS `stockout.create` 的 deliveryOrder.logisticsCode / receiverInfo
|
||
* (13 个字段:name/company/zipCode/tel/mobile/email/countryCode/province/city/area/town/detailAddress/id)
|
||
*/
|
||
function emptyForm() {
|
||
return {
|
||
warehouse_id: null as number | null,
|
||
shop_id: null as number | null,
|
||
outbound_type: 'PTCK',
|
||
customer: '',
|
||
total_amount: 0,
|
||
remark: '',
|
||
express_code: '',
|
||
express_name: '',
|
||
receiver_name: '',
|
||
receiver_company: '',
|
||
receiver_tel: '',
|
||
receiver_mobile: '',
|
||
receiver_email: '',
|
||
receiver_country_code: '',
|
||
receiver_province: '',
|
||
receiver_city: '',
|
||
receiver_area: '',
|
||
receiver_town: '',
|
||
receiver_detail_address: '',
|
||
receiver_zip_code: '',
|
||
receiver_id: '',
|
||
}
|
||
}
|
||
|
||
const form = reactive(emptyForm())
|
||
const rules: FormRules = {
|
||
warehouse_id: [{ required: true, message: '请选择仓库', trigger: 'change' }],
|
||
}
|
||
/** 选择快递公司后同步名称(下拉已展示「名称(编码)」,此处仅写入 express_name 供推送/列表展示) */
|
||
function handleExpressChange(code: string | null) {
|
||
const company = expressCompanies.value.find(c => c.code === code)
|
||
form.express_name = company ? company.name : ''
|
||
}
|
||
/** 新增出库单改为独立整页(菜单「创建出库单」),此处仅跳转 */
|
||
function openCreate() {
|
||
router.push('/outbound-order-create')
|
||
}
|
||
async function openEdit(row: OutboundOrder) {
|
||
const full = await outboundOrderApi.get(row.id)
|
||
editId.value = full.id
|
||
Object.assign(form, {
|
||
warehouse_id: full.warehouse_id ?? null,
|
||
shop_id: full.shop_id ?? null,
|
||
outbound_type: full.outbound_type || 'PTCK',
|
||
customer: full.customer || '',
|
||
total_amount: Number(full.total_amount) || 0,
|
||
remark: full.remark || '',
|
||
express_code: full.express_code || '',
|
||
express_name: full.express_name || '',
|
||
receiver_name: full.receiver_name || '',
|
||
receiver_company: full.receiver_company || '',
|
||
receiver_tel: full.receiver_tel || '',
|
||
receiver_mobile: full.receiver_mobile || '',
|
||
receiver_email: full.receiver_email || '',
|
||
receiver_country_code: full.receiver_country_code || '',
|
||
receiver_province: full.receiver_province || '',
|
||
receiver_city: full.receiver_city || '',
|
||
receiver_area: full.receiver_area || '',
|
||
receiver_town: full.receiver_town || '',
|
||
receiver_detail_address: full.receiver_detail_address || '',
|
||
receiver_zip_code: full.receiver_zip_code || '',
|
||
receiver_id: full.receiver_id || '',
|
||
})
|
||
dialogVisible.value = true
|
||
}
|
||
|
||
async function submitForm() {
|
||
if (!formRef.value) return
|
||
await formRef.value.validate(async (valid) => {
|
||
if (!valid) return
|
||
submitting.value = true
|
||
try {
|
||
const payload = {
|
||
warehouse_id: form.warehouse_id,
|
||
shop_id: form.shop_id || null,
|
||
outbound_type: form.outbound_type,
|
||
customer: form.customer || null,
|
||
total_amount: form.total_amount,
|
||
remark: form.remark || null,
|
||
express_code: form.express_code || null,
|
||
express_name: form.express_name || null,
|
||
receiver_name: form.receiver_name || null,
|
||
receiver_company: form.receiver_company || null,
|
||
receiver_tel: form.receiver_tel || null,
|
||
receiver_mobile: form.receiver_mobile || null,
|
||
receiver_email: form.receiver_email || null,
|
||
receiver_country_code: form.receiver_country_code || null,
|
||
receiver_province: form.receiver_province || null,
|
||
receiver_city: form.receiver_city || null,
|
||
receiver_area: form.receiver_area || null,
|
||
receiver_town: form.receiver_town || null,
|
||
receiver_detail_address: form.receiver_detail_address || null,
|
||
receiver_zip_code: form.receiver_zip_code || null,
|
||
receiver_id: form.receiver_id || null,
|
||
} as Record<string, unknown>
|
||
await outboundOrderApi.update(editId.value as number, payload as any)
|
||
ElMessage.success('保存成功')
|
||
dialogVisible.value = false
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
} finally {
|
||
submitting.value = false
|
||
}
|
||
})
|
||
}
|
||
|
||
/* -------------------- 状态流转 -------------------- */
|
||
const transiting = ref(false)
|
||
async function transit(action: 'audit' | 'push' | 'complete' | 'cancel' | 'restore') {
|
||
if (!currentOrder.value) return
|
||
transiting.value = true
|
||
try {
|
||
const id = currentOrder.value.id
|
||
if (action === 'audit') {
|
||
await outboundOrderApi.audit(id)
|
||
ElMessage.success('审核成功,已进入推送队列,稍后自动推送仓库')
|
||
} else if (action === 'push') {
|
||
await outboundOrderApi.push(id)
|
||
ElMessage.success('已推送仓库')
|
||
} else if (action === 'complete') await outboundOrderApi.complete(id)
|
||
else if (action === 'cancel') await outboundOrderApi.cancel(id)
|
||
else if (action === 'restore') await outboundOrderApi.restore(id)
|
||
if (action !== 'audit' && action !== 'push') ElMessage.success('操作成功')
|
||
const map: Record<string, number> = { audit: 2, push: 3, complete: 4, cancel: 9, restore: 1 }
|
||
if (currentOrder.value) currentOrder.value.status = map[action]
|
||
// 重新拉取整单:自动/手动推送会写 pushed_at 与 wms_push_result,需刷新推送结果面板
|
||
if (currentOrder.value) {
|
||
await outboundOrderApi.get(id).then(r => { currentOrder.value = r }).catch(() => {})
|
||
}
|
||
await fetchItems()
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
} finally {
|
||
transiting.value = false
|
||
}
|
||
}
|
||
async function handleDelete(row: OutboundOrder) {
|
||
try {
|
||
await ElMessageBox.confirm(`确认删除出库单「${row.bill_no}」?`, '删除确认', {
|
||
type: 'warning', confirmButtonText: '删除', cancelButtonText: '取消',
|
||
})
|
||
} catch { return }
|
||
try {
|
||
await outboundOrderApi.remove(row.id)
|
||
ElMessage.success('已删除')
|
||
if (currentOrder.value && currentOrder.value.id === row.id) {
|
||
currentOrder.value = null
|
||
editItems.value = []
|
||
}
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
}
|
||
}
|
||
/** 作废:仅「已审核(2)」可作废,需确认并可填写作废原因;作废后不可恢复 */
|
||
async function handleVoid(row: OutboundOrder) {
|
||
let reason = ''
|
||
try {
|
||
const res = await ElMessageBox.prompt(
|
||
`确认作废出库单「${row.bill_no}」?作废后不可恢复。`,
|
||
'作废确认',
|
||
{
|
||
type: 'warning',
|
||
confirmButtonText: '确认作废',
|
||
cancelButtonText: '取消',
|
||
inputType: 'textarea',
|
||
inputPlaceholder: '作废原因(选填)',
|
||
inputValidator: () => true,
|
||
},
|
||
)
|
||
reason = (res.value || '').trim()
|
||
} catch { return }
|
||
try {
|
||
await outboundOrderApi.voidOrder(row.id, reason ? { void_reason: reason } : {})
|
||
ElMessage.success('已作废')
|
||
await refreshCurrent(row.id)
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
}
|
||
}
|
||
/** 驳回:已审核/已推送且未完成 -> 回到待出库;已推送的会先调外部接口取消单据并回滚库存 */
|
||
async function handleReject(row: OutboundOrder) {
|
||
const tip = row.status === 3
|
||
? `确认驳回出库单「${row.bill_no}」?将调用外部仓库接口取消已推送的单据、回滚锁定/已扣减库存,并退回「待出库」。驳回后单号会自动加后缀(如 _1),再次推送将使用新单号。`
|
||
: `确认驳回出库单「${row.bill_no}」?驳回后回到「待出库」并自动加单号后缀(如 _1),可重新编辑后再次审核。`
|
||
try {
|
||
await ElMessageBox.confirm(tip, '驳回确认', {
|
||
type: 'warning', confirmButtonText: '确认驳回', cancelButtonText: '取消',
|
||
})
|
||
} catch { return }
|
||
try {
|
||
const res = await outboundOrderApi.reject(row.id)
|
||
ElMessage.success(res?.bill_no ? `已驳回,单号已变更为 ${res.bill_no}` : '已驳回')
|
||
await refreshCurrent(row.id)
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
}
|
||
}
|
||
/** 若当前查看的正是被操作的这一单,重新拉取以刷新状态与统计 */
|
||
async function refreshCurrent(id: number) {
|
||
if (!currentOrder.value || currentOrder.value.id !== id) return
|
||
await outboundOrderApi.get(id).then((r) => { currentOrder.value = r }).catch(() => {})
|
||
}
|
||
|
||
/* -------------------- 明细 -------------------- */
|
||
const itemsLoading = ref(false)
|
||
const itemSaving = ref(false)
|
||
const currentOrder = ref<OutboundOrder | null>(null)
|
||
const activeDetailTab = ref('info')
|
||
const initialItemIds = ref<number[]>([])
|
||
interface EditItem {
|
||
id: number | null
|
||
product_id: number | null
|
||
name: string
|
||
code: string
|
||
spec: string
|
||
unit: string
|
||
inventory_type: 'ZP' | 'CC'
|
||
quantity: number
|
||
/** 应/已数量(系统维护,只读展示) */
|
||
plan_in_qty: number
|
||
actual_in_qty: number
|
||
plan_out_qty: number
|
||
actual_out_qty: number
|
||
price: number
|
||
remark: string
|
||
_label: string
|
||
}
|
||
function emptyRow(): EditItem {
|
||
return { id: null, product_id: null, name: '', code: '', spec: '', unit: '', inventory_type: 'ZP', quantity: 1, price: 0, remark: '', _label: '', plan_in_qty: 0, actual_in_qty: 0, plan_out_qty: 0, actual_out_qty: 0 }
|
||
}
|
||
function isEmptyRow(it: EditItem) {
|
||
return !it.product_id && !it.name && !it.code
|
||
}
|
||
const editItems = ref<EditItem[]>([])
|
||
/** 当前单据仓库的货主:明细商品只能选同货主商品(防止跨货主商品进入单据) */
|
||
const currentWarehouseOwnerId = computed<number | null>(() => {
|
||
const warehouseId = currentOrder.value?.warehouse_id
|
||
if (warehouseId == null) return null
|
||
const hit = warehouses.value.find(w => Number(w.id) === Number(warehouseId))
|
||
const sid = hit?.subsidiary_id
|
||
return sid === null || sid === undefined ? null : Number(sid)
|
||
})
|
||
const editTotal = computed(() =>
|
||
editItems.value.reduce((s, it) => s + (Number(it.quantity) || 0) * (Number(it.price) || 0), 0),
|
||
)
|
||
/** 明细锁定:仅「待出库(1)」可增删改明细,已审核及之后锁定(需先驳回) */
|
||
const itemsLocked = computed(() => !!currentOrder.value && currentOrder.value.status !== 1)
|
||
/** 推送失败原因(自动推送失败会退回「待出库」,列表上用感叹号提示,鼠标悬浮看原因) */
|
||
function pushFailTip(row: OutboundOrder) {
|
||
const result = row.wms_push_result
|
||
if (!result || result.success !== false) return ''
|
||
const kindMap: Record<string, string> = {
|
||
timeout: `连续 ${result.attempts || 1} 次无响应/超时`,
|
||
business: '仓库明确拒绝',
|
||
insufficient_stock: '库存不足',
|
||
lock_failed: '库存锁定失败',
|
||
empty_items: '单据无明细',
|
||
}
|
||
const kind = kindMap[String(result.failureKind)] || '推送异常'
|
||
const detail = result.message || result.error || ''
|
||
return `推送失败(${kind}):${detail}`
|
||
}
|
||
// 始终保留一行空行在末尾,选商品填充后可继续往下添加
|
||
function ensureTrailingEmptyRow() {
|
||
const arr = editItems.value
|
||
const last = arr[arr.length - 1]
|
||
if (!last || !isEmptyRow(last)) arr.push(emptyRow())
|
||
}
|
||
async function handleRowClick(row: OutboundOrder) {
|
||
currentOrder.value = row
|
||
await fetchItems()
|
||
}
|
||
/** 列表行内直接执行状态流转,作用于对应行 */
|
||
async function transitRow(action: 'audit' | 'push' | 'complete' | 'cancel' | 'restore', row: OutboundOrder) {
|
||
currentOrder.value = row
|
||
await transit(action)
|
||
}
|
||
async function fetchItems() {
|
||
if (!currentOrder.value) {
|
||
editItems.value = [emptyRow()]
|
||
initialItemIds.value = []
|
||
return
|
||
}
|
||
itemsLoading.value = true
|
||
try {
|
||
const res = await outboundOrderApi.getItems(currentOrder.value.id, { pageSize: 200 })
|
||
editItems.value = (res.list || []).map((row: StockItemLine) => ({
|
||
id: row.id,
|
||
product_id: row.product_id,
|
||
name: row.name || '',
|
||
code: row.code || '',
|
||
spec: row.spec || '',
|
||
unit: row.unit || '',
|
||
inventory_type: (row.inventory_type as 'ZP' | 'CC') || 'ZP',
|
||
quantity: Number(row.quantity) || 0,
|
||
plan_in_qty: Number(row.plan_in_qty) || 0,
|
||
actual_in_qty: Number(row.actual_in_qty) || 0,
|
||
plan_out_qty: Number(row.plan_out_qty) || 0,
|
||
actual_out_qty: Number(row.actual_out_qty) || 0,
|
||
price: Number(row.price) || 0,
|
||
remark: row.remark || '',
|
||
_label: row.product ? `${row.product.item_code} ${row.product.item_name}` : (row.code ? `${row.code} ${row.name}` : ''),
|
||
}))
|
||
initialItemIds.value = editItems.value.filter((it) => it.id != null).map((it) => it.id as number)
|
||
} catch {
|
||
editItems.value = []
|
||
} finally {
|
||
itemsLoading.value = false
|
||
ensureTrailingEmptyRow()
|
||
}
|
||
}
|
||
/** 明细商品前置校验:必须与单据仓库同货主(不一致时不允许加入,后端同样会拦截) */
|
||
function allowPickProduct(p: ProductSearchItem): boolean {
|
||
if (currentWarehouseOwnerId.value === null || p.subsidiary_id == null) return true
|
||
if (Number(p.subsidiary_id) === currentWarehouseOwnerId.value) return true
|
||
ElMessage.warning('该商品不属于单据仓库的货主(所属公司)')
|
||
return false
|
||
}
|
||
function onEditItemSelect(idx: number, p: ProductSearchItem) {
|
||
const it = editItems.value[idx]
|
||
if (!it) return
|
||
it.product_id = p.id
|
||
it.name = p.item_name || ''
|
||
it.code = p.item_code || ''
|
||
it.spec = p.sku_property || ''
|
||
it.unit = p.stock_unit || ''
|
||
it._label = p.item_code ? `${p.item_code} ${p.item_name}` : p.item_name
|
||
ensureTrailingEmptyRow()
|
||
}
|
||
function removeEditItem(idx: number) {
|
||
editItems.value.splice(idx, 1)
|
||
ensureTrailingEmptyRow()
|
||
}
|
||
async function saveItems() {
|
||
if (!currentOrder.value) return
|
||
itemSaving.value = true
|
||
try {
|
||
const current = editItems.value.filter((it) => !isEmptyRow(it))
|
||
const currentIds = new Set(current.filter((it) => it.id != null).map((it) => it.id as number))
|
||
// 删除已移除的明细
|
||
for (const id of initialItemIds.value) {
|
||
if (!currentIds.has(id)) await outboundOrderApi.removeItem(id)
|
||
}
|
||
// 新增 / 更新
|
||
for (const it of current) {
|
||
const payload = {
|
||
bill_id: currentOrder.value.id,
|
||
product_id: it.product_id,
|
||
name: it.name || null,
|
||
code: it.code || null,
|
||
spec: it.spec || null,
|
||
unit: it.unit || null,
|
||
inventory_type: it.inventory_type,
|
||
quantity: it.quantity,
|
||
price: it.price,
|
||
remark: it.remark || null,
|
||
} as OutboundItemPayload
|
||
if (it.id != null) await outboundOrderApi.updateItem(it.id, payload)
|
||
else await outboundOrderApi.createItem(payload)
|
||
}
|
||
ElMessage.success('明细已保存')
|
||
await fetchItems()
|
||
// 刷新当前单据,使 item_kind 等统计字段同步(影响审核按钮可用状态)
|
||
if (currentOrder.value) {
|
||
await outboundOrderApi.get(currentOrder.value.id).then((r) => { currentOrder.value = r }).catch(() => {})
|
||
}
|
||
await fetchList()
|
||
} catch {
|
||
// 拦截器已提示
|
||
} finally {
|
||
itemSaving.value = false
|
||
}
|
||
}
|
||
|
||
onMounted(async () => {
|
||
// 支持仪表盘等入口带筛选条件跳转(?status=1)
|
||
const status = Number(route.query.status)
|
||
if (route.query.status != null && route.query.status !== '' && !Number.isNaN(status)) {
|
||
query.status = status
|
||
}
|
||
await fetchOptions()
|
||
await fetchList()
|
||
})
|
||
</script>
|
||
|
||
<template>
|
||
<el-card class="stock-card">
|
||
<template #header>
|
||
<div class="page-header">
|
||
<span>出库单</span>
|
||
<div class="header-actions">
|
||
<el-button type="primary" @click="openCreate">新增出库单</el-button>
|
||
<ExportButton type="outbound_order" :filters="exportFilters" />
|
||
</div>
|
||
</div>
|
||
</template>
|
||
|
||
<SplitLayout :first-size="400" storage-key="outbound-order-split" :show-second="!!currentOrder">
|
||
<template #first>
|
||
<el-form :inline="true" class="search-bar">
|
||
<el-form-item label="单号">
|
||
<el-input v-model="query.bill_no" placeholder="支持模糊匹配" clearable @keyup.enter="search" />
|
||
</el-form-item>
|
||
<el-form-item label="状态">
|
||
<el-select v-model="query.status" placeholder="全部" clearable style="width: 130px">
|
||
<el-option v-for="(label, val) in STATUS_LABELS" :key="val" :label="label" :value="Number(val)" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="出库类型">
|
||
<el-select v-model="query.outbound_type" placeholder="全部" clearable style="width: 140px">
|
||
<el-option v-for="o in TYPE_OPTIONS" :key="o.value" :label="o.label" :value="o.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item label="货主">
|
||
<el-select v-model="query.subsidiary_id" placeholder="全部" clearable filterable style="width: 140px">
|
||
<el-option v-for="o in subsidiaryOptions" :key="o.id" :label="o.name" :value="o.id" />
|
||
</el-select>
|
||
</el-form-item>
|
||
<el-form-item>
|
||
<el-button type="primary" @click="search">查询</el-button>
|
||
<el-button @click="reset">重置</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
|
||
<div class="top-table-wrap">
|
||
<DataTable
|
||
:loading="loading"
|
||
:data="list"
|
||
highlight-current-row
|
||
height="100%"
|
||
@row-click="handleRowClick"
|
||
>
|
||
<el-table-column prop="bill_no" label="单号" min-width="160" />
|
||
<el-table-column label="货主" width="130">
|
||
<template #default="{ row }">{{ row.subsidiary_name || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="仓库" width="150">
|
||
<template #default="{ row }">{{ row.warehouse?.name || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="店铺" width="140">
|
||
<template #default="{ row }">{{ row.shop?.name || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="类型" width="110">
|
||
<template #default="{ row }">{{ typeLabel(row) }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="状态" width="130">
|
||
<template #default="{ row }">
|
||
<el-tag :type="STATUS_TAGS[row.status]">{{ STATUS_LABELS[row.status] || row.status }}</el-tag>
|
||
<el-tooltip v-if="pushFailTip(row)" :content="pushFailTip(row)" placement="top">
|
||
<span class="push-fail">推送失败</span>
|
||
</el-tooltip>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="客户" width="140">
|
||
<template #default="{ row }">{{ row.customer || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="收件人" width="100">
|
||
<template #default="{ row }">{{ row.receiver_name || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作人" width="100">
|
||
<template #default="{ row }">{{ row.operator || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="创建人" width="100">
|
||
<template #default="{ row }">{{ row.creator_name || row.creator?.nickname || row.creator?.username || '-' }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="金额" width="110" align="right">
|
||
<template #default="{ row }">{{ row.total_amount }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="商品总数" width="100" align="right">
|
||
<template #default="{ row }">{{ row.item_total ?? 0 }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="商品种类" width="100" align="right">
|
||
<template #default="{ row }">{{ row.item_kind ?? 0 }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="运单号" width="180">
|
||
<template #default="{ row }">
|
||
<template v-if="(row.waybill_codes || []).length">
|
||
<div v-for="code in row.waybill_codes" :key="code">{{ code }}</div>
|
||
</template>
|
||
<template v-else>-</template>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column prop="created_at" label="创建时间" width="180">
|
||
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作" width="300" fixed="right">
|
||
<template #default="{ row }">
|
||
<el-button v-if="row.status === 1" link type="primary" size="small" :disabled="transiting || !hasItems(row)" @click="transitRow('audit', row)">审核</el-button>
|
||
<el-button v-if="row.status === 2" link type="primary" size="small" :disabled="transiting" @click="transitRow('push', row)">立即推送</el-button>
|
||
<el-button v-if="row.status === 3" link type="primary" size="small" :disabled="transiting" @click="transitRow('complete', row)">完成</el-button>
|
||
<el-button v-if="row.status === 9" link type="primary" size="small" :disabled="transiting" @click="transitRow('restore', row)">恢复</el-button>
|
||
<el-button v-if="row.status === 2 || row.status === 3" link type="warning" size="small" :disabled="transiting" @click="handleReject(row)">驳回</el-button>
|
||
<el-button v-if="row.status === 2" link type="danger" size="small" :disabled="transiting" @click="handleVoid(row)">作废</el-button>
|
||
<el-button v-if="row.status === 1 || row.status === 3" link type="danger" size="small" :disabled="transiting" @click="transitRow('cancel', row)">取消</el-button>
|
||
<el-button v-if="row.status === 1" link type="primary" size="small" @click="openEdit(row)">编辑</el-button>
|
||
<el-button v-if="row.status === 1 || row.status === 9" link type="danger" size="small" @click="handleDelete(row)">删除</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</DataTable>
|
||
</div>
|
||
|
||
<ListPager
|
||
:total="total"
|
||
:elapsed="elapsed"
|
||
:page="query.page"
|
||
:page-size="query.pageSize"
|
||
@page-change="handlePageChange"
|
||
@size-change="handleSizeChange"
|
||
/>
|
||
</template>
|
||
|
||
<template #second>
|
||
<div class="detail-wrap" v-if="currentOrder">
|
||
<el-tabs v-model="activeDetailTab" type="border-card" class="detail-tabs">
|
||
<el-tab-pane label="单据信息" name="info">
|
||
<div class="info-pane">
|
||
<div class="order-info">
|
||
<el-descriptions :column="3" border size="small">
|
||
<el-descriptions-item label="单号">{{ currentOrder.bill_no }}</el-descriptions-item>
|
||
<el-descriptions-item label="状态">
|
||
<el-tag :type="STATUS_TAGS[currentOrder.status]">{{ STATUS_LABELS[currentOrder.status] || currentOrder.status }}</el-tag>
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="类型">{{ typeLabel(currentOrder) }}</el-descriptions-item>
|
||
<el-descriptions-item label="仓库">{{ currentOrder.warehouse?.name || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="店铺">{{ currentOrder.shop?.name || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="客户">{{ currentOrder.customer || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="物流公司">{{ currentOrder.express_name || currentOrder.express_code || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="运单号">{{ (currentOrder.waybill_codes || []).join('、') || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="操作人">{{ currentOrder.operator || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="总金额">{{ currentOrder.total_amount }}</el-descriptions-item>
|
||
<el-descriptions-item label="收件人">{{ currentOrder.receiver_name || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="收件人电话">{{ currentOrder.receiver_mobile || currentOrder.receiver_tel || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="收货地址" :span="2">
|
||
{{ [ currentOrder.receiver_province, currentOrder.receiver_city, currentOrder.receiver_area, currentOrder.receiver_town, currentOrder.receiver_detail_address ].filter(Boolean).join(' ') || '-' }}
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="备注" :span="2">{{ currentOrder.remark || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item v-if="currentOrder.status === 5" label="作废人">{{ currentOrder.voider_name || currentOrder.voider?.nickname || currentOrder.voider?.username || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item v-if="currentOrder.status === 5" label="作废时间">{{ formatDateTime(currentOrder.void_at) }}</el-descriptions-item>
|
||
<el-descriptions-item v-if="currentOrder.status === 5" label="作废原因">{{ currentOrder.void_reason || '-' }}</el-descriptions-item>
|
||
</el-descriptions>
|
||
<div class="status-actions">
|
||
<el-tooltip :content="currentOrder.status !== 1 ? '仅「待出库」状态可以审核' : (!hasItems(currentOrder) ? '单据无明细,请先录入明细' : '审核后自动进入推送队列')" :disabled="currentOrder.status === 1 && hasItems(currentOrder)">
|
||
<el-button size="small" :disabled="transiting || currentOrder.status !== 1 || !hasItems(currentOrder)" @click="transit('audit')">审核</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="currentOrder.status === 2 ? '审核后会自动推送,此处可立即推送一次' : '请先审核,仅「已审核」状态可推送到外部仓库'" :disabled="currentOrder.status === 2">
|
||
<el-button size="small" type="primary" :disabled="transiting || currentOrder.status !== 2" @click="transit('push')">推送到外部仓库</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="currentOrder.status === 3 ? '' : '仅「已推送」状态可完成出库'" :disabled="currentOrder.status === 3">
|
||
<el-button size="small" :disabled="transiting || currentOrder.status !== 3" @click="transit('complete')">完成</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="currentOrder.status === 9 ? '' : '仅「已取消」状态可恢复'" :disabled="currentOrder.status === 9">
|
||
<el-button size="small" :disabled="transiting || currentOrder.status !== 9" @click="transit('restore')">恢复</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="(currentOrder.status === 2 || currentOrder.status === 3) ? '' : '仅「已审核」「已推送」状态可驳回'" :disabled="currentOrder.status === 2 || currentOrder.status === 3">
|
||
<el-button size="small" type="warning" plain :disabled="transiting || (currentOrder.status !== 2 && currentOrder.status !== 3)" @click="handleReject(currentOrder)">驳回</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="currentOrder.status === 2 ? '' : '仅「已审核」状态可作废'" :disabled="currentOrder.status === 2">
|
||
<el-button size="small" type="danger" plain :disabled="transiting || currentOrder.status !== 2" @click="handleVoid(currentOrder)">作废</el-button>
|
||
</el-tooltip>
|
||
<el-tooltip :content="(currentOrder.status === 2 || currentOrder.status === 4 || currentOrder.status === 9) ? '已审核请使用驳回/作废;已完成/已取消不可取消' : ''" :disabled="currentOrder.status !== 2 && currentOrder.status !== 4 && currentOrder.status !== 9">
|
||
<el-button size="small" type="danger" plain :disabled="transiting || currentOrder.status === 2 || currentOrder.status === 4 || currentOrder.status === 9" @click="transit('cancel')">取消</el-button>
|
||
</el-tooltip>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="ext-wrap">
|
||
<h4>WMS 推送结果</h4>
|
||
<template v-if="currentOrder.wms_push_result">
|
||
<el-descriptions :column="2" border size="small">
|
||
<el-descriptions-item label="推送时间">{{ formatDateTime(currentOrder.pushed_at) }}</el-descriptions-item>
|
||
<el-descriptions-item label="结果">
|
||
<el-tag :type="currentOrder.wms_push_result.success ? 'success' : 'danger'">
|
||
{{ currentOrder.wms_push_result.success ? '成功' : '失败' }}
|
||
</el-tag>
|
||
</el-descriptions-item>
|
||
<el-descriptions-item label="外部单号">{{ currentOrder.wms_push_result.deliveryOrderCode || '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="返回码">{{ currentOrder.wms_push_result.code ?? '-' }}</el-descriptions-item>
|
||
<el-descriptions-item label="消息" :span="2">{{ currentOrder.wms_push_result.message || currentOrder.wms_push_result.error || '-' }}</el-descriptions-item>
|
||
</el-descriptions>
|
||
</template>
|
||
<p v-else class="muted">尚未推送到外部仓库</p>
|
||
</div>
|
||
</div>
|
||
</el-tab-pane>
|
||
<el-tab-pane label="明细" name="detail">
|
||
<div class="items-toolbar">
|
||
<span class="items-title">出库明细</span>
|
||
<span class="total">合计金额:{{ editTotal.toFixed(2) }}</span>
|
||
<span v-if="itemsLocked" class="lock-hint">单据已审核/已结束,明细已锁定(仅「待出库」可增删改)</span>
|
||
<el-button type="primary" :disabled="!currentOrder || itemSaving || itemsLocked" :loading="itemSaving" @click="saveItems">保存明细</el-button>
|
||
</div>
|
||
<div class="bottom-table-wrap" v-loading="itemsLoading">
|
||
<el-table :data="editItems" size="small" border height="100%">
|
||
<el-table-column type="index" label="行号" width="60" align="center" />
|
||
<el-table-column label="系统商品" min-width="220">
|
||
<template #default="{ row, $index }">
|
||
<ProductSelect
|
||
v-model="row.product_id"
|
||
:model-label="row._label"
|
||
:subsidiary-id="currentWarehouseOwnerId"
|
||
:before-select="allowPickProduct"
|
||
:disabled="itemsLocked"
|
||
@select="(p: ProductSearchItem) => onEditItemSelect($index, p)"
|
||
/>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="名称" min-width="140">
|
||
<template #default="{ row }"><el-input v-model="row.name" placeholder="自动带出" :disabled="itemsLocked" /></template>
|
||
</el-table-column>
|
||
<el-table-column label="编码" width="110">
|
||
<template #default="{ row }"><el-input v-model="row.code" placeholder="自动带出" :disabled="itemsLocked" /></template>
|
||
</el-table-column>
|
||
<el-table-column label="规格" width="100">
|
||
<template #default="{ row }"><el-input v-model="row.spec" :disabled="itemsLocked" /></template>
|
||
</el-table-column>
|
||
<el-table-column label="单位" width="80">
|
||
<template #default="{ row }"><el-input v-model="row.unit" :disabled="itemsLocked" /></template>
|
||
</el-table-column>
|
||
<el-table-column label="库存类型" width="110">
|
||
<template #default="{ row }">
|
||
<el-select v-model="row.inventory_type" :disabled="itemsLocked" style="width: 100%">
|
||
<el-option v-for="o in INV_TYPE_OPTIONS" :key="o.value" :label="o.label" :value="o.value" />
|
||
</el-select>
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="数量" width="110">
|
||
<template #default="{ row }">
|
||
<el-input-number v-model="row.quantity" :min="0" :precision="0" :disabled="itemsLocked" style="width: 100%" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="应出数量" width="100" align="right">
|
||
<template #default="{ row }">{{ row.plan_out_qty ?? 0 }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="已出数量" width="100" align="right">
|
||
<template #default="{ row }">{{ row.actual_out_qty ?? 0 }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="单价" width="120">
|
||
<template #default="{ row }">
|
||
<el-input-number v-model="row.price" :min="0" :precision="2" :disabled="itemsLocked" style="width: 100%" />
|
||
</template>
|
||
</el-table-column>
|
||
<el-table-column label="金额" width="110" align="right">
|
||
<template #default="{ row }">{{ ((Number(row.quantity) || 0) * (Number(row.price) || 0)).toFixed(2) }}</template>
|
||
</el-table-column>
|
||
<el-table-column label="操作" width="70" fixed="right">
|
||
<template #default="{ $index }">
|
||
<el-button link type="danger" :disabled="itemsLocked" @click="removeEditItem($index)">删除</el-button>
|
||
</template>
|
||
</el-table-column>
|
||
</el-table>
|
||
</div>
|
||
</el-tab-pane>
|
||
</el-tabs>
|
||
</div>
|
||
<el-empty v-else description="请点击上方单据查看明细" />
|
||
</template>
|
||
</SplitLayout>
|
||
|
||
<!-- 新增 / 编辑 对话框 -->
|
||
<el-dialog
|
||
v-model="dialogVisible"
|
||
title="编辑出库单"
|
||
width="880px"
|
||
>
|
||
<el-form ref="formRef" :model="form" :rules="rules" label-width="110px">
|
||
<el-row :gutter="12">
|
||
<el-col :span="12">
|
||
<el-form-item label="仓库" prop="warehouse_id">
|
||
<VirtualSelect
|
||
v-model="form.warehouse_id"
|
||
:options="warehouseSelectOptions"
|
||
placeholder="请选择仓库"
|
||
clearable
|
||
style="width: 100%"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="出库类型">
|
||
<el-select v-model="form.outbound_type" style="width: 100%">
|
||
<el-option v-for="o in TYPE_OPTIONS" :key="o.value" :label="o.label" :value="o.value" />
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="目标店铺">
|
||
<VirtualSelect
|
||
v-model="form.shop_id"
|
||
:options="shopSelectOptions"
|
||
placeholder="选填"
|
||
clearable
|
||
style="width: 100%"
|
||
/>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="客户/收货方">
|
||
<el-input v-model="form.customer" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="物流公司">
|
||
<el-select
|
||
v-model="form.express_code"
|
||
placeholder="选填,推送为 logisticsCode"
|
||
clearable
|
||
filterable
|
||
style="width: 100%"
|
||
@change="handleExpressChange"
|
||
>
|
||
<el-option v-for="c in expressCompanies" :key="c.code" :label="`${c.name}(${c.code})`" :value="c.code" />
|
||
</el-select>
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="单据金额">
|
||
<el-input-number v-model="form.total_amount" :min="0" :precision="2" style="width: 100%" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="备注">
|
||
<el-input v-model="form.remark" type="textarea" :rows="2" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
|
||
<el-col :span="24">
|
||
<el-divider content-position="left">收件人(receiverInfo)</el-divider>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="姓名">
|
||
<el-input v-model="form.receiver_name" maxlength="50" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="公司">
|
||
<el-input v-model="form.receiver_company" maxlength="200" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="手机">
|
||
<el-input v-model="form.receiver_mobile" maxlength="50" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="固定电话">
|
||
<el-input v-model="form.receiver_tel" maxlength="50" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="邮箱">
|
||
<el-input v-model="form.receiver_email" maxlength="100" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="邮编">
|
||
<el-input v-model="form.receiver_zip_code" maxlength="50" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="国家编码">
|
||
<el-input v-model="form.receiver_country_code" maxlength="50" placeholder="如 CN" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="12">
|
||
<el-form-item label="收件人证件号">
|
||
<el-input v-model="form.receiver_id" maxlength="50" placeholder="选填" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="省">
|
||
<el-input v-model="form.receiver_province" maxlength="50" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="市">
|
||
<el-input v-model="form.receiver_city" maxlength="50" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="8">
|
||
<el-form-item label="区">
|
||
<el-input v-model="form.receiver_area" maxlength="50" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item label="街道/镇">
|
||
<el-input v-model="form.receiver_town" maxlength="50" />
|
||
</el-form-item>
|
||
</el-col>
|
||
<el-col :span="24">
|
||
<el-form-item label="详细地址">
|
||
<el-input v-model="form.receiver_detail_address" maxlength="200" />
|
||
</el-form-item>
|
||
</el-col>
|
||
</el-row>
|
||
</el-form>
|
||
<template #footer>
|
||
<el-button @click="dialogVisible = false">取消</el-button>
|
||
<el-button type="primary" :loading="submitting" @click="submitForm">保存</el-button>
|
||
</template>
|
||
</el-dialog>
|
||
</el-card>
|
||
</template>
|
||
|
||
<style scoped>
|
||
.stock-card {
|
||
flex: 1;
|
||
min-height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
.stock-card :deep(.el-card__header) {
|
||
padding: 8px 14px;
|
||
}
|
||
.stock-card :deep(.el-card__body) {
|
||
flex: 1;
|
||
min-height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
overflow: hidden;
|
||
padding: 10px 14px;
|
||
}
|
||
.page-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-weight: 600;
|
||
}
|
||
.search-bar {
|
||
margin-bottom: 8px;
|
||
}
|
||
.top-table-wrap {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
.items-toolbar {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 12px;
|
||
margin-bottom: 8px;
|
||
}
|
||
.status-actions {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
align-items: center;
|
||
gap: 8px;
|
||
}
|
||
.detail-wrap {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
min-height: 0;
|
||
}
|
||
.order-info {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
gap: 12px;
|
||
margin-bottom: 8px;
|
||
}
|
||
.order-info :deep(.el-descriptions) {
|
||
flex: 1;
|
||
}
|
||
.items-title {
|
||
font-weight: 600;
|
||
}
|
||
.total {
|
||
color: #e6a23c;
|
||
font-weight: 600;
|
||
}
|
||
.lock-hint {
|
||
color: #e6a23c;
|
||
}
|
||
/* 推送失败标记(自动推送失败会退回「待出库」,鼠标悬浮看原因) */
|
||
.push-fail {
|
||
margin-left: 4px;
|
||
color: #f56c6c;
|
||
font-size: 12px;
|
||
cursor: help;
|
||
border-bottom: 1px dashed #f56c6c;
|
||
}
|
||
.bottom-table-wrap {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
.detail-tabs {
|
||
flex: 1;
|
||
min-height: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
.detail-tabs :deep(.el-tabs__content) {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: hidden;
|
||
}
|
||
.detail-tabs :deep(.el-tab-pane) {
|
||
height: 100%;
|
||
display: flex;
|
||
flex-direction: column;
|
||
min-height: 0;
|
||
}
|
||
.info-pane {
|
||
display: flex;
|
||
flex-direction: column;
|
||
height: 100%;
|
||
min-height: 0;
|
||
}
|
||
.ext-wrap {
|
||
flex: 1;
|
||
min-height: 0;
|
||
overflow: auto;
|
||
padding: 8px 4px 4px;
|
||
}
|
||
.ext-wrap h4 {
|
||
margin: 12px 0 8px;
|
||
color: #606266;
|
||
}
|
||
.ext-collapse {
|
||
margin-top: 8px;
|
||
}
|
||
.ext-block {
|
||
margin-bottom: 8px;
|
||
}
|
||
.ext-subtitle {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
margin-bottom: 8px;
|
||
font-weight: 600;
|
||
color: #606266;
|
||
}
|
||
.muted {
|
||
color: #909399;
|
||
}
|
||
</style>
|