Commit 4e3dbb9c6b07190c03e829099bc3e20e852e43a8
1 parent
44442ea4
update...
Showing
8 changed files
with
664 additions
and
1 deletions
src/main/java/com/bsth/controller/realcontrol/summary/HoursController.java
0 → 100644
| 1 | +package com.bsth.controller.realcontrol.summary; | ||
| 2 | + | ||
| 3 | +import com.bsth.controller.BaseController; | ||
| 4 | +import com.bsth.data.summary.entity.Hours_jsy; | ||
| 5 | +import org.springframework.web.bind.annotation.RequestMapping; | ||
| 6 | +import org.springframework.web.bind.annotation.RestController; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 汇总数据 -工时 | ||
| 10 | + * Created by panzhao on 2017/7/27. | ||
| 11 | + */ | ||
| 12 | +@RestController | ||
| 13 | +@RequestMapping("/summary/hours") | ||
| 14 | +public class HoursController extends BaseController<Hours_jsy, Long>{ | ||
| 15 | +} |
src/main/java/com/bsth/data/summary/entity/Hours_jsy.java
0 → 100644
| 1 | +package com.bsth.data.summary.entity; | ||
| 2 | + | ||
| 3 | +import javax.persistence.Entity; | ||
| 4 | +import javax.persistence.Id; | ||
| 5 | +import javax.persistence.Table; | ||
| 6 | +import javax.persistence.Transient; | ||
| 7 | +import java.util.Date; | ||
| 8 | + | ||
| 9 | +/** | ||
| 10 | + * Created by panzhao on 2017/7/26. | ||
| 11 | + * table: | ||
| 12 | + * 驾驶员工时 | ||
| 13 | + */ | ||
| 14 | +@Entity | ||
| 15 | +@Table(name = "z_calc_hoursjsy") | ||
| 16 | +public class Hours_jsy { | ||
| 17 | + | ||
| 18 | + @Id | ||
| 19 | + private Long id; | ||
| 20 | + | ||
| 21 | + /** 公司编码 */ | ||
| 22 | + private String companyId; | ||
| 23 | + | ||
| 24 | + /** 分公司编码 */ | ||
| 25 | + private String subCompanyId; | ||
| 26 | + | ||
| 27 | + /** 公司名称 */ | ||
| 28 | + @Transient | ||
| 29 | + private String companyName; | ||
| 30 | + /** 分公司名称 */ | ||
| 31 | + @Transient | ||
| 32 | + private String subCompanyName; | ||
| 33 | + | ||
| 34 | + /** 线路编码 */ | ||
| 35 | + private String lineCode; | ||
| 36 | + | ||
| 37 | + /** 线路名称 */ | ||
| 38 | + private String lineName; | ||
| 39 | + | ||
| 40 | + /** 驾驶员工号 */ | ||
| 41 | + private String jsy; | ||
| 42 | + | ||
| 43 | + /** 驾驶员姓名 */ | ||
| 44 | + private String jsyName; | ||
| 45 | + | ||
| 46 | + /** 车辆自编号 */ | ||
| 47 | + private String nbbm; | ||
| 48 | + | ||
| 49 | + /** 路牌 */ | ||
| 50 | + private String lpName; | ||
| 51 | + | ||
| 52 | + /** 日期 (班次日期) */ | ||
| 53 | + private String rq; | ||
| 54 | + | ||
| 55 | + /** 计划工时(分钟) */ | ||
| 56 | + private Integer hoursJh; | ||
| 57 | + @Transient | ||
| 58 | + private String hoursJhStr; | ||
| 59 | + | ||
| 60 | + /** 实际工时(分钟) */ | ||
| 61 | + private Integer hoursSj; | ||
| 62 | + @Transient | ||
| 63 | + private String hoursSjStr; | ||
| 64 | + | ||
| 65 | + /** 来源 0: 从路单结算、 1:人工录入 */ | ||
| 66 | + private int source; | ||
| 67 | + | ||
| 68 | + /** 备注 */ | ||
| 69 | + private String remarks; | ||
| 70 | + | ||
| 71 | + private Date createDate; | ||
| 72 | + | ||
| 73 | + public String getCompanyId() { | ||
| 74 | + return companyId; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + public void setCompanyId(String companyId) { | ||
| 78 | + this.companyId = companyId; | ||
| 79 | + } | ||
| 80 | + | ||
| 81 | + public String getSubCompanyId() { | ||
| 82 | + return subCompanyId; | ||
| 83 | + } | ||
| 84 | + | ||
| 85 | + public void setSubCompanyId(String subCompanyId) { | ||
| 86 | + this.subCompanyId = subCompanyId; | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public String getLineCode() { | ||
| 90 | + return lineCode; | ||
| 91 | + } | ||
| 92 | + | ||
| 93 | + public void setLineCode(String lineCode) { | ||
| 94 | + this.lineCode = lineCode; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + public String getLineName() { | ||
| 98 | + return lineName; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + public void setLineName(String lineName) { | ||
| 102 | + this.lineName = lineName; | ||
| 103 | + } | ||
| 104 | + | ||
| 105 | + public String getJsy() { | ||
| 106 | + return jsy; | ||
| 107 | + } | ||
| 108 | + | ||
| 109 | + public void setJsy(String jsy) { | ||
| 110 | + this.jsy = jsy; | ||
| 111 | + } | ||
| 112 | + | ||
| 113 | + public String getJsyName() { | ||
| 114 | + return jsyName; | ||
| 115 | + } | ||
| 116 | + | ||
| 117 | + public void setJsyName(String jsyName) { | ||
| 118 | + this.jsyName = jsyName; | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public String getNbbm() { | ||
| 122 | + return nbbm; | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + public void setNbbm(String nbbm) { | ||
| 126 | + this.nbbm = nbbm; | ||
| 127 | + } | ||
| 128 | + | ||
| 129 | + public String getLpName() { | ||
| 130 | + return lpName; | ||
| 131 | + } | ||
| 132 | + | ||
| 133 | + public void setLpName(String lpName) { | ||
| 134 | + this.lpName = lpName; | ||
| 135 | + } | ||
| 136 | + | ||
| 137 | + public String getRq() { | ||
| 138 | + return rq; | ||
| 139 | + } | ||
| 140 | + | ||
| 141 | + public void setRq(String rq) { | ||
| 142 | + this.rq = rq; | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + | ||
| 146 | + public int getSource() { | ||
| 147 | + return source; | ||
| 148 | + } | ||
| 149 | + | ||
| 150 | + public void setSource(int source) { | ||
| 151 | + this.source = source; | ||
| 152 | + } | ||
| 153 | + | ||
| 154 | + public String getRemarks() { | ||
| 155 | + return remarks; | ||
| 156 | + } | ||
| 157 | + | ||
| 158 | + public void setRemarks(String remarks) { | ||
| 159 | + this.remarks = remarks; | ||
| 160 | + } | ||
| 161 | + | ||
| 162 | + public Date getCreateDate() { | ||
| 163 | + return createDate; | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public void setCreateDate(Date createDate) { | ||
| 167 | + this.createDate = createDate; | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public Integer getHoursJh() { | ||
| 171 | + return hoursJh; | ||
| 172 | + } | ||
| 173 | + | ||
| 174 | + public void setHoursJh(Integer hoursJh) { | ||
| 175 | + this.hoursJh = hoursJh; | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public Integer getHoursSj() { | ||
| 179 | + return hoursSj; | ||
| 180 | + } | ||
| 181 | + | ||
| 182 | + public void setHoursSj(Integer hoursSj) { | ||
| 183 | + this.hoursSj = hoursSj; | ||
| 184 | + } | ||
| 185 | + | ||
| 186 | + public String keys() { | ||
| 187 | + return this.getLineCode() + "_" + this.getLpName() + "_" + this.getJsy() + "_" + this.getNbbm(); | ||
| 188 | + } | ||
| 189 | + | ||
| 190 | + public long getId() { | ||
| 191 | + return id; | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + public void setId(long id) { | ||
| 195 | + this.id = id; | ||
| 196 | + } | ||
| 197 | + | ||
| 198 | + public String getCompanyName() { | ||
| 199 | + return companyName; | ||
| 200 | + } | ||
| 201 | + | ||
| 202 | + public void setCompanyName(String companyName) { | ||
| 203 | + this.companyName = companyName; | ||
| 204 | + } | ||
| 205 | + | ||
| 206 | + public String getSubCompanyName() { | ||
| 207 | + return subCompanyName; | ||
| 208 | + } | ||
| 209 | + | ||
| 210 | + public void setSubCompanyName(String subCompanyName) { | ||
| 211 | + this.subCompanyName = subCompanyName; | ||
| 212 | + } | ||
| 213 | + | ||
| 214 | + public String getHoursJhStr() { | ||
| 215 | + return hoursJhStr; | ||
| 216 | + } | ||
| 217 | + | ||
| 218 | + public void setHoursJhStr(String hoursJhStr) { | ||
| 219 | + this.hoursJhStr = hoursJhStr; | ||
| 220 | + } | ||
| 221 | + | ||
| 222 | + public String getHoursSjStr() { | ||
| 223 | + return hoursSjStr; | ||
| 224 | + } | ||
| 225 | + | ||
| 226 | + public void setHoursSjStr(String hoursSjStr) { | ||
| 227 | + this.hoursSjStr = hoursSjStr; | ||
| 228 | + } | ||
| 229 | +} |
src/main/java/com/bsth/data/summary/repository/HoursRepository.java
0 → 100644
| 1 | +package com.bsth.data.summary.repository; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.summary.entity.Hours_jsy; | ||
| 4 | +import com.bsth.repository.BaseRepository; | ||
| 5 | +import org.springframework.stereotype.Repository; | ||
| 6 | + | ||
| 7 | +/** | ||
| 8 | + * Created by panzhao on 2017/7/27. | ||
| 9 | + */ | ||
| 10 | +@Repository | ||
| 11 | +public interface HoursRepository extends BaseRepository<Hours_jsy, Long> { | ||
| 12 | +} |
src/main/java/com/bsth/data/summary/service/HoursService.java
0 → 100644
src/main/java/com/bsth/data/summary/service/impl/HoursServiceImpl.java
0 → 100644
| 1 | +package com.bsth.data.summary.service.impl; | ||
| 2 | + | ||
| 3 | +import com.bsth.data.BasicData; | ||
| 4 | +import com.bsth.data.summary.entity.Hours_jsy; | ||
| 5 | +import com.bsth.data.summary.service.HoursService; | ||
| 6 | +import com.bsth.service.impl.BaseServiceImpl; | ||
| 7 | +import org.springframework.data.domain.Page; | ||
| 8 | +import org.springframework.data.domain.PageRequest; | ||
| 9 | +import org.springframework.data.domain.Pageable; | ||
| 10 | +import org.springframework.data.domain.Sort; | ||
| 11 | +import org.springframework.stereotype.Service; | ||
| 12 | + | ||
| 13 | +import java.util.ArrayList; | ||
| 14 | +import java.util.List; | ||
| 15 | +import java.util.Map; | ||
| 16 | + | ||
| 17 | +/** | ||
| 18 | + * Created by panzhao on 2017/7/27. | ||
| 19 | + */ | ||
| 20 | +@Service | ||
| 21 | +public class HoursServiceImpl extends BaseServiceImpl<Hours_jsy, Long> implements HoursService { | ||
| 22 | + | ||
| 23 | + @Override | ||
| 24 | + public Page<Hours_jsy> list(Map<String, Object> map, Pageable pageable) { | ||
| 25 | + //排序 | ||
| 26 | + List<Sort.Order> orderList = new ArrayList<>(); | ||
| 27 | + orderList.add(new Sort.Order(Sort.Direction.ASC,"rq")); | ||
| 28 | + orderList.add(new Sort.Order(Sort.Direction.ASC,"lineName")); | ||
| 29 | + orderList.add(new Sort.Order(Sort.Direction.ASC,"jsy")); | ||
| 30 | + orderList.add(new Sort.Order(Sort.Direction.ASC,"nbbm")); | ||
| 31 | + | ||
| 32 | + Page<Hours_jsy> page = super.list(map, new PageRequest(pageable.getPageNumber(), pageable.getPageSize(), new Sort(orderList))); | ||
| 33 | + | ||
| 34 | + //公司编码转名称 | ||
| 35 | + List<Hours_jsy> list = page.getContent(); | ||
| 36 | + for(Hours_jsy h : list){ | ||
| 37 | + h.setCompanyName(BasicData.businessCodeNameMap.get(h.getCompanyId())); | ||
| 38 | + h.setSubCompanyName(BasicData.businessFgsCodeNameMap.get(h.getSubCompanyId()+"_"+h.getCompanyId())); | ||
| 39 | + | ||
| 40 | + //时间字符串 | ||
| 41 | + h.setHoursJhStr(hoursToString(h.getHoursJh())); | ||
| 42 | + h.setHoursSjStr(hoursToString(h.getHoursSj())); | ||
| 43 | + } | ||
| 44 | + return page; | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + private String hoursToString(Integer minute){ | ||
| 48 | + if(minute==0) | ||
| 49 | + return "0"; | ||
| 50 | + int h = minute / 60; | ||
| 51 | + String str = (h<10?"0"+h:h) + ""; | ||
| 52 | + | ||
| 53 | + int m = minute % 60; | ||
| 54 | + if(m != 0) | ||
| 55 | + str += ("." + (m<10?"0"+m:m)); | ||
| 56 | + return str; | ||
| 57 | + } | ||
| 58 | +} |
src/main/resources/static/pages/permission/authorize_all/authorize.html
src/main/resources/static/pages/summary/work_hours/list.html
0 → 100644
| 1 | +<!DOCTYPE html> | ||
| 2 | +<html lang="zh-cn"> | ||
| 3 | + | ||
| 4 | +<head> | ||
| 5 | + <meta charset="UTF-8"> | ||
| 6 | + <link rel="stylesheet" href="/assets/plugins/uk3.0/uikit.min.css"/> | ||
| 7 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.css" /> | ||
| 8 | + <!-- flatpickr --> | ||
| 9 | + <link rel="stylesheet" href="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.css"> | ||
| 10 | + <style> | ||
| 11 | + html,body{ | ||
| 12 | + height: 100%; | ||
| 13 | + } | ||
| 14 | + .ct_page{ | ||
| 15 | + padding: 25px 15px; | ||
| 16 | + height: 100%; | ||
| 17 | + height: calc(100% - 50px); | ||
| 18 | + } | ||
| 19 | + | ||
| 20 | + .ct_cont{ | ||
| 21 | + height: calc(100% - 41px); | ||
| 22 | + } | ||
| 23 | + | ||
| 24 | + .ct_cont>div>div.uk-card{ | ||
| 25 | + height: 99%; | ||
| 26 | + } | ||
| 27 | + | ||
| 28 | + .loading{ | ||
| 29 | + height: 100%; | ||
| 30 | + text-align: center; | ||
| 31 | + } | ||
| 32 | + .loading .uk-spinner{ | ||
| 33 | + margin-top: 200px; | ||
| 34 | + } | ||
| 35 | + .loading circle{ | ||
| 36 | + stroke: red; | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + .ps-container > .ps-scrollbar-x-rail, .ps-container > .ps-scrollbar-y-rail{ | ||
| 40 | + opacity: 0.6 !important; | ||
| 41 | + padding: 0 !important; | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + .ct_table_wrap.day th:nth-of-type(1),.ct_table_wrap.day td:nth-of-type(1){ | ||
| 45 | + width: 10%; | ||
| 46 | + } | ||
| 47 | + .ct_table_wrap.day th:nth-of-type(2),.ct_table_wrap.day td:nth-of-type(2){ | ||
| 48 | + width: 10%; | ||
| 49 | + } | ||
| 50 | + .ct_table_wrap.day th:nth-of-type(3),.ct_table_wrap.day td:nth-of-type(3){ | ||
| 51 | + width: 10%; | ||
| 52 | + } | ||
| 53 | + .ct_table_wrap.day th:nth-of-type(4),.ct_table_wrap.day td:nth-of-type(4){ | ||
| 54 | + width: 10%; | ||
| 55 | + } | ||
| 56 | + .ct_table_wrap.day th:nth-of-type(5),.ct_table_wrap.day td:nth-of-type(5){ | ||
| 57 | + width: 5%; | ||
| 58 | + } | ||
| 59 | + .ct_table_wrap.day th:nth-of-type(6),.ct_table_wrap.day td:nth-of-type(6){ | ||
| 60 | + width: 15%; | ||
| 61 | + } | ||
| 62 | + .ct_table_wrap.day th:nth-of-type(7),.ct_table_wrap.day td:nth-of-type(7){ | ||
| 63 | + width: 10%; | ||
| 64 | + } | ||
| 65 | + .ct_table_wrap.day th:nth-of-type(8),.ct_table_wrap.day td:nth-of-type(8){ | ||
| 66 | + width: 10%; | ||
| 67 | + } | ||
| 68 | + .ct_table_wrap.day th:nth-of-type(9),.ct_table_wrap.day td:nth-of-type(9){ | ||
| 69 | + width: 10%; | ||
| 70 | + } | ||
| 71 | + .ct_table_wrap.day th:nth-of-type(10),.ct_table_wrap.day td:nth-of-type(10){ | ||
| 72 | + width: 10%; | ||
| 73 | + } | ||
| 74 | + | ||
| 75 | + .ct_search_form_wrap{ | ||
| 76 | + border-bottom: 1px solid #e5e5e5; | ||
| 77 | + padding: 10px 0 25px 10px; | ||
| 78 | + } | ||
| 79 | + .ct_search_form_wrap .ct_field{ | ||
| 80 | + display: inline-block; | ||
| 81 | + margin: 0 5px; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + .ct_search_form_wrap .ct_field label{ | ||
| 85 | + font-size: 14px; | ||
| 86 | + } | ||
| 87 | + | ||
| 88 | + .ct_search_form_wrap .ct_field input{ | ||
| 89 | + width: 110px; | ||
| 90 | + } | ||
| 91 | + | ||
| 92 | + .ct_search_form_wrap .ct_field select{ | ||
| 93 | + width: auto; | ||
| 94 | + min-width: 100px; | ||
| 95 | + } | ||
| 96 | + | ||
| 97 | + .ct_search_form_wrap .uk-button{ | ||
| 98 | + padding: 0 14px; | ||
| 99 | + } | ||
| 100 | + | ||
| 101 | + .ct_search_form_wrap .uk-button i{ | ||
| 102 | + vertical-align: middle; | ||
| 103 | + margin-top: -2px; | ||
| 104 | + margin-right: 7px; | ||
| 105 | + } | ||
| 106 | + | ||
| 107 | + .ct_table_wrap{ | ||
| 108 | + font-size: 14px; | ||
| 109 | + height: calc(100% - 77px); | ||
| 110 | + } | ||
| 111 | + | ||
| 112 | + .t_body_wrap{ | ||
| 113 | + height: calc(100% - 41px); | ||
| 114 | + overflow: auto; | ||
| 115 | + position: relative; | ||
| 116 | + } | ||
| 117 | + </style> | ||
| 118 | +</head> | ||
| 119 | + | ||
| 120 | +<body> | ||
| 121 | +<div class="loading"> | ||
| 122 | + <div uk-spinner></div> | ||
| 123 | +</div> | ||
| 124 | +<div class="ct_page" style="display: none;"> | ||
| 125 | + <h2 class="uk-heading-line uk-heading-bullet"><span>工时统计</span></h2> | ||
| 126 | + <div class="ct_cont" > | ||
| 127 | + <div class="ct_search_form_wrap"> | ||
| 128 | + <form> | ||
| 129 | + <div class="ct_field"> | ||
| 130 | + <label>公司: | ||
| 131 | + <select class="uk-select" name="companyId_eq"> | ||
| 132 | + </select> | ||
| 133 | + </label> | ||
| 134 | + </div> | ||
| 135 | + <div class="ct_field"> | ||
| 136 | + <label>分公司: | ||
| 137 | + <select class="uk-select" name="subCompanyId_eq"> | ||
| 138 | + </select> | ||
| 139 | + </label> | ||
| 140 | + </div> | ||
| 141 | + <div class="ct_field"> | ||
| 142 | + <label>线路: | ||
| 143 | + <select class="uk-select" name="lineCode_eq"> | ||
| 144 | + <option value="81101">航头4路</option> | ||
| 145 | + </select> | ||
| 146 | + </label> | ||
| 147 | + </div> | ||
| 148 | + <div class="ct_field"> | ||
| 149 | + <label>日期: | ||
| 150 | + <input class="uk-input" name="rq_eq" > | ||
| 151 | + </label> | ||
| 152 | + </div> | ||
| 153 | + <div class="ct_field"> | ||
| 154 | + <label>驾驶员: | ||
| 155 | + <input class="uk-input" name="jsy_eq" placeholder="工号"> | ||
| 156 | + </label> | ||
| 157 | + </div> | ||
| 158 | + <div class="ct_field"> | ||
| 159 | + <label>车辆: | ||
| 160 | + <input class="uk-input" name="nbbm_eq" > | ||
| 161 | + </label> | ||
| 162 | + </div> | ||
| 163 | + <div class="ct_field"> | ||
| 164 | + <button class="uk-button uk-button-primary search"><i uk-icon="icon: search"></i>搜索</button> | ||
| 165 | + <span id="add_hours_icon" uk-icon="icon: plus" style="vertical-align: bottom;margin-left: 5px;" title="录入工休和非营运工时" uk-tooltip></span> | ||
| 166 | + </div> | ||
| 167 | + </form> | ||
| 168 | + </div> | ||
| 169 | + <div class="ct_table_wrap day"> | ||
| 170 | + <table class="uk-table uk-table-small" style="margin-bottom: 0;"> | ||
| 171 | + <thead> | ||
| 172 | + <tr> | ||
| 173 | + <th>日期</th> | ||
| 174 | + <th>公司</th> | ||
| 175 | + <th>分公司</th> | ||
| 176 | + <th>线路</th> | ||
| 177 | + <th>路牌</th> | ||
| 178 | + <th>驾驶员</th> | ||
| 179 | + <th>车辆</th> | ||
| 180 | + <th>计划工时 <i uk-icon="icon: question; ratio:.7" title="格式:小时.分钟" uk-tooltip></i ></th> | ||
| 181 | + <th>实际工时</th> | ||
| 182 | + <th>备注</th> | ||
| 183 | + </tr> | ||
| 184 | + </thead> | ||
| 185 | + </table> | ||
| 186 | + <div class="t_body_wrap"> | ||
| 187 | + <table class="uk-table uk-table-divider uk-table-hover uk-table-small ct_jsy_day_table"> | ||
| 188 | + <tbody> | ||
| 189 | + </tbody> | ||
| 190 | + </table> | ||
| 191 | + </div> | ||
| 192 | + </div> | ||
| 193 | + </div> | ||
| 194 | +</div> | ||
| 195 | + | ||
| 196 | +<!--<div id="hours_add_modal" uk-modal> | ||
| 197 | + <div class="uk-modal-dialog uk-modal-body"> | ||
| 198 | + <button class="uk-modal-close-default" type="button" uk-close></button> | ||
| 199 | + <h2 class="uk-modal-title">Default</h2> | ||
| 200 | + <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> | ||
| 201 | + </div> | ||
| 202 | +</div>--> | ||
| 203 | + | ||
| 204 | +<script id="hours_jsy_day_list_temp" type="text/html"> | ||
| 205 | + {{each list as obj i}} | ||
| 206 | + <tr> | ||
| 207 | + <td>{{obj.rq}}</td> | ||
| 208 | + <td>{{obj.companyName}}</td> | ||
| 209 | + <td>{{obj.subCompanyName}}</td> | ||
| 210 | + <td>{{obj.lineName}}</td> | ||
| 211 | + <td>{{obj.lpName}}</td> | ||
| 212 | + <td>{{obj.jsy}}/{{obj.jsyName}}</td> | ||
| 213 | + <td>{{obj.nbbm}}</td> | ||
| 214 | + <td>{{obj.hoursJhStr}}</td> | ||
| 215 | + <td>{{obj.hoursSjStr}}</td> | ||
| 216 | + <td>{{obj.remarks}}</td> | ||
| 217 | + </tr> | ||
| 218 | + {{/each}} | ||
| 219 | +</script> | ||
| 220 | + | ||
| 221 | +<script src="/metronic_v4.5.4/plugins/jquery.min.js"></script> | ||
| 222 | +<script src="/assets/plugins/uk3.0/uikit.min.js"></script> | ||
| 223 | +<script src="/assets/plugins/uk3.0/uikit-icons.min.js"></script> | ||
| 224 | +<script src="/real_control_v2/assets/plugins/perfect-scrollbar/perfect-scrollbar.jquery.js" ></script> | ||
| 225 | +<!-- EventProxy --> | ||
| 226 | +<script src="/assets/js/eventproxy.js"></script> | ||
| 227 | +<!-- art-template 模版引擎 --> | ||
| 228 | +<script src="/assets/plugins/template.js"></script> | ||
| 229 | +<script src="/real_control_v2/assets/plugins/moment/moment.min.js"></script> | ||
| 230 | +<!-- jquery.serializejson JSON序列化插件 --> | ||
| 231 | +<script src="/assets/plugins/jquery.serializejson.js" merge="plugins"></script> | ||
| 232 | +<!-- flatpickr --> | ||
| 233 | +<script src="/real_control_v2/assets/plugins/flatpickr/flatpickr.min.js" ></script> | ||
| 234 | +<script src="/real_control_v2/assets/plugins/flatpickr/l10n/zh.js" ></script> | ||
| 235 | +<script> | ||
| 236 | + | ||
| 237 | + var f = $('form', ''); | ||
| 238 | + var page=0, pageSize=120; | ||
| 239 | + | ||
| 240 | + var ep = EventProxy.create('query_comps', 'query_lines', function () { | ||
| 241 | + $('[name=companyId_eq]', f).trigger('change');//公司change | ||
| 242 | + query(); | ||
| 243 | + | ||
| 244 | + $('.loading').remove(); | ||
| 245 | + $('.ct_page').show(); | ||
| 246 | + }); | ||
| 247 | + | ||
| 248 | + //点击搜索 | ||
| 249 | + $('button.search', f).on('click', query); | ||
| 250 | + | ||
| 251 | + function query() { | ||
| 252 | + var data = f.serializeJSON(); | ||
| 253 | + data.page = page; | ||
| 254 | + data.size = pageSize; | ||
| 255 | + | ||
| 256 | + $.get('/summary/hours', data, function (rs) { | ||
| 257 | + //console.log('data', rs); | ||
| 258 | + var htmlStr = template('hours_jsy_day_list_temp', {list: rs.content}); | ||
| 259 | + $('.ct_jsy_day_table tbody').html(htmlStr); | ||
| 260 | + | ||
| 261 | + $('.t_body_wrap').perfectScrollbar('update'); | ||
| 262 | + }); | ||
| 263 | + } | ||
| 264 | + | ||
| 265 | + //日期选择器 | ||
| 266 | + $('[name=rq_eq]', f).val('2017-07-25'); | ||
| 267 | + flatpickr('.ct_search_form_wrap [name=rq_eq]', {"locale": "zh", maxDate: '2017-07-25', minDate: '2017-07-01'}); | ||
| 268 | + | ||
| 269 | + var comps; | ||
| 270 | + //构建公司级联下拉框 | ||
| 271 | + $.get('/user/companyData', function (rs) { | ||
| 272 | + comps = rs; | ||
| 273 | + var opts = ''; | ||
| 274 | + for(var i=0,obj;obj=comps[i++];){ | ||
| 275 | + opts += '<option value="'+obj.companyCode+'">'+obj.companyName+'</option>'; | ||
| 276 | + } | ||
| 277 | + $('[name=companyId_eq]', f).html(opts); | ||
| 278 | + ep.emit('query_comps'); | ||
| 279 | + }); | ||
| 280 | + | ||
| 281 | + var lineMapps; | ||
| 282 | + //加载线路信息 | ||
| 283 | + $.get('/line/all', {'destroy_eq': 0}, function (rs) { | ||
| 284 | + rs.sort(function (a, b) { | ||
| 285 | + return a.name.localeCompare(b.name); | ||
| 286 | + }); | ||
| 287 | + lineMapps={}; | ||
| 288 | + var k; | ||
| 289 | + $.each(rs, function () { | ||
| 290 | + k = this.company+'_'+this.brancheCompany; | ||
| 291 | + if(!lineMapps[k]) | ||
| 292 | + lineMapps[k]=[]; | ||
| 293 | + lineMapps[k].push(this); | ||
| 294 | + }); | ||
| 295 | + | ||
| 296 | + ep.emit('query_lines'); | ||
| 297 | + }); | ||
| 298 | + | ||
| 299 | + $('[name=companyId_eq]', f).on('change', function () { | ||
| 300 | + var code = $(this).val(), subs=[]; | ||
| 301 | + $.each(comps, function () { | ||
| 302 | + if(this.companyCode==code) | ||
| 303 | + subs=this.children; | ||
| 304 | + }); | ||
| 305 | + | ||
| 306 | + var opts=''; | ||
| 307 | + $.each(subs, function () { | ||
| 308 | + opts += '<option value="'+this.code+'">'+this.name+'</option>'; | ||
| 309 | + }); | ||
| 310 | + $('[name=subCompanyId_eq]', f).html(opts).trigger('change'); | ||
| 311 | + }); | ||
| 312 | + | ||
| 313 | + $('[name=subCompanyId_eq]', f).on('change', function () { | ||
| 314 | + var k = $('[name=companyId_eq]', f).val() + '_' + $(this).val(); | ||
| 315 | + var array = lineMapps[k]; | ||
| 316 | + var opts = ''; | ||
| 317 | + if(array){ | ||
| 318 | + $.each(array, function () { | ||
| 319 | + opts += '<option value="'+this.lineCode+'">'+this.name+'</option>'; | ||
| 320 | + }); | ||
| 321 | + } | ||
| 322 | + $('[name=lineCode_eq]', f).html(opts); | ||
| 323 | + }); | ||
| 324 | + | ||
| 325 | + // | ||
| 326 | + //滚动条 | ||
| 327 | + $('.t_body_wrap').perfectScrollbar({suppressScrollX: true}); | ||
| 328 | + | ||
| 329 | + $(document).on('submit', 'form', function () { | ||
| 330 | + return false; | ||
| 331 | + }); | ||
| 332 | + | ||
| 333 | + $('#add_hours_icon').on('click', function () { | ||
| 334 | + UIkit.notification('暂不开放!', 'danger'); | ||
| 335 | + }); | ||
| 336 | +</script> | ||
| 337 | +</body> | ||
| 338 | +</html> | ||
| 0 | \ No newline at end of file | 339 | \ No newline at end of file |
src/main/resources/static/pages/summary/work_hours/main.html
0 → 100644