Browse Source

提交代码

Lijy 1 year ago
parent
commit
b55f02d1d2

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

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