Commit 9014de35 by lijinqi

Merge remote-tracking branch 'origin/develop' into develop

parents a1827a88 097c5a07
...@@ -3,7 +3,7 @@ import request from '@/config/axios' ...@@ -3,7 +3,7 @@ import request from '@/config/axios'
export interface Favorite { export interface Favorite {
id?: number id?: number
userId?: string // 用户编号 userId?: string // 用户编号
spuId?: number | null // 商品 SPU 编号 spuId?: number | null // 资源 SPU 编号
} }
// 获得 ProductFavorite 列表 // 获得 ProductFavorite 列表
......
...@@ -8,8 +8,8 @@ export interface Property { ...@@ -8,8 +8,8 @@ export interface Property {
} }
export interface Sku { export interface Sku {
id?: number // 商品 SKU 编号 id?: number // 资源 SKU 编号
name?: string // 商品 SKU 名称 name?: string // 资源 SKU 名称
spuId?: number // SPU 编号 spuId?: number // SPU 编号
properties?: Property[] // 属性数组 properties?: Property[] // 属性数组
price?: number | string // 商品价格 price?: number | string // 商品价格
......
...@@ -27,8 +27,8 @@ export interface PointActivityVO { ...@@ -27,8 +27,8 @@ export interface PointActivityVO {
export interface PointProductVO { export interface PointProductVO {
id?: number // 积分商城商品编号 id?: number // 积分商城商品编号
activityId?: number // 积分商城活动 id activityId?: number // 积分商城活动 id
spuId?: number // 商品 SPU 编号 spuId?: number // 资源 SPU 编号
skuId: number // 商品 SKU 编号 skuId: number // 资源 SKU 编号
count: number // 可兑换数量 count: number // 可兑换数量
point: number // 兑换积分 point: number // 兑换积分
price: number // 兑换金额,单位:分 price: number // 兑换金额,单位:分
......
...@@ -13,9 +13,9 @@ export interface TradeAfterSaleVO { ...@@ -13,9 +13,9 @@ export interface TradeAfterSaleVO {
orderId?: number | null // 交易订单编号 orderId?: number | null // 交易订单编号
orderNo?: string // 订单流水号 orderNo?: string // 订单流水号
orderItemId?: number | null // 交易订单项编号 orderItemId?: number | null // 交易订单项编号
spuId?: number | null // 商品 SPU 编号 spuId?: number | null // 资源 SPU 编号
spuName?: string // 商品 SPU 名称 spuName?: string // 资源 SPU 名称
skuId?: number | null // 商品 SKU 编号 skuId?: number | null // 资源 SKU 编号
properties?: ProductPropertiesVO[] // 属性数组 properties?: ProductPropertiesVO[] // 属性数组
picUrl?: string // 商品图片 picUrl?: string // 商品图片
count?: number | null // 退货商品数量 count?: number | null // 退货商品数量
......
...@@ -82,9 +82,9 @@ export interface OrderItemRespVO { ...@@ -82,9 +82,9 @@ export interface OrderItemRespVO {
userId?: number | null // 用户编号 userId?: number | null // 用户编号
orderId?: number | null // 订单编号 orderId?: number | null // 订单编号
// ========== 商品基本信息 ========== // ========== 商品基本信息 ==========
spuId?: number | null // 商品 SPU 编号 spuId?: number | null // 资源 SPU 编号
spuName?: string //商品 SPU 名称 spuName?: string //资源 SPU 名称
skuId?: number | null // 商品 SKU 编号 skuId?: number | null // 资源 SKU 编号
picUrl?: string //商品图片 picUrl?: string //商品图片
count?: number | null //购买数量 count?: number | null //购买数量
// ========== 价格 + 支付基本信息 ========== // ========== 价格 + 支付基本信息 ==========
......
...@@ -88,7 +88,7 @@ export const APP_LINK_GROUP_LIST = [ ...@@ -88,7 +88,7 @@ export const APP_LINK_GROUP_LIST = [
] ]
}, },
{ {
name: '商品', name: '资源',
links: [ links: [
{ {
name: '商品列表', name: '商品列表',
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
width: scrollbarWidth width: scrollbarWidth
}" }"
> >
<!-- 商品 --> <!-- 资源 -->
<div <div
class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white" class="relative box-content flex flex-row flex-wrap overflow-hidden bg-white"
:style="{ :style="{
......
...@@ -250,6 +250,7 @@ export const fileSizeFormatter = (row, column, cellValue) => { ...@@ -250,6 +250,7 @@ export const fileSizeFormatter = (row, column, cellValue) => {
* @param source 源对象 * @param source 源对象
*/ */
export const copyValueToTarget = (target: any, source: any) => { export const copyValueToTarget = (target: any, source: any) => {
console.log(target, 'target')
const newObj = Object.assign({}, target, source) const newObj = Object.assign({}, target, source)
// 删除多余属性 // 删除多余属性
Object.keys(newObj).forEach((key) => { Object.keys(newObj).forEach((key) => {
......
<template> <template>
<doc-alert title="【商品】商品分类" url="https://doc.iocoder.cn/mall/product-category/" /> <doc-alert title="【资源】商品分类" url="https://doc.iocoder.cn/mall/product-category/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
:rules="formRules" :rules="formRules"
label-width="100px" label-width="100px"
> >
<el-form-item label="商品" prop="spuId"> <el-form-item label="资源" prop="spuId">
<SpuShowcase v-model="formData.spuId" :limit="1" /> <SpuShowcase v-model="formData.spuId" :limit="1" />
</el-form-item> </el-form-item>
<el-form-item v-if="formData.spuId" label="商品规格" prop="skuId"> <el-form-item v-if="formData.spuId" label="商品规格" prop="skuId">
......
<template> <template>
<doc-alert title="【商品】商品评价" url="https://doc.iocoder.cn/mall/product-comment/" /> <doc-alert title="【资源】商品评价" url="https://doc.iocoder.cn/mall/product-comment/" />
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
......
<template> <template>
<doc-alert title="【商品】商品属性" url="https://doc.iocoder.cn/mall/product-property/" /> <doc-alert title="【资源】商品属性" url="https://doc.iocoder.cn/mall/product-property/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
......
...@@ -28,12 +28,10 @@ ...@@ -28,12 +28,10 @@
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="鉴权信息" prop="auth" align="center" />
<el-table-column label="有效期(单位:天)" prop="expTime" align="center" min-width="100" />
<el-table-column label="费用描述" prop="feeInfo" align="center" />
</template> </template>
<!-- <el-table-column align="center" label="商品条码" min-width="168">-->
<!-- <template #default="{ row }">-->
<!-- <el-input v-model="row.barCode" class="w-100%" />-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="销售价" min-width="168"> <el-table-column align="center" label="销售价" min-width="168">
<template #default="{ row }"> <template #default="{ row }">
<el-input-number <el-input-number
...@@ -75,30 +73,6 @@ ...@@ -75,30 +73,6 @@
<el-input-number v-model="row.stock" :min="0" class="w-100%" controls-position="right" /> <el-input-number v-model="row.stock" :min="0" class="w-100%" controls-position="right" />
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="重量(kg)" min-width="168">-->
<!-- <template #default="{ row }">-->
<!-- <el-input-number-->
<!-- v-model="row.weight"-->
<!-- :min="0"-->
<!-- :precision="2"-->
<!-- :step="0.1"-->
<!-- class="w-100%"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="体积(m^3)" min-width="168">-->
<!-- <template #default="{ row }">-->
<!-- <el-input-number-->
<!-- v-model="row.volume"-->
<!-- :min="0"-->
<!-- :precision="2"-->
<!-- :step="0.1"-->
<!-- class="w-100%"-->
<!-- controls-position="right"-->
<!-- />-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-if="formData!.subCommissionType"> <template v-if="formData!.subCommissionType">
<el-table-column align="center" label="一级返佣(元)" min-width="168"> <el-table-column align="center" label="一级返佣(元)" min-width="168">
<template #default="{ row }"> <template #default="{ row }">
...@@ -173,11 +147,6 @@ ...@@ -173,11 +147,6 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<!-- <el-table-column align="center" label="商品条码" min-width="100">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.barCode }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column align="center" label="销售价(元)" min-width="80"> <el-table-column align="center" label="销售价(元)" min-width="80">
<template #default="{ row }"> <template #default="{ row }">
{{ row.price }} {{ row.price }}
...@@ -198,16 +167,6 @@ ...@@ -198,16 +167,6 @@
{{ row.stock }} {{ row.stock }}
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="重量(kg)" min-width="80">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.weight }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column align="center" label="体积(m^3)" min-width="80">-->
<!-- <template #default="{ row }">-->
<!-- {{ row.volume }}-->
<!-- </template>-->
<!-- </el-table-column>-->
<template v-if="formData!.subCommissionType"> <template v-if="formData!.subCommissionType">
<el-table-column align="center" label="一级返佣(元)" min-width="80"> <el-table-column align="center" label="一级返佣(元)" min-width="80">
<template #default="{ row }"> <template #default="{ row }">
...@@ -253,11 +212,6 @@ ...@@ -253,11 +212,6 @@
</template> </template>
</el-table-column> </el-table-column>
</template> </template>
<el-table-column align="center" label="商品条码" min-width="100">
<template #default="{ row }">
{{ row.barCode }}
</template>
</el-table-column>
<el-table-column align="center" label="销售价(元)" min-width="80"> <el-table-column align="center" label="销售价(元)" min-width="80">
<template #default="{ row }"> <template #default="{ row }">
{{ formatToFraction(row.price) }} {{ formatToFraction(row.price) }}
...@@ -321,13 +275,12 @@ const skuList = ref<Sku[]>([ ...@@ -321,13 +275,12 @@ const skuList = ref<Sku[]>([
price: 0, // 商品价格 price: 0, // 商品价格
marketPrice: 0, // 市场价 marketPrice: 0, // 市场价
costPrice: 0, // 成本价 costPrice: 0, // 成本价
barCode: '', // 商品条码
picUrl: '', // 图片地址 picUrl: '', // 图片地址
stock: 0, // 库存 stock: 0, // 库存
weight: 0, // 商品重量 weight: 0, // 商品重量
volume: 0, // 商品体积 volume: 0 // 商品体积
firstBrokeragePrice: 0, // 一级分销的佣金 // firstBrokeragePrice: 0, // 一级分销的佣金
secondBrokeragePrice: 0 // 二级分销的佣金 // secondBrokeragePrice: 0 // 二级分销的佣金
} }
]) // 批量添加时的临时数据 ]) // 批量添加时的临时数据
...@@ -453,13 +406,12 @@ const generateTableData = (propertyList: any[]) => { ...@@ -453,13 +406,12 @@ const generateTableData = (propertyList: any[]) => {
price: 0, price: 0,
marketPrice: 0, marketPrice: 0,
costPrice: 0, costPrice: 0,
barCode: '',
picUrl: '', picUrl: '',
stock: 0, stock: 0,
weight: 0, weight: 0,
volume: 0, volume: 0,
firstBrokeragePrice: 0, // firstBrokeragePrice: 0,
secondBrokeragePrice: 0 // secondBrokeragePrice: 0
} }
// 如果存在属性相同的 sku 则不做处理 // 如果存在属性相同的 sku 则不做处理
const index = formData.value!.skus!.findIndex( const index = formData.value!.skus!.findIndex(
...@@ -528,13 +480,12 @@ watch( ...@@ -528,13 +480,12 @@ watch(
price: 0, price: 0,
marketPrice: 0, marketPrice: 0,
costPrice: 0, costPrice: 0,
barCode: '',
picUrl: '', picUrl: '',
stock: 0, stock: 0,
weight: 0, weight: 0,
volume: 0, volume: 0
firstBrokeragePrice: 0, // firstBrokeragePrice: 0,
secondBrokeragePrice: 0 // secondBrokeragePrice: 0
} }
] ]
} }
......
...@@ -257,7 +257,7 @@ const handleCheckAll = (checked: boolean) => { ...@@ -257,7 +257,7 @@ const handleCheckAll = (checked: boolean) => {
/** /**
* 选中一行 * 选中一行
* @param checked 是否选中 * @param checked 是否选中
* @param spu 商品 * @param spu 资源
* @param isCalcCheckAll 是否计算全选 * @param isCalcCheckAll 是否计算全选
*/ */
const handleCheckOne = (checked: boolean, spu: Spu, isCalcCheckAll: boolean) => { const handleCheckOne = (checked: boolean, spu: Spu, isCalcCheckAll: boolean) => {
......
<!-- 商品发布 - 基础设置 --> <!-- 商品发布 - 基础设置 -->
<template> <template>
<el-form ref="formRef" :disabled="isDetail" :model="formData" :rules="rules" label-width="120px"> <el-form ref="formRef" :disabled="isDetail" :model="formData" :rules="rules" label-width="120px">
<el-form-item label="商品名称" prop="name"> <el-form-item label="资源名称" prop="name">
<el-input <el-input
v-model="formData.name" v-model="formData.name"
:autosize="{ minRows: 2, maxRows: 2 }" :autosize="{ minRows: 2, maxRows: 2 }"
...@@ -9,11 +9,11 @@ ...@@ -9,11 +9,11 @@
:show-word-limit="true" :show-word-limit="true"
class="w-80!" class="w-80!"
maxlength="64" maxlength="64"
placeholder="请输入商品名称" placeholder="请输入资源名称"
type="textarea" type="textarea"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商品分类" prop="categoryId"> <el-form-item label="资源分类" prop="categoryId">
<el-cascader <el-cascader
v-model="formData.categoryId" v-model="formData.categoryId"
:options="categoryList" :options="categoryList"
...@@ -21,11 +21,16 @@ ...@@ -21,11 +21,16 @@
class="w-80" class="w-80"
clearable clearable
filterable filterable
placeholder="请选择商品分类" placeholder="请选择资源分类"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商品品牌" prop="brandId"> <el-form-item label="资源品牌" prop="brandId">
<el-select v-model="formData.brandId" class="w-80" placeholder="请选择商品品牌"> <el-select
v-model="formData.brandId"
class="w-80"
placeholder="请选择资源品牌"
style="width: 320px"
>
<el-option <el-option
v-for="item in brandList" v-for="item in brandList"
:key="item.id" :key="item.id"
...@@ -34,27 +39,6 @@ ...@@ -34,27 +39,6 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="商品关键字" prop="keyword">
<el-input v-model="formData.keyword" class="w-80!" placeholder="请输入商品关键字" />
</el-form-item>
<el-form-item label="商品简介" prop="introduction">
<el-input
v-model="formData.introduction"
:autosize="{ minRows: 2, maxRows: 2 }"
:clearable="true"
:show-word-limit="true"
class="w-80!"
maxlength="128"
placeholder="请输入商品简介"
type="textarea"
/>
</el-form-item>
<el-form-item label="商品封面图" prop="picUrl">
<UploadImg v-model="formData.picUrl" :disabled="isDetail" height="80px" />
</el-form-item>
<el-form-item label="商品轮播图" prop="sliderPicUrls">
<UploadImgs v-model="formData.sliderPicUrls" :disabled="isDetail" />
</el-form-item>
</el-form> </el-form>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -83,20 +67,16 @@ const formRef = ref() // 表单 Ref ...@@ -83,20 +67,16 @@ const formRef = ref() // 表单 Ref
const formData = reactive<Spu>({ const formData = reactive<Spu>({
name: '', // 商品名称 name: '', // 商品名称
categoryId: undefined, // 商品分类 categoryId: undefined, // 商品分类
keyword: '', // 关键字
picUrl: '', // 商品封面图 picUrl: '', // 商品封面图
sliderPicUrls: [], // 商品轮播图 sliderPicUrls: [], // 商品轮播图
introduction: '', // 商品简介
brandId: undefined // 商品品牌 brandId: undefined // 商品品牌
}) })
const rules = reactive({ const rules = reactive({
name: [required], name: [required],
categoryId: [required], categoryId: [required],
keyword: [required], brandId: [required],
introduction: [required],
picUrl: [required], picUrl: [required],
sliderPicUrls: [required], sliderPicUrls: [required]
brandId: [required]
}) })
/** 将传进来的值赋值给 formData */ /** 将传进来的值赋值给 formData */
......
...@@ -8,17 +8,7 @@ ...@@ -8,17 +8,7 @@
:rules="rules" :rules="rules"
label-width="120px" label-width="120px"
> >
<el-form-item label="分销类型" prop="subCommissionType"> <el-form-item label="资源规格" prop="specType">
<el-radio-group
v-model="formData.subCommissionType"
class="w-80"
@change="changeSubCommissionType"
>
<el-radio :value="false">默认设置</el-radio>
<el-radio :value="true" class="radio">单独设置</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="商品规格" prop="specType">
<el-radio-group v-model="formData.specType" class="w-80" @change="onChangeSpec"> <el-radio-group v-model="formData.specType" class="w-80" @change="onChangeSpec">
<el-radio :value="false" class="radio">单规格</el-radio> <el-radio :value="false" class="radio">单规格</el-radio>
<el-radio :value="true">多规格</el-radio> <el-radio :value="true">多规格</el-radio>
...@@ -33,7 +23,7 @@ ...@@ -33,7 +23,7 @@
:rule-config="ruleConfig" :rule-config="ruleConfig"
/> />
</el-form-item> </el-form-item>
<el-form-item v-if="formData.specType" label="商品属性"> <el-form-item v-if="formData.specType" label="资源属性">
<el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加属性</el-button> <el-button class="mb-10px mr-15px" @click="attributesAddFormRef.open">添加属性</el-button>
<ProductAttributes <ProductAttributes
:is-detail="isDetail" :is-detail="isDetail"
...@@ -73,6 +63,7 @@ import { ...@@ -73,6 +63,7 @@ import {
import ProductAttributes from './ProductAttributes.vue' import ProductAttributes from './ProductAttributes.vue'
import ProductPropertyAddForm from './ProductPropertyAddForm.vue' import ProductPropertyAddForm from './ProductPropertyAddForm.vue'
import type { Spu } from '@/api/mall/product/spu' import type { Spu } from '@/api/mall/product/spu'
import { defaultProps } from '@/utils/tree'
defineOptions({ name: 'ProductSpuSkuForm' }) defineOptions({ name: 'ProductSpuSkuForm' })
...@@ -120,7 +111,10 @@ const formData = reactive<Spu>({ ...@@ -120,7 +111,10 @@ const formData = reactive<Spu>({
}) })
const rules = reactive({ const rules = reactive({
specType: [required], specType: [required],
subCommissionType: [required] subCommissionType: [required],
name: [required],
categoryId: [required],
brandId: [required]
}) })
/** 将传进来的值赋值给 formData */ /** 将传进来的值赋值给 formData */
...@@ -130,6 +124,7 @@ watch( ...@@ -130,6 +124,7 @@ watch(
if (!data) { if (!data) {
return return
} }
console.log(props.propFormData, 'props.propFormData')
copyValueToTarget(formData, data) copyValueToTarget(formData, data)
// 将 SKU 的属性,整理成 PropertyAndValues 数组 // 将 SKU 的属性,整理成 PropertyAndValues 数组
propertyList.value = getPropertyList(data) propertyList.value = getPropertyList(data)
...@@ -158,13 +153,13 @@ const validate = async () => { ...@@ -158,13 +153,13 @@ const validate = async () => {
defineExpose({ validate }) defineExpose({ validate })
/** 分销类型 */ /** 分销类型 */
const changeSubCommissionType = () => { // const changeSubCommissionType = () => {
// 默认为零,类型切换后也要重置为零 // // 默认为零,类型切换后也要重置为零
for (const item of formData.skus!) { // for (const item of formData.skus!) {
item.firstBrokeragePrice = 0 // item.firstBrokeragePrice = 0
item.secondBrokeragePrice = 0 // item.secondBrokeragePrice = 0
} // }
} // }
/** 选择规格 */ /** 选择规格 */
const onChangeSpec = () => { const onChangeSpec = () => {
...@@ -191,4 +186,15 @@ const onChangeSpec = () => { ...@@ -191,4 +186,15 @@ const onChangeSpec = () => {
const generateSkus = (propertyList: any[]) => { const generateSkus = (propertyList: any[]) => {
skuListRef.value.generateTableData(propertyList) skuListRef.value.generateTableData(propertyList)
} }
/** 初始化 */
const brandList = ref<BrandVO[]>([]) // 商品品牌列表
const categoryList = ref<CategoryVO[]>([]) // 商品分类树
onMounted(async () => {
// 获得分类树
const data = await ProductCategoryApi.getCategoryList({})
categoryList.value = handleTree(data, 'id')
// 获取商品品牌列表
brandList.value = await ProductBrandApi.getSimpleBrandList()
})
</script> </script>
<template> <template>
<ContentWrap v-loading="formLoading"> <ContentWrap v-loading="formLoading">
<el-tabs v-model="activeName">
<el-tab-pane label="基础设置" name="info">
<InfoForm <InfoForm
ref="infoRef" ref="infoRef"
v-model:activeName="activeName" v-model:activeName="activeName"
:is-detail="isDetail" :is-detail="isDetail"
:propFormData="formData" :propFormData="formData"
/> />
</el-tab-pane>
<el-tab-pane label="价格库存" name="sku">
<SkuForm <SkuForm
ref="skuRef" ref="skuRef"
v-model:activeName="activeName" v-model:activeName="activeName"
:is-detail="isDetail" :is-detail="isDetail"
:propFormData="formData" :propFormData="formData"
/> />
</el-tab-pane>
</el-tabs>
<el-form> <el-form>
<el-form-item style="float: right"> <el-form-item style="float: right">
<el-button v-if="!isDetail" :loading="formLoading" type="primary" @click="submitForm"> <el-button v-if="!isDetail" :loading="formLoading" type="primary" @click="submitForm">
...@@ -29,23 +23,23 @@ ...@@ -29,23 +23,23 @@
</ContentWrap> </ContentWrap>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { cloneDeep } from 'lodash-es' import {cloneDeep} from 'lodash-es'
import { useTagsViewStore } from '@/store/modules/tagsView' import {useTagsViewStore} from '@/store/modules/tagsView'
import * as ProductSpuApi from '@/api/mall/product/spu' import * as ProductSpuApi from '@/api/mall/product/spu'
import InfoForm from './InfoForm.vue' import InfoForm from './InfoForm.vue'
import DescriptionForm from './DescriptionForm.vue' import DescriptionForm from './DescriptionForm.vue'
import OtherForm from './OtherForm.vue' import OtherForm from './OtherForm.vue'
import SkuForm from './SkuForm.vue' import SkuForm from './SkuForm.vue'
import DeliveryForm from './DeliveryForm.vue' import DeliveryForm from './DeliveryForm.vue'
import { convertToInteger, floatToFixed2, formatToFraction } from '@/utils' import {convertToInteger, floatToFixed2, formatToFraction} from '@/utils'
defineOptions({ name: 'ProductSpuAdd' }) defineOptions({name: 'ProductSpuAdd'})
const { t } = useI18n() // 国际化 const {t} = useI18n() // 国际化
const message = useMessage() // 消息弹窗 const message = useMessage() // 消息弹窗
const { push, currentRoute } = useRouter() // 路由 const {push, currentRoute} = useRouter() // 路由
const { params, name } = useRoute() // 查询参数 const {params, name} = useRoute() // 查询参数
const { delView } = useTagsViewStore() // 视图操作 const {delView} = useTagsViewStore() // 视图操作
const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用
const activeName = ref('info') // Tag 激活的窗口 const activeName = ref('info') // Tag 激活的窗口
...@@ -170,7 +164,7 @@ const submitForm = async () => { ...@@ -170,7 +164,7 @@ const submitForm = async () => {
/** 关闭按钮 */ /** 关闭按钮 */
const close = () => { const close = () => {
delView(unref(currentRoute)) delView(unref(currentRoute))
push({ name: 'ProductSpu' }) push({name: 'ProductSpu'})
} }
/** 初始化 */ /** 初始化 */
......
<!-- 商品中心 - 商品列表 --> <!-- 商品中心 - 商品列表 -->
<template> <template>
<doc-alert title="【商品】商品 SPU 与 SKU" url="https://doc.iocoder.cn/mall/product-spu-sku/" /> <doc-alert title="【资源】资源 SPU 与 SKU" url="https://doc.iocoder.cn/mall/product-spu-sku/" />
<!-- 搜索工作栏 --> <!-- 搜索工作栏 -->
<ContentWrap> <ContentWrap>
...@@ -11,16 +11,16 @@ ...@@ -11,16 +11,16 @@
class="-mb-15px" class="-mb-15px"
label-width="68px" label-width="68px"
> >
<el-form-item label="商品名称" prop="name"> <el-form-item label="资源名称" prop="name">
<el-input <el-input
v-model="queryParams.name" v-model="queryParams.name"
class="!w-240px" class="!w-240px"
clearable clearable
placeholder="请输入商品名称" placeholder="请输入资源名称"
@keyup.enter="handleQuery" @keyup.enter="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="商品分类" prop="categoryId"> <el-form-item label="资源分类" prop="categoryId">
<el-cascader <el-cascader
v-model="queryParams.categoryId" v-model="queryParams.categoryId"
:options="categoryList" :options="categoryList"
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
class="w-1/1" class="w-1/1"
clearable clearable
filterable filterable
placeholder="请选择商品分类" placeholder="请选择资源分类"
/> />
</el-form-item> </el-form-item>
<el-form-item label="创建时间" prop="createTime"> <el-form-item label="创建时间" prop="createTime">
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
</el-form> </el-form>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="商品编号" min-width="140" prop="id" /> <el-table-column label="资源编号" min-width="140" prop="id" />
<el-table-column label="商品信息" min-width="300"> <el-table-column label="资源信息" min-width="300">
<template #default="{ row }"> <template #default="{ row }">
<div class="flex"> <div class="flex">
<el-image <el-image
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</el-form-item> </el-form-item>
<el-form-item <el-form-item
v-if="formData.productScope === PromotionProductScopeEnum.SPU.scope" v-if="formData.productScope === PromotionProductScopeEnum.SPU.scope"
label="商品" label="资源"
prop="productSpuIds" prop="productSpuIds"
> >
<SpuShowcase v-model="formData.productSpuIds" /> <SpuShowcase v-model="formData.productSpuIds" />
......
<template> <template>
<doc-alert title="【统计】会员、商品、交易统计" url="https://doc.iocoder.cn/mall/statistics/" /> <doc-alert title="【统计】会员、资源、交易统计" url="https://doc.iocoder.cn/mall/statistics/" />
<div class="flex flex-col"> <div class="flex flex-col">
<el-row :gutter="16" class="summary"> <el-row :gutter="16" class="summary">
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
</template> </template>
<!-- 排行列表 --> <!-- 排行列表 -->
<el-table v-loading="loading" :data="list" @sort-change="handleSortChange"> <el-table v-loading="loading" :data="list" @sort-change="handleSortChange">
<el-table-column label="商品 ID" prop="spuId" min-width="70" /> <el-table-column label="资源 ID" prop="spuId" min-width="70" />
<el-table-column label="商品图片" align="center" prop="picUrl" width="80"> <el-table-column label="商品图片" align="center" prop="picUrl" width="80">
<template #default="{ row }"> <template #default="{ row }">
<el-image <el-image
......
<template> <template>
<doc-alert title="【统计】会员、商品、交易统计" url="https://doc.iocoder.cn/mall/statistics/" /> <doc-alert title="【统计】会员、资源、交易统计" url="https://doc.iocoder.cn/mall/statistics/" />
<!-- 商品概览 --> <!-- 商品概览 -->
<ProductSummary /> <ProductSummary />
......
<template> <template>
<doc-alert title="【统计】会员、商品、交易统计" url="https://doc.iocoder.cn/mall/statistics/" /> <doc-alert title="【统计】会员、资源、交易统计" url="https://doc.iocoder.cn/mall/statistics/" />
<div class="flex flex-col"> <div class="flex flex-col">
<el-row :gutter="16" class="summary"> <el-row :gutter="16" class="summary">
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="15"> <el-col :span="15">
<el-table v-if="formData.orderItem" :data="[formData.orderItem]" border> <el-table v-if="formData.orderItem" :data="[formData.orderItem]" border>
<el-table-column label="商品" prop="spuName" width="auto"> <el-table-column label="资源" prop="spuName" width="auto">
<template #default="{ row }"> <template #default="{ row }">
{{ row.spuName }} {{ row.spuName }}
<el-tag <el-tag
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="15"> <el-col :span="15">
<el-table :data="formData.items" border> <el-table :data="formData.items" border>
<el-table-column label="商品" prop="spuName" width="auto"> <el-table-column label="资源" prop="spuName" width="auto">
<template #default="{ row }"> <template #default="{ row }">
{{ row.spuName }} {{ row.spuName }}
<el-tag v-for="property in row.properties" :key="property.propertyId"> <el-tag v-for="property in row.properties" :key="property.propertyId">
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
:rules="formRules" :rules="formRules"
label-width="80px" label-width="80px"
> >
<el-form-item label="商品" prop="spuId"> <el-form-item label="资源" prop="spuId">
<el-select <el-select
v-model="formData.spuId" v-model="formData.spuId"
placeholder="请输入下单商品" placeholder="请输入下单商品"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment