| | |
| | | @input="handleScrapQtyInput" /> |
| | | </el-form-item></el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="检品数量" |
| | | prop="inspectedQuantity"> |
| | | <el-input v-model.number="reportForm.inspectedQuantity" |
| | | type="number" |
| | | min="0" |
| | | step="1" |
| | | style="width: 300px" |
| | | placeholder="请输入检品数量" |
| | | @input="handleInspectedQuantity"/> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-form-item label="班组信息"> |
| | | <el-select v-model="reportForm.userId" |
| | | style="width: 300px" |
| | |
| | | :min="0" |
| | | :precision="2" |
| | | :controls="false" |
| | | :max="row.qualitity || 0" |
| | | :disabled="!row.qualitity" |
| | | :max="row.requisitionQty || 0" |
| | | :disabled="!row.requisitionQty" |
| | | style="width: 100%" |
| | | /> |
| | | </template> |
| | |
| | | <el-table-column prop="productName" label="产品名称" min-width="160" /> |
| | | <el-table-column prop="model" label="型号" min-width="150" /> |
| | | <el-table-column prop="unit" label="单位" width="90" align="center" /> |
| | | <el-table-column prop="qualitity" label="可领用数量" width="140" align="center" /> |
| | | <el-table-column prop="requisitionQty" label="可领用数量" width="140" align="center" /> |
| | | </el-table> |
| | | |
| | | <!-- 已选择明细展示放在报工弹框下方的 reportForm.drawMaterialList 表格里 --> |
| | |
| | | const handleQuantityInput = value => { |
| | | if (value === "" || value === null || value === undefined) { |
| | | reportForm.quantity = null; |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | | const num = Number(value); |
| | |
| | | } |
| | | if (num < 1) { |
| | | reportForm.quantity = null; |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | | if (!Number.isInteger(num)) { |
| | | const intValue = Math.floor(num); |
| | | if (intValue < 1) { |
| | | reportForm.quantity = null; |
| | | reportForm.scrapQty = null; |
| | | return; |
| | | } |
| | | reportForm.quantity = intValue; |
| | | } else { |
| | | reportForm.quantity = num; |
| | | } |
| | | // 如果 totalInvestment 有值,自动计算 scrapQty = totalInvestment - quantity |
| | | if (reportForm.totalInvestment !== null && reportForm.totalInvestment !== undefined && reportForm.totalInvestment !== "") { |
| | | const total = Number(reportForm.totalInvestment); |
| | | const qty = Number(reportForm.quantity); |
| | | if (total > qty) { |
| | | reportForm.scrapQty = total - qty; |
| | | } else { |
| | | reportForm.scrapQty = null; |
| | | } |
| | | } |
| | | }; |
| | | |