fix: 基础信息排序问题

This commit is contained in:
dxc
2026-03-12 09:29:50 +08:00
parent 3ecdb121d2
commit d8e86959b8
5 changed files with 234 additions and 122 deletions

View File

@ -881,8 +881,8 @@ const querySearchType = (queryString: string, cb: any) => {
const getList = () => {
loading.value = true;
// 强制注入预警排序开关(基于权限)
queryParams.enableWarningSort = userStore.hasPermission('material_list:view_warning');
// 仅当用户没有进行手动表头排序时才开启预警排序
queryParams.enableWarningSort = userStore.hasPermission('material_list:view_warning') && !queryParams.orderByColumn;
// Stringify advancedFilters to JSON string as backend expects
const params = {
...queryParams,

View File

@ -376,7 +376,15 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="序列号" prop="serial_number">
<el-form-item prop="serial_number">
<template #label>
<div class="flex items-center justify-between w-full">
<span>序列号</span>
<el-link type="primary" :underline="false" @click="openScanner" title="开启摄像头智能扫码" :disabled="entryMode === 'batch'">
<el-icon><Camera /></el-icon> 智能扫码
</el-link>
</div>
</template>
<el-input v-model="form.serial_number" :placeholder="entryMode === 'serial' ? '请扫描 SN...' : '不可用'" :disabled="entryMode === 'batch'" clearable>
<template #prefix><span class="prefix-tag sn">SN</span></template>
</el-input>
@ -646,6 +654,9 @@
<div class="dialog-footer"><el-button @click="printVisible = false">取消</el-button><el-button type="primary" :loading="printing" @click="confirmPrint"><el-icon><Printer/></el-icon>确认打印</el-button></div>
</template>
</el-dialog>
<!-- 智能扫码弹窗 -->
<SmartScannerDialog v-model="scannerDialogVisible" @confirm="handleScannerConfirm" />
</div>
</template>
@ -672,6 +683,7 @@ import {getLabelPreview, executePrint} from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
import WarehouseSelector from '@/components/WarehouseSelector.vue'
import SmartScannerDialog from '@/components/SmartScannerDialog.vue'
import { useUserStore } from '@/stores/user'
// ------------------------------------
@ -813,6 +825,9 @@ const cameraRef = ref<InstanceType<typeof WebRtcCamera> | null>(null)
const currentCameraField = ref<'arrival_photo' | 'inspection_report'>('arrival_photo')
const inspection_report_url = ref('')
// 智能扫码弹窗
const scannerDialogVisible = ref(false)
// 库位级联选择器数据
const warehouseOptions = ref<any[]>([])
@ -1488,6 +1503,17 @@ const handleCameraConfirm = async (file: File) => {
}
}
// 智能扫码
const openScanner = () => {
scannerDialogVisible.value = true
}
const handleScannerConfirm = (result: string) => {
form.serial_number = result
scannerDialogVisible.value = false
ElMessage.success('序列号已提取')
}
const addCondition = () => {
advancedConditions.value.push({ field: '', operator: '', value: '' })
}

View File

@ -320,7 +320,15 @@
<div class="identity-panel">
<el-row :gutter="24">
<el-col :span="12">
<el-form-item label="序列号(SN)" prop="serial_number">
<el-form-item prop="serial_number">
<template #label>
<div class="flex items-center justify-between w-full">
<span>序列号(SN)</span>
<el-link type="primary" :underline="false" @click="openScanner" title="开启摄像头智能扫码">
<el-icon><Camera /></el-icon> 智能扫码
</el-link>
</div>
</template>
<el-input v-model="form.serial_number" placeholder="必填: 唯一序列号" clearable><template #prefix><span class="prefix-tag sn">SN</span></template></el-input>
</el-form-item>
</el-col>
@ -518,6 +526,8 @@
</template>
</el-dialog>
<!-- 智能扫码弹窗 -->
<SmartScannerDialog v-model="scannerDialogVisible" @confirm="handleScannerConfirm" />
</div>
</template>
@ -540,6 +550,7 @@ import {
import { uploadFile, deleteFile } from '@/api/inbound/buy'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
import WarehouseSelector from '@/components/WarehouseSelector.vue'
import SmartScannerDialog from '@/components/SmartScannerDialog.vue'
import { getLabelPreview, executePrint } from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import { useUserStore } from '@/stores/user'
@ -668,6 +679,9 @@ const currentCameraField = ref<'product_photo' | 'quality_report_link' | 'inspec
const quality_url = ref('')
const inspection_url = ref('')
// 智能扫码弹窗
const scannerDialogVisible = ref(false)
// 库位级联选择器数据
const warehouseOptions = ref<any[]>([])
@ -1187,6 +1201,17 @@ const handleCameraConfirm = async (file: File) => {
}
};
// 智能扫码
const openScanner = () => {
scannerDialogVisible.value = true
}
const handleScannerConfirm = (result: string) => {
form.serial_number = result
scannerDialogVisible.value = false
ElMessage.success('序列号已提取')
}
const submitForm = async () => {
await formRef.value.validate(async (valid: boolean) => {
if(valid) {

View File

@ -395,7 +395,15 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="序列号" prop="serial_number">
<el-form-item prop="serial_number">
<template #label>
<div class="flex items-center justify-between w-full">
<span>序列号</span>
<el-link type="primary" :underline="false" @click="openScanner" title="开启摄像头智能扫码" :disabled="entryMode === 'batch'">
<el-icon><Camera /></el-icon> 智能扫码
</el-link>
</div>
</template>
<el-input v-model="form.serial_number" :placeholder="entryMode === 'serial' ? '请扫描 SN...' : '不可用'" :disabled="entryMode === 'batch'" clearable>
<template #prefix><span class="prefix-tag sn">SN</span></template>
</el-input>
@ -582,6 +590,9 @@
<div class="dialog-footer"><el-button @click="printVisible = false">取消</el-button><el-button type="primary" :loading="printing" @click="confirmPrint"><el-icon><Printer/></el-icon>确认打印</el-button></div>
</template>
</el-dialog>
<!-- 智能扫码弹窗 -->
<SmartScannerDialog v-model="scannerDialogVisible" @confirm="handleScannerConfirm" />
</div>
</template>
@ -604,6 +615,7 @@ import {
import { uploadFile, deleteFile } from '@/api/inbound/buy'
import WebRtcCamera from '@/components/Camera/WebRtcCamera.vue'
import WarehouseSelector from '@/components/WarehouseSelector.vue'
import SmartScannerDialog from '@/components/SmartScannerDialog.vue'
import {getLabelPreview, executePrint} from '@/api/common/print'
import { getWarehouseTree } from '@/api/common/warehouse'
import { useUserStore } from '@/stores/user'
@ -731,6 +743,9 @@ const cameraRef = ref<InstanceType<typeof WebRtcCamera> | null>(null)
const currentCameraField = ref<'arrival_photo' | 'quality_report_link'>('arrival_photo')
const quality_report_url = ref('')
// 智能扫码弹窗
const scannerDialogVisible = ref(false)
// 库位级联选择器数据
const warehouseOptions = ref<any[]>([])
@ -1309,6 +1324,17 @@ const handleCameraConfirm = async (file: File) => {
}
};
// 智能扫码
const openScanner = () => {
scannerDialogVisible.value = true
}
const handleScannerConfirm = (result: string) => {
form.serial_number = result
scannerDialogVisible.value = false
ElMessage.success('序列号已提取')
}
const submitForm = async () => {
if (!formRef.value) return
await formRef.value.validate(async (valid: boolean) => {