Commit 95a49edc by linjinhong

Merge remote-tracking branch 'origin/master' into linjinhong

parents b3d0599d 7190baff
...@@ -59,13 +59,13 @@ declare module 'vue' { ...@@ -59,13 +59,13 @@ declare module 'vue' {
LogList: typeof import('./src/components/LogList.vue')['default'] LogList: typeof import('./src/components/LogList.vue')['default']
NavMenu: typeof import('./src/components/NavMenu.vue')['default'] NavMenu: typeof import('./src/components/NavMenu.vue')['default']
RenderColumn: typeof import('./src/components/RenderColumn.vue')['default'] RenderColumn: typeof import('./src/components/RenderColumn.vue')['default']
RightClickMenu: typeof import('./src/components/RightClickMenu.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink'] RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView'] RouterView: typeof import('vue-router')['RouterView']
Select: typeof import('./src/components/Form/Select.vue')['default'] Select: typeof import('./src/components/Form/Select.vue')['default']
ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default'] ShipmentOrderDetail: typeof import('./src/components/ShipmentOrderDetail.vue')['default']
SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default'] SplitDiv: typeof import('./src/components/splitDiv/splitDiv.vue')['default']
'Switch ': typeof import('./src/components/Form/Switch .vue')['default'] 'Switch ': typeof import('./src/components/Form/Switch .vue')['default']
TableRightClickMenu: typeof import('./src/components/TableRightClickMenu.vue')['default']
TableView: typeof import('./src/components/TableView.vue')['default'] TableView: typeof import('./src/components/TableView.vue')['default']
UploadExcel: typeof import('./src/components/UploadExcel.vue')['default'] UploadExcel: typeof import('./src/components/UploadExcel.vue')['default']
UploadImage: typeof import('./src/components/UploadImage.vue')['default'] UploadImage: typeof import('./src/components/UploadImage.vue')['default']
......
...@@ -4,7 +4,7 @@ import { showError } from '@/utils/ui.ts' ...@@ -4,7 +4,7 @@ import { showError } from '@/utils/ui.ts'
const axios = Axios.create({ const axios = Axios.create({
baseURL: import.meta.env.VITE_API_BASE, baseURL: import.meta.env.VITE_API_BASE,
timeout: 30000, timeout: 300000, //凯哥让改的超时时间
}) })
const TOKEN_KEY = 'token' const TOKEN_KEY = 'token'
......
...@@ -10,6 +10,20 @@ import { ...@@ -10,6 +10,20 @@ import {
} from '@/types/api/podUsOrder' } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
import { PodMakeOrderData } from '@/types/api/podMakeOrder' import { PodMakeOrderData } from '@/types/api/podMakeOrder'
export interface AddressInfo {
id?:string
receiverName: string,
receiverPhone: string,
receiverCountry: string,
receiverProvince: string,
receiverCity: string,
receiverDistrict: string,
receiverAddress1: string,
receiverAddress2: string,
receiverPostCode: string,
}
export interface LogisticsData { export interface LogisticsData {
logisticsWayName: string // 物流名称 logisticsWayName: string // 物流名称
warehouseName: string // 发货仓库 warehouseName: string // 发货仓库
...@@ -18,11 +32,13 @@ export interface LogisticsData { ...@@ -18,11 +32,13 @@ export interface LogisticsData {
partition: string // 所在分区 partition: string // 所在分区
logisticsWayId?: number | null logisticsWayId?: number | null
} }
export function getOrderTabData() { export function getOrderTabData() {
return axios.get<never, BaseRespData<Tab[]>>( return axios.get<never, BaseRespData<Tab[]>>(
'/factory/podJomallOrderUs/findStateGroupList', '/factory/podJomallOrderUs/findStateGroupList',
) )
} }
export function getOrderList( export function getOrderList(
params: SearchForm, params: SearchForm,
currentPage: number, currentPage: number,
...@@ -37,12 +53,14 @@ export function getOrderList( ...@@ -37,12 +53,14 @@ export function getOrderList(
}, },
) )
} }
export function handleExceptionOrderApi(orderIds: number[]) { export function handleExceptionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/processExceptionOrders', 'factory/podJomallOrderUs/processExceptionOrders',
orderIds, orderIds,
) )
} }
export function getCardOrderList( export function getCardOrderList(
params: SearchForm, params: SearchForm,
currentPage: number, currentPage: number,
...@@ -57,6 +75,7 @@ export function getCardOrderList( ...@@ -57,6 +75,7 @@ export function getCardOrderList(
}, },
) )
} }
export function confirmOrderApi( export function confirmOrderApi(
data: number[], data: number[],
productionClient: string, productionClient: string,
...@@ -73,11 +92,13 @@ export function confirmOrderApi( ...@@ -73,11 +92,13 @@ export function confirmOrderApi(
}, },
) )
} }
export function getProductionClientApi() { export function getProductionClientApi() {
return axios.get<never, BaseRespData<ProductionClient[]>>( return axios.get<never, BaseRespData<ProductionClient[]>>(
'factory/podJomallOrderUs/getProductionClientList', 'factory/podJomallOrderUs/getProductionClientList',
) )
} }
export function updateExceptionOrderApi(data: number[]) { export function updateExceptionOrderApi(data: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateExceptionOrders', 'factory/podJomallOrderUs/updateExceptionOrders',
...@@ -86,6 +107,15 @@ export function updateExceptionOrderApi(data: number[]) { ...@@ -86,6 +107,15 @@ export function updateExceptionOrderApi(data: number[]) {
}, },
) )
} }
// 同步收货地址
export function syncReceiverAddress(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
data,
)
}
export function changeExceptionOrderApi( export function changeExceptionOrderApi(
url: string, url: string,
ids: number[], ids: number[],
...@@ -98,6 +128,7 @@ export function changeExceptionOrderApi( ...@@ -98,6 +128,7 @@ export function changeExceptionOrderApi(
exceptionReason: value, exceptionReason: value,
}) })
} }
export function cancelOrderApi(ids: number[], value: string) { export function cancelOrderApi(ids: number[], value: string) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/cancelOrders', 'factory/podJomallOrderUs/cancelOrders',
...@@ -107,11 +138,13 @@ export function cancelOrderApi(ids: number[], value: string) { ...@@ -107,11 +138,13 @@ export function cancelOrderApi(ids: number[], value: string) {
}, },
) )
} }
export function getOperationLogApi(id: number) { export function getOperationLogApi(id: number) {
return axios.get<never, BaseRespData<LogListData[]>>( return axios.get<never, BaseRespData<LogListData[]>>(
`factory/podJomallOrderUsLog/getPodJomallOrderUsLog?id=${id}`, `factory/podJomallOrderUsLog/getPodJomallOrderUsLog?id=${id}`,
) )
} }
export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) { export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
return axios.get<never, BaseRespData<ProductList>>( return axios.get<never, BaseRespData<ProductList>>(
'factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber', 'factory/podJomallOrderProductUs/getProductUsByFactorySubOrderNumber',
...@@ -122,12 +155,14 @@ export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) { ...@@ -122,12 +155,14 @@ export function getSubOrderBySubOrderNumber(factorySubOrderNumber: string) {
}, },
) )
} }
export function downloadMaterialApi(id: number[]) { export function downloadMaterialApi(id: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/downloadDesignImages', 'factory/podJomallOrderProductUs/downloadDesignImages',
id, id,
) )
} }
export function productionQueryApi(id: number, podJomallOrderUsId: number) { export function productionQueryApi(id: number, podJomallOrderUsId: number) {
return axios.post<never, BasePaginationData<never>>( return axios.post<never, BasePaginationData<never>>(
'factory/podJomallOrderProductUs/completeDelivery', 'factory/podJomallOrderProductUs/completeDelivery',
...@@ -137,12 +172,14 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) { ...@@ -137,12 +172,14 @@ export function productionQueryApi(id: number, podJomallOrderUsId: number) {
}, },
) )
} }
export function printProductionOrderApi(orderIds: number[]) { export function printProductionOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printProducePdf', 'factory/podJomallOrderUs/printProducePdf',
orderIds, orderIds,
) )
} }
export function printPrintOrderApi(orderIds: number[]) { export function printPrintOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/printPickPdf', 'factory/podJomallOrderUs/printPickPdf',
...@@ -151,6 +188,7 @@ export function printPrintOrderApi(orderIds: number[]) { ...@@ -151,6 +188,7 @@ export function printPrintOrderApi(orderIds: number[]) {
}, },
) )
} }
export function printPickingOrderApi(orderIds: number[]) { export function printPickingOrderApi(orderIds: number[]) {
return axios.post<never, BaseRespData<string>>( return axios.post<never, BaseRespData<string>>(
'factory/podJomallOrderUs/pickingComplete', 'factory/podJomallOrderUs/pickingComplete',
...@@ -159,11 +197,13 @@ export function printPickingOrderApi(orderIds: number[]) { ...@@ -159,11 +197,13 @@ export function printPickingOrderApi(orderIds: number[]) {
}, },
) )
} }
export function stockOutCheckApi(orderIds: number[]) { export function stockOutCheckApi(orderIds: number[]) {
return axios.get<never, BaseRespData<number[]>>( return axios.get<never, BaseRespData<number[]>>(
`factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`, `factory/podJomallOrderUs/replenishVerify?ids=${orderIds.join(',')}`,
) )
} }
export function toBePickingApi(orderIds: number[]) { export function toBePickingApi(orderIds: number[]) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
`factory/podJomallOrderUs/updateStockOutOrderToPicking?ids=${orderIds.join( `factory/podJomallOrderUs/updateStockOutOrderToPicking?ids=${orderIds.join(
...@@ -171,11 +211,13 @@ export function toBePickingApi(orderIds: number[]) { ...@@ -171,11 +211,13 @@ export function toBePickingApi(orderIds: number[]) {
)}`, )}`,
) )
} }
export function getOrderDetailById(id: number) { export function getOrderDetailById(id: number) {
return axios.get<never, BaseRespData<ProductList>>( return axios.get<never, BaseRespData<ProductList>>(
`factory/podJomallOrderProductUs/getProductUsById?id=${id}`, `factory/podJomallOrderProductUs/getProductUsById?id=${id}`,
) )
} }
export function getPackingDataApi( export function getPackingDataApi(
code: string, code: string,
factoryNo: number, factoryNo: number,
...@@ -194,6 +236,7 @@ export function getPackingDataApi( ...@@ -194,6 +236,7 @@ export function getPackingDataApi(
}, },
) )
} }
export function getPodBoxListApi( export function getPodBoxListApi(
factoryNo: number | string, factoryNo: number | string,
warehouseId: number | string, warehouseId: number | string,
...@@ -218,6 +261,7 @@ export function submitInspectionApi( ...@@ -218,6 +261,7 @@ export function submitInspectionApi(
}, },
) )
} }
export function clearBoxApi( export function clearBoxApi(
factoryNo: number, factoryNo: number,
box: number | null, box: number | null,
...@@ -230,11 +274,13 @@ export function clearBoxApi( ...@@ -230,11 +274,13 @@ export function clearBoxApi(
}, },
) )
} }
export function clearAllBoxApi() { export function clearAllBoxApi() {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/delPodBoxOrderDetails', 'factory/podJomallOrderUs/delPodBoxOrderDetails',
) )
} }
export function updateRemarkApi(id: number, content: string) { export function updateRemarkApi(id: number, content: string) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/addRemark', 'factory/podJomallOrderUs/addRemark',
...@@ -242,23 +288,40 @@ export function updateRemarkApi(id: number, content: string) { ...@@ -242,23 +288,40 @@ export function updateRemarkApi(id: number, content: string) {
) )
} }
export function refreshAddressApi(idList: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/syncReceiverAddress',
idList,
)
}
export function updateAddressApi(data: PodUsOrderListData) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateReceiverAddress',
data,
)
}
export function getLogisticsCalculation(id: number) { export function getLogisticsCalculation(id: number) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
'factory/podJomallOrderUs/getLogisticsCalculation', 'factory/podJomallOrderUs/getLogisticsCalculation',
{ params: { id } }, { params: { id } },
) )
} }
export function loadWarehouseListApi() { export function loadWarehouseListApi() {
return axios.get<never, BaseRespData<WarehouseListData[]>>( return axios.get<never, BaseRespData<WarehouseListData[]>>(
'factoryWarehouseInfo/getAll', 'factoryWarehouseInfo/getAll',
) )
} }
export function refreshMaterialApi(orderIds: string) { export function refreshMaterialApi(orderIds: string) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderProductUs/refreshDesignImages ', 'factory/podJomallOrderProductUs/refreshDesignImages ',
{ orderIds }, { orderIds },
) )
} }
// 获取跟踪号 // 获取跟踪号
export function getTrackingNumberApi(orderIds: (string | number)[]) { export function getTrackingNumberApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -266,6 +329,7 @@ export function getTrackingNumberApi(orderIds: (string | number)[]) { ...@@ -266,6 +329,7 @@ export function getTrackingNumberApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
// 获取打印面单 // 获取打印面单
export function getfaceSimplexFileApi(orderIds: (string | number)[]) { export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -273,6 +337,7 @@ export function getfaceSimplexFileApi(orderIds: (string | number)[]) { ...@@ -273,6 +337,7 @@ export function getfaceSimplexFileApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
// 取消物流订单 // 取消物流订单
export function cancelLogisticsOrderApi(orderIds: (string | number)[]) { export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
...@@ -280,6 +345,7 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) { ...@@ -280,6 +345,7 @@ export function cancelLogisticsOrderApi(orderIds: (string | number)[]) {
orderIds, orderIds,
) )
} }
// 更改物流 // 更改物流
export function changeLogisticsApi(params: { export function changeLogisticsApi(params: {
updateByIdParam: { updateByIdParam: {
...@@ -293,6 +359,7 @@ export function changeLogisticsApi(params: { ...@@ -293,6 +359,7 @@ export function changeLogisticsApi(params: {
params, params,
) )
} }
// 创建物流 // 创建物流
export function createLogisticsOrderApi(params: { export function createLogisticsOrderApi(params: {
updateByIdParam: { updateByIdParam: {
...@@ -306,6 +373,15 @@ export function createLogisticsOrderApi(params: { ...@@ -306,6 +373,15 @@ export function createLogisticsOrderApi(params: {
params, params,
) )
} }
// 更改物流
export function composingDesignImages(data: number[]) {
return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/composingDesignImages',
data,
)
}
// 转至待拣胚 // 转至待拣胚
export function updateLogisticsToPickingApi(params: { ids: string }) { export function updateLogisticsToPickingApi(params: { ids: string }) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
...@@ -315,6 +391,7 @@ export function updateLogisticsToPickingApi(params: { ids: string }) { ...@@ -315,6 +391,7 @@ export function updateLogisticsToPickingApi(params: { ids: string }) {
}, },
) )
} }
//创建物流订单 //创建物流订单
export function createLogisticsOrdersApi(orderIds: (string | number)[]) { export function createLogisticsOrdersApi(orderIds: (string | number)[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
......
...@@ -4,48 +4,54 @@ ...@@ -4,48 +4,54 @@
class="right-click-menu" class="right-click-menu"
:style="{ left: position.x + 'px', top: position.y + 'px' }" :style="{ left: position.x + 'px', top: position.y + 'px' }"
> >
<div class="menu-item" @click="handleSelectAll">全选</div> <div class="menu-item" @click="onChangeCopy('select-all')">全部选择</div>
<div class="menu-item" @click="handleUnselectAll">取消全选</div> <div class="menu-item" @click="onChangeCopy('cancel-select')">取消选择</div>
<div class="menu-item" @click="onChangeCopy('shop-numbers')"> <div
v-if="showCopySubShopNumber"
class="menu-item"
@click="onChangeCopy('copy_code')"
>
复制生产单号
</div>
<div
v-if="showCopyShopNumber"
class="menu-item"
@click="onChangeCopy('copy_shopNumber')"
>
复制店铺单号 复制店铺单号
</div> </div>
<div v-if="showCopyCount" class="menu-item" @click="onChangeCopy('count')">
统计数量
</div>
<slot></slot>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { ref, defineExpose, onMounted, onUnmounted } from 'vue' import { ref, defineExpose, onMounted, onUnmounted } from 'vue'
import type { TableInstance } from 'element-plus'
const visible = ref(false) const visible = ref(false)
const position = ref({ x: 0, y: 0 }) const position = ref({ x: 0, y: 0 })
const tableRef = ref<TableInstance>()
const emit = defineEmits(['onChange']) const emit = defineEmits(['onChange'])
const setPosition = ({
x,
y,
el,
}: {
x: number
y: number
el: TableInstance
}) => {
position.value = { x, y }
visible.value = true
tableRef.value = el
}
const handleSelectAll = () => { defineProps({
if (tableRef.value) { showCopyShopNumber: {
tableRef.value.toggleAllSelection() type: Boolean,
} default: true,
visible.value = false },
} showCopyCount: {
type: Boolean,
default: true,
},
showCopySubShopNumber: {
type: Boolean,
default: true,
},
})
const handleUnselectAll = () => { const setPosition = ({ x, y }: { x: number; y: number }) => {
if (tableRef.value) { position.value = { x, y }
tableRef.value.clearSelection() visible.value = true
}
visible.value = false
} }
const onChangeCopy = (value: string) => { const onChangeCopy = (value: string) => {
...@@ -74,7 +80,7 @@ defineExpose({ ...@@ -74,7 +80,7 @@ defineExpose({
}) })
</script> </script>
<style scoped> <style scoped lang="scss">
.right-click-menu { .right-click-menu {
position: fixed; position: fixed;
background: white; background: white;
...@@ -84,15 +90,19 @@ defineExpose({ ...@@ -84,15 +90,19 @@ defineExpose({
z-index: 3000; z-index: 3000;
} }
.menu-item { .right-click-menu {
:deep(.menu-item) {
padding: 8px 16px; padding: 8px 16px;
cursor: pointer; cursor: pointer;
font-size: 14px; font-size: 14px;
color: #606266; color: #606266;
}
} }
.menu-item:hover { .right-click-menu {
:deep(.menu-item):hover {
background-color: #f5f7fa; background-color: #f5f7fa;
color: #409eff; color: #409eff;
}
} }
</style> </style>
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
v-bind="attrs" v-bind="attrs"
header-align="center" header-align="center"
height="100%" height="100%"
@contextmenu.prevent="handleContextMenu"
> >
<ElTableColumn <ElTableColumn
v-if="selectionable" v-if="selectionable"
...@@ -58,19 +57,16 @@ ...@@ -58,19 +57,16 @@
</RenderColumn> </RenderColumn>
</template> </template>
</ElTable> </ElTable>
<RightClickMenu ref="rightMenuRef" @on-change="onChange" />
</div> </div>
</template> </template>
<script setup lang="tsx" generic="T"> <script setup lang="tsx" generic="T">
import { type Slot, useAttrs, useSlots, type PropType, shallowRef } from 'vue' import { type Slot, useAttrs, useSlots, type PropType, shallowRef } from 'vue'
import type { CustomColumn } from '@/types/table' import type { CustomColumn } from '@/types/table'
import RenderColumn from './RenderColumn.vue' import RenderColumn from './RenderColumn.vue'
import RightClickMenu from './TableRightClickMenu.vue'
import { ElTable } from 'element-plus' import { ElTable } from 'element-plus'
import type { TableInstance } from 'element-plus' import type { TableInstance } from 'element-plus'
const tableRef = shallowRef<TableInstance>() const tableRef = shallowRef<TableInstance>()
const rightMenuRef = shallowRef<InstanceType<typeof RightClickMenu>>()
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any
defineProps({ defineProps({
...@@ -98,19 +94,7 @@ defineProps({ ...@@ -98,19 +94,7 @@ defineProps({
const attrs = useAttrs() const attrs = useAttrs()
const slots = useSlots() as Record<string, Slot> const slots = useSlots() as Record<string, Slot>
const emit = defineEmits(['onChange'])
const handleContextMenu = (e: MouseEvent) => {
if (rightMenuRef.value && tableRef.value) {
rightMenuRef.value.setPosition({
x: e.clientX,
y: e.clientY,
el: tableRef.value,
})
}
}
const onChange = (type: string) => {
emit('onChange', type)
}
const setCurrentRow = (row: T) => { const setCurrentRow = (row: T) => {
tableRef.value?.setCurrentRow(row) tableRef.value?.setCurrentRow(row)
} }
...@@ -122,12 +106,16 @@ const toggleRowSelection = (row: T, selected: boolean = true) => { ...@@ -122,12 +106,16 @@ const toggleRowSelection = (row: T, selected: boolean = true) => {
const clearSelection = () => { const clearSelection = () => {
tableRef.value?.clearSelection() tableRef.value?.clearSelection()
} }
const toggleAllSelection = () => {
tableRef.value?.toggleAllSelection()
}
defineExpose({ defineExpose({
tableRef, tableRef,
setCurrentRow, setCurrentRow,
toggleRowSelection, toggleRowSelection,
clearSelection, clearSelection,
toggleAllSelection,
}) })
</script> </script>
......
...@@ -6,6 +6,7 @@ export interface Tab { ...@@ -6,6 +6,7 @@ export interface Tab {
export interface SearchForm { export interface SearchForm {
timeType: number | null timeType: number | null
shopNumber: string shopNumber: string
shipmentType: string
userMark: string userMark: string
logisticsTracking: string logisticsTracking: string
baseSku: string baseSku: string
......
...@@ -976,11 +976,12 @@ ...@@ -976,11 +976,12 @@
> >
<OrderDetail :order-detail-data="orderDetailData" /> <OrderDetail :order-detail-data="orderDetailData" />
</ElDrawer> </ElDrawer>
<RightMenu <RightClickMenu
ref="rightMenuRef" ref="rightMenuRef"
:show-copy-shop-number="true"
:show-copy-count="false" :show-copy-count="false"
:show-copy-sub-shop-number="statusCode !== 6" :show-copy-sub-shop-number="true"
@change="onChange" @on-change="rightChange"
/> />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
...@@ -1037,7 +1038,7 @@ import OrderDetail from './OrderDetail.vue' ...@@ -1037,7 +1038,7 @@ import OrderDetail from './OrderDetail.vue'
import useShipment from './hook/useShipment' import useShipment from './hook/useShipment'
import useQuarantine from './hook/useQuarantine' import useQuarantine from './hook/useQuarantine'
import Quarantine from './Quarantine.vue' import Quarantine from './Quarantine.vue'
import RightMenu from './pod/rightMenu.vue' import RightClickMenu from '@/components/RightClickMenu.vue'
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
mainSku: '', mainSku: '',
...@@ -1670,52 +1671,57 @@ const handleContextMenu = (e: MouseEvent) => { ...@@ -1670,52 +1671,57 @@ const handleContextMenu = (e: MouseEvent) => {
} }
const tableQaRef = ref() const tableQaRef = ref()
const tableRef = ref() const tableRef = ref()
const onChange = (key: string) => { const rightChange = (key: string) => {
if (key === 'check_all') { if (key === 'select-all') {
if (statusCode.value === 6) { if (statusCode.value === 6) {
tableQaRef.value?.toggleAllSelection() tableQaRef.value?.toggleAllSelection()
} else { } else {
tableRef.value?.toggleAllSelection() tableRef.value?.toggleAllSelection()
} }
} else if (key === 'clear_check') { } else if (key === 'cancel-select') {
if (statusCode.value === 6) { if (statusCode.value === 6) {
tableQaRef.value?.clearSelection() tableQaRef.value?.clearSelection()
} else { } else {
tableRef.value?.clearSelection() tableRef.value?.clearSelection()
} }
} else if (key === 'copy_code') {
const shopNumberList: string[] = []
for (const item of selection.value) {
item.productList?.forEach((el) => {
if (el.shopNumber) {
shopNumberList.push(el.shopNumber)
}
})
}
copy(shopNumberList.join(','))
} else if (key === 'copy_shopNumber') { } else if (key === 'copy_shopNumber') {
const subOrderNumber: string[] = [] let shopNumberList: string[] = []
if (statusCode.value === 6) { if (statusCode.value === 6) {
for (const item of selection.value) { shopNumberList = tableData.value
item.detailList?.forEach((el) => { .map((item) => item.detailList)
if (el.shopNumber) { .flat()
subOrderNumber.push(el.shopNumber || '') .map((e) => e?.shopNumber)
} .filter((shopNumber): shopNumber is string => shopNumber !== undefined)
})
}
} else { } else {
for (const item of selection.value) { shopNumberList = tableData.value
item.productList?.forEach((el) => { .map((item) => item.productList)
if (el.subOrderNumber) { .flat()
subOrderNumber.push(el.subOrderNumber) .map((e) => e?.shopNumber)
} .filter((shopNumber): shopNumber is string => shopNumber !== undefined)
})
} }
copy(shopNumberList.join(','))
} else if (key === 'copy_code') {
let subOrderNumber: string[] = []
if (statusCode.value === 6) {
subOrderNumber = tableData.value
.map((item) => item.detailList)
.flat()
.map((e) => e?.subOrderNumber)
.filter(
(subOrderNumber): subOrderNumber is string =>
subOrderNumber !== undefined,
)
} else {
subOrderNumber = tableData.value
.map((item) => item.productList)
.flat()
.map((e) => e?.subOrderNumber)
.filter(
(subOrderNumber): subOrderNumber is string =>
subOrderNumber !== undefined,
)
} }
copy(subOrderNumber.join(',')) copy(subOrderNumber.join(','))
} else if (key === 'count') {
const count = selection.value.length
copy(count.toString())
} }
} }
const onChangeCurrentRow = (item: ProductList) => { const onChangeCurrentRow = (item: ProductList) => {
......
...@@ -590,8 +590,10 @@ ...@@ -590,8 +590,10 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="order-list flex-1 overflow-hidden" class="order-list flex-1 overflow-hidden"
@contextmenu.prevent="(v) => rightClick(v, null)"
> >
<TableView <TableView
ref="tableRef"
:paginated-data="tableData" :paginated-data="tableData"
:columns="tableColumns" :columns="tableColumns"
:selectionable="true" :selectionable="true"
...@@ -973,15 +975,20 @@ ...@@ -973,15 +975,20 @@
基版 <b>{{ cardItem?.baseSku }}</b> 的统计数量为:<b> {{ count }}</b> 基版 <b>{{ cardItem?.baseSku }}</b> 的统计数量为:<b> {{ count }}</b>
</p> </p>
</el-dialog> </el-dialog>
<right-menu <RightClickMenu
ref="rightMenuRef" ref="rightMenuRef"
:show-copy-shop-number=" :show-copy-shop-number="true"
['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status)
"
:show-copy-count=" :show-copy-count="
['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes(status) [
'IN_PRODUCTION',
'TO_BE_CONFIRMED',
'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status)
" "
@change="rightChange" :show-copy-sub-shop-number="true"
@on-change="rightChange"
/> />
<fastProduction <fastProduction
v-model:detailVisible="detailVisible" v-model:detailVisible="detailVisible"
...@@ -1058,7 +1065,6 @@ ...@@ -1058,7 +1065,6 @@
</template> </template>
<script setup lang="tsx"> <script setup lang="tsx">
// refreshJMProductInfo,reasonInvalidationApi, // refreshJMProductInfo,reasonInvalidationApi,
import RightMenu from './rightMenu.vue'
import { import {
getOrderTabData, getOrderTabData,
getOrderList, getOrderList,
...@@ -1120,6 +1126,7 @@ import { filePath } from '@/api/axios' ...@@ -1120,6 +1126,7 @@ import { filePath } from '@/api/axios'
import { CustomColumn } from '@/types/table' import { CustomColumn } from '@/types/table'
import LogList from '@/components/LogList.vue' import LogList from '@/components/LogList.vue'
import CommonCard from '@/components/CommonCard.vue' import CommonCard from '@/components/CommonCard.vue'
import RightClickMenu from '@/components/RightClickMenu.vue'
const tableRef = ref() const tableRef = ref()
const loading = ref(false) const loading = ref(false)
const currentPage = ref(1) const currentPage = ref(1)
...@@ -1154,13 +1161,14 @@ const completeShipmentForm = ref({ ...@@ -1154,13 +1161,14 @@ const completeShipmentForm = ref({
logisticsTracking: '', // 物流跟踪号 logisticsTracking: '', // 物流跟踪号
carriageAmount: '', // 物流费用 carriageAmount: '', // 物流费用
}) })
const rightClick = (e: MouseEvent, item: PodProductList | CardOrderData) => { const rightClick = (
cardItem.value = item e: MouseEvent,
item: PodProductList | CardOrderData | null,
) => {
cardItem.value = item || undefined
rightMenuRef.value.setPosition({ rightMenuRef.value.setPosition({
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
cardItem: e.clientY,
el: e,
}) })
} }
const handleSizeChange = (size: number) => { const handleSizeChange = (size: number) => {
...@@ -1172,10 +1180,14 @@ const handleCurrentChange = (page: number) => { ...@@ -1172,10 +1180,14 @@ const handleCurrentChange = (page: number) => {
loadDiffList() loadDiffList()
} }
const rightChange = async (code: string) => { const rightChange = async (code: string) => {
const flag = ['IN_PRODUCTION', 'TO_BE_CONFIRMED', 'WAIT_SHIPMENT'].includes( const flag = [
status.value, 'IN_PRODUCTION',
) 'TO_BE_CONFIRMED',
if (code === 'check_all') { 'WAIT_SHIPMENT',
'TO_BE_REPLENISHMENT',
'INVALID',
].includes(status.value)
if (code === 'select-all') {
if (flag) { if (flag) {
selection.value = JSON.parse(JSON.stringify(CardOrderList.value)) selection.value = JSON.parse(JSON.stringify(CardOrderList.value))
} else { } else {
...@@ -1184,17 +1196,35 @@ const rightChange = async (code: string) => { ...@@ -1184,17 +1196,35 @@ const rightChange = async (code: string) => {
} }
// selection.value = JSON.parse(JSON.stringify(tableData.value)) // selection.value = JSON.parse(JSON.stringify(tableData.value))
} }
} else if (code === 'clear_check') { } else if (code === 'cancel-select') {
selection.value = [] selection.value = []
tableRef.value?.tableRef.toggleAllSelection() tableRef.value?.tableRef.toggleAllSelection()
} else if (code === 'copy_code') { } else if (code === 'copy_code') {
const str = selection.value let str
.map((item) => item.factorySubOrderNumber || item.factoryOrderNumber) if (flag) {
str = CardOrderList.value.map((item) => item.factorySubOrderNumber).join()
} else {
str = tableData.value
.map((item) => item.productList)
.flat()
.map((item) => item?.factorySubOrderNumber)
.filter((item) => item)
.join() .join()
navigator.clipboard.writeText(str) }
navigator.clipboard.writeText(str || '')
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'copy_shopNumber') { } else if (code === 'copy_shopNumber') {
const str = selection.value.map((item) => item.shopNumber).join() let str
if (flag) {
str = CardOrderList.value.map((item) => item.shopNumber).join()
} else {
str = tableData.value
.map((item) => item.productList)
.flat()
.map((item) => item?.shopNumber)
.filter((item) => item)
.join()
}
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'count') { } else if (code === 'count') {
...@@ -1342,6 +1372,7 @@ const saveCompleteShipment = async () => { ...@@ -1342,6 +1372,7 @@ const saveCompleteShipment = async () => {
const CardOrderList = ref<(PodProductList | CardOrderData)[]>([]) const CardOrderList = ref<(PodProductList | CardOrderData)[]>([])
const loadCardList = async () => { const loadCardList = async () => {
loading.value = true
try { try {
const res = await getCardOrderList( const res = await getCardOrderList(
{ {
...@@ -1380,7 +1411,17 @@ const loadCardList = async () => { ...@@ -1380,7 +1411,17 @@ const loadCardList = async () => {
item.images = images item.images = images
} else { } else {
if (item.imageAry) { if (item.imageAry) {
const images = JSON.parse(item.imageAry as string) console.log(item.imageAry)
let images
if (
typeof item.imageAry === 'string' &&
item.imageAry.startsWith('https')
) {
images = []
} else {
images = JSON.parse(item.imageAry as string)
}
if (Array.isArray(images)) { if (Array.isArray(images)) {
item.images = images.map((e: imageAryInter) => { item.images = images.map((e: imageAryInter) => {
return { return {
...@@ -1396,10 +1437,14 @@ const loadCardList = async () => { ...@@ -1396,10 +1437,14 @@ const loadCardList = async () => {
}) })
total.value = res.data.total total.value = res.data.total
} catch (error) { } catch (error) {
console.error(error)
// showError(error) // showError(error)
} finally {
loading.value = false
} }
} }
const loadOrderList = async () => { const loadOrderList = async () => {
loading.value = true
try { try {
const res = await getOrderList( const res = await getOrderList(
{ {
...@@ -1422,6 +1467,8 @@ const loadOrderList = async () => { ...@@ -1422,6 +1467,8 @@ const loadOrderList = async () => {
total.value = res.data.total total.value = res.data.total
} catch (error) { } catch (error) {
// showError(error) // showError(error)
} finally {
loading.value = false
} }
} }
const currentImage = ref('') const currentImage = ref('')
......
<template>
<!-- <div class="wrap" @click="close"> -->
<div v-if="show" ref="right_menu" class="right_menu">
<button @click="$emit('change', 'check_all')">全部选择</button>
<button @click="$emit('change', 'clear_check')">取消选择</button>
<button v-if="showCopySubShopNumber" @click="$emit('change', 'copy_code')">
复制选中生产单号
</button>
<button
v-if="showCopyShopNumber"
@click="$emit('change', 'copy_shopNumber')"
>
复制选中店铺单号
</button>
<button v-if="showCopyCount" @click="$emit('change', 'count')">
统计数量
</button>
</div>
<!-- </div> -->
</template>
<script setup lang="ts">
import { ref, defineProps, defineExpose } from 'vue'
interface E {
x: number
el: HTMLElement
y: number
}
defineProps({
showCopyShopNumber: {
type: Boolean,
default: true,
},
showCopyCount: {
type: Boolean,
default: true,
},
showCopySubShopNumber: {
type: Boolean,
default: true,
},
})
const row = ref()
const show = ref(false)
const right_menu = ref<HTMLElement>()
const close = () => {
show.value = false
document.body.onclick = null
}
const setPosition = (o: E) => {
console.log(o)
show.value = true
const clientX = o.x
const x = document.body.clientWidth - clientX
document.body.onclick = function () {
close()
}
row.value = setTimeout(() => {
if (!right_menu.value) return
if (x < 150) {
right_menu.value.style.cssText = `top:${o.y}px;right:${x}px`
} else {
right_menu.value.style.cssText = `top:${o.y}px;left:${o.x}px`
}
}, 1)
}
defineExpose({
setPosition,
})
</script>
<style scoped>
.wrap {
position: fixed;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.right_menu {
position: fixed;
max-width: 200px;
min-height: 50px;
background: #fff;
box-shadow: 1px 1px 10px 1px rgba(0, 0, 0, 0.5);
border-radius: 5px;
overflow: hidden;
z-index: 999;
/* left: -500px; */
top: -500px;
}
.right_menu button {
display: block;
line-height: 30px;
font-size: 14px;
padding: 0 15px;
text-align: left;
width: 100%;
cursor: pointer;
}
.right_menu button:hover {
background: rgb(65, 192, 251);
color: white;
}
button {
outline: none;
border: none;
}
</style>
<script setup lang="ts">
import { defineModel } from 'vue'
import { updateAddressApi,AddressInfo } from '@/api/podUsOrder.ts'
const emits = defineEmits(['success'])
defineProps<{
countryList: { countryCode: string }[]
}>()
const visible = defineModel<boolean>('visible')
const form = defineModel<AddressInfo>('form', {
default: {
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
},
})
const formRef = ref()
const rules = {
receiverName: [{ required: true, message: '请输入姓名', trigger: 'blur' }],
receiverPhone: [{ required: true, message: '请输入电话', trigger: 'blur' }],
receiverCountry: [{ required: true, message: '请输入国家', trigger: 'blur' }],
receiverProvince: [{ required: true, message: '请输入省/州', trigger: 'blur' }],
receiverCity: [{ required: true, message: '请输入市', trigger: 'blur' }],
receiverAddress1: [{ required: true, message: '请输入地址1', trigger: 'blur' }],
receiverPostCode: [{ required: true, message: '请输入邮政编码', trigger: 'blur' }],
}
const submitForm = async () => {
formRef?.value.validate(async (valid: boolean) => {
if (valid) {
await updateAddressApi(form.value as never)
visible.value = false
emits('success')
await ElMessageBox.alert('请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。', '提示', {
type: 'warning',
confirmButtonText:'确定',
cancelButtonText:'取消',
showCancelButton: true,
})
}
})
}
</script>
<template>
<el-dialog
v-model="visible"
:close-on-click-modal="false"
title="修改揽收信息"
width="50%"
>
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px">
<el-form-item label="姓名" prop="receiverName">
<el-input v-model="form.receiverName" clearable placeholder="请输入姓名" />
</el-form-item>
<el-form-item label="电话" prop="receiverPhone">
<el-input v-model="form.receiverPhone" clearable placeholder="请输入电话" />
</el-form-item>
<el-form-item label="国家" prop="receiverCountry">
<el-select v-model="form.receiverCountry" clearable filterable>
<el-option
v-for="it in countryList" :key="it.countryCode" :label="it.countryCode"
:value="it.countryCode"></el-option>
</el-select>
</el-form-item>
<el-form-item label="省/州" prop="receiverProvince">
<el-input v-model="form.receiverProvince" clearable placeholder="请输入省/州" />
</el-form-item>
<el-form-item label="市" prop="receiverCity">
<el-input v-model="form.receiverCity" clearable placeholder="请输入市" />
</el-form-item>
<el-form-item label="区/县" prop="receiverDistrict">
<el-input v-model="form.receiverDistrict" clearable placeholder="请输入区/县" />
</el-form-item>
<el-form-item label="地址1" prop="receiverAddress1">
<el-input v-model="form.receiverAddress1" clearable placeholder="请输入地址1" />
</el-form-item>
<el-form-item label="地址2" prop="receiverAddress2">
<el-input v-model="form.receiverAddress2" clearable placeholder="请输入地址2" />
</el-form-item>
<el-form-item label="邮政编码" prop="receiverPostCode">
<el-input v-model="form.receiverPostCode" clearable placeholder="请输入邮政编码" />
</el-form-item>
</el-form>
<template #footer>
<el-button @click="visible=false">取消</el-button>
<el-button type="primary" @click="submitForm">提交</el-button>
</template>
</el-dialog>
</template>
<style scoped lang="scss">
</style>
...@@ -145,7 +145,21 @@ ...@@ -145,7 +145,21 @@
style="width: 150px" style="width: 150px"
/> />
</ElFormItem> </ElFormItem>
<ElFormItem label="物流类型">
<ElSelect
v-model="searchForm.shipmentType"
placeholder="物流类型"
clearable
style="width: 130px"
>
<ElOption
v-for="(item, index) in ['自有物流','工厂物流']"
:key="index"
:value="index"
:label="item"
></ElOption>
</ElSelect>
</ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search">查询</ElButton> <ElButton type="primary" @click="search">查询</ElButton>
</ElFormItem> </ElFormItem>
...@@ -230,12 +244,18 @@ ...@@ -230,12 +244,18 @@
</div> </div>
</div> </div>
<div class="operation-box mb-10"> <div class="operation-box mb-10">
<span v-if="status === 'PICKING'" class="item">
<ElButton :loading="downloadLoading" type="warning" @click="downloadTif"> 排版 </ElButton>
</span>
<span v-if="status === 'TO_BE_CONFIRMED'" class="item"> <span v-if="status === 'TO_BE_CONFIRMED'" class="item">
<ElButton type="success" @click="confirmOrder"> 确认 </ElButton> <ElButton type="success" @click="confirmOrder"> 确认 </ElButton>
</span> </span>
<span v-if="status === 'EXCEPTION_ORDER'" class="item"> <span v-if="status === 'EXCEPTION_ORDER'" class="item">
<ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton> <ElButton type="success" @click="updateOrder"> 转至待确认 </ElButton>
</span> </span>
<span v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 3" class="item">
<ElButton type="success" @click="asyncOrderAddress"> 同步收货地址 </ElButton>
</span>
<span <span
v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1" v-if="status === 'EXCEPTION_ORDER' && exceptionStatus === 1"
class="item" class="item"
...@@ -354,6 +374,7 @@ ...@@ -354,6 +374,7 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="table-wrapper flex-1 flex-column overflow-hidden" class="table-wrapper flex-1 flex-column overflow-hidden"
@contextmenu.prevent="(v) => rightClick(v)"
> >
<TableView <TableView
ref="tableRef" ref="tableRef"
...@@ -364,7 +385,6 @@ ...@@ -364,7 +385,6 @@
:paginated-data="tableData" :paginated-data="tableData"
:cell-style="onCellStyle" :cell-style="onCellStyle"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
@on-change="onChange"
> >
<template #goods="{ row }"> <template #goods="{ row }">
<div class="goods-info-box"> <div class="goods-info-box">
...@@ -574,6 +594,12 @@ ...@@ -574,6 +594,12 @@
</el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">物流类型:</span>
<span class="order-detail-item-value">
{{ ['自有物流','工厂物流'][row.shipmentType] }}
</span>
</div>
<div class="order-detail-item">
<span class="order-detail-item-label">物流跟踪号:</span> <span class="order-detail-item-label">物流跟踪号:</span>
<span class="order-detail-item-value"> <span class="order-detail-item-value">
<el-button <el-button
...@@ -749,7 +775,15 @@ ...@@ -749,7 +775,15 @@
</template> </template>
<template #operate="{ row }"> <template #operate="{ row }">
<div class="operate-box"> <div class="operate-box">
<span class="operate-item"> <span class="operate-item" style="display: flex;flex-direction: column">
<ElButton
link
type="primary"
@click="operationLog(row.id, null)"
>
操作日志
</ElButton>
<ElButton <ElButton
v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'" v-if="!row.expressSheet && row.status === 'TO_BE_CONFIRMED'"
link link
...@@ -759,11 +793,20 @@ ...@@ -759,11 +793,20 @@
确认 确认
</ElButton> </ElButton>
<ElButton <ElButton
v-if="row.shipmentType===1 && ['CREATE_LOGISTICS','WAIT_SHIPMENT'].includes(status)"
link link
type="primary" type="primary"
@click="operationLog(row.id, null)" @click="handleUpdateAddress(row)"
> >
操作日志 修改地址
</ElButton>
<ElButton
v-if="row.shipmentType===0 && ['CREATE_LOGISTICS','WAIT_SHIPMENT'].includes(status)"
link
type="primary"
@click="handleRefreshAddress(row)"
>
刷新地址
</ElButton> </ElButton>
</span> </span>
</div> </div>
...@@ -907,11 +950,18 @@ ...@@ -907,11 +950,18 @@
></ElPagination> ></ElPagination>
</div> </div>
</div> </div>
<right-menu <RightClickMenu
ref="rightMenuRef" ref="rightMenuRef"
:show-copy-count="false" :show-copy-count="false"
@change="rightChange" :show-copy-sub-shop-number="false"
/> @on-change="rightChange"
>
<template #default
><div class="menu-item" @click="rightChange('order-number')">
复制订单号
</div>
</template>
</RightClickMenu>
<el-dialog <el-dialog
v-model="confirmDialogShow" v-model="confirmDialogShow"
:close-on-click-modal="false" :close-on-click-modal="false"
...@@ -1122,7 +1172,7 @@ ...@@ -1122,7 +1172,7 @@
</el-button> </el-button>
</template> </template>
</el-dialog> </el-dialog>
<UpdateAddress v-if="updateAddVisible" v-model:form="currentRow" v-model:visible="updateAddVisible" :country-list="countryList" @success="search"></UpdateAddress>
<ElDialog <ElDialog
v-model="exceptionDialogVisible" v-model="exceptionDialogVisible"
title="转为异常单" title="转为异常单"
...@@ -1183,8 +1233,8 @@ ...@@ -1183,8 +1233,8 @@
</ElDialog> </ElDialog>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getUserMarkList } from '@/api/common'
import { getUserMarkList } from '@/api/common'
import { ArrowDown, WarningFilled } from '@element-plus/icons-vue' import { ArrowDown, WarningFilled } from '@element-plus/icons-vue'
import { import {
getCardOrderList, getCardOrderList,
...@@ -1211,14 +1261,15 @@ import { ...@@ -1211,14 +1261,15 @@ import {
getTrackingNumberApi, getTrackingNumberApi,
getfaceSimplexFileApi, getfaceSimplexFileApi,
cancelLogisticsOrderApi, cancelLogisticsOrderApi,
composingDesignImages,
changeLogisticsApi, changeLogisticsApi,
createLogisticsOrderApi, createLogisticsOrderApi,
updateLogisticsToPickingApi, updateLogisticsToPickingApi,
createLogisticsOrdersApi, createLogisticsOrdersApi, syncReceiverAddress, refreshAddressApi, AddressInfo,
// handleExceptionOrderApi, // handleExceptionOrderApi,
} from '@/api/podUsOrder' } from '@/api/podUsOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
import UpdateAddress from './components/updateAddress.vue'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import { import {
LogListData, LogListData,
...@@ -1242,10 +1293,11 @@ import PodMakeOrder from './PodMakeOrder.vue' ...@@ -1242,10 +1293,11 @@ import PodMakeOrder from './PodMakeOrder.vue'
import { OrderData } from '@/types/api/podMakeOrder' import { OrderData } from '@/types/api/podMakeOrder'
import useLodop, { LODOPObject } from '@/utils/hooks/useLodop' import useLodop, { LODOPObject } from '@/utils/hooks/useLodop'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import rightMenu from '../pod/rightMenu.vue' import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from './components/ResultInfo.vue' import ResultInfo from './components/ResultInfo.vue'
import { isArray, isString } from '@/utils/validate' import { isArray, isString } from '@/utils/validate'
import platformJson from '../../../json/platform.json' import platformJson from '../../../json/platform.json'
import { getAllCountryApi } from '@/api/logistics.ts'
declare global { declare global {
interface Window { interface Window {
ActiveXObject: { ActiveXObject: {
...@@ -1260,12 +1312,26 @@ declare global { ...@@ -1260,12 +1312,26 @@ declare global {
responseBody?: unknown responseBody?: unknown
} }
} }
const updateAddVisible = ref(false)
const tabsNav = ref<Tab[]>() const tabsNav = ref<Tab[]>()
const countryList = ref([])
const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null) const resultRefs = ref<InstanceType<typeof ResultInfo> | null>(null)
const confirmDialogShow = ref(false) const confirmDialogShow = ref(false)
const downloadLoading = ref(false)
const isChangeWay = ref(false) const isChangeWay = ref(false)
const confirmData = ref([]) const confirmData = ref([])
const logisticsWayData = ref([]) const logisticsWayData = ref([])
const currentRow = ref<AddressInfo>({
receiverName: '',
receiverPhone: '',
receiverCountry: '',
receiverProvince: '',
receiverCity: '',
receiverDistrict: '',
receiverAddress1: '',
receiverAddress2: '',
receiverPostCode: '',
})
const confirmSelectionData = ref<LogisticsData[]>([]) const confirmSelectionData = ref<LogisticsData[]>([])
const confirmRowData = ref<ProductList | null>(null) const confirmRowData = ref<ProductList | null>(null)
const status = ref('TO_BE_CONFIRMED') const status = ref('TO_BE_CONFIRMED')
...@@ -1273,6 +1339,7 @@ const detailData = ref({}) ...@@ -1273,6 +1339,7 @@ const detailData = ref({})
const [searchForm] = useValue<SearchForm>({ const [searchForm] = useValue<SearchForm>({
timeType: null, timeType: null,
shopNumber: '', shopNumber: '',
shipmentType: '',
userMark: '', userMark: '',
logisticsTracking: '', logisticsTracking: '',
baseSku: '', baseSku: '',
...@@ -1359,6 +1426,30 @@ const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => { ...@@ -1359,6 +1426,30 @@ const getWeekRange = (weeks = 0, type: 'past' | 'future' = 'past') => {
type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week') type === 'past' ? now.subtract(weeks, 'week') : now.add(weeks, 'week')
return [start.startOf('week').toDate(), start.endOf('week').toDate()] return [start.startOf('week').toDate(), start.endOf('week').toDate()]
} }
const handleRefreshAddress = async (row:PodUsOrderListData) => {
try {
await showConfirm('确定刷新地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
await refreshAddressApi([row.id])
await ElMessageBox.alert('请修改/刷新地址后取消物流重新创建物流订单、获取跟踪号、获取打印面单。', '提示', {
type: 'warning',
confirmButtonText:'确定',
cancelButtonText:'取消',
showCancelButton: true,
})
}
const handleUpdateAddress = async (row:PodUsOrderListData) => {
const { data } = await getAllCountryApi()
countryList.value = data
currentRow.value = JSON.parse(JSON.stringify(row))
updateAddVisible.value = true
}
const tableColumns = computed(() => [ const tableColumns = computed(() => [
{ {
label: '商品', label: '商品',
...@@ -1391,6 +1482,10 @@ const tableColumns = computed(() => [ ...@@ -1391,6 +1482,10 @@ const tableColumns = computed(() => [
slot: 'innerLabel', slot: 'innerLabel',
width: 300, width: 300,
prop: 'innerLabel', prop: 'innerLabel',
},{
label: '异常原因',
width: 300,
prop: 'exceptionReason',
}, },
{ {
label: '操作', label: '操作',
...@@ -1406,8 +1501,6 @@ const rightClick = (e: MouseEvent) => { ...@@ -1406,8 +1501,6 @@ const rightClick = (e: MouseEvent) => {
rightMenuRef.value.setPosition({ rightMenuRef.value.setPosition({
x: e.clientX, x: e.clientX,
y: e.clientY, y: e.clientY,
cardItem: e.clientY,
el: e,
}) })
} }
...@@ -1593,6 +1686,23 @@ const confirmOrder = async () => { ...@@ -1593,6 +1686,23 @@ const confirmOrder = async () => {
productionClientValue.value = '' productionClientValue.value = ''
productionClientVisible.value = true productionClientVisible.value = true
} }
const downloadTif = async () => {
if(!selection.value.length) {
return ElMessage.warning('请选择数据')
}
downloadLoading.value = true
try {
const res= await composingDesignImages(selection.value.map(el=>el.id))
window.open('http://ps.jomalls.com/tiff/'+res.message, '_blank')
downloadLoading.value = false
}catch (e){
console.log(e)
downloadLoading.value = false
}
}
const loadProductionClient = async () => { const loadProductionClient = async () => {
try { try {
const res = await getProductionClientApi() const res = await getProductionClientApi()
...@@ -1657,6 +1767,37 @@ const updateOrder = async () => { ...@@ -1657,6 +1767,37 @@ const updateOrder = async () => {
loading.close() loading.close()
} }
} }
const asyncOrderAddress = async () => {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
try {
await showConfirm('确定同步收货地址吗?', {
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
} catch {
return
}
const ids = selection.value.map((item) => item.id)
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await syncReceiverAddress(ids)
if (res.code !== 200) return
ElMessage.success('同步成功')
search()
await loadTabData()
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const assignOrder = async () => { const assignOrder = async () => {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
...@@ -1872,18 +2013,29 @@ const isSelectStatused = (data: ProductList) => { ...@@ -1872,18 +2013,29 @@ const isSelectStatused = (data: ProductList) => {
return index !== -1 return index !== -1
} }
const rightChange = async (code: string) => { const rightChange = async (code: string) => {
if (code === 'check_all') { const flat = status.value !== 'IN_PRODUCTION'
if (code === 'select-all') {
if (flat) {
tableRef.value?.toggleAllSelection()
} else {
cardSelection.value = JSON.parse(JSON.stringify(tableData.value)) cardSelection.value = JSON.parse(JSON.stringify(tableData.value))
} else if (code === 'clear_check') { }
} else if (code === 'cancel-select') {
if (flat) {
tableRef.value?.clearSelection()
} else {
cardSelection.value = [] cardSelection.value = []
} else if (code === 'copy_code') { }
const str = cardSelection.value } else if (code === 'copy_shopNumber') {
.map((item) => item.factorySubOrderNumber) const str = (tableData.value as ProductList[] | PodUsOrderListData[])
.map((item) => item?.shopNumber)
.join() .join()
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} else if (code === 'copy_shopNumber') { } else if (code === 'order-number') {
const str = cardSelection.value.map((item) => item.shopNumber).join() const str = (tableData.value as ProductList[] | PodUsOrderListData[])
.map((item) => item?.factoryOrderNumber)
.join()
navigator.clipboard.writeText(str) navigator.clipboard.writeText(str)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} }
...@@ -2495,16 +2647,7 @@ onMounted(() => { ...@@ -2495,16 +2647,7 @@ onMounted(() => {
loadProductionClient() loadProductionClient()
loadWarehouseList() loadWarehouseList()
}) })
const onChange = (value: string) => {
if (value === 'shop-numbers') {
const shopNumbers = (tableData.value as PodUsOrderListData[])
.map((item) => item.shopNumber)
.join(',')
navigator.clipboard.writeText(shopNumbers).then(() => {
ElMessage.success('店铺单号已复制到剪贴板')
})
}
}
const handleExceptionCommand = (command: number) => { const handleExceptionCommand = (command: number) => {
exceptionStatus.value = command exceptionStatus.value = command
search() search()
...@@ -2600,6 +2743,12 @@ const handleExceptionCommand = (command: number) => { ...@@ -2600,6 +2743,12 @@ const handleExceptionCommand = (command: number) => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.operate-item{
.el-button{
margin-left: 0 !important;
margin-top: 20px !important;
}
}
.tabs-node_count { .tabs-node_count {
display: inline-block; display: inline-block;
min-width: 20px; min-width: 20px;
......
...@@ -117,7 +117,7 @@ ...@@ -117,7 +117,7 @@
> >
删除 删除
</el-button> </el-button>
<el-button type="success" @click="handleExport"> 导出 </el-button> <el-button type="success" @click="handleExport"> 导出</el-button>
<el-button type="primary" @click="printProductTag"> <el-button type="primary" @click="printProductTag">
打印商品SKU标签 打印商品SKU标签
</el-button> </el-button>
...@@ -609,7 +609,7 @@ ...@@ -609,7 +609,7 @@
></el-input> ></el-input>
<el-popover placement="top-start" width="1000" trigger="click"> <el-popover placement="top-start" width="1000" trigger="click">
<div v-if="skuData.length > 0" style="height: 50vh"> <div v-if="skuData.length > 0" style="height: 50vh">
<ElTable size="small" :data="skuData" height="100%" border> <ElTable size="small" :data="filterSkuData" height="100%" border>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
width="60" width="60"
...@@ -670,8 +670,10 @@ ...@@ -670,8 +670,10 @@
> >
<template #default="{ row }"> <template #default="{ row }">
<el-icon :size="32" color="#67C23A" class="cursor-pointer" <el-icon :size="32" color="#67C23A" class="cursor-pointer"
><CirclePlusFilled @click="skudblclick(row)" >
/></el-icon> <CirclePlusFilled @click="skudblclick(row)"
/>
</el-icon>
</template> </template>
</ElTableColumn> </ElTableColumn>
</ElTable> </ElTable>
...@@ -742,7 +744,7 @@ ...@@ -742,7 +744,7 @@
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
<el-checkbox v-model="exportForm.delivery"> 包含详情 </el-checkbox> <el-checkbox v-model="exportForm.delivery"> 包含详情</el-checkbox>
</el-form-item> </el-form-item>
</el-form> </el-form>
<template #footer> <template #footer>
...@@ -979,6 +981,7 @@ const pickerOptions = { ...@@ -979,6 +981,7 @@ const pickerOptions = {
}, },
], ],
} }
function getStartTime() { function getStartTime() {
const date = new Date() const date = new Date()
const year = date.getFullYear() const year = date.getFullYear()
...@@ -986,6 +989,7 @@ function getStartTime() { ...@@ -986,6 +989,7 @@ function getStartTime() {
const day = date.getDate() const day = date.getDate()
return `${year}-${month}-${day} 00:00:00` return `${year}-${month}-${day} 00:00:00`
} }
const selectSku = ref('') const selectSku = ref('')
const treeData = ref<InterWarehouseTree[]>() const treeData = ref<InterWarehouseTree[]>()
const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({}) const [searchForm, resetSearchForm] = useValue<warehouseSearchForm>({})
...@@ -1075,6 +1079,7 @@ const printProductTag = async () => { ...@@ -1075,6 +1079,7 @@ const printProductTag = async () => {
console.error(e) console.error(e)
} }
} }
async function handlePrintProductTag() { async function handlePrintProductTag() {
const flag = printData.value.every( const flag = printData.value.every(
(el: InterWarehousePage) => el.number && el.number != '0', (el: InterWarehousePage) => el.number && el.number != '0',
...@@ -1104,6 +1109,7 @@ async function handlePrintProductTag() { ...@@ -1104,6 +1109,7 @@ async function handlePrintProductTag() {
showPrintDialog.value = false showPrintDialog.value = false
window.open(filePath + res.message, '_blank') window.open(filePath + res.message, '_blank')
} }
const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => { const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => {
if (!editForm.value.warehouseId) { if (!editForm.value.warehouseId) {
ElMessage.error('请选择仓库') ElMessage.error('请选择仓库')
...@@ -1129,11 +1135,14 @@ const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => { ...@@ -1129,11 +1135,14 @@ const batchAddCommodity = async (sku: string): Promise<InterskuList[]> => {
return [] return []
} }
} }
interface InterImportData { interface InterImportData {
warehouseSku: string warehouseSku: string
remark?: string | null remark?: string | null
[key: string]: unknown [key: string]: unknown
} }
// 前端导入Excel // 前端导入Excel
const excelFieldMap: Record<string, keyof InterProductList> = { const excelFieldMap: Record<string, keyof InterProductList> = {
// SKU图片: 'skuImage', // SKU图片: 'skuImage',
...@@ -1149,7 +1158,7 @@ const excelFieldMap: Record<string, keyof InterProductList> = { ...@@ -1149,7 +1158,7 @@ const excelFieldMap: Record<string, keyof InterProductList> = {
const handleLocalImport = async ({ const handleLocalImport = async ({
path, path,
data, data,
}: { }: {
path: string path: string
data: InterImportData[] data: InterImportData[]
}) => { }) => {
...@@ -1537,6 +1546,12 @@ const addOtherCurrency = async () => { ...@@ -1537,6 +1546,12 @@ const addOtherCurrency = async () => {
upSection() upSection()
} }
} }
const filterSkuData = computed(() => {
const skuList = otherPurchaseData.value.map(el => el.warehouseSku)
console.log(skuList,skuData.value)
return skuData.value.filter(el => !skuList.includes(el.sku))
})
const addSection = async () => { const addSection = async () => {
const params = { ...editForm.value } const params = { ...editForm.value }
params.productList = otherPurchaseData.value params.productList = otherPurchaseData.value
...@@ -1599,9 +1614,10 @@ const upSection = async () => { ...@@ -1599,9 +1614,10 @@ const upSection = async () => {
} }
} }
const addPurchaseVisible = ref(false) const addPurchaseVisible = ref(false)
const purchaseTextarea = ref(null) const purchaseTextarea = ref('')
const addPurchase = async () => { const addPurchase = async () => {
addPurchaseVisible.value = true addPurchaseVisible.value = true
purchaseTextarea.value = ''
} }
const submitPurchase = async () => { const submitPurchase = async () => {
if (!purchaseTextarea.value) { if (!purchaseTextarea.value) {
...@@ -1736,20 +1752,24 @@ onMounted(() => { ...@@ -1736,20 +1752,24 @@ onMounted(() => {
width: 500px; width: 500px;
text-align: center; text-align: center;
} }
.cursor-pointer { .cursor-pointer {
cursor: pointer; cursor: pointer;
} }
.header-filter-form { .header-filter-form {
:deep(.el-form-item) { :deep(.el-form-item) {
margin-right: 14px; margin-right: 14px;
margin-bottom: 10px; margin-bottom: 10px;
} }
} }
.product-dialog-footer { .product-dialog-footer {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin: 8px 0; margin: 8px 0;
} }
$border: solid 1px #ddd; $border: solid 1px #ddd;
.send-order-list { .send-order-list {
...@@ -1797,10 +1817,12 @@ $border: solid 1px #ddd; ...@@ -1797,10 +1817,12 @@ $border: solid 1px #ddd;
.left { .left {
width: 160px; width: 160px;
:deep(.el-tree-node__content) { :deep(.el-tree-node__content) {
height: 30px; height: 30px;
line-height: 30px; line-height: 30px;
} }
:deep(.el-tree-node__label) { :deep(.el-tree-node__label) {
font-size: 13px; font-size: 13px;
cursor: pointer; cursor: pointer;
...@@ -1892,6 +1914,7 @@ $border: solid 1px #ddd; ...@@ -1892,6 +1914,7 @@ $border: solid 1px #ddd;
height: 5px; height: 5px;
background: #eff3f6; background: #eff3f6;
} }
.btn-list { .btn-list {
margin-bottom: 10px; margin-bottom: 10px;
} }
...@@ -1923,6 +1946,7 @@ $border: solid 1px #ddd; ...@@ -1923,6 +1946,7 @@ $border: solid 1px #ddd;
} }
} }
} }
.delivery-note-page { .delivery-note-page {
:deep(#top) { :deep(#top) {
height: 100%; height: 100%;
......
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