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