显示平台订单号

This commit is contained in:
liufumingren 2026-11-03 20:00:02 +08:00
parent 5376dff3de
commit a15c91f5a1

View File

@ -139,6 +139,8 @@ function defaultShopIdOf(): number | null {
/** 当前编辑的单据是否由外部打单平台拉取(店铺不可修改) */
const isExternal = ref(false)
/** 外部单的店铺展示名:外部平台店铺不在可选列表里,直接显示名称而不是让下拉回显 ID */
const externalShopLabel = ref('')
function reset() {
Object.assign(form, {
@ -173,6 +175,8 @@ function reset() {
buyer_message: '',
remark: '',
})
isExternal.value = false
externalShopLabel.value = ''
fillItems([])
}
@ -183,6 +187,8 @@ async function loadDetail(id: number) {
const { order, items } = await getOrderStatusDetail(id)
// 外部打单平台拉取的订单,店铺由平台决定,编辑时不允许修改
isExternal.value = !!(order as { is_external?: boolean }).is_external
const externalShop = props.filters.shops.find(shop => shop.id === order.shop_id)
externalShopLabel.value = order.shop_name || order.shop_nick || externalShop?.name || ''
Object.assign(form, {
parent_order_no: order.parent_order_no || '',
order_no: order.order_no,
@ -551,25 +557,26 @@ async function submit() {
</el-col>
<el-col :span="12">
<el-form-item label="店铺" prop="shop_id">
<el-select
v-model="form.shop_id"
placeholder="请选择店铺"
clearable
filterable
:disabled="isExternal"
<el-input
v-if="isExternal"
:model-value="externalShopLabel || '店铺信息不可用'"
disabled
style="width: 100%"
>
<el-option
v-for="shop in selectableShops"
:key="shop.id"
:label="shop.code ? `${shop.name}(${shop.code})` : shop.name"
:value="shop.id"
/>
</el-select>
/>
<template v-else>
<el-select v-model="form.shop_id" placeholder="请选择店铺" clearable filterable style="width: 100%">
<el-option
v-for="shop in selectableShops"
:key="shop.id"
:label="shop.code ? `${shop.name}(${shop.code})` : shop.name"
:value="shop.id"
/>
</el-select>
<div v-if="!selectableShops.length" class="form-tip">
当前主体下没有可用的平台店铺(外部打单平台店铺不可用于手工建单)
</div>
</template>
<div v-if="isExternal" class="form-tip">平台拉取的订单,店铺由平台决定,不可修改</div>
<div v-else-if="!selectableShops.length" class="form-tip">
当前主体下没有可用的平台店铺(外部打单平台店铺不可用于手工建单)
</div>
</el-form-item>
</el-col>
<el-col :span="8">