From cf7f4ff89e66e6340fa2c4673d333eae2373caae Mon Sep 17 00:00:00 2001 From: puhui999 Date: Tue, 30 May 2023 18:14:40 +0800 Subject: [PATCH 01/80] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=20review=20?= =?UTF-8?q?=E6=8F=90=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=8C=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=88=86=E7=B1=BB=E9=80=89=E6=8B=A9=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E3=80=81=E5=AE=8C=E6=95=B4=E5=B1=82=E7=BA=A7?= =?UTF-8?q?=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit e555977757f76516638ce2c8fb90eb6a186bc25b) --- src/api/mall/product/spu.ts | 14 ++-- src/utils/tree.ts | 81 ++++++++++++++++++ src/views/mall/product/spu/addForm.vue | 15 ++-- .../product/spu/components/BasicInfoForm.vue | 59 ++++++++----- .../spu/components/DescriptionForm.vue | 6 +- .../spu/components/OtherSettingsForm.vue | 6 +- .../components/ProductAttributesAddForm.vue | 3 +- .../mall/product/spu/components/SkuList.vue | 58 ++++++++----- src/views/mall/product/spu/index.vue | 84 ++++++++++++++----- 9 files changed, 238 insertions(+), 88 deletions(-) diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index fd55e126c..5555ce106 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -7,8 +7,7 @@ export interface Property { valueName?: string // 属性值名称 } -// TODO puhui999:是不是直接叫 Sku 更简洁一点哈。type 待后面,总感觉有个类型? -export interface SkuType { +export interface Sku { id?: number // 商品 SKU 编号 spuId?: number // SPU 编号 properties?: Property[] // 属性数组 @@ -25,8 +24,7 @@ export interface SkuType { salesCount?: number // 商品销量 } -// TODO puhui999:是不是直接叫 Spu 更简洁一点哈。type 待后面,总感觉有个类型? -export interface SpuType { +export interface Spu { id?: number name?: string // 商品名称 categoryId?: number | null // 商品分类 @@ -39,9 +37,9 @@ export interface SpuType { brandId?: number | null // 商品品牌编号 specType?: boolean // 商品规格 subCommissionType?: boolean // 分销类型 - skus: SkuType[] // sku数组 + skus: Sku[] // sku数组 description?: string // 商品详情 - sort?: string // 商品排序 + sort?: number // 商品排序 giveIntegral?: number // 赠送积分 virtualSalesCount?: number // 虚拟销量 recommendHot?: boolean // 是否热卖 @@ -62,12 +60,12 @@ export const getTabsCount = () => { } // 创建商品 Spu -export const createSpu = (data: SpuType) => { +export const createSpu = (data: Spu) => { return request.post({ url: '/product/spu/create', data }) } // 更新商品 Spu -export const updateSpu = (data: SpuType) => { +export const updateSpu = (data: Spu) => { return request.put({ url: '/product/spu/update', data }) } diff --git a/src/utils/tree.ts b/src/utils/tree.ts index 91d53f8c3..513b656d9 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -3,6 +3,7 @@ interface TreeHelperConfig { children: string pid: string } + const DEFAULT_CONFIG: TreeHelperConfig = { id: 'id', children: 'children', @@ -133,6 +134,7 @@ export const filter = ( ): T[] => { config = getConfig(config) const children = config.children as string + function listFilter(list: T[]) { return list .map((node: any) => ({ ...node })) @@ -141,6 +143,7 @@ export const filter = ( return func(node) || (node[children] && node[children].length) }) } + return listFilter(tree) } @@ -264,6 +267,7 @@ export const handleTree = (data: any[], id?: string, parentId?: string, children } } } + return tree } /** @@ -300,3 +304,80 @@ export const handleTree2 = (data, id, parentId, children, rootId) => { }) return treeData !== '' ? treeData : data } +/** + * + * @param tree 要操作的树结构数据 + * @param nodeId 需要判断在什么层级的数据 + * @param level 检查的级别, 默认检查到二级 + */ +export const checkSelectedNode = (tree: any[], nodeId, level = 2) => { + if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) { + console.warn('tree must be an array') + return false + } + // 校验是否是一级节点 + if (tree.some((item) => item.id === nodeId)) { + return false + } + // 递归计数 + let count = 1 + + // 深层次校验 + function performAThoroughValidation(arr) { + count += 1 + for (const item of arr) { + if (item.id === nodeId) { + return true + } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { + performAThoroughValidation(item.children) + } + } + return false + } + + for (const item of tree) { + count = 1 + if (performAThoroughValidation(item.children)) { + // 找到后对比是否是期望的层级 + if (count >= level) return true + } + } + return false +} +/** + * 获取节点的完整结构 + * @param tree 树数据 + * @param nodeId 节点 id + */ +export const treeToString = (tree: any[], nodeId) => { + if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) { + console.warn('tree must be an array') + return '' + } + // 校验是否是一级节点 + const node = tree.find((item) => item.id === nodeId) + if (typeof node !== 'undefined') { + return node.name + } + let str = '' + + function performAThoroughValidation(arr) { + for (const item of arr) { + if (item.id === nodeId) { + str += `/${item.name}` + return true + } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { + performAThoroughValidation(item.children) + } + } + return false + } + + for (const item of tree) { + str = `${item.name}` + if (performAThoroughValidation(item.children)) { + break + } + } + return str +} diff --git a/src/views/mall/product/spu/addForm.vue b/src/views/mall/product/spu/addForm.vue index 18f9d0b65..1ae1a4c29 100644 --- a/src/views/mall/product/spu/addForm.vue +++ b/src/views/mall/product/spu/addForm.vue @@ -51,15 +51,15 @@ const basicInfoRef = ref>() // 商品信息Re const descriptionRef = ref>() // 商品详情Ref const otherSettingsRef = ref>() // 其他设置Ref // spu 表单数据 -const formData = ref({ +const formData = ref({ name: '', // 商品名称 categoryId: null, // 商品分类 keyword: '', // 关键字 unit: null, // 单位 picUrl: '', // 商品封面图 - sliderPicUrls: [], // 商品轮播图 + sliderPicUrls: [''], // 商品轮播图 introduction: '', // 商品简介 - deliveryTemplateId: 1, // 运费模版 + deliveryTemplateId: null, // 运费模版 brandId: null, // 商品品牌 specType: false, // 商品规格 subCommissionType: false, // 分销类型 @@ -94,7 +94,7 @@ const getDetail = async () => { if (id) { formLoading.value = true try { - const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.SpuType + const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.Spu res.skus.forEach((item) => { // 回显价格分转元 item.price = formatToFraction(item.price) @@ -120,8 +120,9 @@ const submitForm = async () => { await unref(basicInfoRef)?.validate() await unref(descriptionRef)?.validate() await unref(otherSettingsRef)?.validate() - const deepCopyFormData = cloneDeep(unref(formData.value)) // 深拷贝一份 fix:这样最终 server 端不满足,不需要恢复, - // TODO 兜底处理 sku 空数据 + // 深拷贝一份, 这样最终 server 端不满足,不需要恢复, + const deepCopyFormData = cloneDeep(unref(formData.value)) + // 兜底处理 sku 空数据 formData.value.skus.forEach((sku) => { // 因为是空数据这里判断一下商品条码是否为空就行 if (sku.barCode === '') { @@ -150,7 +151,7 @@ const submitForm = async () => { }) deepCopyFormData.sliderPicUrls = newSliderPicUrls // 校验都通过后提交表单 - const data = deepCopyFormData as ProductSpuApi.SpuType + const data = deepCopyFormData as ProductSpuApi.Spu const id = params.spuId as number if (!id) { await ProductSpuApi.createSpu(data) diff --git a/src/views/mall/product/spu/components/BasicInfoForm.vue b/src/views/mall/product/spu/components/BasicInfoForm.vue index d800e3328..60fc7c693 100644 --- a/src/views/mall/product/spu/components/BasicInfoForm.vue +++ b/src/views/mall/product/spu/components/BasicInfoForm.vue @@ -7,7 +7,7 @@ - + @@ -119,9 +120,9 @@ import { PropType } from 'vue' import { copyValueToTarget } from '@/utils' import { propTypes } from '@/utils/propTypes' -import { defaultProps, handleTree } from '@/utils/tree' +import { checkSelectedNode, defaultProps, handleTree } from '@/utils/tree' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' -import type { SpuType } from '@/api/mall/product/spu' +import type { Spu } from '@/api/mall/product/spu' import { UploadImg, UploadImgs } from '@/components/UploadFile' import { ProductAttributes, ProductAttributesAddForm, SkuList } from './index' import * as ProductCategoryApi from '@/api/mall/product/category' @@ -131,7 +132,7 @@ const message = useMessage() // 消息弹窗 const props = defineProps({ propFormData: { - type: Object as PropType, + type: Object as PropType, default: () => {} }, activeName: propTypes.string.def('') @@ -144,7 +145,7 @@ const skuListRef = ref() // 商品属性列表Ref const generateSkus = (propertyList) => { skuListRef.value.generateTableData(propertyList) } -const formData = reactive({ +const formData = reactive({ name: '', // 商品名称 categoryId: null, // 商品分类 keyword: '', // 关键字 @@ -185,26 +186,24 @@ watch( formData.sliderPicUrls = data['sliderPicUrls'].map((item) => ({ url: item })) - // TODO @puhui999:if return,减少嵌套层级 // 只有是多规格才处理 - if (formData.specType) { - // 直接拿返回的 skus 属性逆向生成出 propertyList - const properties = [] - formData.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 }) - } - }) + if (!formData.specType) return + // 直接拿返回的 skus 属性逆向生成出 propertyList + const properties = [] + formData.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 }) + } }) - propertyList.value = properties - } + }) + propertyList.value = properties }, { immediate: true @@ -216,6 +215,11 @@ watch( */ const emit = defineEmits(['update:activeName']) const validate = async () => { + // 校验 sku + if (!skuListRef.value.validateSku()) { + message.warning('商品相关价格不能低于0.01元!!') + throw new Error('商品相关价格不能低于0.01元!!') + } // 校验表单 if (!productSpuBasicInfoRef) return return await unref(productSpuBasicInfoRef).validate((valid) => { @@ -263,6 +267,15 @@ const onChangeSpec = () => { } const categoryList = ref([]) // 分类树 +/** + * 选择分类时触发校验 + */ +const nodeClick = () => { + if (!checkSelectedNode(categoryList.value, formData.categoryId)) { + formData.categoryId = null + message.warning('必须选择二级节点!!') + } +} const brandList = ref([]) // 精简商品品牌列表 onMounted(async () => { // 获得分类树 diff --git a/src/views/mall/product/spu/components/DescriptionForm.vue b/src/views/mall/product/spu/components/DescriptionForm.vue index fbae9a86b..23a3e99ab 100644 --- a/src/views/mall/product/spu/components/DescriptionForm.vue +++ b/src/views/mall/product/spu/components/DescriptionForm.vue @@ -7,7 +7,7 @@ diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index 539171b06..347197753 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -8,18 +8,16 @@ class="-mb-15px" label-width="68px" > - - + - - + @@ -80,31 +79,60 @@ /> - +虚拟销量:999 --> @@ -202,7 +230,7 @@ import { TabsPaneContext } from 'element-plus' import { cloneDeep } from 'lodash-es' import { createImageViewer } from '@/components/ImageViewer' import { dateFormatter } from '@/utils/formatTime' -import { defaultProps, handleTree } from '@/utils/tree' +import { checkSelectedNode, defaultProps, handleTree, treeToString } from '@/utils/tree' import { ProductSpuStatusEnum } from '@/utils/constants' import { formatToFraction } from '@/utils' import download from '@/utils/download' @@ -391,7 +419,7 @@ const handleExport = async () => { } } -// 监听路由变化更新列表 TODO @puhui999:这个是必须加的么?fix: 因为编辑表单是以路由的方式打开,保存表单后列表不会刷新 +// 监听路由变化更新列表,解决商品保存后,列表不刷新的问题。 watch( () => currentRoute.value, () => { @@ -400,6 +428,22 @@ watch( ) const categoryList = ref() // 分类树 +/** + * 获取分类的节点的完整结构 + * @param categoryId 分类id + */ +const categoryString = (categoryId) => { + return treeToString(categoryList.value, categoryId) +} +/** + * 校验所选是否为二级节点 + */ +const nodeClick = () => { + if (!checkSelectedNode(categoryList.value, queryParams.value.categoryId)) { + queryParams.value.categoryId = null + message.warning('必须选择二级节点!!') + } +} /** 初始化 **/ onMounted(async () => { await getTabsCount() -- Gitee From 9e7fe34ae8a620c5ddb7fc50ab8c47ac7062ccba Mon Sep 17 00:00:00 2001 From: jason <2667446@qq.com> Date: Tue, 30 May 2023 21:21:04 +0800 Subject: [PATCH 02/80] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E8=87=AA=E6=8F=90=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 000aa950129d42aa141816f939c64639e89ff7c6) --- .../mall/trade/delivery/pickUpStore/index.ts | 46 +++ .../delivery/pickUpStore/PickUpStoreForm.vue | 288 ++++++++++++++++++ .../mall/trade/delivery/pickUpStore/index.vue | 199 ++++++++++++ 3 files changed, 533 insertions(+) create mode 100644 src/api/mall/trade/delivery/pickUpStore/index.ts create mode 100644 src/views/mall/trade/delivery/pickUpStore/PickUpStoreForm.vue create mode 100644 src/views/mall/trade/delivery/pickUpStore/index.vue diff --git a/src/api/mall/trade/delivery/pickUpStore/index.ts b/src/api/mall/trade/delivery/pickUpStore/index.ts new file mode 100644 index 000000000..90fb3d01d --- /dev/null +++ b/src/api/mall/trade/delivery/pickUpStore/index.ts @@ -0,0 +1,46 @@ +import request from '@/config/axios' + +export interface DeliveryPickUpStoreVO { + id: number + name: string + introduction: string + phone: string + areaId: number + detailAddress: string + logo: string + openingTime: string + closingTime: string + latitude: number + longitude: number + status: number +} + +// 查询自提门店列表 +export const getDeliveryPickUpStorePage = async (params: DeliveryPickUpStorePageReqVO) => { + return await request.get({ url: '/trade/delivery/pick-up-store/page', params }) +} + +// 查询自提门店详情 +export const getDeliveryPickUpStore = async (id: number) => { + return await request.get({ url: '/trade/delivery/pick-up-store/get?id=' + id }) +} + +// 新增自提门店 +export const createDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => { + return await request.post({ url: '/trade/delivery/pick-up-store/create', data }) +} + +// 修改自提门店 +export const updateDeliveryPickUpStore = async (data: DeliveryPickUpStoreVO) => { + return await request.put({ url: '/trade/delivery/pick-up-store/update', data }) +} + +// 删除自提门店 +export const deleteDeliveryPickUpStore = async (id: number) => { + return await request.delete({ url: '/trade/delivery/pick-up-store/delete?id=' + id }) +} + +// 导出自提门店 Excel +export const exportDeliveryPickUpStoreApi = async (params) => { + return await request.download({ url: '/trade/delivery/pick-up-store/export-excel', params }) +} diff --git a/src/views/mall/trade/delivery/pickUpStore/PickUpStoreForm.vue b/src/views/mall/trade/delivery/pickUpStore/PickUpStoreForm.vue new file mode 100644 index 000000000..937c2a48b --- /dev/null +++ b/src/views/mall/trade/delivery/pickUpStore/PickUpStoreForm.vue @@ -0,0 +1,288 @@ + + + diff --git a/src/views/mall/trade/delivery/pickUpStore/index.vue b/src/views/mall/trade/delivery/pickUpStore/index.vue new file mode 100644 index 000000000..d163af104 --- /dev/null +++ b/src/views/mall/trade/delivery/pickUpStore/index.vue @@ -0,0 +1,199 @@ + + -- Gitee From d35ac547ac302bd3ce7ac0393331f5b7d0e478ce Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 31 May 2023 14:42:45 +0800 Subject: [PATCH 03/80] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=20SPU=20?= =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 39c92cb944e2b41007d1870d411f5255c9da1d70) --- src/api/mall/product/spu.ts | 2 +- src/router/modules/remaining.ts | 13 +++ src/utils/tree.ts | 21 +++- src/views/mall/product/spu/addForm.vue | 12 +- .../product/spu/components/BasicInfoForm.vue | 80 ++++++++++++- .../spu/components/DescriptionForm.vue | 25 ++++- .../spu/components/OtherSettingsForm.vue | 37 +++++- .../mall/product/spu/components/SkuList.vue | 106 ++++++++++++++++-- .../mall/product/spu/components/spu.data.ts | 105 +++++++++++++++++ src/views/mall/product/spu/index.vue | 23 ++-- 10 files changed, 387 insertions(+), 37 deletions(-) create mode 100644 src/views/mall/product/spu/components/spu.data.ts diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 5555ce106..e0d4ec832 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -37,7 +37,7 @@ export interface Spu { brandId?: number | null // 商品品牌编号 specType?: boolean // 商品规格 subCommissionType?: boolean // 分销类型 - skus: Sku[] // sku数组 + skus?: Sku[] // sku数组 description?: string // 商品详情 sort?: number // 商品排序 giveIntegral?: number // 赠送积分 diff --git a/src/router/modules/remaining.ts b/src/router/modules/remaining.ts index b9bf8f9f3..e4d206c06 100644 --- a/src/router/modules/remaining.ts +++ b/src/router/modules/remaining.ts @@ -379,6 +379,19 @@ const remainingRouter: AppRouteRecordRaw[] = [ title: '编辑商品', activeMenu: '/product/product-spu' } + }, + { + path: 'productSpuDetail/:spuId(\\d+)', + component: () => import('@/views/mall/product/spu/addForm.vue'), + name: 'productSpuDetail', + meta: { + noCache: true, + hidden: true, + canTo: true, + icon: 'ep:view', + title: '商品详情', + activeMenu: '/product/product-spu' + } } ] } diff --git a/src/utils/tree.ts b/src/utils/tree.ts index 513b656d9..e2bc600c3 100644 --- a/src/utils/tree.ts +++ b/src/utils/tree.ts @@ -310,26 +310,30 @@ export const handleTree2 = (data, id, parentId, children, rootId) => { * @param nodeId 需要判断在什么层级的数据 * @param level 检查的级别, 默认检查到二级 */ -export const checkSelectedNode = (tree: any[], nodeId, level = 2) => { +export const checkSelectedNode = (tree: any[], nodeId: any, level = 2): boolean => { if (typeof tree === 'undefined' || !Array.isArray(tree) || tree.length === 0) { console.warn('tree must be an array') return false } + // 校验是否是一级节点 if (tree.some((item) => item.id === nodeId)) { return false } + // 递归计数 let count = 1 // 深层次校验 - function performAThoroughValidation(arr) { + function performAThoroughValidation(arr: any[]): boolean { count += 1 for (const item of arr) { if (item.id === nodeId) { return true } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { - performAThoroughValidation(item.children) + if (performAThoroughValidation(item.children)) { + return true + } } } return false @@ -339,11 +343,15 @@ export const checkSelectedNode = (tree: any[], nodeId, level = 2) => { count = 1 if (performAThoroughValidation(item.children)) { // 找到后对比是否是期望的层级 - if (count >= level) return true + if (count >= level) { + return true + } } } + return false } + /** * 获取节点的完整结构 * @param tree 树数据 @@ -367,7 +375,10 @@ export const treeToString = (tree: any[], nodeId) => { str += `/${item.name}` return true } else if (typeof item.children !== 'undefined' && item.children.length !== 0) { - performAThoroughValidation(item.children) + str += `/${item.name}` + if (performAThoroughValidation(item.children)) { + return true + } } } return false diff --git a/src/views/mall/product/spu/addForm.vue b/src/views/mall/product/spu/addForm.vue index 1ae1a4c29..737b5e17c 100644 --- a/src/views/mall/product/spu/addForm.vue +++ b/src/views/mall/product/spu/addForm.vue @@ -5,6 +5,7 @@ @@ -12,6 +13,7 @@ @@ -19,6 +21,7 @@ @@ -42,11 +45,12 @@ import { convertToInteger, formatToFraction } from '@/utils' const { t } = useI18n() // 国际化 const message = useMessage() // 消息弹窗 const { push, currentRoute } = useRouter() // 路由 -const { params } = useRoute() // 查询参数 +const { params, name } = useRoute() // 查询参数 const { delView } = useTagsViewStore() // 视图操作 const formLoading = ref(false) // 表单的加载中:1)修改时的数据加载;2)提交的按钮禁用 const activeName = ref('basicInfo') // Tag 激活的窗口 +const isDetail = ref(false) // 是否查看详情 const basicInfoRef = ref>() // 商品信息Ref const descriptionRef = ref>() // 商品详情Ref const otherSettingsRef = ref>() // 其他设置Ref @@ -90,12 +94,13 @@ const formData = ref({ /** 获得详情 */ const getDetail = async () => { + console.log(name) const id = params.spuId as number if (id) { formLoading.value = true try { const res = (await ProductSpuApi.getSpu(id)) as ProductSpuApi.Spu - res.skus.forEach((item) => { + res.skus!.forEach((item) => { // 回显价格分转元 item.price = formatToFraction(item.price) item.marketPrice = formatToFraction(item.marketPrice) @@ -123,7 +128,7 @@ const submitForm = async () => { // 深拷贝一份, 这样最终 server 端不满足,不需要恢复, const deepCopyFormData = cloneDeep(unref(formData.value)) // 兜底处理 sku 空数据 - formData.value.skus.forEach((sku) => { + formData.value.skus!.forEach((sku) => { // 因为是空数据这里判断一下商品条码是否为空就行 if (sku.barCode === '') { const index = deepCopyFormData.skus.findIndex( @@ -171,7 +176,6 @@ const close = () => { delView(unref(currentRoute)) push('/product/product-spu') } - /** 初始化 */ onMounted(async () => { await getDetail() diff --git a/src/views/mall/product/spu/components/BasicInfoForm.vue b/src/views/mall/product/spu/components/BasicInfoForm.vue index 60fc7c693..2cc5a7c2e 100644 --- a/src/views/mall/product/spu/components/BasicInfoForm.vue +++ b/src/views/mall/product/spu/components/BasicInfoForm.vue @@ -1,5 +1,11 @@ diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index f3e0476ba..47a9c8d59 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -408,7 +408,7 @@ const openForm = (id?: number) => { * 查看商品详情 */ const openDetail = (id?: number) => { - push('/product/productSpuDetail' + id) + push('/product/productSpuDetail/' + id) } /** 导出按钮操作 */ -- Gitee From c2168466f3fa62daef661c13483b9bbef9b81436 Mon Sep 17 00:00:00 2001 From: shizhong <124974919@qq.com> Date: Thu, 27 Jul 2023 18:36:06 +0800 Subject: [PATCH 05/80] =?UTF-8?q?fix:=20=E5=BC=95=E5=85=A5=20v-dompurify-h?= =?UTF-8?q?tml=20=E6=8C=87=E4=BB=A4=E8=A7=A3=E5=86=B3=20v-html=20=E7=9A=84?= =?UTF-8?q?=E5=AE=89=E5=85=A8=E9=9A=90=E6=82=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/Form/src/Form.vue | 14 ++++---- src/main.ts | 5 ++- src/views/infra/build/index.vue | 16 +++------- .../infra/codegen/components/Preview.vue | 32 ++++++++++++++++++- .../spu/components/DescriptionForm.vue | 2 +- src/views/system/mail/log/index.vue | 7 +++- 7 files changed, 54 insertions(+), 23 deletions(-) diff --git a/package.json b/package.json index 6a87adf30..0e759cadd 100644 --- a/package.json +++ b/package.json @@ -65,6 +65,7 @@ "url": "^0.11.0", "video.js": "^8.3.0", "vue": "3.3.4", + "vue-dompurify-html": "^4.1.4", "vue-i18n": "9.2.2", "vue-router": "^4.2.1", "vue-types": "^5.0.3", diff --git a/src/components/Form/src/Form.vue b/src/components/Form/src/Form.vue index c11216416..3dca6c944 100644 --- a/src/components/Form/src/Form.vue +++ b/src/components/Form/src/Form.vue @@ -1,16 +1,16 @@ -- Gitee From a29421dd4153cf414c9f213f6b29a59eab7283a2 Mon Sep 17 00:00:00 2001 From: xiaobai <2511883673@qq.com> Date: Fri, 2 Jun 2023 16:10:33 +0800 Subject: [PATCH 08/80] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 505f5cfa0c543f779abe43d6d77f260991486fdf) --- src/api/mall/trade/order/index.ts | 14 + src/api/mall/trade/order/type/orderType.ts | 183 +++++++++++ src/utils/dict.ts | 14 +- src/views/mall/trade/order/index.vue | 348 +++++++++++++++++++++ 4 files changed, 556 insertions(+), 3 deletions(-) create mode 100644 src/api/mall/trade/order/index.ts create mode 100644 src/api/mall/trade/order/type/orderType.ts create mode 100644 src/views/mall/trade/order/index.vue diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts new file mode 100644 index 000000000..22b8f205d --- /dev/null +++ b/src/api/mall/trade/order/index.ts @@ -0,0 +1,14 @@ +import request from '@/config/axios' + +// 获得交易订单分页 +export const getOrderList = (params: PageParam) => { + return request.get({ url: '/trade/order/page', params }) +} + +// // 获得交易订单详情 +// export function getOrderDetail(id) { +// return request({ +// url: '/trade/order/get-detail?id=' + id, +// method: 'get' +// }) +// } diff --git a/src/api/mall/trade/order/type/orderType.ts b/src/api/mall/trade/order/type/orderType.ts new file mode 100644 index 000000000..cba4fbfff --- /dev/null +++ b/src/api/mall/trade/order/type/orderType.ts @@ -0,0 +1,183 @@ +export interface TradeOrderPageItemRespVO { + // 订单编号 + id: number + // 订单流水号 + no: string + // 下单时间 + createTime: Date + // 订单类型 + type: number + // 订单来源 + terminal: number + // 用户编号 + userId: number + // 用户 IP + userIp: string + // 用户备注 + userRemark: string + // 订单状态 + status: number + // 购买的商品数量 + productCount: number + // 订单完成时间 + finishTime?: Date + // 订单取消时间 + cancelTime?: Date + // 取消类型 + cancelType?: number + // 商家备注 + remark?: string + // 支付订单编号 + payOrderId: number + // 是否已支付 + payed: boolean + // 付款时间 + payTime?: Date + // 支付渠道 + payChannelCode: string + // 商品原价(总) + originalPrice: number + // 订单原价(总) + orderPrice: number + // 订单优惠(总) + discountPrice: number + // 运费金额 + deliveryPrice: number + // 订单调价(总) + adjustPrice: number + // 应付金额(总) + payPrice: number + // 配送模板编号 + deliveryTemplateId?: number + // 发货物流公司编号 + logisticsId?: number + // 发货物流单号 + logisticsNo?: string + // 发货状态 + deliveryStatus: number + // 发货时间 + deliveryTime?: Date + // 收货时间 + receiveTime?: Date + // 收件人名称 + receiverName: string + // 收件人手机 + receiverMobile: string + // 收件人地区编号 + receiverAreaId: number + // 收件人邮编 + receiverPostCode: number + // 收件人详细地址 + receiverDetailAddress: string + // 售后状态 + afterSaleStatus?: number + // 退款金额 + refundPrice: number + // 优惠劵编号 + couponId?: number + // 优惠劵减免金额 + couponPrice: number + // 积分抵扣的金额 + pointPrice: number + //收件人地区名字 + receiverAreaName: string + // 订单项列表 + items: TradeOrderItemBaseVO[] +} + +/** + * 交易订单项 Base VO,提供给添加、修改、详细的子 VO 使用 + * 如果子 VO 存在差异的字段,请不要添加到这里,影响 Swagger 文档生成 + */ +export interface TradeOrderItemBaseVO { + // ========== 订单项基本信息 ========== + /** + * 编号 + */ + id: number + /** + * 用户编号 + */ + userId: number + /** + * 订单编号 + */ + orderId: number + // ========== 商品基本信息 ========== + /** + * 商品 SPU 编号 + */ + spuId: number + /** + * 商品 SPU 名称 + */ + spuName: string + /** + * 商品 SKU 编号 + */ + skuId: number + /** + * 商品图片 + */ + picUrl: string + /** + * 购买数量 + */ + count: number + // ========== 价格 + 支付基本信息 ========== + /** + * 商品原价(总) + */ + originalPrice: number + /** + * 商品原价(单) + */ + originalUnitPrice: number + /** + * 商品优惠(总) + */ + discountPrice: number + /** + * 商品实付金额(总) + */ + payPrice: number + /** + * 子订单分摊金额(总) + */ + orderPartPrice: number + /** + * 分摊后子订单实付金额(总) + */ + orderDividePrice: number + // ========== 营销基本信息 ========== + // TODO 芋艿:在捉摸一下 + // ========== 售后基本信息 ========== + /** + * 售后状态 + */ + afterSaleStatus: number + //属性数组 + properties: ProductPropertyValueDetailRespVO[] +} + +/** + * 管理后台 - 商品属性值的明细 Response VO + */ +export interface ProductPropertyValueDetailRespVO { + /** + * 属性的编号 + */ + propertyId: number + /** + * 属性的名称 + */ + propertyName: string + /** + * 属性值的编号 + */ + valueId: number + /** + * 属性值的名称 + */ + valueName: string +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index afb12b469..09861ca92 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -33,7 +33,6 @@ export const getIntDictOptions = (dictType: string) => { value: parseInt(dict.value + '') }) }) - return dictOption } @@ -150,6 +149,15 @@ export enum DICT_TYPE { // ========== MALL 模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 PRODUCT_SPU_STATUS = 'product_spu_status', //商品状态 - // ========== MALL 交易模块 ========== - EXPRESS_CHARGE_MODE = 'trade_delivery_express_charge_mode' //快递的计费方式 + + //===add by 20230530==== + // ========== MALL - ORDER 模块 ========== + TRADE_AFTER_SALE_STATUS = 'trade_after_sale_status', // 售后 - 状态 + TRADE_AFTER_SALE_WAY = 'trade_after_sale_way', // 售后 - 方式 + TRADE_AFTER_SALE_TYPE = 'trade_after_sale_type', // 售后 - 类型 + TRADE_ORDER_TYPE = 'trade_order_type', // 订单 - 类型 + TRADE_ORDER_STATUS = 'trade_order_status', // 订单 - 状态 + TRADE_ORDER_ITEM_AFTER_SALE_STATUS = 'trade_order_item_after_sale_status', // 订单项 - 售后状态 + + TERMINAL = 'terminal' } diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue new file mode 100644 index 000000000..e5a1e28ec --- /dev/null +++ b/src/views/mall/trade/order/index.vue @@ -0,0 +1,348 @@ + + -- Gitee From 16c518e18a53dfa65d68126536a31faf35f9519a Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 3 Jun 2023 19:52:14 +0800 Subject: [PATCH 09/80] =?UTF-8?q?code=20review=EF=BC=9A=E9=97=A8=E5=BA=97?= =?UTF-8?q?=E8=87=AA=E6=8F=90=E3=80=81=E5=BF=AB=E9=80=92=E8=BF=90=E8=B4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 60c1604d4947df8f2eaaa748780af9db9f75831f) --- .../trade/delivery/expressTemplate/index.ts | 5 --- .../expressTemplate/ExpressTemplateForm.vue | 43 ++++++++++++++++--- .../trade/delivery/expressTemplate/index.vue | 1 + .../delivery/pickUpStore/PickUpStoreForm.vue | 23 +++++----- .../mall/trade/delivery/pickUpStore/index.vue | 4 +- 5 files changed, 51 insertions(+), 25 deletions(-) diff --git a/src/api/mall/trade/delivery/expressTemplate/index.ts b/src/api/mall/trade/delivery/expressTemplate/index.ts index 53f2cdeba..9ed23bc1c 100644 --- a/src/api/mall/trade/delivery/expressTemplate/index.ts +++ b/src/api/mall/trade/delivery/expressTemplate/index.ts @@ -52,8 +52,3 @@ export const updateDeliveryExpressTemplate = async (data: DeliveryExpressTemplat export const deleteDeliveryExpressTemplate = async (id: number) => { return await request.delete({ url: '/trade/delivery/express-template/delete?id=' + id }) } - -// 导出快递运费模板 Excel -export const exportDeliveryExpressTemplateApi = async (params) => { - return await request.download({ url: '/trade/delivery/express-template/export-excel', params }) -} diff --git a/src/views/mall/trade/delivery/expressTemplate/ExpressTemplateForm.vue b/src/views/mall/trade/delivery/expressTemplate/ExpressTemplateForm.vue index 5b25422d4..6c9ff2964 100644 --- a/src/views/mall/trade/delivery/expressTemplate/ExpressTemplateForm.vue +++ b/src/views/mall/trade/delivery/expressTemplate/ExpressTemplateForm.vue @@ -89,7 +89,7 @@ - diff --git a/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue b/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue index cf538fc2d..c3de9a2b1 100644 --- a/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue +++ b/src/views/mall/promotion/seckill/activity/components/SpuAndSkuSelectForm.vue @@ -51,7 +51,7 @@ :data="list" :expand-row-keys="expandRowKeys" row-key="id" - @expandChange="getPropertyList" + @expand-change="expandChange" @selection-change="selectSpu" > @@ -111,7 +111,7 @@ diff --git a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts index ce798f1e6..127f0d7b0 100644 --- a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts +++ b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts @@ -40,8 +40,7 @@ const crudSchemas = reactive([ component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + type: 'daterange' } }, form: { @@ -52,7 +51,7 @@ const crudSchemas = reactive([ } }, table: { - width: 300 + width: 120 } }, { @@ -64,8 +63,7 @@ const crudSchemas = reactive([ component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + type: 'daterange' } }, form: { @@ -76,11 +74,11 @@ const crudSchemas = reactive([ } }, table: { - width: 300 + width: 120 } }, { - label: '秒杀时段', // todo @PUHUI999: 在列表界面,格式化不对 + label: '秒杀时段', field: 'configIds', form: { component: 'Select', @@ -106,7 +104,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -118,7 +116,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -130,7 +128,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -141,7 +139,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -152,7 +150,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -164,7 +162,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { @@ -175,12 +173,12 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 120 } }, { label: '秒杀活动商品', // TODO @puhui999:格式化的商品不对; - field: 'spuId', + field: 'spuIds', form: { colProps: { span: 24 @@ -204,7 +202,7 @@ const crudSchemas = reactive([ }, isForm: false, table: { - width: 300 + width: 120 } }, { @@ -215,7 +213,7 @@ const crudSchemas = reactive([ value: 0 }, table: { - width: 300 + width: 80 } }, { -- Gitee From bc35b0c80f298084665da03b063ec9d7a3c3c522 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 25 Jun 2023 17:16:26 +0800 Subject: [PATCH 57/80] =?UTF-8?q?fix:=20=E5=AE=8C=E5=96=84=20mall=20seckil?= =?UTF-8?q?lActivity=20add?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 341303b014f1d24baf132575763d20a4a08c4b1c) --- .../promotion/seckill/activity/SeckillActivityForm.vue | 5 ++--- src/views/mall/promotion/seckill/activity/index.vue | 8 ++++++++ .../promotion/seckill/activity/seckillActivity.data.ts | 8 +++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue b/src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue index f1d34d4f5..e1aee4c72 100644 --- a/src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue +++ b/src/views/mall/promotion/seckill/activity/SeckillActivityForm.vue @@ -10,7 +10,6 @@ - + diff --git a/src/views/point/record/RecordForm.vue b/src/views/member/point/record/RecordForm.vue similarity index 97% rename from src/views/point/record/RecordForm.vue rename to src/views/member/point/record/RecordForm.vue index 6da630eb2..b22c1e772 100644 --- a/src/views/point/record/RecordForm.vue +++ b/src/views/member/point/record/RecordForm.vue @@ -13,7 +13,7 @@ 搜索 重置 - - 新增 - - - 导出 - @@ -94,7 +82,7 @@ @@ -135,26 +123,6 @@ prop="createDate" :formatter="dateFormatter" /> - - - - -- Gitee From 22f869db89f04d0ddd79f581b7888fccbfedc6c1 Mon Sep 17 00:00:00 2001 From: puhui999 Date: Sun, 2 Jul 2023 19:22:57 +0800 Subject: [PATCH 60/80] feat: mall CombinationActivity (cherry picked from commit 2e96b1c9840b7adfbc8110eb3a36bd2b406dc392) --- .../combination/combinationactivity.ts | 48 +++++ src/utils/formatTime.ts | 7 + .../activity/CombinationActivityForm.vue | 74 ++++++++ .../activity/combinationActivity.data.ts | 168 ++++++++++++++++++ .../promotion/combination/activity/index.vue | 88 +++++++++ 5 files changed, 385 insertions(+) create mode 100644 src/api/mall/promotion/combination/combinationactivity.ts create mode 100644 src/views/mall/promotion/combination/activity/CombinationActivityForm.vue create mode 100644 src/views/mall/promotion/combination/activity/combinationActivity.data.ts create mode 100644 src/views/mall/promotion/combination/activity/index.vue diff --git a/src/api/mall/promotion/combination/combinationactivity.ts b/src/api/mall/promotion/combination/combinationactivity.ts new file mode 100644 index 000000000..bc946773a --- /dev/null +++ b/src/api/mall/promotion/combination/combinationactivity.ts @@ -0,0 +1,48 @@ +import request from '@/config/axios' + +export interface CombinationActivityVO { + id: number + name: string + spuId: number + totalLimitCount: number + singleLimitCount: number + startTime: Date + endTime: Date + userSize: number + totalNum: number + successNum: number + orderUserCount: number + virtualGroup: number + status: number + limitDuration: number +} + +// 查询拼团活动列表 +export const getCombinationActivityPage = async (params) => { + return await request.get({ url: '/promotion/combination-activity/page', params }) +} + +// 查询拼团活动详情 +export const getCombinationActivity = async (id: number) => { + return await request.get({ url: '/promotion/combination-activity/get?id=' + id }) +} + +// 新增拼团活动 +export const createCombinationActivity = async (data: CombinationActivityVO) => { + return await request.post({ url: '/promotion/combination-activity/create', data }) +} + +// 修改拼团活动 +export const updateCombinationActivity = async (data: CombinationActivityVO) => { + return await request.put({ url: '/promotion/combination-activity/update', data }) +} + +// 删除拼团活动 +export const deleteCombinationActivity = async (id: number) => { + return await request.delete({ url: '/promotion/combination-activity/delete?id=' + id }) +} + +// 导出拼团活动 Excel +export const exportCombinationActivity = async (params) => { + return await request.download({ url: '/promotion/combination-activity/export-excel', params }) +} diff --git a/src/utils/formatTime.ts b/src/utils/formatTime.ts index c93d8f3e7..c7caabdd1 100644 --- a/src/utils/formatTime.ts +++ b/src/utils/formatTime.ts @@ -70,6 +70,13 @@ export function parseTime(time: any, pattern?: string) { return time_str } +/** + * 获取当前的日期+时间 + */ +export function getNowDateTime() { + return dayjs().format('YYYY-MM-DD HH:mm:ss') +} + /** * 获取当前日期是第几周 * @param dateTime 当前传入的日期值 diff --git a/src/views/mall/promotion/combination/activity/CombinationActivityForm.vue b/src/views/mall/promotion/combination/activity/CombinationActivityForm.vue new file mode 100644 index 000000000..f0c22be53 --- /dev/null +++ b/src/views/mall/promotion/combination/activity/CombinationActivityForm.vue @@ -0,0 +1,74 @@ + + diff --git a/src/views/mall/promotion/combination/activity/combinationActivity.data.ts b/src/views/mall/promotion/combination/activity/combinationActivity.data.ts new file mode 100644 index 000000000..1c4235201 --- /dev/null +++ b/src/views/mall/promotion/combination/activity/combinationActivity.data.ts @@ -0,0 +1,168 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter, getNowDateTime } from '@/utils/formatTime' + +// 表单校验 +export const rules = reactive({ + name: [required], + totalLimitCount: [required], + singleLimitCount: [required], + startTime: [required], + endTime: [required], + userSize: [required], + totalNum: [required], + successNum: [required], + orderUserCount: [required], + virtualGroup: [required], + status: [required], + limitDuration: [required] +}) + +// CrudSchema https://doc.iocoder.cn/vue3/crud-schema/ +const crudSchemas = reactive([ + { + label: '拼团名称', + field: 'name', + isSearch: true, + isTable: false, + form: { + colProps: { + span: 24 + } + } + }, + { + label: '活动时间', + field: 'activityTime', + formatter: dateFormatter, + search: { + show: true, + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'datetimerange' + } + }, + form: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'datetimerange' + }, + value: [getNowDateTime(), getNowDateTime()], + colProps: { + span: 24 + } + } + }, + { + label: '参与人数', + field: 'orderUserCount', + isSearch: false, + form: { + component: 'InputNumber', + labelMessage: '参与人数不能少于两人', + value: 2 + } + }, + { + label: '限制时长', + field: 'limitDuration', + isSearch: false, + isTable: false, + form: { + component: 'InputNumber', + labelMessage: '限制时长(小时)', + componentProps: { + placeholder: '请输入限制时长(小时)' + } + } + }, + { + label: '总限购数量', + field: 'totalLimitCount', + isSearch: false, + isTable: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '单次限购数量', + field: 'singleLimitCount', + isSearch: false, + isTable: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '购买人数', + field: 'userSize', + isSearch: false, + isForm: false + }, + { + label: '开团组数', + field: 'totalNum', + isSearch: false, + isForm: false + }, + { + label: '成团组数', + field: 'successNum', + isSearch: false, + isForm: false + }, + { + label: '虚拟成团', + field: 'virtualGroup', + isSearch: false, + isTable: false, + form: { + component: 'InputNumber', + value: 0 + } + }, + { + label: '活动状态', + field: 'status', + dictType: DICT_TYPE.COMMON_STATUS, + dictClass: 'number', + isSearch: true, + isForm: false + }, + { + label: '创建时间', + field: 'createTime', + formatter: dateFormatter, + isSearch: false, + isTable: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + isForm: false + }, + { + label: '拼团商品', + field: 'spuId', + isSearch: false, + form: { + colProps: { + span: 24 + } + } + }, + { + label: '操作', + field: 'action', + isForm: false + } +]) +export const { allSchemas } = useCrudSchemas(crudSchemas) diff --git a/src/views/mall/promotion/combination/activity/index.vue b/src/views/mall/promotion/combination/activity/index.vue new file mode 100644 index 000000000..09cc1a7f5 --- /dev/null +++ b/src/views/mall/promotion/combination/activity/index.vue @@ -0,0 +1,88 @@ + + -- Gitee From 401112f6684898c330de9d386ef9be6897684614 Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 21:46:04 +0800 Subject: [PATCH 61/80] =?UTF-8?q?review=20=E7=A7=92=E6=9D=80=E6=B4=BB?= =?UTF-8?q?=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit b1ce2672e418cc9a970992787d5ba405c92d5070) --- src/views/mall/product/spu/components/index.ts | 5 ++++- src/views/mall/product/spu/index.vue | 2 ++ src/views/mall/promotion/components/SpuSelect.vue | 1 - src/views/mall/promotion/components/index.ts | 1 + src/views/mall/promotion/seckill/activity/index.vue | 3 +++ .../mall/promotion/seckill/activity/seckillActivity.data.ts | 2 +- 6 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/views/mall/product/spu/components/index.ts b/src/views/mall/product/spu/components/index.ts index 59c031e87..ca61ff6b4 100644 --- a/src/views/mall/product/spu/components/index.ts +++ b/src/views/mall/product/spu/components/index.ts @@ -7,6 +7,7 @@ import SkuList from './SkuList.vue' import { Spu } from '@/api/mall/product/spu' +// TODO @puhui999:Properties 改成 Property 更合适? interface Properties { id: number name: string @@ -30,8 +31,10 @@ interface RuleConfig { } /** - * 商品通用函数 + * 获得商品的规格列表 + * * @param spu + * @return Property 规格列表 */ const getPropertyList = (spu: Spu): Properties[] => { // 直接拿返回的 skus 属性逆向生成出 propertyList diff --git a/src/views/mall/product/spu/index.vue b/src/views/mall/product/spu/index.vue index 7dfd484b5..75bd02e0f 100644 --- a/src/views/mall/product/spu/index.vue +++ b/src/views/mall/product/spu/index.vue @@ -437,6 +437,7 @@ const categoryList = ref() // 分类树 const categoryString = (categoryId) => { return treeToString(categoryList.value, categoryId) } + /** * 校验所选是否为二级及以下节点 */ @@ -446,6 +447,7 @@ const nodeClick = () => { message.warning('必须选择二级及以下节点!!') } } + /** 初始化 **/ onMounted(async () => { await getTabsCount() diff --git a/src/views/mall/promotion/components/SpuSelect.vue b/src/views/mall/promotion/components/SpuSelect.vue index 0d535dfd6..94c60c9c5 100644 --- a/src/views/mall/promotion/components/SpuSelect.vue +++ b/src/views/mall/promotion/components/SpuSelect.vue @@ -256,7 +256,6 @@ const imagePreview = (imgUrl: string) => { const categoryList = ref() // 分类树 -// TODO @puhui999:商品搜索的时候,可以通过一级搜二级;所以这个校验可以去掉哈;也就是说,只允许挂在二级,但是一级可搜索到 /** 初始化 **/ onMounted(async () => { await getList() diff --git a/src/views/mall/promotion/components/index.ts b/src/views/mall/promotion/components/index.ts index f3f099501..a4b4e75b2 100644 --- a/src/views/mall/promotion/components/index.ts +++ b/src/views/mall/promotion/components/index.ts @@ -7,6 +7,7 @@ type SpuProperty = { spuDetail: T propertyList: Properties[] } + /** * 提供商品活动商品选择通用组件 */ diff --git a/src/views/mall/promotion/seckill/activity/index.vue b/src/views/mall/promotion/seckill/activity/index.vue index d7d69dfb2..f06b855f5 100644 --- a/src/views/mall/promotion/seckill/activity/index.vue +++ b/src/views/mall/promotion/seckill/activity/index.vue @@ -89,6 +89,8 @@ const openForm = (type: string, id?: number) => { const handleDelete = (id: number) => { tableMethods.delList(id, false) } + +// TODO @puhui:是不是直接叫 configList 就好啦 const seckillConfigAllSimple = ref([]) // 时段配置精简列表 const convertSeckillConfigNames = computed( () => (row) => @@ -96,6 +98,7 @@ const convertSeckillConfigNames = computed( ?.filter((item) => row.configIds.includes(item.id)) ?.map((config) => config.name) ) + const expandChange = (row, expandedRows) => { // TODO puhui:等 CRUD 完事后弄 console.log(row, expandedRows) diff --git a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts index fcf48985a..c858374c4 100644 --- a/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts +++ b/src/views/mall/promotion/seckill/activity/seckillActivity.data.ts @@ -219,7 +219,7 @@ const crudSchemas = reactive([ }, { label: '状态', - field: 'status', // TODO @puhui999:状态在 table 格式化不对;建表插入的数据状态值不对,改为 0 或 1 就好了 + field: 'status', dictType: DICT_TYPE.COMMON_STATUS, dictClass: 'number', isForm: false, -- Gitee From 23fa3fe14cc34ad9a7e7503362ed4df89ee0e7eb Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sun, 2 Jul 2023 23:18:45 +0800 Subject: [PATCH 62/80] =?UTF-8?q?review=20=E7=A7=AF=E5=88=86=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 4571f893ed93d3a012635a22137ecaff0ae34949) --- src/utils/dict.ts | 5 ++- src/views/member/point/config/index.vue | 9 +++-- src/views/member/point/record/RecordForm.vue | 1 + src/views/member/point/record/index.vue | 36 +++++++++++--------- src/views/member/signin/config/index.vue | 20 +++++------ src/views/member/signin/record/index.vue | 21 ++---------- 6 files changed, 42 insertions(+), 50 deletions(-) diff --git a/src/utils/dict.ts b/src/utils/dict.ts index d8405444a..70f4e0d3a 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -147,9 +147,8 @@ export enum DICT_TYPE { MP_MESSAGE_TYPE = 'mp_message_type', // 消息类型 // ========== MALL - 会员模块 ========== - // 积分模块 TODO 芋艿:改成 member_ 前缀;包括枚举和值; - MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', - MEMBER_POINT_STATUS = 'member_point_status', + MEMBER_POINT_BIZ_TYPE = 'member_point_biz_type', // 积分的业务类型 + MEMBER_POINT_STATUS = 'member_point_status', // 积分的状态 // ========== MALL - 商品模块 ========== PRODUCT_UNIT = 'product_unit', // 商品单位 diff --git a/src/views/member/point/config/index.vue b/src/views/member/point/config/index.vue index c5f947ce5..0fd1484f1 100644 --- a/src/views/member/point/config/index.vue +++ b/src/views/member/point/config/index.vue @@ -10,9 +10,11 @@ + + - + @@ -58,6 +60,7 @@ const formData = ref({ const formRules = reactive({}) const formRef = ref() // 表单 Ref +/** 修改积分配置 */ const onSubmit = async () => { // 校验表单 if (!formRef) return @@ -75,6 +78,7 @@ const onSubmit = async () => { } } +/** 获得积分配置 */ const getConfig = async () => { try { const data = await ConfigApi.getConfig() @@ -82,6 +86,7 @@ const getConfig = async () => { } finally { } } + onMounted(() => { getConfig() }) diff --git a/src/views/member/point/record/RecordForm.vue b/src/views/member/point/record/RecordForm.vue index b22c1e772..bdbf08cc1 100644 --- a/src/views/member/point/record/RecordForm.vue +++ b/src/views/member/point/record/RecordForm.vue @@ -157,6 +157,7 @@ const submitForm = async () => { } } +// TODO @xiaqing:不需要更新操作哇? /** 重置表单 */ const resetForm = () => { formData.value = { diff --git a/src/views/member/point/record/index.vue b/src/views/member/point/record/index.vue index 082c64cbd..517410f70 100644 --- a/src/views/member/point/record/index.vue +++ b/src/views/member/point/record/index.vue @@ -57,7 +57,7 @@ /> - + - - - - - + + + + + + + - - + + + + - - + + 导出 @@ -44,15 +46,10 @@ - + - - + + - diff --git a/src/views/mall/promotion/components/SpuAndSkuList.vue b/src/views/mall/promotion/components/SpuAndSkuList.vue index 20ade5845..8efb7f835 100644 --- a/src/views/mall/promotion/components/SpuAndSkuList.vue +++ b/src/views/mall/promotion/components/SpuAndSkuList.vue @@ -1,5 +1,5 @@