Bläddra i källkod

Merge branch 'master' of http://47.92.161.104:10080/shuzhan/shinestar-portal

zhengqiang 4 år sedan
förälder
incheckning
4ba9524414

+ 32 - 28
src/views/business/workScheduleAttendance-day-list.vue

@@ -80,8 +80,8 @@
           <template slot-scope="{ row }">
             <span
               v-if="
-                row.onWorkStatus != 1 &&
-                row.onWorkStatus != 1 &&
+                row.onWorkStatus != '1' &&
+                row.onWorkStatus != '1' &&
                 row.onWorkStatus != null
               "
             >
@@ -94,7 +94,7 @@
         </el-table-column>
         <el-table-column prop="onWorkRecordTime" label="上班打卡时间" width="180"
           ><template slot-scope="{ row }">
-            <span v-if="row.onWorkStatus == 1 && row.onWorkResult != 0">
+            <span v-if="row.onWorkStatus == '1' && row.onWorkResult != '0'">
               {{ row.onWorkRecordTime }}
             </span>
             <span v-else></span>
@@ -102,14 +102,13 @@
         </el-table-column>
         <el-table-column prop="onWorkResult" label="上班打卡状态" width="180">
           <template slot-scope="{ row }">
-            <span v-if="row.onWorkStatus == 1 && row.onWorkResult == 0">
+            <span v-if="row.onWorkStatus == '1' && row.onWorkResult == '0'">
               {{ row.onWorkResultN }}
             </span>
             <span
               v-else-if="
-                row.onWorkStatus == 1 &&
-                row.onWorkResult != 1 &&
-                row.onWorkResult != 0
+                row.onWorkStatus == '1' &&
+                (row.onWorkResult =='2' || row.onWorkResult =='3')
               "
             >
               {{ row.onWorkResultN }} {{ row.onLateLeaveMinuteN }}
@@ -119,24 +118,23 @@
         </el-table-column>
         <el-table-column prop="offWorkRecordTime" label="下班打卡时间" width="180"
           ><template slot-scope="{ row }">
-            <span v-if="row.offWorkStatus == 1 && row.offWorkResult != 0">
+            <span v-if="row.offWorkStatus == '1' && row.offWorkResult != '0'">
               {{ row.offWorkRecordTime }}</span
             >
             <span v-else> </span> </template
         ></el-table-column>
-        <el-table-column prop="offWorkResult" label="下班" width="180">
+        <el-table-column prop="offWorkResult" label="下班打卡状态" width="180">
           <template slot-scope="{ row }">
-            <span v-if="row.offWorkStatus == 1 && row.offWorkResult == 0">
+            <span v-if="row.offWorkStatus == '1' && row.offWorkResult == '0'">
               {{ row.offWorkResultN }}
             </span>
             <span
               v-if="
-                row.offWorkStatus == 1 &&
-                row.offWorkResult != 1 &&
-                row.offWorkResult != 0
+                row.offWorkStatus == '1' &&
+                (row.offWorkResult == '2' || row.offWorkResult == '3')
               "
             >
-              {{ row.offWorkResultN }} {{ row.OffLateLeaveMinuteN }}
+              {{ row.offWorkResultN }} {{ row.offLateLeaveMinuteN }}
             </span>
             <span v-else></span>
           </template>
@@ -198,40 +196,50 @@ export default {
       var rows = JSON.parse(JSON.stringify(this.tableData));
 
       rows.forEach(row=>{
+        //非上班状态并且未正常打卡,则显示当前工作状态
         if(row.onWorkStatus != "1" &&
            row.onWorkResult != "1" &&
            row.onWorkStatus != null){
            rows.shiftNumbers = row.onWorkStatusN;
         }
         
+        //非上班状态或者缺卡,则上班考勤时间不显示
         if(row.onWorkStatus != "1" || row.onWorkResult == "0"){
           row.onWorkRecordTime = "";
         }
 
+        //如果是上班状态且上班缺卡
         if(row.onWorkStatus == "1" && row.onWorkResult == "0"){
           row.onWorkResult = row.onWorkResultN;
         }
-        else if(row.onWorkStatus == "1" &&
-                row.onWorkResult != "1" &&
-                row.onWorkResult != "0"){
+        else if(row.onWorkStatus == "1" 
+            && (row.onWorkResult == "2" || row.onWorkResult == "3")
+        ){
+          //如果是上班状态但上班迟到或早退
           row.onWorkResult = row.onWorkResultN + ' ' + row.onLateLeaveMinuteN;
         }
         else{
-          row.onWorkStatus = "";
+          row.onWorkResult = "";
         }
 
-        if(row.offWorkStatus=="0"){
+        //非上班状态或者缺卡,则下班考勤时间不显示
+        if(row.offWorkStatus != "1" || row.offWorkResult == "0"){
           row.offWorkRecordTime = "";
         }
 
-        if(row.offWorkStatus == 1 && row.offWorkResult == 0){
+        //如果是上班状态且下班缺卡
+        if(row.offWorkStatus == "1" && row.offWorkResult == "0"){
           row.offWorkResult = row.offWorkResultN;
         }
-        else if(row.offWorkStatus == 1 &&
-                row.offWorkResult != 1 &&
-                row.offWorkResult != 0){
+        else if(row.offWorkStatus == "1" 
+            && (row.offWorkResult == "2" || row.offWorkResult == "3")
+        ){
+          //如果是上班状态但下班迟到或早退
           row.offWorkResult = row.offWorkResultN + ' ' + row.offLateLeaveMinuteN;
         }
+        else{
+          row.offWorkResult = "";
+        }
       });
 
       pageUtil.printTable(rows,
@@ -241,11 +249,7 @@ export default {
         { field: 'onWorkRecordTime', displayName: '上班打卡时间'},
         { field: 'onWorkResult', displayName: '上班打卡状态'},
         { field: 'offWorkRecordTime', displayName: '下班打卡时间'},
-        { field: 'lateMinutes', displayName: '下班打卡状态'},
-        { field: 'absenteeismDays', displayName: '迟到次数'},
-        { field: 'leaveEarlyMinutes', displayName: '早退分钟'},
-        { field: 'leaveEarlyNum', displayName: '早退次数'},
-        { field: 'overtime', displayName: '加班小时'},
+        { field: 'offWorkResult', displayName: '下班打卡状态'},
         { field: 'absenteeismDays', displayName: '旷工天数'},
         { field: 'notSwipingNum', displayName: '未打卡次数'}
       ],title);

+ 19 - 6
src/views/business/workScheduleAttendance-list.vue

@@ -111,13 +111,13 @@
       <el-table-column
         prop="personInfo.id"
         label="编号"
-        width="60"
+        width="80"
         fixed="left"
       ></el-table-column>
       <el-table-column
         prop="personInfo.jobNumber"
         label="工号"
-        width="60"
+        width="80"
         fixed="left"
       ></el-table-column>
       <el-table-column
@@ -169,7 +169,7 @@
       <el-table-column
         prop="notSwipingNum"
         label="未打卡次数"
-        width="80"
+        width="100"
       ></el-table-column>
       <el-table-column
         prop="signNum"
@@ -497,11 +497,24 @@ export default {
     },
     printReport() {
       var title = "考勤统计表";
-      pageUtil.printTable(this.tableData,
+
+      var rows = JSON.parse(JSON.stringify(this.tableData));
+
+      var index = 0;
+
+      rows.forEach(row=>{
+        row.index = ++index;
+
+        if(row.personInfo.jobNumber==null){
+          row.personInfo.jobNumber = "";
+        }
+      });
+
+      pageUtil.printTable(rows,
       [
-        { field: 'personInfo.id', displayName: '编号'},
+        { field: 'index', displayName: '序号'},
         { field: 'personInfo.jobNumber', displayName: '工号'},
-        { field: 'personInfo.name', displayName: '姓名'},
+        { field: 'personInfo.name', displayName: '姓名', columnSize: '8%'},
         { field: 'attendanceDays', displayName: '应出勤天数'},
         { field: 'totalAttendanceDays', displayName: '全勤天数'},
         { field: 'lateMinutes', displayName: '迟到分钟'},