| | |
| | | }else if(row.quantity_card<row.completedQuantity){ |
| | | return new Error(t('reportingWorks.pleaseNumber10')) |
| | | } |
| | | const nextProcess = titleUploadData.value.nextProcess//下工序 |
| | | |
| | | const completedSum = Number(row.thisQuantitySum) //总完工数量 |
| | | const nextQuantitySum = Number(row.nextQuantitySum) //总下工序完工数量 |
| | | let nextQuantitySum = '' |
| | | if (nextProcess!=''){ |
| | | nextQuantitySum = Number(row.nextQuantitySum) //总下工序完工数量 |
| | | }else { |
| | | nextQuantitySum = Number(row.received_quantity) //总下工序完工数量 |
| | | } |
| | | const totalQuantity = Number(row.quantity) //可完工数量 |
| | | const val = Number(cellValue) //输入值 |
| | | |
| | |
| | | `) |
| | | } |
| | | if(titleUploadData.value.reportingWorkId!=null){ |
| | | if(row.completedQuantityComputed>=row.minQuantity ){ |
| | | if((val<(row.completedQuantityComputed-row.minQuantity || val>=row.completedQuantityComputed))){ |
| | | return new Error(`${row.completedQuantityComputed-row.minQuantity} |
| | | if (nextProcess!=''){//非最后一道工序 |
| | | if(row.completedQuantityComputed>=row.minQuantity ){ |
| | | if((val<(row.completedQuantityComputed-row.minQuantity || val>=row.completedQuantityComputed))){ |
| | | return new Error(`${row.completedQuantityComputed-row.minQuantity} |
| | | <=val<= |
| | | ${row.completedQuantityComputed}`) |
| | | } |
| | | }else{ |
| | | if((val>row.completedQuantityComputed)){ |
| | | return new Error(`val |
| | | } |
| | | }else{ |
| | | if((val>row.completedQuantityComputed)){ |
| | | return new Error(`val |
| | | <= |
| | | ${row.completedQuantityComputed}`) |
| | | } |
| | | } |
| | | }else {//最后一道工序 |
| | | if (val<row.completedQuantityComputed){ |
| | | //库存数量、已入库数量 |
| | | if (val>(row.inventory_quantity-row.received_quantity)){ |
| | | return new Error(`val |
| | | <= |
| | | ${row.inventory_quantity-row.received_quantity}`) |
| | | }else { |
| | | if (val < (row.inventory_quantity-row.received_quantity)){ |
| | | //完工总数、本次完工数、已入库数量 |
| | | if (completedSum-row.completedQuantityComputed <row.received_quantity){ |
| | | return new Error(`${t('reportingWorks.pleaseNumber15')}`) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | } |