From a79f1452b30f89983f153699e7183b202c18d50d Mon Sep 17 00:00:00 2001 From: puhui999 <puhui999@163.com> Date: Sat, 9 Sep 2023 14:27:48 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=99=BB=E5=BD=95=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=EF=BC=9A=E5=A7=90=E5=A7=90=E7=82=B9=E5=87=BB=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E5=90=8E=E7=95=8C=E9=9D=A2=E7=96=AF=E7=8B=82=E9=97=AA=E5=8A=A8?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Login/components/LoginForm.vue | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/views/Login/components/LoginForm.vue b/src/views/Login/components/LoginForm.vue index ffadf8b57..e8d017218 100644 --- a/src/views/Login/components/LoginForm.vue +++ b/src/views/Login/components/LoginForm.vue @@ -230,6 +230,7 @@ const getCookie = () => { } } } +const loading = ref() // ElLoading.service 返回的实例 // 登录 const handleLogin = async (params) => { loginLoading.value = true @@ -244,7 +245,7 @@ const handleLogin = async (params) => { if (!res) { return } - ElLoading.service({ + loading.value = ElLoading.service({ lock: true, text: '正在加载系统中...', background: 'rgba(0, 0, 0, 0.7)' @@ -264,13 +265,9 @@ const handleLogin = async (params) => { } else { push({ path: redirect.value || permissionStore.addRouters[0].path }) } - } catch { - loginLoading.value = false } finally { - setTimeout(() => { - const loadingInstance = ElLoading.service() - loadingInstance.close() - }, 400) + loginLoading.value = false + loading.value.close() } } -- Gitee From 7e511d1e4f0b7c412245b43bd56f36074564a616 Mon Sep 17 00:00:00 2001 From: puhui999 <puhui999@163.com> Date: Sat, 9 Sep 2023 20:51:33 +0800 Subject: [PATCH 2/4] =?UTF-8?q?mall-order=EF=BC=9A=E4=BF=AE=E5=A4=8D=20tod?= =?UTF-8?q?o=20=E6=8F=90=E5=88=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/trade/order/index.ts | 5 ++--- src/config/axios/service.ts | 5 ----- src/views/mall/trade/afterSale/detail/index.vue | 3 ++- src/views/mall/trade/order/detail/index.vue | 7 ++++--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index 6f55b5738..80669c570 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -51,11 +51,10 @@ export interface OrderVO { avatar?: string } // 订单操作日志 - logs?: logs[] + logs?: OrderLogRespVO[] } -// TODO @puhui999:OrderLogRespVO 会不会更好哈。 -export interface logs { +export interface OrderLogRespVO { content?: string createTime?: Date userType?: number diff --git a/src/config/axios/service.ts b/src/config/axios/service.ts index bc6dbe731..1a4741b69 100644 --- a/src/config/axios/service.ts +++ b/src/config/axios/service.ts @@ -191,11 +191,6 @@ service.interceptors.response.use( } return Promise.reject('error') } else { - // TODO @puhui999:这个先不用支持哈; - // 前端处理 data 为 null 的情况,进行提示 - if (data.msg !== '') { - ElNotification.error({ title: msg }) - } return data } }, diff --git a/src/views/mall/trade/afterSale/detail/index.vue b/src/views/mall/trade/afterSale/detail/index.vue index d539dbe5c..a7bdf5ecf 100644 --- a/src/views/mall/trade/afterSale/detail/index.vue +++ b/src/views/mall/trade/afterSale/detail/index.vue @@ -195,7 +195,8 @@ const getDetail = async () => { if (id) { const res = await AfterSaleApi.getAfterSale(id) // 没有表单信息则关闭页面返回 - if (res === null) { + if (res == null) { + message.notifyError('售后订单不存在') close() } formData.value = res diff --git a/src/views/mall/trade/order/detail/index.vue b/src/views/mall/trade/order/detail/index.vue index d329b810d..40f2a6641 100644 --- a/src/views/mall/trade/order/detail/index.vue +++ b/src/views/mall/trade/order/detail/index.vue @@ -245,9 +245,10 @@ const { params } = useRoute() // 查询参数 const getDetail = async () => { const id = params.orderId as unknown as number if (id) { - const res = (await TradeOrderApi.getOrder(id)) as TradeOrderApi.OrderVO + const res = (await TradeOrderApi.getOrder(66666)) as TradeOrderApi.OrderVO // 没有表单信息则关闭页面返回 - if (res === null) { + if (res == null) { + message.error('交易订单不存在') close() } formData.value = res @@ -259,7 +260,7 @@ const { delView } = useTagsViewStore() // 视图操作 const { push, currentRoute } = useRouter() // 路由 const close = () => { delView(unref(currentRoute)) - push({ name: 'TradeAfterSale' }) + push({ name: 'TradeOrder' }) } /** 复制 */ -- Gitee From 615763d4156d04dded8281e905433a011b063ef5 Mon Sep 17 00:00:00 2001 From: puhui999 <puhui999@163.com> Date: Sat, 9 Sep 2023 23:08:28 +0800 Subject: [PATCH 3/4] =?UTF-8?q?order=EF=BC=9A=E5=AE=8C=E5=96=84=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E8=81=9A=E5=90=88=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/mall/trade/order/index.vue | 82 +++++++++++++++++----------- 1 file changed, 50 insertions(+), 32 deletions(-) diff --git a/src/views/mall/trade/order/index.vue b/src/views/mall/trade/order/index.vue index dec14eaa6..61037d646 100644 --- a/src/views/mall/trade/order/index.vue +++ b/src/views/mall/trade/order/index.vue @@ -104,13 +104,19 @@ <el-form-item label="聚合搜索"> <el-input v-show="true" - v-model="queryType.v" + v-model="queryParams[queryType.k]" class="!w-280px" clearable placeholder="请输入" > <template #prepend> - <el-select v-model="queryType.k" class="!w-110px" clearable placeholder="全部"> + <el-select + v-model="queryType.k" + class="!w-110px" + clearable + placeholder="全部" + @change="inputChangeSelect" + > <el-option v-for="dict in searchList" :key="dict.value" @@ -335,41 +341,41 @@ const total = ref(2) // 列表的总页数 const list = ref<TradeOrderApi.OrderVO[]>([]) // 列表的数据 const queryFormRef = ref<FormInstance>() // 搜索的表单 // 表单搜索 -const queryParams = reactive({ - pageNo: 1, //首页 - pageSize: 10, //页面大小 - no: '', - userId: '', - userNickname: '', - userMobile: '', - receiverName: '', - receiverMobile: '', - - terminal: '', - type: null, - status: null, - payChannelCode: '', - createTime: [], - deliveryType: null, - spuName: '', - itemCount: '', - pickUpStoreId: [], - logisticsId: null, - all: '' +const queryParams = ref({ + pageNo: 1, // 页数 + pageSize: 10, // 每页显示数量 + status: null, // 订单状态 + payChannelCode: null, // 支付方式 + createTime: null, // 创建时间 + terminal: null, // 订单来源 + type: null, // 订单类型 + deliveryType: null, // 配送方式 + logisticsId: null, // 快递公司 + pickUpStoreId: null // 自提门店 }) -const queryType = reactive({ k: '', v: '' }) // 订单搜索类型kv -/** - * 订单聚合搜索 - * 商品名称、商品件数、全部 - * - * 需要后端支持 TODO - */ +const queryType = reactive({ k: '' }) // 订单搜索类型 k + +// 订单聚合搜索 select 类型配置 const searchList = ref([ { value: 'no', label: '订单号' }, { value: 'userId', label: '用户UID' }, { value: 'userNickname', label: '用户昵称' }, { value: 'userMobile', label: '用户电话' } ]) +/** + * 聚合搜索切换查询对象时触发 + * @param val + */ +const inputChangeSelect = (val: string) => { + searchList.value + .filter((item) => item.value !== val) + ?.forEach((item1) => { + // 清除集合搜索无用属性 + if (queryParams.value.hasOwnProperty(item1.value)) { + delete queryParams.value[item1.value] + } + }) +} const headerStyle = ({ row, columnIndex }: any) => { // 表头第一行第一列占 8 @@ -417,7 +423,7 @@ const spanMethod = ({ row, rowIndex, columnIndex }: SpanMethodProps) => { const getList = async () => { loading.value = true try { - const data = await TradeOrderApi.getOrderPage(queryParams) + const data = await TradeOrderApi.getOrderPage(unref(queryParams)) list.value = data.list total.value = data.total } finally { @@ -427,13 +433,25 @@ const getList = async () => { /** 搜索按钮操作 */ const handleQuery = async () => { - queryParams.pageNo = 1 + queryParams.value.pageNo = 1 await getList() } /** 重置按钮操作 */ const resetQuery = () => { queryFormRef.value?.resetFields() + queryParams.value = { + pageNo: 1, // 页数 + pageSize: 10, // 每页显示数量 + status: null, // 订单状态 + payChannelCode: null, // 支付方式 + createTime: null, // 创建时间 + terminal: null, // 订单来源 + type: null, // 订单类型 + deliveryType: null, // 配送方式 + logisticsId: null, // 快递公司 + pickUpStoreId: null // 自提门店 + } handleQuery() } -- Gitee From 5dc0c6e3da8e7d200773d79cb31d699004b6cd6d Mon Sep 17 00:00:00 2001 From: puhui999 <puhui999@163.com> Date: Sat, 9 Sep 2023 23:14:02 +0800 Subject: [PATCH 4/4] =?UTF-8?q?spu=EF=BC=9A=E5=88=86=E4=BD=A3=E5=B1=9E?= =?UTF-8?q?=E6=80=A7=E5=92=8C=E5=88=86=E4=BD=A3=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/mall/product/spu.ts | 4 ++-- .../mall/product/spu/components/SkuList.vue | 20 +++++++++---------- .../mall/product/spu/form/BasicInfoForm.vue | 8 ++++---- src/views/mall/product/spu/form/index.vue | 16 +++++++-------- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/api/mall/product/spu.ts b/src/api/mall/product/spu.ts index 2ad9bc604..6c476b8c7 100644 --- a/src/api/mall/product/spu.ts +++ b/src/api/mall/product/spu.ts @@ -20,8 +20,8 @@ export interface Sku { stock?: number // 库存 weight?: number // 商品重量,单位:kg 千克 volume?: number // 商品体积,单位:m^3 平米 - subCommissionFirstPrice?: number | string // 一级分销的佣金 - subCommissionSecondPrice?: number | string // 二级分销的佣金 + firstBrokerageRecord?: number | string // 一级分销的佣金 + secondBrokerageRecord?: number | string // 二级分销的佣金 salesCount?: number // 商品销量 } diff --git a/src/views/mall/product/spu/components/SkuList.vue b/src/views/mall/product/spu/components/SkuList.vue index 81e2347db..fbbb96c86 100644 --- a/src/views/mall/product/spu/components/SkuList.vue +++ b/src/views/mall/product/spu/components/SkuList.vue @@ -80,7 +80,7 @@ <el-table-column align="center" label="一级返佣(元)" min-width="168"> <template #default="{ row }"> <el-input-number - v-model="row.subCommissionFirstPrice" + v-model="row.firstBrokerageRecord" :min="0" :precision="2" :step="0.1" @@ -91,7 +91,7 @@ <el-table-column align="center" label="二级返佣(元)" min-width="168"> <template #default="{ row }"> <el-input-number - v-model="row.subCommissionSecondPrice" + v-model="row.secondBrokerageRecord" :min="0" :precision="2" :step="0.1" @@ -181,12 +181,12 @@ <template v-if="formData!.subCommissionType"> <el-table-column align="center" label="一级返佣(元)" min-width="80"> <template #default="{ row }"> - {{ row.subCommissionFirstPrice }} + {{ row.firstBrokerageRecord }} </template> </el-table-column> <el-table-column align="center" label="二级返佣(元)" min-width="80"> <template #default="{ row }"> - {{ row.subCommissionSecondPrice }} + {{ row.secondBrokerageRecord }} </template> </el-table-column> </template> @@ -295,8 +295,8 @@ const skuList = ref<Sku[]>([ stock: 0, // 库存 weight: 0, // 商品重量 volume: 0, // 商品体积 - subCommissionFirstPrice: 0, // 一级分销的佣金 - subCommissionSecondPrice: 0 // 二级分销的佣金 + firstBrokerageRecord: 0, // 一级分销的佣金 + secondBrokerageRecord: 0 // 二级分销的佣金 } ]) // 批量添加时的临时数据 @@ -415,8 +415,8 @@ const generateTableData = (propertyList: any[]) => { stock: 0, weight: 0, volume: 0, - subCommissionFirstPrice: 0, - subCommissionSecondPrice: 0 + firstBrokerageRecord: 0, + secondBrokerageRecord: 0 } // 如果存在属性相同的 sku 则不做处理 const index = formData.value!.skus!.findIndex( @@ -491,8 +491,8 @@ watch( stock: 0, weight: 0, volume: 0, - subCommissionFirstPrice: 0, - subCommissionSecondPrice: 0 + firstBrokerageRecord: 0, + secondBrokerageRecord: 0 } ] } diff --git a/src/views/mall/product/spu/form/BasicInfoForm.vue b/src/views/mall/product/spu/form/BasicInfoForm.vue index c64260900..c12c76e9b 100644 --- a/src/views/mall/product/spu/form/BasicInfoForm.vue +++ b/src/views/mall/product/spu/form/BasicInfoForm.vue @@ -332,8 +332,8 @@ defineExpose({ validate }) const changeSubCommissionType = () => { // 默认为零,类型切换后也要重置为零 for (const item of formData.skus) { - item.subCommissionFirstPrice = 0 - item.subCommissionSecondPrice = 0 + item.firstBrokerageRecord = 0 + item.secondBrokerageRecord = 0 } } @@ -352,8 +352,8 @@ const onChangeSpec = () => { stock: 0, weight: 0, volume: 0, - subCommissionFirstPrice: 0, - subCommissionSecondPrice: 0 + firstBrokerageRecord: 0, + secondBrokerageRecord: 0 } ] } diff --git a/src/views/mall/product/spu/form/index.vue b/src/views/mall/product/spu/form/index.vue index 0ba7a6d82..e6364f5db 100644 --- a/src/views/mall/product/spu/form/index.vue +++ b/src/views/mall/product/spu/form/index.vue @@ -82,8 +82,8 @@ const formData = ref<ProductSpuApi.Spu>({ stock: 0, // 库存 weight: 0, // 商品重量 volume: 0, // 商品体积 - subCommissionFirstPrice: 0, // 一级分销的佣金 - subCommissionSecondPrice: 0 // 二级分销的佣金 + firstBrokerageRecord: 0, // 一级分销的佣金 + secondBrokerageRecord: 0 // 二级分销的佣金 } ], description: '', // 商品详情 @@ -112,15 +112,15 @@ const getDetail = async () => { item.price = floatToFixed2(item.price) item.marketPrice = floatToFixed2(item.marketPrice) item.costPrice = floatToFixed2(item.costPrice) - item.subCommissionFirstPrice = floatToFixed2(item.subCommissionFirstPrice) - item.subCommissionSecondPrice = floatToFixed2(item.subCommissionSecondPrice) + item.firstBrokerageRecord = floatToFixed2(item.firstBrokerageRecord) + item.secondBrokerageRecord = floatToFixed2(item.secondBrokerageRecord) } else { // 回显价格分转元 item.price = formatToFraction(item.price) item.marketPrice = formatToFraction(item.marketPrice) item.costPrice = formatToFraction(item.costPrice) - item.subCommissionFirstPrice = formatToFraction(item.subCommissionFirstPrice) - item.subCommissionSecondPrice = formatToFraction(item.subCommissionSecondPrice) + item.firstBrokerageRecord = formatToFraction(item.firstBrokerageRecord) + item.secondBrokerageRecord = formatToFraction(item.secondBrokerageRecord) } }) formData.value = res @@ -149,8 +149,8 @@ const submitForm = async () => { item.price = convertToInteger(item.price) item.marketPrice = convertToInteger(item.marketPrice) item.costPrice = convertToInteger(item.costPrice) - item.subCommissionFirstPrice = convertToInteger(item.subCommissionFirstPrice) - item.subCommissionSecondPrice = convertToInteger(item.subCommissionSecondPrice) + item.firstBrokerageRecord = convertToInteger(item.firstBrokerageRecord) + item.secondBrokerageRecord = convertToInteger(item.secondBrokerageRecord) }) // 处理轮播图列表 const newSliderPicUrls: any[] = [] -- Gitee