diff --git a/src/api/mall/trade/order/index.ts b/src/api/mall/trade/order/index.ts index d4a22944..b2e4001e 100644 --- a/src/api/mall/trade/order/index.ts +++ b/src/api/mall/trade/order/index.ts @@ -51,12 +51,13 @@ export interface OrderVO { avatar?: string } // 订单操作日志 - orderLog: orderLog[] + orderLog?: orderLog[] } export interface orderLog { content?: string createTime?: Date + userType?: number } export interface OrderItemRespVO { diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 6b163628..661d83a1 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -60,13 +60,20 @@ export const getBoolDictOptions = (dictType: string) => { return dictOption } -export const getDictObj = (dictType: string, value: any) => { +/** + * 获取指定字典类型的指定值对应的字典对象 + * @param dictType 字典类型 + * @param value 字典值 + * @return DictDataType 字典对象 + */ +export const getDictObj = (dictType: string, value: any): DictDataType | undefined => { const dictOptions: DictDataType[] = getDictOptions(dictType) - dictOptions.forEach((dict: DictDataType) => { - if (dict.value === value.toString()) { + console.log(dictOptions) + for (const dict of dictOptions) { + if (dict.value === value + '') { return dict } - }) + } } /** @@ -74,12 +81,13 @@ export const getDictObj = (dictType: string, value: any) => { * * @param dictType 字典类型 * @param value 字典数据的值 + * @return 字典名称 */ -export const getDictLabel = (dictType: string, value: any) => { +export const getDictLabel = (dictType: string, value: any): string => { const dictOptions: DictDataType[] = getDictOptions(dictType) const dictLabel = ref('') dictOptions.forEach((dict: DictDataType) => { - if (dict.value === value) { + if (dict.value === value + '') { dictLabel.value = dict.label } }) diff --git a/src/views/mall/trade/afterSale/detail/index.vue b/src/views/mall/trade/afterSale/detail/index.vue index 190a4b33..fa4d0f91 100644 --- a/src/views/mall/trade/afterSale/detail/index.vue +++ b/src/views/mall/trade/afterSale/detail/index.vue @@ -131,9 +131,7 @@ :timestamp="formatDate(saleLog.createTime)" placement="top" > - - 用户类型: - +
售后状态(之前): 操作明细:{{ saleLog.content }} - +
+ @@ -160,7 +166,7 @@