This commit is contained in:
weiz 2024-02-18 17:09:45 +08:00
parent 5e8ce86683
commit ff63458ff4
5 changed files with 70 additions and 4 deletions

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\bid\BidDocumentExaminationLists;
use app\adminapi\logic\bid\BidDocumentExaminationLogic;
use app\adminapi\validate\bid\BidDocumentExaminationValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -72,5 +74,23 @@ class BidDocumentExaminationController extends BaseAdminController
return $this->data($result);
}
//获取审批流程列表
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',1)->where('name','bssc')->findOrEmpty();
$data = Flow::field('id,name')->where('flow_cate',$flow_type['id'])->where('status',2)->select();
return $this->success('请求成功',$data->toArray());
}
//添加审批
public function approve(): \think\response\Json
{
$params = (new BidDocumentExaminationValidate())->post()->goCheck('approve');
$result = BidDocumentExaminationLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(BidDocumentExaminationLogic::getError());
}
}

View File

@ -130,4 +130,20 @@ class BidDocumentExaminationLogic extends BaseLogic
$data['approve_id'] = $approve_info['id'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$res = addApprove(
'标书审查',
$params['id'],
'app\common\model\bid\BidDocumentExamination',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
return true;
}else{
return false;
}
}
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\validate\bid;
use app\common\model\bid\BidBuyBiddingDocument;
use app\common\model\bid\BidDocumentExamination;
use app\common\model\dict\DictData;
use app\common\model\material\Material;
use app\common\validate\BaseValidate;
@ -34,18 +35,22 @@ class BidDocumentExaminationValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'buy_bidding_document_id' => 'require|checkBuyBiddingDocument',
'technical_review_annex' => 'checkAnnex',
'business_contract_deviation_annex' => 'checkAnnex',
'tax_rate' => 'checkTaxRate',
'pay_type' => 'checkPayType',
'quotation_detail' => 'checkQuotationDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
'id.require' => '缺少必要参数',
'buy_bidding_document_id.require' => '请选择标书编号',
'flow_id.require' => '审批流程',
'path.require' => '前台路径',
];
@ -57,7 +62,7 @@ class BidDocumentExaminationValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id', true);
return $this->remove('id', true)->remove('flow_id',true)->remove('path',true);
}
@ -68,7 +73,9 @@ class BidDocumentExaminationValidate extends BaseValidate
* @date 2023/12/02 09:52
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -81,6 +88,11 @@ class BidDocumentExaminationValidate extends BaseValidate
{
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
/**
@ -94,6 +106,15 @@ class BidDocumentExaminationValidate extends BaseValidate
return $this->only(['id']);
}
public function checkData($value): bool|string
{
$data = BidDocumentExamination::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkBuyBiddingDocument($value): bool|string
{
$data = BidBuyBiddingDocument::where('id',$value)->findOrEmpty();

View File

@ -33,6 +33,6 @@ class FlowApprove extends BaseModel
public function getCheckStatusTextAttr($value,$data){
$dict = DictData::where('type_value','check_status')->column('name','value');
return !empty($data['check_status']) ? $dict[$data['check_status']] : '';
return $dict[$data['check_status']];
}
}

View File

@ -86,4 +86,13 @@ class BaseValidate extends Validate
// 3.成功返回数据
return $params;
}
public function checkFlow($value): bool|string
{
$flow = Flow::where('id',$value)->findOrEmpty();
if($flow->isEmpty()){
return '审批流程信息不存在';
}
return true;
}
}