Commit bf41f245 by liuyingkang

导入优化

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