| | |
| | | <el-icon class="section-icon"><Goods /></el-icon> |
| | | <span>产品基本信息</span> |
| | | </div> |
| | | <div class="id-info">产品ID:{{ currentProductId || '未提供' }}</div> |
| | | <!-- <div class="id-info">产品ID:{{ currentProductId || '未提供' }}</div>--> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | typeName: string |
| | | describe: string |
| | | shelfStatus?: '待上架' | '已上架' | '已下架' |
| | | listingStatusName?: '' |
| | | } |
| | | |
| | | interface PriceItem { |
| | |
| | | }) |
| | | |
| | | const productDetail = ref<ProductDetail | null>(null) |
| | | const shelfStatus = computed(() => productDetail.value?.shelfStatus || '待上架') |
| | | const shelfStatus = computed(() => productDetail.value?.listingStatusName || '待上架') |
| | | const statusClass = computed(() => { |
| | | switch (shelfStatus.value) { |
| | | case '已上架': |
| | |
| | | return |
| | | } |
| | | ElMessage.success('新建成功') |
| | | // 修改产品状态为已订价 |
| | | // 判断 产品定价列表是否为空,为空则更新状态,不为空则说明更新过了,不需要在此更新 |
| | | if (priceList.value.length === 0) { |
| | | const updateParams = { |
| | | id: currentProductId.value, |
| | | listingStatus: 'PRICED' |
| | | } |
| | | const res: any = await productApi.updateProductStatus(updateParams) |
| | | if (res?.code !== 200) { |
| | | console.log('产品状态更新失败!!') |
| | | } |
| | | } |
| | | } |
| | | |
| | | dialogVisible.value = false |
| | |
| | | function handleToggleEnableStatus(row: any) { |
| | | const newStatus = row.enableStatus === 'ENABLED' ? 'DISABLED' : 'ENABLED' |
| | | ElMessageBox.confirm( |
| | | `确认要${newStatus === 'ENABLED' ? '启用' : '停用'}该价格(ID: ${row.id})吗?`, |
| | | `确认要${newStatus === 'ENABLED' ? '启用' : '停用'}该定价标准吗?`, |
| | | '状态变更', |
| | | { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' } |
| | | ) |