taskViewDetail.vue 40 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  1. <template>
  2. <div class="bg-project" @click="display = false">
  3. <el-container>
  4. <el-header class="main-header">
  5. <div class="top-page-title">
  6. <div v-if="form_query.stage === 1 || form_query.stage === 2 || form_query.stage === 3" class="task-stage">
  7. <div class="task-stage-main">
  8. <img v-if="form_query.stage === 1" :src="normalImg">
  9. <img v-if="form_query.stage === 2" :src="stageImg">
  10. <img v-if="form_query.stage === 3" :src="warningImg">
  11. <el-tooltip class="item" effect="dark" :disabled="form_query.lateMsg===null" :content="form_query.stageString + ':' + form_query.lateMsg" placement="bottom">
  12. <div class="task-stage-title">
  13. <span :class="{'small-size':form_query.stage === 2}">{{ form_query.stageString }}</span>
  14. </div>
  15. </el-tooltip>
  16. </div>
  17. </div>
  18. <div class="header-title">
  19. <span class="title-id">
  20. TASK-{{ form_query.id }}
  21. <el-tooltip v-if="form_query.isDirectlyFromDpm === 0 || form_query.isDirectlyFromDpm === 1" class="item" effect="dark" :content="`【${form_query.relatedDpmTaskInfo.taskId}】【${form_query.relatedDpmTaskInfo.name}】`" placement="top">
  22. <span class="synchronize-icon">
  23. <img src="@/assets/home_images/WX20200914-141851@2x.png" @click="dpmUrl(form_query.dpmUrl)">
  24. <i v-if="form_query.isDirectlyFromDpm === 0" class="el-icon-circle-close sty-icon" @click="deleteDpl()" />
  25. </span>
  26. </el-tooltip>
  27. <el-popover v-if="form_query.isDirectlyFromDpm === -1" placement="bottom" title="关联望岳任务" width="400" trigger="click" popper-class="synchronize">
  28. <div class="blueStr" />
  29. <div class="task-object-list">
  30. <div v-for="(item, index) in dplOption" :key="index" class="task-item" @click="synchronize(item.id)">
  31. <span>{{ item.moduleInfoName }}</span>
  32. <span class="item-name">{{ item.name }}</span>
  33. <span class="item-id">{{ item.taskId }}</span>
  34. </div>
  35. </div>
  36. <el-button v-if="form_query.isDirectlyFromDpm === -1" slot="reference" size="mini" type="text" @click.once="getDplList(taskId)">关联望岳</el-button>
  37. </el-popover>
  38. </span>
  39. <el-tooltip class="item" effect="dark" :content="form_query.name" placement="bottom">
  40. <span
  41. v-clipboard:copy="form_query.name"
  42. v-clipboard:success="copyName"
  43. class="title-name"
  44. >{{ form_query.name }}</span>
  45. </el-tooltip>
  46. </div>
  47. <el-button v-show="form_query.status === -2" disabled plain size="mini">Hold</el-button>
  48. <el-dropdown v-show="form_query.status !== -2" placement="bottom" @command="updateStatus">
  49. <el-button size="mini" plainclass="el-dropdown-link drop_down">
  50. {{ getStatus.name }}
  51. <i class="el-icon-arrow-down el-icon--right" />
  52. </el-button>
  53. <el-dropdown-menu slot="dropdown" align="center">
  54. <el-dropdown-item
  55. v-for="item in allStatus"
  56. :key="item.name"
  57. :command="{status:item.code,label:item.name}"
  58. :disabled="form_query.status === item.code ? true : false"
  59. >{{ item.name }}</el-dropdown-item>
  60. </el-dropdown-menu>
  61. </el-dropdown>
  62. </div>
  63. <div class="top-tabs">
  64. <el-tabs v-model="activeName">
  65. <el-tab-pane label="概览" name="1" />
  66. <el-tab-pane label="子任务" name="2" />
  67. <el-tab-pane label="缺陷" name="3" />
  68. <el-tab-pane label="报告" name="4" />
  69. <el-tab-pane label="统计" name="5" />
  70. </el-tabs>
  71. </div>
  72. <div class="top-control">
  73. <el-dropdown placement="bottom">
  74. <i class="el-icon-circle-plus icon-add" />
  75. <el-dropdown-menu slot="dropdown">
  76. <el-dropdown-item @click.native="created_bug()">新建缺陷</el-dropdown-item>
  77. <el-dropdown-item @click.native="createChildren = true">新建子任务</el-dropdown-item>
  78. <el-dropdown-item @click.native="createReport(1, form_query)">新建提测报告</el-dropdown-item>
  79. <el-dropdown-item @click.native="createReport(2, form_query)">新建测试日报</el-dropdown-item>
  80. <el-dropdown-item @click.native="createReport(3, form_query)">新建准出报告</el-dropdown-item>
  81. </el-dropdown-menu>
  82. </el-dropdown>
  83. <div class="line" />
  84. <span style="vertical-align: bottom; cursor: pointer; color: #6F7C93;" @click.stop="setChild(), display = true"><img style="width: 20px; display: inline-block;" :src="image_url">&nbsp; {{ num }} &nbsp;</span>
  85. <div class="line" />
  86. <i class="el-icon-setting icon-delete" @click="open_created" />
  87. <div class="line" />
  88. <i class="el-icon-delete icon-delete" @click="deleteVisible = true" />
  89. </div>
  90. </el-header>
  91. <el-container v-show="activeName === '1'">
  92. <section class="main-section">
  93. <div class="Layout_space_between">
  94. <div class="el-main-title">
  95. <div class="title-left-icon" />
  96. <div class="title-left-name">工作流</div>
  97. </div>
  98. <div>
  99. <el-button v-if="form_query.isDirectlyFromDpm === 0 || form_query.isDirectlyFromDpm === 1" size="mini" @click="dialogVisible = true">{{ '拉取望岳状态及工作流' }}</el-button>
  100. <el-popover
  101. v-model="visible"
  102. placement="bottom-end"
  103. width="300px"
  104. :visible-arrow="false"
  105. trigger="manual"
  106. >
  107. <el-input
  108. v-model="textarea2"
  109. type="textarea"
  110. rows="5"
  111. style="width:300px"
  112. placeholder="请输入Hold原因(选填)"
  113. />
  114. <div style="text-align: right; margin-top: 10px;">
  115. <el-button size="mini" type="text" @click="visible = false">取消</el-button>
  116. <el-button type="primary" size="mini" @click="taskHold(textarea2)">确定</el-button>
  117. </div>
  118. <el-button slot="reference" class="el-btn-size" size="mini" @click="changeBtn">{{ form_query.status === -2 ? HoldTask = '解除 Hold' : HoldTask = 'Hold 任务' }}</el-button>
  119. </el-popover>
  120. </div>
  121. </div>
  122. <timeLine :id="taskId" ref="timeLine" :name="'任务'" />
  123. </section>
  124. </el-container>
  125. <!-- 概览 -->
  126. <el-container v-show="activeName === '1'" class="is-vertical">
  127. <section class="main-section">
  128. <div class="el-main-title">
  129. <div class="title-left-icon" />
  130. <div class="title-left-name">基础信息</div>
  131. </div>
  132. <div class="detail-info">
  133. <el-form :inline="true" :model="form_query" class="demo-form-inline" label-position="left" label-width="100px">
  134. <el-form-item label="所属项目:" class="module">
  135. <div v-if="form_query.projectId !== -1" @click="jump('项目详情',form_query.projectId)">{{ form_query.projectName }}</div>
  136. <template v-else>{{ form_query.projectName }}</template>
  137. </el-form-item>
  138. <el-form-item label="所属需求:" class="module">
  139. <div v-if="form_query.requireId !== -1" @click="jump('需求详情',form_query.requireId)">{{ form_query.requireName }}</div>
  140. <template v-else>{{ form_query.requireName }}</template>
  141. </el-form-item>
  142. <el-form-item label="所属模块:" class="module">
  143. <div>{{ form_query.moduleInfoName }}</div>
  144. </el-form-item>
  145. </el-form>
  146. <el-form :inline="true" :model="form_query" class="demo-form-inline" label-position="left" label-width="100px">
  147. <el-form-item label="开发负责人:">
  148. <search-people :value.sync="form_query.rdOwner" @change="changeArea" />
  149. </el-form-item>
  150. <el-form-item label="测试负责人:">
  151. <search-people :value.sync="form_query.qaOwner" @change="changeArea" />
  152. </el-form-item>
  153. <el-form-item label="是否跟版:">
  154. <el-select v-model="form_query.followVersion" size="small" filterable placeholder="请选择" @change="changeArea">
  155. <el-option v-for="(item,index) in dependList" :key="item.msg + index" :label="item.msg" :value="item.code" />
  156. </el-select>
  157. </el-form-item>
  158. </el-form>
  159. <el-form :inline="true" :model="form_query" class="demo-form-inline" label-position="left" label-width="100px">
  160. <el-form-item label="跟版客户端:">
  161. <el-select v-if="form_query.followVersion === 1" v-model="form_query.involveApp" size="small" filterable placeholder="请选择" @change="changeArea">
  162. <el-option v-for="(item,index) in appClient" :key="item.msg + index" :label="item.msg" :value="item.code" />
  163. </el-select>
  164. </el-form-item>
  165. <el-form-item label="任务进度:">
  166. <div class="form-progress">
  167. <el-progress :percentage="Number(form_query.rate && form_query.rate.substring(0,4)) || 0" color="#409eff" />
  168. </div>
  169. </el-form-item>
  170. </el-form>
  171. <el-form :inline="true" :model="form_query" class="demo-form-inline" style="white-space: nowrap;" label-position="left" label-width="100px">
  172. <el-form-item label="技术文档:" class="module">
  173. <span class="PRD-link"><a :href="form_query.devUrl" target="_blank">{{ form_query.devUrl }}</a></span>
  174. </el-form-item>
  175. </el-form>
  176. </div>
  177. </section>
  178. <section class="main-section">
  179. <div class="el-main-title">
  180. <div class="title-left-icon" />
  181. <div class="title-left-name">
  182. <div>任务计划
  183. <el-tooltip class="item" effect="dark" :content="isScheduleLocked === 1? '点击解锁排期' : '点击锁定排期'" placement="top">
  184. <span
  185. v-if="!form_query.needGrey || isScheduleLocked === 1 "
  186. class="titleStatus"
  187. :class=" isScheduleLocked === 1 ? 'el-icon-lock' : 'el-icon-unlock'"
  188. @click="changeSchedule"
  189. >
  190. {{ isScheduleLocked === 1 ? '已锁定' : '未锁定' }}
  191. </span>
  192. </el-tooltip>
  193. </div>
  194. </div>
  195. </div>
  196. <section class="main-section">
  197. <div class="task-help-tips">
  198. <div class="tips-icon">
  199. <i class="el-icon-question" />
  200. <span> 帮助提示</span>
  201. </div>
  202. <div class="tips-context">
  203. .每个任务仅支持一次提测和一次准出,请合理拆解任务后再排期。<br>
  204. .任务状态未变更【已排期】前,排期不可锁定;状态变更为【已排期】时,任务排期将被系统自动锁定。<br>
  205. .需求排期锁定时,任务排期将全部被锁定;所有任务锁定时,需求排期将被系统自动锁定。<br>
  206. .任务锁定时,系统会自动将任务排期及交付时间同步至望岳。若多个任务关联同一个望岳任务,同步时排期会汇总一并同步到望岳,交付时间则按最晚日期同步至望岳。<br>
  207. </div>
  208. </div>
  209. <div class="list-tips">
  210. <div class="tips">
  211. <i v-if="tips" class="el-icon-warning-outline" style="color:#e88792;" />
  212. <span v-if="tips" style="color:#e88792;">当前任务归属的需求计划排期呈锁定状态,当前任务的排期无法同步到需求计划中去,请将归属需求的排期解锁!</span>
  213. </div>
  214. <div class="schedule-control">
  215. <div v-show="BackToTheLatest === false" class="Scheduling" style="margin-right: 20px;" @click="clickBackToTheLatest"><i class="el-icon-refresh" /> 回到最新</div>
  216. <div v-show="isScheduleLocked === 0">
  217. <div v-show="BackToTheLatest === true" class="Scheduling" style="margin-right: 20px;" @click="clickAddScheduling()"><i class="el-icon-circle-plus-outline" /> 添加排期</div>
  218. </div>
  219. <div v-show="form_query.relatedDpmTaskInfo" class="Scheduling" @click="synchronizeDialog = true"><i class="el-icon-s-fold" /> 同步排期至望岳</div>
  220. <div v-show="BackToTheLatest === true" align="left" class="Scheduling" @click="scheduleHiHide"><i class="el-icon-document" /> 排期变更记录</div>
  221. <download :id="taskId" :name="'任务'" />
  222. </div>
  223. </div>
  224. </section>
  225. <el-container>
  226. <el-main style="padding: 0;">
  227. <schedule-list :id="taskId" ref="taskSchedule" :showunlock="showunlock" :type-list="taskScheduleEvent" class-name="white" @updataData="getSchedule" />
  228. </el-main>
  229. <el-aside v-if="lockHide" class="SchedulingAside">
  230. <div v-for="(item, index) in SchedulingContent" :key="index" class="SchedulingDiv" @click="clickScheduling(item)">
  231. <i v-show="index < SchedulingContent.length - 1" />
  232. <div class="timeline">
  233. <div class="SchedulingTow" :class="{'vss' : item.id === ScheduId}">
  234. <div v-if="item.operationType === 0" class="el-icon-unlock image" />
  235. <div v-if="item.operationType === 1" class="el-icon-lock image" />
  236. </div>
  237. <div class="modifyTime">{{ item.modifyTime }}</div>
  238. <div>{{ item.operatorObject.name !== null ? item.operatorObject.name : '' }} <span class="btn">{{ item.operation }}</span></div>
  239. <div v-if="item.remarkTypeName"><span class="modifyTime">{{ '解锁原因 : ' }}</span>{{ item.remarkTypeName }}</div>
  240. <div v-if="item.remark"><span class="modifyTime">{{ '具体描述 : ' }}</span>{{ item.remark }}</div>
  241. </div>
  242. </div>
  243. <div v-if="SchedulingContent.length === 0" style="width: 270px; margin: 50% 20px; text-align: center;"> 暂无排期变更记录!</div>
  244. </el-aside>
  245. </el-container>
  246. </section>
  247. <section class="main-section">
  248. <div class="el-main-title">
  249. <div class="title-left-icon" />
  250. <div class="title-left-name">任务描述</div>
  251. </div>
  252. <div>
  253. <text-area :id="'pro-desc'" :value.sync="form_query.description" :empty-text="'点击'" :input-button="'添加描述'" @change="changeArea" />
  254. </div>
  255. </section>
  256. <section class="main-section">
  257. <div class="el-main-title">
  258. <div class="title-left-icon" />
  259. <div class="title-left-name">动态</div>
  260. </div>
  261. <el-tabs v-model="tabPosition" class="sign-tabs">
  262. <el-tab-pane label="评论" name="first">
  263. <div class="detail-info">
  264. <ul class="comment-main">
  265. <li v-for="(item,index) in comments" :key="'comment'+index">
  266. <span class="comment-name">{{ item.commentInfo.name }}</span>
  267. <span class="comment-gmtCreater">{{ item.commentInfo.gmtCreater }}</span><br>
  268. <span class="comment-content">{{ item.commentInfo.content }}</span>
  269. </li>
  270. </ul>
  271. <el-input
  272. v-model="commentContent"
  273. type="textarea"
  274. placeholder="请输入评论内容"
  275. maxlength="300"
  276. show-word-limit
  277. :autosize="{ minRows: 3, maxRows: 5}"
  278. style="margin-bottom: 20px"
  279. />
  280. <el-row>
  281. <el-col :span="2" :offset="22"><el-button type="primary" size="small" @click="addComment">发表评论</el-button></el-col>
  282. </el-row>
  283. </div>
  284. </el-tab-pane>
  285. <el-tab-pane label="变更记录" name="second">
  286. <record :id="taskId" ref="record" :name="'任务'" />
  287. </el-tab-pane>
  288. </el-tabs>
  289. </section>
  290. </el-container>
  291. <!-- 概览 -->
  292. <!-- 子任务 -->
  293. <el-container v-if="activeName === '2'" class="is-vertical">
  294. <section class="main-section contain">
  295. <children-list ref="children-list" />
  296. </section>
  297. </el-container>
  298. <!-- 子任务 -->
  299. <!-- 缺陷 -->
  300. <el-container v-if="activeName === '3'" class="is-vertical">
  301. <section class="main-section contain">
  302. <bugTableDialog ref="bugTableDialog" no-show="taskName" :obj-id="{ taskId: taskId }" />
  303. </section>
  304. </el-container>
  305. <!-- 缺陷 -->
  306. <!-- 报告 -->
  307. <el-container v-if="activeName === '4'" class="is-vertical">
  308. <report-list />
  309. </el-container>
  310. <!-- 报告 -->
  311. <!-- 统计 -->
  312. <el-container v-if="activeName === '5'" class="is-vertical">
  313. <section class="main-section contain">
  314. <data-statistics ref="data-statistics" />
  315. </section>
  316. </el-container>
  317. <!-- 统计 -->
  318. <!-- 新建(bug) -->
  319. <createdBug v-if="bug_open" ref="createdBug" @getBugList="reloadList" />
  320. <create-children v-if="createChildren" :visible.sync="createChildren" :data="form_query" :new-add="true" @change="reloadList" />
  321. <Test-report v-if="dialogTest" ref="TestReport" />
  322. <Daily-report v-if="dialogDaily" ref="DailyReport" />
  323. <ReleaseReport v-if="dialogClient" ref="ClientReport" />
  324. <!-- 新建 -->
  325. <!-- 编辑 -->
  326. <open-dialog v-if="updateVisible" ref="task_createdUpdata" />
  327. <!-- 编辑 -->
  328. <!-- 删除 -->
  329. <el-dialog :visible.sync="deleteVisible" title="删除确认" class="public_task" width="30%" :close-on-click-modal="false">
  330. <div class="blueStripe" />
  331. <div align="center">确定要删除此 {{ form_query.name }} 任务吗?</div>
  332. <span slot="footer" class="dialog-footer">
  333. <el-button size="mini" @click="deleteVisible = false">关 闭</el-button>
  334. <el-button size="mini" type="primary" @click="taskDelete()">确 定</el-button>
  335. </span>
  336. </el-dialog>
  337. <!-- 删除 -->
  338. <task-dialog v-if="showTaskDialog" :show.sync="showTaskDialog" :task-id="taskIds.id" :status-name="taskIds.statusString" @getList="taskGet" />
  339. <!-- 排期锁定 -->
  340. <schedule ref="ScheduleEvent" :visible.sync="scheduleVisble" :name="'任务'" :is-schedule-locked="isScheduleLocked" :require-id="taskId" @updataData="getScheduleGetTaskScheduleHistory" />
  341. <!-- 排期锁定 -->
  342. <!-- 状态及工作流 -->
  343. <workflowAndStatus
  344. :visible.sync="dialogVisible"
  345. :name="'任务'"
  346. :dpmrequired="toilp"
  347. @update="taskGet(); dialogVisible=false "
  348. />
  349. <!-- 状态及工作流 -->
  350. <!-- 同步望月 -->
  351. <synchronize-dialog
  352. v-if="synchronizeDialog"
  353. :id="taskId"
  354. :data="form_query.relatedDpmTaskInfo"
  355. :visible.sync="synchronizeDialog"
  356. @change="taskGet()"
  357. />
  358. <!-- 同步望月 -->
  359. <drawer
  360. ref="drawer"
  361. title="任务成员"
  362. center
  363. :display.sync="display"
  364. width="28%"
  365. :delete="form_query"
  366. :types="false"
  367. :inner="true"
  368. :mask="false"
  369. @childValInput="childVal"
  370. @click.stop
  371. />
  372. </el-container>
  373. </div>
  374. </template>
  375. <script>
  376. const _ = require('lodash')
  377. import Vue from 'vue'
  378. import VueClipboard from 'vue-clipboard2'
  379. Vue.use(VueClipboard)
  380. import { mapGetters } from 'vuex'
  381. import { analysisBizId_id } from '@/utils/crypto-js.js'
  382. import {
  383. taskGet,
  384. configShowTaskEnum,
  385. tasktaskDelete,
  386. taskUpdate,
  387. commentCreate,
  388. commentList,
  389. taskHold,
  390. taskUnhold,
  391. configShowRequirementVersionEnum,
  392. scheduleGetTaskScheduleHistory
  393. } from '@/api/taskIndex'
  394. import { listByTask, taskUpdates } from '@/api/projectViewDetails'
  395. import { projectListProject, scheduleGetHistoryScheduleById, taskListAvailableDpmTask, taskSetTaskRelated, taskDeleteRelationship } from '@/api/requirement.js'
  396. import searchPeople from '@/components/select/searchPeople'
  397. import textArea from '@/components/input/textArea'
  398. import drawer from '@/views/projectManage/Drawer'
  399. import image_url from '@/assets/home_images/home_u.png'
  400. import createdBug from '@/views/projectManage/bugList/file/createdBug'
  401. import openDialog from '@/views/projectManage/dialog_vue'
  402. import createChildren from './childrenTask/createChildren'
  403. import childrenList from './childrenTask/childrenList'
  404. import scheduleList from './components/scheduleList'
  405. import reportList from './components/reportList'
  406. import dataStatistics from './components/dataStatistics'
  407. import TestReport from '@/views/reportManagement/components/TestingReport' // 提测
  408. import DailyReport from '@/views/reportManagement/components/DailyReport' // 日报
  409. import ReleaseReport from '@/views/reportManagement/components/ReleaseReport' // 准出
  410. import stage from '@/assets/detailPage/风险状态.png'
  411. import stage1 from '@/assets/detailPage/正常状态.png'
  412. import stage2 from '@/assets/detailPage/延期状态.png'
  413. import taskDialog from '@/views/projectManage/taskList/dialog/taskDialog' // 任务状态修改(已上线/已提测/已准出)
  414. import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷表格
  415. import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
  416. import download from '@/views/projectManage/components/export.vue'
  417. import record from '@/views/projectManage/components/record.vue'
  418. import timeLine from '@/views/projectManage/components/timeLine.vue'
  419. import { dailyReportCheckStatus, reportreleaseCheckStatus, reportdelivertestCheckStatus } from '@/api/reportTemplate'
  420. import synchronizeDialog from './dialog/synchronizeDialog' // 同步弹框
  421. import workflowAndStatus from '@/views/projectManage/components/workflowAndStatus.vue'
  422. import '@/styles/PublicStyle/index.scss'
  423. export default {
  424. components: {
  425. searchPeople,
  426. textArea,
  427. drawer,
  428. createdBug,
  429. openDialog,
  430. createChildren,
  431. childrenList,
  432. scheduleList,
  433. reportList,
  434. dataStatistics,
  435. TestReport,
  436. DailyReport,
  437. ReleaseReport,
  438. taskDialog,
  439. bugTableDialog,
  440. schedule,
  441. download,
  442. record,
  443. timeLine,
  444. workflowAndStatus,
  445. synchronizeDialog
  446. },
  447. filters: {
  448. ellipsis(value, num) {
  449. if (!value) return ''
  450. if (value.length > num) {
  451. return value.slice(0, num) + '...'
  452. }
  453. return value
  454. }
  455. },
  456. data() {
  457. return {
  458. tabPosition: 'first',
  459. textarea2: '',
  460. HoldTask: '',
  461. visible: false, // Hold任务
  462. dialogVisible: false,
  463. showunlock: true,
  464. toilp: '',
  465. ScheduId: '', // 排期ID
  466. LockState: {}, // 锁定状态
  467. tips: '', // 后加入需求的任务排期提示
  468. scheduleVisble: false, // 排期锁定
  469. isParentRequireScheduleLocked: '',
  470. BackToTheLatest: true, // 显示添加排期按钮
  471. lockHide: false, // 隐藏排期变更记录
  472. SchedulingContent: [], // 排期历史变更记录
  473. stageImg: stage,
  474. normalImg: stage1,
  475. warningImg: stage2,
  476. activeName: '1', // 顶部tab切换
  477. userInformation: localStorage.getItem('username'),
  478. userNames: localStorage.getItem('realname'),
  479. textarea: '', // 评论
  480. showTaskDialog: false, // 状态弹窗
  481. taskId: -1, // 任务id
  482. allStatus: [], // 任务所有状态
  483. belongProjectList: [], // 所属项目列表
  484. requireList: [], // 所属需求列表
  485. appClient: [], // 跟版客户端列表
  486. taskScheduleEvent: [], // 排期类型
  487. dependList: [{ msg: '否', code: 2 }, { msg: '是', code: 1 }], // 是否跟版
  488. form_query: {},
  489. display: false, // 设置成员弹框
  490. isScheduleLocked: '', // 锁定状态1锁定0未锁定
  491. num: 0, // 成员数量
  492. image_url: image_url, // 成员icon
  493. createChildren: false, // 新建子任务弹框
  494. updateVisible: false, // 编辑任务弹框
  495. deleteVisible: false, // 删除任务弹框
  496. bug_open: false, // 新建缺陷弹框
  497. dialogTest: false, // 新建提测报告
  498. dialogDaily: false, // 新建测试日报
  499. dialogClient: false, // 新建准出报告
  500. iterationList: [], // 所属迭代列表
  501. commentContent: null, // 评论内容
  502. comments: [], // 评论列表
  503. taskIds: '', // 将要修改状态的任务id
  504. synchronizeDialog: false, // 同步任务至望月弹框
  505. dplOption: [] // 关联的望岳任务
  506. }
  507. },
  508. computed: {
  509. getStatus() {
  510. return this.allStatus.find(item => item.code === this.form_query.status) || { name: null }
  511. },
  512. ...mapGetters(['bizId'])
  513. },
  514. watch: {
  515. activeName: {
  516. handler(newV) {
  517. Number(newV) > 0
  518. ? this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: newV }})
  519. : this.$router.replace({ path: this.$route.path, query: { ...this.$route.query, page: '1' }})
  520. }
  521. }
  522. },
  523. created() {
  524. this.analysisBizId_id()
  525. this.$nextTick(() => {
  526. this.activeName = this.$route.query.page ? this.$route.query.page : '1'
  527. })
  528. this.$store.state.data.status = true
  529. },
  530. destroyed() {
  531. this.$store.state.data.status = false
  532. },
  533. methods: {
  534. analysisBizId_id() { // 解析路由中的bizId_id
  535. if (!this.$route.query.bizId_id) return
  536. const bizId_id = analysisBizId_id(this.$route.query.bizId_id)
  537. this.taskId = bizId_id[1]
  538. this.taskGet()
  539. this.getTaskStatus()
  540. this.getBelongProject()
  541. this.getRequireList()
  542. this.getCommentList()
  543. this.getScheduleGetTaskScheduleHistory()
  544. },
  545. async getScheduleGetTaskScheduleHistory() {
  546. this.scheduleVisble = false
  547. const res = await scheduleGetTaskScheduleHistory(this.taskId)
  548. this.SchedulingContent = res.data
  549. const res1 = await listByTask(this.taskId)
  550. this.isScheduleLocked = res1.data.isScheduleLocked
  551. this.tips = res1.data.tips
  552. this.isParentRequireScheduleLocked = res1.data.isParentRequireScheduleLocked
  553. this.$refs.taskSchedule.listByTask(this.taskId)
  554. this.taskGet()
  555. },
  556. async getSchedule() {
  557. this.scheduleVisble = false
  558. const res = await scheduleGetTaskScheduleHistory(this.taskId)
  559. this.SchedulingContent = res.data
  560. const res1 = await listByTask(this.taskId)
  561. this.isScheduleLocked = res1.data.isScheduleLocked
  562. this.tips = res1.data.tips
  563. this.isParentRequireScheduleLocked = res1.data.isParentRequireScheduleLocked
  564. },
  565. async clickScheduling(ele) {
  566. this.showunlock = false
  567. this.ScheduId = ele.id
  568. const res = await scheduleGetHistoryScheduleById(ele.id)
  569. this.taskScheduleEvent = res.data.scheduleDetailRespons
  570. this.BackToTheLatest = false
  571. },
  572. clickBackToTheLatest() {
  573. this.showunlock = true
  574. this.BackToTheLatest = true
  575. this.lockHide = false
  576. this.$refs.taskSchedule.listByTask(this.taskId)
  577. },
  578. changeSchedule() { // 修改锁定状态
  579. if (this.isParentRequireScheduleLocked === 1) {
  580. this.$message({ message: '无法解锁,请先变更归属需求的排期状态为未锁定状态!', type: 'error', duration: 3000, offset: 150 })
  581. } else {
  582. this.scheduleVisble = true
  583. }
  584. },
  585. changeBtn() {
  586. if (this.HoldTask === 'Hold 任务') {
  587. this.visible = !this.visible
  588. this.textarea2 = ''
  589. }
  590. if (this.HoldTask === '解除 Hold') {
  591. this.taskHold()
  592. }
  593. },
  594. async taskHold(val) { // 锁定Hold
  595. if (this.HoldTask === 'Hold 任务') {
  596. const res = await taskHold(this.taskId, { 'remark': val })
  597. if (res.code === 200) {
  598. this.taskGet()
  599. this.$refs.timeLine.taskGetWorkFlow()
  600. this.visible = false
  601. this.$message({ message: '已修改状态为 Hold', type: 'success', duration: 1000, offset: 150 })
  602. }
  603. }
  604. if (this.HoldTask === '解除 Hold') {
  605. const res = await taskUnhold(this.taskId)
  606. if (res.code === 200) {
  607. this.taskGet()
  608. this.allStatus = []
  609. this.allStatus.push({ code: -2, msg: 'Hold' })
  610. this.$refs.timeLine.taskGetWorkFlow()
  611. this.$message({ message: 'Hold 状态已解除', type: 'success', duration: 1000, offset: 150 })
  612. }
  613. }
  614. },
  615. async changeArea(e) { // area修改
  616. const taskInfoDO = _.cloneDeep(this.form_query)
  617. taskInfoDO.rdOwner === null ? taskInfoDO.rdOwner = '' : ''
  618. taskInfoDO.qaOwner === null ? taskInfoDO.qaOwner = '' : ''
  619. const user = {
  620. name: localStorage.getItem('username'),
  621. ename: localStorage.getItem('realname'),
  622. id: ''
  623. }
  624. const res = await taskUpdate({ taskInfoDO, user })
  625. if (res.code === 200) {
  626. this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
  627. }
  628. this.taskGet()
  629. },
  630. async getBelongProject() { // 获取所属项目列表
  631. const res = await projectListProject({ bizId: this.bizId })
  632. if (res.code === 200) {
  633. this.belongProjectList = res.data
  634. }
  635. },
  636. async getRequireList() { // 获取所属需求列表
  637. const res = await configShowRequirementVersionEnum({ bizId: this.bizId })
  638. if (res.code === 200) {
  639. this.requireList = res.data
  640. }
  641. },
  642. async getTaskStatus() { // 获取任务状态列表,跟版客户端列表
  643. const res = await configShowTaskEnum()
  644. if (res.code === 200) {
  645. this.taskScheduleEvent = res.data.taskScheduleEvent || []
  646. this.appClient = res.data.appClient.map(item => {
  647. return {
  648. ...item,
  649. code: `${item.code}`
  650. }
  651. })
  652. }
  653. },
  654. async taskGet() { // 获取任务详情
  655. const res = await taskGet(this.taskId)
  656. if (res.code === 200) {
  657. this.form_query = res.data
  658. if (this.form_query.isDirectlyFromDpm === 0 || this.form_query.isDirectlyFromDpm === 1) {
  659. this.toilp = this.form_query.relatedDpmTaskInfo.taskId + this.form_query.relatedDpmTaskInfo.name
  660. }
  661. this.allStatus = res.data.availableStatusList
  662. this.$refs.timeLine.taskGetWorkFlow()
  663. this.$refs.record.operationLogTask()
  664. }
  665. },
  666. async getCommentList() { // 获取任务评论
  667. const res = await commentList({ type: 3, joinId: this.taskId })
  668. if (res.code === 200) {
  669. this.comments = res.data
  670. this.commentContent = ''
  671. }
  672. },
  673. async addComment() { // 发表任务评论
  674. if (this.commentContent.replace(/\s+/g, '') === '' || this.commentContent === null) {
  675. this.$message.warning('评论不能为空')
  676. return
  677. }
  678. const commentInfo = {
  679. joinId: this.taskId,
  680. content: this.commentContent,
  681. type: 3,
  682. fatherId: 0,
  683. name: this.userNames,
  684. email: this.userInformation
  685. }
  686. const user = { name: this.userNames, ename: this.userInformation, id: '' }
  687. const res = await commentCreate({ commentInfo, user })
  688. if (res.code === 200) {
  689. this.$message({ message: '评论成功', type: 'success', duration: 1000, offset: 150 })
  690. this.getCommentList()
  691. } else {
  692. this.$message.warning(res.msg)
  693. }
  694. },
  695. async updateStatus(e) { // 状态改变
  696. if (e.status === 70 || e.status === 90 || e.status === 100) {
  697. this.taskIds = this.form_query
  698. this.allStatus.map(item => {
  699. item.code === e.status ? this.taskIds.statusString = e.label : ''
  700. })
  701. this.showTaskDialog = true
  702. this.taskIds.status = e.status
  703. return
  704. } else {
  705. const user = {
  706. name: localStorage.getItem('username'),
  707. ename: localStorage.getItem('realname'),
  708. id: ''
  709. }
  710. const taskInfoDO = this.form_query
  711. taskInfoDO.status = e.status
  712. const resTask = await taskUpdates({ taskInfoDO, user })
  713. if (resTask.code === 200) {
  714. this.$refs.timeLine.taskGetWorkFlow()
  715. this.$refs.record.operationLogTask()
  716. this.taskGet()
  717. this.$message({ message: '修改成功', type: 'success', offset: 150 })
  718. }
  719. }
  720. },
  721. clickAddScheduling() { // 模拟调用自组件方法
  722. this.$refs.taskSchedule.addSchedule()
  723. },
  724. scheduleHiHide() { // 排期变更显示隐藏
  725. this.lockHide = !this.lockHide
  726. this.BackToTheLatest = true
  727. this.showunlock = true
  728. this.ScheduId = ''
  729. },
  730. childVal(val) {
  731. this.num = val
  732. },
  733. setChild() { // 设置成员
  734. this.$refs.drawer.getRoleList()
  735. },
  736. open_created() { // 编辑任务
  737. // 打开弹窗
  738. this.updateVisible = true
  739. this.$nextTick(() => {
  740. this.$refs.task_createdUpdata.init(3, [null, this.taskId])
  741. })
  742. },
  743. async taskDelete() { // 删除任务
  744. const user = { name: this.userNames, ename: this.userInformation, id: '' }
  745. const res = await tasktaskDelete(user, this.taskId)
  746. if (res.code === 200) {
  747. this.$message({ message: '删除成功', type: 'success', duration: 1000, offset: 150 })
  748. this.$router.push({ name: '任务', query: {}})
  749. }
  750. },
  751. created_bug() { // 缺陷创建
  752. this.bug_open = true
  753. this.$nextTick(() => {
  754. this.$refs.createdBug.init(1, { id: this.taskId })
  755. })
  756. },
  757. createReport(e, ele) { // 创建报告
  758. switch (e) {
  759. case 1: // 提测
  760. reportdelivertestCheckStatus([this.taskId]).then(res => {
  761. if (res.code === 200) {
  762. this.dialogTest = true
  763. this.$nextTick(() => { this.$refs.TestReport.init(7, [this.taskId]) })
  764. }
  765. })
  766. break
  767. case 2: // 日报
  768. dailyReportCheckStatus([this.taskId]).then(res => {
  769. if (res.code === 200) {
  770. this.dialogDaily = true
  771. this.$nextTick(() => {
  772. this.$refs.DailyReport.init(7, [this.taskId])
  773. })
  774. }
  775. })
  776. break
  777. case 3:
  778. reportreleaseCheckStatus([this.taskId]).then(res => {
  779. if (res.code === 200) {
  780. this.dialogClient = true
  781. this.$nextTick(() => { this.$refs.ClientReport.init(7, [this.taskId]) })
  782. }
  783. })
  784. break
  785. }
  786. },
  787. jump(page, id) { // 跳转
  788. this.$router.push({ name: page, query: { id: id }})
  789. },
  790. reloadList() {
  791. this.taskGet()
  792. if (this.$refs['bugTableDialog']) {
  793. this.$refs['bugTableDialog'].bugGetTableList()
  794. }
  795. if (this.$refs['data-statistics']) {
  796. this.$refs['data-statistics'].getRequireSumData()
  797. }
  798. if (this.$refs['children-list']) {
  799. this.$refs['children-list'].getSubTasksList()
  800. }
  801. },
  802. returnEmpty(val) {
  803. return val || ''
  804. },
  805. copyName(name) { // 复制名字
  806. this.$message({ message: '复制成功', type: 'success', duration: 1000, offset: 150 })
  807. },
  808. dpmUrl(url) {
  809. window.open(url, '_blank')
  810. },
  811. async getDplList(taskId) { // 获取关联望岳任务
  812. const res = await taskListAvailableDpmTask(taskId)
  813. if (res.code === 200) {
  814. this.dplOption = res.data
  815. }
  816. },
  817. async synchronize(id) { // 关联至望岳
  818. const res = await taskSetTaskRelated(this.taskId, id)
  819. if (res.code === 200) {
  820. this.taskGet()
  821. this.$message({ message: '关联成功', type: 'success', duration: 1000, offset: 150 })
  822. }
  823. },
  824. async deleteDpl() { // 取消关联
  825. const res = await taskDeleteRelationship(this.taskId)
  826. if (res.code === 200) {
  827. this.taskGet()
  828. this.$message({ message: '已取消关联', type: 'success', offset: 150 })
  829. }
  830. }
  831. }
  832. }
  833. </script>
  834. <style scoped lang="scss">
  835. @import '@/styles/detail-pages.scss';
  836. /deep/.el-button {
  837. cursor: pointer;
  838. }
  839. @include hide-open-header;
  840. .bg-project {
  841. @include bg-project;
  842. }
  843. .main-header {
  844. @include main-header;
  845. .title-name {
  846. cursor: pointer;
  847. }
  848. .synchronize-icon {
  849. position: relative;
  850. img {
  851. width: 60px;
  852. }
  853. }
  854. .sty-icon {
  855. position: absolute;
  856. right: -5px;
  857. top: -5px;
  858. background: #eee;
  859. border-radius: 50%;
  860. }
  861. }
  862. .main-header::after {
  863. @include main-header-after;
  864. }
  865. .contain {
  866. height: calc(100vh - 140px);
  867. overflow: scroll;
  868. }
  869. .main-section {
  870. @include main-section;
  871. .require-plan {
  872. display: flex;
  873. align-items: center;
  874. span {
  875. margin-left: 20px;
  876. color: #E6A23C;
  877. font-size: 12px;
  878. }
  879. }
  880. .task-help-tips {
  881. display: flex;
  882. flex-direction: column;
  883. margin: 0 20px;
  884. padding: 20px 13px;
  885. border-radius: 4px;
  886. background-color: rgba(64, 158, 255,0.1);
  887. .tips-icon {
  888. width: 100%;
  889. font-size: 14px;
  890. font-weight: 550;
  891. line-height: 24px;
  892. color: #333333;
  893. i {
  894. background: #1890FF;
  895. color: #e0eefd;
  896. border-color: #e0eefd;
  897. border-radius: 50%;
  898. }
  899. }
  900. .tips-context {
  901. width: 100%;
  902. font-size: 12px;
  903. line-height: 20px;
  904. color: #444444;
  905. }
  906. }
  907. .schedule-control {
  908. display: flex;
  909. justify-content: flex-end;
  910. }
  911. .detail-info {
  912. padding: 0 34px 20px 34px;
  913. /deep/.el-input__inner{
  914. border: 1px solid rgba(220,223,230,0)
  915. }
  916. /deep/.el-input__inner:hover{
  917. border: 1px solid rgba(220,223,230,1)
  918. }
  919. /deep/.is-focus .el-input__inner {
  920. border: 1px solid rgb(64, 158, 255);
  921. }
  922. /deep/.el-select{
  923. .el-input__suffix-inner {
  924. visibility: hidden;
  925. }
  926. }
  927. /deep/.el-select:hover{
  928. .el-input__suffix-inner {
  929. visibility: visible;
  930. }
  931. }
  932. .demo-form-inline {
  933. .el-form-item {
  934. width: 33%;
  935. margin-right: 0;
  936. }
  937. }
  938. .comment-main {
  939. list-style: none;
  940. padding: 15px 0 0 0;
  941. margin: 0 0 20px 0;
  942. li {
  943. list-style: none;
  944. padding: 0px;
  945. margin: 0px 0px 25px 0;
  946. }
  947. .comment-name {
  948. font-size:14px;
  949. color:#333B4A;
  950. }
  951. .comment-gmtCreater {
  952. margin-left:20px;
  953. color: #9B9B9B;
  954. font-size:12px
  955. }
  956. .comment-content {
  957. font-size:14px;
  958. color:#333B4A;
  959. margin-top: 10px;
  960. white-space: pre-line;
  961. }
  962. }
  963. .PRD-link:hover{
  964. color:#409EFF;
  965. }
  966. .PRD-link {
  967. width: 50%;
  968. overflow: hidden;
  969. text-overflow:ellipsis;
  970. white-space: nowrap;
  971. }
  972. }
  973. }
  974. .task-stage {
  975. position: absolute;
  976. left: 5px;
  977. top: 0px;
  978. z-index: 999;
  979. .task-stage-main {
  980. position: relative;
  981. height: 52px;
  982. width: 15.5px;
  983. img{
  984. height: 52px;
  985. width: 15.5px;
  986. }
  987. .task-stage-title{
  988. position: absolute;
  989. left: 0;
  990. right: 0;
  991. top: 0;
  992. bottom: 0;
  993. color: #ffffff;
  994. font-size: 10px;
  995. text-align: center;
  996. }
  997. .small-size {
  998. transform: scale(0.6);
  999. position: absolute;
  1000. left: 0;
  1001. top: -15px;
  1002. }
  1003. }
  1004. }
  1005. >>>.module .el-form-item__content {
  1006. display: inline-block;
  1007. width: calc(100% - 100px);
  1008. div {
  1009. line-height: 18px;
  1010. padding-top: 12px;
  1011. cursor: pointer;
  1012. }
  1013. div:hover{
  1014. color: #409EFF;
  1015. }
  1016. }
  1017. .form-progress {
  1018. width: 200px;
  1019. padding-top: 12px;
  1020. padding-left: 15px;
  1021. }
  1022. >>>.el-input--small {
  1023. font-size: 14px;
  1024. }
  1025. .vss {
  1026. border:1px solid #409EFF !important;
  1027. color:#409EFF !important;
  1028. }
  1029. .sign-tabs {
  1030. padding: 0 30px;
  1031. }
  1032. .el-btn-size {
  1033. margin: 10px 30px;
  1034. }
  1035. .blueStr {
  1036. width:4px;
  1037. height:17px;
  1038. background:#409EFF;
  1039. border-radius:1px;
  1040. position: absolute;
  1041. top: 22px;
  1042. left: 15px;
  1043. }
  1044. </style>
  1045. <style lang="scss">
  1046. .synchronize {
  1047. .el-popover__title {
  1048. color: #333333;
  1049. padding: 10px 20px;
  1050. }
  1051. .task-object-list {
  1052. width: 100%;
  1053. overflow: scroll;
  1054. cursor: pointer;
  1055. .task-item {
  1056. width: 100%;
  1057. white-space: nowrap;
  1058. color: #999999;
  1059. margin-bottom: 5px;
  1060. .item-id {
  1061. padding-right: 20px;
  1062. }
  1063. .item-name {
  1064. color: #333333;
  1065. padding-right: 20px;
  1066. }
  1067. }
  1068. }
  1069. .task-object-list::-webkit-scrollbar {
  1070. display: none;
  1071. }
  1072. }
  1073. .el-main-title .el-popper[x-placement^=bottom] {
  1074. margin: 12px 10px 0 0;
  1075. width: 300px;
  1076. }
  1077. </style>