| | |
| | | </el-button> |
| | | </el-col> |
| | | <el-col :span="4"> |
| | | <div style="font-size: 16px;">待排产数量:{{productionQuantity}}</div> |
| | | <div style="font-size: 16px;">待排产数量:{{pendingQuantity}}</div> |
| | | </el-col> |
| | | <!-- <el-col :span="2"> |
| | | <el-button type="danger" @click="clearAllRows"> |
| | |
| | | const copyForm = ref(null); |
| | | const coalList = ref([]) |
| | | const supplierList = ref([]); |
| | | const productionQuantity = ref(0); |
| | | const pendingQuantity = ref(0); |
| | | |
| | | // 工具函数 |
| | | const debugIdMatching = () => { |
| | |
| | | }; |
| | | |
| | | const editInitialization = async (type, data) => { |
| | | productionQuantity.value = data.productionQuantity; |
| | | pendingQuantity.value = data.productionQuantity - data.pendingQuantity; |
| | | copyForm.value = deepClone(data); |
| | | tableData.value = data.productionInventoryList || []; |
| | | detailsTableData.value = data.productionList || []; |
| | |
| | | } |
| | | let num = 0; |
| | | detailsTableData.value.forEach((row) => { |
| | | num += row.schedulingNum |
| | | num += Number(row.schedulingNum) |
| | | }) |
| | | if(productionQuantity.value < num){ |
| | | console.log(num) |
| | | if(pendingQuantity.value < num){ |
| | | ElMessage.warning("待排产数量不能小于生产明细数量") |
| | | return; |
| | | } |
| | | console.log(copyForm.value) |
| | | detailsTableData.value.forEach((row) => { |
| | |
| | | row.productionId = copyForm.value.id |
| | | row.coalId = copyForm.value.coalId |
| | | }) |
| | | detailsTableData.value[0].productionQuantity = copyForm.value.productionQuantity |
| | | detailsTableData.value[0].productionQuantity = pendingQuantity.value |
| | | try{ |
| | | const res = await addProductionScheduling(detailsTableData.value) |
| | | if (res.code === 200) { |