Commit 6d3b965d by wuqian

new-pod-cn

parent cc6f038d
...@@ -8,6 +8,7 @@ import { ...@@ -8,6 +8,7 @@ import {
WarehouseListData, WarehouseListData,
LogisticsData, LogisticsData,
ExportParams, ExportParams,
IconfirmSubmit
} from '@/types/api/podCnOrder' } from '@/types/api/podCnOrder'
import { InterceptStateGroupData } from '@/types/api/podUsOrder' import { InterceptStateGroupData } from '@/types/api/podUsOrder'
import axios from './axios' import axios from './axios'
...@@ -32,6 +33,24 @@ export function syncReceiverAddress(data: number[]) { ...@@ -32,6 +33,24 @@ export function syncReceiverAddress(data: number[]) {
data, data,
) )
} }
export function getPackingCnDataApi(
code: string,
factoryNo: number,
box: number | null,
warehouseId: number | string,
) {
return axios.get<never, BaseRespData<PodMakeOrderData>>(
'/factory/podJomallOrderCn/getPodBoxDetailsBySkuOrNo',
{
params: {
podJomallCnNo: code,
box,
factoryNo,
warehouseId,
},
},
)
}
export function refreshAddressApi(idList: number[]) { export function refreshAddressApi(idList: number[]) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderCn/syncReceiverAddress', 'factory/podJomallOrderCn/syncReceiverAddress',
...@@ -382,10 +401,10 @@ export function replenishmentSuccessApi(data: number[]) { ...@@ -382,10 +401,10 @@ export function replenishmentSuccessApi(data: number[]) {
) )
} }
//确认生产 //确认生产
export function confirmProductApi(orderIds: (string | number)[]) { export function confirmProductApi(data:IconfirmSubmit) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
`factory/podJomallOrderCn/confirmProduct`, `factory/podJomallOrderCn/confirmProduct`,
orderIds, data,
) )
} }
export function toOutOfStockApi(ids: number[]) { export function toOutOfStockApi(ids: number[]) {
...@@ -450,6 +469,14 @@ export function batchDownloadRecomposingApi(params: { id: number }) { ...@@ -450,6 +469,14 @@ export function batchDownloadRecomposingApi(params: { id: number }) {
}, },
) )
} }
export function batchDownloadCnRecomposingApi(params: { id: number }) {
return axios.get<never, BaseRespData<never>>(
`factory/podBatchDownload/reCnComposingDesignImages`,
{
params,
},
)
}
// 生产完成 // 生产完成
export function updateToWaitShipmentApi(params: { export function updateToWaitShipmentApi(params: {
cnUpdateParams: Array<{ cnUpdateParams: Array<{
...@@ -515,7 +542,7 @@ export function updateSelfLogistics(params: { ...@@ -515,7 +542,7 @@ export function updateSelfLogistics(params: {
id?: string id?: string
}) { }) {
return axios.post<never, BaseRespData<never>>( return axios.post<never, BaseRespData<never>>(
'factory/podJomallOrderUs/updateSelfLogistics', 'factory/podJomallOrderCn/updateSelfLogistics',
params, params,
) )
} }
......
import { defineStore } from 'pinia'
import {
OrderData,
PodMakeOrderData,
ProductList,
} from '@/types/api/podMakeOrder'
import { getPodBoxListApi } from '@/api/podCnOrder'
export interface OrderStoreState {
podBoxList?: PodMakeOrderData[]
podBoxIndex?: number | null
socketConnect?: string
}
const useOrderStore = defineStore('order', {
state: () => {
return {
podBoxList: [],
podBoxIndex: null,
socketConnect: '',
} as OrderStoreState
},
actions: {
async setPodBoxList(content: {
boxList: PodMakeOrderData[] | OrderData | null
factoryNo: number | string
warehouseId: number | string
box?: number
data?: OrderData
}) {
const { factoryNo, warehouseId, boxList, box, data } = content
if (Array.isArray(boxList)) {
this.podBoxList = boxList
} else {
const index = this.podBoxList?.findIndex((item) => item.box === box)
if (index === -1) {
try {
const res = await getPodBoxListApi(factoryNo, warehouseId)
const boxList = res.data.map((item) => {
if (res.data) {
const productList = item?.data?.productList || []
const pickingNumber = productList.reduce(
(prev: number, item1: ProductList) => {
if (item1.count) {
return prev + item1.count
}
return prev
},
0,
)
if (item.data) {
item.data.pickingNumber = pickingNumber
}
}
return item
})
this.podBoxList = boxList
this.podBoxIndex = box
} catch (error) {
console.error(error)
}
} else if (box !== 0 && box !== undefined) {
const arr = this.podBoxList
if (arr) {
arr[box - 1] = {
box,
data: data || boxList || null,
}
}
this.podBoxList = arr
this.podBoxIndex = box
}
}
},
// 清空所有箱子
clearPodBoxList() {
this.podBoxList = []
},
// 设置当前箱子
setPodBox(box: number) {
this.podBoxIndex = box
},
// 清空当前箱子
clearPodBox() {
this.podBoxIndex = null
},
setSocketConnect(connect: string) {
this.socketConnect = connect
},
},
})
export default useOrderStore
...@@ -66,7 +66,6 @@ const useOrderStore = defineStore('order', { ...@@ -66,7 +66,6 @@ const useOrderStore = defineStore('order', {
data: data || boxList || null, data: data || boxList || null,
} }
} }
console.log('222arr1111', arr)
this.podBoxList = arr this.podBoxList = arr
this.podBoxIndex = box this.podBoxIndex = box
} }
......
...@@ -3,6 +3,11 @@ export interface Tab { ...@@ -3,6 +3,11 @@ export interface Tab {
statusName?: string statusName?: string
quantity?: number quantity?: number
} }
export interface IconfirmSubmit {
ids: string
warehouseId: number | null
warehouseName: string
}
export interface ExportParams extends SearchForm { export interface ExportParams extends SearchForm {
idList?: number[] idList?: number[]
exportAll: boolean exportAll: boolean
...@@ -32,6 +37,8 @@ export interface SearchForm { ...@@ -32,6 +37,8 @@ export interface SearchForm {
batchArrangeNumber?: string batchArrangeNumber?: string
craftCode?: string craftCode?: string
thirdStockSku?: string thirdStockSku?: string
exceptionHandling?: number | undefined
interceptStatus?: number | string
} }
export interface PodCnOrderListData { export interface PodCnOrderListData {
id: number id: number
...@@ -122,7 +129,9 @@ export interface ProductList { ...@@ -122,7 +129,9 @@ export interface ProductList {
isReplenishment?: boolean isReplenishment?: boolean
thirdSkuCode?: string | null thirdSkuCode?: string | null
supplierProductNo?: string | null supplierProductNo?: string | null
userMark?: string | null
replenishmentSumNum?: number | null replenishmentSumNum?: number | null
interceptStatus?: number | null
batchArrangeNumber?: string | null batchArrangeNumber?: string | null
} }
export interface cardImages { export interface cardImages {
......
...@@ -45,5 +45,6 @@ export interface ProductList { ...@@ -45,5 +45,6 @@ export interface ProductList {
power?: boolean power?: boolean
variantImage?: string variantImage?: string
podJomallUsNo?: string podJomallUsNo?: string
podJomallCnNo?: string
previewImgs?: { sort: string | number; title: string; url: string }[] previewImgs?: { sort: string | number; title: string; url: string }[]
} }
import { getWsUrl } from '../api/axios'
import useOrderStore from '../store/cnOrder'
interface NotificationOptions {
body: string
icon: string
data: string
requireInteraction: boolean
}
export interface WebSocketMessage {
code?: string
content?: string
type?: string
data?: unknown
[key: string]: string | unknown | undefined
}
interface InitOptions {
account: string
factoryNo: string
}
type MessageCallback = (
data: WebSocketMessage,
sendSystemMessage: (msg: string) => void,
) => void
type OpenCallback = () => void
function sendSystemMessage(msg: string): void {
if (window.Notification && Notification.permission === 'granted') {
const notificationOptions: NotificationOptions = {
body: msg,
icon: './favicon.ico',
data: 'I like peas.',
requireInteraction: true,
}
const n = new Notification('消息通知', notificationOptions)
n.onclick = (event: Event) => {
event.preventDefault()
window.open('/home', '_blank')
}
setTimeout(() => {
n.close()
}, 10000)
}
}
const showReconnectingMsg = (): void => {
ElMessageBox.alert('消息服务已断开,正在重新连接,请稍候', {
showClose: true,
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
}
class Im {
private socket: WebSocket | null = null
private _wsUrl: string = ''
// private userId: string = ''
private _onMessageCallback?: MessageCallback
private _onOpenCallback?: OpenCallback
private _heartbeatTimer: number | null = null
private _heartbeatTimeoutTimer: number | null = null
private _reconnectingTimer: number | null = null
private num: number = 0
constructor() {
this._onWsOpen = this._onWsOpen.bind(this)
this._onWsMessage = this._onWsMessage.bind(this)
this._onWsClose = this._onWsClose.bind(this)
this._onWsError = this._onWsError.bind(this)
}
private _onWsOpen(): void {
console.log('服务器连接成功')
localStorage.setItem('socket_connect', 'online')
this._onOpenCallback?.()
this._startHeartbeat()
}
private _onWsMessage(event: MessageEvent): void {
let data: WebSocketMessage = {}
if (typeof event.data === 'string') {
try {
data = JSON.parse(event.data)
} catch (error) {
data = {}
}
}
this._onHeartbeatMessage()
this._onMessageCallback?.(data, sendSystemMessage)
}
private _onWsClose(): void {
console.log('服务器关闭')
this._destroyWebSocket(true)
}
private _onWsError(): void {
console.log('连接出错')
this._destroyWebSocket(true)
}
private _sendHeartbeat(): void {
if (!this.socket) return
this.send({ code: 'HEALTH' })
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
this._heartbeatTimeoutTimer = window.setTimeout(() => {
this._destroyWebSocket(true)
}, 5 * 1000)
}
private _onHeartbeatMessage(): void {
console.log('心跳')
useOrderStore().setSocketConnect('online')
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
}
private _startHeartbeat(): void {
this._stopHeartbeat()
this._sendHeartbeat()
this._heartbeatTimer = window.setInterval(
() => this._sendHeartbeat(),
10 * 1000,
)
}
private _stopHeartbeat(): void {
if (this._heartbeatTimer) {
window.clearInterval(this._heartbeatTimer)
}
if (this._heartbeatTimeoutTimer) {
window.clearTimeout(this._heartbeatTimeoutTimer)
}
}
private _scheduleReconnect(): void {
if (!this.num) this.num = 0
this.num++
if (this.num > 5) {
ElMessageBox.alert('尝试重连消息服务失败,请刷新重试')
return
}
showReconnectingMsg()
this._reconnectingTimer = window.setTimeout(() => {
this._createWebSocket()
}, 2000)
}
private _destroyWebSocket(reconnect?: boolean): void {
if (!this.socket) return
this._stopHeartbeat()
if (this._reconnectingTimer) {
window.clearTimeout(this._reconnectingTimer)
}
this.socket.removeEventListener('open', this._onWsOpen)
this.socket.removeEventListener('message', this._onWsMessage)
this.socket.removeEventListener('close', this._onWsClose)
this.socket.removeEventListener('error', this._onWsError)
this.socket.close(1000)
this.socket = null
localStorage.removeItem('socket_connect')
useOrderStore().setSocketConnect('offline')
if (reconnect) this._scheduleReconnect()
}
private _createWebSocket(): void {
if (!this._wsUrl) return
const socket = new WebSocket(this._wsUrl)
socket.addEventListener('open', this._onWsOpen)
socket.addEventListener('message', this._onWsMessage)
socket.addEventListener('close', this._onWsClose)
socket.addEventListener('error', this._onWsError)
this.socket = socket
}
init(
options: InitOptions,
msgfunc?: MessageCallback,
openfunc?: OpenCallback,
): Promise<void> {
return new Promise((resolve, reject) => {
const { account, factoryNo } = options
const socket_connect = localStorage.getItem('socket_connect')
if (socket_connect === 'online') {
resolve()
return
}
if (!window.WebSocket) {
reject(new Error('WebSocket is not supported'))
return
}
this._onMessageCallback = msgfunc
this._onOpenCallback = () => {
openfunc?.()
resolve()
}
this._destroyWebSocket()
this._wsUrl = `${getWsUrl()}/ws/websocket/${factoryNo}/${account}`
this._createWebSocket()
})
}
send(options: WebSocketMessage): void {
this.socket?.send(JSON.stringify(options))
}
close(): void {
this._destroyWebSocket()
}
}
export default new Im()
...@@ -227,17 +227,18 @@ import { ...@@ -227,17 +227,18 @@ import {
PodMakeOrderData, PodMakeOrderData,
ProductList, ProductList,
} from '@/types/api/podMakeOrder' } from '@/types/api/podMakeOrder'
import useOrderStore from '@/store/order' import useOrderStore from '@/store/cnOrder'
import { import {
getPackingCnDataApi,
clearBoxApi, clearBoxApi,
clearAllBoxApi, clearAllBoxApi,
getPackingDataApi,
getPodBoxListApi, getPodBoxListApi,
submitInspectionApi, submitInspectionApi,
} from '@/api/podUsOrder' } from '@/api/podCnOrder'
import useUserStore from '@/store/user' import useUserStore from '@/store/user'
import { Check } from '@element-plus/icons-vue' import { Check } from '@element-plus/icons-vue'
import socket from '@/utils/websocket' import socket from '@/utils/cnWebsocket'
import { WarehouseListData } from '@/types/api/podUsOrder' import { WarehouseListData } from '@/types/api/podUsOrder'
const { getCLodop } = useLodop() const { getCLodop } = useLodop()
...@@ -272,7 +273,7 @@ const podOrderDetailsColumns = computed(() => [ ...@@ -272,7 +273,7 @@ const podOrderDetailsColumns = computed(() => [
}, },
{ {
label: '生产单号', label: '生产单号',
prop: 'podJomallUsNo', prop: 'podJomallCnNo',
width: 150, width: 150,
align: 'center', align: 'center',
}, },
...@@ -326,9 +327,17 @@ watch(visible, async (value: boolean) => { ...@@ -326,9 +327,17 @@ watch(visible, async (value: boolean) => {
if (value) { if (value) {
podOrderDetailsData.value = {} podOrderDetailsData.value = {}
currentCode = '' currentCode = ''
warehouseId.value = props.warehouseList[0].id // warehouseId.value = props.warehouseList[0].id
_warehouseId.value = props.warehouseList[0].id // _warehouseId.value = props.warehouseList[0].id
const locaclWarehouseId = sessionStorage.getItem('locaclCnWarehouseId')
// 设置仓库ID,优先使用本地存储的值,否则使用列表中的第一个仓库
warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
_warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
try { try {
await socket.init( await socket.init(
...@@ -367,6 +376,7 @@ watch(boxIndex, (value: number | null) => { ...@@ -367,6 +376,7 @@ watch(boxIndex, (value: number | null) => {
if (value) { if (value) {
const bool = !boxChange.value const bool = !boxChange.value
boxChange.value = false boxChange.value = false
console.log('boxChange', bool, value)
renderItemBox(bool) renderItemBox(bool)
} }
}) })
...@@ -440,15 +450,14 @@ const renderItemBox = (bool: boolean) => { ...@@ -440,15 +450,14 @@ const renderItemBox = (bool: boolean) => {
if (currentCode) { if (currentCode) {
const parts = currentCode.split('_') const parts = currentCode.split('_')
currentCode = currentCode =
parts.length > 3 && parts[3].startsWith('USPSC') parts.length > 3 && parts[3].startsWith('CNPSC')
? parts[3] ? parts[3]
: parts.length > 1 : parts.length > 1
? parts[1] ? parts[1]
: parts[0] : parts[0]
for (const product of productList) { for (const product of productList) {
if (product.podJomallUsNo === currentCode) { if (product.podJomallCnNo === currentCode) {
coverImage.value = product.previewImgs?.[0]?.url || '' coverImage.value = product.previewImgs?.[0]?.url || ''
console.log(441, coverImage.value)
nextTick(() => { nextTick(() => {
tableRef.value?.setCurrentRow(product) tableRef.value?.setCurrentRow(product)
...@@ -460,7 +469,6 @@ const renderItemBox = (bool: boolean) => { ...@@ -460,7 +469,6 @@ const renderItemBox = (bool: boolean) => {
} }
podOrderDetailsData.value = data podOrderDetailsData.value = data
if (productList.every((item) => item.power)) { if (productList.every((item) => item.power)) {
print(data, false, () => { print(data, false, () => {
renderLock = false renderLock = false
...@@ -473,7 +481,7 @@ const messageChange = (data: WebSocketMessage) => { ...@@ -473,7 +481,7 @@ const messageChange = (data: WebSocketMessage) => {
if (!data) return if (!data) return
const { code, ...more } = data const { code, ...more } = data
if (code === 'POD_PRINT_ORDER') { if (code === 'FACTORY_POD_CN_PRINT_ORDER') {
try { try {
if (typeof more.txt === 'string') { if (typeof more.txt === 'string') {
console.log( console.log(
...@@ -571,7 +579,7 @@ const getPackingData = async (code: string) => { ...@@ -571,7 +579,7 @@ const getPackingData = async (code: string) => {
productionOrder.value = '' productionOrder.value = ''
return return
} }
const res = await getPackingDataApi( const res = await getPackingCnDataApi(
code, code,
factoryNo, factoryNo,
boxIndex.value, boxIndex.value,
...@@ -584,7 +592,6 @@ const getPackingData = async (code: string) => { ...@@ -584,7 +592,6 @@ const getPackingData = async (code: string) => {
return return
} }
const { box } = res.data const { box } = res.data
console.log('box', box)
if (box) { if (box) {
boxIndex.value = box boxIndex.value = box
...@@ -748,6 +755,7 @@ const handleClose = (done: () => void) => { ...@@ -748,6 +755,7 @@ const handleClose = (done: () => void) => {
}) })
} }
const onClose = () => { const onClose = () => {
// orderStore.clearPodBox()
emit('refresh') emit('refresh')
} }
// 下一步 // 下一步
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<el-dialog <el-dialog
title="处理结果" title="处理结果"
v-model="resultDialog" v-model="resultDialog"
width="600px" width="60%"
:close-on-click-modal="false" :close-on-click-modal="false"
@closed="closedFn" @closed="closedFn"
> >
...@@ -128,6 +128,7 @@ const copyAllCode = (field: string) => { ...@@ -128,6 +128,7 @@ const copyAllCode = (field: string) => {
function closedFn() { function closedFn() {
if (key === 'stockOut') return if (key === 'stockOut') return
emits('confirm', selectedList.value) emits('confirm', selectedList.value)
} }
// 监听弹窗状态 // 监听弹窗状态
......
<script setup lang="ts"> <script setup lang="ts">
import { defineModel } from 'vue' import { defineModel } from 'vue'
import { updateAddressApi } from '@/api/podUsOrder.ts' import { updateAddressApi } from '@/api/podCnOrder.ts'
import {AddressInfo} from '@/types/api/podUsOrder.ts' import {AddressInfo} from '@/types/api/podCnOrder.ts'
const emits = defineEmits(['success']) const emits = defineEmits(['success'])
defineProps<{ defineProps<{
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
clearable clearable
filterable filterable
placeholder="请输入" placeholder="请选择"
style="width: 150px" style="width: 150px"
> >
<el-option <el-option
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
</ElFormItem> </ElFormItem>
<ElFormItem label="款号"> <ElFormItem label="款号">
<ElInput <ElInput
v-model="searchForm.supplierProductNo" v-model.trim="searchForm.supplierProductNo"
placeholder="款号" placeholder="款号"
clearable clearable
style="width: 150px" style="width: 150px"
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
</ElFormItem> </ElFormItem>
<ElFormItem label="批次号"> <ElFormItem label="批次号">
<ElInput <ElInput
v-model="searchForm.batchArrangeNumber" v-model.trim="searchForm.batchArrangeNumber"
placeholder="批次号" placeholder="批次号"
clearable clearable
style="width: 150px" style="width: 150px"
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</ElFormItem> </ElFormItem>
<ElFormItem label="生产单号"> <ElFormItem label="生产单号">
<ElInput <ElInput
v-model="searchForm.factorySubOrderNumber" v-model.trim="searchForm.factorySubOrderNumber"
placeholder="生产单号" placeholder="生产单号"
clearable clearable
style="width: 150px" style="width: 150px"
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
</ElFormItem> </ElFormItem>
<ElFormItem label="店铺单号"> <ElFormItem label="店铺单号">
<ElInput <ElInput
v-model="searchForm.shopNumber" v-model.trim="searchForm.shopNumber"
placeholder="店铺单号" placeholder="店铺单号"
clearable clearable
style="width: 150px" style="width: 150px"
...@@ -306,7 +306,7 @@ ...@@ -306,7 +306,7 @@
转至待确认 转至待确认
</ElButton> </ElButton>
</span> </span>
<span v-if="status === 'CREATE_LOGISTICS'" class="item"> <span v-if="status === 'EXCEPTION_ORDER'&&exceptionStatus === 3" class="item">
<ElButton type="warning" @click="asyncOrderAddress"> <ElButton type="warning" @click="asyncOrderAddress">
同步收货地址 同步收货地址
</ElButton> </ElButton>
...@@ -408,8 +408,14 @@ ...@@ -408,8 +408,14 @@
> >
</ElDropdownMenu> </ElDropdownMenu>
</template> --> </template> -->
<!-- 代发:0.自有物流 1.工厂物流; 不代发: 0.自提 1.快递-->
<template #dropdown v-if="shipmentArea === 1"> <template
v-if="
(status === 'CREATE_LOGISTICS' && shipmentArea === 1) ||
status === 'WAIT_SHIPMENT'
"
#dropdown
>
<ElDropdownMenu> <ElDropdownMenu>
<ElDropdownItem <ElDropdownItem
:disabled=" :disabled="
...@@ -488,7 +494,7 @@ ...@@ -488,7 +494,7 @@
拦截失败 拦截失败
</ElButton> </ElButton>
</span> </span>
<span <!-- <span
v-if=" v-if="
status === 'TO_BE_CONFIRMED' || status === 'TO_BE_CONFIRMED' ||
status === 'PICKING' || status === 'PICKING' ||
...@@ -501,7 +507,7 @@ ...@@ -501,7 +507,7 @@
<ElButton type="success" @click="refreshMaterial"> <ElButton type="success" @click="refreshMaterial">
刷新素材 刷新素材
</ElButton> </ElButton>
</span> </span> -->
<span <span
v-if=" v-if="
[ [
...@@ -512,6 +518,7 @@ ...@@ -512,6 +518,7 @@
'TO_BE_REPLENISHMENT', 'TO_BE_REPLENISHMENT',
'IN_PRODUCTION', 'IN_PRODUCTION',
'TO_BE_ARRANGE', 'TO_BE_ARRANGE',
'WAIT_SHIPMENT',
].includes(status) ].includes(status)
" "
class="item" class="item"
...@@ -575,7 +582,10 @@ ...@@ -575,7 +582,10 @@
</template> </template>
</ElDropdown> </ElDropdown>
</span> </span>
<span v-if="status === 'COMPLETE'" class="item"> <span
v-if="['WAIT_TRACK', 'COMPLETE', 'IN_TRANSIT'].includes(status)"
class="item"
>
<ElButton type="warning" @click="statusPush">状态推送</ElButton> <ElButton type="warning" @click="statusPush">状态推送</ElButton>
</span> </span>
<span v-if="status === 'COMPLETE'" class="item"> <span v-if="status === 'COMPLETE'" class="item">
...@@ -743,13 +753,32 @@ ...@@ -743,13 +753,32 @@
<TableView <TableView
ref="tableRef" ref="tableRef"
:columns="tableColumns" :columns="tableColumns"
:serial-numberable="true"
:selectionable="true" :selectionable="true"
:paginated-data="tableData" :paginated-data="tableData"
:cell-style="onCellStyle" :cell-style="onCellStyle"
:row-style="getRowStyle" :row-style="getRowStyle"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<template #serialNumber="{ row, index }">
<div>
<el-tooltip
v-if="
status !== 'INTERCEPTED' &&
(row.interceptStatus == 0 || row.interceptStatus == 2)
"
effect="light"
:content="
row.interceptStatus == 0
? '订单已提交至生产拦截申请'
: '订单已提交至发货拦截申请'
"
placement="bottom"
>
<el-icon color="#E6A23C"><InfoFilled /></el-icon>
</el-tooltip>
<span class="serial-number">{{ index + 1 }}</span>
</div>
</template>
<template #goods="{ row }"> <template #goods="{ row }">
<div class="goods-info-box"> <div class="goods-info-box">
<div class="goods-list"> <div class="goods-list">
...@@ -906,27 +935,33 @@ ...@@ -906,27 +935,33 @@
</div> </div>
<div class="goods-item-info"> <div class="goods-item-info">
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">价格:</span> <span class="goods-item-info-item-label">价格:</span>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.productPrice }}(¥) {{ item.productPrice }}
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">模板金额:</span> <span class="goods-item-info-item-label"
>模板金额¥:</span
>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.templatePrice }}(¥) {{ item.templatePrice }}
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">工艺金额:</span> <span class="goods-item-info-item-label"
>工艺金额¥:</span
>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.craftPrice }}(¥) {{ item.craftPrice }}
</span> </span>
</div> </div>
<div class="goods-item-info-item"> <div class="goods-item-info-item">
<span class="goods-item-info-item-label">付款金额:</span> <span class="goods-item-info-item-label"
>付款金额¥:</span
>
<span class="goods-item-info-item-value"> <span class="goods-item-info-item-value">
{{ item.payAmount }}(¥) {{ item.payAmount }}
</span> </span>
</div> </div>
...@@ -1024,6 +1059,7 @@ ...@@ -1024,6 +1059,7 @@
</el-icon> </el-icon>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<!-- 是否代发 0.否 1.是 -->
<span class="order-detail-item-label">是否代发:</span> <span class="order-detail-item-label">是否代发:</span>
<span <span
style="color: red; font-weight: 500" style="color: red; font-weight: 500"
...@@ -1038,11 +1074,22 @@ ...@@ -1038,11 +1074,22 @@
style="color: red; font-weight: 500" style="color: red; font-weight: 500"
class="order-detail-item-value" class="order-detail-item-value"
> >
{{ ['自有物流', '工厂物流'][row.shipmentType] }} {{
row.replaceShipment === 1
? ['自有物流', '工厂物流'][row.shipmentType]
: ['自提', '快递'][row.shipmentType]
}}
</span> </span>
</div> </div>
<div class="order-detail-item"> <div class="order-detail-item">
<span class="order-detail-item-label">物流跟踪号:</span> <span class="order-detail-item-label">
<!-- 自提时叫 取货码-->
{{
row.replaceShipment === 0 && row.shipmentType === 0
? '取货码:'
: '物流跟踪号:'
}}</span
>
<span class="order-detail-item-value"> <span class="order-detail-item-value">
<el-button <el-button
type="primary" type="primary"
...@@ -1065,18 +1112,6 @@ ...@@ -1065,18 +1112,6 @@
</span> </span>
</div> </div>
<div <div
v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-detail-item"
>
<span class="order-detail-item-label">生产端:</span>
<span
class="order-detail-item-value"
:title="row.productionClient"
>
{{ row.productionClient }}
</span>
</div>
<div
v-if=" v-if="
row.productionClient === 'JOMALL' && row.productionClient === 'JOMALL' &&
row.status !== 'TO_BE_CONFIRMED' row.status !== 'TO_BE_CONFIRMED'
...@@ -1136,6 +1171,12 @@ ...@@ -1136,6 +1171,12 @@
class="order-detail-item-value" class="order-detail-item-value"
:title="row.lanshouAddress" :title="row.lanshouAddress"
> >
<!-- {{
row.receiverCountry +
row.receiverProvince +
row.receiverCity +
row.receiverAddress1
}} -->
{{ row.lanshouAddress }} {{ row.lanshouAddress }}
</span> </span>
</div> </div>
...@@ -1144,9 +1185,9 @@ ...@@ -1144,9 +1185,9 @@
<template #price="{ row }"> <template #price="{ row }">
<div class="order-price-box"> <div class="order-price-box">
<div class="order-price-item"> <div class="order-price-item">
<span class="order-price-item-label">商品总价:</span> <span class="order-price-item-label">商品总价</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.totalAmount }}(¥) {{ row.totalAmount }}
</span> </span>
</div> </div>
...@@ -1154,9 +1195,9 @@ ...@@ -1154,9 +1195,9 @@
v-if="row.status !== 'TO_BE_CONFIRMED'" v-if="row.status !== 'TO_BE_CONFIRMED'"
class="order-price-item" class="order-price-item"
> >
<span class="order-price-item-label">物流运费:</span> <span class="order-price-item-label">物流运费</span>
<span class="order-price-item-value"> <span class="order-price-item-value">
{{ row.payFreight }}(¥) {{ row.payFreight || 0 }}
</span> </span>
</div> </div>
</div> </div>
...@@ -1306,6 +1347,7 @@ ...@@ -1306,6 +1347,7 @@
</span> --> </span> -->
<span <span
v-if=" v-if="
row.replaceShipment === 1 &&
row.shipmentType === 0 && row.shipmentType === 0 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status) ['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)
" "
...@@ -1328,8 +1370,11 @@ ...@@ -1328,8 +1370,11 @@
</span> </span>
<span <span
v-if=" v-if="
row.shipmentType === 0 && (row.replaceShipment === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status) ['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status)) ||
(row.replaceShipment === 0 &&
row.shipmentType === 1 &&
['CREATE_LOGISTICS', 'WAIT_SHIPMENT'].includes(status))
" "
class="operate-item" class="operate-item"
> >
...@@ -1367,6 +1412,23 @@ ...@@ -1367,6 +1412,23 @@
:image-field="'variantImage'" :image-field="'variantImage'"
@contextmenu.prevent="(v: MouseEvent) => rightClick(v)" @contextmenu.prevent="(v: MouseEvent) => rightClick(v)"
> >
<template #top_left>
<el-tooltip
v-if="
cardItem.interceptStatus == 0 ||
cardItem.interceptStatus == 2
"
effect="light"
:content="
cardItem.interceptStatus == 0
? '订单已提交至生产拦截申请'
: '订单已提交至发货拦截申请'
"
placement="bottom"
>
<el-icon color="#E6A23C"><InfoFilled /></el-icon>
</el-tooltip>
</template>
<template <template
#top_right #top_right
v-if="['ZPZY', 'CXZY', 'THZY'].includes(cardItem.craftCode as string)" v-if="['ZPZY', 'CXZY', 'THZY'].includes(cardItem.craftCode as string)"
...@@ -1451,6 +1513,42 @@ ...@@ -1451,6 +1513,42 @@
/> />
</div> </div>
</div> </div>
<div class="flex-row">
<el-tooltip
class="item"
effect="dark"
:content="'用户编码: ' + cardItem?.userMark"
placement="bottom"
>
<span
style="
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100%;
display: inline-block;
"
@click.stop="copy(String(cardItem?.userMark || ''))"
>
{{ cardItem?.userMark }}
</span>
</el-tooltip>
<b
v-if="cardItem"
:style="{
color:
(Number(cardItem.customizedQuantity) || 0) > 1
? 'red'
: '#67C23A',
}"
>
{{
(Number(cardItem.customizedQuantity) || 0) > 1
? '多'
: '单'
}}
</b>
</div>
</div> </div>
</template> </template>
<template #info> <template #info>
...@@ -1756,6 +1854,40 @@ ...@@ -1756,6 +1854,40 @@
</template> </template>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
v-model="confirmManuShow"
:close-on-click-modal="false"
title="确认生产"
width="40%"
>
<el-form
ref="confirmFormRef"
:model="confirmForm"
label-width="120px"
:rules="confirmRules"
>
<el-form-item label="仓库" prop="warehouseId">
<ElSelect
v-model="confirmForm.warehouseId"
clearable
filterable
placeholder="请选择仓库"
style="width: 80%"
>
<el-option
v-for="item in warehouseList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</ElSelect>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="confirmManuShow = false">取消</el-button>
<el-button type="primary" @click="confirmSubmit">确定</el-button>
</template>
</el-dialog>
<el-dialog
v-model="logVisible" v-model="logVisible"
title="操作日志" title="操作日志"
width="1000px" width="1000px"
...@@ -1776,6 +1908,7 @@ ...@@ -1776,6 +1908,7 @@
:print-order="printOrder" :print-order="printOrder"
:warehouse-list="warehouseList" :warehouse-list="warehouseList"
@set-printer="handlePrinterChange" @set-printer="handlePrinterChange"
@set-warehouseId="handleWarehouseIdChange"
@refresh="onFastRefresh" @refresh="onFastRefresh"
/> />
<ElDialog <ElDialog
...@@ -1832,7 +1965,57 @@ ...@@ -1832,7 +1965,57 @@
:country-list="countryList" :country-list="countryList"
@success="search" @success="search"
></UpdateAddress> ></UpdateAddress>
<el-dialog
v-model="logisticsVisible"
:close-on-click-modal="false"
width="700px"
title="更新物流信息"
>
<el-form
v-if="logisticsVisible"
ref="logisticsFormRef"
label-width="100px"
label-position="left"
:model="logisticsForm"
>
<el-form-item prop="processNumber" label="物流处理号">
<el-input
v-model="logisticsForm.processNumber"
placeholder="请输入物流处理号"
clearable
></el-input>
</el-form-item>
<el-form-item prop="trackingNumber" label="物流跟踪号">
<el-input
v-model="logisticsForm.trackingNumber"
placeholder="请输入物流跟踪号"
clearable
></el-input>
</el-form-item>
<el-form-item
v-if="logisticsForm.trackingNumber"
prop="expressSheetUrl"
label="物流面单"
>
<el-upload accept=".pdf" action="" :before-upload="expressSheetUpload">
<el-button type="primary">点击上传</el-button>
</el-upload>
<div v-if="logisticsForm.expressSheet" class="file">
<span>{{ logisticsForm.expressSheet.name }}</span>
<el-icon
class="expressSheetClose"
@click="logisticsForm.expressSheet = null"
>
<Close></Close>
</el-icon>
</div>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="logisticsVisible = false">取消</el-button>
<el-button type="primary" @click="logisticsSubmit"> 确定</el-button>
</template>
</el-dialog>
<!-- 导出 --> <!-- 导出 -->
<ElDialog <ElDialog
v-model="exportVisible" v-model="exportVisible"
...@@ -1922,6 +2105,7 @@ ...@@ -1922,6 +2105,7 @@
import { getUserMarkList } from '@/api/common' import { getUserMarkList } from '@/api/common'
// import { AnyObject } from '@/types/api/warehouse' // import { AnyObject } from '@/types/api/warehouse'
import { import {
InfoFilled,
CaretBottom, CaretBottom,
CaretTop, CaretTop,
ArrowDown, ArrowDown,
...@@ -1944,7 +2128,6 @@ import { ...@@ -1944,7 +2128,6 @@ import {
toBePickingApi, toBePickingApi,
loadWarehouseListApi, loadWarehouseListApi,
getLogisticsCalculation, getLogisticsCalculation,
refreshMaterialApi,
refreshProductInformationApi, refreshProductInformationApi,
composingDesignImages, composingDesignImages,
updateLogisticsToArrangeApi, updateLogisticsToArrangeApi,
...@@ -1959,7 +2142,7 @@ import { ...@@ -1959,7 +2142,7 @@ import {
batchDownloadApi, batchDownloadApi,
batchDownloadDownloadApi, batchDownloadDownloadApi,
batchDownloadDeleteApi, batchDownloadDeleteApi,
batchDownloadRecomposingApi, batchDownloadCnRecomposingApi,
updateToWaitShipmentApi, updateToWaitShipmentApi,
exportPodCnInfo, exportPodCnInfo,
createLogisticsOrdersApi, createLogisticsOrdersApi,
...@@ -1973,6 +2156,8 @@ import { ...@@ -1973,6 +2156,8 @@ import {
rejectToApi, rejectToApi,
statusPushApi, statusPushApi,
completeDeliveryApi, completeDeliveryApi,
updateSelfLogistics,
uploadExpressSheet,
} from '@/api/podCnOrder' } from '@/api/podCnOrder'
import { BaseRespData } from '@/types/api' import { BaseRespData } from '@/types/api'
...@@ -2098,6 +2283,7 @@ const submitExportForm = async () => { ...@@ -2098,6 +2283,7 @@ const submitExportForm = async () => {
const updateAddVisible = ref(false) const updateAddVisible = ref(false)
const initPageSize = ref(50) const initPageSize = ref(50)
const logisticsVisible = ref(false) const logisticsVisible = ref(false)
const logisticsFormRef = ref()
const logistics = { const logistics = {
processNumber: '', processNumber: '',
trackingNumber: '', trackingNumber: '',
...@@ -2666,7 +2852,7 @@ const handleReComposingDesign = async (row: PodCnOrderListData) => { ...@@ -2666,7 +2852,7 @@ const handleReComposingDesign = async (row: PodCnOrderListData) => {
reComposingLoadingMap[row.id] = true reComposingLoadingMap[row.id] = true
try { try {
const res = await batchDownloadRecomposingApi({ id: row.id }) const res = await batchDownloadCnRecomposingApi({ id: row.id })
if (res.code !== 200) return if (res.code !== 200) return
ElMessage.success(res.message) ElMessage.success(res.message)
search() search()
...@@ -2751,6 +2937,13 @@ const tableColumns = computed(() => { ...@@ -2751,6 +2937,13 @@ const tableColumns = computed(() => {
} }
return [ return [
{ {
label: '序号',
prop: 'serialNumber',
slot: 'serialNumber',
width: 60,
align: 'center',
},
{
label: '商品', label: '商品',
prop: 'goods', prop: 'goods',
slot: 'goods', slot: 'goods',
...@@ -2763,7 +2956,7 @@ const tableColumns = computed(() => { ...@@ -2763,7 +2956,7 @@ const tableColumns = computed(() => {
width: 300, width: 300,
}, },
{ {
label: '单价', label: '订单金额(¥)',
slot: 'price', slot: 'price',
width: 160, width: 160,
prop: 'price', prop: 'price',
...@@ -2855,6 +3048,10 @@ const asyncOrderAddress = async () => { ...@@ -2855,6 +3048,10 @@ const asyncOrderAddress = async () => {
const changeTab = (item: Tab) => { const changeTab = (item: Tab) => {
status.value = item.status || '' status.value = item.status || ''
localStorage.setItem('podCnStatus', item.status as string) localStorage.setItem('podCnStatus', item.status as string)
// 如果切换到INTERCEPTED状态,设置默认的exceptionStatus
if (item.status === 'INTERCEPTED' && !interceptCurrent.value) {
interceptCurrent.value = 1
}
selection.value = [] selection.value = []
cardSelection.value = [] cardSelection.value = []
stockOutSuccessIds.value = [] stockOutSuccessIds.value = []
...@@ -2951,11 +3148,17 @@ const { ...@@ -2951,11 +3148,17 @@ const {
timeRange.value && timeRange.value.length > 0 timeRange.value && timeRange.value.length > 0
? timeRange.value[1] ? timeRange.value[1]
: null, : null,
status: status.value, status: status.value === 'INTERCEPTED' ? '' : status.value,
shipmentArea: shipmentArea:
status.value === 'CREATE_LOGISTICS' status.value === 'CREATE_LOGISTICS'
? shipmentArea.value || undefined ? shipmentArea.value || undefined
: undefined, : undefined,
exceptionHandling:
status.value === 'EXCEPTION_ORDER'
? exceptionStatus.value || undefined
: undefined,
interceptStatus:
status.value === 'INTERCEPTED' ? interceptStatus.value : '',
}, },
page, page,
pageSize, pageSize,
...@@ -2973,6 +3176,7 @@ const { ...@@ -2973,6 +3176,7 @@ const {
? timeRange.value[1] ? timeRange.value[1]
: null, : null,
status: status.value, status: status.value,
interceptStatus: '',
}, },
page, page,
pageSize, pageSize,
...@@ -3002,50 +3206,66 @@ const handleProductionClientChange = async (v: string) => { ...@@ -3002,50 +3206,66 @@ const handleProductionClientChange = async (v: string) => {
const downloadFacebook = async (row: string) => { const downloadFacebook = async (row: string) => {
window.open(filePath + row, '_blank') window.open(filePath + row, '_blank')
} }
const confirmManuShow = ref(false)
const confirmFormRef = ref()
const confirmForm = reactive({
warehouseId: null,
})
const confirmRules = reactive({
warehouseId: [
{
required: true,
message: '请选择仓库',
trigger: 'change',
},
],
})
//确认生产 //确认生产
async function confirmProduct() { function confirmProduct() {
if (selection.value.length === 0) { if (selection.value.length === 0) {
return ElMessage.warning('请选择数据') return ElMessage.warning('请选择数据')
} }
confirmManuShow.value = true
confirmFormRef.value.resetFields()
}
async function confirmSubmit() {
try { try {
await showConfirm('确定生产吗?', { await confirmFormRef.value.validate()
confirmButtonText: '确认',
cancelButtonText: '取消',
type: 'warning',
})
const ids = selection.value.map((el) => el.id)
const { code, data } = await confirmProductApi([...ids])
if (code === 200) {
resultInfo.value = data || []
resultInfo.value =
(data as {
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}[]) || []
if (
Array.isArray(data) &&
(data as { status: boolean }[]).some((item) => !item.status)
) {
resultRefs.value?.showDialog()
} else {
search()
loadTabData()
}
}
ElMessage.success('操作成功')
// search()
// await loadTabData()
} catch { } catch {
resultInfo.value = []
return return
} }
const confirmName =
warehouseList.value.find((item) => item.id == confirmForm.warehouseId)
?.name || '未知仓库'
const ids = selection.value.map((el) => el.id).join(',')
const params = {
ids: ids,
warehouseId: confirmForm.warehouseId,
warehouseName: confirmName,
}
const { code, data } = await confirmProductApi(params)
if (code === 200) {
resultInfo.value = data || []
resultInfo.value =
(data as {
id: string | number
status: boolean
factoryOrderNumber?: string
message: string
}[]) || []
if (
Array.isArray(data) &&
(data as { status: boolean }[]).some((item) => !item.status)
) {
resultRefs.value?.showDialog()
} else {
search()
loadTabData()
}
}
ElMessage.success('操作成功')
confirmManuShow.value = false
} }
const handleConfirm = async () => { const handleConfirm = async () => {
if (!productionClientValue.value) { if (!productionClientValue.value) {
return ElMessage.warning('请选择生产端') return ElMessage.warning('请选择生产端')
...@@ -3758,11 +3978,12 @@ const logisticsToPicking = async () => { ...@@ -3758,11 +3978,12 @@ const logisticsToPicking = async () => {
} }
const sheetPrinter = ref('') const sheetPrinter = ref('')
const handlePrinterChange = (value: string) => { const handlePrinterChange = (value: string) => {
console.log('value', value)
sheetPrinter.value = value sheetPrinter.value = value
localStorage.setItem('sheetPrinter', JSON.stringify(value)) localStorage.setItem('sheetPrinter', JSON.stringify(value))
} }
const handleWarehouseIdChange = (value: string) => {
sessionStorage.setItem('locaclCnWarehouseId', JSON.stringify(value))
}
const { getCLodop } = useLodop() const { getCLodop } = useLodop()
const printOrder = async ( const printOrder = async (
data: OrderData, data: OrderData,
...@@ -3982,49 +4203,40 @@ const loadCraftList = async () => { ...@@ -3982,49 +4203,40 @@ const loadCraftList = async () => {
console.error(e) console.error(e)
} }
} }
const refreshMaterial = async () => {
if (status.value === 'PICKING' || status.value === 'TO_BE_REPLENISHMENT') {
if (cardSelection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
} else {
if (selection.value.length === 0) {
return ElMessage.warning('请选择数据')
}
}
const loading = ElLoading.service({
fullscreen: true,
text: '刷新中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await refreshMaterialApi({
orderIds:
status.value !== 'PICKING' && status.value !== 'TO_BE_REPLENISHMENT'
? selection.value.map((item) => item.id).join(',')
: undefined,
productIds:
status.value === 'PICKING' || status.value === 'TO_BE_REPLENISHMENT'
? cardSelection.value.map((item) => item.id).join(',')
: undefined,
})
if (res.code !== 200) return
ElMessage.success('刷新成功')
search()
cardSelection.value = []
} catch (e) {
console.error(e)
} finally {
loading.close()
}
}
const expressSheetUpload = async (file: File) => {
const fm = new FormData()
fm.append('file', file)
fm.append('trackingNumber', logisticsForm.value.trackingNumber)
const res = await uploadExpressSheet(fm as never)
logisticsForm.value.expressSheetUrl = res.message || ''
logisticsForm.value.expressSheet = file
return false
}
const showLogistics = (item: PodCnOrderListData) => { const showLogistics = (item: PodCnOrderListData) => {
currentRow.value = JSON.parse(JSON.stringify(item)) currentRow.value = JSON.parse(JSON.stringify(item))
logisticsVisible.value = true logisticsVisible.value = true
logisticsForm.value = JSON.parse(JSON.stringify(logistics)) logisticsForm.value = JSON.parse(JSON.stringify(logistics))
} }
const logisticsSubmit = () => {
if (!logisticsForm.value.expressSheetUrl) {
return ElMessage.warning('请上传物流面单')
}
logisticsFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
const params = {
trackingNumber: logisticsForm.value.trackingNumber,
expressSheet: logisticsForm.value.expressSheetUrl,
processNumber: logisticsForm.value.processNumber,
id: currentRow.value.id,
}
await updateSelfLogistics(params)
ElMessage.success('操作成功')
logisticsVisible.value = false
search()
}
})
}
watch( watch(
() => status.value, () => status.value,
(val) => { (val) => {
...@@ -4327,7 +4539,6 @@ useRouter().beforeEach((to, from, next) => { ...@@ -4327,7 +4539,6 @@ useRouter().beforeEach((to, from, next) => {
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
} }
.tabs-node_count { .tabs-node_count {
display: inline-block; display: inline-block;
min-width: 20px; min-width: 20px;
...@@ -4362,6 +4573,39 @@ useRouter().beforeEach((to, from, next) => { ...@@ -4362,6 +4573,39 @@ useRouter().beforeEach((to, from, next) => {
.card-list-item { .card-list-item {
cursor: pointer; cursor: pointer;
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
.images-position {
display: flex;
height: 30px;
gap: 10px;
padding: 10px 6px 0;
.item-image {
width: 30px;
height: 30px;
border: 1px solid #909399;
cursor: pointer;
img {
width: 100%;
height: 100%;
object-fit: cover;
}
}
}
b {
margin-right: 5px;
font-size: 15px;
}
}
.flex-row {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 15px;
}
} }
.images-position { .images-position {
......
...@@ -357,9 +357,17 @@ watch(visible, async (value: boolean) => { ...@@ -357,9 +357,17 @@ watch(visible, async (value: boolean) => {
if (value) { if (value) {
podOrderDetailsData.value = {} podOrderDetailsData.value = {}
currentCode = '' currentCode = ''
warehouseId.value = props.warehouseList[0].id // warehouseId.value = props.warehouseList[0].id
_warehouseId.value = props.warehouseList[0].id // _warehouseId.value = props.warehouseList[0].id
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
// 设置仓库ID,优先使用本地存储的值,否则使用列表中的第一个仓库
warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
_warehouseId.value = locaclWarehouseId
? JSON.parse(locaclWarehouseId)
: props.warehouseList[0].id
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
try { try {
await socket.init( await socket.init(
...@@ -382,9 +390,9 @@ watch(visible, async (value: boolean) => { ...@@ -382,9 +390,9 @@ watch(visible, async (value: boolean) => {
initOrderDetailBox() initOrderDetailBox()
initPrintDevice() initPrintDevice()
const locaclPrinter = localStorage.getItem('sheetPrinter') const locaclPrinter = localStorage.getItem('sheetPrinter')
const locaclWarehouseId = localStorage.getItem('locaclWarehouseId') // const locaclWarehouseId = localStorage.getItem('locaclWarehouseId')
if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter) if (locaclPrinter) sheetPrinter.value = JSON.parse(locaclPrinter)
if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId) // if (locaclWarehouseId) warehouseId.value = JSON.parse(locaclWarehouseId)
} else { } else {
if (userStore.user?.factory.id) { if (userStore.user?.factory.id) {
socket.send({ socket.send({
......
...@@ -2014,6 +2014,7 @@ ...@@ -2014,6 +2014,7 @@
v-model="podOrderVisible" v-model="podOrderVisible"
:print-order="printOrder" :print-order="printOrder"
:warehouse-list="warehouseList" :warehouse-list="warehouseList"
:is-cn="false"
@set-printer="handlePrinterChange" @set-printer="handlePrinterChange"
@set-warehouseId="handleWarehouseIdChange" @set-warehouseId="handleWarehouseIdChange"
@refresh="onFastRefresh" @refresh="onFastRefresh"
......
...@@ -27,10 +27,10 @@ export default defineConfig({ ...@@ -27,10 +27,10 @@ export default defineConfig({
host: true, host: true,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://10.168.31.130:8060', target: 'http://10.168.31.193:8060',
}, },
'/ws': { '/ws': {
target: 'ws://wkg.local.cn:8066', target: 'http://10.168.31.193:8060',
ws: true, ws: true,
changeOrigin: true, changeOrigin: true,
}, },
......
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