更新修复投标决策

This commit is contained in:
yaooo 2023-12-11 15:05:31 +08:00
parent ae1fe8d898
commit 6ba7bb636f
4 changed files with 33 additions and 6 deletions

View File

@ -38,7 +38,7 @@ class BidDocumentExaminationLists extends BaseAdminDataLists implements ListsSea
public function setSearch(): array
{
return [
'=' => ['buy_bidding_document_id'],
'=' => ['buy_bidding_document_id', 'is_need_deposit'],
];
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\logic\bid;
use app\common\model\bid\BidDocumentExamination;
use app\common\model\bid\BidDocumentExaminationDetail;
use app\common\logic\BaseLogic;
use think\facade\Db;
@ -40,7 +41,7 @@ class BidDocumentExaminationLogic extends BaseLogic
{
Db::startTrans();
try {
BidDocumentExamination::create([
$bidDocumentExamination = BidDocumentExamination::create([
'approve_id' => $params['approve_id'],
'buy_bidding_document_id' => $params['buy_bidding_document_id'],
'is_need_deposit' => $params['is_need_deposit'],
@ -60,7 +61,12 @@ class BidDocumentExaminationLogic extends BaseLogic
'business_contract_deviation_handling_plan' => $params['business_contract_deviation_handling_plan'],
'business_contract_deviation_annex' => $params['business_contract_deviation_annex']
]);
foreach ($params['product'] as $item)
{
BidDocumentExaminationDetail::create([
'bid_document_examination_id' => $bidDocumentExamination->id,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
@ -135,6 +141,8 @@ class BidDocumentExaminationLogic extends BaseLogic
*/
public static function detail($params): array
{
return BidDocumentExamination::findOrEmpty($params['id'])->toArray();
$bidDocumentExamination = BidDocumentExamination::findOrEmpty($params['id']);
$bidDocumentExamination->document = $bidDocumentExamination->document;
return $bidDocumentExamination->toArray();
}
}

View File

@ -32,6 +32,7 @@ class BidDocumentExaminationValidate extends BaseValidate
*/
protected $rule = [
'id' => 'require',
'product' => 'array|checkProduct',
];
@ -64,7 +65,7 @@ class BidDocumentExaminationValidate extends BaseValidate
*/
public function sceneEdit()
{
return $this->only(['id']);
return $this->only(['id', 'product']);
}
@ -91,4 +92,19 @@ class BidDocumentExaminationValidate extends BaseValidate
return $this->only(['id']);
}
public function checkProduct($value, $rule, $data)
{
$firstData = $value[0];
// if (empty($firstData['product_id'])) {
// return '产品ID不能为空';
// }
// if (empty($firstData['product_num'])) {
// return '产品数量不能为空!';
// }
// if (empty($firstData['tax_rate'])) {
// return '产品税率不能为空!';
// }
return true;
}
}

View File

@ -30,5 +30,8 @@ class BidDocumentExamination extends BaseModel
protected $name = 'bid_document_examination';
protected $deleteTime = 'delete_time';
public function document()
{
return $this->belongsTo(\app\common\model\bid\BidBuyBiddingDocument::class, 'buy_bidding_document_id');
}
}