diff --git a/src/views/mall/product/brand/index.vue b/src/views/mall/product/brand/index.vue
index 9250befd..c89fe520 100644
--- a/src/views/mall/product/brand/index.vue
+++ b/src/views/mall/product/brand/index.vue
@@ -59,7 +59,7 @@
-
+
diff --git a/src/views/mall/product/category/index.vue b/src/views/mall/product/category/index.vue
index a2adfe7f..27ea5368 100644
--- a/src/views/mall/product/category/index.vue
+++ b/src/views/mall/product/category/index.vue
@@ -38,7 +38,7 @@
-
+
diff --git a/src/views/mall/product/comment/index.vue b/src/views/mall/product/comment/index.vue
index 1b0745ba..7c0737f5 100644
--- a/src/views/mall/product/comment/index.vue
+++ b/src/views/mall/product/comment/index.vue
@@ -115,7 +115,7 @@
:formatter="dateFormatter"
width="170"
/>
-
+
{
// 删除的二次确认
await message.delConfirm()
// 发起删除
- await PropertyApi.deleteProperty(id)
+ await PropertyApi.deletePropertyValue(id)
message.success(t('common.delSuccess'))
// 刷新列表
await getList()
diff --git a/src/views/mall/product/spu/components/index.ts b/src/views/mall/product/spu/components/index.ts
index 8f793c51..edecbe89 100644
--- a/src/views/mall/product/spu/components/index.ts
+++ b/src/views/mall/product/spu/components/index.ts
@@ -1,4 +1,5 @@
import SkuList from './SkuList.vue'
+import { Spu } from '@/api/mall/product/spu'
interface PropertyAndValues {
id: number
@@ -22,4 +23,32 @@ interface RuleConfig {
message: string
}
-export { SkuList, PropertyAndValues, RuleConfig }
+/**
+ * 获得商品的规格列表
+ *
+ * @param spu
+ * @return PropertyAndValues 规格列表
+ */
+const getPropertyList = (spu: Spu): PropertyAndValues[] => {
+ // 直接拿返回的 skus 属性逆向生成出 propertyList
+ const properties: PropertyAndValues[] = []
+ // 只有是多规格才处理
+ if (spu.specType) {
+ spu.skus?.forEach((sku) => {
+ sku.properties?.forEach(({ propertyId, propertyName, valueId, valueName }) => {
+ // 添加属性
+ if (!properties?.some((item) => item.id === propertyId)) {
+ properties.push({ id: propertyId!, name: propertyName!, values: [] })
+ }
+ // 添加属性值
+ const index = properties?.findIndex((item) => item.id === propertyId)
+ if (!properties[index].values?.some((value) => value.id === valueId)) {
+ properties[index].values?.push({ id: valueId!, name: valueName! })
+ }
+ })
+ })
+ }
+ return properties
+}
+
+export { SkuList, getPropertyList, PropertyAndValues, RuleConfig }
diff --git a/src/views/mall/product/spu/form/BasicInfoForm.vue b/src/views/mall/product/spu/form/BasicInfoForm.vue
index 678b564d..b399d0f8 100644
--- a/src/views/mall/product/spu/form/BasicInfoForm.vue
+++ b/src/views/mall/product/spu/form/BasicInfoForm.vue
@@ -175,7 +175,7 @@ import { propTypes } from '@/utils/propTypes'
import { checkSelectedNode, defaultProps, handleTree, treeToString } from '@/utils/tree'
import { createImageViewer } from '@/components/ImageViewer'
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
-import { PropertyAndValues, SkuList } from '@/views/mall/product/spu/components/index.ts'
+import { getPropertyList, SkuList } from '@/views/mall/product/spu/components/index.ts'
import ProductAttributes from './ProductAttributes.vue'
import ProductPropertyAddForm from './ProductPropertyAddForm.vue'
import { basicInfoSchema } from './spu.data'
@@ -203,34 +203,6 @@ const imagePreview = (args) => {
})
}
-/**
- * 获得商品的规格列表
- *
- * @param spu
- * @return PropertyAndValues 规格列表
- */
-const getPropertyList = (spu: Spu): PropertyAndValues[] => {
- // 直接拿返回的 skus 属性逆向生成出 propertyList
- const properties: PropertyAndValues[] = []
- // 只有是多规格才处理
- if (spu.specType) {
- spu.skus?.forEach((sku) => {
- sku.properties?.forEach(({ propertyId, propertyName, valueId, valueName }) => {
- // 添加属性
- if (!properties?.some((item) => item.id === propertyId)) {
- properties.push({ id: propertyId!, name: propertyName!, values: [] })
- }
- // 添加属性值
- const index = properties?.findIndex((item) => item.id === propertyId)
- if (!properties[index].values?.some((value) => value.id === valueId)) {
- properties[index].values?.push({ id: valueId!, name: valueName! })
- }
- })
- })
- }
- return properties
-}
-
// ====== end ======
const message = useMessage() // 消息弹窗
diff --git a/src/views/mall/product/spu/form/index.vue b/src/views/mall/product/spu/form/index.vue
index db5b0445..ebe1587d 100644
--- a/src/views/mall/product/spu/form/index.vue
+++ b/src/views/mall/product/spu/form/index.vue
@@ -189,7 +189,7 @@ const submitForm = async () => {
/** 关闭按钮 */
const close = () => {
delView(unref(currentRoute))
- push('/product/product-spu')
+ push({ name: 'ProductSpu' })
}
/** 初始化 */
onMounted(async () => {
diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue
index 9ea06cd5..2ed6d3ad 100644
--- a/src/views/mall/product/spu/index.vue
+++ b/src/views/mall/product/spu/index.vue
@@ -170,6 +170,14 @@
>
详情
+
+ 修改
+
-
-
- 修改
-
{
formData.value = await AfterSaleApi.getAfterSale(id)
}
}
-/**
- * 同意售后
- */
+
+// TODO @puhui999:操作后,需要提示和刷新哈。
+/** 同意售后 */
const agree = () => {
message.confirm('是否同意售后?').then(() => {
AfterSaleApi.agree(formData.value.id)
})
}
-/**
- * 拒绝售后
- */
+
+/** 拒绝售后 */
const disagree = () => {
updateAuditReasonFormRef.value?.open(formData.value)
}
-/**
- * 确认收货
- */
+
+/** 确认收货 */
const receive = () => {
message.confirm('是否确认收货?').then(() => {
AfterSaleApi.receive(formData.value.id)
})
}
-/**
- * 拒绝收货
- */
+
+/** 拒绝收货 */
const refuse = () => {
message.confirm('是否拒绝收货?').then(() => {
AfterSaleApi.refuse(formData.value.id)
})
}
-/**
- * 确认退款
- */
+
+/** 确认退款 */
const refund = () => {
message.confirm('是否确认退款?').then(() => {
AfterSaleApi.refund(formData.value.id)
})
}
+
/** 图片预览 */
const imagePreview = (args) => {
const urlList = []
@@ -206,6 +203,7 @@ const imagePreview = (args) => {
urlList
})
}
+
onMounted(async () => {
await getDetail()
})