From f7296408c7fcb1e5b774b6ae8f74f76ee0c2db96 Mon Sep 17 00:00:00 2001 From: chenzhi Date: Thu, 26 Aug 2021 11:54:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=96=E8=BE=91=E5=8E=9F?= =?UTF-8?q?=E5=90=8D=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StatementWarningController.class.php | 41 +++++++++++++------ .../Admin/View/StatementWarning/edit.html | 9 ++-- .../Admin/View/StatementWarning/lists.html | 7 ++-- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/Application/Admin/Controller/StatementWarningController.class.php b/Application/Admin/Controller/StatementWarningController.class.php index b4a325d5e..7c3b24180 100644 --- a/Application/Admin/Controller/StatementWarningController.class.php +++ b/Application/Admin/Controller/StatementWarningController.class.php @@ -134,13 +134,19 @@ class StatementWarningController extends AdminController } unset($data[$type]['list'][$name]); if(isset($this->statementWarningKey[$name])){ + if( in_array($name,['margin_ratio','profit_ratio']) ){ + $data[$type]['list'][$name]['is_edit'] = 0; + }else{ + $data[$type]['list'][$name]['is_edit'] = 1; + } $data[$type]['list'][$name]['name'] = $this->statementWarningKey[$name]; $data[$type]['list'][$name]['list'] = $value; - $data[$type]['list'][$name]['is_edit'] = 0; + $data[$type]['list'][$name]['is_del'] = 0; }else{ $data[$type]['list'][$name]['name'] = $name; $data[$type]['list'][$name]['list'] = $value; $data[$type]['list'][$name]['is_edit'] = 1; + $data[$type]['list'][$name]['is_del'] = 1; } } } @@ -168,6 +174,7 @@ class StatementWarningController extends AdminController if($act == 'add'){ $isEdit = 0; $this->assign('is_edit', 0); + $this->assign('chenge_name', 1); }else{ $this->assign('is_edit', 1); } @@ -222,22 +229,32 @@ class StatementWarningController extends AdminController } private function resetWarningData() { + //获取真实名称 + $name = $_REQUEST['name']; + $sendData = [ + 'value'=>[0,0,0,0,0,0,0,0,0,0,0,0], + 'ids'=>[0,0,0,0,0,0,0,0,0,0,0,0], + 'chenge_name'=>1, + 'count_year'=>$_REQUEST['count_year'] + ]; + $key = array_flip($this->statementWarningKey); + if(isset($key[$_REQUEST['name']])){ + $sendData['chenge_name'] = 0; + $sendData['orgin_name'] = $key[$_REQUEST['name']]; + $sendData['name'] = $name; + $name = $key[$_REQUEST['name']]; + }else{ + $sendData['orgin_name'] = $name; + $sendData['name'] = $name; + } $where = [ - 'name'=>$_REQUEST['name'], + 'name'=>$name, 'count_year'=>$_REQUEST['count_year'] ]; $data = $this->statementWarningModel->where($where)->select(); - - $sendData = [ - 'count_year'=>$data[0]['count_year'], - 'type'=>$data[0]['type'], - 'name'=>$data[0]['name'], - 'value'=>[0,0,0,0,0,0,0,0,0,0,0,0], - 'ids'=>[0,0,0,0,0,0,0,0,0,0,0,0] - ]; - + $sendData['type'] = $data[0]['type']; foreach ($data as $key => $value) { - $sendData['value'][$value['count_month']-1] = $value['money']/10000; + $sendData['value'][$value['count_month']-1] = round($value['money']/10000,2); $sendData['ids'][$value['count_month']-1] = $value['id']; } $this->assign('data', $sendData); diff --git a/Application/Admin/View/StatementWarning/edit.html b/Application/Admin/View/StatementWarning/edit.html index e18a5ae2b..7ecd4fa5f 100644 --- a/Application/Admin/View/StatementWarning/edit.html +++ b/Application/Admin/View/StatementWarning/edit.html @@ -104,11 +104,10 @@ + + + - - - - *年度: @@ -138,7 +137,7 @@ *类型名称:
- disabled> + disabled>
diff --git a/Application/Admin/View/StatementWarning/lists.html b/Application/Admin/View/StatementWarning/lists.html index 8c08b052e..05f8bbb8f 100644 --- a/Application/Admin/View/StatementWarning/lists.html +++ b/Application/Admin/View/StatementWarning/lists.html @@ -124,10 +124,9 @@ 编辑 - - 删除 - - + + + 删除