taskViewDetail.vue 33 KB

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