|
@@ -148,7 +148,7 @@
|
|
|
<i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;margin-top:8px;'" ></i>
|
|
|
</div>
|
|
|
<div style="margin: 10px 0px;color:#666;" @click="timess(element.endDate)">
|
|
|
- <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date"> {{element.endDate}}</i></span>
|
|
|
+ <span v-if="element.endDate >= times || element.taskStatus == 1"><i v-if="element.endDate != null" class="el-icon-date" style="margin-left:5px"> {{element.endDate}}</i></span>
|
|
|
<span v-else><em v-if="element.endDate != null" style="display: inline-block;padding:3px 5px"><i v-if="element.endDate != null" class="el-icon-date"><span class="element_span"> {{element.endDate}} 截止</span></i></em></span>
|
|
|
<span v-if="element.executorName">
|
|
|
<span v-for="(exeItem, exeIndex) in element.executorName.split(',')" :key="exeIndex" :style="'background:'+element.executorColor.split(',')[exeIndex]" class="user_name_icon">{{exeItem.length>2?exeItem.substring(exeItem.length-2, exeItem.length):exeItem}}</span>
|
|
@@ -156,10 +156,17 @@
|
|
|
<el-button v-if="!element.executorName" type="primary" @click.stop.native="addAsMyTask(element)" size="mini" style="float:right;width:38px;padding:5px;position: absolute;z-index: 5;right: 5px;">认领</el-button>
|
|
|
</div>
|
|
|
<!--子任务 -->
|
|
|
- <div v-if="element.subTaskList.length > 0">
|
|
|
- <el-tooltip class="item" effect="dark" content="查看子任务" placement="top">
|
|
|
- <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span></el-link>
|
|
|
+ <div v-if="element.subTaskList.length > 0" class="taskCardCircleBox">
|
|
|
+ <el-progress type="circle" :percentage="(element.subTaskFinishNum/element.subTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress><span style="margin-left:5px;font-size:12px;">{{element.subTaskFinishNum}}/{{element.subTaskList.length}}</span>
|
|
|
+ </div>
|
|
|
+ <!-- <div v-if="element.taskType == 1 && element.refTaskList != null">
|
|
|
+ <el-tooltip class="item" effect="dark" content="查看关联任务" placement="top">
|
|
|
+ <el-link class="sub_task_num" @click.stop.native="showSubTaskList(element)"><i class="iconfont firerock-icontree" ></i><span style="margin-left:5px;">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span></el-link>
|
|
|
</el-tooltip>
|
|
|
+ </div> -->
|
|
|
+ <div v-if="element.taskType == 1 && element.refTaskList != null" class="taskCardCircleBox">
|
|
|
+ <el-progress type="circle" :percentage="(element.finishRefTaskCount/element.refTaskList.length) * 100" width="16" :show-text="false" stroke-linecap="butt" stroke-width="8"></el-progress>
|
|
|
+ <span style="margin-left:5px;font-size:12px">{{element.finishRefTaskCount}}/{{element.refTaskList.length}}</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</draggable>
|
|
@@ -244,7 +251,7 @@
|
|
|
|
|
|
<!--新增任务界面-->
|
|
|
<el-dialog :class="addForm.id==null?'':'jm'" :title="title" v-if="addFormVisible" :visible.sync="addFormVisible"
|
|
|
- :close-on-click-modal="false" customClass="customWidth" width="800px">
|
|
|
+ :close-on-click-modal="false" customClass="customWidth" width="800px" ref="addDialog">
|
|
|
<!-- <div style="width: 200%;height:80%;position: absolute;right:-100%;top:0;background:#000;opacity: 0;" @click="sss"></div> -->
|
|
|
|
|
|
<el-form ref="form1" :model="addForm" :rules="taskRules" label-width="100px">
|
|
@@ -255,7 +262,9 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="类型">
|
|
|
- <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id">
|
|
|
+ <!-- <el-button @click="test">test</el-button> -->
|
|
|
+ <!-- 0011 -->
|
|
|
+ <el-select v-model="addForm.taskType" style="width:100%;" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="selchg()">
|
|
|
<el-option v-for="item in taskTypeList" :key="item.id" :label="item.name" :value="item.id">
|
|
|
<i :class="item.icon" ></i>
|
|
|
<span>{{item.name}}</span>
|
|
@@ -265,10 +274,10 @@
|
|
|
<el-form-item label="任务内容" prop="name">
|
|
|
<el-input v-model="addForm.name" :maxlength="40" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" placeholder="请输入任务内容" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="开始时间" prop="startDate">
|
|
|
+ <el-form-item :label="!timelabel ? '开始时间' : '截至时间'" prop="startDate">
|
|
|
<el-date-picker v-model="addForm.startDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
|
|
|
- placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
|
|
|
- <span style="margin-left:30px;margin-right:10px;">截止时间</span>
|
|
|
+ placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()" v-if="!timelabel"></el-date-picker>
|
|
|
+ <span style="margin-left:30px;margin-right:10px;" v-if="!timelabel">截止时间</span>
|
|
|
<el-date-picker v-model="addForm.endDate" type="date" value-format="yyyy-MM-dd"
|
|
|
placeholder="请选择日期" :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" @change="DateChange()"></el-date-picker>
|
|
|
</el-form-item>
|
|
@@ -301,6 +310,8 @@
|
|
|
<div v-if="addForm.id != null">
|
|
|
<el-divider ></el-divider>
|
|
|
<!-- 任务进展 -->
|
|
|
+ <template v-if="!timelabel || isRelationItem">
|
|
|
+
|
|
|
<p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">任务进展</i>
|
|
|
<span ref="addPro" style="display: block; float:right;"><el-link @click="addprogress">添加任务进展</el-link></span>
|
|
|
</p>
|
|
@@ -406,12 +417,40 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
|
|
|
- <!-- 子任务 -->
|
|
|
- <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">子任务</i>
|
|
|
- <el-link style="float:right;" @click="addSubTask">添加子任务</el-link>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 子任务/关联任务 -->
|
|
|
+ <p ><i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">{{timelabel && !isRelationItem ? '关联任务' : '子任务'}}</i>
|
|
|
+ <el-link style="float:right;" @click="addRelation" v-if="timelabel && !isRelationItem">添加关联任务</el-link>
|
|
|
+ <el-link style="float:right;" @click="addSubTask" v-else>添加子任务</el-link>
|
|
|
</p>
|
|
|
+ <!-- 关联任务列表 -->
|
|
|
+ <el-table key="guanlian" :data="relationSubTaskList" v-if="timelabel && !isRelationItem"
|
|
|
+ :header-cell-style="{'font-weight':'normal'}"
|
|
|
+ highlight-current-row
|
|
|
+ v-loading="listLoading"
|
|
|
+ style="width: 100%;margin-top:10px;"
|
|
|
+ @row-click="relationTaskClick">
|
|
|
+ <el-table-column prop="taskStatus" label="完成" width="50" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-checkbox :disabled="scope.row.taskStatus==2" :checked="scope.row.taskStatus==1?true:false" size="large" class="cb" @change="relationFinishTask(scope.row)" @click.stop.native=""></el-checkbox>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="taskName" label="标题" >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tooltip class="item" effect="dark" :content="scope.row.taskName" placement="top">
|
|
|
+ <span style="overflow: hidden;text-overflow:ellipsis;white-space: nowrap;" > {{scope.row.taskName}}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" width="130" align="left">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="deleteRelationItem(scope.row.id)" size="mini">解除关联</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
<!--子任务列表 -->
|
|
|
- <el-table :data="addForm.subTaskList"
|
|
|
+ <el-table key="zi" :data="addForm.subTaskList" v-else
|
|
|
:header-cell-style="{'font-weight':'normal'}"
|
|
|
highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
|
|
|
<el-table-column prop="taskStatus" label="完成" width="50" >
|
|
@@ -440,17 +479,92 @@
|
|
|
<p v-else style="background: #e62412; color: #fff;text-align: center; border-radius: 3px;">{{scope.row.endDate}}</p>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- </el-table>
|
|
|
- </div>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
+
|
|
|
+ <!-- 关联文件列表 -->
|
|
|
+ <template v-if="isEditFile">
|
|
|
+ <div style="width:100%;margin:1em 0;">
|
|
|
+ <i class="iconfont firerock-icontree" style="color:#20A0ff;margin-left:10px;">相关文件/交付成果</i>
|
|
|
+ <el-link @click="relationFileClick()" style="float:right;margin-left:10px">关联文件</el-link>
|
|
|
+ <el-upload style="float:right;" action="#" :http-request="uploadFileClick" :show-file-list="false" :multiple="false">
|
|
|
+ <el-link>上传文件</el-link>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ v-loading="fileListLoading"
|
|
|
+ ref="filetable"
|
|
|
+ :data="taskFileList"
|
|
|
+ :header-cell-style="{'font-weight':'normal'}"
|
|
|
+ highlight-current-row
|
|
|
+ max-height="240"
|
|
|
+ style="width: 100%;margin-top:10px;margin-bottom:15px">
|
|
|
+ <el-table-column label="序号" prop="documentType" min-width="40" align="center"></el-table-column>
|
|
|
+ <el-table-column label="文件名称" prop="documentName" min-width="180"></el-table-column>
|
|
|
+ <el-table-column label="文件大小" prop="size" min-width="60" align="center"></el-table-column>
|
|
|
+ <el-table-column label="创建人" prop="creatorName" min-width="60" align="center"></el-table-column>
|
|
|
+ <el-table-column label="创建时间" prop="indate" min-width="120" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{scope.row.indate[0] + '-' + scope.row.indate[1] + '-' + scope.row.indate[2] + '\u0020\u0020' + scope.row.indate[3] + ':' + scope.row.indate[4] + ':' + scope.row.indate[5]}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" min-width="90">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-link :href="scope.row.url" :download="scope.row.documentName" type="primary" style="margin-right:7px">下载</el-link>
|
|
|
+ <el-link @click="taskFileDelete(scope.row.id)">删除</el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <!-- 关联文件dialog -->
|
|
|
+ <el-dialog v-if="relationFileDialog" :visible.sync="relationFileDialog" title="关联文件" append-to-body>
|
|
|
+ <span>从文件中心选择已有文件进行关联</span>
|
|
|
+ <div>
|
|
|
+ <span>选择文件</span>
|
|
|
+ <el-select v-model="addFileId">
|
|
|
+ <el-option
|
|
|
+ v-for="item in projectFileList"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.documentName"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ <el-button @click="addTaskFile()">确定</el-button>
|
|
|
+ <!-- <el-button @click="relationFileDialog = false">取消</el-button> -->
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-if="isRelationTab" :visible.sync="isRelationTab" title="添加关联任务" width="800px" append-to-body>
|
|
|
+ <el-form ref="relationItemForm" label-width="100px">
|
|
|
+ <el-form-item label="选择任务" prop="taskType">
|
|
|
+ <el-select v-model="relationvalue" multiple>
|
|
|
+ <el-option
|
|
|
+ v-for="item in relationdata"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="isRelationTab = false">取消</el-button>
|
|
|
+ <el-button type="primary" @click="addRelationTask()">确认</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
+
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button v-if="user.id == this.addForm.createrId || currentProject.inchargerId == user.id" @click.native="deleteTask" style="float:left;">删除</el-button>
|
|
|
<el-button @click.native="addFormVisible = false">取消</el-button>
|
|
|
<el-button type="primary" @click="submitInsert" :loading="addLoading">提交</el-button>
|
|
|
</div>
|
|
|
- <div slot="title" v-if="addForm.parentTid != null" >
|
|
|
+ <div slot="title" v-if="addForm.parentTid != null || isRelationItem" >
|
|
|
<!-- <el-link @click="backToParentTask"><i class="el-icon-arrow-left single_line">返回父级任务</i> | {{addForm.parentTname}}</el-link> -->
|
|
|
- <el-page-header @back="backToParentTask" title="返回父任务" :content="addForm.parentTname"></el-page-header>
|
|
|
+ <el-page-header @back="backToParentTask" :title="timelabel ? '返回里程碑' : '返回父任务'" :content="timelabel ? relationPar.name : addForm.parentTname"></el-page-header>
|
|
|
</div>
|
|
|
<!-- 评论 -->
|
|
|
<div class="remark" v-show="addForm.id != null">
|
|
@@ -509,7 +623,7 @@
|
|
|
<!-- 评论 -->
|
|
|
</el-dialog>
|
|
|
<!-- 子任务列表 -->
|
|
|
- <el-dialog title="查看子任务" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
|
|
|
+ <el-dialog :title="addForm.taskType == 1 ? '查看关联任务' : '查看子任务'" v-if="subTaskVisible" :visible.sync="subTaskVisible" :close-on-click-modal="false" customClass="customWidth" width="800px">
|
|
|
<el-table :data="addForm.subTaskList"
|
|
|
:header-cell-style="{'font-weight':'normal'}"
|
|
|
highlight-current-row v-loading="listLoading" style="width: 100%;margin-top:10px;" @row-click="taskLineClick">
|
|
@@ -696,6 +810,8 @@
|
|
|
import 'quill/dist/quill.bubble.css'
|
|
|
// 导入富文本
|
|
|
import { quillEditor } from 'vue-quill-editor'
|
|
|
+import { error } from 'dingtalk-jsapi';
|
|
|
+import delete$ from 'dingtalk-jsapi/api/biz/cspace/delete';
|
|
|
let id=1;
|
|
|
export default {
|
|
|
name: "two-list-headerslots",
|
|
@@ -853,11 +969,334 @@
|
|
|
checkLists: [], // 选中人数据的ID
|
|
|
taskIid: null,
|
|
|
gstimday:[],
|
|
|
- gstimhour:[]
|
|
|
+ gstimhour:[],
|
|
|
+ timelabel: false,
|
|
|
+ relationdata: [],
|
|
|
+ isRelationTab: false,
|
|
|
+ relationvalue:[],
|
|
|
+ relationSubTaskList:[],
|
|
|
+ relationItemData: null,
|
|
|
+ relationPar:{name: ''},
|
|
|
+ isRelationItem: false,
|
|
|
+
|
|
|
+ // 关联文件
|
|
|
+ fileListLoading:false,
|
|
|
+ projectFileList:[],
|
|
|
+ taskFileList:[],
|
|
|
+ relationFileDialog: false,
|
|
|
+ addFileId: null,
|
|
|
+ isEditFile: false
|
|
|
};
|
|
|
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 0011
|
|
|
+ // test(){
|
|
|
+ // // console.log("test",this.addFileId);
|
|
|
+ // this.getTaskFileList()
|
|
|
+ // },
|
|
|
+ // 关联文件按钮
|
|
|
+ relationFileClick(){
|
|
|
+ this.relationFileDialog = true
|
|
|
+ this.addFileId = null
|
|
|
+ this.getProjectFileList()
|
|
|
+ },
|
|
|
+ // 确认关联文件
|
|
|
+ addTaskFile(){
|
|
|
+ if(this.addFileId == null){
|
|
|
+ this.$message({message: '请选择关联文件' , type: 'warning'})
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.http.post('/task-files/addDocumentRef',{
|
|
|
+ documentId: this.addFileId,
|
|
|
+ taskId: this.addForm.id,
|
|
|
+ projectId: this.curProjectId
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.$message({
|
|
|
+ message: '关联成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.relationFileDialog = false
|
|
|
+ this.getTaskFileList()
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取项目下的文档列表
|
|
|
+ getProjectFileList(){
|
|
|
+ this.http.post('/task-files/getDocumentList',{
|
|
|
+ projectId: this.curProjectId
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.projectFileList = res.data
|
|
|
+ console.log('list',res.data);
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 获取任务下的文档列表
|
|
|
+ getTaskFileList(e,eid){
|
|
|
+ let etaskId
|
|
|
+ if(e == 1){etaskId = eid}
|
|
|
+ else{etaskId = this.addForm.id}
|
|
|
+ this.fileListLoading = true
|
|
|
+ this.http.post('/task-files/getTaskFiles',{
|
|
|
+ taskId: etaskId
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.fileListLoading = false
|
|
|
+ this.taskFileList = res.data
|
|
|
+ console.log('taskFileList',res.data);
|
|
|
+ }else {
|
|
|
+ this.fileListLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.fileListLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 列表的删除按钮
|
|
|
+ taskFileDelete(eid){
|
|
|
+ this.$confirm('是否确定取消关联此文件?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(()=>{
|
|
|
+ this.http.post('/task-files/delete',{
|
|
|
+ id: eid
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ this.$message({
|
|
|
+ message: res.data,
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getTaskFileList()
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }).catch(()=>{
|
|
|
+ this.$message({
|
|
|
+ message: '已取消删除',
|
|
|
+ type: 'info'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 列表的上传按钮
|
|
|
+ uploadFileClick(item){
|
|
|
+ console.log("upload",item.file);
|
|
|
+ let files = new FormData()
|
|
|
+ files.append("projectId",this.curProjectId);
|
|
|
+ files.append("taskId", this.addForm.id);
|
|
|
+ files.append("files", item.file);
|
|
|
+ this.http.uploadFile('/task-files/uploadFile',files,
|
|
|
+ res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ console.log(res);
|
|
|
+ this.$message({
|
|
|
+ message: '已上传',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.getTaskFileList()
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ selchg(){ //类型切换
|
|
|
+ if(this.addForm.taskType == 1){
|
|
|
+ this.timelabel = true
|
|
|
+ }else{
|
|
|
+ this.timelabel = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addRelation(){ //关联任务卡片
|
|
|
+ this.isRelationTab = true
|
|
|
+ this.getrelation()
|
|
|
+
|
|
|
+ },
|
|
|
+ addRelationTask(){ //添加关联任务
|
|
|
+ this.http.post('/task/addMileStoneTask',{
|
|
|
+ milestoneId: this.addForm.id,
|
|
|
+ taskIds: JSON.stringify(this.relationvalue)
|
|
|
+ },
|
|
|
+ res =>{
|
|
|
+ if(res.code == "ok") {
|
|
|
+ this.isRelationTab = false
|
|
|
+ this.$message({
|
|
|
+ message: '添加成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ this.$forceUpdate()
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getRelationTaskList(i,e){ //获取关联任务列表
|
|
|
+ let eid = null
|
|
|
+ if(i){
|
|
|
+ eid = e
|
|
|
+ }else{
|
|
|
+ eid = this.addForm.id
|
|
|
+ }
|
|
|
+ this.http.post('/task/getMilestoneTaskList',{
|
|
|
+ milestoneId: eid
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok') {
|
|
|
+ this.relationSubTaskList = res.data
|
|
|
+ // console.log('res',res.data);
|
|
|
+ }else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getrelation(){ //获取选择关联列表
|
|
|
+ this.http.post('/task/getTaskOnlyList',{
|
|
|
+ projectId: this.curProjectId
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.relationdata = []
|
|
|
+ res.data.forEach( (item) =>{
|
|
|
+ if(item.taskType != 1){
|
|
|
+ this.relationdata.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ // console.log('map',this.relationdata);
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 里程碑关联任务列表
|
|
|
+
|
|
|
+ // 解除关联
|
|
|
+ deleteRelationItem(eid){
|
|
|
+ this.listLoading = true
|
|
|
+ this.http.post('/task/removeMileStoneTask',{
|
|
|
+ id: eid
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok') {
|
|
|
+ this.getRelationTaskList()
|
|
|
+ this.listLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: '解除成功',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.listLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.listLoading = false
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 关联任务列表是否完成修改
|
|
|
+ relationFinishTask(row){
|
|
|
+ this.http.post('/task/finish',{
|
|
|
+ id: row.taskId,
|
|
|
+ taskStatus: row.taskStatus
|
|
|
+ },res => {
|
|
|
+ if(res.code == 'ok'){
|
|
|
+ if(this.groupType == 0){
|
|
|
+ this.getStageList();
|
|
|
+ }else {
|
|
|
+ this.getViewTaskList();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
//保存分组负责人
|
|
|
saveGroupIncharger() {
|
|
|
this.http.post('/task-group/saveGroupIncharger', {id: this.groupForm.id, inchargerId: this.groupForm.inchargerId},
|
|
@@ -1307,12 +1746,21 @@
|
|
|
showSubTaskList(task) {
|
|
|
this.subTaskVisible = true;
|
|
|
this.addForm = task;
|
|
|
+ // console.log('click',task.subTaskList);
|
|
|
},
|
|
|
backToParentTask() {
|
|
|
- this.getTaskDetail(this.addForm.parentTid);
|
|
|
+ // this.getTaskDetail(this.addForm.parentTid);
|
|
|
+ this.getTaskDetail(this.timelabel ? this.relationPar.id : this.addForm.parentTid);
|
|
|
+ if(this.timelabel){
|
|
|
+ this.isRelationItem = false
|
|
|
+ // this.relationPar = {name: ''}
|
|
|
+ this.getRelationTaskList(1, this.relationPar.id)
|
|
|
+ this.gain(this.relationPar)
|
|
|
+ }
|
|
|
},
|
|
|
//显示子任务创建卡片
|
|
|
addSubTask() {
|
|
|
+ if(this.isRelationItem){return}
|
|
|
this.addFormVisible = true;
|
|
|
this.addForm = {parentTname: this.addForm.name,parentTid: this.addForm.id,projectId: this.addForm.projectId, groupId: this.addForm.groupId, taskLevel:0, planHours: 8, taskType: 0};
|
|
|
this.addForm.executorListFront = [{executorId:null, planHours:8}];
|
|
@@ -1339,6 +1787,7 @@
|
|
|
});
|
|
|
},
|
|
|
taskLineClick(row, column, event) {
|
|
|
+ if(this.isRelationItem){return}
|
|
|
this.editTask(row);
|
|
|
},
|
|
|
//排序发生改变
|
|
@@ -1457,20 +1906,45 @@
|
|
|
},
|
|
|
// 点击卡片事件
|
|
|
editTask(task) {
|
|
|
- console.log(task)
|
|
|
+ // console.log('editTask',task)
|
|
|
+ if(task.taskType == 1){
|
|
|
+ this.timelabel = true
|
|
|
+ this.isRelationItem = false
|
|
|
+ }else{
|
|
|
+ this.timelabel = false
|
|
|
+ }
|
|
|
this.addFormVisible = true;
|
|
|
+ this.isEditFile = true;
|
|
|
this.addLoading = false;
|
|
|
this.title = "编辑任务";
|
|
|
this.getTaskDetail(task.id);
|
|
|
this.getTaskProgressList(task.id); // 获取任务进展列表
|
|
|
this.getUsers(); // 获取名单数据
|
|
|
this.gain(task); // 获取评论列表
|
|
|
+ this.getRelationTaskList(1, task.id)
|
|
|
+ this.getTaskFileList(1,task.id)
|
|
|
},
|
|
|
+ // 关联任务点击事件
|
|
|
+ relationTaskClick(row,column,event){
|
|
|
+ // console.log('relationTaskClick',row);
|
|
|
+ this.relationPar = JSON.parse(JSON.stringify(this.addForm))
|
|
|
+ // console.log(this.relationPar);
|
|
|
+ this.addFormVisible = true;
|
|
|
+ this.addLoading = false;
|
|
|
+ this.isRelationItem = true;
|
|
|
+ this.isEditFile = true;
|
|
|
+ this.title = "编辑任务";
|
|
|
+ this.getTaskDetail(row.taskId);
|
|
|
+ this.getUsers();
|
|
|
+ this.gain(row,1);
|
|
|
+ this.getRelationTaskList(1, row.taskId)
|
|
|
+ this.getTaskFileList(1,row.taskId)
|
|
|
+ },
|
|
|
// 获取评论列表
|
|
|
- gain (task) {
|
|
|
+ gain (task,e) {
|
|
|
this.commentList = [];
|
|
|
- this.taskId = task.id;
|
|
|
- this.http.post('/task-comment/getList', {taskId: task.id},
|
|
|
+ this.taskId = e == 1 ? task.taskId : task.id;
|
|
|
+ this.http.post('/task-comment/getList', {taskId: e == 1 ? task.taskId : task.id},
|
|
|
res => {
|
|
|
if (res.code == "ok") {
|
|
|
this.commentList = res.data
|
|
@@ -1575,23 +2049,43 @@
|
|
|
this.gstimhour = [this.user.timeType.allday]
|
|
|
this.gstimday = [1]
|
|
|
this.addLoading = false;
|
|
|
+ this.isEditFile = false;
|
|
|
this.title="创建任务";
|
|
|
this.commentList = [];
|
|
|
},
|
|
|
- addExecutorLine() {
|
|
|
- if (this.addForm.executorListFront == null) {
|
|
|
- this.addForm.executorListFront = [];//初始化
|
|
|
- }
|
|
|
- this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
|
|
|
- this.gstimday.push(1)
|
|
|
- this.gstimhour.push(this.user.timeType.allday)
|
|
|
- this.$forceUpdate();
|
|
|
+ addExecutorLine(e) {
|
|
|
+ if(e == 1){
|
|
|
+ if (this.relationItemData.executorList == null) {
|
|
|
+ this.relationItemData.executorList = [];//初始化
|
|
|
+ }
|
|
|
+ this.relationItemData.executorList.push({executorId:null, planHours:this.user.timeType.allday});
|
|
|
+ this.gstimday.push(1)
|
|
|
+ this.gstimhour.push(this.user.timeType.allday)
|
|
|
+ this.$forceUpdate();
|
|
|
+ }else{
|
|
|
+ if (this.addForm.executorListFront == null) {
|
|
|
+ this.addForm.executorListFront = [];//初始化
|
|
|
+ }
|
|
|
+ this.addForm.executorListFront.push({executorId:null, planHours:this.user.timeType.allday});
|
|
|
+ this.gstimday.push(1)
|
|
|
+ this.gstimhour.push(this.user.timeType.allday)
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
- removeExecutorLine(index) {
|
|
|
- this.addForm.executorListFront.splice(index,1);
|
|
|
- this.gstimday.splice(index,1)
|
|
|
- this.gstimhour.splice(index,1)
|
|
|
- this.$forceUpdate();
|
|
|
+ removeExecutorLine(index,e) {
|
|
|
+ if(e == 1){
|
|
|
+ this.relationItemData.executorList.splice(index,1);
|
|
|
+ this.gstimday.splice(index,1)
|
|
|
+ this.gstimhour.splice(index,1)
|
|
|
+ this.$forceUpdate();
|
|
|
+ }else{
|
|
|
+ this.addForm.executorListFront.splice(index,1);
|
|
|
+ this.gstimday.splice(index,1)
|
|
|
+ this.gstimhour.splice(index,1)
|
|
|
+ this.$forceUpdate();
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
renameStage(item) {
|
|
|
this.stageForm = JSON.parse(JSON.stringify(item));
|
|
@@ -1645,6 +2139,7 @@
|
|
|
});
|
|
|
},
|
|
|
timess(){
|
|
|
+ // console.log('timess');
|
|
|
var date = new Date()
|
|
|
let Y = date.getFullYear()
|
|
|
let M = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : (date.getMonth() + 1)
|
|
@@ -1692,7 +2187,7 @@
|
|
|
this.selectedGroup = this.groupList.filter(g=>g.id == index)[0];
|
|
|
this.getStageList();
|
|
|
this.displayTable = false;
|
|
|
- console.log("1223");
|
|
|
+ // console.log("1223");
|
|
|
this.$forceUpdate()
|
|
|
},
|
|
|
//本地搜索组
|
|
@@ -2058,6 +2553,7 @@
|
|
|
this.$refs.form1.validate(valid => {
|
|
|
if (valid) {
|
|
|
delete this.addForm.subTaskList;
|
|
|
+ delete this.addForm.refTaskList;
|
|
|
delete this.addForm.progress;
|
|
|
this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
|
|
|
this.addLoading = true;
|
|
@@ -2109,7 +2605,7 @@
|
|
|
}
|
|
|
this.$forceUpdate()
|
|
|
}
|
|
|
- console.log("gstimday",this.gstimday);
|
|
|
+ // console.log("gstimday",this.gstimday);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -2203,7 +2699,12 @@
|
|
|
|
|
|
|
|
|
<style >
|
|
|
-
|
|
|
+.taskCardCircleBox{
|
|
|
+ padding-left: 5px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: left;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
.flip-list-move {
|
|
|
transition: transform 0.5s;
|
|
|
}
|