| | |
| | | placeholder="员工" |
| | | :show-all-levels="false" |
| | | :collapse-tags="true" |
| | | @change="changeUserList" |
| | | class="cascader-item" |
| | | @change="changeUserList" |
| | | /> |
| | | <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 |
| | |
| | | <el-input v-model="query.name" filterable clearable placeholder="任务名称" style="width: 185px; margin-top: 6px;" class="filter-item" /> |
| | | |
| | | <rrOperation :crud="crud" /> |
| | | |
| | | <div style="color: red;">*检索条件【所属项目】仅包含状态为【进行中】的项目</div> |
| | | </div> |
| | | <!--表格渲染--> |
| | | <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"> |
| | |
| | | {{ scope.row.taskProgress }}% |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column v-if="checkPer(['task:businessLeader'])" :show-overflow-tooltip="true" prop="taskUserMongo.taskHours" label="计划工时" min-width="80px" /> |
| | | <el-table-column v-if="checkPer(['task:businessLeader'])" :show-overflow-tooltip="true" prop="accumulateHours" label="累计工时" min-width="80px" /> |
| | | <el-table-column :show-overflow-tooltip="true" prop="settlementStatus" min-width="80px" label="绩效类型"> |
| | | <template slot-scope="scope"> |
| | | <el-tag>{{ scope.row.taskUserMongo.performanceType === "1" ? "绩效" : "非绩效" }}</el-tag> |
| | |
| | | import crudTaskDaliy from '@/api/task/taskDaliy' |
| | | import CRUD, { presenter, header, form, crud } from '@crud/crud' |
| | | import rrOperation from '@crud/RR.operation' |
| | | import crudOperation from '@crud/CRUD.operation' |
| | | import udOperation from '@crud/UD.operation' |
| | | import pagination from '@crud/Pagination' |
| | | import { mapGetters } from 'vuex' |
| | | import constant from '@/utils/constant' |
| | |
| | | const defaultForm = { id: null, projectId: null, taskId: null, taskName: null, taskMongoId: null, taskUserMongo: {}, userId: null, fillDate: null, consumedHours: null, todayFixedHours: 0, todayAttendanceHours: 0, alreadyConsumedHours: 0, taskHours: 0, consumedWorkload: null, consumedWorkloadUnit: null, taskProgress: null, settlementStatus: constant.SETTLEMENT_STATUS_UNSETTLED, remarks: null, createBy: null, createTime: null, updateBy: null, updateTime: null } |
| | | export default { |
| | | name: 'OtherDaliy', |
| | | components: { pagination, crudOperation, rrOperation, udOperation }, |
| | | components: { pagination, rrOperation }, |
| | | mixins: [presenter(), header(), form(defaultForm), crud()], |
| | | dicts: [constant.STANDARD_WORKLOAD_UNIT, constant.SETTLEMENT_STATUS], |
| | | cruds() { |
| | |
| | | options: [], |
| | | selectedValue: [], |
| | | |
| | | props: { multiple: true }, |
| | | props: { multiple: true } |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | ]) |
| | | }, |
| | | mounted() { |
| | | this.getUser(); |
| | | this.getQueryProject(); |
| | | this.getUser() |
| | | this.getQueryProject() |
| | | }, |
| | | methods: { |
| | | changeUserList(e) { |
| | |
| | | getQueryProject() { |
| | | this.loadingProject = true |
| | | this.queryProjects = [] |
| | | // 获取项目 |
| | | crudProject.getAll({projectStatusIn: 'project_status_not_started', projectStatusIn: 'project_status_under_way'}).then(res => { |
| | | // 获取项目(liableUserId传''用于占位) |
| | | crudProject.getAll({ projectStatusIn: ['project_status_under_way'], liableUserId: this.checkPer(['task:businessLeader']) ? '' : null }).then(res => { |
| | | // 检索项目列表 |
| | | this.queryProjects = res |
| | | this.loadingProject = false |
| | |
| | | }, |
| | | // 表格工时汇总 |
| | | getSummaries(param) { |
| | | const { columns, data } = param; |
| | | const sums = []; |
| | | sums[0] = '合计'; |
| | | 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 (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] += ' 小时'; |
| | | const value = Number(curr) |
| | | if (!isNaN(value)) { |
| | | return prev + curr |
| | | } else { |
| | | return prev |
| | | } |
| | | }, 0) |
| | | sums[index] += ' 小时' |
| | | } else { |
| | | sums[index] = ''; |
| | | sums[index] = '' |
| | | } |
| | | } |
| | | }); |
| | | return sums; |
| | | }) |
| | | return sums |
| | | } |
| | | } |
| | | } |