考勤新报表修改
diff --git a/src/main/java/com/supwisdom/dlpay/atte/bean/ExcelReport.java b/src/main/java/com/supwisdom/dlpay/atte/bean/ExcelReport.java
new file mode 100644
index 0000000..2a397a0
--- /dev/null
+++ b/src/main/java/com/supwisdom/dlpay/atte/bean/ExcelReport.java
@@ -0,0 +1,764 @@
+package com.supwisdom.dlpay.atte.bean;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+
+public class ExcelReport {
+    @Excel(name = "姓名")
+    private String custname;
+    @Excel(name = "卡号")
+    private String cardno;
+    @Excel(name = "正常(天)")
+    private float cnt1; //正常
+    @Excel(name = "异常(天)")
+    private float cnt2;  //迟到并早退
+    @Excel(name = "请假(天)")
+    private float cnt3; // 请假
+    @Excel(name = "旷工(天)")
+    private float cnt4; //旷工
+    @Excel(name = "总考勤天数")
+    private float cnts;//
+//    @Excel(name = "姓名")
+//    private float cnt5;//迟到或早退
+    @Excel(name = "补休(天)")
+    private float cnt7;//补休
+    @Excel(name = "外出办公(天)")
+    private float cnt8;//外出办案
+    @Excel(name = "出差(天)")
+    private float cnt9;//出差
+    @Excel(name = "人员类别")
+    private String custtypename;
+    @Excel(name = "部门")
+    private String deptname;
+    @Excel(name = "1(上午)")
+    private String a1;
+    @Excel(name = "1(下午)")
+    private String p1;
+    @Excel(name = "2(上午)")
+    private String a2;
+    @Excel(name = "2(下午)")
+    private String p2;
+    @Excel(name = "3(上午)")
+    private String a3;
+    @Excel(name = "3(下午)")
+    private String p3;
+    @Excel(name = "4(上午)")
+    private String a4;
+    @Excel(name = "4(下午)")
+    private String p4;
+    @Excel(name = "5(上午)")
+    private String a5;
+    @Excel(name = "5(下午)")
+    private String p5;
+    @Excel(name = "6(上午)")
+    private String a6;
+    @Excel(name = "6(下午)")
+    private String p6;
+    @Excel(name = "7(上午)")
+    private String a7;
+    @Excel(name = "7(下午)")
+    private String p7;
+    @Excel(name = "8(上午)")
+    private String a8;
+    @Excel(name = "8(下午)")
+    private String p8;
+    @Excel(name = "9(上午)")
+    private String a9;
+    @Excel(name = "9(下午)")
+    private String p9;
+    @Excel(name = "10(上午)")
+    private String a10;
+    @Excel(name = "10(下午)")
+    private String p10;
+    @Excel(name = "11(上午)")
+    private String a11;
+    @Excel(name = "11(下午)")
+    private String p11;
+    @Excel(name = "12(上午)")
+    private String a12;
+    @Excel(name = "12(下午)")
+    private String p12;
+    @Excel(name = "13(上午)")
+    private String a13;
+    @Excel(name = "13(下午)")
+    private String p13;
+    @Excel(name = "14(上午)")
+    private String a14;
+    @Excel(name = "14(下午)")
+    private String p14;
+    @Excel(name = "15(上午)")
+    private String a15;
+    @Excel(name = "15(下午)")
+    private String p15;
+    @Excel(name = "16(上午)")
+    private String a16;
+    @Excel(name = "16(下午)")
+    private String p16;
+    @Excel(name = "17(上午)")
+    private String a17;
+    @Excel(name = "17(下午)")
+    private String p17;
+    @Excel(name = "18(上午)")
+    private String a18;
+    @Excel(name = "18(下午)")
+    private String p18;
+    @Excel(name = "19(上午)")
+    private String a19;
+    @Excel(name = "19(下午)")
+    private String p19;
+    @Excel(name = "20(上午)")
+    private String a20;
+    @Excel(name = "20(下午)")
+    private String p20;
+    @Excel(name = "21(上午)")
+    private String a21;
+    @Excel(name = "21(下午)")
+    private String p21;
+    @Excel(name = "22(上午)")
+    private String a22;
+    @Excel(name = "22(下午)")
+    private String p22;
+    @Excel(name = "23(上午)")
+    private String a23;
+    @Excel(name = "23(下午)")
+    private String p23;
+    @Excel(name = "24(上午)")
+    private String a24;
+    @Excel(name = "24(下午)")
+    private String p24;
+    @Excel(name = "25(上午)")
+    private String a25;
+    @Excel(name = "25(下午)")
+    private String p25;
+    @Excel(name = "26(上午)")
+    private String a26;
+    @Excel(name = "26(下午)")
+    private String p26;
+    @Excel(name = "27(上午)")
+    private String a27;
+    @Excel(name = "27(下午)")
+    private String p27;
+    @Excel(name = "28(上午)")
+    private String a28;
+    @Excel(name = "28(下午)")
+    private String p28;
+    @Excel(name = "29(上午)")
+    private String a29;
+    @Excel(name = "29(下午)")
+    private String p29;
+    @Excel(name = "30(上午)")
+    private String a30;
+    @Excel(name = "30(下午)")
+    private String p30;
+    @Excel(name = "31(上午)")
+    private String a31;
+    @Excel(name = "31(下午)")
+    private String p31;
+
+
+
+
+
+
+
+    public String getCustname() {
+        return custname;
+    }
+
+    public void setCustname(String custname) {
+        this.custname= custname;
+    }
+
+    public String getCardno() {
+        return cardno;
+    }
+
+    public void setCardno(String cardno) {
+        this.cardno = cardno;
+    }
+
+
+
+    public float getCnt1() {
+        return cnt1;
+    }
+
+    public void setCnt1(float cnt1) {
+        this.cnt1 = cnt1;
+    }
+
+    public float getCnt2() {
+        return cnt2;
+    }
+
+    public void setCnt2(float cnt2) {
+        this.cnt2 = cnt2;
+    }
+
+    public float getCnt3() {
+        return cnt3;
+    }
+
+    public void setCnt3(float cnt3) {
+        this.cnt3 = cnt3;
+    }
+
+    public float getCnts() {
+        return cnts;
+    }
+
+    public void setCnts(float cnts) {
+        this.cnts = cnts;
+    }
+
+    public float getCnt4() {
+        return cnt4;
+    }
+
+    public void setCnt4(float cnt4) {
+        this.cnt4 = cnt4;
+    }
+
+    public String getCusttypename() {
+        return custtypename;
+    }
+
+    public void setCusttypename(String custtypename) {
+        this.custtypename = custtypename;
+    }
+
+    public String getDeptname() {
+        return deptname;
+    }
+
+    public void setDeptname(String deptname) {
+        this.deptname = deptname;
+    }
+
+//    public float getCnt5() {
+//        return cnt5;
+//    }
+//
+//    public void setCnt5(float cnt5) {
+//        this.cnt5 = cnt5;
+//    }
+
+    public float getCnt7() {
+        return cnt7;
+    }
+
+    public void setCnt7(float cnt7) {
+        this.cnt7 = cnt7;
+    }
+
+    public float getCnt8() {
+        return cnt8;
+    }
+
+    public void setCnt8(float cnt8) {
+        this.cnt8 = cnt8;
+    }
+
+    public float getCnt9() {
+        return cnt9;
+    }
+
+    public void setCnt9(float cnt9) {
+        this.cnt9 = cnt9;
+    }
+
+    public String getA1() {
+        return a1;
+    }
+
+    public void setA1(String a1) {
+        this.a1 = a1;
+    }
+
+    public String getP1() {
+        return p1;
+    }
+
+    public void setP1(String p1) {
+        this.p1 = p1;
+    }
+
+    public String getA2() {
+        return a2;
+    }
+
+    public void setA2(String a2) {
+        this.a2 = a2;
+    }
+
+    public String getP2() {
+        return p2;
+    }
+
+    public void setP2(String p2) {
+        this.p2 = p2;
+    }
+
+    public String getA3() {
+        return a3;
+    }
+
+    public void setA3(String a3) {
+        this.a3 = a3;
+    }
+
+    public String getP3() {
+        return p3;
+    }
+
+    public void setP3(String p3) {
+        this.p3 = p3;
+    }
+
+    public String getA4() {
+        return a4;
+    }
+
+    public void setA4(String a4) {
+        this.a4 = a4;
+    }
+
+    public String getP4() {
+        return p4;
+    }
+
+    public void setP4(String p4) {
+        this.p4 = p4;
+    }
+
+    public String getA5() {
+        return a5;
+    }
+
+    public void setA5(String a5) {
+        this.a5 = a5;
+    }
+
+    public String getP5() {
+        return p5;
+    }
+
+    public void setP5(String p5) {
+        this.p5 = p5;
+    }
+
+    public String getA6() {
+        return a6;
+    }
+
+    public void setA6(String a6) {
+        this.a6 = a6;
+    }
+
+    public String getP6() {
+        return p6;
+    }
+
+    public void setP6(String p6) {
+        this.p6 = p6;
+    }
+
+    public String getA7() {
+        return a7;
+    }
+
+    public void setA7(String a7) {
+        this.a7 = a7;
+    }
+
+    public String getP7() {
+        return p7;
+    }
+
+    public void setP7(String p7) {
+        this.p7 = p7;
+    }
+
+    public String getA8() {
+        return a8;
+    }
+
+    public void setA8(String a8) {
+        this.a8 = a8;
+    }
+
+    public String getP8() {
+        return p8;
+    }
+
+    public void setP8(String p8) {
+        this.p8 = p8;
+    }
+
+    public String getA9() {
+        return a9;
+    }
+
+    public void setA9(String a9) {
+        this.a9 = a9;
+    }
+
+    public String getP9() {
+        return p9;
+    }
+
+    public void setP9(String p9) {
+        this.p9 = p9;
+    }
+
+    public String getA10() {
+        return a10;
+    }
+
+    public void setA10(String a10) {
+        this.a10 = a10;
+    }
+
+    public String getP10() {
+        return p10;
+    }
+
+    public void setP10(String p10) {
+        this.p10 = p10;
+    }
+
+    public String getA11() {
+        return a11;
+    }
+
+    public void setA11(String a11) {
+        this.a11 = a11;
+    }
+
+    public String getP11() {
+        return p11;
+    }
+
+    public void setP11(String p11) {
+        this.p11 = p11;
+    }
+
+    public String getA12() {
+        return a12;
+    }
+
+    public void setA12(String a12) {
+        this.a12 = a12;
+    }
+
+    public String getP12() {
+        return p12;
+    }
+
+    public void setP12(String p12) {
+        this.p12 = p12;
+    }
+
+    public String getA13() {
+        return a13;
+    }
+
+    public void setA13(String a13) {
+        this.a13 = a13;
+    }
+
+    public String getP13() {
+        return p13;
+    }
+
+    public void setP13(String p13) {
+        this.p13 = p13;
+    }
+
+    public String getA14() {
+        return a14;
+    }
+
+    public void setA14(String a14) {
+        this.a14 = a14;
+    }
+
+    public String getP14() {
+        return p14;
+    }
+
+    public void setP14(String p14) {
+        this.p14 = p14;
+    }
+
+    public String getA15() {
+        return a15;
+    }
+
+    public void setA15(String a15) {
+        this.a15 = a15;
+    }
+
+    public String getP15() {
+        return p15;
+    }
+
+    public void setP15(String p15) {
+        this.p15 = p15;
+    }
+
+    public String getA16() {
+        return a16;
+    }
+
+    public void setA16(String a16) {
+        this.a16 = a16;
+    }
+
+    public String getP16() {
+        return p16;
+    }
+
+    public void setP16(String p16) {
+        this.p16 = p16;
+    }
+
+    public String getA17() {
+        return a17;
+    }
+
+    public void setA17(String a17) {
+        this.a17 = a17;
+    }
+
+    public String getP17() {
+        return p17;
+    }
+
+    public void setP17(String p17) {
+        this.p17 = p17;
+    }
+
+    public String getA18() {
+        return a18;
+    }
+
+    public void setA18(String a18) {
+        this.a18 = a18;
+    }
+
+    public String getP18() {
+        return p18;
+    }
+
+    public void setP18(String p18) {
+        this.p18 = p18;
+    }
+
+    public String getA19() {
+        return a19;
+    }
+
+    public void setA19(String a19) {
+        this.a19 = a19;
+    }
+
+    public String getP19() {
+        return p19;
+    }
+
+    public void setP19(String p19) {
+        this.p19 = p19;
+    }
+
+    public String getA20() {
+        return a20;
+    }
+
+    public void setA20(String a20) {
+        this.a20 = a20;
+    }
+
+    public String getP20() {
+        return p20;
+    }
+
+    public void setP20(String p20) {
+        this.p20 = p20;
+    }
+
+    public String getA21() {
+        return a21;
+    }
+
+    public void setA21(String a21) {
+        this.a21 = a21;
+    }
+
+    public String getP21() {
+        return p21;
+    }
+
+    public void setP21(String p21) {
+        this.p21 = p21;
+    }
+
+    public String getA22() {
+        return a22;
+    }
+
+    public void setA22(String a22) {
+        this.a22 = a22;
+    }
+
+    public String getP22() {
+        return p22;
+    }
+
+    public void setP22(String p22) {
+        this.p22 = p22;
+    }
+
+    public String getA23() {
+        return a23;
+    }
+
+    public void setA23(String a23) {
+        this.a23 = a23;
+    }
+
+    public String getP23() {
+        return p23;
+    }
+
+    public void setP23(String p23) {
+        this.p23 = p23;
+    }
+
+    public String getA24() {
+        return a24;
+    }
+
+    public void setA24(String a24) {
+        this.a24 = a24;
+    }
+
+    public String getP24() {
+        return p24;
+    }
+
+    public void setP24(String p24) {
+        this.p24 = p24;
+    }
+
+    public String getA25() {
+        return a25;
+    }
+
+    public void setA25(String a25) {
+        this.a25 = a25;
+    }
+
+    public String getP25() {
+        return p25;
+    }
+
+    public void setP25(String p25) {
+        this.p25 = p25;
+    }
+
+    public String getA26() {
+        return a26;
+    }
+
+    public void setA26(String a26) {
+        this.a26 = a26;
+    }
+
+    public String getP26() {
+        return p26;
+    }
+
+    public void setP26(String p26) {
+        this.p26 = p26;
+    }
+
+    public String getA27() {
+        return a27;
+    }
+
+    public void setA27(String a27) {
+        this.a27 = a27;
+    }
+
+    public String getP27() {
+        return p27;
+    }
+
+    public void setP27(String p27) {
+        this.p27 = p27;
+    }
+
+    public String getA28() {
+        return a28;
+    }
+
+    public void setA28(String a28) {
+        this.a28 = a28;
+    }
+
+    public String getP28() {
+        return p28;
+    }
+
+    public void setP28(String p28) {
+        this.p28 = p28;
+    }
+
+    public String getA29() {
+        return a29;
+    }
+
+    public void setA29(String a29) {
+        this.a29 = a29;
+    }
+
+    public String getP29() {
+        return p29;
+    }
+
+    public void setP29(String p29) {
+        this.p29 = p29;
+    }
+
+    public String getA30() {
+        return a30;
+    }
+
+    public void setA30(String a30) {
+        this.a30 = a30;
+    }
+
+    public String getP30() {
+        return p30;
+    }
+
+    public void setP30(String p30) {
+        this.p30 = p30;
+    }
+
+    public String getA31() {
+        return a31;
+    }
+
+    public void setA31(String a31) {
+        this.a31 = a31;
+    }
+
+    public String getP31() {
+        return p31;
+    }
+
+    public void setP31(String p31) {
+        this.p31 = p31;
+    }
+}
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 24d1b15..c51b312 100644
--- a/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
+++ b/src/main/java/com/supwisdom/dlpay/atte/controller/CustAtteController.java
@@ -1,10 +1,11 @@
 package com.supwisdom.dlpay.atte.controller;
 
-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.dao.AtteReportDao;
+import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
+import cn.afterturn.easypoi.excel.entity.ExportParams;
+import cn.afterturn.easypoi.excel.entity.enmus.ExcelType;
+import cn.afterturn.easypoi.excel.entity.params.ExcelExportEntity;
+import cn.afterturn.easypoi.view.PoiBaseView;
+import com.supwisdom.dlpay.atte.bean.*;
 import com.supwisdom.dlpay.atte.domain.*;
 import com.supwisdom.dlpay.atte.service.*;
 import com.supwisdom.dlpay.doorlist.bean.TCustomerInfo;
@@ -12,8 +13,6 @@
 import com.supwisdom.dlpay.framework.service.SystemUtilService;
 import com.supwisdom.dlpay.framework.util.DateUtil;
 import com.supwisdom.dlpay.framework.util.StringUtil;
-import com.supwisdom.dlpay.mainservice.domain.TCustomer;
-import com.supwisdom.dlpay.mainservice.service.WebInterfaceService;
 import com.supwisdom.dlpay.ncmgr.domain.TNcDevice;
 import com.supwisdom.dlpay.ncmgr.domain.TNcTime;
 import com.supwisdom.dlpay.ncmgr.domain.TNcTimegrp;
@@ -36,9 +35,10 @@
 
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
 @Controller
 @RequestMapping("/atte")
@@ -1221,4 +1221,145 @@
         return "atte/report/print/newreportindex";
     }
 
+    @GetMapping("/excel/excelnewreport")
+    public void excelNewReport(HttpServletRequest request, HttpServletResponse response,
+                               @ModelAttribute("searchBean") AttedtlSearchBean searchBean,
+                                     @RequestParam(value = "opercode",required = false) String opercode) {
+        Map map =new HashMap();
+        try {
+            TOperator operUser=managerService.getOperatorByOpercode(opercode);
+            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";
+                }
+            }
+            List<TDept> deptlist=systemService.findAllDept();
+            TDept tdept=null;
+            for(TDept dept:deptlist){
+                if(dept.getDeptcode().equals(deptcode)){
+                    tdept=dept;
+                }
+            }
+            searchBean.setDeptcode(deptcode);
+            List<AtteReport> list=atteClassService.getNewReportList(searchBean);
+            ExportParams params = new ExportParams("考勤报表", "考勤报表", ExcelType.XSSF);
+//		params.setFreezeCol(2);
+            List<ExcelReport> data=new ArrayList<>();
+            for(AtteReport at:list){
+                ExcelReport er=new ExcelReport();
+                er.setCustname(at.getCustname());
+                er.setDeptname(at.getDeptname());
+                er.setCusttypename(at.getCusttypename());
+                er.setCardno(at.getCardno());
+                er.setCnt1(at.getCnt1());
+                er.setCnt2(at.getCnt2());
+                er.setCnt3(at.getCnt3());
+                er.setCnt4(at.getCnt4());
+                er.setCnt7(at.getCnt7());
+                er.setCnt8(at.getCnt8());
+                er.setCnt9(at.getCnt9());
+                er.setCnts(at.getCnts());
+                er.setA1(getState(at.getA1()));
+                er.setP1(getState(at.getP1()));
+                er.setA2(getState(at.getA2()));
+                er.setP2(getState(at.getP2()));
+                er.setA3(getState(at.getA3()));
+                er.setP3(getState(at.getP3()));
+                er.setA4(getState(at.getA4()));
+                er.setP4(getState(at.getP4()));
+                er.setA6(getState(at.getA5()));
+                er.setP6(getState(at.getP5()));
+                er.setA7(getState(at.getA7()));
+                er.setP7(getState(at.getP7()));
+                er.setA8(getState(at.getA8()));
+                er.setP8(getState(at.getP8()));
+                er.setA9(getState(at.getA9()));
+                er.setP9(getState(at.getP9()));
+                er.setA10(getState(at.getA10()));
+                er.setP10(getState(at.getP10()));
+                er.setA11(getState(at.getA11()));
+                er.setP11(getState(at.getP11()));
+                er.setA12(getState(at.getA12()));
+                er.setP12(getState(at.getP12()));
+                er.setA13(getState(at.getA13()));
+                er.setP13(getState(at.getP13()));
+                er.setA14(getState(at.getA14()));
+                er.setP14(getState(at.getP14()));
+                er.setA15(getState(at.getA15()));
+                er.setP15(getState(at.getP15()));
+                er.setA16(getState(at.getA16()));
+                er.setP16(getState(at.getP16()));
+                er.setA17(getState(at.getA17()));
+                er.setP17(getState(at.getP17()));
+                er.setA18(getState(at.getA18()));
+                er.setP18(getState(at.getP18()));
+                er.setA19(getState(at.getA19()));
+                er.setP19(getState(at.getP19()));
+                er.setA20(getState(at.getA20()));
+                er.setP20(getState(at.getP20()));
+                er.setA21(getState(at.getA21()));
+                er.setP21(getState(at.getP21()));
+                er.setA22(getState(at.getA22()));
+                er.setP22(getState(at.getP22()));
+                er.setA23(getState(at.getA23()));
+                er.setP23(getState(at.getP23()));
+                er.setA24(getState(at.getA24()));
+                er.setP24(getState(at.getP24()));
+                er.setA25(getState(at.getA25()));
+                er.setP25(getState(at.getP25()));
+                er.setA26(getState(at.getA26()));
+                er.setP26(getState(at.getP26()));
+                er.setA27(getState(at.getA27()));
+                er.setP27(getState(at.getP27()));
+                er.setA28(getState(at.getA28()));
+                er.setP28(getState(at.getP28()));
+                er.setA29(getState(at.getA29()));
+                er.setP29(getState(at.getP29()));
+                er.setA30(getState(at.getA30()));
+                er.setP30(getState(at.getP30()));
+                er.setA31(getState(at.getA31()));
+                er.setP31(getState(at.getP31()));
+                data.add(er);
+            }
+
+            map.put(NormalExcelConstants.DATA_LIST, data );//设置值
+            map.put(NormalExcelConstants.PARAMS, params);//设置属性
+            map.put(NormalExcelConstants.CLASS, ExcelReport.class);
+            map.put(NormalExcelConstants.FILE_NAME, "考勤报表");
+            PoiBaseView.render(map, request, response, NormalExcelConstants.EASYPOI_EXCEL_VIEW);
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            map.put("result", "导出excel文件失败");
+        }
+    }
+
+    public String getState(Integer num){
+        if(num==null) {
+            return "";
+        }
+        switch (num){
+            case 0:
+                return "未打卡";
+            case 1:
+                return "正常";
+            case 2:
+                return "异常";
+            case 7:
+                return "补休";
+            case 8:
+            return "外出办公";
+            case 9:
+                return "出差";
+            case 11:
+                return "请假";
+            default:
+                return "";
+        }
+
+    }
 }
diff --git a/src/main/resources/templates/atte/newreport/index.html b/src/main/resources/templates/atte/newreport/index.html
index c2446c0..1163d3f 100644
--- a/src/main/resources/templates/atte/newreport/index.html
+++ b/src/main/resources/templates/atte/newreport/index.html
@@ -11,28 +11,28 @@
             <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 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">
+                                    v-model="preportform.startdate" type="month"
+                                    placeholder="选择月份" :editable="false"  value-format="yyyyMM">
                             </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-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>
@@ -88,11 +88,12 @@
 
                 <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 class="control-label col-md-3 col-sm-12 col-xs-12" style="font-size: 14px;"></span>
                         </label>
-                        <div class="col-md-8 col-sm-12 col-xs-12">
+                        <div class="col-md-9 col-sm-12 col-xs-12">
                         <button type="button" class="btn btn-info" @click="query" id="attedtl_qrybtn">查看报表</button>
                         <button type="button" class="btn btn-info" @click="print" id="print_preport">打印</button>
+                        <button type="button" class="btn btn-info" @click="excel" id="export_preport">导出</button>
                         </div>
                     </div>
                 </div>
@@ -602,6 +603,11 @@
 
 
             },
+            pickerOptions0: {
+                disabledDate:function(time) {
+                    return time.getTime() <Date.now();
+                }
+            },
 
         },
         methods: {
@@ -628,6 +634,10 @@
                 that=this;
                 print(that);
             },
+            excel:function (){
+                that=this;
+                excel(that);
+            },
             resetForm:function(formName) {
                 this.$refs[formName].resetFields();
                 this.dialogFormVisible = false
@@ -728,12 +738,22 @@
     }
     function report_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);
-        if(startdate.substring(0,6) != enddate.substring(0,6)){
-            layer.msg("开始日期和结束日期必须属于同一月份!", {icon: 1, time: 1000});
+
+        var month=class_Formatdate(_self.preportform.startdate).substring(0,6);
+        if(checkEmpty(month)){
+            layer.msg("月份不能为空!", {icon: 1, time: 1000});
             return ;
         }
+        var curmonth=class_Formatdate(Date.now()).substring(0,6);
+        if(month>curmonth){
+            month=curmonth;
+        }
+        var   startdate=month+'01';
+        var enddate=month+'31';
+        // if(startdate.substring(0,6) != enddate.substring(0,6)){
+        //     layer.msg("开始日期和结束日期必须属于同一月份!", {icon: 1, time: 1000});
+        //     return ;
+        // }
 
         var custtypeid=_self.preportform.custtypeid;
         var custname=_self.preportform.custname;
@@ -743,7 +763,7 @@
             layer.msg("姓名丶卡号丶人员类别丶部门四个查询条件至少选择一个!", {icon: 1, time: 2000});
             return ;
         }
-        layer.msg("正在生成报表,请稍等!", {icon: 1, time: 3000});
+        layer.msg("正在生成报表,请稍等!", {icon: 1, time: 2000});
         $.ajax({
             type:"post",
             dataType:"json",
@@ -823,8 +843,17 @@
     var LODOP;
     function print(that){
         layer.msg("正在打印,请稍等!", {icon: 1, time: 1000});
-        var startdate=class_Formatdate(that.preportform.startdate);
-        var enddate=class_Formatdate(that.preportform.enddate);
+        var month=class_Formatdate(_self.preportform.startdate).substring(0,6);
+        if(checkEmpty(month)){
+            layer.msg("月份不能为空!", {icon: 1, time: 1000});
+            return ;
+        }
+        var curmonth=class_Formatdate(Date.now()).substring(0,6);
+        if(month>curmonth){
+            month=curmonth;
+        }
+        var   startdate=month+'01';
+        var enddate=month+'31';
         var custtypeid=that.preportform.custtypeid;
         var custname=that.preportform.custname;
         var cardno=that.preportform.cardno;
@@ -846,6 +875,27 @@
 
     }
 
+    function excel(that){
+        layer.msg("正在导出,请稍等!", {icon: 1, time: 1000});
+        var month=class_Formatdate(that.preportform.startdate).substring(0,6);
+        if(checkEmpty(month)){
+            layer.msg("月份不能为空!", {icon: 1, time: 1000});
+            return ;
+        }
+        var curmonth=class_Formatdate(Date.now()).substring(0,6);
+        if(month>curmonth){
+            month=curmonth;
+        }
+        var   startdate=month+'01';
+        var enddate=month+'31';
+        var custtypeid=that.preportform.custtypeid;
+        var custname=that.preportform.custname;
+        var cardno=that.preportform.cardno;
+        var opercode=that.oper.opercode;
+        var dtcode=that.preportform.dtcode;
+        var url = encodeURI('[[@{/atte/excel/excelnewreport?startdate=}]]' + startdate + '&enddate=' + enddate + '&custtypeid=' + custtypeid + '&custname=' + custname+"&cardno="+cardno+"&opercode="+opercode+"&dtcode="+dtcode);
+        window.open(url);
+    }
 
 
 </script>
\ No newline at end of file