| | |
| | | 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 |
| | |
| | | <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"> |
| | |
| | | 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> |
| | |
| | | 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> |