feat: 新增检测单关联、基础数据优化与入库单升级

1. 新增出库单检测单号字段并添加索引支持溯源
2. 优化基础数据页面物料类型展示与选择逻辑
3. 升级入库单导入功能,支持自动生成单号并返回导入结果
4. 优化接驳台查询排序方式
5. 修复字符串拼接空格问题
This commit is contained in:
SunYF
2026-09-21 15:28:14 +08:00
parent 0e769f3813
commit 12ca493c61
70 changed files with 25782 additions and 119 deletions
+20 -3
View File
@@ -131,10 +131,12 @@ const batchOptions = ref([])
// 选中物料的展示类型(问题18:类型含「其他」):other=其他品类(按批次管理)/sn=电气件/batch=结构件
const pickedType = ref('')
const genForm = reactive({
outboundNo: '',
materialCode: '', mode: 1, batchNo: '', qty: 1, zoneCode: '',
shelfNo: '', layerNo: '', positionNo: '',
boxNo: '', contractNo: '', remark: '',
outboundCategory: 'other', ownershipType: 'other', ownershipNo: '', targetStation: ''
outboundCategory: 'other', ownershipType: 'other', ownershipNo: '', targetStation: '',
inspectionNo: ''
})
const snInput = ref('')
const snList = ref([])
@@ -297,8 +299,10 @@ async function submitGen() {
ElMessage.warning('出库类别选「其他」时,请在备注中填写具体原因'); return
}
const payload = {
outboundNo: genForm.outboundNo.trim() || undefined,
materialCode: genForm.materialCode, operator,
outboundCategory: genForm.outboundCategory,
batchNo: batchVal,
ownershipType: genForm.ownershipType,
ownershipNo: genForm.ownershipNo.trim() || undefined,
targetStation: genForm.targetStation.trim() || undefined,
@@ -308,7 +312,8 @@ async function submitGen() {
positionNo: genForm.positionNo || undefined,
boxNo: genForm.boxNo.trim() || undefined,
contractNo: genForm.contractNo.trim() || undefined,
remark: genForm.remark.trim() || undefined
remark: genForm.remark.trim() || undefined,
inspectionNo: genForm.inspectionNo.trim() || undefined
}
if (genForm.mode === 1) {
if (!genForm.batchNo) { ElMessage.warning('请从该物料可用批次中选择出库批次'); return }
@@ -345,7 +350,7 @@ function recDefaultRange() {
const end = new Date(); const start = new Date(); start.setMonth(start.getMonth() - 3)
return [fmt(start), fmt(end)]
}
const recFilters = reactive({ outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', dateRange: recDefaultRange() })
const recFilters = reactive({ outboundType: '', status: '', materialCode: '', boxNo: '', ownershipNo: '', inspectionNo: '', dateRange: recDefaultRange() })
const recRows = ref([])
const recTotal = ref(0)
const loadingRec = ref(false)
@@ -362,6 +367,7 @@ async function loadRecords() {
materialCode: recFilters.materialCode.trim(),
boxNo: recFilters.boxNo.trim(),
ownershipNo: recFilters.ownershipNo.trim(),
inspectionNo: recFilters.inspectionNo.trim(),
page: recPage.current, pageSize: recPage.size
}
if (Array.isArray(recFilters.dateRange) && recFilters.dateRange.length === 2) {
@@ -385,6 +391,7 @@ function downloadCSV() {
materialCode: recFilters.materialCode.trim(),
boxNo: recFilters.boxNo.trim(),
ownershipNo: recFilters.ownershipNo.trim(),
inspectionNo: recFilters.inspectionNo.trim(),
startDate: dr[0],
endDate: dr[1]
}, '出库管理.xlsx', { countUrl: '/outbound/query', name: '出库记录' })
@@ -482,11 +489,18 @@ onMounted(loadDicts)
<span v-else style="color:#909399;font-size:12px">请先选择物料,系统自动带出类型(电气件/结构件)</span>
</el-form-item>
<el-form-item label="出库单号">
<el-input v-model="genForm.outboundNo" placeholder="留空自动生成(如 OB20260921-001)" clearable style="width:100%" />
</el-form-item>
<el-form-item label="出库类别" required>
<el-select v-model="genForm.outboundCategory" style="width:100%">
<el-option v-for="c in CATEGORY_OPTIONS" :key="c.value" :value="c.value" :label="c.label" />
</el-select>
</el-form-item>
<el-form-item label="检测单号">
<el-input v-model="genForm.inspectionNo" placeholder="退货/报废需溯源检验单据时填写(选填)" clearable style="width:100%" />
</el-form-item>
<el-form-item label="归属">
<el-select v-model="genForm.ownershipType" style="width:160px;margin-right:8px">
<el-option v-for="o in OWNERSHIP_OPTIONS" :key="o.value" :value="o.value" :label="o.label" />
@@ -642,6 +656,9 @@ onMounted(loadDicts)
<el-form-item label="归属单号">
<el-input v-model="recFilters.ownershipNo" placeholder="工单号/科技项目号" clearable style="width:160px" @keyup.enter="searchRec" />
</el-form-item>
<el-form-item label="检测单号">
<el-input v-model="recFilters.inspectionNo" placeholder="检测单号(模糊)" clearable style="width:180px" @keyup.enter="searchRec" />
</el-form-item>
<el-form-item label="时间">
<el-date-picker v-model="recFilters.dateRange" type="daterange" value-format="YYYY-MM-DD"
range-separator="至" start-placeholder="开始" end-placeholder="结束" style="width:240px" />