Commit f94dee6c by linjinhong

podus podcn添加自定义标签展示

parent e4199f19
......@@ -10,7 +10,10 @@ import {
ExportParams,
IconfirmSubmit,
} from '@/types/api/podCnOrder'
import { InterceptStateGroupData,ProductionClient } from '@/types/api/podUsOrder'
import {
InterceptStateGroupData,
ProductionClient,
} from '@/types/api/podUsOrder'
import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export function exportPodCnInfo(data: ExportParams) {
......@@ -657,3 +660,9 @@ export function printProductionPdfByBatchNumberApi(params: {
},
)
}
// 获取US标签列表
export function getCustomTagListCnApi() {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderCn/getCustomTagList`,
)
}
......@@ -615,3 +615,10 @@ export function countTrackRegisterApi() {
`factory/podJomallOrderUs/countTrackRegister`,
)
}
// 获取US标签列表
export function getCustomTagListApi() {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/getCustomTagList`,
)
}
......@@ -192,8 +192,8 @@ const copy = (text: string) => {
.img_top_right {
position: absolute;
top: 5px;
right: 5px;
top: 0px;
right: 0px;
}
.img_bottom_left {
......
......@@ -42,6 +42,8 @@ export interface SearchForm {
exceptionHandling?: number | undefined
interceptStatus?: number | string
sizeType?: number | null
tagsId?: string
tagsIdArr?: (number | null)[]
}
export interface PodCnOrderListData {
id: number
......@@ -90,6 +92,7 @@ export interface PodCnOrderListData {
logisticsWayName?: string
url?: string | null
tiffUrl?: string | null
customTagList?: { name: string }[]
}
export interface ProductList {
id: number
......@@ -141,6 +144,7 @@ export interface ProductList {
interceptStatus?: number | null
batchArrangeNumber?: string | null
sizeType?: number | null
customTagList?: { name: string }[]
}
export interface cardImages {
title: string
......
......@@ -38,6 +38,8 @@ export interface SearchForm {
interceptStatus?: number | string
trackRegisterSelect?: string | number
sizeType?: number | null
tagsId?: string
tagsIdArr?: (number | null)[]
}
export interface PodUsOrderListData {
id: number
......@@ -84,6 +86,7 @@ export interface PodUsOrderListData {
url?: string | null
tiffUrl?: string | null
lanshouAddress?: string | null
customTagList?: { name: string }[]
}
export interface ProductList {
id: number
......@@ -134,6 +137,7 @@ export interface ProductList {
batchArrangeNumber?: string | null
interceptStatus?: number | null
sizeType?: number | null
customTagList?: { name: string }[]
}
export interface cardImages {
title: string
......
......@@ -301,6 +301,26 @@
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="标签">
<ElSelect
v-model="searchForm.tagsIdArr"
placeholder="请选择标签"
clearable
filterable
multiple
collapse-tags
collapse-tags-tooltip
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in customTagList"
:key="index"
:value="item.id"
:label="item.name"
></ElOption>
</ElSelect>
</ElFormItem>
</ElForm>
<template #reference>
<el-button type="warning" @click="searchVisible = !searchVisible">
......@@ -1201,6 +1221,25 @@
</el-icon>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">自定义标签:</span>
<span
class="order-detail-item-value"
:title=" row.customTagList?.length
? row.customTagList
.map((item: { name: string }) => item.name)
.join(',')
: ''"
>
{{
row.customTagList?.length
? row.customTagList
.map((item: { name: string }) => item.name)
.join(',')
: ''
}}
</span>
</div>
<div class="order-detail-item">
<!-- 是否代发 0. 1. -->
<span class="order-detail-item-label">是否代发:</span>
<span
......@@ -1590,7 +1629,7 @@
>
<div v-if="tableData.length > 0" class="card-list">
<div
v-for="cardItem in tableData as ProductList[]"
v-for="(cardItem) in tableData as ProductList[]"
:key="cardItem.id"
class="card-list-item"
@click="cardClick(cardItem)"
......@@ -1620,6 +1659,39 @@
>
<el-icon color="#E6A23C"><InfoFilled /></el-icon>
</el-tooltip>
<el-tooltip
v-if="cardItem.customTagList"
:disabled="!(cardItem.customTagList?.length > 3)"
class="box-item"
effect="light"
:content="tooltipContent(cardItem.customTagList.slice(3))"
placement="bottom"
>
<template #content>
<div
v-for="(item, index) in cardItem.customTagList.slice(3)"
:key="index"
>
<el-tag type="primary">{{ item.name || '' }}</el-tag>
</div>
</template>
<div
class="flex"
style="gap: 5px; overflow: hidden"
v-if="cardItem.customTagList?.length"
>
<el-tag
size="small"
type="primary"
v-for="(item, index) in cardItem.customTagList.slice(
0,
3,
)"
:key="index"
>{{ item.name || '' }}</el-tag
>
</div>
</el-tooltip>
</template>
<template
#top_right
......@@ -2359,6 +2431,7 @@ import {
printPickPdfByBatchNumberApi,
printProductionPdfByBatchNumberApi,
batchDownloadRecomposingApi,
getCustomTagListCnApi,
} from '@/api/podCnOrder'
import { BaseRespData } from '@/types/api'
......@@ -3386,6 +3459,13 @@ const {
} = usePageList({
initPageSize: initPageSize.value,
query: (page, pageSize) => {
const baseparams = {
...searchForm.value,
startTime: timeRange.value?.[0] || null,
endTime: timeRange.value?.[1] || null,
tagsId: searchForm.value?.tagsIdArr?.join(',') || '',
}
baseparams.tagsIdArr && delete baseparams.tagsIdArr
// 批量下载
if (status.value === 'BATCH_DOWNLOAD') {
return batchDownloadApi(page, pageSize).then((res) => {
......@@ -3399,15 +3479,7 @@ const {
) {
return getOrderList(
{
...searchForm.value,
startTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[0]
: null,
endTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[1]
: null,
...baseparams,
status: status.value === 'INTERCEPTED' ? '' : status.value,
shipmentArea:
status.value === 'CREATE_LOGISTICS'
......@@ -3426,15 +3498,7 @@ const {
} else {
return getCardOrderList(
{
...searchForm.value,
startTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[0]
: null,
endTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[1]
: null,
...baseparams,
status: status.value,
interceptStatus: '',
},
......@@ -4703,7 +4767,21 @@ const loadCraftList = async () => {
console.error(e)
}
}
const customTagList = ref<{ id: string; name: string }[]>([])
const getCustomTagList = async () => {
try {
const res = await getCustomTagListCnApi()
if (res.code !== 200) return
customTagList.value = res.data
} catch (e) {
console.error(e)
}
}
function tooltipContent(arr: { name: string }[]) {
return arr.map((tag) => tag.name).join('、')
}
const expressSheetUpload = async (file: File) => {
const fm = new FormData()
fm.append('file', file)
......@@ -4773,6 +4851,7 @@ onMounted(() => {
loadTabData()
getUserMark()
loadWarehouseList()
getCustomTagList()
loadCraftList()
})
......
......@@ -256,6 +256,26 @@
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="标签">
<ElSelect
v-model="searchForm.tagsIdArr"
placeholder="请选择标签"
clearable
filterable
multiple
collapse-tags
collapse-tags-tooltip
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in customTagList"
:key="index"
:value="item.id"
:label="item.name"
></ElOption>
</ElSelect>
</ElFormItem>
</ElForm>
<template #reference>
<el-button type="warning" @click="searchVisible = !searchVisible">
......@@ -1363,6 +1383,25 @@
</el-icon>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">自定义标签:</span>
<span
class="order-detail-item-value"
:title=" row.customTagList?.length
? row.customTagList
.map((item: { name: string }) => item.name)
.join(',')
: ''"
>
{{
row.customTagList?.length
? row.customTagList
.map((item: { name: string }) => item.name)
.join(',')
: ''
}}
</span>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">物流类型:</span>
<span
style="color: red; font-weight: 500"
......@@ -1804,9 +1843,10 @@
>
<div v-if="tableData.length > 0" class="card-list">
<div
v-for="cardItem in tableData as ProductList[]"
v-for="(cardItem) in tableData as ProductList[]"
:key="cardItem.id"
class="card-list-item"
ref="cardRefs"
@click="cardClick(cardItem)"
@mouseleave="handleChangeImages(null, cardItem)"
>
......@@ -1836,6 +1876,41 @@
<InfoFilled />
</el-icon>
</el-tooltip>
<el-tooltip
v-if="cardItem.customTagList"
:disabled="!(cardItem.customTagList?.length > 3)"
class="box-item"
effect="light"
:content="tooltipContent(cardItem.customTagList.slice(3))"
placement="bottom"
>
<template #content>
<div
v-for="(item, index) in cardItem.customTagList.slice(3)"
:key="index"
>
<el-tag type="primary">{{ item.name || '' }}</el-tag>
</div>
</template>
<div
class="flex"
ref="tagRefs"
style="gap: 5px; overflow: hidden"
v-if="cardItem.customTagList?.length"
>
<el-tag
size="small"
type="primary"
v-for="(item, index) in cardItem.customTagList.slice(
0,
3,
)"
:key="index"
>{{ item.name || '' }}</el-tag
>
</div>
</el-tooltip>
</template>
<template
v-if="['ZPZY', 'CXZY', 'THZY'].includes(cardItem.craftCode as string)"
......@@ -2714,6 +2789,7 @@ import {
changeToFinished,
updateTrackingNumberAndRegister,
countTrackRegisterApi,
getCustomTagListApi,
} from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api'
......@@ -3580,6 +3656,17 @@ const {
return processedValues.join(',')
})()
//基本params
const baseparams = {
...searchForm.value,
factorySubOrderNumber,
startTime: timeRange.value?.[0] || null,
endTime: timeRange.value?.[1] || null,
craftCode: searchForm.value?.craftCodeArr?.join(',') || '',
tagsId: searchForm.value?.tagsIdArr?.join(',') || '',
}
baseparams.craftCodeArr && delete baseparams.craftCodeArr
baseparams.tagsIdArr && delete baseparams.tagsIdArr
// 批量下载
if (status.value === 'BATCH_DOWNLOAD') {
return batchDownloadApi(page, pageSize).then((res) => {
......@@ -3592,16 +3679,7 @@ const {
status.value !== 'TO_BE_ARRANGE'
) {
const params = {
...searchForm.value,
factorySubOrderNumber,
startTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[0]
: null,
endTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[1]
: null,
...baseparams,
status: status.value === 'INTERCEPTED' ? '' : status.value,
exceptionHandling:
status.value === 'EXCEPTION_ORDER'
......@@ -3611,29 +3689,18 @@ const {
status.value === 'INTERCEPTED' ? interceptStatus.value : '',
trackRegisterSelect:
status.value === 'WAIT_TRACK' ? waitTrackStatus.value : '',
craftCode: searchForm.value?.craftCodeArr?.join(',') || '',
}
params.craftCodeArr && delete params.craftCodeArr
return getOrderList(params, page, pageSize).then(
(res) => res.data,
) as never
} else {
const params = {
...searchForm.value,
factorySubOrderNumber,
startTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[0]
: null,
endTime:
timeRange.value && timeRange.value.length > 0
? timeRange.value[1]
: null,
...baseparams,
status: status.value,
interceptStatus: '',
craftCode: searchForm.value?.craftCodeArr?.join(',') || '',
}
params.craftCodeArr && delete params.craftCodeArr
return getCardOrderList(params, page, pageSize).then(
(res) => res.data,
) as never
......@@ -3647,6 +3714,8 @@ watch(
if (!newData?.length) return
newData.forEach((order) => {
// console.log(3690, order)
// 使用可选链和空值合并简化判断
order.productList?.forEach((product) => {
if (!product.previewImgs && product.imageAry) {
......@@ -5388,6 +5457,18 @@ const loadCraftList = async () => {
console.error(e)
}
}
const customTagList = ref<{ id: string; name: string }[]>([])
const getCustomTagList = async () => {
try {
const res = await getCustomTagListApi()
if (res.code !== 200) return
customTagList.value = res.data
} catch (e) {
console.error(e)
}
}
const refreshMaterial = async () => {
if (
[
......@@ -5460,6 +5541,7 @@ onMounted(() => {
loadProductionClient()
loadWarehouseList()
loadCraftList()
getCustomTagList()
})
const expressSheetUpload = async (file: File) => {
......@@ -5893,6 +5975,10 @@ function changeChinaTime(zone: string) {
})
}
function tooltipContent(arr: { name: string }[]) {
return arr.map((tag) => tag.name).join('、')
}
const token = getToken() as string
async function getPermission() {
......
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