taskViewDetail.vue 42 KB

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