新增物流相关

This commit is contained in:
dzl
2025-10-15 17:26:57 +08:00
parent bb12ebe636
commit e8c3d86fbc
2 changed files with 27 additions and 5 deletions

View File

@@ -196,6 +196,12 @@
<el-descriptions-item label="更新时间">{{
formatDate(selectedOrder.updated_at)
}}</el-descriptions-item>
<el-descriptions-item label="物流单号">{{
selectedOrder.delivery_code || '暂无'
}}</el-descriptions-item>
<el-descriptions-item label="物流公司">{{
selectedOrder.logistics_company || '暂无'
}}</el-descriptions-item>
</el-descriptions>
<h4 style="margin: 20px 0 10px 0">商品清单</h4>

View File

@@ -364,7 +364,7 @@
</div>
<div v-if="combinations.length > 0" class="combinations-preview">
<el-table :data="combinations.slice(0, 3)" size="small" stripe>
<el-table :data="combinations" size="small" stripe>
<el-table-column prop="display_text" label="规格组合" min-width="200">
<template #default="{ row }">
<el-tag
@@ -386,10 +386,15 @@
</el-tag>
</template>
</el-table-column>
<el-table-column prop="id" label="操作">
<template #default="{ row }">
<el-button type="danger" size="small" @click="deleteCombination(row)">删除</el-button>
</template>
</el-table-column>
</el-table>
<div v-if="combinations.length > 3" class="more-combinations">
<el-text type="info"> {{ combinations.length - 3 }} 个规格组合...</el-text>
<el-text type="info"> {{ combinations.length }} 个规格组合</el-text>
</div>
</div>
@@ -755,7 +760,6 @@ const generateCombinationsDialogVisible = ref(false)
const newSpecName = ref('')
const newSpecValue = ref('')
const selectedSpecNames = ref([])
const specValuesMap = ref({})
const currentSpecName = ref(null)
const currentSpecValues = ref([])
const defaultStock = ref(0)
@@ -898,7 +902,9 @@ const manageSpecValues = async (specName) => {
const loadCurrentSpecValues = async (specNameId) => {
try {
const response = await api.specifications.getSpecValues(specNameId)
currentSpecValues.value = response.data || []
// console.log('加载规格值响应:', response.data.data)
currentSpecValues.value = response.data.data || []
} catch (error) {
console.error('加载规格值失败:', error)
currentSpecValues.value = []
@@ -1036,6 +1042,16 @@ const validateSpecs = () => {
return true
}
const deleteCombination = async (combination) => {
try {
await api.specifications.deleteCombination(combination.id)
await loadCombinations()
ElMessage.success('删除规格组合成功')
} catch (error) {
ElMessage.error('删除规格组合失败')
}
}
// 加载商品数据(编辑模式)
const loadProduct = async () => {
if (!isEdit.value) return
@@ -1160,7 +1176,7 @@ const submitForm = async () => {
router.push('/products')
} catch (error) {
console.log(error);
console.log(12345, error);
if (error.response?.data?.message) {
ElMessage.error(error.response.data.message)
} else {