Commit cacd6eec by zhuzhequan

添加刷新商品信息功能

parent 1b645dcf
...@@ -2,7 +2,7 @@ import { BasePaginationData, BaseRespData } from '@/types/api' ...@@ -2,7 +2,7 @@ import { BasePaginationData, BaseRespData } from '@/types/api'
import axios from './axios' import axios from './axios'
import { import {
LogListData, LogListData,
OrderData, OrderData, Refresh,
SearchForm, SearchForm,
SendOrderData, SendOrderData,
ShipmentForm, ShipmentForm,
...@@ -136,3 +136,10 @@ export function cancelOrderApi(id: number) { ...@@ -136,3 +136,10 @@ export function cancelOrderApi(id: number) {
{ id }, { id },
) )
} }
export function refreshProductInfo(data: Refresh[]) {
return axios.post<never, BaseRespData<never>>(
'factory/customJomallOrder/refreshProductInfo',
data,
)
}
...@@ -16,6 +16,11 @@ export interface Tab { ...@@ -16,6 +16,11 @@ export interface Tab {
quantity: number quantity: number
} }
export interface Refresh {
id: number
}
export interface OrderData { export interface OrderData {
id: number id: number
namespace?: string namespace?: string
......
...@@ -112,6 +112,11 @@ ...@@ -112,6 +112,11 @@
>添加内部标签</ElButton >添加内部标签</ElButton
> >
</span> </span>
<span v-if="statusCode === 2 || statusCode === 3|| statusCode === 4" class="item">
<ElButton type="primary" @click="refreshProduct"
>刷新商品信息</ElButton
>
</span>
<span v-if="statusCode === 3 || statusCode === 4" class="item"> <span v-if="statusCode === 3 || statusCode === 4" class="item">
<ElButton type="success" @click="confirmDelivery">发货</ElButton> <ElButton type="success" @click="confirmDelivery">发货</ElButton>
</span> </span>
...@@ -240,7 +245,8 @@ ...@@ -240,7 +245,8 @@
<div class="order-operate_info"> <div class="order-operate_info">
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<ElButton text type="primary" @click="openDetail(row.id)" <ElButton text type="primary" @click="openDetail(row.id)"
>查看详情</ElButton >查看详情
</ElButton
> >
</div> </div>
<div <div
...@@ -251,13 +257,15 @@ ...@@ -251,13 +257,15 @@
text text
type="primary" type="primary"
@click="openShipment(row.id)" @click="openShipment(row.id)"
>查看发货单</ElButton >查看发货单
</ElButton
> >
</div> </div>
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<ElButton text type="primary" @click="openLog(row.id)" <ElButton text type="primary" @click="openLog(row.id)"
>操作日志</ElButton >操作日志
</ElButton
> >
</div> </div>
<div <div
...@@ -265,7 +273,8 @@ ...@@ -265,7 +273,8 @@
class="order-list-expand_item_info_title" class="order-list-expand_item_info_title"
> >
<ElButton text type="danger" @click="cancelOrder(row.id)" <ElButton text type="danger" @click="cancelOrder(row.id)"
>取消</ElButton >取消
</ElButton
> >
</div> </div>
</div> </div>
...@@ -371,7 +380,8 @@ ...@@ -371,7 +380,8 @@
type="primary" type="primary"
size="large" size="large"
@click="searchShipmentByOrderNumber" @click="searchShipmentByOrderNumber"
>查询</el-button >查询
</el-button
> >
</div> </div>
<Shipment <Shipment
...@@ -439,10 +449,12 @@ ...@@ -439,10 +449,12 @@
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button size="large" @click="shipmentVisible = false" <el-button size="large" @click="shipmentVisible = false"
>取消</el-button >取消
</el-button
> >
<el-button size="large" type="primary" @click="saveShipment" <el-button size="large" type="primary" @click="saveShipment"
>发货</el-button >发货
</el-button
> >
</div> </div>
</template> </template>
...@@ -502,7 +514,7 @@ import { ...@@ -502,7 +514,7 @@ import {
getLogList, getLogList,
getOrderDetail, getOrderDetail,
cancelOrderApi, cancelOrderApi,
reGenerateScriptUrlApi, reGenerateScriptUrlApi, refreshProductInfo,
} from '@/api/order' } from '@/api/order'
import { showError, showConfirm } from '@/utils/ui' import { showError, showConfirm } from '@/utils/ui'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
...@@ -770,6 +782,36 @@ const exportManuscript = async () => { ...@@ -770,6 +782,36 @@ const exportManuscript = async () => {
showError(e) showError(e)
} }
} }
const refreshProduct = async () => {
if (selection.value.length === 0) {
return ElMessage({
message: '请选择订单',
type: 'warning',
offset: window.innerHeight / 2,
})
}
try {
await showConfirm('是否刷新商品信息', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const res = await refreshProductInfo(selection.value.map(el => {
return {
id: el.id,
}
}))
ElMessage({
message: res.message,
type: 'success',
offset: window.innerHeight / 2,
})
await loadTabData()
search()
}
// 添加内部便签 // 添加内部便签
const addInternalTag = async () => { const addInternalTag = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
...@@ -860,6 +902,7 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -860,6 +902,7 @@ const onChangeCurrentRow = (item: ProductList) => {
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.header-filter-tab { .header-filter-tab {
margin-top: 10px; margin-top: 10px;
} }
...@@ -897,12 +940,15 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -897,12 +940,15 @@ const onChangeCurrentRow = (item: ProductList) => {
.order-list { .order-list {
margin-top: 10px; margin-top: 10px;
flex: 1; flex: 1;
:deep(.el-table__expand-icon > .el-icon) { :deep(.el-table__expand-icon > .el-icon) {
display: none; display: none;
} }
:deep(.el-table__row) { :deep(.el-table__row) {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
:deep(.el-table__expanded-cell) { :deep(.el-table__expanded-cell) {
padding: 0; padding: 0;
} }
...@@ -917,10 +963,12 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -917,10 +963,12 @@ const onChangeCurrentRow = (item: ProductList) => {
flex: 1; flex: 1;
display: flex; display: flex;
align-items: center; align-items: center;
.label { .label {
color: #aaa; color: #aaa;
margin-right: 6px; margin-right: 6px;
} }
.value { .value {
color: #000; color: #000;
flex: 1; flex: 1;
...@@ -933,6 +981,7 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -933,6 +981,7 @@ const onChangeCurrentRow = (item: ProductList) => {
.table-expand { .table-expand {
display: flex; display: flex;
} }
.order-operate { .order-operate {
width: 100px; width: 100px;
} }
...@@ -983,6 +1032,7 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -983,6 +1032,7 @@ const onChangeCurrentRow = (item: ProductList) => {
.order-list-expand_more { .order-list-expand_more {
text-align: center; text-align: center;
padding: 10px 0; padding: 10px 0;
span { span {
cursor: pointer; cursor: pointer;
} }
...@@ -995,6 +1045,7 @@ const onChangeCurrentRow = (item: ProductList) => { ...@@ -995,6 +1045,7 @@ const onChangeCurrentRow = (item: ProductList) => {
.order-operate_info { .order-operate_info {
padding: 20px; padding: 20px;
:deep(.el-button) { :deep(.el-button) {
padding: 0; padding: 0;
font-size: 14px; font-size: 14px;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment