Commit a5b4887e by wusiyi

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

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