Commit ce169029 by wusiyi

Merge branch 'dev' into 'master'

Dev

See merge request !267
parents 31d03a6d f44f8816
......@@ -18,6 +18,7 @@ export interface OrderData {
orderStatus?: number
fromUser?: string | number
salesPlatform?: string
platform?: string
logisticsCompanyId?: number
blocked?: boolean
logisticsCompanyName?: string
......
......@@ -63,18 +63,50 @@ export function useOrderSearchForm(
searchForm.value.shipmentType = ''
}
/** 扫码枪扫完一单后追加英文逗号,便于连续扫多个操作单号 */
const handleOperationNoScanEnter = (event: KeyboardEvent) => {
event.preventDefault()
const val = (searchForm.value.operationNo || '').trim()
if (!val || val.endsWith(',')) return
searchForm.value.operationNo = `${val},`
}
const getQueryPayload = () => {
const { productMarkList: rawProductMarks, tagsIdArr, ...rest } =
searchForm.value
const {
productMarkList: rawProductMarks,
tagsIdArr,
operationNo,
...rest
} = searchForm.value
const markQuery = normalizeProductMarkListForQuery(rawProductMarks)
const tagsId =
Array.isArray(tagsIdArr) && tagsIdArr.length > 0
? tagsIdArr.join(',')
: undefined
const processedOperationNo = (() => {
const originalValue = operationNo || ''
if (!originalValue) return ''
const values = originalValue.split(/[,,;;]/).filter((v) => v.trim())
const processedValues = values.map((value) => {
const trimmedValue = value.trim()
const underscoreCount = (trimmedValue.match(/_/g) || []).length
if (underscoreCount >= 3) {
const parts = trimmedValue.split('_')
return parts[3]
}
return trimmedValue
})
return processedValues.join(',')
})()
const raw: Record<string, unknown> = {
...rest,
...markQuery,
...(tagsId !== undefined ? { tagsId } : {}),
operationNo: processedOperationNo,
startTime: dateRange.value?.[0] || null,
endTime: dateRange.value?.[1] || null,
}
......@@ -99,6 +131,7 @@ export function useOrderSearchForm(
toggleMulti,
changeReplaceShipment,
getQueryPayload,
handleOperationNoScanEnter,
reset,
}
}
......@@ -165,6 +165,7 @@
placeholder="多个操作单号,分隔"
clearable
style="width: 140px"
@keydown.enter.prevent="handleOperationNoScanEnter"
/>
</ElFormItem>
......@@ -490,30 +491,22 @@
<ElDropdownMenu>
<ElDropdownItem
command="createLogistic"
:disabled="
cardSelectList.some((item) => item.shipmentType !== 1)
"
:disabled="isShowLogisticsButton"
>创建物流订单</ElDropdownItem
>
<ElDropdownItem
command="getTrackingNumber"
:disabled="
cardSelectList.some((item) => item.shipmentType !== 1)
"
:disabled="isShowLogisticsButton"
>获取跟踪号</ElDropdownItem
>
<ElDropdownItem
command="getPrintOrder"
:disabled="
cardSelectList.some((item) => item.shipmentType !== 1)
"
:disabled="isShowLogisticsButton"
>获取打印面单</ElDropdownItem
>
<ElDropdownItem
command="cancelLogistic"
:disabled="
cardSelectList.some((item) => item.shipmentType !== 1)
"
:disabled="isShowLogisticsButton"
>取消物流订单</ElDropdownItem
>
</ElDropdownMenu>
......@@ -837,7 +830,18 @@
@row-click="handleRowClick"
>
<template #operation="{ row }">
<div class="main-table-operation">
<div
v-if="
!(
status === 'ALL' &&
([, '已取消', '已完成', '已归档'].includes(
row.statusName,
) ||
row.pause)
)
"
class="main-table-operation"
>
<span v-if="status === 'PENDING_RECEIVE'" class="item">
<ElButton
type="primary"
......@@ -1391,6 +1395,7 @@ const {
toggleMulti,
changeReplaceShipment,
getQueryPayload,
handleOperationNoScanEnter,
reset,
} = useOrderSearchForm(
() => refreshCurrentViewProxy.value(),
......@@ -1488,6 +1493,7 @@ const {
operationOrderList,
logList,
tableRef,
currentRow,
selectedRows,
cardSelectList,
loading,
......@@ -1862,6 +1868,9 @@ const mainColumns = computed(() => [
label: status.value !== 'SUSPEND' ? '订单状态' : '挂起前状态',
minWidth: 120,
align: 'center',
render: (row: FactoryOrderNewListData) => {
return <span>{row.pause ? '挂起' : row.statusName}</span>
},
},
{
label: '客户标签',
......@@ -1882,6 +1891,12 @@ const mainColumns = computed(() => [
},
},
{
prop: 'shipmentsNote',
label: '客户发货备注',
width: 140,
align: 'center',
},
{
prop: 'logisticsWayName',
label: '物流类型',
width: 140,
......@@ -1918,6 +1933,8 @@ const mainColumns = computed(() => [
e.stopPropagation()
if (row.expressSheet) {
window.open(filePath + row.expressSheet, '_blank')
} else {
ElMessage.warning('未获取到物流面单,请获取后再打印!')
}
}}
>
......@@ -2028,7 +2045,7 @@ function getOperationOrderMarkLabel(row: operateOrderListData): string {
return ''
}
const operationOrderColumns = [
const operationOrderColumns = computed(() => [
{
key: 'operationNo',
prop: 'operationNo',
......@@ -2118,6 +2135,7 @@ const operationOrderColumns = [
minWidth: 120,
align: 'center',
showOverflowTooltip: true,
showColumn: currentRow.value?.pause === true,
},
{
key: 'craftName',
......@@ -2143,7 +2161,7 @@ const operationOrderColumns = [
align: 'center',
showOverflowTooltip: true,
},
]
])
const baseProductColumns = computed(() => [
{
......@@ -3369,6 +3387,15 @@ const getFunctionSwitch = async () => {
if (res.code !== 200) return
isEnableSorting.value = res.data.enable
}
// 物流接口是否展示
const isShowLogisticsButton = computed(() => {
if (isCardLayout.value) {
return cardSelectList.value.find((item) => item.shipmentType !== 1)
} else {
return selectedRows.value.find((item) => item.shipmentType !== 1)
}
})
onMounted(() => {
loadStatusTreeCounts()
loadAllDictionaries()
......
......@@ -123,9 +123,12 @@
<span>物流方式:</span>
<span></span>
</div> -->
<div class="basic-info-item">
<span>发货备注:</span>
<span>{{ podOrderDetailsData?.remark }}</span>
<div
class="basic-info-item"
:title="podOrderDetailsData?.shipmentsNote"
>
<span>客户发货备注:</span>
<span>{{ podOrderDetailsData?.shipmentsNote }}</span>
</div>
<div class="basic-info-item">
<span>订单号:</span>
......@@ -176,6 +179,31 @@
?.warehouseName || '')
}}
</div>
<div class="platform-filter">
<span>平台</span>
<ElSelect
v-model="platform"
placeholder="请选择"
clearable
filterable
style="width: 250px"
>
<ElOption
v-for="(item, index) in platformList"
:key="index"
:label="item.type"
:value="item.type"
>
<img
:src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0"
/>
<span :title="item.type">{{ item.type }}</span>
</ElOption>
</ElSelect>
<ElButton type="primary" @click="handlePlatformChange">查询</ElButton>
<ElButton @click="resetPlatform">重置</ElButton>
</div>
<div class="flex right-panel-body">
<div class="middle-content">
<div class="box-top">
......@@ -282,6 +310,10 @@
:class="{
active: item.box && boxIndex == item.box,
isNull: !item.data,
'platform-matched':
platformMatchedBoxes &&
item.box &&
platformMatchedBoxes.includes(item.box),
}"
@click="handleBoxClick(item)"
>
......@@ -343,6 +375,7 @@ import { ElButton, ElIcon, ElTag } from 'element-plus'
import { BaseRespData } from '@/types/api'
import type { SortingList } from '@/types/api/order'
import { showError } from '@/utils/ui.ts'
import platformJson from '../../../json/platform.json'
const { getCLodop } = useLodop()
......@@ -539,6 +572,7 @@ watch(visible, async (value: boolean) => {
if (value) {
podOrderDetailsData.value = {}
currentCode = ''
resetPlatform()
if (props.wallType === 'sort') {
await getSortingAreaList()
}
......@@ -865,6 +899,7 @@ const initPrintDevice = () => {
// }
// }
const handleSearch = () => {
resetPlatform()
const code = productionOrder.value
if (!code) {
ElMessage.warning('请输入生产单号')
......@@ -1533,6 +1568,7 @@ const handleSortingAreaChange = (
sortingAreaId: sortingAreaId.value,
})
initOrderDetailBox(type)
resetPlatform()
}
// 手动切换仓库
const handleWarehouseChange = (value: string | number) => {
......@@ -1553,6 +1589,7 @@ const handleWarehouseChange = (value: string | number) => {
})
_warehouseId.value = value
initOrderDetailBox()
resetPlatform()
}
const printNormal = async () => {
......@@ -1609,6 +1646,36 @@ const getSortingAreaList = async () => {
if (res.code !== 200) return
sortingAreaList.value = res.data.records
}
// 筛选查询平台
const platformList = computed(
() => platformJson.filter((item) => item.type === 'TIKTOK'),
// platformJson,
)
const platform = ref<string>('')
const queriedPlatform = ref<string>('')
const platformMatchedBoxes = computed(() => {
if (!queriedPlatform.value) return null
return (podBoxList.value || [])
.filter(
(item) =>
item.data?.platform?.toUpperCase() ===
queriedPlatform.value.toUpperCase(),
)
.map((item) => item.box)
.filter((box): box is number => box != null && box !== 0)
})
const handlePlatformChange = () => {
if (!platform.value) {
ElMessage.warning('请选择平台')
return
}
queriedPlatform.value = platform.value
}
const resetPlatform = () => {
platform.value = ''
queriedPlatform.value = ''
}
</script>
<style scoped lang="scss">
......@@ -1654,11 +1721,21 @@ const getSortingAreaList = async () => {
flex: 1;
min-height: 0;
overflow: hidden;
.platform-filter {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
margin-bottom: 5px;
}
.right-panel-body {
min-height: 0;
overflow: hidden;
}
}
.right-panel-body {
min-height: 0;
overflow: hidden;
}
.sorting-area-content {
border: 2px solid #666;
padding: 10px;
......@@ -1791,6 +1868,10 @@ const getSortingAreaList = async () => {
background: #ff9900;
color: #fff;
}
&.platform-matched {
background: rgb(177, 19, 19);
color: #fff;
}
&.badge::after {
position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment