B位静置记录查询
This commit is contained in:
@@ -41,11 +41,17 @@
|
||||
<label class="form-label">产品扫码:</label>
|
||||
<el-input ref="scanInputRef" v-model.trim="productCode" placeholder="请扫描或输入产品码"
|
||||
clearable prefix-icon="Scanner" @keyup.enter="handleScanQuery"
|
||||
@clear="handleClearProduct" />
|
||||
@clear="handleClearProduct" class="scan-input" />
|
||||
<div class="scan-actions">
|
||||
<el-button type="primary" :loading="scanLoading" :disabled="!canScan"
|
||||
@click="handleScanQuery" icon="Search">
|
||||
查询
|
||||
</el-button>
|
||||
<el-button :loading="staticRecordLoading" @click="openStaticRecordDialog"
|
||||
icon="Tickets">
|
||||
查询静置产品
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -118,18 +124,6 @@
|
||||
<span class="metric-label">本次标准</span>
|
||||
<span class="metric-value">{{ displayMinutes(scanResult.minStaticMinutes) }}</span>
|
||||
</div>
|
||||
<div class="metric-item">
|
||||
<span class="metric-label">PLC申请上线</span>
|
||||
<el-tag :type="scanResult.partLoad ? 'success' : 'info'">
|
||||
{{ scanResult.partLoad ? '已申请' : '未申请' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<div class="metric-item">
|
||||
<span class="metric-label">后端判定</span>
|
||||
<el-tag :type="scanResult.canConfirm ? 'success' : 'warning'">
|
||||
{{ scanResult.canConfirm ? '允许确认' : '禁止确认' }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -196,6 +190,40 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="staticRecordDialog.visible" title="查询静置产品" width="92vw"
|
||||
:close-on-click-modal="false" class="static-record-dialog">
|
||||
<div class="record-toolbar">
|
||||
<el-radio-group v-model="staticRecordDialog.status" @change="queryStaticRecords">
|
||||
<el-radio-button label="all">全部</el-radio-button>
|
||||
<el-radio-button label="online">未下线</el-radio-button>
|
||||
<el-radio-button label="offline">已下线</el-radio-button>
|
||||
</el-radio-group>
|
||||
<div class="record-search">
|
||||
<el-input v-model.trim="staticRecordDialog.packCode" clearable placeholder="PACK码模糊查询"
|
||||
prefix-icon="Search" @keyup.enter="queryStaticRecords" @clear="queryStaticRecords" />
|
||||
<el-button type="primary" :loading="staticRecordLoading" @click="queryStaticRecords"
|
||||
icon="Refresh">
|
||||
刷新
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-table :data="staticRecordList" v-loading="staticRecordLoading" border height="560"
|
||||
empty-text="暂无静置产品记录">
|
||||
<el-table-column prop="产品编号" label="产品编号" min-width="230" show-overflow-tooltip />
|
||||
<el-table-column prop="产品型号" label="产品型号" min-width="100" show-overflow-tooltip />
|
||||
<el-table-column label="静置状态" width="90" align="center">
|
||||
<template #default="{ row }">
|
||||
<el-tag :type="row.静置结束时间 ? 'success' : 'warning'">
|
||||
{{ row.静置结束时间 ? '已出库' : '未出库' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="静置开始时间" label="静置开始" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="静置结束时间" label="静置完成" min-width="170" show-overflow-tooltip />
|
||||
<el-table-column prop="静置时长" label="持续时间" min-width="120" show-overflow-tooltip />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<div v-else class="auth-loading">
|
||||
@@ -238,6 +266,9 @@ const scanLoading = ref(false)
|
||||
const confirmLoading = ref(false)
|
||||
const confirmedSuccess = ref(false)
|
||||
const standardDialog = reactive({ visible: false, value: DEFAULT_STANDARD_MINUTES })
|
||||
const staticRecordLoading = ref(false)
|
||||
const staticRecordList = ref([])
|
||||
const staticRecordDialog = reactive({ visible: false, status: 'all', packCode: '' })
|
||||
|
||||
const scanResult = reactive({
|
||||
success: false,
|
||||
@@ -491,6 +522,8 @@ const handleScanReply = (result) => {
|
||||
|
||||
scanResult.success = true
|
||||
scanResult.productCode = fields[1] || productCode.value
|
||||
// 扫箱体码时后端会返回最终 PACK 码,后续确认上线必须使用 PACK 码。
|
||||
productCode.value = scanResult.productCode
|
||||
scanResult.orderNo = fields[2] || ''
|
||||
scanResult.productType = fields[3] || ''
|
||||
scanResult.machineCode = fields[4] || ''
|
||||
@@ -546,6 +579,28 @@ const handleScanQuery = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const queryStaticRecords = async () => {
|
||||
staticRecordLoading.value = true
|
||||
try {
|
||||
const param = []
|
||||
param[0] = ['状态', staticRecordDialog.status]
|
||||
param[1] = ['PACK码', staticRecordDialog.packCode]
|
||||
const data = CreateData('11', '线下手动静置_记录查询', param)
|
||||
const response = await ExecDatabase(data)
|
||||
staticRecordList.value = Array.isArray(response.data) ? response.data.slice(0, 100) : []
|
||||
} catch (e) {
|
||||
staticRecordList.value = []
|
||||
ElMessage.error('查询静置产品失败')
|
||||
} finally {
|
||||
staticRecordLoading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const openStaticRecordDialog = async () => {
|
||||
staticRecordDialog.visible = true
|
||||
await queryStaticRecords()
|
||||
}
|
||||
|
||||
const handleConfirmClick = () => {
|
||||
if (!canConfirmOnline.value) {
|
||||
ElMessage.warning(scanResult.message || '当前状态不允许确认上线')
|
||||
@@ -798,7 +853,7 @@ onBeforeUnmount(() => {
|
||||
.operation-section,
|
||||
.info-section,
|
||||
.action-section {
|
||||
padding: 12px 24px 0;
|
||||
padding: 10px 24px 0;
|
||||
}
|
||||
|
||||
.info-section {
|
||||
@@ -810,7 +865,7 @@ onBeforeUnmount(() => {
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
padding: 14px 16px;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
@@ -827,20 +882,34 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
|
||||
.scan-row {
|
||||
display: flex;
|
||||
display: grid;
|
||||
grid-template-columns: 96px minmax(260px, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
width: 96px;
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
color: #606266;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.scan-input {
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.scan-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.scan-actions :deep(.el-button) {
|
||||
min-width: 118px;
|
||||
}
|
||||
|
||||
.result-summary {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -874,6 +943,14 @@ onBeforeUnmount(() => {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.summary-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -893,7 +970,7 @@ onBeforeUnmount(() => {
|
||||
|
||||
.info-item,
|
||||
.metric-item {
|
||||
min-height: 58px;
|
||||
min-height: 56px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 8px;
|
||||
background: #f8fafc;
|
||||
@@ -971,6 +1048,25 @@ onBeforeUnmount(() => {
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.record-toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.record-search {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(220px, 320px) 140px;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.record-search :deep(.el-button) {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.header-actions {
|
||||
flex-wrap: wrap;
|
||||
@@ -982,22 +1078,43 @@ onBeforeUnmount(() => {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.scan-row,
|
||||
@media (max-width: 640px) {
|
||||
.scan-row {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.action-card {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
width: auto;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.scan-actions {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scan-actions :deep(.el-button) {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.info-grid,
|
||||
.metric-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.record-toolbar {
|
||||
align-items: stretch;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.record-search {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (orientation: portrait) {
|
||||
|
||||
Reference in New Issue
Block a user