Compare commits
6 Commits
5ccc42fdbc
...
9743cdd36f
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9743cdd36f | ||
|
|
01d26f6649 | ||
|
|
1137f75cd2 | ||
|
|
2e5093ddd2 | ||
|
|
15f096b7c1 | ||
|
|
623150288e |
@ -67,6 +67,7 @@ export type DeliveryOrderListItem = {
|
||||
service_fee?: string | null
|
||||
logistics_name?: string
|
||||
delivery_type?: string | null
|
||||
/** 重量类型 */
|
||||
weight_type?: string | number | null
|
||||
is_urgency?: string
|
||||
invoice_flag?: string
|
||||
@ -87,6 +88,7 @@ export type DeliveryOrderListItem = {
|
||||
items?: string
|
||||
items_count?: number
|
||||
items_total?: number
|
||||
/** 订单商品总重量(g) */
|
||||
items_weight?: string
|
||||
wave_id?: number
|
||||
wave_no?: string
|
||||
@ -165,6 +167,7 @@ export type DeliveryOrderDetailItem = {
|
||||
/** order.deliveryOrder.detail 运单信息项 */
|
||||
export type DeliveryOrderDetailExpressItem = {
|
||||
waybill_code?: string
|
||||
/** 称重重量(g) */
|
||||
weighing_weight?: number | null
|
||||
sys_logistics_code?: string
|
||||
sys_logistics_name?: string
|
||||
|
||||
@ -63,7 +63,7 @@ export type UpdateExpressWeighingWeightParams = {
|
||||
order_id: number | string
|
||||
/** 订单仅一个运单时可不传;多运单时必填;order_id=0 时必填 */
|
||||
waybill_code?: string
|
||||
/** 称重重量(kg),必须大于 0,最多 3 位小数 */
|
||||
/** 称重重量(g),必须大于 0,最多 3 位小数 */
|
||||
weighing_weight: number | string
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ export type UpdateExpressWeighingWeightResponse = {
|
||||
order_id?: number
|
||||
/** 写入重量的运单号;订单模式及运单号散单模式返回 */
|
||||
waybill_code?: string
|
||||
/** 已写入的称重重量(kg) */
|
||||
/** 已写入的称重重量(g) */
|
||||
weighing_weight: number
|
||||
/** 波次号;团购批量模式返回 */
|
||||
wave_no?: string
|
||||
@ -88,7 +88,7 @@ export type UpdateExpressWeighingWeightResponse = {
|
||||
business_key?: string
|
||||
/** 波次 ID;团购批量模式返回 */
|
||||
wave_id?: number
|
||||
/** 所有拆单重量累加(kg);团购批量模式返回 */
|
||||
/** 所有拆单重量累加(g);团购批量模式返回 */
|
||||
total_weight?: number
|
||||
/** waybill_code 非空的 business_key 数量;团购批量模式返回 */
|
||||
split_count?: number
|
||||
|
||||
@ -63,7 +63,7 @@ export type ScanOrderSingleListItem = {
|
||||
store_remark?: string
|
||||
intercept_status?: string
|
||||
stock?: unknown[]
|
||||
/** 订单商品总重量(kg) */
|
||||
/** 订单商品总重量(g) */
|
||||
items_weight?: number | string
|
||||
/** 推荐包材信息,无推荐时为 null */
|
||||
suggested_package_material?: Record<string, unknown> | null
|
||||
|
||||
@ -170,7 +170,7 @@ export type WaveGroupOrderFetchListItem = Record<string, unknown> & {
|
||||
group?: string
|
||||
group_count?: number
|
||||
items_total?: number
|
||||
/** 总重量 kg,取组内首单 items_weight */
|
||||
/** 总重量 g,取组内首单 items_weight */
|
||||
items_weight?: number | string
|
||||
store_id?: number
|
||||
store_ids?: number[]
|
||||
|
||||
@ -56,11 +56,7 @@
|
||||
<barcode-img :text="getPreviewValue(item) || '0123456789'" />
|
||||
</template>
|
||||
<template v-else-if="item.type === 'qrcode'">
|
||||
<img
|
||||
:src="'https://ye4s.wms.gztbyc.com/qrcode/build?text=' + encodeURIComponent(getPreviewValue(item) || '')"
|
||||
alt=""
|
||||
style="width: 100%; height: 100%; object-fit: contain;"
|
||||
/>
|
||||
<qrcode-img :text="getPreviewValue(item) || ''" />
|
||||
</template>
|
||||
<template v-else-if="item.type === 'image'">
|
||||
<img :src="item.content" alt="" style="width: 100%; height: 100%; object-fit: fill;" />
|
||||
@ -126,6 +122,7 @@
|
||||
import { computed, h, reactive, ref, watch } from 'vue'
|
||||
import { ElMessage } from 'element-plus'
|
||||
import JsBarcode from 'jsbarcode'
|
||||
import QRCode from 'qrcode'
|
||||
import * as receivingApi from '@/api/storage_receiving/receiving'
|
||||
import * as templateApi from '@/api/setting.printtemplate/printTemplate'
|
||||
import * as stationApi from '@/api/print/print'
|
||||
@ -204,6 +201,29 @@ const barcodeImg = {
|
||||
}
|
||||
}
|
||||
|
||||
const qrcodeImg = {
|
||||
props: ['text'],
|
||||
setup(innerProps: any) {
|
||||
const src = ref('')
|
||||
const renderQrcode = (val: string) => {
|
||||
if (!val) {
|
||||
src.value = ''
|
||||
return
|
||||
}
|
||||
const canvas = document.createElement('canvas')
|
||||
QRCode.toCanvas(canvas, val, { width: 200, margin: 1 }, (err: Error | null | undefined) => {
|
||||
if (err) {
|
||||
src.value = ''
|
||||
return
|
||||
}
|
||||
src.value = canvas.toDataURL()
|
||||
})
|
||||
}
|
||||
watch(() => innerProps.text, (val: string) => renderQrcode(val), { immediate: true })
|
||||
return () => h('img', { src: src.value, style: { display: 'block', width: '100%', height: '100%', objectFit: 'contain' } })
|
||||
}
|
||||
}
|
||||
|
||||
const previewInfo = computed(() => {
|
||||
const t = templateOptions.value.find((item: any) => item.id === printSettings.template)
|
||||
if (!t) return { width: 0, height: 0 }
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
{{ formatCellNumber(row.height) }}
|
||||
</template>
|
||||
<template #column-weight="{ row }">
|
||||
{{ formatCellNumber(row.weight) }}
|
||||
{{ formatCellNumber(row.weight) ? formatCellNumber(row.weight) + 'g' : '--' }}
|
||||
</template>
|
||||
<template #column-cost_price="{ row }">
|
||||
{{ formatCellNumber(row.cost_price) }}
|
||||
@ -129,7 +129,7 @@ const previewColumns = [
|
||||
{ prop: 'length', label: '长度', width: '80' },
|
||||
{ prop: 'width', label: '宽度', width: '80' },
|
||||
{ prop: 'height', label: '高度', width: '80' },
|
||||
{ prop: 'weight', label: '重量', width: '80' },
|
||||
{ prop: 'weight', label: '重量(g)', width: '80' },
|
||||
{ prop: 'cost_price', label: '成本价', width: '90' },
|
||||
{ prop: 'status', label: '状态', width: '70' },
|
||||
{ prop: 'import_status', label: '导入状态', width: '100' },
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
</template>
|
||||
|
||||
<template #column-weight="{ row }">
|
||||
{{ formatNumber(row.weight) }}
|
||||
{{ formatNumber(row.weight) ? formatNumber(row.weight) + 'g' : '--' }}
|
||||
</template>
|
||||
|
||||
<template #column-cost_price="{ row }">
|
||||
@ -152,7 +152,7 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-form-item label="重量(g)" prop="weight">
|
||||
<el-input-number
|
||||
v-model="formData.weight"
|
||||
:min="0"
|
||||
|
||||
@ -21,7 +21,7 @@ export const packageMaterialColumns = [
|
||||
{ prop: 'material_type', label: '包材类型', minWidth: '110', showOverflowTooltip: true },
|
||||
{ prop: 'spec', label: '规格', minWidth: '120', showOverflowTooltip: true },
|
||||
{ prop: 'dimensions', label: '尺寸(L×W×H)', minWidth: '140' },
|
||||
{ prop: 'weight', label: '重量', width: '90' },
|
||||
{ prop: 'weight', label: '重量(g)', width: '90' },
|
||||
{ prop: 'cost_price', label: '成本价', width: '100' },
|
||||
{ prop: 'status', label: '状态', width: '90' },
|
||||
{ prop: 'actions', label: '操作', width: '150', fixed: 'right' }
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column prop="logistics_name" label="物流公司" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column prop="logistics_interface_name" label="快递接口" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="称重(kg)" width="110" align="right">
|
||||
<el-table-column label="称重(g)" width="110" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ formatWeight(row.weighing_weight) }}
|
||||
</template>
|
||||
@ -46,7 +46,7 @@
|
||||
<el-form-item label="运单号">
|
||||
<el-input :model-value="weighingForm.waybill_code" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="称重(kg)">
|
||||
<el-form-item label="称重(g)">
|
||||
<el-input-number
|
||||
v-model="weighingForm.weighing_weight"
|
||||
:min="0.001"
|
||||
@ -101,7 +101,7 @@ const orderId = computed(() => props.row?.id)
|
||||
function formatWeight(value: unknown) {
|
||||
if (value === null || value === undefined || value === '') return '—'
|
||||
const num = Number(value)
|
||||
return Number.isFinite(num) ? String(num) : String(value)
|
||||
return Number.isFinite(num) ? String(num) + 'g' : String(value)
|
||||
}
|
||||
|
||||
function formatTime(value: unknown) {
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
<el-table :data="expresses" border stripe size="small" empty-text="暂无运单信息">
|
||||
<el-table-column prop="waybill_code" label="运单号" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column prop="logistics_name" label="物流公司" min-width="140" show-overflow-tooltip />
|
||||
<el-table-column label="称重(kg)" width="100" align="right">
|
||||
<el-table-column label="称重(g)" width="100" align="right">
|
||||
<template #default="{ row }">
|
||||
{{ formatWeight(row.weighing_weight) }}
|
||||
</template>
|
||||
@ -97,7 +97,7 @@ function formatAmount(value: unknown) {
|
||||
function formatWeight(value: unknown) {
|
||||
if (value === null || value === undefined || value === '') return '—'
|
||||
const num = Number(value)
|
||||
return Number.isFinite(num) ? String(num) : String(value)
|
||||
return Number.isFinite(num) ? String(num) + 'g' : String(value)
|
||||
}
|
||||
|
||||
function formatExpressTime(value: unknown) {
|
||||
|
||||
@ -142,6 +142,13 @@ export const COMMON_TRANSLATIONS: Record<string, Record<string, string>> = {
|
||||
'1': '轻货',
|
||||
'2': '重货',
|
||||
'3': '冷链'
|
||||
},
|
||||
create_channel: {
|
||||
'QM': '奇门',
|
||||
'API': 'API',
|
||||
'IMPORT': '导入',
|
||||
'MANUAL': '手动',
|
||||
'PLATFORM': '平台'
|
||||
}
|
||||
}
|
||||
|
||||
@ -760,7 +767,7 @@ export const orderDetailFullSections: OrderDetailSectionConfig[] = [
|
||||
title: '流程与状态',
|
||||
column: 4,
|
||||
fields: [
|
||||
{ prop: 'status', label: '订单状态', tag: true },
|
||||
{ prop: 'status', label: '订单状态', tag: true, formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'step', label: '流程步骤' },
|
||||
{ prop: 'sync_status', label: '同步状态', tag: true },
|
||||
{ prop: 'inspection_status', label: '审核状态', tag: true },
|
||||
@ -825,7 +832,7 @@ export const orderDetailFullSections: OrderDetailSectionConfig[] = [
|
||||
{ prop: 'items', label: '商品明细摘要', span: 4 },
|
||||
{ prop: 'items_count', label: '商品种类' },
|
||||
{ prop: 'items_total', label: '商品总数' },
|
||||
{ prop: 'items_weight', label: '商品重量kg' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)' },
|
||||
{ prop: 'items_hash', label: '商品哈希', span: 2 },
|
||||
{ prop: 'items_crc', label: '商品CRC' }
|
||||
]
|
||||
@ -859,7 +866,7 @@ export const orderDetailCompactSections: OrderDetailSectionConfig[] = [
|
||||
{ prop: 'create_channel', label: '来源' },
|
||||
{ prop: 'shop_nick', label: '店铺名称' },
|
||||
{ prop: 'buyer_nick', label: '买家昵称' },
|
||||
{ prop: 'status', label: '订单状态', tag: true },
|
||||
{ prop: 'status', label: '订单状态', tag: true, formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'source_order_codes', label: '平台交易单号' },
|
||||
{ prop: 'is_urgency', label: '是否紧急', tag: true },
|
||||
{ prop: 'seller_nick', label: '卖家昵称' },
|
||||
@ -907,7 +914,7 @@ export const orderDetailCompactSections: OrderDetailSectionConfig[] = [
|
||||
{ prop: 'freight', label: '运费', amount: true },
|
||||
{ prop: 'items_count', label: '商品种类' },
|
||||
{ prop: 'items_total', label: '商品总数' },
|
||||
{ prop: 'items_weight', label: '商品重量kg' }
|
||||
{ prop: 'items_weight', label: '商品重量(g)' }
|
||||
]
|
||||
},
|
||||
{
|
||||
@ -1389,7 +1396,7 @@ export const deliveryColumns = applyOrderListCopyActions([
|
||||
{ prop: 'province', label: '省份', width: '90' },
|
||||
{ prop: 'city', label: '城市', width: '90' },
|
||||
{ prop: 'area', label: '区/县', width: '90' },
|
||||
{ prop: 'status', label: '订单状态', width: '100' },
|
||||
{ prop: 'status', label: '订单状态', width: '100', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'outbound_status', label: '数据归档', width: '100' },
|
||||
{ prop: 'sync_status', label: '同步状态', width: '100' },
|
||||
{ prop: 'inspection_status', label: '审核状态', width: '100' },
|
||||
@ -1414,7 +1421,7 @@ export const deliveryColumns = applyOrderListCopyActions([
|
||||
{ prop: 'basket_number', label: '篮号', width: '90' },
|
||||
{ prop: 'items_count', label: '商品种类', width: '90' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '90' },
|
||||
{ prop: 'items_weight', label: '商品重量kg', width: '90' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', width: '90' },
|
||||
{ prop: 'total_amount', label: '订单金额', width: '100' },
|
||||
{ prop: 'item_amount', label: '商品金额', width: '100' },
|
||||
{ prop: 'freight', label: '运费', width: '90' },
|
||||
@ -1438,7 +1445,7 @@ export const deliverydetail = [
|
||||
{ label: '商品SKU', prop: 'items' },
|
||||
{ label: '商品种类数', prop: 'items_count' },
|
||||
{ label: '商品总数', prop: 'items_total' },
|
||||
{ label: '商品重量kg', prop: 'items_weight' },
|
||||
{ label: '商品重量(g)', prop: 'items_weight' },
|
||||
{ label: '货主', prop: 'store_id' },
|
||||
{ label: '国家编码', prop: 'country_code' },
|
||||
{ label: '详细地址', prop: 'detail_address' },
|
||||
@ -1514,7 +1521,7 @@ export const reviewColums = applyOrderListCopyActions([
|
||||
{ prop: 'logistics_name', label: '快递', width: '120' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '100' },
|
||||
{ prop: 'items_count', label: '商品种类', width: '100' },
|
||||
{ prop: 'items_weight', label: '商品重量kg', width: '110' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', width: '110' },
|
||||
{ prop: 'total_amount', label: '订单金额', width: '110' },
|
||||
{ prop: 'pay_time', label: '支付时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'operator_name', label: '审核人', width: '100' },
|
||||
@ -1534,7 +1541,7 @@ export const reviewOrderDetail = [
|
||||
{ prop: 'shop_nick', label: '店铺名称' },
|
||||
{ prop: 'buyer_nick', label: '买家昵称' },
|
||||
{ prop: 'seller_nick', label: '卖家昵称' },
|
||||
{ prop: 'status', label: '订单状态' },
|
||||
{ prop: 'status', label: '订单状态', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'is_urgency', label: '是否紧急' },
|
||||
{ prop: 'invoice_flag', label: '发票标记' },
|
||||
{ prop: 'sync_status', label: '同步状态' },
|
||||
@ -1552,7 +1559,7 @@ export const reviewOrderDetail = [
|
||||
{ prop: 'items', label: '商品清单', span: 3 },
|
||||
{ prop: 'items_count', label: '商品种类' },
|
||||
{ prop: 'items_total', label: '商品总数' },
|
||||
{ prop: 'items_weight', label: '商品重量kg' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)' },
|
||||
|
||||
// 收货与物流
|
||||
{ prop: 'name', label: '收件人' },
|
||||
@ -1681,7 +1688,7 @@ export const pendingCloums = [
|
||||
{ prop: 'express_numbers', label: '运单号', width: '160', formatter: waybillCodesFormatter },
|
||||
{ prop: 'items_count', label: '商品种类', width: '100' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '100' },
|
||||
{ prop: 'items_weight', label: '商品重量kg', width: '110' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', width: '110' },
|
||||
{ prop: 'province', label: '省份', width: '100' },
|
||||
{ prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'pay_time', label: '支付时间', width: '160', formatter: orderTimeFormatter },
|
||||
@ -1707,7 +1714,7 @@ export const ORDER_LIST_FIELD_LABELS: Record<string, string> = {
|
||||
buyer_message: '买家留言',
|
||||
pre_delivery_order_code: '前置单号',
|
||||
delivery_time: '配送时间',
|
||||
items_weight: '商品重量kg',
|
||||
items_weight: '商品重量(g)',
|
||||
waybill_codes: '运单号',
|
||||
weight_type: '重量类型',
|
||||
}
|
||||
@ -1754,7 +1761,7 @@ export const pendingOrderDetail = [
|
||||
{ prop: 'shop_nick', label: '店铺名称' },
|
||||
{ prop: 'buyer_nick', label: '买家昵称' },
|
||||
{ prop: 'seller_nick', label: '卖家昵称' },
|
||||
{ prop: 'status', label: '订单状态' },
|
||||
{ prop: 'status', label: '订单状态', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'sync_status', label: '同步状态' },
|
||||
{ prop: 'is_urgency', label: '是否紧急' },
|
||||
{ prop: 'invoice_flag', label: '发票标记' },
|
||||
@ -1771,7 +1778,7 @@ export const pendingOrderDetail = [
|
||||
{ prop: 'items', label: '商品清单', span: 3 },
|
||||
{ prop: 'items_count', label: '商品种类' },
|
||||
{ prop: 'items_total', label: '商品总数' },
|
||||
{ prop: 'items_weight', label: '商品重量kg' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)' },
|
||||
|
||||
// 收货与物流
|
||||
{ prop: 'name', label: '收件人' },
|
||||
@ -1921,14 +1928,14 @@ export const workbenchColumns = applyOrderListCopyActions([
|
||||
{ prop: 'mobile', label: '电话', minWidth: 120 },
|
||||
{ prop: 'buyer_message', label: '买家留言', minWidth: 180 },
|
||||
{ prop: 'is_urgency', label: '是否紧急', minWidth: 100 },
|
||||
{ prop: 'status', label: '订单状态', minWidth: 120 },
|
||||
{ prop: 'status', label: '订单状态', minWidth: 120, formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'sync_status', label: '同步状态', minWidth: 110 },
|
||||
{ prop: 'inspection_status', label: '审核状态', minWidth: 110 },
|
||||
{ prop: 'outbound_status', label: '数据归档', minWidth: 120 },
|
||||
{ prop: 'logistics_name', label: '快递', minWidth: 120 },
|
||||
{ prop: 'waybill_codes', label: '运单号', minWidth: 140, formatter: waybillCodesFormatter },
|
||||
{ prop: 'items_total', label: '商品总数', minWidth: 100 },
|
||||
{ prop: 'items_weight', label: '商品重量kg', minWidth: 110 },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', minWidth: 110 },
|
||||
{ prop: 'total_amount', label: '订单金额', minWidth: 110 },
|
||||
{ prop: 'create_at', label: '创建时间', minWidth: 170, formatter: orderTimeFormatter },
|
||||
{ prop: 'updated_at', label: '更新时间', minWidth: 170, formatter: orderTimeFormatter }
|
||||
@ -2005,7 +2012,7 @@ export const expectionColumns = [
|
||||
{ prop: 'pre_delivery_order_code', label: '前置单号', width: '140' },
|
||||
{ prop: 'order_flag', label: '订单标记', minWidth: '260' },
|
||||
{ prop: 'items_total', label: '商品总数', width: '100' },
|
||||
{ prop: 'items_weight', label: '商品重量kg', width: '110' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', width: '110' },
|
||||
{ prop: 'total_amount', label: '订单金额', width: '110' },
|
||||
{ prop: 'pay_time', label: '支付时间', width: '165', formatter: orderTimeFormatter },
|
||||
{ prop: 'create_at', label: '创建时间', width: '165', formatter: orderTimeFormatter },
|
||||
@ -2019,7 +2026,7 @@ export const expectionOrderDetail = [
|
||||
{ prop: 'shop_nick', label: '店铺名称' },
|
||||
{ prop: 'sys_platform_name', label: '平台' },
|
||||
{ prop: 'create_channel', label: '来源' },
|
||||
{ prop: 'status', label: '订单状态' },
|
||||
{ prop: 'status', label: '订单状态', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'intercept_status', label: '拦截状态' },
|
||||
|
||||
// 异常/状态标记
|
||||
@ -2043,7 +2050,7 @@ export const expectionOrderDetail = [
|
||||
// 统计信息
|
||||
{ prop: 'items_count', label: '商品种类' },
|
||||
{ prop: 'items_total', label: '商品总数' },
|
||||
{ prop: 'items_weight', label: '商品重量kg' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)' },
|
||||
|
||||
// 时间信息
|
||||
{ prop: 'create_at', label: '创建时间' },
|
||||
@ -2102,9 +2109,9 @@ export const archiveColumns = applyOrderListCopyActions([
|
||||
{ prop: 'name', label: '收件人', width: '120' },
|
||||
{ prop: 'mobile', label: '电话', width: '120' },
|
||||
{ prop: 'buyer_message', label: '买家留言', minWidth: '180' },
|
||||
{ prop: 'items_weight', label: '商品重量kg', width: '110' },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', width: '110' },
|
||||
{ prop: 'logistics_name', label: '快递', width: '120' },
|
||||
{ prop: 'status', label: '订单状态', width: '100' },
|
||||
{ prop: 'status', label: '订单状态', width: '100', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
{ prop: 'create_at', label: '创建时间', width: '160' },
|
||||
{ prop: 'updated_at', label: '归档时间', width: '160' },
|
||||
])
|
||||
@ -2117,7 +2124,7 @@ export const archiveOrderDetail = [
|
||||
{ prop: 'shop_nick', label: '店铺名称' },
|
||||
{ prop: 'sys_platform_name', label: '平台' },
|
||||
{ prop: 'create_channel', label: '来源' },
|
||||
{ prop: 'status', label: '订单状态' },
|
||||
{ prop: 'status', label: '订单状态', formatter: (row: any) => translateOrderField('status', row.status) },
|
||||
|
||||
// 收货信息
|
||||
{ prop: 'name', label: '收件人' },
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
class="weighing-form-alert"
|
||||
>
|
||||
<template #title>
|
||||
支持运单号模式(order_id=0)与订单模式(order_id 为正整数)。称重重量单位为 kg,须大于 0,最多 3 位小数。
|
||||
支持运单号模式(order_id=0)与订单模式(order_id 为正整数)。称重重量单位为 g,须大于 0 的整数。
|
||||
</template>
|
||||
</el-alert> -->
|
||||
|
||||
@ -66,19 +66,12 @@
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
<el-form-item label="重量单位">
|
||||
<el-radio-group v-model="formModel.weight_unit">
|
||||
<el-radio value="kg">kg</el-radio>
|
||||
<el-radio value="g">g</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="称重重量" prop="weighing_weight">
|
||||
<el-form-item label="称重重量(g)" prop="weighing_weight">
|
||||
<el-input-number
|
||||
v-model="formModel.weighing_weight"
|
||||
:min="formModel.weight_unit === 'g' ? 1 : 0.001"
|
||||
:precision="formModel.weight_unit === 'g' ? 0 : 3"
|
||||
:step="formModel.weight_unit === 'g' ? 1 : 0.1"
|
||||
:min="1"
|
||||
:precision="0"
|
||||
:step="1"
|
||||
controls-position="right"
|
||||
placeholder="请输入称重重量"
|
||||
style="width: 100%"
|
||||
@ -126,7 +119,6 @@ const formModel = reactive({
|
||||
waybill_code: '',
|
||||
order_id: undefined as number | undefined,
|
||||
order_waybill_code: '',
|
||||
weight_unit: 'kg' as 'kg' | 'g',
|
||||
weighing_weight: undefined as number | undefined
|
||||
})
|
||||
|
||||
@ -136,12 +128,9 @@ function validateWeighingWeight(_rule: unknown, value: unknown, callback: (error
|
||||
callback(new Error('称重重量须大于 0'))
|
||||
return
|
||||
}
|
||||
if (formModel.weight_unit === 'kg') {
|
||||
const rounded = Number(num.toFixed(3))
|
||||
if (Math.abs(num - rounded) > 1e-9) {
|
||||
callback(new Error('kg 单位最多 3 位小数'))
|
||||
return
|
||||
}
|
||||
if (!Number.isInteger(num)) {
|
||||
callback(new Error('称重重量必须为整数(g)'))
|
||||
return
|
||||
}
|
||||
callback()
|
||||
}
|
||||
@ -192,34 +181,12 @@ function resetForm() {
|
||||
formModel.waybill_code = props.initialWaybillCode?.trim() || ''
|
||||
formModel.order_id = undefined
|
||||
formModel.order_waybill_code = ''
|
||||
formModel.weight_unit = loadWeightUnit()
|
||||
formModel.weighing_weight = undefined
|
||||
formRef.value?.clearValidate()
|
||||
}
|
||||
|
||||
function loadWeightUnit(): 'kg' | 'g' {
|
||||
try {
|
||||
const unit = localStorage.getItem('order_weighing_unit')
|
||||
return unit === 'g' ? 'g' : 'kg'
|
||||
} catch {
|
||||
return 'kg'
|
||||
}
|
||||
}
|
||||
|
||||
function saveWeightUnit(unit: 'kg' | 'g') {
|
||||
try {
|
||||
localStorage.setItem('order_weighing_unit', unit)
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
function buildPayload(): UpdateExpressWeighingWeightParams {
|
||||
const rawWeight = Number(formModel.weighing_weight)
|
||||
const weighingWeight =
|
||||
formModel.weight_unit === 'g'
|
||||
? Number((rawWeight / 1000).toFixed(3))
|
||||
: Number(rawWeight.toFixed(3))
|
||||
const weighingWeight = Number(formModel.weighing_weight)
|
||||
|
||||
if (formModel.weighing_mode === 'waybill') {
|
||||
return {
|
||||
@ -257,7 +224,7 @@ async function handleSubmit() {
|
||||
if (!isOrderIndexApiSuccess(res)) {
|
||||
throw new Error(res?.message || '称重保存失败')
|
||||
}
|
||||
saveWeightUnit(formModel.weight_unit)
|
||||
|
||||
const detail = parseUpdateExpressWeighingWeightResponse(res)
|
||||
ElMessage.success(res?.message || '称重保存成功')
|
||||
applySuccessResult(payload, detail)
|
||||
|
||||
@ -9,11 +9,11 @@
|
||||
<div class="result-title">{{ lastResult.wave_no || lastResult.waybill || '称重结果' }}</div>
|
||||
<div class="result-weights">
|
||||
<div class="weight-row">
|
||||
<el-tag size="default" :type="weightWarnType" class="weight-tag">{{ lastResult.weighing_weight }} kg</el-tag>
|
||||
<el-tag size="default" :type="weightWarnType" class="weight-tag">{{ lastResult.weighing_weight }} g</el-tag>
|
||||
<span class="weight-label">称重</span>
|
||||
</div>
|
||||
<div class="weight-row" v-if="lastResult.total_weight != null">
|
||||
<el-tag size="default" type="info" class="weight-tag">{{ lastResult.total_weight }} kg</el-tag>
|
||||
<el-tag size="default" type="info" class="weight-tag">{{ lastResult.total_weight }} g</el-tag>
|
||||
<span class="weight-label">系统</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -40,7 +40,7 @@
|
||||
:class="{ 'has-waybill': s.waybill_code }"
|
||||
>
|
||||
<span class="split-key">{{ s.business_key }}</span>
|
||||
<span class="split-weight">{{ s.weighing_weight }} kg</span>
|
||||
<span class="split-weight">{{ s.weighing_weight }} g</span>
|
||||
<span class="split-waybill" v-if="s.waybill_code">{{ s.waybill_code }}</span>
|
||||
<span class="split-waybill empty" v-else>待分配</span>
|
||||
</div>
|
||||
@ -88,7 +88,7 @@
|
||||
@refresh="loadList"
|
||||
>
|
||||
<template #column-weighing_weight="{ row }">
|
||||
<span v-if="row.weighing_weight != null">{{ row.weighing_weight }} kg</span>
|
||||
<span v-if="row.weighing_weight != null">{{ row.weighing_weight }} g</span>
|
||||
<span v-else style="color:#c0c4cc">未称重</span>
|
||||
</template>
|
||||
|
||||
|
||||
@ -178,7 +178,7 @@
|
||||
@closed="resetWeighingForm"
|
||||
>
|
||||
<el-form ref="weighingFormRef" :model="weighingForm" :rules="weighingRules" label-width="80px" @submit.prevent>
|
||||
<el-form-item label="重量" prop="weight">
|
||||
<el-form-item label="重量(g)" prop="weight">
|
||||
<el-input-number
|
||||
ref="weighingInputRef"
|
||||
v-model="weighingForm.weight"
|
||||
@ -187,7 +187,7 @@
|
||||
:precision="3"
|
||||
:step="0.001"
|
||||
style="width: 100%"
|
||||
placeholder="请输入重量(kg)"
|
||||
placeholder="请输入重量(g)"
|
||||
@keyup.enter.prevent="submitWeighing"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -1769,7 +1769,7 @@ async function submitWeighing() {
|
||||
payload.recheck_status,
|
||||
payload.recheck_time
|
||||
].filter((x) => x != null && String(x) !== '')
|
||||
ElMessage.success(parts.length ? `复核成功:${parts.join(' / ')},称重 ${weight} kg` : `复核已记录,称重 ${weight} kg`)
|
||||
ElMessage.success(parts.length ? `复核成功:${parts.join(' / ')},称重 ${weight} g` : `复核已记录,称重 ${weight} g`)
|
||||
weighingDialogVisible.value = false
|
||||
weighingBeforeConfirm.value = false
|
||||
await finishConfirmAndAdvance()
|
||||
|
||||
@ -17,7 +17,7 @@ export const recheckOrderSingleListColumns = [
|
||||
{ prop: 'recheck_status', label: '复核状态', width: '96' },
|
||||
{ prop: 'items_count', label: 'SKU数', width: '72', align: 'right' },
|
||||
{ prop: 'items_total', label: '件数', width: '72', align: 'right' },
|
||||
{ prop: 'items_weight', label: '重量', width: '80', align: 'right' },
|
||||
{ prop: 'items_weight', label: '重量(g)', width: '80', align: 'right' },
|
||||
{ prop: 'pick_time', label: '拣货时间', width: '150' },
|
||||
{ prop: 'recheck_time', label: '复核时间', width: '150' }
|
||||
]
|
||||
|
||||
@ -249,7 +249,7 @@ export const fallbackOrderColumns = applyWaveListCopyActions([
|
||||
{ prop: 'province', label: '省份', minWidth: 100 },
|
||||
{ prop: 'items_count', label: '商品种数', minWidth: 100 },
|
||||
{ prop: 'items_total', label: '商品总数', minWidth: 100 },
|
||||
{ prop: 'items_weight', label: '商品重量kg', minWidth: 110 },
|
||||
{ prop: 'items_weight', label: '商品重量(g)', minWidth: 110 },
|
||||
{ prop: 'item_snapshot', label: '商品快照', minWidth: 260 },
|
||||
{ prop: 'wave_scan_result', label: '扫描结果', minWidth: 110 },
|
||||
{ prop: 'buyer_message', label: '买家留言', minWidth: 180 },
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
<el-descriptions-item label="商家编码">{{ selectedRow.goods_code || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="品牌">{{ selectedRow.brand_name || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="库存单位">{{ selectedRow.stock_unit || '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毛重">{{ selectedRow.gross_weight ?? '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="毛重">{{ selectedRow.gross_weight != null ? selectedRow.gross_weight + 'g' : '—' }}</el-descriptions-item>
|
||||
<el-descriptions-item label="条码" :span="2">
|
||||
<template v-if="selectedRow.barcodes && selectedRow.barcodes.length">
|
||||
<el-tag
|
||||
|
||||
@ -78,7 +78,7 @@ export const stockColumns = [
|
||||
},
|
||||
{
|
||||
prop: 'gross_weight',
|
||||
label: '毛重',
|
||||
label: '毛重(g)',
|
||||
width: '100',
|
||||
formatter: (row: any) => row.gross_weight ? `${formatNumber(row.gross_weight, 0)}g` : '--'
|
||||
},
|
||||
@ -212,7 +212,7 @@ export const stockColumns = [
|
||||
},
|
||||
{
|
||||
prop: 'net_weight',
|
||||
label: '净重',
|
||||
label: '净重(g)',
|
||||
width: '100',
|
||||
formatter: (row: any) => row.net_weight ? `${formatNumber(row.net_weight, 0)}g` : '--'
|
||||
},
|
||||
@ -507,6 +507,11 @@ export const stockFormRules = {
|
||||
stock_unit: [{ required: true, message: '库存单位不能为空', trigger: 'change' }],
|
||||
gross_weight: [
|
||||
{ required: true, message: '毛重不能为空', trigger: 'blur' },
|
||||
{
|
||||
pattern: /^(0|[1-9]\d*)$/,
|
||||
message: '毛重必须为非负整数(g)',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{
|
||||
validator: (rule: any, value: any, callback: any) => {
|
||||
if (value < 0) callback(new Error('毛重不能小于0'))
|
||||
|
||||
@ -238,7 +238,7 @@
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12"><el-form-item label="毛重/重量"><el-input v-model="editForm.weight" clearable /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="毛重/重量(g)"><el-input-number v-model="editForm.weight" :min="0" :precision="0" :controls="false" style="width: 100%" /></el-form-item></el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="SKU">
|
||||
@ -265,7 +265,7 @@
|
||||
<el-col :span="12"><el-form-item label="箱长"><el-input v-model="editForm.box_length" clearable /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="箱宽"><el-input v-model="editForm.box_width" clearable /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="箱高"><el-input v-model="editForm.box_height" clearable /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="实测箱重"><el-input v-model="editForm.box_weight" clearable /></el-form-item></el-col>
|
||||
<el-col :span="12"><el-form-item label="实测箱重(g)"><el-input-number v-model="editForm.box_weight" :min="0" :precision="0" :controls="false" style="width: 100%" /></el-form-item></el-col>
|
||||
|
||||
<el-col :span="24"><el-form-item label="备注"><el-input v-model="editForm.remark" type="textarea" :rows="3" clearable /></el-form-item></el-col>
|
||||
</el-row>
|
||||
@ -337,7 +337,7 @@
|
||||
{ prop: 'item_name', label: '商品名称', minWidth: '220' },
|
||||
{ prop: 'barcodes', label: '条码', width: '180' },
|
||||
{ prop: 'store_name', label: '货主', width: '180' },
|
||||
{ prop: 'weight', label: '重量', width: '110', align: 'right' }
|
||||
{ prop: 'weight', label: '重量(g)', width: '110', align: 'right' }
|
||||
]"
|
||||
@selection-change="handleSystemProductSelectionChange"
|
||||
@row-click="handleSystemProductRowClick"
|
||||
@ -2213,6 +2213,18 @@ const submitEditDetail = async () => {
|
||||
|
||||
const itemPayload: any = {}
|
||||
|
||||
// 重量字段必须为整数(g)
|
||||
for (const wf of ['weight', 'box_weight'] as const) {
|
||||
const raw = editForm[wf]
|
||||
if (raw !== '' && raw !== null && raw !== undefined) {
|
||||
const n = Number(raw)
|
||||
if (!Number.isInteger(n) || n < 0) {
|
||||
ElMessage.warning(`${wf === 'weight' ? '毛重/重量' : '实测箱重'}必须为非负整数(g)`)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const numberFields = [
|
||||
'actual_quantity',
|
||||
'box_quantity',
|
||||
|
||||
@ -1526,7 +1526,7 @@ async function handleExport(mode: 'waybill' | 'item' = 'waybill') {
|
||||
'实收数量': item.actual_quantity ?? '',
|
||||
'箱数': item.box_quantity ?? '',
|
||||
'箱规': item.boxes_per_pallet ?? '',
|
||||
'重量': item.weight ?? '',
|
||||
'重量(g)': item.weight ?? '',
|
||||
'批次号': item.batch_number || '',
|
||||
'生产日期': item.production_date || '',
|
||||
'有效期': item.expiry_date || '',
|
||||
|
||||
@ -406,7 +406,7 @@ export const productdetail = [
|
||||
{ prop: 'actual_quantity', label: '实际收货数量', width: '160' },
|
||||
{ prop: 'box_quantity', label: '箱数', width: '160' },
|
||||
{ prop: 'boxes_per_pallet', label: '箱规', width: '160' },
|
||||
{ prop: 'weight', label: '重量', width: '160' },
|
||||
{ prop: 'weight', label: '重量(g)', width: '160' },
|
||||
{ prop: 'pallet_quantity', label: '托盘数', width: '160' },
|
||||
{ prop: 'receiving_time', label: '收货时间', width: '160' },
|
||||
{ prop: 'receiving_status', label: '收货状态', width: '160' },
|
||||
@ -445,7 +445,7 @@ export const productquick = [
|
||||
{ prop: 'actual_quantity', label: '收货数量', width: '100', align: 'right' },
|
||||
{ prop: 'box_quantity', label: '箱数', width: '100', align: 'right' },
|
||||
{ prop: 'boxes_per_pallet', label: '箱规', width: '100', align: 'right' },
|
||||
{ prop: 'weight', label: '重量', width: '100', align: 'right' },
|
||||
{ prop: 'weight', label: '重量(g)', width: '100', align: 'right' },
|
||||
{ prop: 'batch_number', label: '批次号', width: '120' },
|
||||
{ prop: 'production_date', label: '生产日期', width: '120' },
|
||||
{ prop: 'expiry_date', label: '到期日期', width: '120' },
|
||||
@ -495,7 +495,7 @@ export const printFormConfig = [
|
||||
{ prop: 'barcode', label: '商品条码', type: 'input' },
|
||||
{ prop: 'box_quantity', label: '箱数', type: 'number' },
|
||||
{ prop: 'boxes_per_pallet', label: '箱规', type: 'number' },
|
||||
{ prop: 'weight', label: '重量', type: 'number' },
|
||||
{ prop: 'weight', label: '重量(g)', type: 'number' },
|
||||
{ prop: 'actual_quantity', label: '实际收货数量', type: 'number' },
|
||||
{ prop: 'remark', label: '明细备注', type: 'input' },
|
||||
]}
|
||||
|
||||
@ -30,16 +30,6 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="承重限制" prop="max_weight">
|
||||
<el-input-number
|
||||
v-model="formData.max_weight"
|
||||
:min="0"
|
||||
:step="0.1"
|
||||
style="width: 100%"
|
||||
placeholder="最大承重(kg)"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="仓位状态" prop="space_status">
|
||||
<el-select
|
||||
v-model="formData.space_status"
|
||||
@ -104,7 +94,6 @@ const formData = reactive<any>({
|
||||
space_code: '',
|
||||
custom_name: '',
|
||||
custom_barcode: '',
|
||||
max_weight: null,
|
||||
space_status: 'AVAILABLE',
|
||||
is_enabled: 1
|
||||
})
|
||||
@ -129,7 +118,6 @@ watch(() => props.space, (newSpace) => {
|
||||
formData.space_code = newSpace.space_code
|
||||
formData.custom_name = newSpace.custom_name || ''
|
||||
formData.custom_barcode = newSpace.custom_barcode || ''
|
||||
formData.max_weight = newSpace.max_weight
|
||||
formData.space_status = newSpace.space_status
|
||||
formData.is_enabled = newSpace.is_enabled ? 1 : 0
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user