From 4fcaf1c9aeb80d9d27cae0224ad28c5129ffb401 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E6=9D=BE=E6=A0=91?= Date: Wed, 27 Feb 2019 12:02:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8D=A3=E8=AA=89=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=B7=AF=E7=94=B1=E3=80=81=E7=BC=96=E5=86=99=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=AF=BE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/keti/controller/Index.php | 14 +- application/keti/view/index/index.html | 6 +- application/keti/view/keti_info/create.html | 15 ++ application/keti/view/keti_info/read.html | 230 ++++++++++++++++++ application/rongyu/controller/JsRongyu.php | 20 +- .../rongyu/controller/JsRongyuInfo.php | 14 +- application/rongyu/validate/JsRongyuInfo.php | 3 +- application/rongyu/view/js_rongyu/index.html | 4 +- .../rongyu/view/js_rongyu_info/createall.html | 5 +- .../rongyu/view/js_rongyu_info/index.html | 2 +- .../rongyu/view/js_rongyu_info/read.html | 95 +------- route/keti.php | 7 +- route/rongyu.php | 4 +- 13 files changed, 294 insertions(+), 125 deletions(-) create mode 100644 application/keti/view/keti_info/read.html diff --git a/application/keti/controller/Index.php b/application/keti/controller/Index.php index bec0d710..c78c3569 100644 --- a/application/keti/controller/Index.php +++ b/application/keti/controller/Index.php @@ -147,7 +147,19 @@ class Index extends Base */ public function read($id) { - // + + // 获取变量 + $list['id'] = $id; + // 设置页面标题 + $list['title'] = '课题信息'; + // 设置数据总数 + $ktinfo = new \app\keti\model\KetiInfo; + $list['count'] = $ktinfo->where('ketice',$id)->count(); + + // 模板赋值 + $this->assign('list',$list); + + return $this->fetch('keti_info/read'); } /** diff --git a/application/keti/view/index/index.html b/application/keti/view/index/index.html index 80c73d96..0f1b06ce 100644 --- a/application/keti/view/index/index.html +++ b/application/keti/view/index/index.html @@ -143,7 +143,7 @@ { "targets": 1, "render": function(data, type, row, meta) { - return ''+row.title+'册' + return ''+row.title+'' } }, { @@ -156,9 +156,9 @@ startbut = ''; // 上图图片按钮 - picbut = ''; + picbut = ''; // 添加荣誉 - addbut = ''; + addbut = ''; // 编辑按钮 editbut = ''; delbut = ''; diff --git a/application/keti/view/keti_info/create.html b/application/keti/view/keti_info/create.html index e688aa82..7e0890b1 100644 --- a/application/keti/view/keti_info/create.html +++ b/application/keti/view/keti_info/create.html @@ -2,7 +2,22 @@ {block name="mycss"} {/block} {block name="formaa"} +
+
+ +
+
+
+
选择文件
+ +
+
+
+
+ + +
diff --git a/application/keti/view/keti_info/read.html b/application/keti/view/keti_info/read.html new file mode 100644 index 00000000..e36101a1 --- /dev/null +++ b/application/keti/view/keti_info/read.html @@ -0,0 +1,230 @@ +{extend name="common@list" /} +{block name="topnav"} + +{/block} +{block name="bouttons"} +
+ + + + + 批量删除 + + + + + 共有数据:{$list.count} 条 + +
+
+
筛选课题册信息
+
+
+ {php} + $school = schlist('区级','部级'); + {/php} + +
+
+ {foreach $school as $key=>$vo } + + {/foreach} +
+ +
+
+ {php}$category = getCategory(115);{/php} + +
+
+ {foreach $category as $key=>$vo } + + {/foreach} +
+ +
+
+ {php} + $school = schlist('校级','区级'); + {/php} + +
+
+ {foreach $school as $key=>$vo } + + {/foreach} +
+ +
+
+
+{/block} +{block name="tables"} + + + + + + + + + + + + + + + + + + +
主持人课题名称立项单位课题类型研究方向学科结题数量立项时间状态操作
+ + +{/block} +{block name="myjs"} + +{/block} \ No newline at end of file diff --git a/application/rongyu/controller/JsRongyu.php b/application/rongyu/controller/JsRongyu.php index 186b9e24..f0ff2315 100644 --- a/application/rongyu/controller/JsRongyu.php +++ b/application/rongyu/controller/JsRongyu.php @@ -142,19 +142,19 @@ class JsRongyu extends Base * @param \think\Request $request * @return \think\Response */ - public function createall($id) - { - // 设置页面标题 - $list['title'] = '添加教师荣誉册'; - $list['id'] = $id; + // public function createall($id) + // { + // // 设置页面标题 + // $list['title'] = '添加教师荣誉册'; + // $list['id'] = $id; - // 模板赋值 - $this->assign('list',$list); + // // 模板赋值 + // $this->assign('list',$list); - // 渲染 - return $this->fetch(); + // // 渲染 + // return $this->fetch(); - } + // } diff --git a/application/rongyu/controller/JsRongyuInfo.php b/application/rongyu/controller/JsRongyuInfo.php index 0287e0a7..da919108 100644 --- a/application/rongyu/controller/JsRongyuInfo.php +++ b/application/rongyu/controller/JsRongyuInfo.php @@ -123,11 +123,14 @@ class JsRongyuInfo extends Base // 实例化验证类 $validate = new \app\rongyu\validate\JsRongyuInfo; // 验证表单数据 - $result = $validate->scene('save')->check($list); + $result = $validate->scene('add')->check($list); $msg = $validate->getError(); // 如果验证不通过则停止保存 if(!$result){ + if($list['id']>0){ + ryinfo::destroy($list['id'],true); + } return json(['msg'=>$msg,'val'=>0]); } @@ -175,7 +178,7 @@ class JsRongyuInfo extends Base { // 设置页面标题 $list['title'] = '添加教师荣誉册'; - $list['id'] = $id; + $list['rongyuce'] = $id; // 模板赋值 $this->assign('list',$list); @@ -281,21 +284,18 @@ class JsRongyuInfo extends Base public function update($id) { // 获取表单数据 - $list = request()->only(['rongyuce','bianhao','title','category','hjschool','subject','hjshijian','jiangxiang','hjteachers','cyteachers','pic'],'put'); + $list = request()->only(['bianhao','title','category','hjschool','subject','hjshijian','jiangxiang','hjteachers','cyteachers','pic'],'put'); $list['id'] = $id; // 实例化验证类 $validate = new \app\rongyu\validate\JsRongyuInfo; // 验证表单数据 - $result = $validate->check($list); + $result = $validate->scene('edit')->check($list); $msg = $validate->getError(); // 如果验证不通过则停止保存 if(!$result){ - if($list['id']>0){ - ryinfo::destroy($list['id'],true); - } return json(['msg'=>$msg,'val'=>0]); } diff --git a/application/rongyu/validate/JsRongyuInfo.php b/application/rongyu/validate/JsRongyuInfo.php index 6468bb84..06d0a9b5 100644 --- a/application/rongyu/validate/JsRongyuInfo.php +++ b/application/rongyu/validate/JsRongyuInfo.php @@ -34,6 +34,7 @@ class JsRongyuInfo extends Validate // 验证场景 protected $scene = [ - 'save' => ['rongyuce','title','hjteachers','hjschool','subject','hjshijian','jiangxiang','cyteachers'], + 'add' => ['rongyuce','title','hjteachers','hjschool','subject','hjshijian','jiangxiang','cyteachers'], + 'edit' => ['id','title','hjteachers','hjschool','subject','hjshijian','jiangxiang','cyteachers'], ]; } diff --git a/application/rongyu/view/js_rongyu/index.html b/application/rongyu/view/js_rongyu/index.html index 8c1283c1..0ad01749 100644 --- a/application/rongyu/view/js_rongyu/index.html +++ b/application/rongyu/view/js_rongyu/index.html @@ -154,9 +154,9 @@ startbut = ''; // 上图图片按钮 - picbut = ''; + picbut = ''; // 添加荣誉 - addbut = ''; + addbut = ''; // 编辑按钮 editbut = ''; delbut = ''; diff --git a/application/rongyu/view/js_rongyu_info/createall.html b/application/rongyu/view/js_rongyu_info/createall.html index 1dda5c2f..3c714976 100644 --- a/application/rongyu/view/js_rongyu_info/createall.html +++ b/application/rongyu/view/js_rongyu_info/createall.html @@ -24,7 +24,6 @@
- {/block} {block name="yanzheng"} {js href="/static/H-ui.admin_v3.1.3.1/H-ui.admin/lib/webuploader/0.1.5/webuploader.js"} @@ -182,7 +181,7 @@ function article_save(){ label: '点击选择图片' }, formData: { - uid: $('#id').val(), + rongyuce: "{$list.rongyuce}", }, dnd: '#dndArea', paste: '#uploader', @@ -192,7 +191,7 @@ function article_save(){ compress:false, //是否压缩图片 server: '{:url("upload")}', formData:{ - rongyuce:"{$list.id}" + rongyuce:"{$list.rongyuce}" }, // runtimeOrder: 'flash', diff --git a/application/rongyu/view/js_rongyu_info/index.html b/application/rongyu/view/js_rongyu_info/index.html index 6b087463..42499b74 100644 --- a/application/rongyu/view/js_rongyu_info/index.html +++ b/application/rongyu/view/js_rongyu_info/index.html @@ -149,7 +149,7 @@ // 定义列参数 var mycolumns = [ { "data": "id" }, - { "data": "hjJsName" ,"name":"teacherid","defaultContent": ""}, + { "data": "hjJsName" ,"name":"id","defaultContent": ""}, { "data": "hj_school.jiancheng" ,"name":"hjschool","defaultContent": ""}, { "data": "title","defaultContent": "" }, { "data": "ry_tuce.title" ,"name":"rongyuce","defaultContent": ""}, diff --git a/application/rongyu/view/js_rongyu_info/read.html b/application/rongyu/view/js_rongyu_info/read.html index e0c0455e..5dfa1916 100644 --- a/application/rongyu/view/js_rongyu_info/read.html +++ b/application/rongyu/view/js_rongyu_info/read.html @@ -30,57 +30,6 @@ 共有数据:{$list.count} 条 -
-
筛选荣誉册
-
-
- {php} - $school = schlist('校级','区级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php} - $school = schlist('区级','部级'); - {/php} - -
-
- {foreach $school as $key=>$vo } - - {/foreach} -
- -
-
- {php}$category = getCategory(114);{/php} - -
-
- {foreach $category as $key=>$vo } - - {/foreach} -
- -
-
-
{/block} {block name="tables"} @@ -112,36 +61,9 @@ url: "{:url('JsRongyuInfo/ajaxdata')}", type: "post", data: { - hjschool:function(){ - var chk = []; - $('input[name="hjschool"]:checked').each(function(){ - if(typeof($(this).val()) != "undefined") - { - chk.push($(this).val()); - } - }); - return chk; - }, - fzschool:function(){ - var chk = []; - $('input[name="fzschool"]:checked').each(function(){ - if(typeof($(this).val()) != "undefined") - { - chk.push($(this).val()); - } - }); - return chk; - }, - category:function(){ - var chk = []; - $('input[name="category"]:checked').each(function(){ - if(typeof($(this).val()) != "undefined") - { - chk.push($(this).val()); - } - }); - return chk; - }, + hjschool:'', + fzschool:'', + category:'', rongyuce:"{$list.id}", }, }; @@ -149,7 +71,7 @@ // 定义列参数 var mycolumns = [ { "data": "id" }, - { "data": "hjJsName" ,"name":"teacherid","defaultContent": ""}, + { "data": "hjJsName" ,"name":"id","defaultContent": ""}, { "data": "hj_school.jiancheng" ,"name":"hjschool","defaultContent": ""}, { "data": "title","defaultContent": "" }, { "data": "ry_tuce.title" ,"name":"rongyuce","defaultContent": ""}, @@ -210,15 +132,6 @@ }, ]; - // 筛选成绩面板折叠 - $('#shaixuan').click(function(){ - $(this).next().toggle(); - }); - // 重载数据 - function dtreload() - { - $('#table1').DataTable().ajax.reload(); - } {/block} \ No newline at end of file diff --git a/route/keti.php b/route/keti.php index fd05c75b..fae34b42 100644 --- a/route/keti.php +++ b/route/keti.php @@ -12,12 +12,11 @@ //系统设置路由 Route::resource('kt','keti/Index'); Route::resource('ktinfo','keti/KetiInfo'); -// 课题册中的课题信息 -Route::get('ktinfo/:id/ketice','keti/KetiInfo/ketiCe'); + // 添加立项信息 -Route::get('ktinfo/:id/create','keti/KetiInfo/create'); +Route::get('ktinfoadd/:id/create','keti/KetiInfo/create'); // 批量添加立项图片 -Route::get('ktinfoall/:id/createall','keti/KetiInfo/createall'); +Route::get('ktinfoadd/:id/createall','keti/KetiInfo/createall'); diff --git a/route/rongyu.php b/route/rongyu.php index 53021124..21ce20b6 100644 --- a/route/rongyu.php +++ b/route/rongyu.php @@ -15,5 +15,5 @@ Route::resource('jsry','rongyu/JsRongyu'); Route::resource('jsryinfo','rongyu/JsRongyuInfo'); Route::get('dwry/createall','rongyu/DwRongyu/createall'); // Route::get('jsry/:id/createall','rongyu/JsRongyu/createall'); -Route::get('jsryinfoadd/:id/create','rongyu/JsRongyuInfo/create'); -Route::get('jsryinfoadd/:id/createall','rongyu/JsRongyuInfo/createall'); \ No newline at end of file +Route::get('jsryinfoadd/:id','rongyu/JsRongyuInfo/create'); +Route::get('jsryinfoaddall/:id','rongyu/JsRongyuInfo/createall'); \ No newline at end of file