|
|
@@ -97,7 +97,7 @@
|
|
|
<el-table-column label="反馈备注">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
- <span>{{ scope.row.description }}</span>
|
|
|
+ <span v-html="scope.row.description"></span>
|
|
|
<span v-for="(file,index) in scope.row.fileList">
|
|
|
<a :href="file.url" style="color: darkgreen">
|
|
|
<span v-html="file.fileName"></span>
|
|
|
@@ -119,40 +119,60 @@
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
- <el-dialog title="反馈任务" :visible.sync="open" width="680px" append-to-body :close-on-click-modal="false">
|
|
|
+ <el-dialog title="反馈任务" :visible.sync="open" width="680px" class="feed-dialog" append-to-body @close="cancel">
|
|
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="100px">
|
|
|
<el-form-item label="任务名称">
|
|
|
<div>{{ form.taskName }}</div>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="所属项目">
|
|
|
- <div>{{ form.projectName }}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="反馈时间">
|
|
|
- <div>{{ form.feedbackDate }}</div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="反馈类型" prop="feedbackType">
|
|
|
- <el-radio-group v-model="form.feedbackType" @input="feedbackTypeChange">
|
|
|
- <el-radio
|
|
|
- v-for="dict in dict.type.feedback_type"
|
|
|
- :key="dict.value"
|
|
|
- :label="dict.value"
|
|
|
- v-if="dict.value<5"
|
|
|
- >{{ dict.label }}
|
|
|
- </el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="工时" prop="hours">
|
|
|
- <el-input v-model="form.hours" style="width: 130px"></el-input>
|
|
|
- <span style="margin-left: 5px">小时</span>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="进度" prop="value">
|
|
|
- <el-input-number v-model="form.value" :min="1" :max="100"></el-input-number>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="附件" prop="fileUrl">
|
|
|
- <file-upload @getFileUrl="getFileUrl" @removeFile="removeFile"></file-upload>
|
|
|
- </el-form-item>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="所属项目">
|
|
|
+ <div>{{ form.projectName }}</div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="反馈时间">
|
|
|
+ <div>{{ form.feedbackDate }}</div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="反馈类型" prop="feedbackType">
|
|
|
+ <el-radio-group v-model="form.feedbackType" @input="feedbackTypeChange">
|
|
|
+ <el-radio
|
|
|
+ v-for="dict in dict.type.feedback_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.value"
|
|
|
+ v-if="dict.value<3"
|
|
|
+ >{{ dict.label }}
|
|
|
+ </el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="工时" prop="hours">
|
|
|
+ <el-input v-model="form.hours" style="width: 130px"></el-input>
|
|
|
+ <span style="margin-left: 5px">小时</span>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="进度" prop="value">
|
|
|
+ <el-input-number v-model="form.value" :min="1" :max="100"></el-input-number>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="附件" prop="fileUrl">
|
|
|
+ <file-upload @getFileUrl="getFileUrl" @removeFile="removeFile"></file-upload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+
|
|
|
<el-form-item label="反馈描述" prop="description">
|
|
|
- <el-input v-model="form.description" type="textarea" autosize/>
|
|
|
+ <!-- <el-input v-model="form.description" type="textarea" autosize/>-->
|
|
|
+ <rich-text-editor ref="rtEditor" @getHtml="(val)=>form.description=val"></rich-text-editor>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -170,10 +190,10 @@
|
|
|
|
|
|
<script>
|
|
|
import {getTask, listView, addTaskFeedback, getFeedbackList, confirmComment} from "@/api/task/task";
|
|
|
-import {getProjectList, getProjectTree} from "@/api/task/project";
|
|
|
import DateUtil from "@/utils/date"
|
|
|
import TaskDetail from "./components/taskDetail"
|
|
|
import FileUpload from "@/components/FileUpload"
|
|
|
+import RichTextEditor from '@/components/RichTextEditor'
|
|
|
|
|
|
import {mapGetters} from 'vuex'
|
|
|
|
|
|
@@ -187,21 +207,41 @@ const statusMap = {
|
|
|
}
|
|
|
|
|
|
export default {
|
|
|
- components: {TaskDetail, FileUpload},
|
|
|
+ components: {TaskDetail, FileUpload, RichTextEditor},
|
|
|
dicts: ['task_status', 'feedback_type'],
|
|
|
computed: {
|
|
|
...mapGetters(['userId'])
|
|
|
},
|
|
|
data() {
|
|
|
let validateValue = (rule, value, callback) => {
|
|
|
- if (this.form.feedbackType != '1' && this.form.feedbackType != '2') {
|
|
|
- return callback();
|
|
|
+ if (!Number.isInteger(value) || value < 0 || value > 100) {
|
|
|
+ return callback(new Error('进度值必须为0到100的整数'));
|
|
|
}
|
|
|
if (!value) {
|
|
|
return callback(new Error('进度不能为空'));
|
|
|
}
|
|
|
return callback();
|
|
|
};
|
|
|
+ let validateHours = (rule, value, callback) => {
|
|
|
+ const regex = /^(?:[0-1]?\d|2[0-4])(\.5)?$/;
|
|
|
+ if (!regex.test(value) || value < 0 || value > 24) {
|
|
|
+ return callback(new Error('工时必须为0到24的数,最小维度为0.5小时'));
|
|
|
+ }
|
|
|
+ if (!value) {
|
|
|
+ return callback(new Error('工时不能为空'));
|
|
|
+ }
|
|
|
+ return callback();
|
|
|
+ };
|
|
|
+ let validateDescription = (rule, value, callback) => {
|
|
|
+ let text = value.replace('<p>', '').replace('</p>', '').replace('<br>', '').replace(' ', '')
|
|
|
+ if (text === '') {
|
|
|
+ return callback(new Error('反馈描述不能为空'));
|
|
|
+ }
|
|
|
+ if (text.length < 5 || text.length > 900) {
|
|
|
+ return callback(new Error('反馈描述字符数需在5到500之间'));
|
|
|
+ }
|
|
|
+ return callback();
|
|
|
+ };
|
|
|
|
|
|
return {
|
|
|
queryParams: {
|
|
|
@@ -222,11 +262,13 @@ export default {
|
|
|
{required: true, message: "反馈类型不能为空", trigger: "change"}
|
|
|
],
|
|
|
value: [
|
|
|
- {validator: validateValue, trigger: 'blur'}
|
|
|
+ {required: true, validator: validateValue, trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ hours: [
|
|
|
+ {required: true, validator: validateHours, trigger: 'blur'}
|
|
|
],
|
|
|
description: [
|
|
|
- {required: true, message: "反馈描述不能为空", trigger: "blur"},
|
|
|
- {min: 3, max: 500, message: '长度在 3 到 500 个字符', trigger: 'blur'}
|
|
|
+ {required: true, validator: validateDescription, trigger: "blur"},
|
|
|
]
|
|
|
},
|
|
|
openDetail: false,
|
|
|
@@ -351,6 +393,7 @@ export default {
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
+ this.$refs.rtEditor.clear();
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
@@ -444,4 +487,9 @@ export default {
|
|
|
vertical-align: text-top;
|
|
|
}
|
|
|
|
|
|
+.feed-dialog ::v-deep .el-dialog__body {
|
|
|
+ padding: 0 20px 10px 20px;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
</style>
|