update
This commit is contained in:
parent
5e8ce86683
commit
ff63458ff4
@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
|
|||||||
use app\adminapi\lists\bid\BidDocumentExaminationLists;
|
use app\adminapi\lists\bid\BidDocumentExaminationLists;
|
||||||
use app\adminapi\logic\bid\BidDocumentExaminationLogic;
|
use app\adminapi\logic\bid\BidDocumentExaminationLogic;
|
||||||
use app\adminapi\validate\bid\BidDocumentExaminationValidate;
|
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);
|
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());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -130,4 +130,20 @@ class BidDocumentExaminationLogic extends BaseLogic
|
|||||||
$data['approve_id'] = $approve_info['id'];
|
$data['approve_id'] = $approve_info['id'];
|
||||||
return $data->toArray();
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -16,6 +16,7 @@ namespace app\adminapi\validate\bid;
|
|||||||
|
|
||||||
|
|
||||||
use app\common\model\bid\BidBuyBiddingDocument;
|
use app\common\model\bid\BidBuyBiddingDocument;
|
||||||
|
use app\common\model\bid\BidDocumentExamination;
|
||||||
use app\common\model\dict\DictData;
|
use app\common\model\dict\DictData;
|
||||||
use app\common\model\material\Material;
|
use app\common\model\material\Material;
|
||||||
use app\common\validate\BaseValidate;
|
use app\common\validate\BaseValidate;
|
||||||
@ -34,18 +35,22 @@ class BidDocumentExaminationValidate extends BaseValidate
|
|||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
'id' => 'require',
|
'id' => 'require|checkData',
|
||||||
'buy_bidding_document_id' => 'require|checkBuyBiddingDocument',
|
'buy_bidding_document_id' => 'require|checkBuyBiddingDocument',
|
||||||
'technical_review_annex' => 'checkAnnex',
|
'technical_review_annex' => 'checkAnnex',
|
||||||
'business_contract_deviation_annex' => 'checkAnnex',
|
'business_contract_deviation_annex' => 'checkAnnex',
|
||||||
'tax_rate' => 'checkTaxRate',
|
'tax_rate' => 'checkTaxRate',
|
||||||
'pay_type' => 'checkPayType',
|
'pay_type' => 'checkPayType',
|
||||||
'quotation_detail' => 'checkQuotationDetail',
|
'quotation_detail' => 'checkQuotationDetail',
|
||||||
|
'flow_id' => 'require|checkFlow',
|
||||||
|
'path' => 'require',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $message = [
|
protected $message = [
|
||||||
'id.require' => '缺少必要参数',
|
'id.require' => '缺少必要参数',
|
||||||
'buy_bidding_document_id.require' => '请选择标书编号',
|
'buy_bidding_document_id.require' => '请选择标书编号',
|
||||||
|
'flow_id.require' => '审批流程',
|
||||||
|
'path.require' => '前台路径',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
@ -57,7 +62,7 @@ class BidDocumentExaminationValidate extends BaseValidate
|
|||||||
*/
|
*/
|
||||||
public function sceneAdd()
|
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
|
* @date 2023/12/02 09:52
|
||||||
*/
|
*/
|
||||||
public function sceneEdit()
|
public function sceneEdit()
|
||||||
{}
|
{
|
||||||
|
return $this->remove('flow_id',true)->remove('path',true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +88,11 @@ class BidDocumentExaminationValidate extends BaseValidate
|
|||||||
{
|
{
|
||||||
return $this->only(['id']);
|
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']);
|
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
|
public function checkBuyBiddingDocument($value): bool|string
|
||||||
{
|
{
|
||||||
$data = BidBuyBiddingDocument::where('id',$value)->findOrEmpty();
|
$data = BidBuyBiddingDocument::where('id',$value)->findOrEmpty();
|
||||||
|
@ -33,6 +33,6 @@ class FlowApprove extends BaseModel
|
|||||||
|
|
||||||
public function getCheckStatusTextAttr($value,$data){
|
public function getCheckStatusTextAttr($value,$data){
|
||||||
$dict = DictData::where('type_value','check_status')->column('name','value');
|
$dict = DictData::where('type_value','check_status')->column('name','value');
|
||||||
return !empty($data['check_status']) ? $dict[$data['check_status']] : '';
|
return $dict[$data['check_status']];
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -86,4 +86,13 @@ class BaseValidate extends Validate
|
|||||||
// 3.成功返回数据
|
// 3.成功返回数据
|
||||||
return $params;
|
return $params;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function checkFlow($value): bool|string
|
||||||
|
{
|
||||||
|
$flow = Flow::where('id',$value)->findOrEmpty();
|
||||||
|
if($flow->isEmpty()){
|
||||||
|
return '审批流程信息不存在';
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user