Commit 3269bc05 by qinjianhui

Merge branch 'dev' into 'master'

Dev

See merge request !238
parents 2575a787 fee6d6cc
...@@ -537,10 +537,14 @@ export function completeDeliveryApi(ids: (number | string)[]) { ...@@ -537,10 +537,14 @@ export function completeDeliveryApi(ids: (number | string)[]) {
} }
// 生产扫码 // 生产扫码
export function productionScanApi(id: number | string, status: string) { export function productionScanApi(
id: number | string,
status: string,
type: string,
) {
return axios.get<never, BaseRespData<never>>( return axios.get<never, BaseRespData<never>>(
'factory/podOrderOperation/scan-produce', 'factory/podOrderOperation/scan-produce',
{ params: { id, status } }, { params: { id, status, type } },
) )
} }
...@@ -655,7 +659,7 @@ export function interceptUpdateApi(ids: (string | number)[]) { ...@@ -655,7 +659,7 @@ export function interceptUpdateApi(ids: (string | number)[]) {
} }
export function interceptSuccessApi( export function interceptSuccessApi(
data: { factoryOrderNumber: string; suspendSussessType: number }[], data: { factoryOrderNumber: string; blockSuccessType: number }[],
) { ) {
return axios.post<never, BaseRespData<ResultInfoDataItem[]>>( return axios.post<never, BaseRespData<ResultInfoDataItem[]>>(
'factory/podOrder/factoryOrderBlockSuccess', 'factory/podOrder/factoryOrderBlockSuccess',
...@@ -680,3 +684,11 @@ export function exportOrderInventoryApi(data: Record<string, unknown>) { ...@@ -680,3 +684,11 @@ export function exportOrderInventoryApi(data: Record<string, unknown>) {
data, data,
) )
} }
// 配货完成 按钮
export function deliveryCompleteApi(data: { id: number; version?: number }[]) {
return axios.post<never, BaseRespData<ResultInfoDataItem[]>>(
'factory/podOrder/podPrintOrderShipmentComplete',
{ orderParamList: data },
)
}
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
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="onChangeCopy('select-all')">全部选择</div> <div v-if="showSelectionMenu" class="menu-item" @click="onChangeCopy('select-all')">全部选择</div>
<div class="menu-item" @click="onChangeCopy('cancel-select')">取消选择</div> <div v-if="showSelectionMenu" class="menu-item" @click="onChangeCopy('cancel-select')">取消选择</div>
<div <div
v-if="showCopySubShopNumber" v-if="showCopySubShopNumber"
class="menu-item" class="menu-item"
...@@ -48,6 +48,10 @@ defineProps({ ...@@ -48,6 +48,10 @@ defineProps({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
showSelectionMenu: {
type: Boolean,
default: true,
},
}) })
const setPosition = ({ x, y }: { x: number; y: number }) => { const setPosition = ({ x, y }: { x: number; y: number }) => {
......
...@@ -46,6 +46,7 @@ export interface SearchForm { ...@@ -46,6 +46,7 @@ export interface SearchForm {
prop?: string prop?: string
/** list_page 排序方向:asc 正序,desc 倒序 */ /** list_page 排序方向:asc 正序,desc 倒序 */
order?: 'asc' | 'desc' order?: 'asc' | 'desc'
customerNo?: string // 客户交运单号
} }
export interface FactoryOrderNewListData { export interface FactoryOrderNewListData {
......
...@@ -49,6 +49,7 @@ export interface SearchForm { ...@@ -49,6 +49,7 @@ export interface SearchForm {
prop?: string prop?: string
/** list_page 排序方向:asc 正序,desc 倒序 */ /** list_page 排序方向:asc 正序,desc 倒序 */
order?: 'asc' | 'desc' order?: 'asc' | 'desc'
customerNo?: string // 客户交运单号
} }
export interface FactoryOrderNewListData { export interface FactoryOrderNewListData {
......
...@@ -63,7 +63,8 @@ export interface InterWarehousePage extends InterWarehouseBase { } ...@@ -63,7 +63,8 @@ export interface InterWarehousePage extends InterWarehouseBase { }
export interface InterWarehouseDetail extends InterWarehouseBase { export interface InterWarehouseDetail extends InterWarehouseBase {
currencyName?:string currencyName?:string
currencyCode?:string currencyCode?:string
productList: InterProductList[] productList: InterProductList[],
outRecordType?: string
} }
export interface ExportInWarehouseInfo extends warehouseSearchForm { export interface ExportInWarehouseInfo extends warehouseSearchForm {
total?: number total?: number
...@@ -125,6 +126,7 @@ export interface InterskuList { ...@@ -125,6 +126,7 @@ export interface InterskuList {
currencyCode?: string | null currencyCode?: string | null
buyStored?: number | null buyStored?: number | null
totalPrice?: number | null totalPrice?: number | null
inventory?: number | null
} }
export interface ILocation { export interface ILocation {
id?: number id?: number
......
...@@ -22,6 +22,9 @@ ...@@ -22,6 +22,9 @@
/> />
</ElSelect> </ElSelect>
</ElFormItem> </ElFormItem>
<div style="color: #f56c6c; margin-left: 100px; margin-top: -10px">
注意: 取消订单后金额将原路返回
</div>
</ElForm> </ElForm>
<template #footer> <template #footer>
<div class="dialog-footer" style="text-align: center"> <div class="dialog-footer" style="text-align: center">
......
...@@ -52,13 +52,13 @@ ...@@ -52,13 +52,13 @@
> >
<ElTableColumn <ElTableColumn
type="selection" type="selection"
width="70" width="50"
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> ></ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
width="60" width="50"
align="center" align="center"
label="序号" label="序号"
type="index" type="index"
...@@ -78,11 +78,13 @@ ...@@ -78,11 +78,13 @@
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="库存SKU" label="库存SKU"
width="160"
prop="warehouseSku" prop="warehouseSku"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="left"
header-align="center"
label="商品名称" label="商品名称"
prop="skuName" prop="skuName"
/> />
...@@ -90,20 +92,35 @@ ...@@ -90,20 +92,35 @@
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="款号" label="款号"
width="90"
prop="productNo" prop="productNo"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="right"
width="110"
header-align="center"
label="可用库存数量" label="可用库存数量"
prop="usableInventory" prop="usableInventory"
/> />
<ElTableColumn align="center" label="出库数量" prop="outCount"> <ElTableColumn
show-overflow-tooltip
align="right"
header-align="center"
label="库存数量"
prop="inventory"
/>
<ElTableColumn
header-align="center"
align="right"
label="出库数量"
prop="outCount"
width="100"
>
<template #default="{ row }"> <template #default="{ row }">
<el-input <el-input
v-model.number="row.outCount" v-model.number="row.outCount"
placeholder="出库数量" placeholder="出库数量"
style="width: 120px"
clearable clearable
size="small" size="small"
@input="setCostPrice(row)" @input="setCostPrice(row)"
...@@ -117,14 +134,16 @@ ...@@ -117,14 +134,16 @@
prop="currencyName" prop="currencyName"
/> />
<ElTableColumn <ElTableColumn
width="100" width="80"
align="center" align="right"
label="成本价" label="成本价"
header-align="center"
prop="costPrice" prop="costPrice"
/> />
<ElTableColumn <ElTableColumn
align="center" align="right"
width="100" width="80"
header-align="center"
label="总成本" label="总成本"
prop="totalPrice" prop="totalPrice"
/> />
...@@ -153,12 +172,13 @@ ...@@ -153,12 +172,13 @@
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="所属客户" label="所属客户"
width="100"
prop="userMark" prop="userMark"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
width="240" width="120"
label="备注" label="备注"
prop="remark" prop="remark"
> >
...@@ -338,6 +358,7 @@ const addOtherCurrency = async () => { ...@@ -338,6 +358,7 @@ const addOtherCurrency = async () => {
const params: InterWarehouseDetail = { const params: InterWarehouseDetail = {
...editForm.value, ...editForm.value,
productList: otherPurchaseData.value, productList: otherPurchaseData.value,
outRecordType: 'picking_replenish',
} }
try { try {
await addOutRecordApi(params) await addOutRecordApi(params)
...@@ -425,6 +446,7 @@ const open = async (params: OpenParams) => { ...@@ -425,6 +446,7 @@ const open = async (params: OpenParams) => {
usableInventory: skuItem.usableInventory, usableInventory: skuItem.usableInventory,
inventoryId: skuItem.id, inventoryId: skuItem.id,
remark: skuItem.remark ?? null, remark: skuItem.remark ?? null,
inventory: skuItem.inventory,
} as InterProductList } as InterProductList
}) })
......
...@@ -192,7 +192,7 @@ const handleRestockCheck = async (row: RestockData) => { ...@@ -192,7 +192,7 @@ const handleRestockCheck = async (row: RestockData) => {
} }
try { try {
const res = await restockCheckApi( const res = await restockCheckApi(
row.id, row.factoryId,
row.warehouseSku ?? '', row.warehouseSku ?? '',
row.warehouseId, row.warehouseId,
) )
......
...@@ -218,10 +218,10 @@ ...@@ -218,10 +218,10 @@
/> />
</div> </div>
</ElFormItem> </ElFormItem>
<ElFormItem label="订单号"> <ElFormItem label="订单号">
<ElInput <ElInput
v-model.trim="searchForm.factoryOrderNumber" v-model.trim="searchForm.factoryOrderNumber"
placeholder="订单号" placeholder="订单号"
clearable clearable
style="width: 150px" style="width: 150px"
/> />
...@@ -243,6 +243,14 @@ ...@@ -243,6 +243,14 @@
></el-option> ></el-option>
</el-select> </el-select>
</ElFormItem> </ElFormItem>
<ElFormItem v-if="status === 'ALL'" label="客户交运单号">
<ElInput
v-model.trim="searchForm.customerNo"
placeholder="客户交运单号"
clearable
style="width: 150px"
/>
</ElFormItem>
<ElFormItem label="Variant SKU"> <ElFormItem label="Variant SKU">
<ElInput <ElInput
v-model.trim="searchForm.sku" v-model.trim="searchForm.sku"
...@@ -441,7 +449,7 @@ ...@@ -441,7 +449,7 @@
<span <span
v-if=" v-if="
status === 'PENDING_RECEIVE' || status === 'PENDING_RECEIVE' ||
(status === 'SUSPEND' && suspendedSubTab !== 1) (status === 'SUSPEND' && suspendedSubTab === 4)
" "
class="item" class="item"
> >
...@@ -646,12 +654,12 @@ ...@@ -646,12 +654,12 @@
</span> </span>
<span v-if="suspendedSubTab === 1" class="item"> <span v-if="suspendedSubTab === 1" class="item">
<ElButton type="success" @click="() => handleInterceptionSuccess()" <ElButton type="success" @click="() => handleInterceptionSuccess()"
>拦截成功</ElButton >处理拦截</ElButton
> >
</span> </span>
<span v-if="suspendedSubTab === 1" class="item"> <span v-if="suspendedSubTab === 1" class="item">
<ElButton type="danger" @click="() => handleInterceptionFail()" <ElButton type="danger" @click="() => handleInterceptionFail()"
>拦截失败</ElButton >取消拦截</ElButton
> >
</span> </span>
<span class="item"> <span class="item">
...@@ -673,6 +681,11 @@ ...@@ -673,6 +681,11 @@
> >
<ElButton type="danger" @click="handleSuspend">挂起</ElButton> <ElButton type="danger" @click="handleSuspend">挂起</ElButton>
</span> </span>
<span v-if="['PICKING'].includes(status)" class="item">
<ElButton type="success" @click="handleDeliveryComplete"
>配货完成</ElButton
>
</span>
<span v-if="status === 'PENDING_PACKING'" class="item"> <span v-if="status === 'PENDING_PACKING'" class="item">
<ElButton type="success" @click="handlePrintWarehouseSkuTag" <ElButton type="success" @click="handlePrintWarehouseSkuTag"
>打印库存SKU标签</ElButton >打印库存SKU标签</ElButton
...@@ -796,6 +809,7 @@ ...@@ -796,6 +809,7 @@
v-loading="loading" v-loading="loading"
element-loading-text="加载中..." element-loading-text="加载中..."
class="table-list flex-1 overflow-hidden" class="table-list flex-1 overflow-hidden"
@contextmenu.prevent="rightClick"
> >
<TableView <TableView
ref="tableRef" ref="tableRef"
...@@ -888,7 +902,7 @@ ...@@ -888,7 +902,7 @@
size="small" size="small"
@click.stop="handleInterceptionSuccess(row)" @click.stop="handleInterceptionSuccess(row)"
> >
拦截成功 处理拦截
</ElButton> </ElButton>
</span> </span>
<span <span
...@@ -901,7 +915,7 @@ ...@@ -901,7 +915,7 @@
size="small" size="small"
@click.stop="handleInterceptionFail(row)" @click.stop="handleInterceptionFail(row)"
> >
拦截失败 取消拦截
</ElButton> </ElButton>
</span> </span>
</div> </div>
...@@ -956,6 +970,7 @@ ...@@ -956,6 +970,7 @@
:paginated-data="operationOrderList" :paginated-data="operationOrderList"
:columns="operationOrderColumns" :columns="operationOrderColumns"
serial-numberable serial-numberable
@row-contextmenu="handleOperationOrderContextMenu"
/> />
</div> </div>
</el-tab-pane> </el-tab-pane>
...@@ -1107,24 +1122,24 @@ ...@@ -1107,24 +1122,24 @@
/> />
<ElDialog <ElDialog
v-model="interceptSuccessDialogVisible" v-model="interceptSuccessDialogVisible"
title="拦截成功" title="处理拦截"
width="480px" width="480px"
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<ElForm ref="interceptSuccessFormRef" :model="interceptSuccessForm"> <ElForm ref="interceptSuccessFormRef" :model="interceptSuccessForm">
<ElFormItem <ElFormItem
label="拦截成功类型" label="处理拦截类型"
prop="suspendSussessType" prop="blockSuccessType"
:rules="[ :rules="[
{ {
required: true, required: true,
message: '请选择拦截成功类型', message: '请选择处理拦截类型',
trigger: 'change', trigger: 'change',
}, },
]" ]"
> >
<ElSelect <ElSelect
v-model="interceptSuccessForm.suspendSussessType" v-model="interceptSuccessForm.blockSuccessType"
placeholder="请选择" placeholder="请选择"
style="width: 100%" style="width: 100%"
clearable clearable
...@@ -1179,6 +1194,31 @@ ...@@ -1179,6 +1194,31 @@
:warehouse-list="warehouseList" :warehouse-list="warehouseList"
:selected-rows="selectedRows" :selected-rows="selectedRows"
/> />
<RightClickMenu
ref="rightMenuRef"
:show-copy-count="false"
:show-copy-sub-shop-number="false"
:show-copy-shop-number="rightClickContext === 'main'"
:show-selection-menu="rightClickContext === 'main'"
@on-change="rightChange"
>
<template #default>
<div
v-if="rightClickContext === 'main'"
class="menu-item"
@click="rightChange('order-number')"
>
复制订单编号
</div>
<div
v-if="rightClickContext === 'operation'"
class="menu-item"
@click="rightChange('operationNo')"
>
复制操作单号
</div>
</template>
</RightClickMenu>
</div> </div>
</template> </template>
...@@ -1194,6 +1234,7 @@ import { ...@@ -1194,6 +1234,7 @@ import {
import { computed, nextTick, onMounted, ref } from 'vue' import { computed, nextTick, onMounted, ref } from 'vue'
import splitDiv from '@/components/splitDiv/splitDiv.vue' import splitDiv from '@/components/splitDiv/splitDiv.vue'
import TableView from '@/components/TableView.vue' import TableView from '@/components/TableView.vue'
import RightClickMenu from '@/components/RightClickMenu.vue'
import ResultInfo from '@/views/order/components/ResultInfo.vue' import ResultInfo from '@/views/order/components/ResultInfo.vue'
import type { BaseRespData } from '@/types/api' import type { BaseRespData } from '@/types/api'
import type { import type {
...@@ -1237,6 +1278,7 @@ import { ...@@ -1237,6 +1278,7 @@ import {
exportFactoryOrderInfo, exportFactoryOrderInfo,
interceptUpdateApi, interceptUpdateApi,
interceptSuccessApi, interceptSuccessApi,
deliveryCompleteApi,
} from '@/api/factoryOrderNew' } from '@/api/factoryOrderNew'
import { getConfigApi } from '@/api/order' import { getConfigApi } from '@/api/order'
import { getLogisticsWayApi } from '@/api/podUsOrder' import { getLogisticsWayApi } from '@/api/podUsOrder'
...@@ -1299,8 +1341,8 @@ const interceptSuccessTypeOptions = [ ...@@ -1299,8 +1341,8 @@ const interceptSuccessTypeOptions = [
{ label: '生产拦截成功', value: 1 }, { label: '生产拦截成功', value: 1 },
{ label: '发货拦截成功', value: 2 }, { label: '发货拦截成功', value: 2 },
] ]
const interceptSuccessForm = ref<{ suspendSussessType: number | undefined }>({ const interceptSuccessForm = ref<{ blockSuccessType: number | undefined }>({
suspendSussessType: undefined, blockSuccessType: undefined,
}) })
const interceptSuccessRows = ref<FactoryOrderNewListData[]>([]) const interceptSuccessRows = ref<FactoryOrderNewListData[]>([])
const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL'] const sizes = ['FS', 'XS', 'S', 'M', 'L', 'XL', 'XXL', '3XL', '4XL', '5XL']
...@@ -1650,11 +1692,73 @@ const handleSuspendTabClick = (value: number) => { ...@@ -1650,11 +1692,73 @@ const handleSuspendTabClick = (value: number) => {
// statusCurrentPageRef.value = 1 // statusCurrentPageRef.value = 1
// refreshTableList() // refreshTableList()
// } // }
const handleCopyCell = (e: Event, text?: string) => { const handleCopyCell = (e: Event | null, text?: string) => {
e.stopPropagation() e && e.stopPropagation()
if (text) window.navigator.clipboard.writeText(text) if (text) window.navigator.clipboard.writeText(text)
ElMessage.success('复制成功') ElMessage.success('复制成功')
} }
const rightMenuRef = ref()
const rightClickContext = ref<'main' | 'operation'>('main')
const operationRightClickItem = ref<operateOrderListData | null>(null)
const rightClick = (e: MouseEvent) => {
rightClickContext.value = 'main'
operationRightClickItem.value = null
rightMenuRef.value?.setPosition({
x: e.clientX,
y: e.clientY,
})
}
const handleOperationOrderContextMenu = (
_row: unknown,
_column: unknown,
event: Event,
) => {
event.preventDefault()
rightClickContext.value = 'operation'
operationRightClickItem.value = null
rightMenuRef.value?.setPosition({
x: (event as MouseEvent).clientX,
y: (event as MouseEvent).clientY,
})
}
const rightChange = async (code: string) => {
if (code === 'select-all') {
tableRef.value?.toggleAllSelection()
return
}
if (code === 'cancel-select') {
tableRef.value?.clearSelection()
return
}
const targetRows = selectedRows.value
if (code === 'copy_shopNumber') {
const str = targetRows
.map((item) => item.shopNumber)
.filter(Boolean)
.join(',')
handleCopyCell(null, str)
} else if (code === 'order-number') {
const str = targetRows
.map((item) => item.factoryOrderNumber)
.filter(Boolean)
.join(',')
handleCopyCell(null, str)
} else if (code === 'operationNo') {
const str = operationOrderList.value
.map((item) => item?.operationNo)
.filter(Boolean)
.join(',')
if (!str) return ElMessage.warning('当前数据没有操作单号')
handleCopyCell(null, str)
}
}
const mainColumns = computed(() => [ const mainColumns = computed(() => [
{ {
prop: 'factoryOrderNumber', prop: 'factoryOrderNumber',
...@@ -2897,6 +3001,35 @@ const handlePickComplete = () => { ...@@ -2897,6 +3001,35 @@ const handlePickComplete = () => {
if (!ensureSelection()) return if (!ensureSelection()) return
pickCompleteDialogRef.value?.open(getSelectedIds()) pickCompleteDialogRef.value?.open(getSelectedIds())
} }
const handleDeliveryComplete = () => {
if (!ensureSelection()) return
ElMessageBox.confirm('确定完成发货吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
})
.then(async () => {
const params = selectedRows.value.map((row) => ({
id: row.id,
version: row.version,
}))
const loading = ElLoading.service({
fullscreen: true,
text: '操作中...',
background: 'rgba(0, 0, 0, 0.3)',
})
try {
const res = await deliveryCompleteApi(params)
if (res.code !== 200) return
ElMessage.success('操作成功')
} catch (e) {
console.error(e)
} finally {
loading.close()
refreshCurrentView({ isRefreshTree: true })
}
})
.catch(() => {})
}
const handlePickFail = () => { const handlePickFail = () => {
if (!ensureSelection()) return if (!ensureSelection()) return
pickFailDialogRef.value?.open(getSelectedIds(), { pickFailDialogRef.value?.open(getSelectedIds(), {
...@@ -2998,7 +3131,7 @@ const completeOperationById = ( ...@@ -2998,7 +3131,7 @@ const completeOperationById = (
) => { ) => {
if (trigger === 'auto') { if (trigger === 'auto') {
const detailStatus = String(detailData?.status ?? '') const detailStatus = String(detailData?.status ?? '')
return productionScanApi(ids[0], detailStatus) return productionScanApi(ids[0], detailStatus, 'web')
} }
return completeDeliveryApi(ids) return completeDeliveryApi(ids)
} }
...@@ -3102,7 +3235,7 @@ const handleInterceptionSuccess = (row?: FactoryOrderNewListData) => { ...@@ -3102,7 +3235,7 @@ const handleInterceptionSuccess = (row?: FactoryOrderNewListData) => {
if (!ensureSelection()) return if (!ensureSelection()) return
interceptSuccessRows.value = [...selectedRows.value] interceptSuccessRows.value = [...selectedRows.value]
} }
interceptSuccessForm.value.suspendSussessType = undefined interceptSuccessForm.value.blockSuccessType = undefined
interceptSuccessDialogVisible.value = true interceptSuccessDialogVisible.value = true
nextTick(() => interceptSuccessFormRef.value?.clearValidate()) nextTick(() => interceptSuccessFormRef.value?.clearValidate())
} }
...@@ -3115,8 +3248,8 @@ const submitInterceptSuccess = async () => { ...@@ -3115,8 +3248,8 @@ const submitInterceptSuccess = async () => {
} catch { } catch {
return return
} }
const suspendSussessType = interceptSuccessForm.value.suspendSussessType const blockSuccessType = interceptSuccessForm.value.blockSuccessType
if (suspendSussessType === undefined) return if (blockSuccessType === undefined) return
const loading = ElLoading.service({ const loading = ElLoading.service({
fullscreen: true, fullscreen: true,
...@@ -3127,9 +3260,9 @@ const submitInterceptSuccess = async () => { ...@@ -3127,9 +3260,9 @@ const submitInterceptSuccess = async () => {
const data = rows.map((item: FactoryOrderNewListData) => { const data = rows.map((item: FactoryOrderNewListData) => {
return { return {
factoryOrderNumber: item.factoryOrderNumber as string, factoryOrderNumber: item.factoryOrderNumber as string,
suspendSussessType, blockSuccessType,
} }
}) as { factoryOrderNumber: string; suspendSussessType: number }[] }) as { factoryOrderNumber: string; blockSuccessType: number }[]
try { try {
const res = await interceptSuccessApi(data) const res = await interceptSuccessApi(data)
if (res.code !== 200) return if (res.code !== 200) return
...@@ -3155,7 +3288,7 @@ const handleInterceptionFail = async (row?: FactoryOrderNewListData) => { ...@@ -3155,7 +3288,7 @@ const handleInterceptionFail = async (row?: FactoryOrderNewListData) => {
item.factoryOrderNumber as string, item.factoryOrderNumber as string,
), ),
api: (ids) => interceptUpdateApi(ids as string[]), api: (ids) => interceptUpdateApi(ids as string[]),
confirmText: '拦截失败,订单会恢复到拦截前的状态,确认是否拒绝拦截申请?', confirmText: '取消拦截,订单会恢复到拦截前的状态,确认是否拒绝拦截申请?',
onSuccess: (res) => { onSuccess: (res) => {
const data = Array.isArray(res.data) const data = Array.isArray(res.data)
? (res.data as ResultInfoDataItem[]) ? (res.data as ResultInfoDataItem[])
......
...@@ -8,6 +8,7 @@ export const FACTORY_ORDER_LIST_SEARCH_FIELD_RULES: Record< ...@@ -8,6 +8,7 @@ export const FACTORY_ORDER_LIST_SEARCH_FIELD_RULES: Record<
operationNo: (c) => c.isCardLayout, operationNo: (c) => c.isCardLayout,
receiverCountry: (c) => !c.isCardLayout, receiverCountry: (c) => !c.isCardLayout,
logisticsWayId: (c) => c.status === 'ALL', logisticsWayId: (c) => c.status === 'ALL',
customerNo: (c) => c.status === 'ALL',
} }
export function filterFactoryOrderListSearchPayload( export function filterFactoryOrderListSearchPayload(
......
...@@ -1540,10 +1540,6 @@ const getSortingAreaList = async () => { ...@@ -1540,10 +1540,6 @@ const getSortingAreaList = async () => {
sortingAreaId.value = defaultArea.id sortingAreaId.value = defaultArea.id
warehouseId.value = defaultArea.warehouseId warehouseId.value = defaultArea.warehouseId
isAutoPrint.value = defaultArea.autoPrint || false isAutoPrint.value = defaultArea.autoPrint || false
emit('set-warehouseId', {
warehouseId: warehouseId.value,
sortingAreaId: sortingAreaId.value,
})
} }
</script> </script>
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
<splitDiv size="50"> <splitDiv size="50">
<template #top> <template #top>
<div class="header-filter-form"> <div class="header-filter-form">
<ElForm :model="searchForm" inline ref="searchFormRef"> <ElForm ref="searchFormRef" :model="searchForm" inline>
<ElFormItem label="仓库"> <ElFormItem label="仓库">
<ElSelect <ElSelect
v-model="searchForm.warehouseId" v-model="searchForm.warehouseId"
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
/> />
</ElFormItem> </ElFormItem>
<ElFormItem> <ElFormItem>
<ElButton type="primary" @click="search" ref="searchBtnRef" <ElButton ref="searchBtnRef" type="primary" @click="search"
>查询</ElButton >查询</ElButton
> >
</ElFormItem> </ElFormItem>
...@@ -511,13 +511,13 @@ ...@@ -511,13 +511,13 @@
> >
<ElTableColumn <ElTableColumn
type="selection" type="selection"
width="70" width="50"
header-align="center" header-align="center"
align="center" align="center"
></ElTableColumn> ></ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
width="60" width="50"
align="center" align="center"
label="序号" label="序号"
type="index" type="index"
...@@ -537,12 +537,14 @@ ...@@ -537,12 +537,14 @@
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="库存SKU" label="库存SKU"
width="160"
prop="warehouseSku" prop="warehouseSku"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="left"
header-align="center"
label="商品名称" label="商品名称"
prop="skuName" prop="skuName"
/> />
...@@ -550,20 +552,36 @@ ...@@ -550,20 +552,36 @@
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
label="款号" label="款号"
width="90"
prop="productNo" prop="productNo"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="right"
header-align="center"
label="库存数量"
width="90"
prop="inventory"
/>
<ElTableColumn
show-overflow-tooltip
align="right"
header-align="center"
label="可用库存数量" label="可用库存数量"
prop="usableInventory" prop="usableInventory"
width="110"
/> />
<ElTableColumn align="center" label="出库数量" prop="outCount"> <ElTableColumn
align="right"
header-align="center"
label="出库数量"
width="90"
prop="outCount"
>
<template #default="{ row }"> <template #default="{ row }">
<el-input <el-input
v-model.number="row.outCount" v-model.number="row.outCount"
placeholder="出库数量" placeholder="出库数量"
style="width: 120px"
clearable clearable
size="small" size="small"
@input="setCostPrice(row)" @input="setCostPrice(row)"
...@@ -577,18 +595,25 @@ ...@@ -577,18 +595,25 @@
prop="currencyName" prop="currencyName"
/> />
<ElTableColumn <ElTableColumn
width="100" width="80"
align="center" align="right"
header-align="center"
label="成本价" label="成本价"
prop="costPrice" prop="costPrice"
/> />
<ElTableColumn <ElTableColumn
align="center" align="right"
width="100" header-align="center"
width="80"
label="总成本" label="总成本"
prop="totalPrice" prop="totalPrice"
/> />
<ElTableColumn align="center" label="库位" prop="locationCode"> <ElTableColumn
width="90"
align="center"
label="库位"
prop="locationCode"
>
<template #default="{ row }"> <template #default="{ row }">
<span v-if="row.locationCode">{{ row.locationCode }}</span> <span v-if="row.locationCode">{{ row.locationCode }}</span>
<ElSelect <ElSelect
...@@ -596,7 +621,6 @@ ...@@ -596,7 +621,6 @@
v-model="row.locationId" v-model="row.locationId"
clearable clearable
placeholder="请输入库位" placeholder="请输入库位"
style="width: 120px"
filterable filterable
@change="handleLocationChange(row.locationId, row)" @change="handleLocationChange(row.locationId, row)"
> >
...@@ -611,14 +635,16 @@ ...@@ -611,14 +635,16 @@
</ElTableColumn> </ElTableColumn>
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
header-align="center"
align="center" align="center"
width="100"
label="所属客户" label="所属客户"
prop="userMark" prop="userMark"
/> />
<ElTableColumn <ElTableColumn
show-overflow-tooltip show-overflow-tooltip
align="center" align="center"
width="240" width="120"
label="备注" label="备注"
prop="remark" prop="remark"
> >
...@@ -1304,6 +1330,7 @@ const handleLocalImport = async ({ ...@@ -1304,6 +1330,7 @@ const handleLocalImport = async ({
usableInventory: skuItem.usableInventory, usableInventory: skuItem.usableInventory,
inventoryId: skuItem.id, inventoryId: skuItem.id,
remark: importedItem?.remark ?? skuItem.remark ?? null, remark: importedItem?.remark ?? skuItem.remark ?? null,
inventory: skuItem.inventory,
} as InterProductList } as InterProductList
}) })
...@@ -1421,6 +1448,7 @@ const skudblclick = (val: InterskuList) => { ...@@ -1421,6 +1448,7 @@ const skudblclick = (val: InterskuList) => {
image = '', image = '',
locationId = null, locationId = null,
usableInventory = null, usableInventory = null,
inventory = null,
id = null, id = null,
currencyName = '', currencyName = '',
currencyCode = '', currencyCode = '',
...@@ -1453,9 +1481,10 @@ const skudblclick = (val: InterskuList) => { ...@@ -1453,9 +1481,10 @@ const skudblclick = (val: InterskuList) => {
totalPrice: null, totalPrice: null,
usableInventory, //可用库存数量 usableInventory, //可用库存数量
inventoryId: id, inventoryId: id,
inventory: inventory,
currencyName, currencyName,
currencyCode, currencyCode,
}, } as InterProductList,
] ]
// 使用filter代替forEach+splice,时间复杂度从O(n^2)降到O(n) // 使用filter代替forEach+splice,时间复杂度从O(n^2)降到O(n)
const skuSet = new Set( const skuSet = new Set(
...@@ -1532,11 +1561,25 @@ const getProduct = async (id: number | undefined) => { ...@@ -1532,11 +1561,25 @@ const getProduct = async (id: number | undefined) => {
const productList = res.data?.productList const productList = res.data?.productList
const newProductList = (Array.isArray(productList) ? productList : []).map( const newProductList = (Array.isArray(productList) ? productList : []).map(
(item: InterProductList) => { (item: InterProductList) => {
const { inventory, ...rest } = item const inventoryData = item.inventory as
| { inventory?: number; usableInventory?: number }
| number
| null
| undefined
if (
inventoryData !== null &&
inventoryData !== undefined &&
typeof inventoryData === 'object'
) {
const { ...rest } = item
return { return {
...rest, ...rest,
usableInventory: inventory?.usableInventory ?? null, inventory: inventoryData.inventory ?? null,
usableInventory:
inventoryData.usableInventory ?? rest.usableInventory ?? null,
} as InterProductList
} }
return item
}, },
) )
if (res.data) { if (res.data) {
...@@ -1795,6 +1838,7 @@ const submitPurchase = async () => { ...@@ -1795,6 +1838,7 @@ const submitPurchase = async () => {
outCount: null, outCount: null,
totalPrice: null, totalPrice: null,
usableInventory: skuItem.usableInventory, usableInventory: skuItem.usableInventory,
inventory: skuItem.inventory,
inventoryId: skuItem.id, inventoryId: skuItem.id,
remark: null, remark: null,
} as InterProductList } as InterProductList
......
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