update
This commit is contained in:
parent
55d4fe7d21
commit
66eaf507fe
@ -189,6 +189,7 @@ class ProcurementContractValidate extends BaseValidate
|
|||||||
return '采购合同明细数据格式错误';
|
return '采购合同明细数据格式错误';
|
||||||
}
|
}
|
||||||
foreach ($value as $v) {
|
foreach ($value as $v) {
|
||||||
|
$material_purchase_request_detail = MaterialPurchaseRequestDetail::where('id', $v['material_purchase_request_detail_id'])->findOrEmpty();
|
||||||
if (isset($v['id']) && $v['id'] != '') {
|
if (isset($v['id']) && $v['id'] != '') {
|
||||||
$data_detail = ProcurementContractDetail::where('id', $v['id'])->findOrEmpty();
|
$data_detail = ProcurementContractDetail::where('id', $v['id'])->findOrEmpty();
|
||||||
if ($data_detail->isEmpty()) {
|
if ($data_detail->isEmpty()) {
|
||||||
@ -198,7 +199,7 @@ class ProcurementContractValidate extends BaseValidate
|
|||||||
if (empty($v['material_purchase_request_detail_id'])) {
|
if (empty($v['material_purchase_request_detail_id'])) {
|
||||||
return '请选择采购申请明细信息';
|
return '请选择采购申请明细信息';
|
||||||
} else {
|
} else {
|
||||||
$material_purchase_request_detail = MaterialPurchaseRequestDetail::where('id',$v['material_purchase_request_detail_id'])->findOrEmpty();
|
|
||||||
if ($material_purchase_request_detail->isEmpty()) {
|
if ($material_purchase_request_detail->isEmpty()) {
|
||||||
return '采购申请明细信息不存在';
|
return '采购申请明细信息不存在';
|
||||||
}
|
}
|
||||||
@ -209,6 +210,9 @@ class ProcurementContractValidate extends BaseValidate
|
|||||||
if (!is_numeric($v['num']) || $v['num'] <= 0) {
|
if (!is_numeric($v['num']) || $v['num'] <= 0) {
|
||||||
return '数量必须是大于0的数字';
|
return '数量必须是大于0的数字';
|
||||||
}
|
}
|
||||||
|
if ($v['num'] > $material_purchase_request_detail['num']) {
|
||||||
|
return '数量不能大于申请数量';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (empty($v['price'])) {
|
if (empty($v['price'])) {
|
||||||
return '含税单价不能为空';
|
return '含税单价不能为空';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user