This commit is contained in:
weiz 2024-01-21 15:09:46 +08:00
parent faa0f56b27
commit af03d4c3db
4 changed files with 2 additions and 44 deletions

View File

@ -22,7 +22,6 @@ use app\common\model\bid\BidBuyBiddingDocument;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\custom\Custom; use app\common\model\custom\Custom;
use app\common\model\project\Project; use app\common\model\project\Project;
use think\facade\Db;
/** /**
@ -75,7 +74,7 @@ class BidBuyBiddingDocumentLists extends BaseAdminDataLists implements ListsSear
$project_ids = Project::where('custom_id',$params['custom_id'])->column('id'); $project_ids = Project::where('custom_id',$params['custom_id'])->column('id');
$where[] = ['project_id','in',$project_ids]; $where[] = ['project_id','in',$project_ids];
} }
return BidBuyBiddingDocument::field('id,org_id,dept_id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address') return BidBuyBiddingDocument::field('id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')
->where($this->searchWhere)->where($where) ->where($this->searchWhere)->where($where)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])

View File

@ -20,8 +20,6 @@ use app\common\model\bid\BidBiddingDecision;
use app\common\model\bid\BidBuyBiddingDocument; use app\common\model\bid\BidBuyBiddingDocument;
use app\common\model\custom\Custom; use app\common\model\custom\Custom;
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\project\Project; use app\common\model\project\Project;
use think\facade\Db; use think\facade\Db;
@ -47,8 +45,6 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
BidBuyBiddingDocument::create([ BidBuyBiddingDocument::create([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'code' => data_unique_code('购买标书'), 'code' => data_unique_code('购买标书'),
'project_id' => $params['project_id'], 'project_id' => $params['project_id'],
'bid_decision_id' => $params['bid_decision_id'], 'bid_decision_id' => $params['bid_decision_id'],
@ -82,8 +78,6 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
Db::startTrans(); Db::startTrans();
try { try {
BidBuyBiddingDocument::where('id', $params['id'])->update([ BidBuyBiddingDocument::where('id', $params['id'])->update([
'org_id' => $params['org_id'],
'dept_id' => $params['dept_id'],
'project_id' => $params['project_id'], 'project_id' => $params['project_id'],
'bid_decision_id' => $params['bid_decision_id'], 'bid_decision_id' => $params['bid_decision_id'],
'bid_document_no' => $params['bid_document_no'], 'bid_document_no' => $params['bid_document_no'],
@ -127,15 +121,11 @@ class BidBuyBiddingDocumentLogic extends BaseLogic
*/ */
public static function detail($params): array public static function detail($params): array
{ {
$data = BidBuyBiddingDocument::field('id,org_id,dept_id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')->findOrEmpty($params['id']); $data = BidBuyBiddingDocument::field('id,project_id,bid_decision_id,code,bid_document_no,invite_tenders_company_name,bid_company_name,buyer,amount,buy_date,bid_address')->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('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty(); $project = Project::field('custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty(); $custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
$bid_decision = BidBiddingDecision::field('code,bidding_project_fund_source,bidding_time,bid_type,is_margin,margin_amount,bid_opening_date,margin_amount_return_date,bid_project_overview,project_desc,annex')->where('id',$data['bid_decision_id'])->findOrEmpty(); $bid_decision = BidBiddingDecision::field('code,bidding_project_fund_source,bidding_time,bid_type,is_margin,margin_amount,bid_opening_date,margin_amount_return_date,bid_project_overview,project_desc,annex')->where('id',$data['bid_decision_id'])->findOrEmpty();
$admin = Admin::field('name')->where('id',$data['buyer'])->findOrEmpty(); $admin = Admin::field('name')->where('id',$data['buyer'])->findOrEmpty();
$data['org_name'] = $org['name'];
$data['dept_name'] = $dept['name'];
$data['project_name'] = $project['name']; $data['project_name'] = $project['name'];
$data['project_code'] = $project['project_code']; $data['project_code'] = $project['project_code'];
$data['custom_name'] = $custom['name']; $data['custom_name'] = $custom['name'];

View File

@ -14,9 +14,6 @@
namespace app\adminapi\validate\bid; namespace app\adminapi\validate\bid;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\dict\DictData; use app\common\model\dict\DictData;
use app\common\model\project\Project; use app\common\model\project\Project;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;

View File

@ -17,9 +17,6 @@ namespace app\adminapi\validate\bid;
use app\common\model\auth\Admin; use app\common\model\auth\Admin;
use app\common\model\bid\BidBiddingDecision; use app\common\model\bid\BidBiddingDecision;
use app\common\model\dept\Dept;
use app\common\model\dept\Orgs;
use app\common\model\dict\DictData;
use app\common\model\project\Project; use app\common\model\project\Project;
use app\common\validate\BaseValidate; use app\common\validate\BaseValidate;
@ -38,8 +35,6 @@ class BidBuyBiddingDocumentValidate extends BaseValidate
*/ */
protected $rule = [ protected $rule = [
'id' => 'require', 'id' => 'require',
'org_id' => 'require|checkOrg',
'dept_id' => 'require|checkDept',
'project_id' => 'require|checkProject', 'project_id' => 'require|checkProject',
'bid_decision_id' => 'require|checkBidDecision', 'bid_decision_id' => 'require|checkBidDecision',
'bid_document_no' => 'require', 'bid_document_no' => 'require',
@ -53,8 +48,6 @@ class BidBuyBiddingDocumentValidate extends BaseValidate
protected $message = [ protected $message = [
'id.require' => '缺少必要参数', 'id.require' => '缺少必要参数',
'org_id.require' => '请选择组织',
'dept_id.require' => '请选择部门',
'project_id.require' => '请选择项目', 'project_id.require' => '请选择项目',
'bid_decision_id.require' => '请选择投标决策', 'bid_decision_id.require' => '请选择投标决策',
'bid_document_no.require' => '请填写标书编号', 'bid_document_no.require' => '请填写标书编号',
@ -111,27 +104,6 @@ class BidBuyBiddingDocumentValidate extends BaseValidate
return $this->only(['id']); return $this->only(['id']);
} }
public function checkOrg($value): bool|string
{
$org = Orgs::where('id',$value)->findOrEmpty();
if($org->isEmpty()){
return '组织不存在';
}
return true;
}
public function checkDept($value,$rule,$data): bool|string
{
$dept = Dept::where('id',$value)->findOrEmpty();
if($dept->isEmpty()){
return '部门不存在';
}
if($dept['org_id'] != $data['org_id']){
return '部门无效';
}
return true;
}
public function checkProject($value): bool|string public function checkProject($value): bool|string
{ {
$project = Project::where('id',$value)->findOrEmpty(); $project = Project::where('id',$value)->findOrEmpty();