BAOLH
2025-08-06 bab770dc19cb25fc7bc63bcb4a877d49a853f59c
Merge branch 'dengjh-2507-update' of http://192.168.1.110:5678/r/pms-upgrade into dengjh-2507-update
1 files modified
53 ■■■■■ changed files
eladmin-web-master/src/views/task/other/other.vue 53 ●●●●● patch | view | raw | blame | history
eladmin-web-master/src/views/task/other/other.vue
@@ -23,8 +23,9 @@
          clearable
          placeholder="员工"
          :show-all-levels="false"
          style="width: 200px;"
          :collapse-tags="true"
          @change="changeUserList"
          class="cascader-item"
        />
        <el-select v-model="query.projectId" filterable clearable placeholder="所属项目" :loading="loadingProject" style="width: 185px; margin-top: 6px;" class="filter-item" @change="queryProjectChange" @clear="clearQueryTasks">
          <el-option
@@ -47,7 +48,7 @@
        <rrOperation :crud="crud" />
      </div>
      <!--表格渲染-->
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
      <el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" :summary-method="getSummaries" show-summary @selection-change="crud.selectionChangeHandler">
        <el-table-column type="selection" width="55" />
        <el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px">
          <template slot-scope="scope">
@@ -213,6 +214,31 @@
    clearQueryTasks() {
      this.loadingTask = false
    },
    // 表格工时汇总
    getSummaries(param) {
      const { columns, data } = param;
      const sums = [];
      sums[0] = '合计';
      columns.forEach((column, index) => {
        if(column.property === 'consumedHours') {
          const values = data.map(item => Number(item[column.property]));
          if (!values.every(value => isNaN(value))) {
            sums[index] = values.reduce((prev, curr) => {
            const value = Number(curr);
            if (!isNaN(value)) {
              return prev + curr;
            } else {
              return prev;
            }
          }, 0);
            sums[index] += ' 小时';
          } else {
            sums[index] = '';
          }
        }
      });
      return sums;
    }
  }
}
</script>
@@ -221,4 +247,27 @@
  adventTable tr:first-child {
    display: none;
  }
  .cascader-item >>> .el-input__inner {
    height: 29.5px !important;
    line-height: 29.5px !important;
  }
  .cascader-item >>> .el-cascader__search-input {
    height: 20px !important;
    margin: 2px 0px 0px 15px !important;
  }
  .cascader-item >>> .el-tag {
    margin-top: 4.5px;
  }
  .cascader-item >>> .el-input__suffix {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-input--small {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-cascader__tags {
    height: 29.5px !important;
  }
  .cascader-item >>> .el-input--small {
    height: 29.5px !important;
  }
</style>