新增物流相关
This commit is contained in:
@@ -196,6 +196,12 @@
|
|||||||
<el-descriptions-item label="更新时间">{{
|
<el-descriptions-item label="更新时间">{{
|
||||||
formatDate(selectedOrder.updated_at)
|
formatDate(selectedOrder.updated_at)
|
||||||
}}</el-descriptions-item>
|
}}</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>
|
</el-descriptions>
|
||||||
|
|
||||||
<h4 style="margin: 20px 0 10px 0">商品清单</h4>
|
<h4 style="margin: 20px 0 10px 0">商品清单</h4>
|
||||||
|
|||||||
@@ -364,7 +364,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="combinations.length > 0" class="combinations-preview">
|
<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">
|
<el-table-column prop="display_text" label="规格组合" min-width="200">
|
||||||
<template #default="{ row }">
|
<template #default="{ row }">
|
||||||
<el-tag
|
<el-tag
|
||||||
@@ -386,10 +386,15 @@
|
|||||||
</el-tag>
|
</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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>
|
</el-table>
|
||||||
|
|
||||||
<div v-if="combinations.length > 3" class="more-combinations">
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -755,7 +760,6 @@ const generateCombinationsDialogVisible = ref(false)
|
|||||||
const newSpecName = ref('')
|
const newSpecName = ref('')
|
||||||
const newSpecValue = ref('')
|
const newSpecValue = ref('')
|
||||||
const selectedSpecNames = ref([])
|
const selectedSpecNames = ref([])
|
||||||
const specValuesMap = ref({})
|
|
||||||
const currentSpecName = ref(null)
|
const currentSpecName = ref(null)
|
||||||
const currentSpecValues = ref([])
|
const currentSpecValues = ref([])
|
||||||
const defaultStock = ref(0)
|
const defaultStock = ref(0)
|
||||||
@@ -898,7 +902,9 @@ const manageSpecValues = async (specName) => {
|
|||||||
const loadCurrentSpecValues = async (specNameId) => {
|
const loadCurrentSpecValues = async (specNameId) => {
|
||||||
try {
|
try {
|
||||||
const response = await api.specifications.getSpecValues(specNameId)
|
const response = await api.specifications.getSpecValues(specNameId)
|
||||||
currentSpecValues.value = response.data || []
|
|
||||||
|
// console.log('加载规格值响应:', response.data.data)
|
||||||
|
currentSpecValues.value = response.data.data || []
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载规格值失败:', error)
|
console.error('加载规格值失败:', error)
|
||||||
currentSpecValues.value = []
|
currentSpecValues.value = []
|
||||||
@@ -1036,6 +1042,16 @@ const validateSpecs = () => {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deleteCombination = async (combination) => {
|
||||||
|
try {
|
||||||
|
await api.specifications.deleteCombination(combination.id)
|
||||||
|
await loadCombinations()
|
||||||
|
ElMessage.success('删除规格组合成功')
|
||||||
|
} catch (error) {
|
||||||
|
ElMessage.error('删除规格组合失败')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 加载商品数据(编辑模式)
|
// 加载商品数据(编辑模式)
|
||||||
const loadProduct = async () => {
|
const loadProduct = async () => {
|
||||||
if (!isEdit.value) return
|
if (!isEdit.value) return
|
||||||
@@ -1160,7 +1176,7 @@ const submitForm = async () => {
|
|||||||
|
|
||||||
router.push('/products')
|
router.push('/products')
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error);
|
console.log(12345, error);
|
||||||
if (error.response?.data?.message) {
|
if (error.response?.data?.message) {
|
||||||
ElMessage.error(error.response.data.message)
|
ElMessage.error(error.response.data.message)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user