| | |
| | | <div> |
| | | <el-dialog v-model="dialogVisible" |
| | | title="领料台账" |
| | | width="1200px" |
| | | width="1350px" |
| | | @close="handleClose"> |
| | | <div class="material-toolbar"> |
| | | <el-button type="primary" |
| | |
| | | border |
| | | row-key="tempId"> |
| | | <el-table-column label="工序名称" |
| | | min-width="140"> |
| | | min-width="80"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.operationName || "-" }}</span> |
| | | <el-select v-else |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="原料名称" |
| | | min-width="140"> |
| | | min-width="120"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.materialName || "-" }}</span> |
| | | <el-button v-else |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="原料型号" |
| | | min-width="140"> |
| | | min-width="120"> |
| | | <template #default="{ row }"> |
| | | {{ row.materialModel || "-" }} |
| | | </template> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="需求数量" |
| | | min-width="120"> |
| | | min-width="100"> |
| | | <template #default="{ row }"> |
| | | <span v-if="row.bom === true">{{ row.demandedQuantity ?? "-" }}</span> |
| | | <span v-if="row.bom === true">{{ stripTrailingZeros(row.demandedQuantity) ?? "-" }}</span> |
| | | <el-input-number v-else |
| | | v-model="row.demandedQuantity" |
| | | :min="0" |
| | | :precision="3" |
| | | :step="1" |
| | | controls-position="right" |
| | | :formatter="value => stripTrailingZeros(value)" |
| | | :parser="value => parseFloat(value) || 0" |
| | | style="width: 100%;" |
| | | @change="val => handleRequiredQtyChange(row, val)" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="计量单位" |
| | | width="100"> |
| | | width="80"> |
| | | <template #default="{ row }"> |
| | | {{ row.unit || "-" }} |
| | | </template> |
| | |
| | | <template #default="{ row }"> |
| | | <el-input-number v-model="row.pickQty" |
| | | :min="0" |
| | | :precision="3" |
| | | :step="1" |
| | | controls-position="right" |
| | | :formatter="value => stripTrailingZeros(value)" |
| | | :parser="value => parseFloat(value) || 0" |
| | | style="width: 100%;" /> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | } |
| | | ); |
| | | |
| | | const stripTrailingZeros = val => { |
| | | const str = String(val); |
| | | if (str.includes(".")) { |
| | | return parseFloat(str).toString(); |
| | | } |
| | | return str; |
| | | }; |
| | | |
| | | const handleClose = () => { |
| | | materialTableData.value = []; |
| | | currentMaterialSelectRowIndex.value = -1; |