feat(production): 更新工单页面检品数量输入组件并添加批号等字段
- 将检品数量输入框从 el-input-number 替换为 el-input 组件
- 添加 handleInspectedQuantity 方法处理检品数量输入验证
- 注释掉生产数量不能超过待生产数量的校验逻辑
- 在最终检验页面表格中新增批号、检品数量和请检部门列
| | |
| | | </el-form-item> |
| | | <el-form-item label="检品数量" |
| | | prop="inspectedQuantity"> |
| | | <el-input-number v-model.number="reportForm.inspectedQuantity" |
| | | :min="0" |
| | | :step="1" |
| | | <el-input v-model.number="reportForm.inspectedQuantity" |
| | | type="number" |
| | | min="0" |
| | | step="1" |
| | | style="width: 300px" |
| | | controls-position="right" |
| | | placeholder="请输入检品数量"/> |
| | | placeholder="请输入检品数量" |
| | | @input="handleInspectedQuantity"/> |
| | | </el-form-item> |
| | | <el-form-item label="班组信息"> |
| | | <el-select v-model="reportForm.userId" |
| | |
| | | } |
| | | reportForm.scrapQty = num; |
| | | }; |
| | | |
| | | const handleInspectedQuantity = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.inspectedQuantity = null; |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | | if (isNaN(num)) { |
| | | return; |
| | | } |
| | | if (num < 0) { |
| | | reportForm.inspectedQuantity = null; |
| | | return; |
| | | } |
| | | if (!Number.isInteger(num)) { |
| | | reportForm.inspectedQuantity = Math.floor(num); |
| | | return; |
| | | } |
| | | reportForm.inspectedQuantity = num; |
| | | }; |
| | | const currentReportRowData = ref(null); |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | return; |
| | | } |
| | | |
| | | if (quantity > reportForm.planQuantity) { |
| | | ElMessageBox.alert("本次生产数量不能超过待生产数量", "提示", { |
| | | confirmButtonText: "确定", |
| | | }); |
| | | return; |
| | | } |
| | | // if (quantity > reportForm.planQuantity) { |
| | | // ElMessageBox.alert("本次生产数量不能超过待生产数量", "提示", { |
| | | // confirmButtonText: "确定", |
| | | // }); |
| | | // return; |
| | | // } |
| | | |
| | | const submitData = { |
| | | ...reportForm, |
| | |
| | | prop: "productName", |
| | | }, |
| | | { |
| | | label: "批号", |
| | | prop: "batchNo", |
| | | }, |
| | | { |
| | | label: "检品数量", |
| | | prop: "inspectedQuantity", |
| | | }, |
| | | { |
| | | label: "请检部门", |
| | | prop: "manufacturingTeam", |
| | | }, |
| | | { |
| | | label: "规格型号", |
| | | prop: "model", |
| | | }, |