|
@@ -147,13 +147,15 @@
|
|
|
<el-tooltip class="item" effect="dark" :content="element.name" placement="top">
|
|
|
<label class="task_name" :style="'background:'+(element.taskStatus==0?'#ffffff;':'#eFeFeF;')"><span>{{element.name}}</span></label>
|
|
|
</el-tooltip>
|
|
|
- <span v-if="element.executorName != null" :style="'background:'+element.executorColor" class="user_name_icon">{{element.executorName.length>2?element.executorName.substring(element.executorName.length-2, element.executorName.length):element.executorName}}</span>
|
|
|
- <el-button v-if="element.executorName == null" 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>
|
|
|
+ <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-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>
|
|
|
- <i :class="taskTypeIcon[element.taskType]" :style="'float:right;color:'+taskTypeColor[element.taskType]+';margin-right:8px;'" ></i>
|
|
|
+ <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>
|
|
|
+ </span>
|
|
|
+ <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">
|
|
@@ -265,22 +267,26 @@
|
|
|
<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="执行人">
|
|
|
- <el-select v-model="addForm.executorId" filterable placeholder="请选择执行人" style="width:100%;" >
|
|
|
- <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
+
|
|
|
<el-form-item label="开始时间" 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"></el-date-picker>
|
|
|
- <span style="margin-left:30px;margin-right:10px;">计划工时</span>
|
|
|
- <el-input-number :disabled="this.addForm.id != null && user.id != this.addForm.createrId && currentProject.inchargerId != user.id" v-model="addForm.planHours" style="width:30%;" :min="1" :max="100" placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="截止时间" prop="endDate">
|
|
|
- <el-date-picker v-model="addForm.endDate" type="date" style="width:40%;" value-format="yyyy-MM-dd"
|
|
|
+ <span style="margin-left:30px;margin-right:10px;">截止时间</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"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <div style="border: 1px solid #ddd;margin:5px 0;padding:5px 0;">
|
|
|
+ <el-form-item :label="'执行人'+(index+1)" v-for="(executorItem, index) in addForm.executorListFront" :key="index">
|
|
|
+ <el-select v-model="executorItem.executorId" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" size="small" filterable placeholder="请选择执行人" style="width:40%;" @change="$forceUpdate()">
|
|
|
+ <el-option v-for="item in users" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ <span style="margin-left:30px;margin-right:10px;">计划工时</span>
|
|
|
+ <el-input-number size="small" :disabled="addForm.id != null && user.id != addForm.createrId && currentProject.inchargerId != user.id" v-model="executorItem.planHours" style="width:30%;" :min="1" :max="100" placeholder="请输入计划工作时长,单位小时" ></el-input-number ><span style="margin-left:10px;">小时</span>
|
|
|
+ <!--移除执行人 -->
|
|
|
+ <i class="el-icon-delete" v-if="index>0 && (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id)" style="margin-left:5px" @click="removeExecutorLine(index)"></i>
|
|
|
</el-form-item>
|
|
|
-
|
|
|
+ <el-link type="primary" v-if="(addForm.executorListFront == null || addForm.executorListFront.length<10)&& (addForm.id == null|| user.id == addForm.createrId || currentProject.inchargerId == user.id)" style="margin-left:35px;" @click="addExecutorLine">添加执行人</el-link>
|
|
|
+ </div>
|
|
|
<el-form-item label="优先级">
|
|
|
<el-select v-model="addForm.taskLevel" style="width:100%;" >
|
|
|
<el-option v-for="item in importanceList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
@@ -612,16 +618,16 @@
|
|
|
<el-form-item prop="name">
|
|
|
<el-input v-model="templateForm.name" placeholder="请输入模板名称" maxlength="12"
|
|
|
show-word-limit clearable></el-input>
|
|
|
- <!-- <div>
|
|
|
+ <div>
|
|
|
<span style="margin-right:20px">同时保存</span>
|
|
|
<el-checkbox v-model="templateForm.saveTask" label="任务"></el-checkbox>
|
|
|
- <el-checkbox v-model="templateForm.saveRisk" label="风险"></el-checkbox>
|
|
|
<el-checkbox v-model="templateForm.saveMileStone" label="里程碑"></el-checkbox>
|
|
|
- </div> -->
|
|
|
+ <el-checkbox v-model="templateForm.saveRisk" label="风险"></el-checkbox>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
- <el-button type="primary" @click="createTemplate" style="width:100%;" >存为模板</el-button>
|
|
|
+ <el-button type="primary" @click="createTemplate" style="width:100%;" :loading="saveTemplateLoading">存为模板</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
@@ -709,6 +715,7 @@
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ saveTemplateLoading: false,
|
|
|
joinMembList:[],
|
|
|
setInchargerDialog: false,
|
|
|
recentProgressInfo:{},
|
|
@@ -789,7 +796,7 @@
|
|
|
},
|
|
|
sleectId: null,
|
|
|
sleectProjectId: null,
|
|
|
- sidebarIndex: null, // 侧边栏索引
|
|
|
+ sidebarIndex: 0, // 侧边栏索引
|
|
|
url: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
|
|
|
count: 0,
|
|
|
textarea2: '',
|
|
@@ -896,8 +903,10 @@
|
|
|
},
|
|
|
//创建模板
|
|
|
createTemplate() {
|
|
|
+ this.saveTemplateLoading = true;
|
|
|
this.http.post('/group-template/addTemplate', this.templateForm,
|
|
|
res => {
|
|
|
+ this.saveTemplateLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
this.addToTmpDialog = false;
|
|
|
this.getGroupTemplate();
|
|
@@ -1297,6 +1306,7 @@
|
|
|
addSubTask() {
|
|
|
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}];
|
|
|
this.addLoading = false;
|
|
|
},
|
|
|
//认领任务
|
|
@@ -1518,6 +1528,9 @@
|
|
|
this.addForm.indate = null;
|
|
|
this.addLoading = false;
|
|
|
this.recentProgressInfo = this.addForm.progress;
|
|
|
+ this.addForm.executorListFront = this.addForm.executorList;
|
|
|
+ //删除中间传值的变量数组
|
|
|
+ delete this.addForm.executorList;
|
|
|
} else {
|
|
|
this.$message({
|
|
|
message: res.msg,
|
|
@@ -1535,10 +1548,23 @@
|
|
|
addTask(stage) {
|
|
|
this.addFormVisible = true;
|
|
|
this.addForm = {projectId: stage.projectId, groupId: stage.groupId, stagesId: stage.id, taskLevel:0, planHours: 8, taskType: 0};
|
|
|
+ this.addForm.executorListFront = [{executorId:null, planHours:8}];
|
|
|
+
|
|
|
this.addLoading = false;
|
|
|
this.title="创建任务";
|
|
|
this.commentList = [];
|
|
|
},
|
|
|
+ addExecutorLine() {
|
|
|
+ if (this.addForm.executorListFront == null) {
|
|
|
+ this.addForm.executorListFront = [];//初始化
|
|
|
+ }
|
|
|
+ this.addForm.executorListFront.push({executorId:null, planHours:8});
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
+ removeExecutorLine(index) {
|
|
|
+ this.addForm.executorListFront.splice(index,1);
|
|
|
+ this.$forceUpdate();
|
|
|
+ },
|
|
|
renameStage(item) {
|
|
|
this.stageForm = JSON.parse(JSON.stringify(item));
|
|
|
this.addStageDialog = true;
|
|
@@ -1692,7 +1718,6 @@
|
|
|
var param = JSON.parse(JSON.stringify(this.groupTemplateList.filter(g=>g.selected)[0]));
|
|
|
delete param.stagesList;
|
|
|
param.projectId = this.curProjectId;
|
|
|
- //
|
|
|
var k = this.groupTemplateList[this.sidebarIndex].name
|
|
|
var s = null;
|
|
|
var xmz = this.groupList.forEach(function(a, b, c){
|
|
@@ -1703,6 +1728,10 @@
|
|
|
})
|
|
|
if (s){
|
|
|
this.addGroupDialog = false;
|
|
|
+ this.$message({
|
|
|
+ message: '当前项目已存在分组['+k+'],请修改组名后重试。',
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
return
|
|
|
}
|
|
|
//
|
|
@@ -1971,12 +2000,35 @@
|
|
|
message: '图片太大,请重新上传',
|
|
|
type: 'warning'
|
|
|
});
|
|
|
+ //检查是有重名的执行人
|
|
|
+ var exeList = this.addForm.executorListFront;
|
|
|
+ for (var i=0;i<exeList.length;i++) {
|
|
|
+ var findSameUser = false;
|
|
|
+ for (var j=i+1;j<exeList.length; j++) {
|
|
|
+ if (exeList[i].executorId && exeList[j].executorId && exeList[i].executorId == exeList[j].executorId) {
|
|
|
+ findSameUser = true;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (findSameUser) {
|
|
|
+ return this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '执行人存在重复',
|
|
|
+ type: 'error'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
this.$refs.form1.validate(valid => {
|
|
|
if (valid) {
|
|
|
delete this.addForm.subTaskList;
|
|
|
delete this.addForm.progress;
|
|
|
+ this.addForm.executorListStr = JSON.stringify(this.addForm.executorListFront);
|
|
|
+ this.addLoading = true;
|
|
|
this.http.post('/task/save',this.addForm,
|
|
|
res => {
|
|
|
+ this.addLoading = false;
|
|
|
if (res.code == "ok") {
|
|
|
this.$message({
|
|
|
message: "提交成功",
|