*/ namespace app\admin\page; use app\common\BasePage; use sdModule\layui\TablePage; use sdModule\layui\tablePage\TableAux; use sdModule\layuiSearch\Form; use sdModule\layui\defaultForm\FormData; use app\admin\model\Member; use app\admin\model\Bidding; use sdModule\layuiSearch\SearchForm; use sdModule\layuiSearch\generate\TimeRange; /** * Class Tender * @package app\admin\page */ class Tender extends BasePage { /** * 获取创建列表table的数据 * @return TablePage */ public function getTablePageData(): TablePage { $table = TablePage::create([ TablePage::column(['type' => 'checkbox']), TableAux::column('id', 'ID','',['width'=>80]), TableAux::column('member_username', '投标人'), TableAux::column('company', '投标公司'), TableAux::column('bidding_title', '标书'), TableAux::column('file_id', '投标文件'), TableAux::column('tender_price', '投标价格'), TableAux::column('create_time', '投标时间'), ]); $table->removeBarEvent('create'); $table->removeEvent('update'); $table->setHandleWidth(150); return $table; } /** * 生成表单的数据 * @return array */ public function formData(): array { return [ FormData::hidden('id'), FormData::select('member_id', '投标人', Member::addSoftDelWhere()->column('username', 'id')), FormData::select('bidding_id', '标书', Bidding::addSoftDelWhere()->column('title', 'id')), FormData::text('tender_price', '投标价格'), FormData::upload('file_id', '投标文件','excel*image*word'), ]; } /** * 列表页面的名字 * @return string */ public function listPageName(): string { return "投标列表"; } /** * 创建搜索表单的数据 * @return string */ public function searchFormData():string { $form_data = [ SearchForm::Text('member.username%%', "会员昵称")->label(true)->html(), SearchForm::Text('bidding.title%%', "标书标题")->label(true)->html(), SearchForm::TimeRange("i.create_time_~", "投标时间")->label(true)->html(TimeRange::TYPE_DATETIME), ]; return Form::CreateHTML($form_data); } /** * @return array 设置快捷搜索 */ public function setQuickSearchField():array { return [ ]; } }