Commit b4f7fcfa by qinjianhui

feat: 播种墙配货修改

parent 7c1373d5
......@@ -187,12 +187,12 @@ export function batchDeleteApi(ids: (number | string)[]) {
export function restockCheckApi(
factoryId: number | string,
thirdSkuCode: string,
warehouseSku: string,
warehouseId: number | string,
) {
return axios.get<never, BaseRespData<void>>(
'factory/podOrder/replenishVerify',
{ params: { factoryId, thirdSkuCode, warehouseId } },
return axios.post<never, BaseRespData<void>>(
'factory/podOrder/outOfStock/autoMark',
{ factoryId, warehouseSku, warehouseId },
)
}
......
......@@ -64,7 +64,7 @@
<ElInput
ref="productionOrderRef"
v-model="productionOrder"
placeholder="请输入生产单号"
:placeholder="props.isNewOrder ? '请输入操作单号' : '请输入生产单号'"
clearable
style="width: 100%"
@keyup.enter="handleSearch"
......@@ -293,8 +293,10 @@ const props = withDefaults(
printOrder: (data: OrderData, callback: (status: boolean) => void) => void
warehouseList: WarehouseListData[]
isNewOrder: boolean
wsOpenCode: string
wsCloseCode: string
}>(),
{ isNewOrder: false },
{ isNewOrder: false, wsOpenCode: 'STARTORDER', wsCloseCode: 'ENDORDER' },
)
const emit = defineEmits([
'update:modelValue',
......@@ -325,8 +327,8 @@ const podOrderDetailsColumns = computed(() => [
align: 'center',
},
{
label: '生产单号',
prop: 'podJomallUsNo',
label: props.isNewOrder ? '操作单号' : '生产单号',
prop: props.isNewOrder ? 'operationNos' : 'podJomallUsNo',
width: 150,
align: 'center',
},
......@@ -406,7 +408,7 @@ watch(visible, async (value: boolean) => {
messageChange,
)
socket.send({
code: 'STARTORDER',
code: props.wsOpenCode,
factoryNo: userStore.user?.factory.id,
warehouseId: warehouseId.value,
})
......@@ -422,7 +424,7 @@ watch(visible, async (value: boolean) => {
} else {
if (userStore.user?.factory.id) {
socket.send({
code: 'ENDORDER',
code: props.wsCloseCode,
factoryNo: userStore.user?.factory.id,
warehouseId: warehouseId.value,
})
......@@ -442,11 +444,8 @@ watch(boxIndex, (value: number | null) => {
watch(
podBoxList,
(value) => {
console.log('podBoxIndex1111', podBoxIndex.value)
if (value) {
const item = value.find((item) => item.box === podBoxIndex.value)
console.log('podBoxList', value, podBoxIndex.value, item)
if (item?.data) {
renderItemBox(true)
} else {
......@@ -571,7 +570,7 @@ const messageChange = (data: WebSocketMessage) => {
if (!data) return
const { code, ...more } = data
if (code === 'POD_PRINT_ORDER') {
if (code === 'POD_PRINT_ORDER' || code === 'FACTORY_POD_ORDER_PRINT_ORDER') {
try {
if (typeof more.txt === 'string') {
console.log(
......@@ -586,7 +585,10 @@ const messageChange = (data: WebSocketMessage) => {
console.log('WebSocketMessage', more)
setPodBoxList(more)
} else if (code === 'POD_BOX_FLUSH') {
} else if (
code === 'POD_BOX_FLUSH' ||
code === 'FACTORY_POD_ORDER_BOX_FLUSH'
) {
initOrderDetailBox()
}
}
......@@ -1130,7 +1132,7 @@ const handleWarehouseChange = (value: string | number) => {
if (!value) return
if (_warehouseId.value !== warehouseId.value) {
socket.send({
code: 'ENDORDER',
code: props.wsCloseCode,
factoryNo: userStore.user?.factory.id,
warehouseId: _warehouseId.value,
})
......@@ -1138,7 +1140,7 @@ const handleWarehouseChange = (value: string | number) => {
warehouseId.value = value
emit('set-warehouseId', value)
socket.send({
code: 'STARTORDER',
code: props.wsOpenCode,
factoryNo: userStore.user?.factory.id,
warehouseId: warehouseId.value,
})
......@@ -1183,7 +1185,7 @@ const reconnectWebSocket = async () => {
messageChange,
)
socket.send({
code: 'STARTORDER',
code: props.wsOpenCode,
factoryNo: userStore.user?.factory.id,
warehouseId: warehouseId.value,
})
......
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