|
|
@@ -58,7 +58,7 @@
|
|
|
</div>
|
|
|
|
|
|
<el-table :data="taskList"
|
|
|
- size="mini"
|
|
|
+ ref="taskList"
|
|
|
height="calc(100vh - 180px)"
|
|
|
@row-click="rowClick"
|
|
|
row-key="id"
|
|
|
@@ -189,7 +189,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 详情/审核任务对话框 -->
|
|
|
- <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="680px" class="add-dialog" append-to-body
|
|
|
+ <el-dialog :title="detailTitle" :visible.sync="detailOpen" width="800px" class="add-dialog" append-to-body
|
|
|
:close-on-click-modal="false">
|
|
|
<task-detail :detail-form="detailForm"></task-detail>
|
|
|
<div v-if="detailTitle=='审核任务'" style="margin-top: 10px">
|
|
|
@@ -212,7 +212,7 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 分解任务对话框 -->
|
|
|
- <el-dialog title="分解任务" :visible.sync="splitOpen" width="500px" class="add-dialog" append-to-body>
|
|
|
+ <el-dialog title="分解任务" :visible.sync="splitOpen" :fullscreen="true" class="add-dialog" append-to-body>
|
|
|
<el-form ref="splitForm" class="split-form" size="mini">
|
|
|
<el-form-item label="任务名称:">
|
|
|
<div>{{ splitForm.taskName }}</div>
|
|
|
@@ -222,34 +222,44 @@
|
|
|
<el-button type="text" icon="el-icon-circle-plus-outline"
|
|
|
style="float: right; padding: -1px 3px" @click="addChild"></el-button>
|
|
|
</el-form-item>
|
|
|
- <el-card shadow="always" v-for="(child,index) in splitForm.children" :key="index">
|
|
|
- <div slot="header" class="clearfix">
|
|
|
- <div class="card-header">
|
|
|
- <div style="margin-top: 5px">子任务{{ index + 1 }}</div>
|
|
|
- <el-button type="text" icon="el-icon-delete" @click="delChild(index)"
|
|
|
- style="float: right;color: red; padding: 3px 0"></el-button>
|
|
|
+ <div style="display: flex;justify-content: flex-start">
|
|
|
+ <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="text" icon="el-icon-delete" @click="delChild(index)"
|
|
|
+ style="float: right;color: red; padding: 3px 0"></el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <el-form ref="splitChild" :model="child" :rules="rules" size="mini" label-width="80px">
|
|
|
- <el-form-item label="任务名称" prop="taskName">
|
|
|
- <el-input v-model="child.taskName" style="width: 350px"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="执行人" prop="executor">
|
|
|
- <dept-user-tree ref="dutSplit" :userList="userList" style="width: 350px"
|
|
|
- @selected="(val)=>selectExecutor(val,'splitForm',index)"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="起止时间" prop="rangeDate">
|
|
|
- <el-date-picker
|
|
|
- v-model="child.rangeDate"
|
|
|
- type="daterange"
|
|
|
- value-format="yyyy-MM-dd"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期">
|
|
|
- </el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
- </el-card>
|
|
|
+ <el-form ref="splitChild" :model="child" :rules="rules" size="mini" label-width="80px">
|
|
|
+ <el-form-item label="任务名称" prop="taskName">
|
|
|
+ <el-input v-model="child.taskName" style="width: 350px"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="执行人" prop="executor">
|
|
|
+ <dept-user-tree ref="dutSplit" :userList="userList" style="width: 350px"
|
|
|
+ @selected="(val)=>selectExecutor(val,'splitForm',index)"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="起止时间" prop="rangeDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="child.rangeDate"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="任务附件">
|
|
|
+ <file-upload @getFileUrl="(val)=>getChildFileUrl(child,val)"
|
|
|
+ @removeFile="(val)=>removeChildFile(child,val)"></file-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="任务描述" prop="description">
|
|
|
+ <rich-text-editor ref="crtEditor"
|
|
|
+ @getHtml="(val)=>child.description=val"></rich-text-editor>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </el-card>
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" size="mini" @click="submitSplit">确 定</el-button>
|
|
|
@@ -296,6 +306,7 @@ import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import RichTextEditor from '@/components/RichTextEditor'
|
|
|
import {mapGetters} from "vuex";
|
|
|
+import DateUtil from "@/utils/date"
|
|
|
|
|
|
const statusMap = {
|
|
|
'0': {name: '待查看', type: 'info'},
|
|
|
@@ -426,9 +437,11 @@ export default {
|
|
|
this.form = {
|
|
|
id: undefined,
|
|
|
taskName: undefined,
|
|
|
- categoryId: undefined,
|
|
|
- description: undefined,
|
|
|
- status: "0",
|
|
|
+ projectId: undefined,
|
|
|
+ executor: undefined,
|
|
|
+ coExecutor: undefined,
|
|
|
+ rangeDate: [],
|
|
|
+ description: undefined
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
@@ -492,24 +505,23 @@ export default {
|
|
|
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/>', ''))
|
|
|
+ this.form.files = this.form.fileList.map(item => item.url.replace('http://file.aivfo.com:36000/', ''))
|
|
|
}
|
|
|
}))
|
|
|
arr.push(listProject().then(response => {
|
|
|
this.projectOptions = this.handleTree(response.data, "id");
|
|
|
}))
|
|
|
await Promise.all(arr)
|
|
|
-
|
|
|
+ this.$set(this.form, 'rangeDate', [row.beginDate, row.endDate])
|
|
|
this.$refs.dut2.setCheckedNode(this.form.executor)
|
|
|
this.$refs.dut3.setCheckedNode(this.form.coExecutor)
|
|
|
},
|
|
|
selectExecutor(val, form, index) {
|
|
|
if (form === 'splitForm') {
|
|
|
let child = this.splitForm.children[index];
|
|
|
- child.executor = val
|
|
|
+ this.$set(child, 'executor', val)
|
|
|
}
|
|
|
if (form === 'form') {
|
|
|
this.$set(this.form, 'executor', val)
|
|
|
@@ -525,6 +537,13 @@ export default {
|
|
|
removeFile(val) {
|
|
|
this.form.files.splice(val)
|
|
|
},
|
|
|
+ getChildFileUrl(child, val) {
|
|
|
+ child['files'] = child.files || []
|
|
|
+ child.files.push(val)
|
|
|
+ },
|
|
|
+ removeChildFile(child, val) {
|
|
|
+ child.files.splice(val)
|
|
|
+ },
|
|
|
/** 更多操作触发 */
|
|
|
handleCommand(command, row) {
|
|
|
switch (command) {
|
|
|
@@ -590,7 +609,10 @@ export default {
|
|
|
});
|
|
|
} else {
|
|
|
updateTask(this.form).then(res => {
|
|
|
-
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ this.getList();
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
@@ -646,6 +668,9 @@ export default {
|
|
|
},
|
|
|
/** 分解任务提交按钮 */
|
|
|
submitSplit() {
|
|
|
+ if (this.splitForm.children.length === 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
let validResult = true
|
|
|
let splitChild = this.$refs.splitChild;
|
|
|
for (let key in splitChild) {
|
|
|
@@ -658,6 +683,9 @@ export default {
|
|
|
if (!validResult) {
|
|
|
return
|
|
|
}
|
|
|
+ this.splitForm.children.forEach(c => {
|
|
|
+ c.fileUrl = JSON.stringify(c.files)
|
|
|
+ })
|
|
|
this.splitForm.checkTaskConflict = true;
|
|
|
splitTask(this.splitForm).then(res => {
|
|
|
if (res.code === 'S.F-2001') {
|
|
|
@@ -752,4 +780,9 @@ export default {
|
|
|
padding: 0 20px 10px 20px;
|
|
|
}
|
|
|
|
|
|
+.split-card {
|
|
|
+ width: 49%;
|
|
|
+ margin: 5px;
|
|
|
+}
|
|
|
+
|
|
|
</style>
|