请假字段类型修改
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/AtteRestInfo.java b/src/main/java/com/supwisdom/dlpay/atte/bean/AtteRestInfo.java
index 2c280ec..c7392b2 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/bean/AtteRestInfo.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/AtteRestInfo.java
@@ -1,17 +1,22 @@
package com.supwisdom.dlpay.atte.bean;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+
+
public class AtteRestInfo {
+
private String id; //请假条编号
private String custid;
private String custname;
- private String custtypeid;
+ private Integer custtypeid;
private String custtypename;
private String cardno;
private String startdate;
private String enddate;
private String remark;
- private String rtype;
- private String status;
+ private Integer rtype;
+ private Integer status;
private String recustid;
private String recustname;
private String updatetime;
@@ -34,11 +39,11 @@
this.custname = custname;
}
- public String getCusttypeid() {
+ public Integer getCusttypeid() {
return custtypeid;
}
- public void setCusttypeid(String custtypeid) {
+ public void setCusttypeid(Integer custtypeid) {
this.custtypeid = custtypeid;
}
@@ -82,19 +87,19 @@
this.remark = remark;
}
- public String getRtype() {
+ public Integer getRtype() {
return rtype;
}
- public void setRtype(String rtype) {
+ public void setRtype(Integer rtype) {
this.rtype = rtype;
}
- public String getStatus() {
+ public Integer getStatus() {
return status;
}
- public void setStatus(String status) {
+ public void setStatus(Integer status) {
this.status = status;
}
@@ -145,4 +150,6 @@
public void setDeptname(String deptname) {
this.deptname = deptname;
}
+
+
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/RestSearchBean.java b/src/main/java/com/supwisdom/dlpay/atte/bean/RestSearchBean.java
index 01342ea..6d26e33 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/bean/RestSearchBean.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/RestSearchBean.java
@@ -6,9 +6,9 @@
private String custid;
private String deptcode;
private String custname;
- private String status;
- private String rtype;
- private String custtypeid;
+ private Integer status;
+ private Integer rtype;
+ private Integer custtypeid;
public String getStartdate() {
return startdate;
@@ -50,27 +50,27 @@
this.custname = custname;
}
- public String getStatus() {
+ public Integer getStatus() {
return status;
}
- public void setStatus(String status) {
+ public void setStatus(Integer status) {
this.status = status;
}
- public String getRtype() {
+ public Integer getRtype() {
return rtype;
}
- public void setRtype(String rtype) {
+ public void setRtype(Integer rtype) {
this.rtype = rtype;
}
- public String getCusttypeid() {
+ public Integer getCusttypeid() {
return custtypeid;
}
- public void setCusttypeid(String custtypeid) {
+ public void setCusttypeid(Integer custtypeid) {
this.custtypeid = custtypeid;
}
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java b/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
index 1b7a009..d0ee441 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/AppAtteController.java
@@ -50,7 +50,7 @@
public Map addRest(@RequestParam("custid") String custid,
@RequestParam("enddate") String enddate,
@RequestParam("startdate") String startdate,
- @RequestParam("rtype") String rtype,
+ @RequestParam("rtype") Integer rtype,
@RequestParam("remark") String remark,
HttpServletRequest request){
Map map=new HashMap();
@@ -60,7 +60,8 @@
atteRest.setStartdate(startdate);
atteRest.setEnddate(enddate);
atteRest.setRemark(remark);
- atteRest.setStatus("0");
+ atteRest.setStatus(0);
+ atteRest.setRtype(rtype);
atteRest.setUpdatetime(DateUtil.getNow());
if(!atteRestService.saveAtteRest(atteRest)){
map.put("errStr","添加数据失败!");
@@ -79,8 +80,8 @@
*/
@RequestMapping(value = "/getrestlist", method = RequestMethod.POST)
@ResponseBody
- public Map getRestList(@RequestParam("rtype") String rtype,
- @RequestParam("status") String status,
+ public Map getRestList(@RequestParam("rtype") Integer rtype,
+ @RequestParam("status") Integer status,
@RequestParam("custid") String custid,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
@@ -124,7 +125,7 @@
model.addObject("custid",custid);
model.setViewName("atte/app/index");
List<TCustType> custtypelist=systemService.findAllCusttype();
-
+ model.addObject("custtypelist",custtypelist);
return model;
}
/**
@@ -132,16 +133,16 @@
*/
@RequestMapping(value = "/getreviewlist", method = RequestMethod.POST)
@ResponseBody
- public Map getreviewlist(@RequestParam("rtype") String rtype,
+ public Map getreviewlist(@RequestParam("rtype") Integer rtype,
@RequestParam("custid") String custid,
- @RequestParam(value = "custtypeid", required = false, defaultValue = "") String custtypeid,
+ @RequestParam(value = "custtypeid", required = false, defaultValue = "") Integer custtypeid,
@RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
@RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
HttpServletRequest request){
Map map=new HashMap();
RestSearchBean searchBean=new RestSearchBean();
- searchBean.setStatus("0");
+ searchBean.setStatus(0);
searchBean.setCusttypeid(custtypeid);
searchBean.setRtype(rtype);
TCustomer cust=webInterfaceService.findCustomerById(custid);
diff --git a/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java b/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
index ce6329e..ba64171 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
@@ -2,12 +2,14 @@
import com.supwisdom.dlpay.atte.bean.AtteReport;
import com.supwisdom.dlpay.atte.bean.AttedtlSearchBean;
+import com.supwisdom.dlpay.atte.bean.RestSearchBean;
import com.supwisdom.dlpay.atte.bean.Sum;
import com.supwisdom.dlpay.atte.domain.TAtteClass;
import com.supwisdom.dlpay.atte.domain.TAtteDtl;
import com.supwisdom.dlpay.atte.domain.TSeaCusttype;
import com.supwisdom.dlpay.atte.domain.TSeason;
import com.supwisdom.dlpay.atte.service.AtteClassService;
+import com.supwisdom.dlpay.atte.service.AtteRestService;
import com.supwisdom.dlpay.atte.service.CustseaService;
import com.supwisdom.dlpay.atte.service.SeasonService;
import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
@@ -63,6 +65,8 @@
private SystemUtilService systemUtilService;
@Autowired
private ManagerService managerService;
+ @Autowired
+ private AtteRestService atteRestService;
@GetMapping("/rule/index")
public String seasonindex(){
@@ -981,12 +985,49 @@
return "atte/report/print/p_printindex";
}
- public static void main(String[] args) {
- String s1=DateUtil.getNow("yyyyMMdd")+"140000";
- String s2=DateUtil.getNow("yyyyMMdd")+"143000";
- long dif=DateUtil.getInterval(s1,s2);
- System.out.println(dif);
- System.out.println((int)(dif/(1000*60)));
+ /**
+ * 查询假单
+ * @param
+ */
+ @GetMapping("/rest/index")
+ public String restindex(){
+ return "atte/rest/index";
+ }
+
+ @ResponseBody
+ @RequestMapping(value="/rest/list",method = {RequestMethod.POST})
+ public Map getrestlist(HttpServletRequest request,
+ HttpServletResponse response,
+ @RequestParam(value = "pageNo", required = false, defaultValue = "1") int pageNo,
+ @RequestParam(value = "pageSize", required = false, defaultValue = "10") int pageSize,
+ @RequestParam(value = "startdate") String startdate,
+ @RequestParam(value = "enddate") String enddate,
+ @RequestBody RestSearchBean searchBean,
+ @AuthenticationPrincipal TOperator operUser) {
+ searchBean.setStartdate(startdate);
+ searchBean.setEnddate(enddate);
+ Map map=new HashMap();
+ try {
+ Pagination page=null;
+ String opertype=operUser.getOpertype();
+ String deptcode=operUser.getDeptcode();
+ if (!StringUtil.isEmpty(opertype) &&(opertype.equals("S")||opertype.equals("P"))){
+ deptcode=null;
+ }else {
+ if(StringUtil.isEmpty(deptcode)){
+ deptcode="-99";
+ }
+ }
+ searchBean.setDeptcode(deptcode);
+ page=atteRestService.getRestInfo(searchBean,pageNo,pageSize);
+ map.put("PageResult",page);
+ List<TCustType> custtypelist=systemService.findAllCusttype();
+ map.put("custtypelist",custtypelist);
+ }catch (Exception e) {
+ e.printStackTrace();
+ log.error("查询假单失败:" + e.getMessage());
+ }
+ return map;
}
diff --git a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
index 767114f..3e61c17 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/dao/impl/AtteRestDaoImpl.java
@@ -1,15 +1,12 @@
package com.supwisdom.dlpay.atte.dao.impl;
-import com.supwisdom.dlpay.atte.bean.AtteDetailInfo;
import com.supwisdom.dlpay.atte.bean.AtteRestInfo;
import com.supwisdom.dlpay.atte.bean.RestSearchBean;
import com.supwisdom.dlpay.atte.dao.AtteRestDao;
-import com.supwisdom.dlpay.atte.domain.TAtteClass;
import com.supwisdom.dlpay.atte.domain.TAtteRest;
import com.supwisdom.dlpay.framework.util.StringUtil;
import com.supwisdom.dlpay.system.page.Pagination;
import org.hibernate.query.internal.NativeQueryImpl;
-import org.hibernate.transform.ResultTransformer;
import org.hibernate.transform.Transformers;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -70,12 +67,12 @@
public Pagination getRestInfo(RestSearchBean searchBean,int pageNo,int pageSize) {
StringBuffer sql=new StringBuffer();
sql.append(" select r.id,c.custid,c.custname,ct.custtypeid,ct.custtypename,tc.cardno,r.startdate,r.enddate,r.remark,r.rtype,r.status,r.updatetime ");
- sql.append(" ,td.deptcode,td.deptname,r.re_custid,(select custname from t_customer where custid=r.re_custid) recustname ");
+ sql.append(" ,td.deptcode,td.deptname,r.re_custid recustid,(select custname from t_customer where custid=r.re_custid) recustname ");
sql.append(" from t_atte_rest r left join t_customer c on r.custid=c.custid ")
.append(" left join t_card tc on r.custid=tc.custid ")
.append(" left join tb_custtype ct on c.custtypeid=ct.custtypeid ")
.append(" left join tb_dept td on c.deptcode=td.deptcode ")
- .append(" where c.status='1' and tc.status='normal' and tc.transtatus='normal' ");
+ .append(" where r.status != '4' and c.status='1' and tc.status='normal' and tc.transtatus='normal' ");
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
sql.append(" and ( (:sdate between r.startdate and r.enddate) or (:edate between r.startdate and r.enddate) ");
sql.append(" or (:sdate < r.startdate and :edate > r.enddate ) )");
@@ -89,14 +86,17 @@
if(!StringUtil.isEmpty(searchBean.getCustname())){
sql.append(" and c.custname like :cname ");
}
- if(!StringUtil.isEmpty(searchBean.getStatus())){
+ if(searchBean.getStatus()!=null){
sql.append(" and r.status= :stat ");
}
- if(!StringUtil.isEmpty(searchBean.getCusttypeid())){
+ if(searchBean.getCusttypeid()!=null){
sql.append(" and c.custtypeid= :ctypeid ");
}
+ if(searchBean.getRtype()!=null){
+ sql.append(" and r.rtype = :rte ");
+ }
sql.append(" order by r.startdate desc,r.enddate desc ");
- Query query=entityManager.createNativeQuery(sql.toString(), AtteRestInfo.class);
+ Query query=entityManager.createNativeQuery(sql.toString());
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
query.setParameter("sdate",searchBean.getStartdate());
query.setParameter("edate",searchBean.getEnddate());
@@ -110,11 +110,14 @@
if(!StringUtil.isEmpty(searchBean.getCustname())){
query.setParameter("cname","%"+searchBean.getCustname()+"%");
}
- if(!StringUtil.isEmpty(searchBean.getStatus())){
+ if(searchBean.getStatus()!=null){
query.setParameter("stat",searchBean.getStatus());
}
- if(!StringUtil.isEmpty(searchBean.getCusttypeid())){
- query.setParameter("ctypeid",Integer.parseInt(searchBean.getCusttypeid()));
+ if(searchBean.getCusttypeid()!=null){
+ query.setParameter("ctypeid",searchBean.getCusttypeid());
+ }
+ if(searchBean.getRtype()!=null){
+ query.setParameter("rte",searchBean.getRtype());
}
pageNo = pageNo <= 0 ? 1 : pageNo;
query.setFirstResult((pageNo - 1) * pageSize);
@@ -132,12 +135,12 @@
public int getRestCount(RestSearchBean searchBean){
StringBuffer sql=new StringBuffer();
- sql.append(" select count(*)");
+ sql.append(" select count(r.id)");
sql.append(" from t_atte_rest r left join t_customer c on r.custid=c.custid ")
.append(" left join t_card tc on r.custid=tc.custid ")
.append(" left join tb_custtype ct on c.custtypeid=ct.custtypeid ")
.append(" left join tb_dept td on c.deptcode=td.deptcode ")
- .append(" where c.status='1' and tc.status='normal' and tc.transtatus='normal' ");
+ .append(" where r.status != '4' and c.status='1' and tc.status='normal' and tc.transtatus='normal' ");
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
sql.append(" and ( (:sdate between r.startdate and r.enddate) or (:edate between r.startdate and r.enddate) ");
sql.append(" or (:sdate < r.startdate and :edate > r.enddate ) )");
@@ -151,14 +154,17 @@
if(!StringUtil.isEmpty(searchBean.getCustname())){
sql.append(" and c.custname like :cname ");
}
- if(!StringUtil.isEmpty(searchBean.getStatus())){
+ if(searchBean.getStatus()!=null){
sql.append(" and r.status= :stat ");
}
- if(!StringUtil.isEmpty(searchBean.getCusttypeid())){
+ if(searchBean.getCusttypeid()!=null){
sql.append(" and c.custtypeid= :ctypeid ");
}
- sql.append(" order by r.startdate desc,r.enddate desc ");
- Query query=entityManager.createNativeQuery(sql.toString(), AtteRestInfo.class);
+ if(searchBean.getRtype()!=null){
+ sql.append(" and r.rtype = :rte ");
+ }
+// sql.append(" order by r.startdate desc,r.enddate desc ");
+ Query query=entityManager.createNativeQuery(sql.toString());
if(!StringUtil.isEmpty(searchBean.getStartdate())&&!StringUtil.isEmpty(searchBean.getEnddate())){
query.setParameter("sdate",searchBean.getStartdate());
query.setParameter("edate",searchBean.getEnddate());
@@ -172,11 +178,14 @@
if(!StringUtil.isEmpty(searchBean.getCustname())){
query.setParameter("cname","%"+searchBean.getCustname()+"%");
}
- if(!StringUtil.isEmpty(searchBean.getStatus())){
+ if(searchBean.getStatus()!=null){
query.setParameter("stat",searchBean.getStatus());
}
- if(!StringUtil.isEmpty(searchBean.getCusttypeid())){
- query.setParameter("ctypeid",Integer.parseInt(searchBean.getCusttypeid()));
+ if(searchBean.getCusttypeid()!=null){
+ query.setParameter("ctypeid",searchBean.getCusttypeid());
+ }
+ if(searchBean.getRtype()!=null){
+ query.setParameter("rte",searchBean.getRtype());
}
int cnt=0;
Object obj=query.getSingleResult();
diff --git a/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteRest.java b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteRest.java
index fb70fa3..dbef9b8 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteRest.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/domain/TAtteRest.java
@@ -17,10 +17,10 @@
private String startdate;
@Column(name="enddate",length= 8)
private String enddate;
- @Column(name="remark",length = 255 )
+ @Column(name="remark",length = 60 )
private String remark;
@Column(name="status",length = 4)
- private String status; // 0-未审核 1-已通过 2-未通过 3-取消
+ private Integer status; // 0-未审核 1-已通过 2-未通过 3-取消 4-删除
@Column(name="updatetime",length = 14)
private String updatetime;
@Column(name="re_custid",length = 32)
@@ -74,11 +74,11 @@
this.remark = remark;
}
- public String getStatus() {
+ public Integer getStatus() {
return status;
}
- public void setStatus(String status) {
+ public void setStatus(Integer status) {
this.status = status;
}
diff --git a/src/main/resources/templates/atte/rest/index.html b/src/main/resources/templates/atte/rest/index.html
new file mode 100644
index 0000000..eee12fa
--- /dev/null
+++ b/src/main/resources/templates/atte/rest/index.html
@@ -0,0 +1,500 @@
+<div class="layui-card">
+ <div class="layui-card-header">
+ <h2 class="header-title">假单查询</h2>
+ <span class="layui-breadcrumb pull-right">
+ <a href="#">人员考勤</a>
+ <a><cite>假单查询</cite></a>
+ </span>
+ </div>
+ <div class="layui-card-body" >
+ <div id="restapp">
+ <el-form :inline="true" ref="preportform" :model="preportform" data-parsley-validate class="form-horizontal form-label-left">
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">开始日期:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-date-picker style="width: 100%"
+ v-model="preportform.startdate" type="date"
+ placeholder="选择日期" :editable="false" value-format="yyyyMMdd">
+ </el-date-picker>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">结束日期:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-date-picker style="width: 100%"
+ v-model="preportform.enddate" type="date"
+ placeholder="选择日期" :editable="false" value-format="yyyyMMdd">
+ </el-date-picker>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">请假类别:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-select v-model="preportform.rtype" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="rtype in rtypelist"
+ :key="rtype.value"
+ :label="rtype.label"
+ :value="rtype.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
+
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">姓名:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-input v-model="preportform.custname" ></el-input>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">人员类别:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-select v-model="preportform.custtypeid" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="custtypeid in custtypelist"
+ :key="custtypeid.value"
+ :label="custtypeid.label"
+ :value="custtypeid.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;">状态:</span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <el-select v-model="preportform.status" style="width:100%;" clearable filterable placeholder="请选择">
+ <el-option
+ v-for="status in statuslist"
+ :key="status.value"
+ :label="status.label"
+ :value="status.value">
+ </el-option>
+ </el-select>
+ </div>
+ </div>
+ </div>
+
+
+ <div class="col-md-4">
+ <div class="form-group">
+ <label class="control-label col-md-4 col-sm-12 col-xs-12" style="font-size: 14px;"></span>
+ </label>
+ <div class="col-md-8 col-sm-12 col-xs-12">
+ <button type="button" class="btn btn-info" @click="query" id="attedtl_qrybtn">查 询</button>
+ </div>
+ </div>
+ </div>
+ </el-form>
+
+ <template>
+ <el-table
+ ref="singleTable"
+ :data="tableData"
+ highlight-current-row
+ @current-change="currRowChange"
+ stripe
+ border
+ max-height="2000"
+ style="width: 100%">
+
+ <el-table-column
+ prop="custname"
+ label="姓名"
+ sortable
+ >
+ </el-table-column>
+ <el-table-column
+ prop="cardno"
+ label="卡号"
+ sortable
+ >
+ </el-table-column>
+ <el-table-column
+ prop="custtypename"
+ label="人员类别"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="deptname"
+ label="部门"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="startdate"
+ label="开始日期"
+
+ >
+ </el-table-column>
+ <el-table-column
+ prop="enddate"
+ label="截止日期"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="rtype"
+ label="请假类型"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="status"
+ label="状态"
+ >
+ </el-table-column>
+ <el-table-column
+ prop="remark"
+ label="请假事由"
+ >
+ </el-table-column>
+
+ </el-table>
+ <div class="clearfix"></div>
+ <el-pagination
+ @size-change="handleSizeChange"
+ @current-change="currPageChange"
+ :current-page="currPage"
+ :page-sizes="[10, 20, 50, 100]"
+ :page-size="pageSize"
+ layout="prev, pager, next,sizes, jumper,total"
+ :total="totSize">
+ </el-pagination>
+ </template>
+
+ </div>
+
+
+ </div>
+</div>
+
+<script>
+ var polreport_vue = new Vue({
+ el: '#restapp',
+ data:{
+ tableData: [],
+ currPage: 1,
+ pageSize:10,
+ totSize:0,
+ currentRow: null,
+ rtypelist:[{value:11,label:'事假'},{value:12,label:'病假'},{value:13,label:'年假'},{value:14,label:'调休'},{value:15,label:'调休'}],
+ statuslist:[{value:0,label:'未审核'},{value:1,label:'已通过'},{value:2,label:'未通过'},{value:3,label:'取消'}],
+ preportform:{
+ startdate:Date.now(),
+ enddate:Date.now(),
+ custname:'',
+ custtypeid:'',
+ rtype:'',
+ status:''
+ },
+ timegrplist:[],
+ custtypelist:[],
+ deptlist:[],
+ dialogFormVisible: false,
+ dlgAllotDevVisible:false,
+ updatetitle:'修改考勤状态',
+ dtlDiaForm:{
+ atteno:'',
+ custname:'',
+ state:'',
+ remark:''
+ },
+ rules: {
+ season: [
+ { required: true, message: '请输入时令名', trigger: 'blur' },
+ { min: 1, max: 20, message: '长度在 1 到 20 个字符', trigger: 'blur'}
+ ],
+
+
+ },
+
+ },
+ methods: {
+ handleSizeChange:function(val) {
+ this.pageSize=val;
+ attedtl_commonQuery(this,this.currPage,val);
+ },
+ currPageChange:function(val) {
+ this.currPage=val;
+ attedtl_commonQuery(this,this.currPage,this.pageSize);
+ },
+ currRowChange:function(val) {
+ this.currentRow = val;
+ },
+ attedatefor:function(row){
+ if(row.attedate!= null){
+ return dateformatter(row.attedate);
+ }
+ },
+ statimefor:function(row){
+ if(row.statime!= null){
+ return timeformatter(row.statime);
+ }
+ },
+ statefor:function(row){
+ if(row.state!= null){
+ return state_grpname(row.state);
+ }
+ },
+ oldstatefor:function(row){
+ if(row.oldstate!= null){
+ return state_grpname(row.oldstate);
+ }
+ },
+ timenamefor:function(row){
+ if(row.timeid!=null){
+ return timeid_grpname(row.timeid);
+ }
+ },
+ query:function () {
+ this.pagesize=10;
+ this.currPage=1;
+ attedtl_commonQuery(this,this.currPage,this.pageSize);
+ },
+ print:function () {
+ that=this;
+ print(that);
+ },
+ resetForm:function(formName) {
+ this.$refs[formName].resetFields();
+ this.dialogFormVisible = false
+ },
+ closeDialog:function(formName) {
+ this.$refs[formName].resetFields();
+ this.dialogFormVisible = false
+ },
+
+ custtypefor:function (row) {
+ return custtype_grpname(row.custtypeid);
+ },
+ deptfor:function (row) {
+ return dept_grpname(row.deptcode);
+ },
+ refreshdtl:function (){
+ var _that=this;
+ refreshAtteDtl(_that);
+ }
+
+ },
+ created:function(){
+ var _self=this;
+ var token=$("meta[name='_csrf_token']").attr("value");
+ var startdate=class_Formatdate(_self.preportform.startdate);
+ var enddate=class_Formatdate(_self.preportform.enddate);
+ $.ajax({
+ type:"post",
+ dataType:"json",
+ url:"[[@{/atte/rest/list?startdate=}]]"+startdate+"&enddate="+enddate+"&pageNo="+"&pageSize=",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
+ data:JSON.stringify(_self.preportform),
+ success:function(ret){
+ _self.totSize=ret.PageResult.totalCount;
+ _self.tableData=ret.PageResult.list;
+ if(_self.totSize == 0 ){
+ layer.msg("暂无数据", {icon: 2, time: 1000});
+ }
+ var custtypelist = [];
+ var types=ret.custtypelist;
+ for (var i = 0; i < types.length; i++) {
+ custtypelist.push({
+ value: types[i].custtypeid,
+ label: types[i].custtypename
+ });
+ }
+ _self.custtypelist=custtypelist;
+
+ }
+ })
+ }
+
+ })
+ function refreshAtteDtl(that){
+ var startdate=class_Formatdate(that.preportform.startdate);
+ var enddate=class_Formatdate(that.preportform.enddate);
+ if(startdate== '' || enddate=='') {
+ layer.msg("请选择日期", {icon: 2, time: 1000});
+ return;
+ }
+ if(startdate>enddate){
+ layer.msg("开始日期不能大于结束日期!", {icon: 2, time: 1000});
+ return;
+ }
+ layer.confirm('你确定要刷新所选日期的流水吗?', {icon: 3, title:'请确认',offset:'30%'},function (){
+
+ $.ajax({
+ type:"get",
+ dataType:"json",
+ url:"[[@{/atte/adddtlbyhand?enddate=}]]"+enddate+"&startdate="+startdate,
+ success:function(ret){
+ layer.msg('保存信息成功!', {icon: 1, time: 1000});
+ dtl_refreshThisTable();
+ }
+ })
+ })
+ }
+ function dateformatter(time){
+ return time.substr(0,4)+'-'+time.substr(4,2)+'-'+time.substr(6,2);
+ }
+ function timeformatter(time){
+ return time.substr(0,2)+':'+time.substr(2,2)+':'+time.substr(4,2);
+ }
+
+ function dept_grpname(grpid){
+// console.log(typeof timeid)
+ if(grpid!=null){
+ var list = polreport_vue.deptlist;
+ for(var i=0;i<list.length;i++){
+ if(list[i].value == grpid){
+ return list[i].label;
+ }
+ }
+ }
+ }
+ function custtype_grpname(grpid){
+// console.log(typeof timeid)
+ if(grpid!=null){
+ var list = polreport_vue.typegrplist;
+ for(var i=0;i<list.length;i++){
+ if(list[i].value == grpid){
+ return list[i].label;
+ }
+ }
+ }
+ }
+ function state_grpname(grpid){
+ if(grpid!=null){
+ var list = polreport_vue.stategrplist;
+ for(var i=0;i<list.length;i++){
+ if(list[i].value == grpid){
+ return list[i].label;
+ }
+ }
+ }
+ }
+
+ function timeid_grpname(grpid){
+ if(grpid!=null){
+ var list = polreport_vue.timegrplist;
+ for(var i=0;i<list.length;i++){
+ if(list[i].value == grpid){
+ return list[i].label;
+ }
+ }
+ }
+ }
+ function class_Formatdate(date){
+ if(date==null||date==''){
+ return '';
+ }
+ var d=new Date(date);
+ var month=d.getMonth() + 1+'';
+ var date=d.getDate()+'';
+ if(month.length==1){
+ month='0'+month;
+ }
+ if(date.length==1){
+ date='0'+date;
+ }
+ var formated=d.getFullYear() + '' + month + '' +date;
+
+ return formated;
+ }
+ function attedtl_commonQuery(_self,pageno,pagesize) {
+
+ var token=$("meta[name='_csrf_token']").attr("value");
+ var startdate=class_Formatdate(_self.preportform.startdate);
+ var enddate=class_Formatdate(_self.preportform.enddate);
+ $.ajax({
+ type:"post",
+ dataType:"json",
+ url:"[[@{/atte/rest/list?startdate=}]]"+startdate+"&enddate="+enddate+"&pageNo="+pageno+"&pageSize="+pagesize,
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
+ data:JSON.stringify(_self.preportform),
+ success:function(ret){
+ _self.totSize=ret.PageResult.totalCount;
+ _self.tableData=ret.PageResult.list;
+ if(_self.totSize == 0 ){
+ layer.msg("暂无数据", {icon: 2, time: 1000});
+ }
+
+ }
+ })
+ }
+
+ function dtl_getFillData(_self,row){
+ _self.dtlDiaForm.atteno=row.atteno;
+ _self.dtlDiaForm.custname=row.custname;
+ _self.dtlDiaForm.state=row.state;
+ _self.dtlDiaForm.remark=row.remark;
+ }
+
+ function attedtl_saveData(_that,formName) {
+ var atteno=_that.dtlDiaForm.atteno;
+ var state=_that.dtlDiaForm.state;
+ var remark=_that.dtlDiaForm.remark;
+ if(remark==null){
+ remark='';
+ }
+ var token=$("meta[name='_csrf_token']").attr("value");
+ $.ajax({
+ type: "POST",
+ url: '[[@{/atte/updatetimeDtl?atteno=}]]'+atteno+"&state="+state+"&remark="+remark,
+ dataType: "json",
+ contentType: "application/json",
+ headers: {
+ 'Accept': 'application/json',
+ 'Content-Type': 'application/json',
+ 'X-CSRF-TOKEN':token,
+ },
+ success: function (data) {
+ if (data.errStr == undefined) {
+ layer.msg('用户认证已过期,请重新登录', {icon: 2, time: 1000});
+ window.location = "login";
+ return;
+ }
+ if (data.errStr != "") {
+ layer.msg(data.errStr, {icon: 2, time: 1000});
+ } else {
+ layer.msg('保存信息成功!', {icon: 1, time: 1000});
+ _that.dialogFormVisible = false;
+ dtl_refreshThisTable();
+ _that.$refs[formName].resetFields();
+ }
+ }
+ })
+
+ }
+
+ function dtl_refreshThisTable(){
+ attedtl_commonQuery(polreport_vue,polreport_vue.currPage,polreport_vue.pageSize);
+ };
+
+
+
+
+</script>
\ No newline at end of file