商户修复

This commit is contained in:
menxipeng
2025-10-19 13:41:14 +08:00
parent e6255148a4
commit 6cb2164dbe

View File

@@ -804,30 +804,32 @@ export default function MerchantsPage() {
placeholder="请输入联系电话"
/>
</div>
<div className="space-y-2">
<Label htmlFor="totalMerchant"></Label>
<Select
value={newMerchant.totalMerchant}
onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })}
disabled={loadingTotalMerchants}
onOpenChange={(open) => {
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
fetchTotalMerchants()
}
}}
>
<SelectTrigger>
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
</SelectTrigger>
<SelectContent>
{totalMerchants.map((merchant) => (
<SelectItem key={merchant.userId} value={merchant.userId}>
{merchant.nickName}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{userRole === "admin" && (
<div className="space-y-2">
<Label htmlFor="totalMerchant"></Label>
<Select
value={newMerchant.totalMerchant}
onValueChange={(value) => setNewMerchant({ ...newMerchant, totalMerchant: value })}
disabled={loadingTotalMerchants}
onOpenChange={(open) => {
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
fetchTotalMerchants()
}
}}
>
<SelectTrigger>
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
</SelectTrigger>
<SelectContent>
{totalMerchants.map((merchant) => (
<SelectItem key={merchant.userId} value={merchant.userId}>
{merchant.nickName}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)}
<div className="col-span-2 space-y-2">
<Label htmlFor="detailedAddress"></Label>
<Textarea
@@ -1033,30 +1035,32 @@ export default function MerchantsPage() {
placeholder="请输入联系电话"
/>
</div>
<div className="space-y-2">
<Label htmlFor="edit-totalMerchant"></Label>
<Select
value={editMerchant.totalMerchant}
onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })}
disabled={loadingTotalMerchants}
onOpenChange={(open) => {
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
fetchTotalMerchants()
}
}}
>
<SelectTrigger>
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
</SelectTrigger>
<SelectContent>
{totalMerchants.map((merchant) => (
<SelectItem key={merchant.userId} value={merchant.userId}>
{merchant.nickName}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
{userRole === "admin" && (
<div className="space-y-2">
<Label htmlFor="edit-totalMerchant"></Label>
<Select
value={editMerchant.totalMerchant}
onValueChange={(value) => setEditMerchant({ ...editMerchant, totalMerchant: value })}
disabled={loadingTotalMerchants}
onOpenChange={(open) => {
if (open && totalMerchants.length === 0 && !loadingTotalMerchants) {
fetchTotalMerchants()
}
}}
>
<SelectTrigger>
<SelectValue placeholder={loadingTotalMerchants ? "加载中..." : "选择总商户(可选)"} />
</SelectTrigger>
<SelectContent>
{totalMerchants.map((merchant) => (
<SelectItem key={merchant.userId} value={merchant.userId}>
{merchant.nickName}
</SelectItem>
))}
</SelectContent>
</Select>
</div>
)}
<div className="col-span-2 space-y-2">
<Label htmlFor="edit-detailedAddress"></Label>
<Textarea