This commit is contained in:
weiz 2024-02-19 17:49:52 +08:00
parent b0da07a99b
commit c4e27aaceb
39 changed files with 985 additions and 107 deletions

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectCostAdjustmentLists;
use app\adminapi\logic\project\ProjectCostAdjustmentLogic;
use app\adminapi\validate\project\ProjectCostAdjustmentValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectCostAdjustmentController extends BaseAdminController
$result = ProjectCostAdjustmentLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','cbtz')->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 ProjectCostAdjustmentValidate())->post()->goCheck('approve');
$result = ProjectCostAdjustmentLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectCostAdjustmentLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectCostBudgetLists;
use app\adminapi\logic\project\ProjectCostBudgetLogic;
use app\adminapi\validate\project\ProjectCostBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectCostBudgetController extends BaseAdminController
$result = ProjectCostBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','fyys')->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 ProjectCostBudgetValidate())->post()->goCheck('approve');
$result = ProjectCostBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectCostBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectEquipmentBudgetLists;
use app\adminapi\logic\project\ProjectEquipmentBudgetLogic;
use app\adminapi\validate\project\ProjectEquipmentBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,23 @@ class ProjectEquipmentBudgetController extends BaseAdminController
$result = ProjectEquipmentBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','jjys')->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 ProjectEquipmentBudgetValidate())->post()->goCheck('approve');
$result = ProjectEquipmentBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectEquipmentBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectExpenseReimbursementLists;
use app\adminapi\logic\project\ProjectExpenseReimbursementLogic;
use app\adminapi\validate\project\ProjectExpenseReimbursementValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectExpenseReimbursementController extends BaseAdminController
$result = ProjectExpenseReimbursementLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','fybx')->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 ProjectExpenseReimbursementValidate())->post()->goCheck('approve');
$result = ProjectExpenseReimbursementLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectExpenseReimbursementLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectLaborBudgetLists;
use app\adminapi\logic\project\ProjectLaborBudgetLogic;
use app\adminapi\validate\project\ProjectLaborBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,22 @@ class ProjectLaborBudgetController extends BaseAdminController
$result = ProjectLaborBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','rgys')->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 ProjectLaborBudgetValidate())->post()->goCheck('approve');
$result = ProjectLaborBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectLaborBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectLoanApplyLists;
use app\adminapi\logic\project\ProjectLoanApplyLogic;
use app\adminapi\validate\project\ProjectLoanApplyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectLoanApplyController extends BaseAdminController
$result = ProjectLoanApplyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','jksq')->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 ProjectLoanApplyValidate())->post()->goCheck('approve');
$result = ProjectLoanApplyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectLoanApplyLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectMaterialBudgetLists;
use app\adminapi\logic\project\ProjectMaterialBudgetLogic;
use app\adminapi\validate\project\ProjectMaterialBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectMaterialBudgetController extends BaseAdminController
$result = ProjectMaterialBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','clys')->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 ProjectMaterialBudgetValidate())->post()->goCheck('approve');
$result = ProjectMaterialBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectMaterialBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectSettlementLists;
use app\adminapi\logic\project\ProjectSettlementLogic;
use app\adminapi\validate\project\ProjectSettlementValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -72,6 +74,24 @@ class ProjectSettlementController extends BaseAdminController
$result = ProjectSettlementLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','jfjs')->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 ProjectSettlementValidate())->post()->goCheck('approve');
$result = ProjectSettlementLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectSettlementLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectSubcontractSettlementLists;
use app\adminapi\logic\project\ProjectSubcontractSettlementLogic;
use app\adminapi\validate\project\ProjectSubcontractSettlementValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -70,6 +72,24 @@ class ProjectSubcontractSettlementController extends BaseAdminController
$result = ProjectSubcontractSettlementLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','fbjs')->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 ProjectSubcontractSettlementValidate())->post()->goCheck('approve');
$result = ProjectSubcontractSettlementLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectSubcontractSettlementLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectSubpackageBudgetLists;
use app\adminapi\logic\project\ProjectSubpackageBudgetLogic;
use app\adminapi\validate\project\ProjectSubpackageBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectSubpackageBudgetController extends BaseAdminController
$result = ProjectSubpackageBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','fbys')->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 ProjectSubpackageBudgetValidate())->post()->goCheck('approve');
$result = ProjectSubpackageBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectSubpackageBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectTotalBudgetLists;
use app\adminapi\logic\project\ProjectTotalBudgetLogic;
use app\adminapi\validate\project\ProjectTotalBudgetValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectTotalBudgetController extends BaseAdminController
$result = ProjectTotalBudgetLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','xmzys')->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 ProjectTotalBudgetValidate())->post()->goCheck('approve');
$result = ProjectTotalBudgetLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectTotalBudgetLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectTravelReimbursementLists;
use app\adminapi\logic\project\ProjectTravelReimbursementLogic;
use app\adminapi\validate\project\ProjectTravelReimbursementValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectTravelReimbursementController extends BaseAdminController
$result = ProjectTravelReimbursementLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','clbx')->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 ProjectTravelReimbursementValidate())->post()->goCheck('approve');
$result = ProjectTravelReimbursementLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectTravelReimbursementLogic::getError());
}
}

View File

@ -20,6 +20,8 @@ use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\project\ProjectTripApplyLists;
use app\adminapi\logic\project\ProjectTripApplyLogic;
use app\adminapi\validate\project\ProjectTripApplyValidate;
use app\common\model\oa\Flow;
use app\common\model\oa\FlowType;
/**
@ -103,6 +105,24 @@ class ProjectTripApplyController extends BaseAdminController
$result = ProjectTripApplyLogic::detail($params);
return $this->data($result);
}
public function flows(): \think\response\Json
{
$flow_type = FlowType::where('type',4)->where('name','ccsq')->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 ProjectTripApplyValidate())->post()->goCheck('approve');
$result = ProjectTripApplyLogic::approve($params,$this->adminId);
if (true === $result) {
return $this->success('提交审核信息成功', [], 1, 1);
}
return $this->fail(ProjectTripApplyLogic::getError());
}
}

View File

@ -114,17 +114,46 @@ class ProjectCostAdjustmentLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectCostAdjustment::field('id,project_id,adjust_date,adjust_amount,remark,annex,add_user,update_user,create_time,update_time')->findOrEmpty($params['id']);
$data = ProjectCostAdjustment::field('id,project_id,adjust_date,adjust_amount,remark,annex,add_user,update_user,create_time,update_time,approve_id')->findOrEmpty($params['id']);
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$admin = Admin::where('id','in',[$data['add_user'],$data['update_user']])->column('name','id');
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$data['add_user'] = $admin[$data['add_user']];
$data['update_user'] = $admin[$data['update_user']];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectCostAdjustment')
->where('content_logic','app\adminapi\logic\project\ProjectCostAdjustmentLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectCostAdjustment::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'成本调整',
$params['id'],
'app\common\model\project\ProjectCostAdjustment',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectCostAdjustment::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -150,7 +150,7 @@ class ProjectCostBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectCostBudget::field('id,org_id,dept_id,project_id,cost_budget_code,remark,annex')->findOrEmpty($params['id']);
$data = ProjectCostBudget::field('id,org_id,dept_id,project_id,cost_budget_code,remark,annex,approve_id')->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -158,10 +158,39 @@ class ProjectCostBudgetLogic extends BaseLogic
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectCostBudget')
->where('content_logic','app\adminapi\logic\project\ProjectCostBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectCostBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'费用预算',
$params['id'],
'app\common\model\project\ProjectCostBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectCostBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -158,7 +158,7 @@ class ProjectEquipmentBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectEquipmentBudget::field('id,org_id,dept_id,project_id,equipment_budget_code,remark,annex')->findOrEmpty($params['id']);
$data = ProjectEquipmentBudget::field('id,org_id,dept_id,project_id,equipment_budget_code,remark,annex,approve_id')->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -166,10 +166,39 @@ class ProjectEquipmentBudgetLogic extends BaseLogic
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectEquipmentBudget')
->where('content_logic','app\adminapi\logic\project\ProjectEquipmentBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectEquipmentBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'机具预算',
$params['id'],
'app\common\model\project\ProjectEquipmentBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectEquipmentBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -214,7 +214,7 @@ class ProjectExpenseReimbursementLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectExpenseReimbursement::field('id,expense_reimbursement_code,project_id,apply_user,apply_date,reimbursement_type,loan_apply_id,offset_loan_amount,payee_name,payee_bank,payee_account,remark,annex,bank_account_id')
$data = ProjectExpenseReimbursement::field('id,expense_reimbursement_code,project_id,apply_user,apply_date,reimbursement_type,loan_apply_id,offset_loan_amount,payee_name,payee_bank,payee_account,remark,annex,bank_account_id,approve_id')
->findOrEmpty($params['id']);
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$loan_apply = ProjectLoanApply::field('loan_apply_code,loan_amount')->where('id',$data['loan_apply_id'])->findOrEmpty();
@ -226,10 +226,39 @@ class ProjectExpenseReimbursementLogic extends BaseLogic
$data['pay_amount'] = $data['total_amount'] - $data['offset_loan_amount'];
$data['reimbursement_type_text'] = $data->reimbursement_type_text;
$data['bank_account'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectExpenseReimbursement')
->where('content_logic','app\adminapi\logic\project\ProjectExpenseReimbursementLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectExpenseReimbursement::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'费用报销',
$params['id'],
'app\common\model\project\ProjectExpenseReimbursement',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectExpenseReimbursement::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -154,7 +154,7 @@ class ProjectLaborBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectLaborBudget::field('id,org_id,dept_id,project_id,labor_budget_code,remark,annex')->findOrEmpty($params['id']);
$data = ProjectLaborBudget::field('id,org_id,dept_id,project_id,labor_budget_code,remark,annex,approve_id')->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -162,10 +162,39 @@ class ProjectLaborBudgetLogic extends BaseLogic
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectLaborBudget')
->where('content_logic','app\adminapi\logic\project\ProjectLaborBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectLaborBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'人工预算',
$params['id'],
'app\common\model\project\ProjectLaborBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectLaborBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -122,16 +122,45 @@ class ProjectLoanApplyLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectLoanApply::field('id,project_id,loan_apply_code,apply_user,loan_date,loan_amount,payee_name,payee_bank,payee_account,remark,annex,bank_account_id')
$data = ProjectLoanApply::field('id,project_id,loan_apply_code,apply_user,loan_date,loan_amount,payee_name,payee_bank,payee_account,remark,annex,bank_account_id,approve_id')
->findOrEmpty($params['id']);
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$data['bank_account'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectLoanApply')
->where('content_logic','app\adminapi\logic\project\ProjectLoanApplyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectLoanApply::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'借款申请',
$params['id'],
'app\common\model\project\ProjectLoanApply',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectLoanApply::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -153,7 +153,7 @@ class ProjectMaterialBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectMaterialBudget::field('id,org_id,dept_id,project_id,material_budget_code,remark,annex')->findOrEmpty($params['id']);
$data = ProjectMaterialBudget::field('id,org_id,dept_id,project_id,material_budget_code,remark,annex,approve_id')->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -161,10 +161,39 @@ class ProjectMaterialBudgetLogic extends BaseLogic
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectMaterialBudget')
->where('content_logic','app\adminapi\logic\project\ProjectMaterialBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectMaterialBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'材料预算',
$params['id'],
'app\common\model\project\ProjectMaterialBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectMaterialBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -117,7 +117,7 @@ class ProjectSettlementLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectSettlement::field('id,settlement_code,project_id,contract_id,settlement_amount,settlement_date,remark,annex')->findOrEmpty($params['id'])->toArray();
$data = ProjectSettlement::field('id,settlement_code,project_id,contract_id,settlement_amount,settlement_date,remark,annex,approve_id')->findOrEmpty($params['id'])->toArray();
$project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$contract = Contract::field('contract_name,contract_code,amount')->where('id',$data['contract_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
@ -132,10 +132,39 @@ class ProjectSettlementLogic extends BaseLogic
$data['negotiation_amount'] = ContractNegotiation::where('contract_id',$data['contract_id'])->sum('negotiation_amount');
//结算差异
$data['settlement_difference'] = bcsub(($data['contract_amount']+$data['negotiation_amount']),$data['settlement_amount']);
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectSettlement')
->where('content_logic','app\adminapi\logic\project\ProjectSettlementLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data;
}
public static function approve($params,$admin_id): bool{
$data = ProjectSettlement::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'甲方结算',
$params['id'],
'app\common\model\project\ProjectSettlement',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectSettlement::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -118,7 +118,7 @@ class ProjectSubcontractSettlementLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectSubcontractSettlement::field('id,settlement_code,project_id,contract_id,settlement_amount,settlement_date,remark,annex')->findOrEmpty($params['id'])->toArray();
$data = ProjectSubcontractSettlement::field('id,settlement_code,project_id,contract_id,settlement_amount,settlement_date,remark,annex,approve_id')->findOrEmpty($params['id'])->toArray();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$contract = SubcontractingContract::field('supplier_id,contract_no,contract_name')->where('id',$data['contract_id'])->findOrEmpty();
$supplier = Supplier::field('supplier_code,supplier_name')->where('id',$contract['supplier_id'])->findOrEmpty();
@ -134,10 +134,39 @@ class ProjectSubcontractSettlementLogic extends BaseLogic
$data['negotiation_amount'] = SubcontractingContractNegotiation::where('contract_id',$data['contract_id'])->sum('negotiation_amount');
//结算差异
$data['settlement_difference'] = bcsub(($data['contract_amount']+$data['negotiation_amount']),$data['settlement_amount']);
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectSubcontractSettlement')
->where('content_logic','app\adminapi\logic\project\ProjectSubcontractSettlementLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data;
}
public static function approve($params,$admin_id): bool{
$data = ProjectSubcontractSettlement::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'分包结算',
$params['id'],
'app\common\model\project\ProjectSubcontractSettlement',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectSubcontractSettlement::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -160,7 +160,7 @@ class ProjectSubpackageBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectSubpackageBudget::field('id,org_id,dept_id,project_id,subpackage_budget_code,remark,annex')->findOrEmpty($params['id']);
$data = ProjectSubpackageBudget::field('id,org_id,dept_id,project_id,subpackage_budget_code,remark,annex,approve_id')->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
@ -168,10 +168,39 @@ class ProjectSubpackageBudgetLogic extends BaseLogic
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code'];
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectSubpackageBudget')
->where('content_logic','app\adminapi\logic\project\ProjectSubpackageBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectSubpackageBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'分包预算',
$params['id'],
'app\common\model\project\ProjectSubpackageBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectSubpackageBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -130,7 +130,7 @@ class ProjectTotalBudgetLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectTotalBudget::field('id,org_id,dept_id,project_id,total_budget_code,contract_amount,cl_cost,fb_cost,rg_cost,fy_cost,jj_cost,remark,budget_list,budget_date,project_manager')
$data = ProjectTotalBudget::field('id,org_id,dept_id,project_id,total_budget_code,contract_amount,cl_cost,fb_cost,rg_cost,fy_cost,jj_cost,remark,budget_list,budget_date,project_manager,approve_id')
->findOrEmpty($params['id']);
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
@ -155,10 +155,39 @@ class ProjectTotalBudgetLogic extends BaseLogic
$data['fy_cost_ratio'] = number_format($data['fy_cost'] / $data['total_cost'],2);
//机具成本占比
$data['jj_cost_ratio'] = number_format($data['jj_cost'] / $data['total_cost'],2);
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectTotalBudget')
->where('content_logic','app\adminapi\logic\project\ProjectTotalBudgetLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectTotalBudget::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'项目总预算',
$params['id'],
'app\common\model\project\ProjectTotalBudget',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectTotalBudget::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -236,7 +236,7 @@ class ProjectTravelReimbursementLogic extends BaseLogic
*/
public static function detail($params): array
{
$field = 'id,trip_apply_id,project_id,trip_reimbursement_code,reimbursement_type,loan_apply_id,offset_loan_amount,apply_user,apply_date,payee_name,payee_bank,payee_account,remark,annex,bank_account_id';
$field = 'id,trip_apply_id,project_id,trip_reimbursement_code,reimbursement_type,loan_apply_id,offset_loan_amount,apply_user,apply_date,payee_name,payee_bank,payee_account,remark,annex,bank_account_id,approve_id';
$data = ProjectTravelReimbursement::field($field)
->findOrEmpty($params['id']);
$trip_apply = ProjectTripApply::field('trip_apply_code')->where('id',$data['trip_apply_id'])->findOrEmpty();
@ -258,10 +258,39 @@ class ProjectTravelReimbursementLogic extends BaseLogic
$data['total_amount'] = ProjectTravelReimbursementDetail::where('travel_reimbursement_id',$data['id'])->sum('total_amount');
$data['pay_amount'] = $data['total_amount'] - $data['offset_loan_amount'];
$data['bank_account'] = BankAccount::field('account_sn,deposit_bank,account_name,account')->where('id',$data['bank_account_id'])->findOrEmpty();
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectTravelReimbursement')
->where('content_logic','app\adminapi\logic\project\ProjectTravelReimbursementLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectTravelReimbursement::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'差旅报销',
$params['id'],
'app\common\model\project\ProjectTravelReimbursement',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectTravelReimbursement::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -123,7 +123,7 @@ class ProjectTripApplyLogic extends BaseLogic
*/
public static function detail($params): array
{
$data = ProjectTripApply::field('id,project_id,trip_apply_code,origin_address,target_address,traffic,start_date,end_date,reason,days,remark,annex')
$data = ProjectTripApply::field('id,project_id,trip_apply_code,origin_address,target_address,traffic,start_date,end_date,reason,days,remark,annex,approve_id')
->findOrEmpty($params['id']);
$project = Project::field('name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$manager = ProjectManagerAppointment::field('project_manager')->where('project_id',$data['project_id'])->findOrEmpty();
@ -136,10 +136,39 @@ class ProjectTripApplyLogic extends BaseLogic
$admin = Admin::field('name')->where('id',$manager['project_manager'])->findOrEmpty();
$data['project_manager'] = $admin['name'];
}
$approve_info = FlowApprove::field('id')->where('content_id',$params['id'])
->where('content_model','app\common\model\project\ProjectTripApply')
->where('content_logic','app\adminapi\logic\project\ProjectTripApplyLogic')->findOrEmpty();
$data['approve_id'] = $approve_info['id'];
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
$data['approve_check_status'] = $approve_data['check_status'];
return $data->toArray();
}
public static function approve($params,$admin_id): bool{
$data = ProjectTripApply::where('id',$params['id'])->findOrEmpty();
$approve_data = FlowApprove::where('id',$data['approve_id'])->findOrEmpty();
if(!empty($data['approve_id']) && $approve_data['check_status'] != 3){
self::setError('当前内容存在审核信息,请勿重复提交');
return false;
}
Db::startTrans();
try {
$res = addApprove(
'出差申请',
$params['id'],
'app\common\model\project\ProjectTripApply',
$params['path'],
$params['flow_id'],
$admin_id
);
if($res){
ProjectTripApply::where('id',$params['id'])->update([
'approve_id' => $res,
]);
}
Db::commit();
return true;
} catch (\Exception $e) {
Db::rollback();
self::setError($e->getMessage());
return false;
}
}
}

View File

@ -16,6 +16,7 @@ namespace app\adminapi\validate\project;
use app\common\model\project\Project;
use app\common\model\project\ProjectCostAdjustment;
use app\common\validate\BaseValidate;
@ -32,11 +33,13 @@ class ProjectCostAdjustmentValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'adjust_date' => 'require|dateFormat:Y-m-d',
'adjust_amount' => 'require|float|gt:0',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -60,7 +63,7 @@ class ProjectCostAdjustmentValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -71,7 +74,9 @@ class ProjectCostAdjustmentValidate extends BaseValidate
* @date 2024/01/17 13:43
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -97,6 +102,20 @@ class ProjectCostAdjustmentValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectCostAdjustment::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();

View File

@ -18,6 +18,7 @@ namespace app\adminapi\validate\project;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project;
use app\common\model\project\ProjectCostBudget;
use app\common\model\project\ProjectCostBudgetDetail;
use app\common\model\project\ProjectCostTempSet;
use app\common\validate\BaseValidate;
@ -36,12 +37,14 @@ class ProjectCostBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
'annex' => 'checkAnnex',
'cost_budget_detail' => 'require|checkCostBudgetDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -61,7 +64,7 @@ class ProjectCostBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -72,7 +75,9 @@ class ProjectCostBudgetValidate extends BaseValidate
* @date 2024/01/16 14:32
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -98,6 +103,20 @@ class ProjectCostBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectCostBudget::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -18,6 +18,7 @@ namespace app\adminapi\validate\project;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project;
use app\common\model\project\ProjectEquipmentBudget;
use app\common\model\project\ProjectEquipmentBudgetDetail;
use app\common\validate\BaseValidate;
@ -35,12 +36,14 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
'annex' => 'checkAnnex',
'equipment_budget_detail' => 'require|checkEquipmentBudgetDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -60,7 +63,7 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -71,7 +74,9 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
* @date 2024/01/16 11:40
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -97,6 +102,20 @@ class ProjectEquipmentBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectEquipmentBudget::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -19,6 +19,7 @@ use app\common\model\bank\BankAccount;
use app\common\model\dict\DictData;
use app\common\model\project\Project;
use app\common\model\project\ProjectCostTempSet;
use app\common\model\project\ProjectExpenseReimbursement;
use app\common\model\project\ProjectExpenseReimbursementDetail;
use app\common\model\project\ProjectExpenseReimbursementInvoiceDetail;
use app\common\model\project\ProjectLoanApply;
@ -38,7 +39,7 @@ class ProjectExpenseReimbursementValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'apply_user' => 'require',
'apply_date' => 'require|dateFormat:Y-m-d',
@ -52,6 +53,8 @@ class ProjectExpenseReimbursementValidate extends BaseValidate
'bank_account_id' => 'require|checkBankAccount',
'reimbursement_detail' => 'require|checkReimbursementDetail',
'invoice_detail' => 'require|checkInvoiceDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -84,7 +87,7 @@ class ProjectExpenseReimbursementValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -95,7 +98,9 @@ class ProjectExpenseReimbursementValidate extends BaseValidate
* @date 2024/01/19 13:44
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -121,6 +126,20 @@ class ProjectExpenseReimbursementValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectExpenseReimbursement::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();

View File

@ -19,6 +19,7 @@ use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project;
use app\common\model\project\ProjectJobType;
use app\common\model\project\ProjectLaborBudget;
use app\common\model\project\ProjectLaborBudgetDetail;
use app\common\validate\BaseValidate;
@ -36,12 +37,14 @@ class ProjectLaborBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
'annex' => 'checkAnnex',
'labor_budget_detail' => 'require|checkLaborBudgetDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -62,7 +65,7 @@ class ProjectLaborBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -73,7 +76,9 @@ class ProjectLaborBudgetValidate extends BaseValidate
* @date 2024/01/16 09:26
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -99,6 +104,20 @@ class ProjectLaborBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectLaborBudget::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -17,6 +17,7 @@ namespace app\adminapi\validate\project;
use app\common\model\bank\BankAccount;
use app\common\model\project\Project;
use app\common\model\project\ProjectLoanApply;
use app\common\validate\BaseValidate;
@ -33,7 +34,7 @@ class ProjectLoanApplyValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'apply_user' => 'require',
'loan_date' => 'require|dateFormat:Y-m-d',
@ -43,6 +44,8 @@ class ProjectLoanApplyValidate extends BaseValidate
'payee_account' => 'require',
'annex' => 'checkAnnex',
'bank_account_id' => 'require|checkBankAccount',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -71,7 +74,7 @@ class ProjectLoanApplyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -82,7 +85,9 @@ class ProjectLoanApplyValidate extends BaseValidate
* @date 2024/01/17 11:05
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -108,6 +113,20 @@ class ProjectLoanApplyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectLoanApply::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();

View File

@ -35,12 +35,14 @@ class ProjectMaterialBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
'annex' => 'checkAnnex',
'material_budget_detail' => 'require|checkMaterialBudgetDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -60,7 +62,7 @@ class ProjectMaterialBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -71,7 +73,9 @@ class ProjectMaterialBudgetValidate extends BaseValidate
* @date 2024/01/08 16:30
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -97,6 +101,20 @@ class ProjectMaterialBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectMaterialBudgetDetail::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -18,6 +18,7 @@ namespace app\adminapi\validate\project;
use app\common\model\bid\BidBuyBiddingDocument;
use app\common\model\contract\Contract;
use app\common\model\project\Project;
use app\common\model\project\ProjectSettlement;
use app\common\validate\BaseValidate;
@ -34,12 +35,14 @@ class ProjectSettlementValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'contract_id' => 'require|checkContract',
'settlement_amount' => 'require|float|egt:0',
'settlement_date' => 'require|dateFormat:Y-m-d',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -62,7 +65,7 @@ class ProjectSettlementValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -73,7 +76,9 @@ class ProjectSettlementValidate extends BaseValidate
* @date 2023/12/29 10:22
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -99,6 +104,20 @@ class ProjectSettlementValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectSettlement::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();

View File

@ -16,6 +16,7 @@ namespace app\adminapi\validate\project;
use app\common\model\contract\SubcontractingContract;
use app\common\model\project\Project;
use app\common\model\project\ProjectSubcontractSettlement;
use app\common\validate\BaseValidate;
@ -32,12 +33,14 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'contract_id' => 'require|checkContract',
'settlement_amount' => 'require|float|egt:0',
'settlement_date' => 'require|dateFormat:Y-m-d',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -60,7 +63,7 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -71,7 +74,9 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
* @date 2023/12/29 13:59
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -97,6 +102,20 @@ class ProjectSubcontractSettlementValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectSubcontractSettlement::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();

View File

@ -18,6 +18,7 @@ namespace app\adminapi\validate\project;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project;
use app\common\model\project\ProjectSubpackageBudget;
use app\common\model\project\ProjectSubpackageBudgetDetail;
use app\common\validate\BaseValidate;
@ -35,12 +36,14 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
'annex' => 'checkAnnex',
'subpackage_budget_detail' => 'require|checkSubpackageBudgetDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
/**
@ -64,7 +67,7 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -75,7 +78,9 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
* @date 2024/01/10 15:19
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -101,6 +106,20 @@ class ProjectSubpackageBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectSubpackageBudget::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -18,6 +18,7 @@ namespace app\adminapi\validate\project;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project;
use app\common\model\project\ProjectTotalBudget;
use app\common\validate\BaseValidate;
@ -34,7 +35,7 @@ class ProjectTotalBudgetValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject',
@ -47,6 +48,8 @@ class ProjectTotalBudgetValidate extends BaseValidate
'budget_list' => 'checkAnnex',
'budget_date' => 'require|dateFormat:Y-m-d',
'project_manager' => 'require',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
protected $message = [
@ -80,7 +83,7 @@ class ProjectTotalBudgetValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -92,7 +95,7 @@ class ProjectTotalBudgetValidate extends BaseValidate
*/
public function sceneEdit()
{
return $this->remove('org_id',true)->remove('dept_id',true)->remove('project_id',true);
return $this->remove('org_id',true)->remove('dept_id',true)->remove('project_id',true)->remove('flow_id',true)->remove('path',true);
}
@ -119,6 +122,20 @@ class ProjectTotalBudgetValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectTotalBudget::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();

View File

@ -19,6 +19,7 @@ use app\common\model\bank\BankAccount;
use app\common\model\dict\DictData;
use app\common\model\project\ProjectCostTempSet;
use app\common\model\project\ProjectLoanApply;
use app\common\model\project\ProjectTravelReimbursement;
use app\common\model\project\ProjectTravelReimbursementDetail;
use app\common\model\project\ProjectTravelReimbursementInvoiceDetail;
use app\common\model\project\ProjectTripApply;
@ -38,7 +39,7 @@ class ProjectTravelReimbursementValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'trip_apply_id' => 'require|checkTripApply',
'reimbursement_type' => 'require|checkReimbursementType',
'loan_apply_id' => 'requireCallback:check_require|checkLoanApply',
@ -52,6 +53,8 @@ class ProjectTravelReimbursementValidate extends BaseValidate
'bank_account_id' => 'require|checkBankAccount',
'reimbursement_detail' => 'require|checkReimbursementDetail',
'invoice_detail' => 'require|checkInvoiceDetail',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -84,7 +87,7 @@ class ProjectTravelReimbursementValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -95,7 +98,9 @@ class ProjectTravelReimbursementValidate extends BaseValidate
* @date 2024/01/18 13:57
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -121,6 +126,20 @@ class ProjectTravelReimbursementValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectTravelReimbursement::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkTripApply($value): bool|string
{
$data = ProjectTripApply::where('id',$value)->findOrEmpty();

View File

@ -17,6 +17,7 @@ namespace app\adminapi\validate\project;
use app\common\model\dict\DictData;
use app\common\model\project\Project;
use app\common\model\project\ProjectTripApply;
use app\common\validate\BaseValidate;
@ -33,7 +34,7 @@ class ProjectTripApplyValidate extends BaseValidate
* @var string[]
*/
protected $rule = [
'id' => 'require',
'id' => 'require|checkData',
'project_id' => 'require|checkProject',
'origin_address' => 'require',
'target_address' => 'require',
@ -41,6 +42,8 @@ class ProjectTripApplyValidate extends BaseValidate
'start_date' => 'require|dateFormat:Y-m-d',
'end_date' => 'require|dateFormat:Y-m-d|checkEndDate',
'annex' => 'checkAnnex',
'flow_id' => 'require|checkFlow',
'path' => 'require',
];
@ -67,7 +70,7 @@ class ProjectTripApplyValidate extends BaseValidate
*/
public function sceneAdd()
{
return $this->remove('id',true);
return $this->remove('id',true)->remove('flow_id',true)->remove('path',true);
}
@ -78,7 +81,9 @@ class ProjectTripApplyValidate extends BaseValidate
* @date 2024/01/17 09:22
*/
public function sceneEdit()
{}
{
return $this->remove('flow_id',true)->remove('path',true);
}
/**
@ -104,6 +109,20 @@ class ProjectTripApplyValidate extends BaseValidate
return $this->only(['id']);
}
public function sceneApprove()
{
return $this->only(['id','flow_id','path']);
}
public function checkData($value): bool|string
{
$data = ProjectTripApply::where('id',$value)->findOrEmpty();
if($data->isEmpty()){
return '数据不存在';
}
return true;
}
public function checkProject($value): bool|string
{
$data = Project::where('id',$value)->findOrEmpty();