|
|
@@ -126,12 +126,6 @@
|
|
|
</el-table-column>
|
|
|
<el-table-column label="开始时间" prop="beginDate" sortable="custom" width="100"/>
|
|
|
<el-table-column label="结束时间" prop="endDate" sortable="custom" width="100"/>
|
|
|
-
|
|
|
- <!-- <el-table-column label="创建时间" prop="createTime" width="120">-->
|
|
|
- <!-- <template slot-scope="scope">-->
|
|
|
- <!-- <span>{{ parseTime(scope.row.createTime) }}</span>-->
|
|
|
- <!-- </template>-->
|
|
|
- <!-- </el-table-column>-->
|
|
|
<el-table-column label="操作" width="120">
|
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini"
|
|
|
@@ -205,7 +199,7 @@
|
|
|
<el-form-item label="执行(负责)人" prop="executor">
|
|
|
<dept-user-tree ref="dut2" :userList="userList"
|
|
|
style="width: 220px"
|
|
|
- @selected="(val)=>selectExecutor(val,'form')"/>
|
|
|
+ @selected="selectExecutor"/>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
@@ -262,8 +256,7 @@
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
<el-form-item label="任务描述" prop="description">
|
|
|
- <rich-text-editor ref="rtEditor" :value="form.description"
|
|
|
- @getHtml="(val)=>form.description=val"></rich-text-editor>
|
|
|
+ <rich-text-editor ref="rtEditor" v-model="form.description" v-if="open"></rich-text-editor>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -272,114 +265,23 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <!-- 任务详情对话框 -->
|
|
|
<el-dialog :visible.sync="detailOpen" width="900px" class="add-dialog" append-to-body
|
|
|
:close-on-click-modal="true">
|
|
|
<task-detail :detail-form="detailForm"></task-detail>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 详情/审核任务对话框 -->
|
|
|
- <!-- <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="800px" class="add-dialog" append-to-body-->
|
|
|
- <!-- :close-on-click-modal="detailTitle==='审核任务'?false:true">-->
|
|
|
- <!--<!– <task-detail :detail-form="detailForm"></task-detail>–>-->
|
|
|
- <!-- <div v-if="detailTitle=='审核任务'" style="margin-top: 10px">-->
|
|
|
- <!-- <el-form ref="auditForm" :model="auditForm" :rules="auditRules" size="mini" label-width="100px">-->
|
|
|
- <!-- <el-row>-->
|
|
|
- <!-- <el-col :span="12">-->
|
|
|
- <!-- <el-form-item label="审核意见" prop="auditResult">-->
|
|
|
- <!-- <el-radio-group v-model="auditForm.auditResult">-->
|
|
|
- <!-- <el-radio label="1">确认完成</el-radio>-->
|
|
|
- <!-- <el-radio label="0">驳回</el-radio>-->
|
|
|
- <!-- </el-radio-group>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
- <!-- <el-col :span="12">-->
|
|
|
- <!-- <el-form-item v-if="auditForm.auditResult==='0'" label="进度(%)" prop="value">-->
|
|
|
- <!-- <el-input-number v-model="auditForm.value" :min="1" :max="99"></el-input-number>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-col>-->
|
|
|
- <!-- </el-row>-->
|
|
|
- <!-- <el-form-item label="审核备注" prop="auditOpinion">-->
|
|
|
- <!-- <el-input v-model="auditForm.auditOpinion" type="textarea"/>-->
|
|
|
- <!-- </el-form-item>-->
|
|
|
- <!-- </el-form>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- <div v-if="detailTitle=='审核任务'" slot="footer" class="dialog-footer">-->
|
|
|
- <!-- <el-button type="primary" size="mini" @click="submitAudit">确 定</el-button>-->
|
|
|
- <!-- <el-button size="mini" @click="detailCancel">取 消</el-button>-->
|
|
|
- <!-- </div>-->
|
|
|
- <!-- </el-dialog>-->
|
|
|
+ <!-- 审核任务对话框 -->
|
|
|
+ <el-dialog :visible.sync="auditOpen" width="900px" class="add-dialog" append-to-body @close="auditCancel">
|
|
|
+ <task-audit :detail-form="detailForm" :audit-form="auditForm" @auditCancel="auditCancel"></task-audit>
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- 分解任务对话框 -->
|
|
|
- <el-dialog title="分解任务" :visible.sync="splitOpen" width="90%" class="add-dialog" append-to-body>
|
|
|
- <el-form ref="splitForm" class="split-form" size="mini">
|
|
|
- <el-form-item label="任务名称:">
|
|
|
- <div>{{ splitForm.taskName }}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属项目:">
|
|
|
- <span>{{ splitForm.projectName }}</span>
|
|
|
- <div style="float: right; padding: -1px 3px">
|
|
|
- <el-button type="primary" plain circle icon="el-icon-plus"
|
|
|
- @click="addChild"></el-button>
|
|
|
- </div>
|
|
|
-
|
|
|
- </el-form-item>
|
|
|
- <div style="display: flex;justify-content: flex-start;flex-wrap:wrap">
|
|
|
- <el-card shadow="always" v-for="(child,index) in splitForm.children" :key="index" class="split-card">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <div class="card-header">
|
|
|
- <div style="margin-top: 5px">子任务{{ index + 1 }}</div>
|
|
|
- <el-button type="danger" circle @click="delChild(index)" icon="el-icon-delete"
|
|
|
- style="float: right;">
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <el-form ref="splitChild" :model="child" :rules="rules" size="mini">
|
|
|
- <el-form-item label="任务名称" prop="taskName" label-width="80px">
|
|
|
- <el-input v-model="child.taskName"/>
|
|
|
- </el-form-item>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="开始时间" prop="beginDate" label-width="80px">
|
|
|
- <el-date-picker
|
|
|
- v-model="child.beginDate"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- @change="checkDates(child.beginDate,child.endDate)"
|
|
|
- start-placeholder="开始日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12">
|
|
|
- <el-form-item label="结束时间" prop="endDate">
|
|
|
- <el-date-picker
|
|
|
- v-model="child.endDate"
|
|
|
- type="date"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- @change="checkDates(child.beginDate,child.endDate)"
|
|
|
- start-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-form-item label="执行人" prop="executor" label-width="80px">
|
|
|
- <dept-user-tree ref="dutSplit" :userList="userList"
|
|
|
- @selected="(val)=>selectExecutor(val,'splitForm',index)"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="任务附件" label-width="80px">
|
|
|
- <file-upload @getFileUrl="(val)=>getChildFileUrl(child,val)"
|
|
|
- @removeFile="(val)=>removeChildFile(child,val)"></file-upload>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="任务描述" prop="description" label-width="80px">
|
|
|
- <rich-text-editor ref="crtEditor"
|
|
|
- @getHtml="(val)=>child.description=val"></rich-text-editor>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-card>
|
|
|
- </div>
|
|
|
- </el-form>
|
|
|
- <div v-if="splitForm.children&&splitForm.children.length>0" style=" position: fixed; bottom: 10px;left: 49%">
|
|
|
- <el-button type="primary" size="mini" @click="submitSplit">保存</el-button>
|
|
|
- <!-- <el-button size="mini" @click="splitCancel">取消</el-button>-->
|
|
|
+ <el-dialog :visible.sync="splitOpen" width="900px" class="add-dialog" append-to-body @close="splitCancel">
|
|
|
+ <task-split ref="split" :split-form="splitForm" :user-list="userList"></task-split>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="splitCancel">取 消</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="submitSplit">确 定</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
@@ -410,16 +312,19 @@ import {
|
|
|
addTask,
|
|
|
updateTask,
|
|
|
auditTask,
|
|
|
- splitTask, childrenTask
|
|
|
+ splitTask
|
|
|
} from "@/api/task/task";
|
|
|
import {listProject} from "@/api/task/project";
|
|
|
import {getDeptUserTree} from "@/api/system/user";
|
|
|
-import TaskDetail from "./components/taskDetail"
|
|
|
+import Treeselect from "@riophae/vue-treeselect";
|
|
|
+import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import DeptUserTree from "@/components/DeptUserTree"
|
|
|
import FileUpload from "@/components/FileUpload"
|
|
|
import Project from "@/views/task/components/project";
|
|
|
-import Treeselect from "@riophae/vue-treeselect";
|
|
|
-import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
+import TaskDetail from "@/views/task/components/taskDetail"
|
|
|
+import TaskSplit from "@/views/task/components/taskSplit"
|
|
|
+import TaskAudit from "@/views/task/components/taskAudit"
|
|
|
+
|
|
|
import RichTextEditor from '@/components/RichTextEditor'
|
|
|
import {mapGetters} from "vuex";
|
|
|
import task from "@/views/mixins/task";
|
|
|
@@ -427,7 +332,7 @@ import DateUtil from "@/utils/date";
|
|
|
|
|
|
export default {
|
|
|
name: "Task",
|
|
|
- components: {Project, TaskDetail, DeptUserTree, FileUpload, Treeselect, RichTextEditor},
|
|
|
+ components: {Project, TaskDetail, DeptUserTree, FileUpload, Treeselect, RichTextEditor, TaskSplit, TaskAudit},
|
|
|
dicts: ['task_status', 'task_priority'],
|
|
|
mixins: [task],
|
|
|
computed: {
|
|
|
@@ -449,7 +354,7 @@ export default {
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageSize: 20,
|
|
|
executors: [],
|
|
|
projectId: undefined,
|
|
|
startDate: undefined,
|
|
|
@@ -464,6 +369,7 @@ export default {
|
|
|
detailTitle: "",
|
|
|
detailOpen: false,
|
|
|
detailForm: {},
|
|
|
+ auditOpen: false,
|
|
|
auditForm: {},
|
|
|
splitOpen: false,
|
|
|
splitForm: {},
|
|
|
@@ -488,14 +394,7 @@ export default {
|
|
|
{required: true, message: "执行人不能为空", trigger: 'change'}
|
|
|
]
|
|
|
},
|
|
|
- auditRules: {
|
|
|
- auditResult: [
|
|
|
- {required: true, message: "审核意见不能为空", trigger: "change"}
|
|
|
- ],
|
|
|
- value: [
|
|
|
- {required: true, message: "进度不能为空", trigger: "blur"}
|
|
|
- ]
|
|
|
- },
|
|
|
+
|
|
|
confirmOpen: false,
|
|
|
conflictTasks: []
|
|
|
};
|
|
|
@@ -553,7 +452,7 @@ export default {
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.$refs.dut2.clearText()
|
|
|
- this.$refs.rtEditor.clear()
|
|
|
+ // this.$refs.rtEditor.clear()
|
|
|
this.$refs.fu.clear()
|
|
|
this.reset()
|
|
|
this.open = false;
|
|
|
@@ -571,18 +470,18 @@ export default {
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
- // 取消按钮(详情/审核)
|
|
|
- detailCancel() {
|
|
|
- this.detailOpen = false;
|
|
|
+ // 审核取消按钮
|
|
|
+ auditCancel() {
|
|
|
+ this.auditOpen = false;
|
|
|
this.detailForm = {};
|
|
|
this.auditForm = {}
|
|
|
this.resetForm("auditForm");
|
|
|
},
|
|
|
// 取消按钮(分解任务)
|
|
|
- splitCancel() {
|
|
|
+ async splitCancel() {
|
|
|
+ await this.$refs.split.reset();
|
|
|
+ // this.splitForm = {}
|
|
|
this.splitOpen = false;
|
|
|
- this.splitForm = {}
|
|
|
- this.resetForm("splitForm");
|
|
|
},
|
|
|
|
|
|
/** 查看任务详情*/
|
|
|
@@ -598,6 +497,9 @@ export default {
|
|
|
},
|
|
|
|
|
|
sortChange({column, prop, order}) {
|
|
|
+ if (!order) {
|
|
|
+ return
|
|
|
+ }
|
|
|
this.queryParams.sortField = prop
|
|
|
this.queryParams.order = order.replace('ending', '')
|
|
|
this.getList()
|
|
|
@@ -622,7 +524,7 @@ export default {
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加任务";
|
|
|
- listProject().then(response => {
|
|
|
+ listProject('1').then(response => {
|
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
|
if (this.selectProjectId && this.projectOptions.length > 0) {
|
|
|
let ids = this.projectOptions.map(item => item.id);
|
|
|
@@ -655,14 +557,8 @@ export default {
|
|
|
this.$set(this.form, 'rangeDate', [row.beginDate, row.endDate])
|
|
|
this.$refs.dut2.setCheckedNode(this.form.executor)
|
|
|
},
|
|
|
- selectExecutor(val, form, index) {
|
|
|
- if (form === 'splitForm') {
|
|
|
- let child = this.splitForm.children[index];
|
|
|
- this.$set(child, 'executor', val)
|
|
|
- }
|
|
|
- if (form === 'form') {
|
|
|
- this.$set(this.form, 'executor', val)
|
|
|
- }
|
|
|
+ selectExecutor(val) {
|
|
|
+ this.$set(this.form, 'executor', val)
|
|
|
},
|
|
|
getFileUrl(val) {
|
|
|
this.form.files = val
|
|
|
@@ -670,12 +566,7 @@ export default {
|
|
|
removeFile(val) {
|
|
|
this.form.files = val
|
|
|
},
|
|
|
- getChildFileUrl(child, val) {
|
|
|
- child['files'] = val
|
|
|
- },
|
|
|
- removeChildFile(child, val) {
|
|
|
- child['files'] = val
|
|
|
- },
|
|
|
+
|
|
|
/** 更多操作触发 */
|
|
|
handleCommand(command, row) {
|
|
|
switch (command) {
|
|
|
@@ -706,26 +597,26 @@ export default {
|
|
|
value: undefined,
|
|
|
auditOpinion: undefined
|
|
|
}
|
|
|
- this.detailOpen = true;
|
|
|
- this.detailTitle = "审核任务";
|
|
|
+ this.auditOpen = true;
|
|
|
})
|
|
|
},
|
|
|
/** 分解按钮操作 */
|
|
|
handleSplit(row) {
|
|
|
- console.log(row);
|
|
|
getTask(row.id).then(res => {
|
|
|
- console.log(res);
|
|
|
this.splitForm = res.data
|
|
|
- // this.splitForm = {
|
|
|
- // parentId: row.id,
|
|
|
- // taskName: row.taskName,
|
|
|
- // projectName: row.projectName,
|
|
|
- // children: []
|
|
|
- // }
|
|
|
this.splitForm['parentId'] = row.id
|
|
|
+ this.splitForm['children'] = []
|
|
|
+ let child = {
|
|
|
+ taskName: undefined,
|
|
|
+ executor: undefined,
|
|
|
+ beginDate: row.beginDate,
|
|
|
+ endDate: row.endDate,
|
|
|
+ planHours: undefined,
|
|
|
+ description: undefined
|
|
|
+ }
|
|
|
+ this.splitForm.children.push(child)
|
|
|
this.splitOpen = true
|
|
|
})
|
|
|
-
|
|
|
},
|
|
|
|
|
|
/** 提交按钮 */
|
|
|
@@ -807,44 +698,15 @@ export default {
|
|
|
// this.resetForm("splitForm");
|
|
|
},
|
|
|
|
|
|
- /** 审核提交按钮 */
|
|
|
- submitAudit() {
|
|
|
- this.$refs["auditForm"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- auditTask(this.auditForm).then(res => {
|
|
|
- this.resetForm("auditForm");
|
|
|
- this.getList()
|
|
|
- this.detailOpen = false
|
|
|
- this.$message.success("操作成功");
|
|
|
- })
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
|
|
|
/** 分解任务提交按钮 */
|
|
|
submitSplit() {
|
|
|
- if (this.splitForm.children.length === 0) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let validResult = true
|
|
|
- let splitChild = this.$refs.splitChild;
|
|
|
- for (let key in splitChild) {
|
|
|
- splitChild[key].validate(valid => {
|
|
|
- if (!valid) {
|
|
|
- validResult = valid
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- if (!validResult) {
|
|
|
+ let data = this.$refs.split.submit();
|
|
|
+ if (!data) {
|
|
|
return
|
|
|
}
|
|
|
- this.splitForm.children.forEach(c => {
|
|
|
- if (c.files) {
|
|
|
- let files = c.files.map(item => item.name);
|
|
|
- c.fileUrl = JSON.stringify(files)
|
|
|
- }
|
|
|
- })
|
|
|
- this.splitForm.checkTaskConflict = true;
|
|
|
+ this.splitForm = data;
|
|
|
+ this.$set(this.splitForm, 'checkTaskConflict', true)
|
|
|
splitTask(this.splitForm).then(res => {
|
|
|
if (res.code === 'S.F-2001') {
|
|
|
this.conflictTasks = res.data
|
|
|
@@ -877,20 +739,6 @@ export default {
|
|
|
this.$message.success("删除成功");
|
|
|
}).catch(() => {
|
|
|
});
|
|
|
- },
|
|
|
-
|
|
|
- addChild() {
|
|
|
- let child = {
|
|
|
- taskName: undefined,
|
|
|
- executor: undefined,
|
|
|
- rangeDate: [],
|
|
|
- planHours: undefined,
|
|
|
- description: undefined
|
|
|
- }
|
|
|
- this.splitForm.children.push(child)
|
|
|
- },
|
|
|
- delChild(index) {
|
|
|
- this.splitForm.children.splice(index, 1)
|
|
|
}
|
|
|
|
|
|
}
|