|
@@ -33,12 +33,22 @@
|
|
|
|
|
|
<el-form-item :label="'项目'">
|
|
|
<div style="margin-left: 8px">
|
|
|
- <el-select v-model="screenProjectId" style="width:150px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="screenProjectChange">
|
|
|
+ <el-select v-model="screenProjectId" filterable style="width:150px;" size="small" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="screenProjectChange">
|
|
|
<el-option v-for="item in allProjectList" :key="item.id" :label="item.projectName" :value="item.id"></el-option>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
|
|
|
+ <el-form-item :label="'部门'">
|
|
|
+ <div style="margin-left: 8px">
|
|
|
+ <el-cascader v-if="user.userNameNeedTranslate != 1" v-model="screenDeptId" :placeholder="$t('defaultText.pleaseChoose')" style="width: 125px"
|
|
|
+ :options="departmentList" :props="{ checkStrictly: false,expandTrigger: 'hover' }" :show-all-levels="false" clearable
|
|
|
+ @change="getList()" size="mini"></el-cascader>
|
|
|
+
|
|
|
+ <vueCascader :size="'mini'" :widthStr="'125'" :clearable="true" :subject="departmentList" :radios="false" :distinction="'1'" @vueCasader="vueCasader" v-if="user.userNameNeedTranslate == 1"></vueCascader>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+
|
|
|
<el-form-item :label="'任务分组'">
|
|
|
<div style="margin-left: 8px">
|
|
|
<el-select v-model="screenTaskGroupingId" style="width:150px;" size="small" :disabled="!screenProjectId" slot="prepend" :placeholder="$t('defaultText.pleaseChoose')" clearable @change="hiddens()">
|
|
@@ -82,6 +92,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right;" v-if="user.companyId != '3092'">
|
|
|
<el-link type="primary" icon="el-icon-circle-plus-outline" :underline="false" @click="addTask()">新建任务</el-link>
|
|
|
+ <el-link type="primary" :underline="false" @click="exportTaskList()" style="margin-left: 20px;" v-loading="exportTaskLoading">导出</el-link>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</el-col>
|
|
@@ -103,7 +114,7 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column prop="stagesName" :label="$t('taskstage')" sortable width="180" @mouseover="mouseOver">
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="taskLevel" label="优先级" sortable width="180">
|
|
|
+ <el-table-column prop="taskLevel" label="优先级" sortable width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<span v-if="scope.row.taskLevel == 0">一般</span>
|
|
@@ -140,11 +151,6 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
<el-table-column prop="executorName" :label="$t('zhi-hang-ren')" sortable width="130">
|
|
|
<template slot-scope="scope">
|
|
|
<!-- <el-link type="primary" @click="showUser(scope.row.executorId)">{{scope.row.executorName}}</el-link> -->
|
|
@@ -159,6 +165,11 @@
|
|
|
</el-table-column>
|
|
|
|
|
|
<el-table-column prop="startDate" :label="$t('starttimes')" sortable width="180"></el-table-column>
|
|
|
+ <el-table-column prop="projectName" :label="$t('headerTop.projectName')" sortable width="260" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link type="primary" :href="'#/projectInside/'+scope.row.projectId">{{scope.row.projectName}}</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="endDate" :label="$t('deadline')" width="310" fixed="right" sortable>
|
|
|
<template slot-scope="scope">
|
|
|
<div style="display: flex;justify-content: space-between;padding-right: 40px">
|
|
@@ -468,6 +479,9 @@ import { error } from 'dingtalk-jsapi';
|
|
|
|
|
|
// 引入自定义组件
|
|
|
import selectCat from "@/components/select.vue"
|
|
|
+ // 引入自定义级联组件
|
|
|
+ import vueCascader from "@/components/cascader.vue"
|
|
|
+ import cascaderOption from "@/components/cascaderOption.vue"
|
|
|
|
|
|
import taskComponent from "@/components/taskComponent.vue"
|
|
|
|
|
@@ -491,7 +505,9 @@ import { error } from 'dingtalk-jsapi';
|
|
|
// Earning,
|
|
|
quillEditor, // 富文本
|
|
|
selectCat,
|
|
|
- taskComponent
|
|
|
+ taskComponent,
|
|
|
+ vueCascader,
|
|
|
+ cascaderOption
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -639,7 +655,9 @@ import { error } from 'dingtalk-jsapi';
|
|
|
screenProjectId: '',
|
|
|
screenTaskGroupingId: '',
|
|
|
screenPersonnelId: '',
|
|
|
- allProjectList: []
|
|
|
+ allProjectList: [],
|
|
|
+ exportTaskLoading: false,
|
|
|
+ screenDeptId: [],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
@@ -782,6 +800,57 @@ import { error } from 'dingtalk-jsapi';
|
|
|
}
|
|
|
this.addSubProject = true;
|
|
|
},
|
|
|
+ exportTaskList(){
|
|
|
+ let parameter = {
|
|
|
+ status: this.searchField,
|
|
|
+ viewId: this.idx,
|
|
|
+ pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
+ // type: this.typeField
|
|
|
+ projectId: this.screenProjectId,
|
|
|
+ groupId: this.screenTaskGroupingId,
|
|
|
+ targetUserId: this.screenPersonnelId
|
|
|
+ }
|
|
|
+ if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
|
|
|
+ parameter.type = this.typeField
|
|
|
+ }
|
|
|
+ if(this.dateSelect != null && this.dateSelect.length != 0){
|
|
|
+ parameter.dateType = this.dateType
|
|
|
+ parameter.startDate = this.dateSelect[0]
|
|
|
+ parameter.endDate = this.dateSelect[1]
|
|
|
+ }
|
|
|
+ if(this.deptId.length > 0) {
|
|
|
+ parameter.deptId = this.deptId[this.deptId.length - 1]
|
|
|
+ } else {
|
|
|
+ parameter.deptId = ''
|
|
|
+ }
|
|
|
+ this.http.post('/task/exportTaskList', parameter,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ var filePath = res.data;
|
|
|
+ var fName = '待办任务导出.xlsx'
|
|
|
+ const a = document.createElement('a'); // 创建a标签
|
|
|
+ a.setAttribute('download', fName);// download属性
|
|
|
+ a.setAttribute('href', filePath);// href链接
|
|
|
+ a.click(); //自执行点击事件
|
|
|
+ a.remove();
|
|
|
+ this.exportLoading = false
|
|
|
+ this.byQuarterDialog = false
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
//显示子项目
|
|
|
subProject(item) {
|
|
|
this.subProjectVisible = true;
|
|
@@ -902,7 +971,7 @@ import { error } from 'dingtalk-jsapi';
|
|
|
|
|
|
//获取项目列表
|
|
|
getList() {
|
|
|
- console.log('执行函数')
|
|
|
+ console.log('执行函数', this.screenDeptId)
|
|
|
this.listLoading = true;
|
|
|
let parameter = {
|
|
|
status: this.searchField,
|
|
@@ -914,6 +983,7 @@ import { error } from 'dingtalk-jsapi';
|
|
|
groupId: this.screenTaskGroupingId,
|
|
|
targetUserId: this.screenPersonnelId
|
|
|
}
|
|
|
+ console.log(parameter)
|
|
|
if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
|
|
|
parameter.type = this.typeField
|
|
|
}
|
|
@@ -930,6 +1000,9 @@ import { error } from 'dingtalk-jsapi';
|
|
|
} else {
|
|
|
parameter.deptId = ''
|
|
|
}
|
|
|
+ if(this.screenDeptId.length > 0) {
|
|
|
+ parameter.deptId = this.screenDeptId[this.screenDeptId.length - 1]
|
|
|
+ }
|
|
|
this.http.post('/task/listByPage', parameter,
|
|
|
res => {
|
|
|
this.listLoading = false;
|
|
@@ -962,6 +1035,59 @@ import { error } from 'dingtalk-jsapi';
|
|
|
})
|
|
|
},
|
|
|
|
|
|
+ // 导出任务
|
|
|
+ exportTask() {
|
|
|
+ // console.log('执行代码')
|
|
|
+ this.exportTaskLoading = true
|
|
|
+ let url = '' // 导出连接
|
|
|
+ let parameter = {
|
|
|
+ status: this.searchField,
|
|
|
+ viewId: this.idx,
|
|
|
+ pageIndex: this.page,
|
|
|
+ pageSize: this.size,
|
|
|
+ // type: this.typeField
|
|
|
+ projectId: this.screenProjectId,
|
|
|
+ groupId: this.screenTaskGroupingId,
|
|
|
+ targetUserId: this.screenPersonnelId
|
|
|
+ }
|
|
|
+ if(this.typeField != 'null' && this.typeField != null && this.typeField != '') {
|
|
|
+ parameter.type = this.typeField
|
|
|
+ }
|
|
|
+ if(this.dateSelect != null && this.dateSelect.length != 0){
|
|
|
+ parameter.dateType = this.dateType
|
|
|
+ parameter.startDate = this.dateSelect[0]
|
|
|
+ parameter.endDate = this.dateSelect[1]
|
|
|
+ }
|
|
|
+ if(this.deptId.length > 0) {
|
|
|
+ parameter.deptId = this.deptId[this.deptId.length - 1]
|
|
|
+ } else {
|
|
|
+ parameter.deptId = ''
|
|
|
+ }
|
|
|
+ this.http.post(url, parameter,
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.exportTaskLoading = false;
|
|
|
+ var aTag = document.createElement('a');
|
|
|
+ aTag.download = '待办任务';
|
|
|
+ aTag.href = res.data;
|
|
|
+ aTag.click();
|
|
|
+ } else {
|
|
|
+ this.exportTaskLoading = false;
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ this.exportTaskLoading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
//显示新增界面
|
|
|
handleAdd(i, item) {
|
|
|
if(i == -1) {
|
|
@@ -1875,6 +2001,19 @@ import { error } from 'dingtalk-jsapi';
|
|
|
type: "error"
|
|
|
});
|
|
|
});
|
|
|
+ },
|
|
|
+
|
|
|
+ vueCasader() {
|
|
|
+ if(obj.distinction == '1') {
|
|
|
+ if(obj.id != '') {
|
|
|
+ let arr = []
|
|
|
+ arr.push(obj.id)
|
|
|
+ this.screenDeptId = arr
|
|
|
+ } else {
|
|
|
+ this.screenDeptId = []
|
|
|
+ }
|
|
|
+ this.getList()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
@@ -1892,6 +2031,7 @@ import { error } from 'dingtalk-jsapi';
|
|
|
if(this.user.timeType.projectWithDept) {
|
|
|
this.getDepartmentList()
|
|
|
}
|
|
|
+ this.getDepartmentList()
|
|
|
this.getAllProjectlist()
|
|
|
// if(this.user.companyId == '428') {
|
|
|
// this.getSthForSb()
|