|
@@ -34,7 +34,7 @@
|
|
|
<el-form-item prop="status">
|
|
|
<el-select
|
|
|
v-model="queryParams.status"
|
|
|
- placeholder="任务状态"
|
|
|
+ placeholder="状态"
|
|
|
style="width: 85px">
|
|
|
<el-option
|
|
|
v-for="dict in dict.type.task_status"
|
|
@@ -135,7 +135,7 @@
|
|
|
type="text"
|
|
|
icon="el-icon-coordinate"
|
|
|
@click="handleAudit(scope.row)"
|
|
|
- :disabled="scope.row.status!='6'"
|
|
|
+ :disabled="scope.row.status!='6'||scope.row.auditUserId!=userId"
|
|
|
v-hasPermi="['task:task:audit']"
|
|
|
>审核
|
|
|
</el-button>
|
|
@@ -193,6 +193,7 @@
|
|
|
<treeselect v-model="form.projectId" :options="projectOptions"
|
|
|
:open-on-click="true"
|
|
|
:normalizer="normalizer"
|
|
|
+ @select="treeProjectChange"
|
|
|
:flat="true"
|
|
|
:defaultExpandLevel="1"
|
|
|
style="width: 220px"
|
|
@@ -262,6 +263,10 @@
|
|
|
<el-form-item label="任务描述" prop="description">
|
|
|
<rich-text-editor ref="rtEditor" v-model="form.description" v-if="open"></rich-text-editor>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="审核流程" v-if="form.projectId">
|
|
|
+ <audit-module ref="auditModule" :audit-users="auditUsers"
|
|
|
+ :project-audit-configs="projectAuditConfigs"></audit-module>
|
|
|
+ </el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" size="mini" @click="submitForm">确 定</el-button>
|
|
@@ -270,14 +275,15 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 任务详情对话框 -->
|
|
|
- <el-dialog :title="detailForm.taskName" :visible.sync="detailOpen" width="900px" class="add-dialog" append-to-body
|
|
|
+ <el-dialog :title="detailForm.id+'、'+detailForm.taskName" :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="detailForm.taskName" :visible.sync="auditOpen" width="900px" class="add-dialog" append-to-body
|
|
|
- @close="auditCancel">
|
|
|
+ <el-dialog :title="detailForm.id+'、'+detailForm.taskName" :visible.sync="auditOpen" width="900px" class="add-dialog"
|
|
|
+ append-to-body @close="auditCancel">
|
|
|
<task-detail :detail-form="detailForm"></task-detail>
|
|
|
<el-form ref="auditForm" :model="auditForm" :rules="auditRules" size="mini" label-width="100px">
|
|
|
<el-row>
|
|
@@ -286,6 +292,7 @@
|
|
|
<el-radio-group v-model="auditForm.auditResult">
|
|
|
<el-radio label="1">确认完成</el-radio>
|
|
|
<el-radio label="0">驳回</el-radio>
|
|
|
+ <el-radio label="9">评论</el-radio>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
@@ -341,10 +348,11 @@ import {
|
|
|
addTask,
|
|
|
updateTask,
|
|
|
auditTask,
|
|
|
- splitTask
|
|
|
+ splitTask,
|
|
|
+ projectAuditConfigs, taskAuditConfigs, addTaskFeedback
|
|
|
} from "@/api/task/task";
|
|
|
import {getProjectTree, listProject} from "@/api/task/project";
|
|
|
-import {getDeptUserTree} from "@/api/system/user";
|
|
|
+import {getDeptUserTree, getAuditUsers} from "@/api/system/user";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import DeptUserTree from "@/components/DeptUserTree"
|
|
@@ -358,9 +366,11 @@ import {mapGetters} from "vuex";
|
|
|
import task from "@/views/mixins/task";
|
|
|
import DateUtil from "@/utils/date";
|
|
|
|
|
|
+import AuditModule from '@/views/task/components/auditModule';
|
|
|
+
|
|
|
export default {
|
|
|
name: "Task",
|
|
|
- components: {Project, TaskDetail, DeptUserTree, FileUpload, Treeselect, RichTextEditor, TaskSplit},
|
|
|
+ components: {Project, TaskDetail, DeptUserTree, FileUpload, Treeselect, RichTextEditor, TaskSplit, AuditModule},
|
|
|
dicts: ['task_status', 'task_priority'],
|
|
|
mixins: [task],
|
|
|
computed: {
|
|
@@ -387,13 +397,15 @@ export default {
|
|
|
projectId: undefined,
|
|
|
startDate: undefined,
|
|
|
endDate: undefined,
|
|
|
- status: '1',
|
|
|
+ status: undefined,
|
|
|
priority: undefined,
|
|
|
sortField: undefined,
|
|
|
order: undefined
|
|
|
},
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
+ projectAuditConfigs: [],
|
|
|
+ auditUsers: [],
|
|
|
detailTitle: "",
|
|
|
detailOpen: false,
|
|
|
detailForm: {},
|
|
@@ -557,6 +569,11 @@ export default {
|
|
|
};
|
|
|
return newVar;
|
|
|
},
|
|
|
+ treeProjectChange(node) {
|
|
|
+ projectAuditConfigs({projectId: node.id}).then(res => {
|
|
|
+ this.projectAuditConfigs = res.data
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
@@ -569,14 +586,26 @@ export default {
|
|
|
let ids = this.projectOptions.map(item => item.id);
|
|
|
if (ids.indexOf(this.selectProjectId) < 0) {
|
|
|
this.form.projectId = this.selectProjectId
|
|
|
+ projectAuditConfigs({projectId: this.form.projectId}).then(res => {
|
|
|
+ this.projectAuditConfigs = res.data
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
this.$set(this.form, 'priority', '4')
|
|
|
})
|
|
|
+ getAuditUsers().then(res => {
|
|
|
+ this.auditUsers = res.data
|
|
|
+ })
|
|
|
},
|
|
|
async handleEdit(row) {
|
|
|
this.open = true;
|
|
|
this.title = "修改任务";
|
|
|
+ taskAuditConfigs({taskId: row.id}).then(res => {
|
|
|
+ this.projectAuditConfigs = res.data
|
|
|
+ })
|
|
|
+ getAuditUsers().then(res => {
|
|
|
+ this.auditUsers = res.data
|
|
|
+ })
|
|
|
let arr = []
|
|
|
arr.push(getTask(row.id).then(res => {
|
|
|
this.form = res.data;
|
|
@@ -681,6 +710,7 @@ export default {
|
|
|
let tempFiles = this.form.files.map(item => item.name);
|
|
|
this.form.fileUrl = JSON.stringify(tempFiles)
|
|
|
}
|
|
|
+ this.form['auditConfigs'] = this.$refs.auditModule.getAuditConfigs()
|
|
|
this.form.checkTaskConflict = true;
|
|
|
if (!this.form.id) {
|
|
|
addTask(this.form).then(res => {
|
|
@@ -745,11 +775,24 @@ export default {
|
|
|
submitAudit() {
|
|
|
this.$refs["auditForm"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- auditTask(this.auditForm).then(res => {
|
|
|
- this.$message.success("操作成功");
|
|
|
- this.getList()
|
|
|
- this.auditCancel()
|
|
|
- })
|
|
|
+ if (this.auditForm.auditResult != '9') {
|
|
|
+ auditTask(this.auditForm).then(res => {
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.getList()
|
|
|
+ this.auditCancel()
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ let data = {
|
|
|
+ taskId: this.auditForm.taskId,
|
|
|
+ feedbackDate: DateUtil.day(),
|
|
|
+ feedbackType: '4',
|
|
|
+ description: this.auditForm.auditOpinion
|
|
|
+ }
|
|
|
+ addTaskFeedback(data).then(res => {
|
|
|
+ this.$message.success("评论成功");
|
|
|
+ this.auditCancel()
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|