| | |
| | | <span v-else>{{ row.unit }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" |
| | | label="单价"> |
| | | <template #default="{ row }"> |
| | | <el-form-item v-if="bomDataValue.isEdit" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitPrice" |
| | | :min="0" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!bomDataValue.isEdit" /> |
| | | </el-form-item> |
| | | <span v-else>{{ row.unitPrice }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | fixed="right" |
| | | v-if="pageType === 'order'" |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | unit: "", |
| | | children: [], |
| | | tempId: new Date().getTime(), |
| | |
| | | ElMessage.error("请填写单位产出所需数量"); |
| | | return false; |
| | | } |
| | | // 校验单价是否必填 |
| | | if ( |
| | | item.unitPrice === undefined || |
| | | item.unitPrice === null || |
| | | item.unitPrice === 0 |
| | | ) { |
| | | ElMessage.error("请填写单价"); |
| | | return false; |
| | | } |
| | | // 递归校验子项 |
| | | if (item.children && item.children.length > 0) { |
| | | if (!validateBomData(item.children)) { |
| | |
| | | productModelId: item.productModelId || null, |
| | | processId: item.processId || null, |
| | | unitQuantity: item.unitQuantity || 0, |
| | | unitPrice: item.unitPrice || 0, |
| | | demandedQuantity: item.demandedQuantity || null, |
| | | unit: item.unit || "", |
| | | tempId: item.tempId || new Date().getTime(), |
| | |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" |
| | | label="单价"> |
| | | <template #default="{ row, $index }"> |
| | | <el-form-item v-if="dataValue.isEdit" |
| | | :rules="[{ required: true, message: '请输入单价', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitPrice" |
| | | :min="0" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!dataValue.isEdit" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" |
| | | fixed="right" |
| | | width="200"> |
| | |
| | | isValid = false; |
| | | return; |
| | | } |
| | | if (!item.unitPrice) { |
| | | ElMessage.error("请输入单价"); |
| | | isValid = false; |
| | | return; |
| | | } |
| | | if (isOrderPage.value && !item.demandedQuantity) { |
| | | ElMessage.error("请输入需求总量"); |
| | | isValid = false; |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | children: [], |
| | |
| | | processId: "", |
| | | processName: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | children: [], |
| | |
| | | productModelId: undefined, |
| | | processId: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | demandedQuantity: 0, |
| | | children: [], |
| | | unit: "", |
| | |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="unitPrice" |
| | | label="单价" |
| | | width="150"> |
| | | <template #default="{ row, $index }"> |
| | | <el-form-item :prop="`dataList.${$index}.unitPrice`" |
| | | :rules="[{ required: true, message: '请输入单价', trigger: ['blur','change'] }]" |
| | | style="margin: 0"> |
| | | <el-input-number v-model="row.unitPrice" |
| | | :min="0" |
| | | :precision="2" |
| | | :step="1" |
| | | controls-position="right" |
| | | style="width: 100%" |
| | | :disabled="!dataValue.isEdit" /> |
| | | </el-form-item> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="diskQuantity" |
| | | label="盘数(盘)" |
| | | width="150"> |
| | |
| | | productModelId: undefined, |
| | | processId: "", |
| | | unitQuantity: 0, |
| | | unitPrice: 0, |
| | | demandedQuantity: 0, |
| | | unit: "", |
| | | diskQuantity: 0, |