招标
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

166 lines
7.0 KiB

<?php
/**
* Bidding.php
* Date: 2020-12-21 14:07:08
* User: chenlong <vip_chenlong@163.com>
*/
namespace app\admin\page;
use app\common\BasePage;
use sdModule\layui\Layui;
use sdModule\layui\TablePage;
use sdModule\layui\tablePage\TableAux;
use sdModule\layuiSearch\Form;
use sdModule\layui\defaultForm\FormData;
use app\admin\model\Bidding as MyModel;
use sdModule\layuiSearch\SearchForm;
use sdModule\layuiSearch\generate\TimeRange;
/**
* Class Bidding
* @package app\admin\page
*/
class Bidding extends BasePage
{
/**
* 获取创建列表table的数据
* @return TablePage
*/
public function getTablePageData(): TablePage
{
$table = TablePage::create([
TablePage::column(['type' => 'checkbox']),
TableAux::column('id', 'ID','',['width'=>80,'hide'=>true]),
TableAux::column('sort', '排序','',['width'=>80,'hide'=>true]),
TableAux::column('title', '标题'),
TableAux::column('contract_title', '合同名称','',['hide'=>true]),
TableAux::column('contractNo', '合同编号','',['hide'=>true]),
TableAux::column('province', '省份','',['hide'=>true]),
TableAux::column('city', '城市','',['hide'=>true]),
TableAux::column('project_title', '项目名称'),
TableAux::column('projectNo', '项目编号','',['hide'=>true]),
TableAux::column('purchase_unit', '采购单位'),
TableAux::column('contact_person', '联系人','',['width'=>100]),
TableAux::column('contact_person_tel', '联系人电话','',['width'=>120]),
TableAux::column('status', '状态','',['width'=>80]),
TableAux::column('is_urgent', '是否紧急','',['width'=>100]),
TableAux::column('open_bid_time', '开标时间'),
TableAux::column('create_time', '创建时间'),
]);
//中标详情
$table->addEvent('details')->setEventWhere('details','d.status_1==1');
$table->setEventHtml('details',Layui::button('中标详情','ii')->setEvent('details')->primary('xs'));
$table->setEventJs('details',TableAux::openPage([url('details')], '中标详情'));
//投标列表
$table->addEvent('tenderList')->setEventWhere('tenderList','d.status_1==1');
$table->setEventHtml('tenderList',Layui::button('投标列表','ii')->setEvent('tenderList')->primary('xs'));
$table->setEventJs('tenderList',TableAux::openPage([url('bidding/tenderList')], '投标列表'));
//操作
$table->setHandleWidth(400);
return $table;
}
/**
* @return TablePage
* @throws \app\common\SdException
* @author Deng
* @date 2020-12-23 14:34
* 投标列表
*/
public function getTenderList(): TablePage
{
$table = TablePage::create([
// TableAux::column('id', 'ID','',['width'=>60]),company
TableAux::column('username', '投标人','',['width'=>100]),
TableAux::column('company', '投标公司','',['width'=>100]),
TableAux::column('title', '标题','',['width'=>150]),
// TableAux::column('contract_title', '合同名称'),
TableAux::column('tender_price', '投标价格','',['width'=>100]),
TableAux::column('file_id', '标书文件'),
TableAux::column('ip', 'IP','',['width'=>150]),
TableAux::column('ip_address', 'IP地址','',['width'=>150]),
TableAux::column('status', '投标状态','',['width'=>100]),
TableAux::column('create_time', '投标时间','',['width'=>160]),
]);
//中标详情
$table->addEvent('winningBiding');
$table->setEventHtml('winningBiding',Layui::button('中标','ii')->setEvent('winningBiding')->defaults('xs'));
$table->setEventJs('winningBiding',TableAux::ajax(url('winningBiding'), 'get','是否确定该投标中标?'));
//操作
$table->removeEvent(['update','delete']);
$table->removeBarEvent(['create','delete']);
$table->setHandleWidth(100);
$table->setConfig(['url'=>url('bidding/tenderData')->build(),'where'=>['id'=>request()->get('id')]]);
return $table;
}
/**
* 生成表单的数据
* @return array
*/
public function formData(): array
{
return [
FormData::hidden('id'),
FormData::text('sort', '排序','请输入排序数字,越大越靠前'),
FormData::text('title', '标题','请输入标题'),
FormData::textarea('desc', '简介','请输入简介'),
FormData::text('province', '省份','请输入省份'),
FormData::text('city', '城市','请输入城市'),
FormData::text('bidding_person', '招标人','请输入招标人'),
FormData::text('contract_title', '合同名称','请输入合同名称'),
FormData::text('contractNo', '合同编号','请输入合同编号'),
FormData::text('project_title', '项目名称','请输入项目名称'),
FormData::text('project_address', '项目所在地','请输入项目所在地'),
FormData::text('projectNo', '项目编号','请输入项目编号'),
FormData::text('purchase_unit', '采购单位','请输入采购单位'),
FormData::text('contact_person', '联系人','请输入联系人'),
FormData::text('contact_person_tel', '联系人电话','请输入联系人电话'),
FormData::time('open_bid_time', '开标时间', 'datetime'),
FormData::upload('file', '标书文件','excel*word*pdf*image'),
FormData::radio('status', '状态', MyModel::getStatusSc(false))->preset(0),
FormData::radio('is_urgent', '是否紧急', MyModel::getIsUrgentSc(false))->preset(0),
FormData::radio('tag_ids', '类型',\app\common\model\Tag::where('delete_time',0)->column('title','id'))->preset(1),
FormData::u_editor('content', '标书内容'),
];
}
/**
* 列表页面的名字
* @return string
*/
public function listPageName(): string
{
return "标书列表";
}
/**
* 创建搜索表单的数据
* @return string
*/
public function searchFormData():string
{
$form_data = [
SearchForm::Text('i.title%%', "标题")->label(true)->html(),
SearchForm::Text('i.project_title%%', "项目名称")->label(true)->html(),
SearchForm::Select('i.status', "状态")->label(true)->html(MyModel::getStatusSc(false)),
SearchForm::Text('i.contact_person%%', "联系人")->label(true)->html(),
SearchForm::Select('i.is_urgent', "是否紧急")->label(true)->html(MyModel::getIsUrgentSc(false)),
SearchForm::TimeRange("i.create_time_~", "创建时间")->label(true)->html(TimeRange::TYPE_DATETIME),
];
return Form::CreateHTML($form_data);
}
/**
* @return array 设置快捷搜索
*/
public function setQuickSearchField():array
{
return [
];
}
}