maven
9 天以前 351e2c4fd56d116061beff3cc335101b9a512f50
src/views/production/operationScheduling/components/ProductionDialog.vue
@@ -17,7 +17,7 @@
          </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">
@@ -152,7 +152,7 @@
const copyForm = ref(null);
const coalList = ref([])
const supplierList = ref([]);
const productionQuantity = ref(0);
const pendingQuantity = ref(0);
// 工具函数
const debugIdMatching = () => {
@@ -199,7 +199,7 @@
};
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 || [];
@@ -290,10 +290,12 @@
  }
  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) => {
@@ -301,7 +303,7 @@
    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) {