소스 검색

holiday bug调整

likeku 8 년 전
부모
커밋
7cbb8f8ca7
4개의 변경된 파일35개의 추가작업 그리고 37개의 파일을 삭제
  1. 7 26
      global/css/global.css
  2. 24 7
      protected/controller/HolidayController.php
  3. 3 3
      protected/view/holiday-borad.html
  4. 1 1
      protected/view/holiday-vacation.html

+ 7 - 26
global/css/global.css

@@ -1923,7 +1923,7 @@ a.new-ribbon:before{
   min-height:400px
 }
 .saeaList .seTable{
-  margin:0 25% 0 0;
+  margin:0 0 0 25.1%;
 }
 .saeaList .seTable .sFile{
   margin: 0 5px 5px 0;
@@ -2033,7 +2033,7 @@ table .taC{
 }
 .saeaList .seCensor {
   position: absolute;
-  right:0;
+  right:left;
   top:0;
   width:25%;
   height:100%;
@@ -2269,9 +2269,7 @@ table .taC{
 }
 .seCensor .reportButton {
   width:100%;
-  position: absolute;
-  bottom: 0;
-  right:0;
+  margin:2px 0;
 }
 .seCensor .reportButton button{
   border:none;
@@ -2286,6 +2284,8 @@ table .taC{
 }
 .reportButton a.buttonDone,.reportButton button.buttonDone{
   background:#7ea85c;
+  font-size: 16px;
+  margin-bottom: 2px
 }
 .reportButton a.buttonDone:hover,.reportButton button.buttonDone:hover{
   background:#4f8e08
@@ -2295,6 +2295,7 @@ table .taC{
 }
 .reportButton a.buttonUndone{
   background:#ce5e5e;
+  padding: 3px 0
 }
 .reportButton a.buttonUndone:hover{
   background:#c01010;
@@ -2304,6 +2305,7 @@ table .taC{
 }
 .reportButton a.buttonBack{
   background:#ffa132;
+  padding: 3px 0
 }
 .reportButton a.buttonBack:hover{
   background:#ff8a00;
@@ -3730,24 +3732,3 @@ td div.dlLev3{
 .invoButton a.buttonUndone:active{
   background:#790000;
 }
-
-nav a{
-  padding: 5px 10px;
-  font-size: 12px;
-  line-height: 1.5px;
-  text-decoration:none;
-  color: #8E0950;
-  background-color: #ffffff;
-  border: 1px solid #dddddd;
-  margin-left: -1px;
-}
-nav a.current {
-  background: #8E0950;
-  color: #fff;
-  cursor: default;
-}
-
-nav a:hover{
-  border-color:#8E0950;
-  z-index: 1
-}

+ 24 - 7
protected/controller/HolidayController.php

@@ -142,7 +142,7 @@ class HolidayController extends DooController {
 
 		$data['holidaycount'] = $holidaycount;
 
-		$holidaymsg = $holiday->find(array('where' => 'uid='.$this->staff[0]['sid'], 'limit' => 3, 'desc' => 'id', 'asArray' => TRUE));
+		$holidaymsg = $holiday->find(array('where' => 'uid='.$this->staff[0]['sid'], 'limit' => 10, 'desc' => 'approvetime', 'desc' => 'id', 'asArray' => TRUE));
 		if(!empty($holidaymsg)){
 			foreach($holidaymsg as $k => $v){
 				$holidaymsg[$k]['typename'] = $type->getTypeNamebyid($v['type']);
@@ -174,7 +174,7 @@ class HolidayController extends DooController {
 					}
 				}elseif(in_array($v['type'],array(6,7,8,9))){
 					$msg .= $v['starttime']. ' 至 '.$v['endtime'];
-				}elseif(in_array($v['type'],array(13,14))){
+				}elseif(in_array($v['type'],array(13,14,15,16,17,18,19))){
 					$msg .= date('Y-m-d H:i:s',$v['addtime']);
 				}
 				$holidaymsg[$k]['daymsg'] = $msg;
@@ -201,8 +201,8 @@ class HolidayController extends DooController {
 		if(isset($this->params['type'])){
 			if($this->params['type'] == 4 ){//加班、值班
 				$sql = ' and (type=4 or type=5)';
-			}elseif($this->params['type'] == 6){//其他长假
-				$sql = ' and type in(3,6,7,8,9,13)';
+			}elseif($this->params['type'] == 6){//其他,管理员操作
+				$sql = ' and type in(3,6,7,8,9,13,14,15,16,17,18,19)';
 			}else{
 				$sql = ' and type='.$this->params['type'];
 			}
@@ -253,7 +253,7 @@ class HolidayController extends DooController {
 					}
 				}elseif(in_array($v['type'],array(6,7,8,9))){
 					$msg .= $v['starttime']. ' 至 '.$v['endtime'];
-				}elseif(in_array($v['type'],array(13,14))){
+				}elseif(in_array($v['type'],array(13,14,15,16,17,18,19))){
 					$msg .= date('Y-m-d H:i:s',$v['addtime']);
 				}
 				$holidaymsg[$k]['daymsg'] = $msg;
@@ -397,7 +397,7 @@ class HolidayController extends DooController {
 			foreach($cidstafflist as $ck => $cv) {
 				foreach (array(1, 2, 3, 14) as $tk => $tv) {
 					if($tv == 14){
-						$typeholiday = $holiday->getOne(array('where' => 'status=1 and type='.$tv.' and uid='.$cv['sid'].' and starttime="'.$thismonth['start'].'" and endtime="'.$thismonth['end'].'"', 'desc' => 'id', 'asArray' => TRUE));
+						$typeholiday = $holiday->getOne(array('where' => 'status=3 and type='.$tv.' and uid='.$cv['sid'].' and starttime="'.$thismonth['start'].'" and endtime="'.$thismonth['end'].'"', 'desc' => 'id', 'asArray' => TRUE));
 						$cidstafflist[$ck][$tv] = $typeholiday['daynum'] != 0 ? floatval($typeholiday['daynum']) : '';
 					}else{
 						$typeholiday = $hday->find(array('where' => 'type=' . $tv . ' and uid=' . $cv['sid'] . ' and UNIX_TIMESTAMP(daytime) between ' . $thismonth['start'] . ' and ' . $thismonth['end'], 'asArray' => TRUE));
@@ -656,7 +656,7 @@ class HolidayController extends DooController {
 						$holiday->daynum = $daynum;
 						$holiday->status = 3;
 						$holiday->addtime = time();
-						$holiday->approvetime = 1;
+						$holiday->approvetime = time();
 						$holiday->description = $_POST['description'];
 						$holiday->insert();
 
@@ -751,25 +751,42 @@ class HolidayController extends DooController {
 			$hstaff = new HStaff();
 			$hstaffmsg = $hstaff->getOne(array('where' => 'uid='.$_POST['uid'], 'asArray' => TRUE));
 			$hstaff->uid = $_POST['uid'];
+			$type = '';
 			switch($_POST['typeholiday']){
 				case 'yearnum':
 					$hstaff->yearnum = $hstaffmsg['yearnum']+$_POST['addnum'];
+					$type = 15;
 					break;
 				case 'hunjianum':
 					$hstaff->hunjianum = $hstaffmsg['hunjianum']+$_POST['addnum'];
+					$type = 16;
 					break;
 				case 'chanjianum':
 					$hstaff->chanjianum = $hstaffmsg['chanjianum']+$_POST['addnum'];
+					$type = 17;
 					break;
 				case 'sangjianum':
 					$hstaff->sangjianum = $hstaffmsg['sangjianum']+$_POST['addnum'];
+					$type = 18;
 					break;
 				case 'gongjianum':
 					$hstaff->gongjianum = $hstaffmsg['gongjianum']+$_POST['addnum'];
+					$type = 19;
 					break;
 			}
 			$hstaff->update();
 
+			Doo::loadModel('holiday');
+			$holiday = new Holiday();
+			$holiday->uid = $_POST['uid'];
+			$holiday->type = $type;
+			$holiday->daynum = $_POST['addnum'];
+			$holiday->status = 3;
+			$holiday->addtime = time();
+			$holiday->approvetime = time();
+			$holiday->description = $_POST['description'];
+			$holiday->insert();
+
 			return '/holidayvacation';
 		}else{
 			exit('增加出错');

+ 3 - 3
protected/view/holiday-borad.html

@@ -28,9 +28,9 @@
 								<table class="table table-bordered table-condensed">
 									<tbody>
 									<tr><th class="taC" colspan="6">{{countmonth}}</th></tr>
-									<tr><th class="taC" width="120">事假</th><td>{{holidaycount.0}}</td><th class="taC" width="120">加班</th><td>{{holidaycount.3}}</td><th class="taC" width="120">年假(可用)</th><td>{{holidaycount.5}}</td></tr>
-									<tr><th class="taC">病假</th><td>{{holidaycount.1}}</td><th class="taC">值班</th><td>{{holidaycount.4}}</td><th class="taC">存假(可用)</th><td>{{holidaycount.6}}</td></tr>
-									<tr><th class="taC">旷工</th><td>{{holidaycount.2}}</td><th class="taC"> </th><td> </td><th class="taC"> </th><td> </td></tr>
+									<tr><th class="taC" width="120">事假</th><td>{{holidaycount.0}}</td><th class="taC" width="120">加班</th><td>{{holidaycount.3}}</td><th class="taC" width="120">年假(可用)</th><td>{{holidaycount.5}}</td></tr>
+									<tr><th class="taC">病假</th><td>{{holidaycount.1}}</td><th class="taC">值班</th><td>{{holidaycount.4}}</td><th class="taC">存假(可用)</th><td>{{holidaycount.6}}</td></tr>
+									<tr><th class="taC">旷工</th><td>{{holidaycount.2}}</td><th class="taC"> </th><td> </td><th class="taC"> </th><td> </td></tr>
 									</tbody>
 								</table>
 							</div>

+ 1 - 1
protected/view/holiday-vacation.html

@@ -116,7 +116,7 @@
 						<th class="taC" width="100"><span class="colRed">*</span>增加天数</th><td><input placeholder="请输入天数" id="addnum" name="addnum" type="number" step="0.5"></td>
 					</tr>
 					<tr>
-						<th class="taC" width="100">备注</th><td><textarea class="span4" placeholder="选填"></textarea></td>
+						<th class="taC" width="100">备注</th><td><textarea class="span4" name="description" placeholder="选填"></textarea></td>
 					</tr>
 					</tbody>
 				</table>