|
@@ -96,7 +96,7 @@
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-button size="mini"
|
|
<el-button size="mini"
|
|
|
type="text"
|
|
type="text"
|
|
|
- icon="el-icon-edit"
|
|
|
|
|
|
|
+ icon="el-icon-coordinate"
|
|
|
@click="handleAudit(scope.row)"
|
|
@click="handleAudit(scope.row)"
|
|
|
:disabled="scope.row.progressValue!=100||(scope.row.status!='2'&&scope.row.status!='3')||scope.row.createBy!=userId"
|
|
:disabled="scope.row.progressValue!=100||(scope.row.status!='2'&&scope.row.status!='3')||scope.row.createBy!=userId"
|
|
|
v-hasPermi="['task:task:audit']"
|
|
v-hasPermi="['task:task:audit']"
|
|
@@ -106,14 +106,20 @@
|
|
|
v-hasPermi="['task:task:edit','task:task:split', 'task:task:delete']">
|
|
v-hasPermi="['task:task:edit','task:task:split', 'task:task:delete']">
|
|
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
|
<el-button size="mini" type="text" icon="el-icon-d-arrow-right">更多</el-button>
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
- <el-dropdown-item command="handleSplit" icon="el-icon-edit"
|
|
|
|
|
|
|
+ <el-dropdown-item command="handleSplit" icon="el-icon-tickets"
|
|
|
v-hasPermi="['task:task:split']"
|
|
v-hasPermi="['task:task:split']"
|
|
|
>分解
|
|
>分解
|
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
|
- <el-dropdown-item command="handleUpdate" icon="el-icon-edit"
|
|
|
|
|
|
|
+ <el-dropdown-item command="handleUpdate" icon="el-icon-edit-outline"
|
|
|
|
|
+ v-if="userId===scope.row.createBy"
|
|
|
v-hasPermi="['task:task:edit']"
|
|
v-hasPermi="['task:task:edit']"
|
|
|
>终止
|
|
>终止
|
|
|
</el-dropdown-item>
|
|
</el-dropdown-item>
|
|
|
|
|
+ <el-dropdown-item command="handleEdit" icon="el-icon-edit"
|
|
|
|
|
+ v-if="userId===scope.row.createBy"
|
|
|
|
|
+ v-hasPermi="['task:task:edit']"
|
|
|
|
|
+ >修改
|
|
|
|
|
+ </el-dropdown-item>
|
|
|
<el-dropdown-item command="handleDelete" icon="el-icon-delete"
|
|
<el-dropdown-item command="handleDelete" icon="el-icon-delete"
|
|
|
v-hasPermi="['task:task:delete']"
|
|
v-hasPermi="['task:task:delete']"
|
|
|
>删除
|
|
>删除
|
|
@@ -169,12 +175,11 @@
|
|
|
<dept-user-tree ref="dut3" :userList="userList" :multiple="true" @selected="selectCoExecutor"/>
|
|
<dept-user-tree ref="dut3" :userList="userList" :multiple="true" @selected="selectCoExecutor"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="任务附件">
|
|
<el-form-item label="任务附件">
|
|
|
- <file-upload @getFileUrl="getFileUrl" @removeFile="removeFile"></file-upload>
|
|
|
|
|
|
|
+ <file-upload :files="form.fileList" @getFileUrl="getFileUrl" @removeFile="removeFile"></file-upload>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item label="任务描述" prop="description">
|
|
<el-form-item label="任务描述" prop="description">
|
|
|
-
|
|
|
|
|
- <!-- <el-input v-model="form.description" type="textarea" placeholder="请输入内容"></el-input>-->
|
|
|
|
|
- <rich-text-editor ref="rtEditor" @getHtml="(val)=>form.description=val"></rich-text-editor>
|
|
|
|
|
|
|
+ <rich-text-editor ref="rtEditor" :value="form.description"
|
|
|
|
|
+ @getHtml="(val)=>form.description=val"></rich-text-editor>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -310,6 +315,7 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
projectOptions: [],
|
|
projectOptions: [],
|
|
|
|
|
+ selectProjectId: undefined,
|
|
|
userList: [],
|
|
userList: [],
|
|
|
// 总条数
|
|
// 总条数
|
|
|
total: 0,
|
|
total: 0,
|
|
@@ -385,6 +391,7 @@ export default {
|
|
|
);
|
|
);
|
|
|
},
|
|
},
|
|
|
selectProject(data) {
|
|
selectProject(data) {
|
|
|
|
|
+ this.selectProjectId = data
|
|
|
this.queryParams.projectId = data;
|
|
this.queryParams.projectId = data;
|
|
|
this.handleQuery()
|
|
this.handleQuery()
|
|
|
},
|
|
},
|
|
@@ -471,11 +478,34 @@ export default {
|
|
|
handleAdd() {
|
|
handleAdd() {
|
|
|
this.reset();
|
|
this.reset();
|
|
|
this.open = true;
|
|
this.open = true;
|
|
|
- this.title = "添加项目";
|
|
|
|
|
|
|
+ this.title = "添加任务";
|
|
|
listProject().then(response => {
|
|
listProject().then(response => {
|
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
|
|
|
+ if (this.selectProjectId) {
|
|
|
|
|
+ this.form.projectId = this.selectProjectId
|
|
|
|
|
+ }
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ async handleEdit(row) {
|
|
|
|
|
+ this.open = true;
|
|
|
|
|
+ this.title = "修改任务";
|
|
|
|
|
+ let arr = []
|
|
|
|
|
+ arr.push(getTask(row.id).then(res => {
|
|
|
|
|
+ this.form = res.data;
|
|
|
|
|
+ this.form.rangeDate = [row.beginDate, row.endDate]
|
|
|
|
|
+ this.form['files'] = this.form.files || []
|
|
|
|
|
+ if (this.form.fileList.length > 0) {
|
|
|
|
|
+ this.form.files = this.form.fileList.map(item => item.fileName.replace('<br/>', ''))
|
|
|
|
|
+ }
|
|
|
|
|
+ }))
|
|
|
|
|
+ arr.push(listProject().then(response => {
|
|
|
|
|
+ this.projectOptions = this.handleTree(response.data, "id");
|
|
|
|
|
+ }))
|
|
|
|
|
+ await Promise.all(arr)
|
|
|
|
|
+
|
|
|
|
|
+ this.$refs.dut2.setCheckedNode(this.form.executor)
|
|
|
|
|
+ this.$refs.dut3.setCheckedNode(this.form.coExecutor)
|
|
|
|
|
+ },
|
|
|
selectExecutor(val, form, index) {
|
|
selectExecutor(val, form, index) {
|
|
|
if (form === 'splitForm') {
|
|
if (form === 'splitForm') {
|
|
|
let child = this.splitForm.children[index];
|
|
let child = this.splitForm.children[index];
|
|
@@ -504,6 +534,9 @@ export default {
|
|
|
case 'handleUpdate':
|
|
case 'handleUpdate':
|
|
|
this.handleUpdate(row)
|
|
this.handleUpdate(row)
|
|
|
break
|
|
break
|
|
|
|
|
+ case 'handleEdit':
|
|
|
|
|
+ this.handleEdit(row)
|
|
|
|
|
+ break
|
|
|
case 'handleDelete':
|
|
case 'handleDelete':
|
|
|
this.handleDelete(row)
|
|
this.handleDelete(row)
|
|
|
break
|
|
break
|
|
@@ -543,17 +576,23 @@ export default {
|
|
|
this.form.endDate = this.form.rangeDate[1]
|
|
this.form.endDate = this.form.rangeDate[1]
|
|
|
this.form.fileUrl = JSON.stringify(this.form.files)
|
|
this.form.fileUrl = JSON.stringify(this.form.files)
|
|
|
this.form.checkTaskConflict = true;
|
|
this.form.checkTaskConflict = true;
|
|
|
- addTask(this.form).then(res => {
|
|
|
|
|
- if (res.code === 'S.F-2001') {
|
|
|
|
|
- this.conflictTasks = res.data
|
|
|
|
|
- this.confirmOpen = true
|
|
|
|
|
- } else {
|
|
|
|
|
- this.$message.success("新增成功");
|
|
|
|
|
- this.open = false;
|
|
|
|
|
- this.reset();
|
|
|
|
|
- this.getList();
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ if (!this.form.id) {
|
|
|
|
|
+ addTask(this.form).then(res => {
|
|
|
|
|
+ if (res.code === 'S.F-2001') {
|
|
|
|
|
+ this.conflictTasks = res.data
|
|
|
|
|
+ this.confirmOpen = true
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.$message.success("新增成功");
|
|
|
|
|
+ this.open = false;
|
|
|
|
|
+ this.reset();
|
|
|
|
|
+ this.getList();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ updateTask(this.form).then(res => {
|
|
|
|
|
+
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|