!240 完善前端 mall-order 模块相关问题

Merge pull request !240 from puhui999/dev-to-dev
This commit is contained in:
芋道源码 2023-09-12 15:08:34 +00:00 committed by Gitee
commit ef15261926
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
10 changed files with 86 additions and 75 deletions

View File

@ -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 // 商品销量
}

View File

@ -51,11 +51,10 @@ export interface OrderVO {
avatar?: string
}
// 订单操作日志
logs?: logs[]
logs?: OrderLogRespVO[]
}
// TODO @puhui999OrderLogRespVO 会不会更好哈。
export interface logs {
export interface OrderLogRespVO {
content?: string
createTime?: Date
userType?: number

View File

@ -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
}
},

View File

@ -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()
}
}

View File

@ -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
}
]
}

View File

@ -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
}
]
}

View File

@ -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[] = []

View File

@ -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

View File

@ -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' })
}
/** 复制 */

View File

@ -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()
}