123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634 |
- <template>
- <div>
- <div class="table-top">
- <label>{{ name }}的任务</label>
- <span class="new-tab-open">
- <el-switch
- v-model="newTabOpen"
- active-text="新标签页跳转"
- />
- </span>
- </div>
- <el-row v-if="!showHeader" class="select-main" type="flex" align="center">
- <el-col :span="1" class="flex-align-center">
- <el-checkbox v-model="planChecked" class="plan-checked" @change="changeCheck" />
- </el-col>
- <el-col :span="3" class="item-checked">已选择<span style="color: #409EFF">{{ curcentChecked }}</span>个</el-col>
- <el-col :span="1" class="item-line">|</el-col>
- <el-col :span="2" class="item-click" @click.native="addSechedule()"><img :src="imgUrl">添加排期</el-col>
- <el-col :span="2" class="item-click" @click.native="handlePlan('test')"><img :src="imgUrl">提测</el-col>
- <el-col :span="2" class="item-click" @click.native="handlePlan('allow')"><img :src="imgUrl">准出</el-col>
- <el-col :span="4" class="item-click" @click.native="handlePlan('daily')"><img :src="imgUrl">建立测试日报</el-col>
- <el-col :span="4" class="item-click" @click.native="handlePlan('cancel')">取消选择</el-col>
- </el-row>
- <el-table
- ref="planTable"
- :data="all_task"
- style="width: 100%;"
- size="mini"
- row-key="id"
- :header-cell-style="{ color: 'rgb(74, 74, 74)', fontSize: '14px', fontWeight: '500'}"
- :row-style="{ fontSize: '14px' }"
- show-overflow-tooltip="true"
- :show-header="showHeader"
- :header-row-style="{height: '50px'}"
- @selection-change="handleSelectionChange"
- >
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="优先级" prop="priority" width="90" sortable align="center">
- <template slot-scope="scope" style="text-align: center;">
- <span class="div_priority" :class="scope.row.priorityString">
- {{ scope.row.priorityString }}
- </span>
- </template>
- </el-table-column>
- <el-table-column label="任务名称" min-width="250" align="left" show-overflow-tooltip>
- <template slot-scope="scope">
- <div class="task-main">
- <span class="task-id">TASK-{{ scope.row.id }}
- <span
- v-if="scope.row.tagNotification !== null"
- :class="{
- 'tagNotification': scope.row.tagType === 0,
- 'tagNotification1': scope.row.tagType === 1
- }"
- >
- {{ scope.row.tagNotification }}
- </span>
- </span>
- <span class="task-title" @click="link_task(scope.row.id)">{{ scope.row.name }}</span>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="状态" width="150" align="center">
- <template slot-scope="scope">
- <el-select
- v-model="scope.row.status"
- :class="{
- 'status0':scope.row.status===0,
- 'status1':scope.row.status > 0 && scope.row.status <100,
- 'status2':scope.row.status===100,
- 'public_btn':scope.row.status!==10 || scope.row.status!==40 || scope.row.status!==20 || scope.row.status!==30,
- 'public_btn1':scope.row.status===40,
- 'public_btn2':scope.row.status===10,
- 'public_btn3':scope.row.status===20 || scope.row.status===30
- }"
- size="mini"
- @change="changeStatus(scope.row)"
- >
- <el-option v-for="item in scope.row.availableStatusList" :key="item.code" :label="item.name" :value="item.code" />
- </el-select>
- </template>
- </el-table-column>
- <el-table-column label="开发负责人" width="100" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.rdObject ? scope.row.rdObject.name : '' }}</template>
- </el-table-column>
- <el-table-column label="测试负责人" width="100" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.qaObject ? scope.row.qaObject.name : '' }}</template>
- </el-table-column>
- <el-table-column label="交付日期" width="150" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.optionsObject ? scope.row.optionsObject.endTime : '' }}</template>
- </el-table-column>
- <el-table-column label="所属模块" width="200" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.moduleInfoName }}</template>
- </el-table-column>
- <el-table-column label="跟版客户端" width="150" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.involveAppString || '无' }}</template>
- </el-table-column>
- <el-table-column label="缺陷数量" width="100" align="center" show-overflow-tooltip>
- <template slot-scope="scope">{{ scope.row.bugCount }}</template>
- </el-table-column>
- <el-table-column label="任务进度" width="150" align="center">
- <template slot-scope="scope">
- <el-progress :percentage="Number(scope.row.rate && scope.row.rate.substring(0,4))" color="#409eff" />
- </template>
- </el-table-column>
- </el-table>
- <div align="right">
- <el-pagination
- :page-sizes="[15, 30, 45, total]"
- :current-page.sync="pages.curIndex"
- :page-size="pages.pageSize"
- background
- layout="total, sizes, prev, pager, next, jumper"
- :total="total"
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- />
- </div>
- <TestReport v-if="dialogTestReport" ref="TestReport" />
- <DailyReport v-if="dialogDailyReport" ref="DailyReport" />
- <ReleaseReport v-if="dialogClientReport" ref="ClientReport" />
- <task-dialog v-if="showTaskDialog" :show.sync="showTaskDialog" :task-id="taskId.id" :status-name="taskId.statusString" @getList="getNew" />
- <!-- 批量排期 -->
- <modify-schedule
- v-if="visibleSchedule"
- :visible.sync="visibleSchedule"
- :select-task-list="selectTaskList"
- title="新建排期"
- @update="get_allTask()"
- />
- </div>
- </template>
- <script>
- import imgUrl from '@/assets/建立档案@2x.png'
- import '@/styles/PublicStyle/index.scss'
- import TestReport from '@/views/reportManagement/components/TestingReport' // 提测
- import DailyReport from '@/views/reportManagement/components/DailyReport' // 日报
- import ReleaseReport from '@/views/reportManagement/components/ReleaseReport' // 准出
- import { taskUpdate } from '@/api/projectViewDetails'
- import { configShowTaskEnum, configShowTaskStatusEnum, taskList } from '@/api/taskIndex'
- import modifySchedule from '@/views/projectManage/projectList/components/modifySchedule'
- import taskDialog from '@/views/projectManage/taskList/dialog/taskDialog' // 任务状态修改(已上线/已提测/已准出)
- import { dailyReportCheckStatus, reportreleaseCheckStatus, reportdelivertestCheckStatus } from '@/api/reportTemplate'
- export default {
- components: {
- TestReport,
- DailyReport,
- ReleaseReport,
- taskDialog,
- modifySchedule
- },
- props: {
- idList: {
- type: Array,
- default: () => [],
- required: true
- },
- name: {
- type: String,
- default: '',
- required: false
- }
- },
- data() {
- return {
- newTabOpen: true, // 是否新的tab页打开
- imgUrl: imgUrl,
- tableList: [], // 排期bable验证
- showTaskDialog: false, // 状态弹窗
- all_task: [], // 任务列表
- allStatus: [], // 任务所有状态
- taskScheduleEvent: [], // 排期类型
- showHeader: true, // 任务列表的表头是否显示
- curcentList: [], // 当前已选择的列表
- curcentChecked: 0, // 当前已选择的数量
- planChecked: false,
- planHandleType: '', // 任务列表操作类型
- dialogTestReport: false, // 提测
- dialogDailyReport: false, // 日报
- dialogClientReport: false, // 准出
- changeStatusDate: null, // 状态改变时间
- nowChangeTask: null, // 当前正在改变的任务对象
- taskId: '', // 将要修改状态的任务id
- visibleSchedule: false, // 排期弹框
- selectTaskList: [], // 已选任务的id
- total: 0,
- status: null, // 列表状态
- pages: {
- pageSize: 15,
- curIndex: 1
- }
- }
- },
- watch: {
- idList: {
- handler(newV) {
- this.get_allTask()
- },
- deep: true
- },
- name: {
- handler(newV) {},
- immediate: true
- }
- },
- created() {
- this.getTaskStatus()
- },
- methods: {
- setStatus(val) {
- this.status = val
- this.pages.curIndex = 1
- this.get_allTask()
- },
- handleSizeChange(val) {
- this.pageSize = val
- this.get_allTask()
- },
- handleCurrentChange(val) {
- this.curIndex = val
- this.get_allTask()
- },
- async get_allTask() { // 获取全部任务
- if (this.idList.length === 0) {
- this.all_task = []
- return
- }
- const res = await taskList({ ids: this.idList, ...this.pages })
- if (res && res.code === 200) {
- this.all_task = res.data
- this.total = res.total
- }
- },
- async getTaskStatus() { // 获取任务状态列表
- const res = await configShowTaskEnum()
- if (res.code === 200) {
- this.taskScheduleEvent = res.data.taskScheduleEvent || []
- }
- const res1 = await configShowTaskStatusEnum(localStorage.getItem('bizId'))
- if (res1.code === 200) {
- this.allStatus = res1.data.taskStatus
- }
- },
- changeCheck(val) {
- if (val) {
- this.all_task.forEach(row => {
- this.$refs.planTable.toggleRowSelection(row, true)
- })
- } else {
- this.$refs.planTable.clearSelection()
- }
- },
- async changeStatus(e) { // 状态改变
- if (e.status === 70 || e.status === 90 || e.status === 100) {
- this.taskId = e
- this.allStatus.map(item => {
- item.code === e.status ? this.taskId.statusString = item.msg : ''
- })
- this.showTaskDialog = true
- this.nowChangeTask = e
- return
- } else {
- const user = {
- name: localStorage.getItem('username'),
- ename: localStorage.getItem('realname'),
- id: ''
- }
- const taskInfoDO = e
- const resTask = await taskUpdate({ taskInfoDO, user })
- if (resTask.code === 200) {
- this.$message({ message: '修改成功', type: 'success', offset: 150 })
- // this.get_allTask()
- this.$emit('change', '任务')// 通知父组件,让父组件去执行子组件的数据更新
- }
- }
- },
- getNew() { // 状态改变成功回调
- this.$emit('change', '任务')// 通知父组件,让父组件去执行子组件的数据更新
- },
- handleSelectionChange(val) { // 任务列表删选操作
- this.tableList = []
- this.tableList = val
- val.length > 0 ? this.showHeader = false : this.showHeader = true
- this.curcentChecked = val.length
- this.curcentList = val
- if (val.length === this.all_task.length) {
- this.planChecked = true
- }
- },
- handlePlan(type) { // 任务列表操作
- this.planHandleType = type
- switch (type) {
- case 'test':
- this.filtrateTest()
- break
- case 'allow':
- this.filtrateAllow()
- break
- case 'daily':
- this.filtrateDaily()
- break
- case 'cancel':
- this.$refs.planTable.clearSelection()
- break
- }
- },
- addSechedule() { // 添加排期
- const taskA = []
- this.tableList.map(item => {
- if (item.isScheduleLocked === 1) {
- taskA.push(item.taskIdSting)
- }
- })
- if (taskA.length !== 0) {
- this.$message({ message: '任务 ' + taskA + ' 的排期已锁定,请先解锁排期后再添加排期', type: 'warning', offset: 150 })
- return
- }
- this.visibleSchedule = true
- this.selectTaskList = this.curcentList
- },
- async filtrateTest() { // 提测筛选
- const data = this.curcentList.map(item => { return item.id })
- const res = await reportdelivertestCheckStatus(data)
- if (res.code === 200) {
- this.dialogTestReport = true
- this.$nextTick(() => {
- this.$refs.TestReport.init(7, this.curcentList.map(item => { return item.id }))
- })
- }
- },
- async filtrateAllow() { // 准出筛选
- const data = this.curcentList.map(item => { return item.id })
- const res = await reportreleaseCheckStatus(data)
- if (res.code === 200) {
- this.dialogClientReport = true
- this.$nextTick(() => {
- this.$refs.ClientReport.init(7, this.curcentList.map(item => { return item.id }))
- })
- }
- },
- async filtrateDaily() { // 建立日报
- const data = this.curcentList.map(item => { return item.id })
- const res = await dailyReportCheckStatus(data)
- if (res.code === 200) {
- this.dialogDailyReport = true
- this.$nextTick(() => {
- this.$refs.DailyReport.init(7, this.curcentList.map(item => { return item.id }))
- })
- }
- },
- link_task(id) { // 跳转到任务详情页
- if (this.newTabOpen) {
- const newTab = this.$router.resolve({ name: '任务详情', query: { id: id }})
- window.open(newTab.href, '_blank')
- } else {
- this.$router.push({ name: '任务详情', query: { id: id }})
- }
- }
- }
- }
- </script>
- <style scoped>
- .tagNotification {
- background: rgba(255,137,82,15%);
- color: #FF8952;
- padding: 0 5px;
- border-radius: 8px;
- margin-left: 10px;
- }
- .tagNotification1 {
- background: rgba(245,108,108,17%);
- color: #F56C6C;
- padding: 0 5px;
- border-radius: 8px;
- margin-left: 10px;
- }
- </style>
- <style lang="scss" scoped>
- @mixin setStatus($color) {
- input {
- color:$color;
- border: 1px solid $color;
- }
- >>> .el-select__caret{
- color:$color;
- }
- >>> .el-input__inner{
- color:$color;
- border-color: $color;
- }
- >>> .el-input__inner:focus {
- border-color: $color;
- }
- }
- >>>.el-row .el-col {
- margin: 10px 0;
- }
- .table-top {
- color: #333333;
- font-size: 16px;
- width: 100%;
- padding: 10px 15px 0 15px;
- display: flex;
- justify-content: space-between;
- }
- .task-main {
- display: flex;
- flex-direction: column;
- .task-title {
- cursor: pointer;
- color: #666666;
- font-size: 14px;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- .task-id {
- color: #A7AEBC;
- font-size: 10px;
- }
- }
- .color-blue {
- color:#409EFF;
- }
- .P0 {
- background-color: #F56C6C;
- }
- .P1 {
- background-color: #FF8952;
- }
- .P2 {
- background-color: #F5E300;
- }
- .P3 {
- background-color: #7ED321;
- }
- .P4 {
- background-color: #61D3B8;
- }
- .P5 {
- background-color: #69B3FF;
- }
- .P6 {
- background-color: #BDBDBD;
- }
- .status0 {
- @include setStatus(#409EFF)
- }
- .status1{
- @include setStatus(#FF8952)
- }
- .status2 {
- @include setStatus(#7ED321)
- }
- .expand i {
- border:1px solid #DCDFE6;
- }
- >>>.el-table__expand-icon{
- font-size: 14px;
- .el-icon{
- margin: 0;
- transform: translate(-50%, -50%);
- border:1px solid #DCDFE6;
- }
- }
- >>>.el-table__expand-icon .el-icon-arrow-right::before{
- content: "\E6D9";
- }
- >>>.el-table__expand-icon--expanded .el-icon-arrow-right::before{
- content: "\E6D8";
- }
- >>>.el-table__expand-icon--expanded {
- transform: rotate(180deg);
- }
- >>>.el-table__expanded-cell {
- background-color: #FFFFFF;
- padding: 0;
- }
- >>>.el-table__expanded-cell:hover {
- background-color: #FFFFFF !important;
- }
- .div_priority {
- text-align: center;
- color: #ffffff;
- padding: inherit;
- border-radius: 4px;
- width: 40px;
- display: inline-block;
- }
- .plan-checked {
- padding-left: 21px;
- }
- .select-main {
- height: 50px;
- border-bottom: 1px solid #DCDFE6;
- .flex-align-center {
- display: flex;
- align-items: center;
- }
- .item-checked {
- width: auto;
- margin-right: 28px;
- color: #606266;
- font-size: 14px;
- display: flex;
- align-items: center;
- justify-content: left;
- cursor: pointer;
- }
- .item-click,.item-line{
- margin: 0;
- width: auto;
- color: #666666;
- font-size: 14px;
- display: flex;
- align-items: center;
- cursor: pointer;
- margin-right: 28px;
- img {
- height: 13.5px;
- widows: 13.5px;
- margin-right: 5px;
- }
- }
- .item-line {
- color:rgba(102,102,102,0.6);
- }
- .cancel {
- position: absolute;
- right: 0;
- top: 50%;
- transform: translateY(-50%);
- }
- }
- .descr {
- display: flex;
- justify-content: flex-start;
- }
- .planList >>> .el-table th>.cell {
- padding-left: 14px;
- padding-right: 14px;
- }
- .dialog-change-status {
- margin: 2% 3%;
- display: flex;
- justify-content: space-between;
- align-items: center;
- white-space:nowrap;
- }
- </style>
- <style lang="scss">
- .btns .el-input--suffix .el-input__inner {
- padding-right: 10px;
- padding-left: 10px;
- width: 73px;
- }
- .item{
- /deep/ input {
- color: rgb(126, 211, 33);
- border: 1px solid rgb(126, 211, 33);
- border-color: rgb(126, 211, 33) !important;
- font-weight: 900;
- }
- /deep/ .el-input__suffix {
- color: rgb(126, 211, 33) !important;
- right: 1px;
- }
- /deep/ .el-select__caret {
- color: rgb(126, 211, 33) !important;
- }
- }
- .item1 {
- /deep/ input {
- color: rgb(255, 204, 102);
- border: 1px solid rgb(255, 204, 102);
- border-color: rgb(255, 204, 102) !important;
- font-weight: 900;
- }
- /deep/ .el-input__suffix {
- color: rgb(255, 204, 102) !important;
- right: 1px;
- }
- /deep/ .el-select__caret {
- color: rgb(255, 204, 102) !important;
- }
- }
- .item2 {
- /deep/ input {
- color: rgb(245, 108, 108);
- border: 1px solid rgb(245, 108, 108);
- border-color: rgb(245, 108, 108) !important;
- font-weight: 900;
- }
- /deep/ .el-input__suffix {
- color: rgb(245, 108, 108) !important;
- right: 1px;
- }
- /deep/ .el-select__caret {
- color: rgb(245, 108, 108) !important;
- }
- }
- .item3 {
- /deep/ input {
- color: #D675F0;
- border: 1px solid #D675F0;
- border-color: #D675F0 !important;
- font-weight: 900;
- }
- /deep/ .el-input__suffix {
- color: #D675F0 !important;
- right: 1px;
- }
- /deep/ .el-select__caret {
- color: #D675F0 !important;
- }
- }
- .item-color {
- /deep/ input {
- color: rgb(106, 180, 255);
- border: 1px solid rgb(106, 180, 255);
- border-color: rgb(106, 180, 255) !important;
- font-weight: 900;
- }
- /deep/ .el-input__suffix {
- color: rgb(106, 180, 255) !important;
- right: 1px;
- }
- /deep/ .el-select__caret {
- color: rgb(106, 180, 255) !important;
- }
- }
- </style>
|