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
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
class="item" class="item"
> >
<ElButton type="warning" is-dark @click="downloadManuscript" <ElButton type="warning" is-dark @click="downloadManuscript"
>下载稿件</ElButton >下载稿件</ElButton
> >
</span> </span>
<span <span
...@@ -94,22 +94,27 @@ ...@@ -94,22 +94,27 @@
class="item" class="item"
> >
<ElButton type="success" is-dark @click="reGenerateManuscript" <ElButton type="success" is-dark @click="reGenerateManuscript"
>重新下载稿件</ElButton >重新下载稿件</ElButton
> >
</span> </span>
<span v-if="statusCode === 2 || statusCode === 3" class="item"> <span v-if="statusCode === 2 || statusCode === 3" class="item">
<ElButton type="primary" dark @click="printManuscript" <ElButton type="primary" dark @click="printManuscript"
>打印生产单</ElButton >打印生产单</ElButton
> >
</span> </span>
<span v-if="statusCode === 2" class="item"> <span v-if="statusCode === 2" class="item">
<ElButton type="success" dark @click="exportManuscript" <ElButton type="success" dark @click="exportManuscript"
>导出生产单</ElButton >导出生产单</ElButton
> >
</span> </span>
<span class="item"> <span class="item">
<ElButton type="warning" @click="addInternalTag" <ElButton type="warning" @click="addInternalTag"
>添加内部标签</ElButton >添加内部标签</ElButton
>
</span>
<span v-if="statusCode === 2 || statusCode === 3|| statusCode === 4" class="item">
<ElButton type="primary" @click="refreshProduct"
>刷新商品信息</ElButton
> >
</span> </span>
<span v-if="statusCode === 3 || statusCode === 4" class="item"> <span v-if="statusCode === 3 || statusCode === 4" class="item">
...@@ -144,14 +149,14 @@ ...@@ -144,14 +149,14 @@
<span @click="openAll(row)"> <span @click="openAll(row)">
<template v-if="!row.moreable"> <template v-if="!row.moreable">
展开全部<strong style="color: red" 展开全部<strong style="color: red"
>({{ row.productList.length }})</strong >({{ row.productList.length }})</strong
>条商品信息<el-icon style="vertical-align: middle" >条商品信息<el-icon style="vertical-align: middle"
><ArrowDown /></el-icon ><ArrowDown /></el-icon
></template> ></template>
<template v-else> <template v-else>
收起商品信息<el-icon style="vertical-align: middle" 收起商品信息<el-icon style="vertical-align: middle"
><ArrowUp ><ArrowUp
/></el-icon> /></el-icon>
</template> </template>
</span> </span>
</div> </div>
...@@ -162,22 +167,22 @@ ...@@ -162,22 +167,22 @@
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">商品价:</span> <span class="order-list-expand_item_label">商品价:</span>
<span class="order-list-expand_item_value">{{ <span class="order-list-expand_item_value">{{
row.productAmount row.productAmount
}}</span> }}</span>
</div> </div>
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label">小计:</span> <span class="order-list-expand_item_label">小计:</span>
<span class="order-list-expand_item_value">{{ <span class="order-list-expand_item_value">{{
row.totalAmount || '--' row.totalAmount || '--'
}}</span> }}</span>
</div> </div>
<div <div
v-if="row.totolBuyNumber" v-if="row.totolBuyNumber"
class="order-list-expand_item_info_title" class="order-list-expand_item_info_title"
> >
<span class="order-list-expand_item_value" <span class="order-list-expand_item_value"
>{{ row.totolBuyNumber }}</span >{{ row.totolBuyNumber }}</span
> >
</div> </div>
</div> </div>
...@@ -211,27 +216,27 @@ ...@@ -211,27 +216,27 @@
<div class="order-time_info"> <div class="order-time_info">
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label" <span class="order-list-expand_item_label"
>创建时间:</span >创建时间:</span
> >
<span class="order-list-expand_item_value">{{ <span class="order-list-expand_item_value">{{
row.createTime || '--' row.createTime || '--'
}}</span> }}</span>
</div> </div>
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label" <span class="order-list-expand_item_label"
>确认时间:</span >确认时间:</span
> >
<span class="order-list-expand_item_value">{{ <span class="order-list-expand_item_value">{{
row.startStockingTime || '--' row.startStockingTime || '--'
}}</span> }}</span>
</div> </div>
<div class="order-list-expand_item_info_title"> <div class="order-list-expand_item_info_title">
<span class="order-list-expand_item_label" <span class="order-list-expand_item_label"
>完成时间:</span >完成时间:</span
> >
<span class="order-list-expand_item_value">{{ <span class="order-list-expand_item_value">{{
row.finishTime || '--' row.finishTime || '--'
}}</span> }}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -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>
...@@ -288,14 +297,14 @@ ...@@ -288,14 +297,14 @@
<div class="order-detail_item"> <div class="order-detail_item">
<span class="label">第三方订单号:</span> <span class="label">第三方订单号:</span>
<span class="value" :title="scope.row.erpOrderNumber">{{ <span class="value" :title="scope.row.erpOrderNumber">{{
scope.row.erpOrderNumber || '--' scope.row.erpOrderNumber || '--'
}}</span> }}</span>
</div> </div>
<div class="order-detail_item"> <div class="order-detail_item">
<span class="label">稿件下载状态:</span> <span class="label">稿件下载状态:</span>
<span class="value" :title="scope.row.manuscriptStatusStr">{{ <span class="value" :title="scope.row.manuscriptStatusStr">{{
scope.row.manuscriptStatusStr || '--' scope.row.manuscriptStatusStr || '--'
}}</span> }}</span>
</div> </div>
<div class="order-detail_item"> <div class="order-detail_item">
<span class="label">收货人:</span> <span class="label">收货人:</span>
...@@ -308,8 +317,8 @@ ...@@ -308,8 +317,8 @@
<div class="order-detail_item"> <div class="order-detail_item">
<span class="label">收货地址:</span> <span class="label">收货地址:</span>
<span class="value" :title="scope.row.lanshouAddress">{{ <span class="value" :title="scope.row.lanshouAddress">{{
scope.row.lanshouAddress scope.row.lanshouAddress
}}</span> }}</span>
</div> </div>
<div class="order-detail_item"> <div class="order-detail_item">
<span class="label">邮编:</span> <span class="label">邮编:</span>
...@@ -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