feat(consignment): 寄售仓库新增对接客服多选筛选
This commit is contained in:
@@ -149,6 +149,8 @@ export default function ConsignmentInventoryPanel() {
|
||||
const [categoryExpandedKeys, setCategoryExpandedKeys] = useState<Array<string | number>>([])
|
||||
const [specFilters, setSpecFilters] = useState<Record<string, string>>({})
|
||||
const [allowMatching, setAllowMatching] = useState<string>('')
|
||||
// 对接客服多选:0 作为「未指定」哨兵值,与真实客服 id 分开。
|
||||
const [contactSupporterIds, setContactSupporterIds] = useState<number[]>([])
|
||||
const [inboundRange, setInboundRange] = useState<[string, string] | null>(null)
|
||||
const [keyword, setKeyword] = useState<string>('')
|
||||
const [page, setPage] = useState<number>(1)
|
||||
@@ -295,6 +297,9 @@ export default function ConsignmentInventoryPanel() {
|
||||
}, [dynamicFilters, specFilters])
|
||||
const specFilterParams =
|
||||
Object.keys(specFilterPayload).length > 0 ? JSON.stringify(specFilterPayload) : undefined
|
||||
// 对接客服筛选只按 id 传参;未指定单独标记,后端与多选 id 取并集。
|
||||
const contactSupporterIdsParam = contactSupporterIds.filter((id) => id > 0).join(',') || undefined
|
||||
const includeUnassignedContactSupporter = contactSupporterIds.includes(0)
|
||||
|
||||
function updateSpecFilter(field: ConsignmentInventoryFilterField, value: string) {
|
||||
setSpecFilters((current) => {
|
||||
@@ -314,6 +319,8 @@ export default function ConsignmentInventoryPanel() {
|
||||
categoryId,
|
||||
specFilterParams,
|
||||
allowMatching,
|
||||
contactSupporterIdsParam,
|
||||
includeUnassignedContactSupporter,
|
||||
inboundRange?.[0],
|
||||
inboundRange?.[1],
|
||||
keyword,
|
||||
@@ -326,6 +333,8 @@ export default function ConsignmentInventoryPanel() {
|
||||
categoryId: categoryId ?? undefined,
|
||||
specFilters: specFilterParams,
|
||||
allowMatching: allowMatching === 'yes' ? true : allowMatching === 'no' ? false : undefined,
|
||||
contactSupporterIds: contactSupporterIdsParam,
|
||||
contactSupporterUnassigned: includeUnassignedContactSupporter || undefined,
|
||||
dateFrom: inboundRange?.[0],
|
||||
dateTo: inboundRange?.[1],
|
||||
keyword: keyword || undefined,
|
||||
@@ -1107,6 +1116,23 @@ export default function ConsignmentInventoryPanel() {
|
||||
}}
|
||||
/>
|
||||
|
||||
{/* 对接客服筛选:多选 + 未指定;只按客服 id 匹配,与寄售人严格分开。 */}
|
||||
<Select
|
||||
mode="multiple"
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
maxTagCount="responsive"
|
||||
style={{ width: 220, maxWidth: '100%' }}
|
||||
value={contactSupporterIds}
|
||||
placeholder="对接客服(可多选)"
|
||||
onChange={(values) => {
|
||||
setContactSupporterIds(values)
|
||||
setPage(1)
|
||||
}}
|
||||
options={[{ label: '未指定', value: 0 }, ...contactSupporterOptions]}
|
||||
/>
|
||||
|
||||
<Input.Search
|
||||
placeholder="搜索物品名/编号/收购人/店铺/卖家"
|
||||
allowClear
|
||||
|
||||
Reference in New Issue
Block a user