Commit bf41f245 by liuyingkang

导入优化

parent f2a0519c
......@@ -32,23 +32,23 @@ protected function grid()
{
return Grid::make(ModelsCovenant::with(['lawyer']), function (Grid $grid) {
//工具栏
$grid->tools(function (Grid\Tools $tools) {
$tools->append(Modal::make()
// 大号弹窗
->lg()
// 弹窗标题
->title('上传文件')
// 按钮
->button('<button class="btn btn-primary"><i class="feather icon-upload"></i> 导入数据</button>')
// 弹窗内容
->body(ImportExcel::make()->payload(['className' => ModelsCovenant::class])));
// 下载导入模板
$tools->append(DownloadTemplateExcel::make()->setKey('ModelsCovenant'));
});
$grid->model()->orderBy('id', 'DESC');
// //工具栏【有用再打开】
// $grid->tools(function (Grid\Tools $tools) {
// $tools->append(Modal::make()
// // 大号弹窗
// ->lg()
// // 弹窗标题
// ->title('上传文件')
// // 按钮
// ->button('<button class="btn btn-primary"><i class="feather icon-upload"></i> 导入数据</button>')
// // 弹窗内容
// ->body(ImportExcel::make()->payload(['className' => ModelsCovenant::class])));
// // 下载导入模板
// $tools->append(DownloadTemplateExcel::make()->setKey('ModelsCovenant'));
// });
$grid->model()->orderBy('sign_at', 'DESC');
//$grid->column('id')->sortable();
$grid->column('number');
$grid->column('cname')->width(200);
......
......@@ -92,7 +92,7 @@ public static function CreateImportData($item): array
$principal_id= Principal::getIdByName($principal);
// 合同类型,默认其他
$ctype = array_search($result[7], self::CTYPE) ?: 8;
$ctype = array_search($result[2], self::CTYPE) ?: 8;
$number= $result[3];
$case_reason= $result[4];
......
......@@ -248,6 +248,7 @@ public static function getIdByName($title = '')
}else{
$id = self::insertGetId([
'name' => $title,
'wtype' => 2,
'number' => mt_rand(10000, 99999),
'created_at' => date('Y-m-d H:i:s'),
'updated_at' => date('Y-m-d H:i:s'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment