code review:订单列表

This commit is contained in:
YunaiV 2023-09-01 20:03:08 +08:00
parent 22d95fa0ac
commit 0743e4941c
3 changed files with 15 additions and 20 deletions

View File

@ -142,17 +142,6 @@ const submitForm = async () => {
await unref(otherSettingsRef)?.validate() await unref(otherSettingsRef)?.validate()
// , server // , server
const deepCopyFormData = cloneDeep(unref(formData.value)) as ProductSpuApi.Spu const deepCopyFormData = cloneDeep(unref(formData.value)) as ProductSpuApi.Spu
// sku TODO
// formData.value.skus!.forEach((sku) => {
// //
// if (sku.barCode === '') {
// const index = deepCopyFormData.skus!.findIndex(
// (item) => JSON.stringify(item.properties) === JSON.stringify(sku.properties)
// )
// // sku
// deepCopyFormData.skus!.splice(index, 1)
// }
// })
deepCopyFormData.skus!.forEach((item) => { deepCopyFormData.skus!.forEach((item) => {
// sku name // sku name
item.name = deepCopyFormData.name item.name = deepCopyFormData.name

View File

@ -166,7 +166,7 @@ import UpdateAuditReasonForm from '@/views/mall/trade/afterSale/form/AfterSaleDi
import { createImageViewer } from '@/components/ImageViewer' import { createImageViewer } from '@/components/ImageViewer'
import { isArray } from '@/utils/is' import { isArray } from '@/utils/is'
defineOptions({ name: 'TradeOrderDetailForm' }) defineOptions({ name: 'TradeAfterSaleDetail' })
const { t } = useI18n() // const { t } = useI18n() //
const message = useMessage() // const message = useMessage() //

View File

@ -23,7 +23,7 @@
<dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.payChannelCode!" /> <dict-tag :type="DICT_TYPE.PAY_CHANNEL_CODE" :value="formData.payChannelCode!" />
</el-descriptions-item> </el-descriptions-item>
<!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> --> <!-- <el-descriptions-item label="买家: ">{{ formData.user.nickname }}</el-descriptions-item> -->
<!-- TODO 芋艿待实现跳转会员 --> <!-- TODO @puhui999待实现跳转会员 -->
<el-descriptions-item label="收货地址: "> <el-descriptions-item label="收货地址: ">
{{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }} {{ formData.receiverAreaName }} {{ formData.receiverDetailAddress }}
<el-link <el-link
@ -40,6 +40,7 @@
<el-descriptions-item label="订单状态: "> <el-descriptions-item label="订单状态: ">
<dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.status!" /> <dict-tag :type="DICT_TYPE.TRADE_ORDER_STATUS" :value="formData.status!" />
</el-descriptions-item> </el-descriptions-item>
<!-- TODO @puhui999根据状态进行展示按钮 -->
<el-descriptions-item label-class-name="no-colon"> <el-descriptions-item label-class-name="no-colon">
<el-button type="primary" @click="openForm('updatePrice')">调整价格</el-button> <el-button type="primary" @click="openForm('updatePrice')">调整价格</el-button>
<el-button type="primary" @click="openForm('remark')">备注</el-button> <el-button type="primary" @click="openForm('remark')">备注</el-button>
@ -179,15 +180,16 @@ import OrderUpdateAddressForm from '@/views/mall/trade/order/form/OrderUpdateAdd
import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue' import OrderUpdatePriceForm from '@/views/mall/trade/order/form/OrderUpdatePriceForm.vue'
import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express' import * as DeliveryExpressApi from '@/api/mall/trade/delivery/express'
defineOptions({ name: 'TradeOrderDetailForm' }) defineOptions({ name: 'TradeOrderDetail' })
const message = useMessage() // const message = useMessage() //
const { params } = useRoute() //
// //
const formData = ref<TradeOrderApi.OrderVO>({ const formData = ref<TradeOrderApi.OrderVO>({
orderLog: [] orderLog: [] // TODO @puhui999orderLogs
}) })
// TODO @puhui999
const deliveryFormRef = ref() // Ref const deliveryFormRef = ref() // Ref
const updateRemarkForm = ref() // Ref const updateRemarkForm = ref() // Ref
const updateAddressFormRef = ref() // Ref const updateAddressFormRef = ref() // Ref
@ -210,6 +212,7 @@ const openForm = (type: string) => {
} }
/** 获得详情 */ /** 获得详情 */
const { params } = useRoute() //
const getDetail = async () => { const getDetail = async () => {
const id = params.orderId as unknown as number const id = params.orderId as unknown as number
if (id) { if (id) {
@ -217,6 +220,13 @@ const getDetail = async () => {
formData.value = res formData.value = res
} }
} }
/** 复制 */
const clipboardSuccess = () => {
message.success('复制成功')
}
/** 初始化 **/
const deliveryExpressList = ref([]) // const deliveryExpressList = ref([]) //
const expressTrackList = ref([]) // const expressTrackList = ref([]) //
onMounted(async () => { onMounted(async () => {
@ -224,10 +234,6 @@ onMounted(async () => {
deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList() deliveryExpressList.value = await DeliveryExpressApi.getSimpleDeliveryExpressList()
expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!) expressTrackList.value = await TradeOrderApi.getExpressTrackList(formData.value.id!)
}) })
const clipboardSuccess = () => {
message.success('复制成功')
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
:deep(.el-descriptions) { :deep(.el-descriptions) {