Commit 9a72bd10 by wusiyi

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

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