Commit 9a72bd10 by wusiyi

feat: 工厂订单(NEW)操作单展示客户标签 #1009511

parent 40ae7ae9
......@@ -165,6 +165,7 @@ export interface operateOrderListData {
warehouseId?: number
namespace?: string
statusName?: string
tagsId?: string
[key: string]: unknown
}
......
......@@ -45,6 +45,11 @@
</div>
</el-tooltip>
<span v-if="item.tagsId" class="flex-row flex-row-gap6">
<el-tag v-for="tag in getItemTags(item.tagsId)" :key="tag.id">
{{ tag.name }}
</el-tag>
</span>
</template>
<template #top_right>
<img
......@@ -306,6 +311,7 @@ const props = defineProps<{
status?: string
queryPayload?: Record<string, unknown>
initPageSize?: number
tagList?: { id: string; name: string }[]
fetchList?: CardLayoutListFetcher
}>()
......@@ -356,6 +362,16 @@ const rightClickItem = ref<operateOrderListData | null>(null)
const isSelected = (item: operateOrderListData) =>
selectedItems.value.some((s) => s.id === item.id)
const getItemTags = (tagsId?: string) => {
if (!tagsId || !props.tagList?.length) return []
return tagsId
.split(',')
.map((id) => id.trim())
.filter(Boolean)
.map((id) => props.tagList!.find((tag) => String(tag.id) === id))
.filter((tag): tag is { id: string; name: string } => !!tag)
}
const handleCardClick = (item: operateOrderListData) => {
const idx = selectedItems.value.findIndex((s) => s.id === item.id)
if (idx >= 0) {
......@@ -432,13 +448,13 @@ const openLogDialog = async (item: operateOrderListData) => {
})
try {
const res = await getFactoryOrderNewLogApi(item.podOrderId as number)
logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true
} catch (e) {
// ignore
} finally {
loading.close()
}
logList.value = (res.data || []) as unknown as LogListData[]
logVisible.value = true
} catch (e) {
// ignore
} finally {
loading.close()
}
}
const clearSelection = () => {
......@@ -555,8 +571,8 @@ defineExpose({ clearSelection, getSelectedIds, refresh })
}
.product-mark-badge {
border: 2px solid #F56C6C;
color: #F56C6C;
border: 2px solid #f56c6c;
color: #f56c6c;
font-weight: 700;
height: 28px;
width: 28px;
......
......@@ -782,6 +782,7 @@
ref="cardLayoutRef"
:status="listQueryStatus"
:query-payload="getListQueryPayload()"
:tag-list="customTagList"
@selection-change="handleCardSelectionChange"
@view-detail="handleViewDetail"
/>
......
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