feat: 新增立库入库异常处理、优先级变更
This commit is contained in:
parent
c94fe7fd80
commit
a3cb47d838
|
|
@ -1,3 +1,3 @@
|
||||||
# 开发环境 — 留空,走 vite.config.ts 中的 proxy
|
# 开发环境 — 留空,走 vite.config.ts 中的 proxy
|
||||||
VITE_API_BASE=http://localhost:8114
|
VITE_API_BASE=https://sit-api.baoshi56.com
|
||||||
VITE_ENTRY_OPTIONS=ops,monitor
|
VITE_ENTRY_OPTIONS=ops,monitor
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,18 @@ export interface CancelReq extends MachineBaseReq {
|
||||||
reason?: string
|
reason?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface InboundExceptionReq {
|
||||||
|
palletCode: string
|
||||||
|
outboundStation: string
|
||||||
|
elevatorId: number
|
||||||
|
elevatorPoint: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ExpediteReq {
|
||||||
|
businessNo: string
|
||||||
|
priority: number
|
||||||
|
}
|
||||||
|
|
||||||
export function generateInbound(data: InboundReq) {
|
export function generateInbound(data: InboundReq) {
|
||||||
return request.post<never, { code: number; data: string }>(`${BASE}/inbound`, data)
|
return request.post<never, { code: number; data: string }>(`${BASE}/inbound`, data)
|
||||||
}
|
}
|
||||||
|
|
@ -98,3 +110,11 @@ export function generateReleaseStation(data: ReleaseStationReq) {
|
||||||
export function generateCancel(data: CancelReq) {
|
export function generateCancel(data: CancelReq) {
|
||||||
return request.post<never, { code: number; data: string[] }>(`${BASE}/cancel`, data)
|
return request.post<never, { code: number; data: string[] }>(`${BASE}/cancel`, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function generateInboundException(data: InboundExceptionReq) {
|
||||||
|
return request.post<never, { code: number; data: boolean }>(`${BASE}/inboundException`, data)
|
||||||
|
}
|
||||||
|
|
||||||
|
export function generateExpedite(data: ExpediteReq) {
|
||||||
|
return request.post<never, { code: number; data: boolean }>(`${BASE}/expedite`, data)
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -288,6 +288,48 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- 入库异常处理 -->
|
||||||
|
<div v-show="isPanel('inboundException')" class="gen-form-wrap">
|
||||||
|
<el-form :model="inboundExceptionForm" :label-width="formLabelWidth" :label-position="labelPos" class="gen-form">
|
||||||
|
<el-row :gutter="gutter">
|
||||||
|
<el-col :span="colSpan"><el-form-item label="托盘码" required><el-input v-model="inboundExceptionForm.palletCode" /></el-form-item></el-col>
|
||||||
|
<el-col :span="colSpan">
|
||||||
|
<el-form-item label="出库站点" required>
|
||||||
|
<el-select v-model="inboundExceptionForm.outboundStation" placeholder="请选择" style="width: 100%">
|
||||||
|
<el-option v-for="s in outboundStationOptions" :key="s" :label="s" :value="s" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="colSpan">
|
||||||
|
<el-form-item label="提升机" required>
|
||||||
|
<el-select v-model="inboundExceptionForm.elevatorId" placeholder="请选择" style="width: 100%">
|
||||||
|
<el-option v-for="e in elevatorOptions" :key="e.id" :label="e.label" :value="e.id" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="colSpan"><el-form-item label="仓库编码" required><el-input v-model="inboundExceptionForm.warehouse" /></el-form-item></el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" :loading="loading" @click="handleInboundException" :style="isMobile ? 'width:100%' : ''">出库</el-button>
|
||||||
|
<el-button type="warning" :loading="loading" @click="handleInboundExceptionUnbind" :style="isMobile ? 'width:100%' : ''">解绑</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 任务加急 -->
|
||||||
|
<div v-show="isPanel('expedite')" class="gen-form-wrap">
|
||||||
|
<el-form :model="expediteForm" :label-width="formLabelWidth" :label-position="labelPos" class="gen-form">
|
||||||
|
<el-row :gutter="gutter">
|
||||||
|
<el-col :span="colSpan"><el-form-item label="业务跟踪号" required><el-input v-model="expediteForm.businessNo" placeholder="与任务链业务追踪号一致" /></el-form-item></el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button :loading="loading" @click="handleExpedite(60)" :style="isMobile ? 'width:100%' : ''">正常</el-button>
|
||||||
|
<el-button type="warning" :loading="loading" @click="handleExpedite(500)" :style="isMobile ? 'width:100%' : ''">加急</el-button>
|
||||||
|
<el-button type="danger" :loading="loading" @click="handleExpedite(1000)" :style="isMobile ? 'width:100%' : ''">非常紧急</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
@ -314,7 +356,9 @@ defineOptions({ name: 'TaskGenerateView' })
|
||||||
import {
|
import {
|
||||||
generateBindStation,
|
generateBindStation,
|
||||||
generateCancel,
|
generateCancel,
|
||||||
|
generateExpedite,
|
||||||
generateInbound,
|
generateInbound,
|
||||||
|
generateInboundException,
|
||||||
generateMoveBatch,
|
generateMoveBatch,
|
||||||
generateMoveBatchNew,
|
generateMoveBatchNew,
|
||||||
generateOutboundNoWait,
|
generateOutboundNoWait,
|
||||||
|
|
@ -333,7 +377,7 @@ import {
|
||||||
} from '@/api/generate'
|
} from '@/api/generate'
|
||||||
import { cancelTaskByBusinessNo } from '@/api/task'
|
import { cancelTaskByBusinessNo } from '@/api/task'
|
||||||
import { useDevice } from '@/composables/useDevice'
|
import { useDevice } from '@/composables/useDevice'
|
||||||
import { ElMessage } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
import { computed, reactive, ref } from 'vue'
|
import { computed, reactive, ref } from 'vue'
|
||||||
|
|
||||||
const { isMobile } = useDevice()
|
const { isMobile } = useDevice()
|
||||||
|
|
@ -356,6 +400,8 @@ const taskTypeNavItems: { key: string; label: string }[] = [
|
||||||
{ key: 'releaseStation', label: '解绑站点' },
|
{ key: 'releaseStation', label: '解绑站点' },
|
||||||
{ key: 'cancel', label: '取消任务(仓+容器)' },
|
{ key: 'cancel', label: '取消任务(仓+容器)' },
|
||||||
{ key: 'businessCancel', label: '业务取消' },
|
{ key: 'businessCancel', label: '业务取消' },
|
||||||
|
{ key: 'inboundException', label: '入库异常处理' },
|
||||||
|
{ key: 'expedite', label: '任务加急' },
|
||||||
]
|
]
|
||||||
|
|
||||||
const panelKey = ref('inbound')
|
const panelKey = ref('inbound')
|
||||||
|
|
@ -417,6 +463,20 @@ const releaseStationForm = reactive<ReleaseStationReq>({ warehouse: '', containe
|
||||||
const cancelForm = reactive<CancelReq>({ warehouse: '', container: '' })
|
const cancelForm = reactive<CancelReq>({ warehouse: '', container: '' })
|
||||||
const businessCancelForm = reactive({ businessNo: '', reason: '' })
|
const businessCancelForm = reactive({ businessNo: '', reason: '' })
|
||||||
|
|
||||||
|
/** 入库异常处理:出库站点与提升机点位映射(与后台 ASRSConsts 保持一致) */
|
||||||
|
const outboundStationOptions = ['A3', 'A4']
|
||||||
|
const elevatorOptions = [
|
||||||
|
{ id: 1, label: '提升机1号', point: '0211520SS0225040' },
|
||||||
|
{ id: 2, label: '提升机2号', point: '0228800SS0225040' },
|
||||||
|
]
|
||||||
|
const inboundExceptionForm = reactive({
|
||||||
|
palletCode: '',
|
||||||
|
outboundStation: 'A3',
|
||||||
|
elevatorId: 1 as number,
|
||||||
|
warehouse: 'WH01',
|
||||||
|
})
|
||||||
|
const expediteForm = reactive({ businessNo: '' })
|
||||||
|
|
||||||
function showResult(title: string, type: 'success' | 'error', detail?: unknown) {
|
function showResult(title: string, type: 'success' | 'error', detail?: unknown) {
|
||||||
resultTitle.value = title
|
resultTitle.value = title
|
||||||
resultType.value = type
|
resultType.value = type
|
||||||
|
|
@ -606,6 +666,81 @@ async function handleCancel() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function handleInboundException() {
|
||||||
|
if (!inboundExceptionForm.palletCode) {
|
||||||
|
return ElMessage.warning('请输入托盘码')
|
||||||
|
}
|
||||||
|
if (!inboundExceptionForm.outboundStation) {
|
||||||
|
return ElMessage.warning('请选择出库站点')
|
||||||
|
}
|
||||||
|
const elevator = elevatorOptions.find(e => e.id === inboundExceptionForm.elevatorId)
|
||||||
|
if (!elevator) {
|
||||||
|
return ElMessage.warning('请选择提升机')
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
await generateInboundException({
|
||||||
|
palletCode: inboundExceptionForm.palletCode,
|
||||||
|
outboundStation: inboundExceptionForm.outboundStation,
|
||||||
|
elevatorId: elevator.id,
|
||||||
|
elevatorPoint: elevator.point,
|
||||||
|
})
|
||||||
|
showResult('入库异常出库已提交', 'success')
|
||||||
|
ElMessage.success('入库异常出库已提交')
|
||||||
|
} catch (e) {
|
||||||
|
showResult('入库异常出库失败', 'error', e)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleInboundExceptionUnbind() {
|
||||||
|
if (!inboundExceptionForm.warehouse || !inboundExceptionForm.palletCode || !inboundExceptionForm.outboundStation) {
|
||||||
|
return ElMessage.warning('请填写仓库编码、托盘码和出库站点')
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
await generateReleaseStation({
|
||||||
|
warehouse: inboundExceptionForm.warehouse,
|
||||||
|
container: inboundExceptionForm.palletCode,
|
||||||
|
station: inboundExceptionForm.outboundStation,
|
||||||
|
})
|
||||||
|
showResult('解绑成功', 'success')
|
||||||
|
ElMessage.success('解绑成功')
|
||||||
|
} catch (e) {
|
||||||
|
showResult('解绑失败', 'error', e)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleExpedite(priority: number) {
|
||||||
|
const businessNo = expediteForm.businessNo?.trim()
|
||||||
|
if (!businessNo) {
|
||||||
|
return ElMessage.warning('请填写业务跟踪号')
|
||||||
|
}
|
||||||
|
const label = priority >= 1000 ? '非常紧急' : priority >= 500 ? '加急' : '正常'
|
||||||
|
try {
|
||||||
|
await ElMessageBox.confirm(
|
||||||
|
`确认将业务跟踪号「${businessNo}」的任务链设为${label}(优先级 ${priority})?`,
|
||||||
|
'任务加急确认',
|
||||||
|
{ type: 'warning', confirmButtonText: '确认', cancelButtonText: '取消' },
|
||||||
|
)
|
||||||
|
} catch {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
loading.value = true
|
||||||
|
try {
|
||||||
|
await generateExpedite({ businessNo, priority })
|
||||||
|
showResult(`任务已${label}(优先级 ${priority})`, 'success')
|
||||||
|
ElMessage.success(`任务已${label}`)
|
||||||
|
} catch (e) {
|
||||||
|
showResult('任务加急失败', 'error', e)
|
||||||
|
} finally {
|
||||||
|
loading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleBusinessCancel() {
|
async function handleBusinessCancel() {
|
||||||
if (!businessCancelForm.businessNo?.trim()) {
|
if (!businessCancelForm.businessNo?.trim()) {
|
||||||
return ElMessage.warning('请填写业务跟踪号')
|
return ElMessage.warning('请填写业务跟踪号')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue