From e8c3d86fbc0ddd9a3874ae51db30ed86eaf5d359 Mon Sep 17 00:00:00 2001
From: dzl <786316265@qq.com>
Date: Wed, 15 Oct 2025 17:26:57 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=89=A9=E6=B5=81=E7=9B=B8?=
=?UTF-8?q?=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/Orders.vue | 6 ++++++
src/views/ProductForm.vue | 26 +++++++++++++++++++++-----
2 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/src/views/Orders.vue b/src/views/Orders.vue
index 0d642e9..acbbb6e 100644
--- a/src/views/Orders.vue
+++ b/src/views/Orders.vue
@@ -196,6 +196,12 @@
{{
formatDate(selectedOrder.updated_at)
}}
+ {{
+ selectedOrder.delivery_code || '暂无'
+ }}
+ {{
+ selectedOrder.logistics_company || '暂无'
+ }}
商品清单
diff --git a/src/views/ProductForm.vue b/src/views/ProductForm.vue
index a18e173..50bc751 100644
--- a/src/views/ProductForm.vue
+++ b/src/views/ProductForm.vue
@@ -364,7 +364,7 @@
-
+
+
+
+ 删除
+
+
- 还有 {{ combinations.length - 3 }} 个规格组合...
+ 共有 {{ combinations.length }} 个规格组合
@@ -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 {