<template>
|
<div class="app-container">
|
<!--工具栏-->
|
<div class="head-container">
|
<div>
|
<!-- 搜索 -->
|
<el-select v-model="query.projectId" value-key="id" clearable filterable placeholder="所属项目" style="width: 250px;"
|
class="filter-item" @keyup.enter.native="crud.toQuery">
|
<el-option v-for="item in projects" :key="item.id" :label="item.name" :value="item">
|
<span style="float: left">{{ item.name }}</span>
|
</el-option>
|
</el-select>
|
<el-select v-model="query.userId" filterable clearable placeholder="所属员工" style="width: 185px;"
|
class="filter-item" @keyup.enter.native="crud.toQuery">
|
<el-option v-for="item in users" :key="item.id" :label="item.nickName" :value="item.id" />
|
</el-select>
|
<el-select v-model="query.taskStatus" filterable clearable multiple collapse-tags placeholder="任务状态"
|
style="width: 185px;" class="filter-item" @keyup.enter.native="crud.toQuery">
|
<el-option v-for="item in dict[taskStatus]" :key="item.id" :label="item.label" :value="item.value" />
|
</el-select>
|
<rrOperation :crud="crud" />
|
</div>
|
</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="projectName" label="项目名称" fixed="left" width="270">
|
<template slot-scope="scope">
|
<el-tag slot="reference">{{ scope.row.projectName }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="name" label="名称" fixed="left" width="270">
|
<template slot-scope="scope">
|
<el-tag slot="reference">{{ scope.row.name }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="taskStartDate" label="任务开始时间" width="140" />
|
<el-table-column :show-overflow-tooltip="true" prop="taskEndDate" label="任务结束时间" width="140" />
|
<el-table-column :show-overflow-tooltip="true" prop="taskHours" label="任务工时" width="80" />
|
<el-table-column :show-overflow-tooltip="true" prop="userNickName" label="所属员工" width="100">
|
<template slot-scope="scope">
|
<el-tag v-if="scope.row.userNickName">{{
|
scope.row.userNickName
|
}}</el-tag>
|
<el-tag v-else>未指定</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="performanceType" label="绩效类型" width="80">
|
<template slot-scope="scope">
|
<el-tag>{{ dict.label[performanceType][scope.row.performanceType] }}</el-tag>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="performanceHours" label="分配工时" width="80" />
|
<el-table-column :show-overflow-tooltip="true" prop="costHours" label="消耗工时" width="80" />
|
<el-table-column :show-overflow-tooltip="true" label="任务进度" width="80">
|
<template slot-scope="scope">
|
<span style="margin-left: 10px">{{ scope.row.newTaskProgress }}%</span>
|
</template>
|
</el-table-column>
|
<el-table-column :show-overflow-tooltip="true" prop="taskStatus" label="任务状态" width="80">
|
<template slot-scope="scope">
|
<el-tag>{{
|
dict.label[taskStatus][scope.row.taskStatus]
|
}}</el-tag>
|
</template>
|
</el-table-column>
|
</el-table>
|
<!--分页组件-->
|
<pagination />
|
</div>
|
</template>
|
<script>
|
import crudTaskUser from "@/api/task/taskUser";
|
import crudTask from "@/api/task/task";
|
import crudUser from "@/api/system/user";
|
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 DateRangePicker from "@/components/DateRangePicker";
|
import Treeselect from "@riophae/vue-treeselect";
|
import { mapGetters } from "vuex";
|
import constant from "@/utils/constant";
|
import UploadExcelComponent from "@/components/UploadExcel/index.vue";
|
import UploadExcelComponentTwo from "@/components/UploadExcel/excelIndex.vue";
|
const defaultForm = {
|
id: null,
|
name: null,
|
userId: null,
|
projectId: null,
|
task: { id: null, name: null },
|
taskStartDate: null,
|
taskEndDate: null,
|
taskHours: null,
|
performanceHours: null,
|
newTaskProgress: null,
|
taskStatus: null,
|
remarks: null,
|
divideUserIds: [],
|
is_ok: null
|
};
|
export default {
|
name: "HomePage",
|
components: {
|
Treeselect,
|
crudOperation,
|
rrOperation,
|
udOperation,
|
pagination,
|
DateRangePicker,
|
UploadExcelComponent,
|
UploadExcelComponentTwo
|
},
|
cruds() {
|
return CRUD({
|
title: "任务分配",
|
url: "api/taskUser",
|
crudMethod: { ...crudTaskUser }
|
});
|
},
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
// 数据字典
|
dicts: [
|
constant.TASK_STATUS,
|
constant.TAST_CLASSIFICATION,
|
constant.STANDARD_WORKLOAD_UNIT,
|
constant.PERFORMANCE_TYPE
|
],
|
data() {
|
return {
|
projectId: null,
|
projectDatas: [],
|
taskName: "",
|
selectedTaskName: "",
|
planStartTime: null,
|
planEndTime: null,
|
taskTotal: {},
|
taskDatas: [],
|
taskLoading: false,
|
defaultProps: { children: "nodes", label: "name", isLeaf: "leaf" },
|
permission: {
|
list: ["admin", "taskUser:list"],
|
},
|
queryTypeOptions: [
|
{ key: "userId", display_name: "所属员工" },
|
{ key: "taskStatus", display_name: "任务状态" },
|
{ key: "createTime", display_name: "创建时间" }
|
],
|
// 字典:任务状态
|
taskStatus: constant.TASK_STATUS,
|
// 字典:任务分类
|
taskClassification: constant.TAST_CLASSIFICATION,
|
// 字典:标准工作量单位
|
standardWorkloadUnit: constant.STANDARD_WORKLOAD_UNIT,
|
// 字典:绩效对象
|
performanceType: constant.PERFORMANCE_TYPE,
|
// 字典:批准状态-未承认
|
approveStatusUnrecognized: constant.APPROVE_STATUS_UNRECOGNIZED,
|
// CRUD状态
|
crudStatusPrepared: CRUD.STATUS.PREPARED,
|
Is_ok: false,
|
generateForm: [],
|
tableHeader: [],
|
users: [],
|
// 项目列表
|
projects: [],
|
// 检索任务列表
|
queryTasks: [],
|
// 表单任务列表
|
formTasks: [],
|
selectedTask: "",
|
dialogVisible_taskUser: false,
|
dialogLoading_taskUser: true,
|
taskLoading_L: true,
|
dialogVisible_task: false,
|
dialogVisible_task_LQ: false,
|
dialogLoading_task: true,
|
dialogLoading_task_LQ: true,
|
steps: [],
|
TaskName: "",
|
expectedHours: "",
|
actualHours: "",
|
taskUserDetail: {},
|
taskDetail: {},
|
taskProgress: "",
|
ProgressStatus: "",
|
advList: [],
|
tobeOver: "first",
|
tobeTasked: "任务详细",
|
total: 0,
|
currentPage: 1,
|
pageSize: 10,
|
slong: false,
|
taskSo: constant.TASK_STATUS_UNRECOGNIZED,
|
taskSt: constant.TASK_STATUS_COMPLETED,
|
taskStatusOne: ''
|
};
|
},
|
computed: {
|
...mapGetters(["user"])
|
},
|
mounted() {
|
this.getAllProjectDatas();
|
},
|
methods: {
|
getAllProjectDatas() {
|
crudTask.getProjects().then(res => {
|
this.projectDatas = res;
|
});
|
},
|
}
|
};
|
</script>
|
|
<style rel="stylesheet/scss" lang="scss">
|
.hide-time .el-button--text {
|
display: none;
|
}
|
|
.tree-scroll {
|
height: 100%;
|
width: 100%;
|
}
|
|
.flow-tree {
|
overflow-x: hidden;
|
overflow-y: auto;
|
max-height: 600px;
|
width: 100%;
|
|
>>>.el-tree-node {
|
>.el-tree-node__children {
|
overflow-y: visible !important;
|
}
|
|
>.el-tree-node__content {
|
height: 100%;
|
}
|
}
|
}
|
|
::v-deep .vue-treeselect__control,
|
::v-deep .vue-treeselect__placeholder,
|
::v-deep .vue-treeselect__single-value {
|
height: 40px;
|
line-height: 40px;
|
}
|
|
.active {
|
/* 添加长亮效果的样式 */
|
color: #1890ff;
|
}
|
</style>
|