| | |
| | | /> |
| | | </div> |
| | | <div v-loading="infinite" class="infinite-list" style="overflow:auto;height:500px"> |
| | | <el-card v-for="task in taskDatas" :key="task.id" class="box-card" :class="{ 'active': task === selectedTask }" style="margin-bottom: 10px;" shadow="hover"> |
| | | <el-card v-for="task in taskDatas" :key="task.id" class="box-card" :class="{ 'active': task === selectedTask }" style="margin-bottom: 10px;cursor:pointer" shadow="hover"> |
| | | <el-tooltip class="item" effect="dark" placement="top-start" :open-delay="1000" enterable> |
| | | <div slot="content" class="slot-style"> |
| | | <div @click="showTaskDetail(task)"> |
| | | <h4>查看详细</h4> |
| | | <h4 style="cursor: pointer;">查看详细</h4> |
| | | </div> |
| | | </div> |
| | | <div @click="handleNodeClick(task)"> |
| | |
| | | @closed="setNull" |
| | | @close="dialogVisible_taskUser = false" |
| | | > |
| | | <div v-if="!dialogVisible_taskUser"> |
| | | <el-card> |
| | | |
| | | <div v-if="steps.length > 0" v-loading="dialogLoading_taskUser"> |
| | | <el-card v-if="steps.length > 0"> |
| | | <div style="width: 35%;float: left"> |
| | | 任务名称:{{ TaskName }} |
| | | <p v-for="(item,index) in taskUserDetail" :key="index"> |
| | | {{ index }} 共消耗 {{ item }} 工时 |
| | | </p> |
| | | </div> |
| | | <div style="width: 65%;float: right"> |
| | | <el-progress :percentage="taskProgress" style="width: 80%;margin-left: 55px" :color="ProgressStatus" :format="formatTaskProgress" /> |
| | | <br> |
| | | <i>任务预计时长:{{ expectedHours }}小时</i><i style="margin-left: 40px">任务实际用时:{{ actualHours }}小时</i> |
| | | </div> |
| | | </el-card> |
| | | </div> |
| | | <br> |
| | |
| | | <el-tooltip class="item" effect="light" :open-delay="1000" placement="top" :disabled="!flag"> |
| | | <div slot="content" class="slot-style"> |
| | | <div @click="showDetail(scope.row)"> |
| | | <h4>查看详情</h4> |
| | | <h4 style="cursor: pointer;">查看详情</h4> |
| | | </div> |
| | | </div> |
| | | <el-tag v-if="scope.row.userNickName">{{ scope.row.userNickName }}</el-tag> |
| | | <el-tag v-if="scope.row.userNickName" style="cursor: pointer;">{{ scope.row.userNickName }}</el-tag> |
| | | <el-tag v-else>未指定</el-tag> |
| | | </el-tooltip> |
| | | </template> |
| | |
| | | </el-table> |
| | | <!--表格渲染--> |
| | | <!--分页组件--> |
| | | <pagination /> |
| | | <!--表单组件--> |
| | | <el-dialog :close-on-click-modal="false" :before-close="closeGenerate" :visible.sync="generateStatus" title="导入任务分配信息" width="720px"> |
| | | <el-form ref="generateForm" size="small" label-width="80px"> |
| | |
| | | dialogLoading_task: true, |
| | | steps: [], |
| | | TaskName: '', |
| | | expectedHours: '', |
| | | actualHours: '', |
| | | taskUserDetail: {}, |
| | | taskDetail: {} |
| | | taskDetail: {}, |
| | | taskProgress: '', |
| | | ProgressStatus: '' |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | showDetail(e) { |
| | | this.dialogVisible_taskUser = true |
| | | this.TaskName = e.name |
| | | this.expectedHours = e.performanceHours |
| | | this.actualHours = 0 |
| | | // 发送taskUser,获取所有的日报信息,并在后台进行处理,将处理后的结果返回给前端的steps中,进行显示 |
| | | crudTaskUser.getTaskUserDetail(e.id).then(res => { |
| | | this.steps = res |
| | | for (let i = 0; i < this.steps.length; i++) { |
| | | this.taskUserDetail[this.steps[i].taskUserName] = this.steps[i].alreadyConsumeHours |
| | | } |
| | | // console.log(this.taskUserDetail) |
| | | // this.taskUserDetail.map((key, value) => { |
| | | // console.log(key) |
| | | // console.log(value) |
| | | // }) |
| | | |
| | | // var key = this.taskUserDetail.keySet(); |
| | | for (var key in this.taskUserDetail) { |
| | | this.actualHours += this.taskUserDetail[key] |
| | | } |
| | | |
| | | this.taskProgress = Math.round(this.actualHours / this.expectedHours * 100) |
| | | if (this.taskProgress > 100) { |
| | | this.taskProgress = 100 |
| | | } |
| | | if (this.taskProgress === 100) { |
| | | this.ProgressStatus = '#F56C6C' |
| | | } |
| | | if (this.taskProgress < 100) { |
| | | this.ProgressStatus = '#409EFF' |
| | | } |
| | | // this.taskUserDetail.forEach(function(value,key){ |
| | | // console.log(value,key); |
| | | // }); |
| | | this.dialogLoading_taskUser = false |
| | | }) |
| | | }, |
| | |
| | | } |
| | | this.dialogLoading_task = false |
| | | }) |
| | | }, |
| | | formatTaskProgress(percentage) { |
| | | return percentage === 100 ? '实际消耗已超出计划时长' : `${percentage}%` |
| | | } |
| | | } |
| | | } |