fix(admin-web): show company-name in store create partner dropdown
This commit is contained in:
@@ -306,7 +306,14 @@ type StoreRow = {
|
|||||||
category?: { id: string; name: string; parentId?: string | null } | null;
|
category?: { id: string; name: string; parentId?: string | null } | null;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PartnerOption = { id: string; companyName: string };
|
type PartnerOption = { id: string; companyName: string; name?: string };
|
||||||
|
|
||||||
|
function partnerOptionLabel(p: PartnerOption): string {
|
||||||
|
const company = (p.companyName || '').trim();
|
||||||
|
const person = (p.name || '').trim();
|
||||||
|
if (company && person) return `${company}-${person}`;
|
||||||
|
return company || person || p.id;
|
||||||
|
}
|
||||||
type CityOption = {
|
type CityOption = {
|
||||||
id: string;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
@@ -799,7 +806,7 @@ export default function StoresPage() {
|
|||||||
optionFilterProp="label"
|
optionFilterProp="label"
|
||||||
style={{ width: 180 }}
|
style={{ width: 180 }}
|
||||||
placeholder="全部"
|
placeholder="全部"
|
||||||
options={filterPartners.map((p) => ({ value: p.id, label: p.companyName || p.id }))}
|
options={filterPartners.map((p) => ({ value: p.id, label: partnerOptionLabel(p) }))}
|
||||||
/>
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item name="status" label="营业状态">
|
<Form.Item name="status" label="营业状态">
|
||||||
@@ -1129,7 +1136,7 @@ export default function StoresPage() {
|
|||||||
loading={optionsLoading}
|
loading={optionsLoading}
|
||||||
optionFilterProp="label"
|
optionFilterProp="label"
|
||||||
placeholder={optionsLoading ? '加载中…' : '请选择开城合伙人'}
|
placeholder={optionsLoading ? '加载中…' : '请选择开城合伙人'}
|
||||||
options={partners.map((p) => ({ value: p.id, label: p.companyName }))}
|
options={partners.map((p) => ({ value: p.id, label: partnerOptionLabel(p) }))}
|
||||||
onChange={(partnerAccountId) => {
|
onChange={(partnerAccountId) => {
|
||||||
const codes = createForm.getFieldValue('regionCodes') as string[] | undefined;
|
const codes = createForm.getFieldValue('regionCodes') as string[] | undefined;
|
||||||
if (codes?.length === 3) bindRegionSelection(codes, partnerAccountId);
|
if (codes?.length === 3) bindRegionSelection(codes, partnerAccountId);
|
||||||
|
|||||||
Reference in New Issue
Block a user