Commit ce169029 by wusiyi

Merge branch 'dev' into 'master'

Dev

See merge request !267
parents 31d03a6d f44f8816
...@@ -18,6 +18,7 @@ export interface OrderData { ...@@ -18,6 +18,7 @@ export interface OrderData {
orderStatus?: number orderStatus?: number
fromUser?: string | number fromUser?: string | number
salesPlatform?: string salesPlatform?: string
platform?: string
logisticsCompanyId?: number logisticsCompanyId?: number
blocked?: boolean blocked?: boolean
logisticsCompanyName?: string logisticsCompanyName?: string
......
...@@ -63,18 +63,50 @@ export function useOrderSearchForm( ...@@ -63,18 +63,50 @@ export function useOrderSearchForm(
searchForm.value.shipmentType = '' 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 getQueryPayload = () => {
const { productMarkList: rawProductMarks, tagsIdArr, ...rest } = const {
searchForm.value productMarkList: rawProductMarks,
tagsIdArr,
operationNo,
...rest
} = searchForm.value
const markQuery = normalizeProductMarkListForQuery(rawProductMarks) const markQuery = normalizeProductMarkListForQuery(rawProductMarks)
const tagsId = const tagsId =
Array.isArray(tagsIdArr) && tagsIdArr.length > 0 Array.isArray(tagsIdArr) && tagsIdArr.length > 0
? tagsIdArr.join(',') ? tagsIdArr.join(',')
: undefined : 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> = { const raw: Record<string, unknown> = {
...rest, ...rest,
...markQuery, ...markQuery,
...(tagsId !== undefined ? { tagsId } : {}), ...(tagsId !== undefined ? { tagsId } : {}),
operationNo: processedOperationNo,
startTime: dateRange.value?.[0] || null, startTime: dateRange.value?.[0] || null,
endTime: dateRange.value?.[1] || null, endTime: dateRange.value?.[1] || null,
} }
...@@ -99,6 +131,7 @@ export function useOrderSearchForm( ...@@ -99,6 +131,7 @@ export function useOrderSearchForm(
toggleMulti, toggleMulti,
changeReplaceShipment, changeReplaceShipment,
getQueryPayload, getQueryPayload,
handleOperationNoScanEnter,
reset, reset,
} }
} }
...@@ -165,6 +165,7 @@ ...@@ -165,6 +165,7 @@
placeholder="多个操作单号,分隔" placeholder="多个操作单号,分隔"
clearable clearable
style="width: 140px" style="width: 140px"
@keydown.enter.prevent="handleOperationNoScanEnter"
/> />
</ElFormItem> </ElFormItem>
...@@ -490,30 +491,22 @@ ...@@ -490,30 +491,22 @@
<ElDropdownMenu> <ElDropdownMenu>
<ElDropdownItem <ElDropdownItem
command="createLogistic" command="createLogistic"
:disabled=" :disabled="isShowLogisticsButton"
cardSelectList.some((item) => item.shipmentType !== 1)
"
>创建物流订单</ElDropdownItem >创建物流订单</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
command="getTrackingNumber" command="getTrackingNumber"
:disabled=" :disabled="isShowLogisticsButton"
cardSelectList.some((item) => item.shipmentType !== 1)
"
>获取跟踪号</ElDropdownItem >获取跟踪号</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
command="getPrintOrder" command="getPrintOrder"
:disabled=" :disabled="isShowLogisticsButton"
cardSelectList.some((item) => item.shipmentType !== 1)
"
>获取打印面单</ElDropdownItem >获取打印面单</ElDropdownItem
> >
<ElDropdownItem <ElDropdownItem
command="cancelLogistic" command="cancelLogistic"
:disabled=" :disabled="isShowLogisticsButton"
cardSelectList.some((item) => item.shipmentType !== 1)
"
>取消物流订单</ElDropdownItem >取消物流订单</ElDropdownItem
> >
</ElDropdownMenu> </ElDropdownMenu>
...@@ -837,7 +830,18 @@ ...@@ -837,7 +830,18 @@
@row-click="handleRowClick" @row-click="handleRowClick"
> >
<template #operation="{ row }"> <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"> <span v-if="status === 'PENDING_RECEIVE'" class="item">
<ElButton <ElButton
type="primary" type="primary"
...@@ -1391,6 +1395,7 @@ const { ...@@ -1391,6 +1395,7 @@ const {
toggleMulti, toggleMulti,
changeReplaceShipment, changeReplaceShipment,
getQueryPayload, getQueryPayload,
handleOperationNoScanEnter,
reset, reset,
} = useOrderSearchForm( } = useOrderSearchForm(
() => refreshCurrentViewProxy.value(), () => refreshCurrentViewProxy.value(),
...@@ -1488,6 +1493,7 @@ const { ...@@ -1488,6 +1493,7 @@ const {
operationOrderList, operationOrderList,
logList, logList,
tableRef, tableRef,
currentRow,
selectedRows, selectedRows,
cardSelectList, cardSelectList,
loading, loading,
...@@ -1862,6 +1868,9 @@ const mainColumns = computed(() => [ ...@@ -1862,6 +1868,9 @@ const mainColumns = computed(() => [
label: status.value !== 'SUSPEND' ? '订单状态' : '挂起前状态', label: status.value !== 'SUSPEND' ? '订单状态' : '挂起前状态',
minWidth: 120, minWidth: 120,
align: 'center', align: 'center',
render: (row: FactoryOrderNewListData) => {
return <span>{row.pause ? '挂起' : row.statusName}</span>
},
}, },
{ {
label: '客户标签', label: '客户标签',
...@@ -1882,6 +1891,12 @@ const mainColumns = computed(() => [ ...@@ -1882,6 +1891,12 @@ const mainColumns = computed(() => [
}, },
}, },
{ {
prop: 'shipmentsNote',
label: '客户发货备注',
width: 140,
align: 'center',
},
{
prop: 'logisticsWayName', prop: 'logisticsWayName',
label: '物流类型', label: '物流类型',
width: 140, width: 140,
...@@ -1918,6 +1933,8 @@ const mainColumns = computed(() => [ ...@@ -1918,6 +1933,8 @@ const mainColumns = computed(() => [
e.stopPropagation() e.stopPropagation()
if (row.expressSheet) { if (row.expressSheet) {
window.open(filePath + row.expressSheet, '_blank') window.open(filePath + row.expressSheet, '_blank')
} else {
ElMessage.warning('未获取到物流面单,请获取后再打印!')
} }
}} }}
> >
...@@ -2028,7 +2045,7 @@ function getOperationOrderMarkLabel(row: operateOrderListData): string { ...@@ -2028,7 +2045,7 @@ function getOperationOrderMarkLabel(row: operateOrderListData): string {
return '' return ''
} }
const operationOrderColumns = [ const operationOrderColumns = computed(() => [
{ {
key: 'operationNo', key: 'operationNo',
prop: 'operationNo', prop: 'operationNo',
...@@ -2118,6 +2135,7 @@ const operationOrderColumns = [ ...@@ -2118,6 +2135,7 @@ const operationOrderColumns = [
minWidth: 120, minWidth: 120,
align: 'center', align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true,
showColumn: currentRow.value?.pause === true,
}, },
{ {
key: 'craftName', key: 'craftName',
...@@ -2143,7 +2161,7 @@ const operationOrderColumns = [ ...@@ -2143,7 +2161,7 @@ const operationOrderColumns = [
align: 'center', align: 'center',
showOverflowTooltip: true, showOverflowTooltip: true,
}, },
] ])
const baseProductColumns = computed(() => [ const baseProductColumns = computed(() => [
{ {
...@@ -3369,6 +3387,15 @@ const getFunctionSwitch = async () => { ...@@ -3369,6 +3387,15 @@ const getFunctionSwitch = async () => {
if (res.code !== 200) return if (res.code !== 200) return
isEnableSorting.value = res.data.enable 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(() => { onMounted(() => {
loadStatusTreeCounts() loadStatusTreeCounts()
loadAllDictionaries() loadAllDictionaries()
......
...@@ -123,9 +123,12 @@ ...@@ -123,9 +123,12 @@
<span>物流方式:</span> <span>物流方式:</span>
<span></span> <span></span>
</div> --> </div> -->
<div class="basic-info-item"> <div
<span>发货备注:</span> class="basic-info-item"
<span>{{ podOrderDetailsData?.remark }}</span> :title="podOrderDetailsData?.shipmentsNote"
>
<span>客户发货备注:</span>
<span>{{ podOrderDetailsData?.shipmentsNote }}</span>
</div> </div>
<div class="basic-info-item"> <div class="basic-info-item">
<span>订单号:</span> <span>订单号:</span>
...@@ -176,6 +179,31 @@ ...@@ -176,6 +179,31 @@
?.warehouseName || '') ?.warehouseName || '')
}} }}
</div> </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="flex right-panel-body">
<div class="middle-content"> <div class="middle-content">
<div class="box-top"> <div class="box-top">
...@@ -282,6 +310,10 @@ ...@@ -282,6 +310,10 @@
:class="{ :class="{
active: item.box && boxIndex == item.box, active: item.box && boxIndex == item.box,
isNull: !item.data, isNull: !item.data,
'platform-matched':
platformMatchedBoxes &&
item.box &&
platformMatchedBoxes.includes(item.box),
}" }"
@click="handleBoxClick(item)" @click="handleBoxClick(item)"
> >
...@@ -343,6 +375,7 @@ import { ElButton, ElIcon, ElTag } from 'element-plus' ...@@ -343,6 +375,7 @@ import { ElButton, ElIcon, ElTag } from 'element-plus'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
import type { SortingList } from '@/types/api/order' import type { SortingList } from '@/types/api/order'
import { showError } from '@/utils/ui.ts' import { showError } from '@/utils/ui.ts'
import platformJson from '../../../json/platform.json'
const { getCLodop } = useLodop() const { getCLodop } = useLodop()
...@@ -539,6 +572,7 @@ watch(visible, async (value: boolean) => { ...@@ -539,6 +572,7 @@ watch(visible, async (value: boolean) => {
if (value) { if (value) {
podOrderDetailsData.value = {} podOrderDetailsData.value = {}
currentCode = '' currentCode = ''
resetPlatform()
if (props.wallType === 'sort') { if (props.wallType === 'sort') {
await getSortingAreaList() await getSortingAreaList()
} }
...@@ -865,6 +899,7 @@ const initPrintDevice = () => { ...@@ -865,6 +899,7 @@ const initPrintDevice = () => {
// } // }
// } // }
const handleSearch = () => { const handleSearch = () => {
resetPlatform()
const code = productionOrder.value const code = productionOrder.value
if (!code) { if (!code) {
ElMessage.warning('请输入生产单号') ElMessage.warning('请输入生产单号')
...@@ -1533,6 +1568,7 @@ const handleSortingAreaChange = ( ...@@ -1533,6 +1568,7 @@ const handleSortingAreaChange = (
sortingAreaId: sortingAreaId.value, sortingAreaId: sortingAreaId.value,
}) })
initOrderDetailBox(type) initOrderDetailBox(type)
resetPlatform()
} }
// 手动切换仓库 // 手动切换仓库
const handleWarehouseChange = (value: string | number) => { const handleWarehouseChange = (value: string | number) => {
...@@ -1553,6 +1589,7 @@ const handleWarehouseChange = (value: string | number) => { ...@@ -1553,6 +1589,7 @@ const handleWarehouseChange = (value: string | number) => {
}) })
_warehouseId.value = value _warehouseId.value = value
initOrderDetailBox() initOrderDetailBox()
resetPlatform()
} }
const printNormal = async () => { const printNormal = async () => {
...@@ -1609,6 +1646,36 @@ const getSortingAreaList = async () => { ...@@ -1609,6 +1646,36 @@ const getSortingAreaList = async () => {
if (res.code !== 200) return if (res.code !== 200) return
sortingAreaList.value = res.data.records 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> </script>
<style scoped lang="scss"> <style scoped lang="scss">
...@@ -1654,11 +1721,21 @@ const getSortingAreaList = async () => { ...@@ -1654,11 +1721,21 @@ const getSortingAreaList = async () => {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
overflow: hidden; 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 { .sorting-area-content {
border: 2px solid #666; border: 2px solid #666;
padding: 10px; padding: 10px;
...@@ -1791,6 +1868,10 @@ const getSortingAreaList = async () => { ...@@ -1791,6 +1868,10 @@ const getSortingAreaList = async () => {
background: #ff9900; background: #ff9900;
color: #fff; color: #fff;
} }
&.platform-matched {
background: rgb(177, 19, 19);
color: #fff;
}
&.badge::after { &.badge::after {
position: absolute; 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