<template>
|
<div class="app-container">
|
<div class="head-container">
|
<div>
|
<!-- 搜索 -->
|
<el-date-picker
|
v-model="query.fillDates"
|
type="daterange"
|
clearable
|
class="filter-item"
|
value-format="yyyy-MM-dd"
|
placeholder="请选择日报日期"
|
range-separator=" ~ "
|
start-placeholder="开始日期"
|
end-placeholder="结束日期"
|
style="width: 285px; margin-top: 6px;"
|
/>
|
<el-cascader
|
v-model="selectedValue"
|
:filterable="true"
|
:options="options"
|
:props="props"
|
clearable
|
placeholder="员工"
|
:show-all-levels="false"
|
style="width: 200px;"
|
@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
|
v-for="item in queryProjects"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
/>
|
</el-select>
|
<el-select v-model="query.taskMongoId" filterable clearable placeholder="所属任务" :loading="loadingTask" style="width: 185px; margin-top: 6px;" class="filter-item">
|
<el-option
|
v-for="item in queryTasks"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
/>
|
</el-select>
|
<el-input v-model="query.name" filterable clearable placeholder="任务名称" style="width: 185px; margin-top: 6px;" class="filter-item" />
|
|
<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-column type="selection" width="55" />
|
<el-table-column :show-overflow-tooltip="true" prop="fillDate" label="填写日期" fixed="left" min-width="100px">
|
<template slot-scope="scope">
|
{{ crud.toDate(scope.row.fillDate) }}
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" fixed="left" min-width="100px">
|
<template slot-scope="scope">
|
<el-tag>{{ scope.row.userNickName }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="projectName" label="所属项目" min-width="140px">
|
<template slot-scope="scope">
|
<el-tag>{{ scope.row.projectName }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="taskName" label="所属任务" min-width="180px">
|
<template slot-scope="scope">
|
<el-tag>{{ scope.row.taskName }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="taskUserMongo.name" label="分配任务" min-width="180px">
|
<template slot-scope="scope">
|
<el-tag>{{ scope.row.taskUserMongo.name }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="consumedHours" label="消耗工时" min-width="80px" />
|
<el-table-column :show-overflow-tooltip="true" prop="taskProgress" label="任务进度" min-width="80px">
|
<template slot-scope="scope">
|
{{ scope.row.taskProgress }}%
|
</template>
|
</el-table-column>
|
<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>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="remarks" label="备注" min-width="140px" />
|
</el-table>
|
<!--分页组件-->
|
<pagination />
|
</div>
|
</div>
|
</template>
|
|
<script>
|
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'
|
import crudProject from '@/api/project/project'
|
import crudTask from '@/api/task/task'
|
import crudUser from '@/api/system/user'
|
|
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 },
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
dicts: [constant.STANDARD_WORKLOAD_UNIT, constant.SETTLEMENT_STATUS],
|
cruds() {
|
return CRUD({ title: '员工任务日报', url: 'api/taskDaliy/4dept', idField: 'id', sort: 'fillDate,desc', crudMethod: { ...crudTaskDaliy }})
|
},
|
data() {
|
return {
|
permission: {
|
add: ['admin', 'taskDaliy:add'],
|
edit: ['admin', 'taskDaliy:edit'],
|
del: ['admin', 'taskDaliy:del'],
|
download: ['admin', 'taskDaliy:download']
|
},
|
queryTypeOptions: [
|
{ key: 'userId', display_name: '所属员工' },
|
{ key: 'projectId', display_name: '所属项目' },
|
{ key: 'taskId', display_name: '所属任务' },
|
{ key: 'taskUserId', display_name: '分配任务' },
|
{ key: 'TaskUserName', display_name: '任务名称' },
|
{ key: 'taskMongoId', display_name: '任务名称' }
|
],
|
// 字典:结算状态
|
settlementStatus: constant.SETTLEMENT_STATUS,
|
// 字典:绩效对象
|
performanceType: constant.PERFORMANCE_TYPE,
|
// 用户列表
|
users: [],
|
// 检索项目列表
|
queryProjects: [],
|
// 检索任务列表
|
queryTasks: [],
|
loadingProject: true,
|
loadingTask: false,
|
|
options: [],
|
selectedValue: [],
|
|
props: { multiple: true },
|
}
|
},
|
computed: {
|
...mapGetters([
|
'user'
|
])
|
},
|
mounted() {
|
this.getUser();
|
this.getQueryProject();
|
},
|
methods: {
|
changeUserList(e) {
|
var tempList = []
|
for (let i = 0; i < e.length; i++) {
|
var temp = e[i]
|
tempList.push(temp[e[i].length - 1])
|
}
|
this.query.userIds = tempList
|
},
|
// 获取用户
|
getUser() {
|
// 获取用户
|
crudUser.getAll().then(res => {
|
// 用户列表
|
this.users = res
|
})
|
|
crudUser.getUserDept().then(res => {
|
this.options = res
|
})
|
},
|
// 获取检索项目
|
getQueryProject() {
|
this.loadingProject = true
|
this.queryProjects = []
|
// 获取项目
|
crudProject.getAll({projectStatusIn: 'project_status_not_started', projectStatusIn: 'project_status_under_way'}).then(res => {
|
// 检索项目列表
|
this.queryProjects = res
|
this.loadingProject = false
|
})
|
},
|
// 检索项目变更
|
queryProjectChange() {
|
this.queryTasks = []
|
this.loadingTask = true
|
// 检索赋值
|
this.$set(this.query, 'taskId', null)
|
// 判断检索项目是否为空
|
if (this.query.projectId === null || this.query.projectId === '') {
|
// 检索任务列表
|
this.queryTasks = []
|
} else {
|
// 获取任务
|
crudTask.getAll({ projectId: this.query.projectId }).then(res => {
|
// 检索任务列表
|
this.queryTasks = res
|
this.loadingTask = false
|
})
|
}
|
},
|
clearQueryTasks() {
|
this.loadingTask = false
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
adventTable tr:first-child {
|
display: none;
|
}
|
</style>
|