taskViewDetail.vue 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076
  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" @tab-click="handleClick">
  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: Number(this.$route.query.id) }" />
  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 {
  381. taskGet,
  382. configShowTaskEnum,
  383. tasktaskDelete,
  384. taskUpdate,
  385. commentCreate,
  386. commentList,
  387. taskHold,
  388. taskUnhold,
  389. configShowRequirementVersionEnum,
  390. scheduleGetTaskScheduleHistory
  391. } from '@/api/taskIndex'
  392. import { listByTask, taskUpdates } from '@/api/projectViewDetails'
  393. import { projectListProject, scheduleGetHistoryScheduleById, taskListAvailableDpmTask, taskSetTaskRelated, taskDeleteRelationship } from '@/api/requirement.js'
  394. import searchPeople from '@/components/select/searchPeople'
  395. import textArea from '@/components/input/textArea'
  396. import drawer from '@/views/projectManage/Drawer'
  397. import image_url from '@/assets/home_images/home_u.png'
  398. import createdBug from '@/views/projectManage/bugList/file/createdBug'
  399. import openDialog from '@/views/projectManage/dialog_vue'
  400. import createChildren from './childrenTask/createChildren'
  401. import childrenList from './childrenTask/childrenList'
  402. import scheduleList from './components/scheduleList'
  403. import reportList from './components/reportList'
  404. import dataStatistics from './components/dataStatistics'
  405. import TestReport from '@/views/reportManagement/components/TestingReport' // 提测
  406. import DailyReport from '@/views/reportManagement/components/DailyReport' // 日报
  407. import ReleaseReport from '@/views/reportManagement/components/ReleaseReport' // 准出
  408. import stage from '@/assets/detailPage/风险状态.png'
  409. import stage1 from '@/assets/detailPage/正常状态.png'
  410. import stage2 from '@/assets/detailPage/延期状态.png'
  411. import taskDialog from '@/views/projectManage/taskList/dialog/taskDialog' // 任务状态修改(已上线/已提测/已准出)
  412. import bugTableDialog from '@/views/projectManage/bugList/details/bugTableDialog' // 缺陷表格
  413. import schedule from '@/views/projectManage/schedule' // 排期锁定弹窗
  414. import download from '@/views/projectManage/components/export.vue'
  415. import record from '@/views/projectManage/components/record.vue'
  416. import timeLine from '@/views/projectManage/components/timeLine.vue'
  417. import { dailyReportCheckStatus, reportreleaseCheckStatus, reportdelivertestCheckStatus } from '@/api/reportTemplate'
  418. import synchronizeDialog from './dialog/synchronizeDialog' // 同步弹框
  419. import workflowAndStatus from '@/views/projectManage/components/workflowAndStatus.vue'
  420. import '@/styles/PublicStyle/index.scss'
  421. export default {
  422. components: {
  423. searchPeople,
  424. textArea,
  425. drawer,
  426. createdBug,
  427. openDialog,
  428. createChildren,
  429. childrenList,
  430. scheduleList,
  431. reportList,
  432. dataStatistics,
  433. TestReport,
  434. DailyReport,
  435. ReleaseReport,
  436. taskDialog,
  437. bugTableDialog,
  438. schedule,
  439. download,
  440. record,
  441. timeLine,
  442. workflowAndStatus,
  443. synchronizeDialog
  444. },
  445. filters: {
  446. ellipsis(value, num) {
  447. if (!value) return ''
  448. if (value.length > num) {
  449. return value.slice(0, num) + '...'
  450. }
  451. return value
  452. }
  453. },
  454. data() {
  455. return {
  456. tabPosition: 'first',
  457. textarea2: '',
  458. HoldTask: '',
  459. visible: false, // Hold任务
  460. dialogVisible: false,
  461. showunlock: true,
  462. toilp: '',
  463. ScheduId: '', // 排期ID
  464. LockState: {}, // 锁定状态
  465. tips: '', // 后加入需求的任务排期提示
  466. scheduleVisble: false, // 排期锁定
  467. isParentRequireScheduleLocked: '',
  468. BackToTheLatest: true, // 显示添加排期按钮
  469. lockHide: false, // 隐藏排期变更记录
  470. SchedulingContent: [], // 排期历史变更记录
  471. stageImg: stage,
  472. normalImg: stage1,
  473. warningImg: stage2,
  474. activeName: '1', // 顶部tab切换
  475. userInformation: localStorage.getItem('username'),
  476. userNames: localStorage.getItem('realname'),
  477. textarea: '', // 评论
  478. showTaskDialog: false, // 状态弹窗
  479. taskId: Number(this.$route.query.id), // 任务id
  480. allStatus: [], // 任务所有状态
  481. belongProjectList: [], // 所属项目列表
  482. requireList: [], // 所属需求列表
  483. appClient: [], // 跟版客户端列表
  484. taskScheduleEvent: [], // 排期类型
  485. dependList: [{ msg: '否', code: 2 }, { msg: '是', code: 1 }], // 是否跟版
  486. form_query: {},
  487. display: false, // 设置成员弹框
  488. isScheduleLocked: '', // 锁定状态1锁定0未锁定
  489. num: 0, // 成员数量
  490. image_url: image_url, // 成员icon
  491. createChildren: false, // 新建子任务弹框
  492. updateVisible: false, // 编辑任务弹框
  493. deleteVisible: false, // 删除任务弹框
  494. bug_open: false, // 新建缺陷弹框
  495. dialogTest: false, // 新建提测报告
  496. dialogDaily: false, // 新建测试日报
  497. dialogClient: false, // 新建准出报告
  498. iterationList: [], // 所属迭代列表
  499. commentContent: null, // 评论内容
  500. comments: [], // 评论列表
  501. taskIds: '', // 将要修改状态的任务id
  502. synchronizeDialog: false, // 同步任务至望月弹框
  503. dplOption: [] // 关联的望岳任务
  504. }
  505. },
  506. computed: {
  507. getStatus() {
  508. return this.allStatus.find(item => item.code === this.form_query.status) || { name: null }
  509. }
  510. },
  511. watch: {
  512. activeName: {
  513. handler(newV) {
  514. Number(newV) > 0
  515. ? this.$router.push({ path: this.$route.path, query: { id: this.$route.query.id, page: newV }})
  516. : this.$router.push({ path: this.$route.path, query: { id: this.$route.query.id, page: '1' }})
  517. }
  518. }
  519. },
  520. created() {
  521. this.$nextTick(() => {
  522. this.activeName = this.$route.query.page ? this.$route.query.page : '1'
  523. })
  524. this.taskGet()
  525. this.getTaskStatus()
  526. this.getBelongProject()
  527. this.getRequireList()
  528. this.getCommentList()
  529. this.getScheduleGetTaskScheduleHistory()
  530. this.$store.state.data.status = true
  531. // this.$store.state.data.bizId = true
  532. },
  533. destroyed() {
  534. this.$store.state.data.status = false
  535. // this.$store.state.data.bizId = false
  536. },
  537. methods: {
  538. handleClick(tab, event) {
  539. console.log(tab, event)
  540. },
  541. async getScheduleGetTaskScheduleHistory() {
  542. this.scheduleVisble = false
  543. const res = await scheduleGetTaskScheduleHistory(this.taskId)
  544. this.SchedulingContent = res.data
  545. const res1 = await listByTask(this.taskId)
  546. this.isScheduleLocked = res1.data.isScheduleLocked
  547. this.tips = res1.data.tips
  548. this.isParentRequireScheduleLocked = res1.data.isParentRequireScheduleLocked
  549. this.$refs.taskSchedule.listByTask(this.taskId)
  550. this.taskGet()
  551. },
  552. async getSchedule() {
  553. this.scheduleVisble = false
  554. const res = await scheduleGetTaskScheduleHistory(this.taskId)
  555. this.SchedulingContent = res.data
  556. const res1 = await listByTask(this.taskId)
  557. this.isScheduleLocked = res1.data.isScheduleLocked
  558. this.tips = res1.data.tips
  559. this.isParentRequireScheduleLocked = res1.data.isParentRequireScheduleLocked
  560. },
  561. async clickScheduling(ele) {
  562. this.showunlock = false
  563. this.ScheduId = ele.id
  564. const res = await scheduleGetHistoryScheduleById(ele.id)
  565. this.taskScheduleEvent = res.data.scheduleDetailRespons
  566. this.BackToTheLatest = false
  567. },
  568. clickBackToTheLatest() {
  569. this.showunlock = true
  570. this.BackToTheLatest = true
  571. this.lockHide = false
  572. this.$refs.taskSchedule.listByTask(this.taskId)
  573. },
  574. changeSchedule() { // 修改锁定状态
  575. if (this.isParentRequireScheduleLocked === 1) {
  576. this.$message({ message: '无法解锁,请先变更归属需求的排期状态为未锁定状态!', type: 'error', duration: 3000, offset: 150 })
  577. } else {
  578. this.scheduleVisble = true
  579. }
  580. },
  581. changeBtn() {
  582. if (this.HoldTask === 'Hold 任务') {
  583. this.visible = !this.visible
  584. this.textarea2 = ''
  585. }
  586. if (this.HoldTask === '解除 Hold') {
  587. this.taskHold()
  588. }
  589. },
  590. async taskHold(val) { // 锁定Hold
  591. if (this.HoldTask === 'Hold 任务') {
  592. const res = await taskHold(this.taskId, { 'remark': val })
  593. if (res.code === 200) {
  594. this.taskGet()
  595. this.$refs.timeLine.taskGetWorkFlow()
  596. this.visible = false
  597. this.$message({ message: '已修改状态为 Hold', type: 'success', duration: 1000, offset: 150 })
  598. }
  599. }
  600. if (this.HoldTask === '解除 Hold') {
  601. const res = await taskUnhold(this.taskId)
  602. if (res.code === 200) {
  603. this.taskGet()
  604. this.allStatus = []
  605. this.allStatus.push({ code: -2, msg: 'Hold' })
  606. this.$refs.timeLine.taskGetWorkFlow()
  607. this.$message({ message: 'Hold 状态已解除', type: 'success', duration: 1000, offset: 150 })
  608. }
  609. }
  610. },
  611. async changeArea(e) { // area修改
  612. const taskInfoDO = _.cloneDeep(this.form_query)
  613. taskInfoDO.rdOwner === null ? taskInfoDO.rdOwner = '' : ''
  614. taskInfoDO.qaOwner === null ? taskInfoDO.qaOwner = '' : ''
  615. const user = {
  616. name: localStorage.getItem('username'),
  617. ename: localStorage.getItem('realname'),
  618. id: ''
  619. }
  620. const res = await taskUpdate({ taskInfoDO, user })
  621. if (res.code === 200) {
  622. this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
  623. }
  624. this.taskGet()
  625. },
  626. async getBelongProject() { // 获取所属项目列表
  627. const res = await projectListProject({ bizId: Number(localStorage.getItem('bizId')) })
  628. if (res.code === 200) {
  629. this.belongProjectList = res.data
  630. }
  631. },
  632. async getRequireList() { // 获取所属需求列表
  633. const res = await configShowRequirementVersionEnum({ bizId: Number(localStorage.getItem('bizId')) })
  634. if (res.code === 200) {
  635. this.requireList = res.data
  636. }
  637. },
  638. async getTaskStatus() { // 获取任务状态列表,跟版客户端列表
  639. const res = await configShowTaskEnum()
  640. if (res.code === 200) {
  641. this.taskScheduleEvent = res.data.taskScheduleEvent || []
  642. this.appClient = res.data.appClient.map(item => {
  643. return {
  644. ...item,
  645. code: `${item.code}`
  646. }
  647. })
  648. }
  649. },
  650. async taskGet() { // 获取任务详情
  651. const res = await taskGet(this.$route.query.id)
  652. if (res.code === 200) {
  653. this.form_query = res.data
  654. this.toilp = this.form_query.relatedDpmTaskInfo.taskId + this.form_query.relatedDpmTaskInfo.name
  655. this.allStatus = res.data.availableStatusList
  656. this.$refs.timeLine.taskGetWorkFlow()
  657. }
  658. },
  659. async getCommentList() { // 获取任务评论
  660. const res = await commentList({ type: 3, joinId: this.taskId })
  661. if (res.code === 200) {
  662. this.comments = res.data
  663. this.commentContent = ''
  664. }
  665. },
  666. async addComment() { // 发表任务评论
  667. if (this.commentContent.replace(/\s+/g, '') === '' || this.commentContent === null) {
  668. this.$message.warning('评论不能为空')
  669. return
  670. }
  671. const commentInfo = {
  672. joinId: this.taskId,
  673. content: this.commentContent,
  674. type: 3,
  675. fatherId: 0,
  676. name: this.userNames,
  677. email: this.userInformation
  678. }
  679. const user = { name: this.userNames, ename: this.userInformation, id: '' }
  680. const res = await commentCreate({ commentInfo, user })
  681. if (res.code === 200) {
  682. this.$message({ message: '评论成功', type: 'success', duration: 1000, offset: 150 })
  683. this.getCommentList()
  684. } else {
  685. this.$message.warning(res.msg)
  686. }
  687. },
  688. async updateStatus(e) { // 状态改变
  689. if (e.status === 70 || e.status === 90 || e.status === 100) {
  690. this.taskIds = this.form_query
  691. this.allStatus.map(item => {
  692. item.code === e.status ? this.taskIds.statusString = e.label : ''
  693. })
  694. this.showTaskDialog = true
  695. this.taskIds.status = e.status
  696. return
  697. } else {
  698. const user = {
  699. name: localStorage.getItem('username'),
  700. ename: localStorage.getItem('realname'),
  701. id: ''
  702. }
  703. const taskInfoDO = this.form_query
  704. taskInfoDO.status = e.status
  705. const resTask = await taskUpdates({ taskInfoDO, user })
  706. if (resTask.code === 200) {
  707. this.$refs.timeLine.taskGetWorkFlow()
  708. this.$refs.record.operationLogTask()
  709. this.taskGet()
  710. this.$message({ message: '修改成功', type: 'success', offset: 150 })
  711. }
  712. }
  713. },
  714. clickAddScheduling() { // 模拟调用自组件方法
  715. this.$refs.taskSchedule.addSchedule()
  716. },
  717. scheduleHiHide() { // 排期变更显示隐藏
  718. this.lockHide = !this.lockHide
  719. this.BackToTheLatest = true
  720. this.showunlock = true
  721. this.ScheduId = ''
  722. },
  723. childVal(val) {
  724. this.num = val
  725. },
  726. setChild() { // 设置成员
  727. this.$refs.drawer.getRoleList()
  728. },
  729. open_created() { // 编辑任务
  730. // 打开弹窗
  731. this.updateVisible = true
  732. this.$nextTick(() => {
  733. this.$refs.task_createdUpdata.init(3, [null, this.taskId])
  734. })
  735. },
  736. async taskDelete() { // 删除任务
  737. const user = { name: this.userNames, ename: this.userInformation, id: '' }
  738. const res = await tasktaskDelete(user, this.taskId)
  739. if (res.code === 200) {
  740. this.$message({ message: '删除成功', type: 'success', duration: 1000, offset: 150 })
  741. this.$router.push({ name: '任务', query: {}})
  742. }
  743. },
  744. created_bug() { // 缺陷创建
  745. this.bug_open = true
  746. this.$nextTick(() => {
  747. this.$refs.createdBug.init(1, { id: this.taskId })
  748. })
  749. },
  750. createReport(e, ele) { // 创建报告
  751. switch (e) {
  752. case 1: // 提测
  753. reportdelivertestCheckStatus([this.taskId]).then(res => {
  754. if (res.code === 200) {
  755. this.dialogTest = true
  756. this.$nextTick(() => { this.$refs.TestReport.init(7, [this.taskId]) })
  757. }
  758. })
  759. break
  760. case 2: // 日报
  761. dailyReportCheckStatus([this.taskId]).then(res => {
  762. if (res.code === 200) {
  763. this.dialogDaily = true
  764. this.$nextTick(() => {
  765. this.$refs.DailyReport.init(7, [this.taskId])
  766. })
  767. }
  768. })
  769. break
  770. case 3:
  771. reportreleaseCheckStatus([this.taskId]).then(res => {
  772. if (res.code === 200) {
  773. this.dialogClient = true
  774. this.$nextTick(() => { this.$refs.ClientReport.init(7, [this.taskId]) })
  775. }
  776. })
  777. break
  778. }
  779. },
  780. jump(page, id) { // 跳转
  781. this.$router.push({ name: page, query: { id: id }})
  782. },
  783. reloadList() {
  784. this.taskGet()
  785. if (this.$refs['bugTableDialog']) {
  786. this.$refs['bugTableDialog'].bugGetTableList()
  787. }
  788. if (this.$refs['data-statistics']) {
  789. this.$refs['data-statistics'].getRequireSumData()
  790. }
  791. if (this.$refs['children-list']) {
  792. this.$refs['children-list'].getSubTasksList()
  793. }
  794. },
  795. returnEmpty(val) {
  796. return val || ''
  797. },
  798. copyName(name) { // 复制名字
  799. this.$message({ message: '复制成功', type: 'success', duration: 1000, offset: 150 })
  800. },
  801. dpmUrl(url) {
  802. window.open(url, '_blank')
  803. },
  804. async getDplList(taskId) { // 获取关联望岳任务
  805. const res = await taskListAvailableDpmTask(taskId)
  806. if (res.code === 200) {
  807. this.dplOption = res.data
  808. }
  809. },
  810. async synchronize(id) { // 关联至望岳
  811. const res = await taskSetTaskRelated(this.taskId, id)
  812. if (res.code === 200) {
  813. this.taskGet()
  814. this.$message({ message: '关联成功', type: 'success', duration: 1000, offset: 150 })
  815. }
  816. },
  817. async deleteDpl() { // 取消关联
  818. const res = await taskDeleteRelationship(this.taskId)
  819. if (res.code === 200) {
  820. this.taskGet()
  821. this.$message({ message: '已取消关联', type: 'success', offset: 150 })
  822. }
  823. }
  824. }
  825. }
  826. </script>
  827. <style scoped lang="scss">
  828. @import '@/styles/detail-pages.scss';
  829. /deep/.el-button {
  830. cursor: pointer;
  831. }
  832. @include hide-open-header;
  833. .bg-project {
  834. @include bg-project;
  835. }
  836. .main-header {
  837. @include main-header;
  838. .title-name {
  839. cursor: pointer;
  840. }
  841. .synchronize-icon {
  842. position: relative;
  843. img {
  844. width: 60px;
  845. }
  846. }
  847. .sty-icon {
  848. position: absolute;
  849. right: -5px;
  850. top: -5px;
  851. background: #eee;
  852. border-radius: 50%;
  853. }
  854. }
  855. .main-header::after {
  856. @include main-header-after;
  857. }
  858. .contain {
  859. height: calc(100vh - 140px);
  860. overflow: scroll;
  861. }
  862. .main-section {
  863. @include main-section;
  864. .require-plan {
  865. display: flex;
  866. align-items: center;
  867. span {
  868. margin-left: 20px;
  869. color: #E6A23C;
  870. font-size: 12px;
  871. }
  872. }
  873. .task-help-tips {
  874. display: flex;
  875. flex-direction: column;
  876. margin: 0 20px;
  877. padding: 20px 13px;
  878. border-radius: 4px;
  879. background-color: rgba(64, 158, 255,0.1);
  880. .tips-icon {
  881. width: 100%;
  882. font-size: 14px;
  883. font-weight: 550;
  884. line-height: 24px;
  885. color: #333333;
  886. i {
  887. background: #1890FF;
  888. color: #e0eefd;
  889. border-color: #e0eefd;
  890. border-radius: 50%;
  891. }
  892. }
  893. .tips-context {
  894. width: 100%;
  895. font-size: 12px;
  896. line-height: 20px;
  897. color: #444444;
  898. }
  899. }
  900. .schedule-control {
  901. display: flex;
  902. justify-content: flex-end;
  903. }
  904. .detail-info {
  905. padding: 0 34px 20px 34px;
  906. /deep/.el-input__inner{
  907. border: 1px solid rgba(220,223,230,0)
  908. }
  909. /deep/.el-input__inner:hover{
  910. border: 1px solid rgba(220,223,230,1)
  911. }
  912. /deep/.is-focus .el-input__inner {
  913. border: 1px solid rgb(64, 158, 255);
  914. }
  915. /deep/.el-select{
  916. .el-input__suffix-inner {
  917. visibility: hidden;
  918. }
  919. }
  920. /deep/.el-select:hover{
  921. .el-input__suffix-inner {
  922. visibility: visible;
  923. }
  924. }
  925. .demo-form-inline {
  926. .el-form-item {
  927. width: 33%;
  928. margin-right: 0;
  929. }
  930. }
  931. .comment-main {
  932. list-style: none;
  933. padding: 15px 0 0 0;
  934. margin: 0 0 20px 0;
  935. li {
  936. list-style: none;
  937. padding: 0px;
  938. margin: 0px 0px 25px 0;
  939. }
  940. .comment-name {
  941. font-size:14px;
  942. color:#333B4A;
  943. }
  944. .comment-gmtCreater {
  945. margin-left:20px;
  946. color: #9B9B9B;
  947. font-size:12px
  948. }
  949. .comment-content {
  950. font-size:14px;
  951. color:#333B4A;
  952. margin-top: 10px;
  953. white-space: pre-line;
  954. }
  955. }
  956. .PRD-link:hover{
  957. color:#409EFF;
  958. }
  959. .PRD-link {
  960. width: 50%;
  961. overflow: hidden;
  962. text-overflow:ellipsis;
  963. white-space: nowrap;
  964. }
  965. }
  966. }
  967. .task-stage {
  968. position: absolute;
  969. left: 5px;
  970. top: 0px;
  971. z-index: 999;
  972. .task-stage-main {
  973. position: relative;
  974. height: 52px;
  975. width: 15.5px;
  976. img{
  977. height: 52px;
  978. width: 15.5px;
  979. }
  980. .task-stage-title{
  981. position: absolute;
  982. left: 0;
  983. right: 0;
  984. top: 0;
  985. bottom: 0;
  986. color: #ffffff;
  987. font-size: 10px;
  988. text-align: center;
  989. }
  990. .small-size {
  991. transform: scale(0.6);
  992. position: absolute;
  993. left: 0;
  994. top: -15px;
  995. }
  996. }
  997. }
  998. >>>.module .el-form-item__content {
  999. display: inline-block;
  1000. width: calc(100% - 100px);
  1001. div {
  1002. line-height: 18px;
  1003. padding-top: 12px;
  1004. cursor: pointer;
  1005. }
  1006. div:hover{
  1007. color: #409EFF;
  1008. }
  1009. }
  1010. .form-progress {
  1011. width: 200px;
  1012. padding-top: 12px;
  1013. padding-left: 15px;
  1014. }
  1015. >>>.el-input--small {
  1016. font-size: 14px;
  1017. }
  1018. .vss {
  1019. border:1px solid #409EFF !important;
  1020. color:#409EFF !important;
  1021. }
  1022. .sign-tabs {
  1023. padding: 0 30px;
  1024. }
  1025. .el-btn-size {
  1026. margin: 10px 30px;
  1027. }
  1028. .blueStr {
  1029. width:4px;
  1030. height:17px;
  1031. background:#409EFF;
  1032. border-radius:1px;
  1033. position: absolute;
  1034. top: 22px;
  1035. left: 15px;
  1036. }
  1037. </style>
  1038. <style lang="scss">
  1039. .synchronize {
  1040. .el-popover__title {
  1041. color: #333333;
  1042. padding: 10px 20px;
  1043. }
  1044. .task-object-list {
  1045. width: 100%;
  1046. overflow: scroll;
  1047. cursor: pointer;
  1048. .task-item {
  1049. width: 100%;
  1050. white-space: nowrap;
  1051. color: #999999;
  1052. margin-bottom: 5px;
  1053. .item-id {
  1054. padding-right: 20px;
  1055. }
  1056. .item-name {
  1057. color: #333333;
  1058. padding-right: 20px;
  1059. }
  1060. }
  1061. }
  1062. .task-object-list::-webkit-scrollbar {
  1063. display: none;
  1064. }
  1065. }
  1066. .el-main-title .el-popper[x-placement^=bottom] {
  1067. margin: 12px 10px 0 0;
  1068. width: 300px;
  1069. }
  1070. </style>