瀏覽代碼

提交代码

Lijy 1 年之前
父節點
當前提交
b55f02d1d2
共有 1 個文件被更改,包括 20 次插入4 次删除
  1. 20 4
      fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

+ 20 - 4
fhKeeper/formulahousekeeper/timesheet/src/views/workReport/daily.vue

@@ -1387,8 +1387,8 @@
       :visible.sync="monthWorkTimeDialog"
       :close-on-click-modal="false"
       customClass="customWidth selectworktime"
-      width="1200px"
-      title=""
+      width="92%"
+      top="60px"
     >
       <!-- <el-input style="width:100%" v-model="filterName" placeholder="请输入姓名搜索" @change="findUserInTree"></el-input> -->
       <el-tabs v-model="activeName" @tab-click="handleClick">
@@ -1442,6 +1442,7 @@
             style="width: 100%"
             v-loading="tbload"
             :lazy="true"
+            :cell-style="hasworkTblCellStyle"
           >
             <el-table-column width="75" type="index" fixed="left" :label="$t('headerTop.serialNumber')">
               <template slot-scope="scope">
@@ -1473,7 +1474,6 @@
             >
               <template slot-scope="scope">
                 <div
-                  style="color: red"
                   v-if="
                     scope.row.worktimeList.filter(
                       (w) =>
@@ -1491,7 +1491,6 @@
                   }}
                 </div>
                 <div
-                  style="color: #20a0ff"
                   v-if="
                     scope.row.worktimeList.filter(
                       (w) =>w.createDate==item.date
@@ -2545,6 +2544,23 @@
         },
         methods: {
             ...mapMutations(['upDataLoading']),
+            // 已填工时情况表设置背景色
+            hasworkTblCellStyle({ columnIndex, row, column }) {
+                if(columnIndex > 2) {
+                    const dateSingle = this.pickDateArray[columnIndex - 3].date
+                    const worktimeList = row.worktimeList || []
+                    const times = this.reportTimeType.allday
+                    const filterData = worktimeList.filter(item => item.createDate == dateSingle)
+
+                    const isWorkDate = filterData[0] && filterData[0].workingTime
+                    if(isWorkDate < times) {
+                        return "backgroundColor: #FC3D49"
+                    }
+                    if(isWorkDate > times) {
+                        return "backgroundColor: #20a0ff"
+                    }
+                }
+            },
             // 判断当前账号是否有某一块定制权限(返回 boolean 类型)
             isCustomization(userInfo, permissionArray) {
                 const { companyId } = userInfo