Commit f94dee6c by linjinhong

podus podcn添加自定义标签展示

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