Commit e8cb1d1c by zhuzhequan

feat:刷新地址功能

parent 23e6429e
...@@ -556,6 +556,19 @@ export function changeToFinished(ids: string) { ...@@ -556,6 +556,19 @@ export function changeToFinished(ids: string) {
) )
} }
export function reissueOrderApi(ids: string) {
return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/reissueOrder`,
{ params: { ids } },
)
}
export function OrderCnReceiverAddress(idList: number[]) {
return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/syncReceiverAddress`,
idList,
)
}
// 转至已完成 // 转至已完成
export function updateTrackingNumberAndRegister( export function updateTrackingNumberAndRegister(
id: number, id: number,
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
:stripe="stripe" :stripe="stripe"
header-align="center" header-align="center"
height="100%" height="100%"
@row-click="rowClick"
v-bind="attrs" v-bind="attrs"
:class="internalIsMore ? 'is-more-active' : ''" :class="internalIsMore ? 'is-more-active' : ''"
@header-click="handleTableHeaderClick" @header-click="handleTableHeaderClick"
...@@ -88,6 +89,11 @@ const props = defineProps({ ...@@ -88,6 +89,11 @@ const props = defineProps({
type: Array, type: Array,
required: true, required: true,
}, },
rowClickSelect: {
type: Boolean,
required: false,
default: false,
},
columns: { columns: {
type: Array as PropType<CustomColumn<T>>, type: Array as PropType<CustomColumn<T>>,
required: true, required: true,
...@@ -127,7 +133,13 @@ const clearSelection = () => { ...@@ -127,7 +133,13 @@ const clearSelection = () => {
const toggleAllSelection = () => { const toggleAllSelection = () => {
tableRef.value?.toggleAllSelection() tableRef.value?.toggleAllSelection()
} }
const rowClick = (row:NonNullable<unknown>)=>{
console.log(row)
console.log(tableRef.value,props.rowClickSelect)
if(props.rowClickSelect){
tableRef.value?.toggleRowSelection(row,true)
}
}
const handleTableHeaderClick = (column: { type?: string }, event: Event) => { const handleTableHeaderClick = (column: { type?: string }, event: Event) => {
if (column.type === 'selection' && props.isMore) { if (column.type === 'selection' && props.isMore) {
event.preventDefault() event.preventDefault()
......
<script setup lang="ts"> <script setup lang="ts">
import { OrderCnReceiverAddress } from '@/api/podUsOrder.ts'
defineOptions({ defineOptions({
name: 'OrderTracking', name: 'OrderTracking',
}) })
...@@ -39,7 +41,8 @@ import { filePath } from '@/api/axios' ...@@ -39,7 +41,8 @@ import { filePath } from '@/api/axios'
import { convertToChinaTime } from '@/utils/index' import { convertToChinaTime } from '@/utils/index'
import { useValue } from '@/utils/hooks/useValue' import { useValue } from '@/utils/hooks/useValue'
import { ElFormItem } from 'element-plus'
const tabValue = ref('1')
const [searchForm, resetSearchForm] = useValue<SearchForm>({ const [searchForm, resetSearchForm] = useValue<SearchForm>({
timeType: 1, timeType: 1,
shopNumber: '', shopNumber: '',
...@@ -93,6 +96,12 @@ const tableColumns = computed(() => { ...@@ -93,6 +96,12 @@ const tableColumns = computed(() => {
align: 'center', align: 'center',
}, },
{ {
label: '是否代发',
slot: 'replaceShipment',
prop: 'replaceShipment',
width: 120,
align: 'center',
},{
label: '物流类型', label: '物流类型',
slot: 'shipmentType', slot: 'shipmentType',
prop: 'shipmentType', prop: 'shipmentType',
...@@ -367,6 +376,10 @@ const search = () => { ...@@ -367,6 +376,10 @@ const search = () => {
goodsData.value = [] goodsData.value = []
logList.value = [] logList.value = []
getOrderListFn() getOrderListFn()
if(tabValue.value==='2'){
zoneType.value = 'Asia/Shanghai'
operationLog()
}
} }
const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => { const getDateRange = (days = 0, type: 'past' | 'future' = 'past') => {
...@@ -428,10 +441,10 @@ const submitExportForm = async () => { ...@@ -428,10 +441,10 @@ const submitExportForm = async () => {
...params, ...params,
...(resourceType === 2 ...(resourceType === 2
? { ? {
...searchForm.value, ...searchForm.value,
startTime: timeRange.value?.[0] || null, startTime: timeRange.value?.[0] || null,
endTime: timeRange.value?.[1] || null, endTime: timeRange.value?.[1] || null,
} }
: {}), : {}),
}) })
ElMessage.success('请求成功,请稍后到右上角[我的下载]中查看') ElMessage.success('请求成功,请稍后到右上角[我的下载]中查看')
...@@ -551,6 +564,7 @@ const getOrderListFn = async () => { ...@@ -551,6 +564,7 @@ const getOrderListFn = async () => {
} }
} }
const currentRowId = ref<number>() const currentRowId = ref<number>()
function rowClick(row: PodCnOrderListData) { function rowClick(row: PodCnOrderListData) {
currentRowId.value = row.id currentRowId.value = row.id
goodsLoading.value = true goodsLoading.value = true
...@@ -560,6 +574,7 @@ function rowClick(row: PodCnOrderListData) { ...@@ -560,6 +574,7 @@ function rowClick(row: PodCnOrderListData) {
clearTimeout(timer) clearTimeout(timer)
}, 500) }, 500)
} }
const logLoading = ref(false) const logLoading = ref(false)
const operationLog = async () => { const operationLog = async () => {
logLoading.value = true logLoading.value = true
...@@ -614,10 +629,43 @@ const resultInfo = ref< ...@@ -614,10 +629,43 @@ const resultInfo = ref<
>([]) >([])
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null) const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const refreshAddress = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
await ElMessageBox.confirm('是否刷新地址?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await OrderCnReceiverAddress(
selection.value.map((item) => item.id),
)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
await loadTabData()
if(tabValue.value==='2'){
zoneType.value = 'Asia/Shanghai'
await operationLog()
}
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
/** /**
* @description: 获取打印面单 * @description: 获取打印面单
*/ */
const getOrderByIdApi = async (type: string) => { const getOrderByIdApi = async (type: string) => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
...@@ -681,6 +729,7 @@ const getOrderByIdApi = async (type: string) => { ...@@ -681,6 +729,7 @@ const getOrderByIdApi = async (type: string) => {
const tempChinaLogs = ref<LogListData[]>([]) const tempChinaLogs = ref<LogListData[]>([])
const zoneType = ref<string>('Asia/Shanghai') const zoneType = ref<string>('Asia/Shanghai')
function changeChinaTime(zone: string) { function changeChinaTime(zone: string) {
zoneType.value = zone zoneType.value = zone
logList.value = tempChinaLogs.value.map((el) => { logList.value = tempChinaLogs.value.map((el) => {
...@@ -780,21 +829,7 @@ onMounted(() => { ...@@ -780,21 +829,7 @@ onMounted(() => {
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="物流跟踪号"> <ElFormItem label="物流跟踪号">
<ElInput <ElInput
v-model.trim="searchForm.trackingNumber" v-model.trim="searchForm.trackingNumber"
...@@ -962,6 +997,37 @@ onMounted(() => { ...@@ -962,6 +997,37 @@ onMounted(() => {
style="width: 150px" style="width: 150px"
></ElInput> ></ElInput>
</ElFormItem> </ElFormItem>
<ElFormItem label="是否代发">
<ElSelect
v-model="searchForm.replaceShipment"
placeholder="是否代发"
clearable
:teleported="false"
style="width: 150px"
>
<ElOption
v-for="(item, index) in ['不代发', '代发']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem v-if="searchForm.replaceShipment || searchForm.replaceShipment===0" label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 150px"
>
<ElOption
v-for="(item, index) in searchForm.replaceShipment === 0? ['自提', '快递']:['自有物流', '工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<!-- <ElFormItem label="Base SKU"> <!-- <ElFormItem label="Base SKU">
<ElInput <ElInput
v-model.trim="searchForm.baseSku" v-model.trim="searchForm.baseSku"
...@@ -989,7 +1055,7 @@ onMounted(() => { ...@@ -989,7 +1055,7 @@ onMounted(() => {
<ElFormItem> <ElFormItem>
<span> <span>
<ElButton link @click="resetSearchForm" style="font-size: 12px" <ElButton link @click="resetSearchForm" style="font-size: 12px"
><span title="重置查询条件">重置</span></ElButton ><span title="重置查询条件">重置</span></ElButton
> >
</span> </span>
</ElFormItem> </ElFormItem>
...@@ -1001,7 +1067,14 @@ onMounted(() => { ...@@ -1001,7 +1067,14 @@ onMounted(() => {
<ElFormItem> <ElFormItem>
<span> <span>
<ElButton type="primary" @click="getOrderByIdApi('getPrintOrder')" <ElButton type="primary" @click="getOrderByIdApi('getPrintOrder')"
>获取打印面单</ElButton >获取打印面单</ElButton
>
</span>
</ElFormItem>
<ElFormItem>
<span>
<ElButton type="success" @click="refreshAddress"
>刷新地址</ElButton
> >
</span> </span>
</ElFormItem> </ElFormItem>
...@@ -1019,6 +1092,7 @@ onMounted(() => { ...@@ -1019,6 +1092,7 @@ onMounted(() => {
<div class="table-container"> <div class="table-container">
<TableView <TableView
ref="tableRef" ref="tableRef"
:row-click-select="true"
:columns="tableColumns" :columns="tableColumns"
:serial-numberable="true" :serial-numberable="true"
:selectionable="true" :selectionable="true"
...@@ -1031,7 +1105,10 @@ onMounted(() => { ...@@ -1031,7 +1105,10 @@ onMounted(() => {
<div>{{ getStatus(row.status) }}</div> <div>{{ getStatus(row.status) }}</div>
</template> </template>
<template #shipmentType="{ row }"> <template #shipmentType="{ row }">
{{ ['自有物流', '工厂物流'][row.shipmentType] }} {{ (row.replaceShipment === 0 ? ['自提', '快递'] : ['自有物流', '工厂物流'])[row.shipmentType] }}
</template>
<template #replaceShipment="{ row }">
{{['不代发', '代发'][row.replaceShipment] }}
</template> </template>
</TableView> </TableView>
</div> </div>
...@@ -1054,8 +1131,8 @@ onMounted(() => { ...@@ -1054,8 +1131,8 @@ onMounted(() => {
</template> </template>
<template #other> <template #other>
<div class="bottom-table"> <div class="bottom-table">
<el-tabs> <el-tabs v-model="tabValue">
<el-tab-pane label="商品明细"> <el-tab-pane name="1" label="商品明细">
<TableView <TableView
ref="goodsRef" ref="goodsRef"
v-loading="goodsLoading" v-loading="goodsLoading"
...@@ -1068,7 +1145,7 @@ onMounted(() => { ...@@ -1068,7 +1145,7 @@ onMounted(() => {
</template> </template>
</TableView> </TableView>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="操作日志" @tab-click="operationLog"> <el-tab-pane name="2" label="操作日志" @tab-click="operationLog">
<div> <div>
<el-button <el-button
:type="zoneType === 'Asia/Shanghai' ? 'primary' : ''" :type="zoneType === 'Asia/Shanghai' ? 'primary' : ''"
...@@ -1076,7 +1153,8 @@ onMounted(() => { ...@@ -1076,7 +1153,8 @@ onMounted(() => {
link link
style="margin-left: 10px" style="margin-left: 10px"
@click="changeChinaTime('Asia/Shanghai')" @click="changeChinaTime('Asia/Shanghai')"
>北京时间</el-button >北京时间
</el-button
> >
<el-button <el-button
:type="zoneType === 'America/New_York' ? 'primary' : ''" :type="zoneType === 'America/New_York' ? 'primary' : ''"
...@@ -1084,7 +1162,8 @@ onMounted(() => { ...@@ -1084,7 +1162,8 @@ onMounted(() => {
link link
style="margin-left: 10px" style="margin-left: 10px"
@click="changeChinaTime('America/New_York')" @click="changeChinaTime('America/New_York')"
>新泽西时间</el-button >新泽西时间
</el-button
> >
<el-button <el-button
:type="zoneType === 'America/Los_Angeles' ? 'primary' : ''" :type="zoneType === 'America/Los_Angeles' ? 'primary' : ''"
...@@ -1092,7 +1171,8 @@ onMounted(() => { ...@@ -1092,7 +1171,8 @@ onMounted(() => {
link link
style="margin-left: 10px" style="margin-left: 10px"
@click="changeChinaTime('America/Los_Angeles')" @click="changeChinaTime('America/Los_Angeles')"
>洛杉矶时间</el-button >洛杉矶时间
</el-button
> >
</div> </div>
...@@ -1128,7 +1208,7 @@ onMounted(() => { ...@@ -1128,7 +1208,7 @@ onMounted(() => {
:loading="exportLoading" :loading="exportLoading"
type="primary" type="primary"
@click="submitExportForm" @click="submitExportForm"
>确认</el-button >确认</el-button
> >
</span> </span>
</template> </template>
...@@ -1223,9 +1303,11 @@ onMounted(() => { ...@@ -1223,9 +1303,11 @@ onMounted(() => {
} }
} }
} }
.search-form { .search-form {
::v-deep .el-radio-button { ::v-deep .el-radio-button {
width: 75px; width: 75px;
.el-radio-button__inner { .el-radio-button__inner {
width: 100%; width: 100%;
} }
......
...@@ -26,31 +26,7 @@ ...@@ -26,31 +26,7 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台">
<ElSelect
v-model="searchForm.platform"
value-key=""
placeholder="请选择"
clearable
filterable
popper-class="customize-select-style"
style="width: 150px"
>
<ElOption
v-for="(item, index) in platformJson"
:key="index"
:label="item.type"
:value="item.type"
style="width: 160px"
>
<img
:src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0"
/>
<span :title="item.type">{{ item.type }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem label="工艺"> <ElFormItem label="工艺">
<LogisticsWaySelect <LogisticsWaySelect
...@@ -117,6 +93,31 @@ ...@@ -117,6 +93,31 @@
></el-option> ></el-option>
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<ElFormItem label="平台">
<ElSelect
v-model="searchForm.platform"
value-key=""
placeholder="请选择"
clearable
filterable
popper-class="customize-select-style"
style="width: 150px"
>
<ElOption
v-for="(item, index) in platformJson"
:key="index"
:label="item.type"
:value="item.type"
style="width: 160px"
>
<img
:src="`/images/icon/${item.icon.split('/').pop()}`"
style="height: 20px; margin: 5px 10px 0 0"
/>
<span :title="item.type">{{ item.type }}</span>
</ElOption>
</ElSelect>
</ElFormItem>
<!-- </div> --> <!-- </div> -->
<ElFormItem label="类型"> <ElFormItem label="类型">
<el-radio-group <el-radio-group
...@@ -821,6 +822,11 @@ ...@@ -821,6 +822,11 @@
> >
</span> </span>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="['WAIT_TRACK'].includes(status) && waitTrackStatus === 5">
<span class="item">
<ElButton type="success" @click="reissueOrder">补发</ElButton>
</span>
</ElFormItem>
</ElForm> </ElForm>
</div> </div>
<div class="header-filter-tab"> <div class="header-filter-tab">
...@@ -2954,6 +2960,7 @@ import { ...@@ -2954,6 +2960,7 @@ import {
getCustomTagListApi, getCustomTagListApi,
getLogisticsWayApi, getLogisticsWayApi,
printNormalPickPdfApi, printNormalPickPdfApi,
reissueOrderApi
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -6230,6 +6237,34 @@ const setFinish = async () => { ...@@ -6230,6 +6237,34 @@ const setFinish = async () => {
loading.close() loading.close()
} }
} }
const reissueOrder = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
await ElMessageBox.confirm('是否补发?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await reissueOrderApi(
selection.value.map((item) => item.id).join(','),
)
if (res.code !== 200) return
ElMessage.success('操作成功')
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
// 完成发货 // 完成发货
const completeDelivery = async () => { const completeDelivery = async () => {
......
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