前端(buy/semi/product/service.vue,4 文件): 修复物料搜索"点击已聚焦 input 时内容被清空"交互 bug。 el-select 在 filterable+remote 模式下点击已聚焦的 input 时,el-select 内部 会 emit query='' 触发 remote-method,绕过 handleMaterialDropdownVisible 入口保护,直接清空 searchKeyword 和 materialOptions,导致用户被迫重写。 新增两层防御实现"编辑无感": 1) handleMaterialDropdownVisible 入口拦截:已选过物料(form.base_id 有值) 时下拉打开直接 return,不请求默认列表 2) handleSearchMaterial 内部拦截:拦截 el-select 内部 emit 的空 query, 仅在 form.base_id 有值 + safeQuery 为空 + 列表非空时 return 后端(buy/semi/product_service.py,3 文件): 入库类别校验从黑名单改为白名单准入制,彻底杜绝"成品进半成品库" 等非法组合(d94b52b 黑名单方案"成品不能进采购库"已挡不住这种组合)。 - buy_service.py: 黑名单(禁半成品/成品进采购)→ 白名单(必须含"原材料") - semi_service.py: 统一错误信息格式为"只有【半成品】才允许半成品入库!" - product_service.py: 统一错误信息格式为"只有【成品】才允许成品入库!" - 三处空 category 统一显示为"未分类" 配合前端已修复的 catch 块(e.response.data.msg 精准提取),后端新错误 信息可原样弹窗给用户。
Vue 3 + TypeScript + Vite
This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 <script setup> SFCs, check out the script setup docs to learn more.
Learn more about the recommended Project Setup and IDE Support in the Vue Docs TypeScript Guide.