Commit a5b4887e by wusiyi

feat: 配货分拣自动打印面单功能优化 #1013154

parent 9bf605b9
......@@ -318,7 +318,6 @@ export interface SortingRuleDetail {
warehouseId: number
warehouseName: string
matchType: 1 | 2 //匹配类型:1=所有条件(且) 2=任一条件(或)
autoPrint: boolean // 自动打单
defaultFlag: boolean // 默认分拣区
secondScan: boolean // 二次扫码
conditions: SortingRuleCondition[] // 配货规则
......
......@@ -199,21 +199,6 @@
</div>
</el-form-item>
<el-form-item label="自动打单" prop="autoPrint">
<el-switch
v-model="form.autoPrint"
size="large"
placeholder="请选择是否自动打单"
/>
</el-form-item>
<el-form-item>
<span v-if="form.autoPrint" class="item-info">
开启后,配货分拣订单配齐时,自动打单,打单后订单状态转为待发货。
</span>
<span v-else class="item-info">
关闭后,配货分拣订单配齐后仍在待配货状态,经过配货打单后订单状态转为待发货。
</span>
</el-form-item>
<el-form-item label="是否对接二次扫码设备" prop="secondScan">
<el-select
v-model="form.secondScan"
......@@ -308,7 +293,6 @@ const form = ref<SortingRuleDetail>({
],
secondScan: false,
sortNo: 1,
autoPrint: false,
warehouseId: 0,
warehouseName: '',
defaultFlag: false,
......@@ -396,9 +380,7 @@ const rules = computed(() => {
{ required: true, message: '请输入配货区说明', trigger: 'blur' },
],
areaCode: [{ required: true, message: '请选择配货区', trigger: 'change' }],
autoPrint: [
{ required: true, message: '请选择是否自动打单', trigger: 'change' },
],
secondScan: [
{
required: true,
......
......@@ -214,14 +214,6 @@ const columns: CustomColumn<SortingList>[] = [
align: 'left',
},
{
key: 'autoPrint',
prop: 'autoPrint',
label: '自动打单',
width: 100,
align: 'center',
slot: 'autoPrint',
},
{
key: 'warehouseName',
prop: 'warehouseName',
label: '仓库',
......
......@@ -608,9 +608,9 @@
>
</span>
<span v-if="status === 'IN_PRODUCTION' && isEnableSorting" class="item">
<ElButton type="primary" @click="handleSeedingWall('sort')"
>配货分拣</ElButton
>
<ElButton type="primary" @click="handleInventorySorting">
配货分拣
</ElButton>
</span>
<span
v-if="
......@@ -1111,18 +1111,22 @@
v-model="podOrderVisible"
:print-order="printOrder"
:warehouse-list="warehouseList"
:title="wallType === 'print' ? '配货打单' : '配货分拣'"
title="配货打单"
:is-new-order="true"
:wall-type="wallType"
:ws-open-code="
wallType === 'print' ? 'STARTORDERNEWPOD' : 'STARTORDERNEWPODTOP'
"
:ws-close-code="
wallType === 'print' ? 'ENDORDERNEWPOD' : 'ENDORDERNEWPODTOP'
"
wall-type="print"
ws-open-code="STARTORDERNEWPOD"
ws-close-code="ENDORDERNEWPOD"
init-url="factory/podOrderPacking/local/getPodBoxOrderDetails"
@set-printer="handlePrinterChange"
@set-warehouse-id="handleWarehouseIdChange"
@set-warehouse-id="handlePrintWarehouseIdChange"
@refresh="() => refreshCurrentView({ isRefreshTree: true })"
/>
<!-- 配货分拣 -->
<InventorySorting
v-model="inventorySortingVisible"
:print-order="printOrder"
:warehouse-list="warehouseList"
@set-printer="handlePrinterChange"
@refresh="() => refreshCurrentView({ isRefreshTree: true })"
/>
<PodDistributionOrder
......@@ -1347,6 +1351,7 @@ import UpdateCustomDeclarationInfoDialog from '@/views/order/components/UpdateCu
import WeightDialog from '@/views/order/components/WeightDialog.vue'
import FastProduction from '@/views/order/components/FastProduction.vue'
import PodMakeOrder from '@/views/order/podUs/PodMakeOrder.vue'
import InventorySorting from './component/InventorySorting.vue'
import PodDistributionOrder from '@/views/order/podCN/PodDistributionOrder.vue'
import PrintWarehouseSkuTag from '@/views/order/components/printWarehouseSkuTag.vue'
import UpdateAddress from '@/views/order/podCN/components/updateAddress.vue'
......@@ -1524,9 +1529,9 @@ const getListQueryPayload = () => {
}
const getCraft = async () => {
const res = await getPodOrderCraftApi()
const res = await getPodOrderCraftApi()
const data: CraftListData[] = res.data
podCraftList.value = data.map((item:CraftListData) => ({
podCraftList.value = data.map((item: CraftListData) => ({
id: item.craftCode,
name: item.craftName,
warehouseName: processTypeMap[item.craftType] ?? '其他',
......@@ -1930,19 +1935,19 @@ const mainColumns = computed(() => [
},
{
prop: 'statusName',
label:'挂起前状态',
label: '挂起前状态',
minWidth: 120,
hidden:status.value !== 'SUSPEND',
align: 'center'
hidden: status.value !== 'SUSPEND',
align: 'center',
},
{
prop: 'statusName',
hidden:status.value === 'SUSPEND',
hidden: status.value === 'SUSPEND',
label: '订单状态',
minWidth: 120,
align: 'center',
render: (row: FactoryOrderNewListData) => {
return <span>{ row.pause ? '挂起' : row.statusName}</span>
return <span>{row.pause ? '挂起' : row.statusName}</span>
},
},
{
......@@ -2879,22 +2884,15 @@ const handleSingleConfirmOrder = (row: FactoryOrderNewListData) => {
confirmOrderDialogRef.value?.open([row.id])
}
const podOrderVisible = ref(false)
const inventorySortingVisible = ref(false)
const podDistributionOrderVisible = ref(false)
const sheetPrinter = ref('')
const handlePrinterChange = (value: string) => {
sheetPrinter.value = value
localStorage.setItem('sheetPrinter', JSON.stringify(value))
}
const handleWarehouseIdChange = (
value:
| string
| { warehouseId: string | number; sortingAreaId: string | number },
) => {
if (wallType.value === 'print') {
localStorage.setItem('localNewWarehouseId', JSON.stringify(value))
} else if (wallType.value === 'sort') {
localStorage.setItem('localSortingAreaId', JSON.stringify(value))
}
const handlePrintWarehouseIdChange = (value: string | number) => {
localStorage.setItem('localNewWarehouseId', JSON.stringify(value))
}
const mapOrderParamListToSubmitItems = (
orderParamList: { id: number; dataVersion?: number }[],
......@@ -2915,22 +2913,26 @@ const getPrintLogisticLabelFactory = (id?: number) =>
getfaceSimplexFileApi([id ?? 0])
const { getCLodop } = useLodop()
const wallType = ref<'print' | 'sort'>('print')
const handleSeedingWall = (type: 'print' | 'sort') => {
const wallType = ref<'print'>('print')
const handleSeedingWall = (type: 'print') => {
wallType.value = type
const lodop = getCLodop(null, null)
if (!lodop) return
sheetPrinter.value = lodop.GET_PRINTER_NAME(0)
podOrderVisible.value = true
}
// 点击打开配货分拣弹窗
const handleInventorySorting = () => {
const lodop = getCLodop(null, null)
if (!lodop) return
sheetPrinter.value = lodop.GET_PRINTER_NAME(0)
inventorySortingVisible.value = true
}
/** LODOP 单例不可并发,打印串行 */
let printOrderChain: Promise<void> = Promise.resolve()
const printOrder = (
data: OrderData,
callback: (status: boolean) => void,
) => {
const printOrder = (data: OrderData, callback: (status: boolean) => void) => {
const run = async () => {
const lodop = getCLodop(null, null)
if (!lodop) {
......
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