taskIndex.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513
  1. <template>
  2. <div class="bgborder" style="background-color:#F2F3F6;min-height:calc(100vh - 80px);padding:10px">
  3. <div class="stylus-head">
  4. <div class="stylus-title">
  5. <span style="font-size: 22px;letter-spacing: 1px;font-weight: 600;color: #333B4A;padding-left: 15px">任务</span>
  6. <div>
  7. <el-button
  8. type="primary"
  9. size="mini"
  10. @click="open_created"
  11. >新建任务</el-button>
  12. </div>
  13. </div>
  14. <el-divider style="color: #EEF0F5;" />
  15. <div class="Layout" style="padding: 5px 0 0 15px">
  16. <div>
  17. <el-form :model="form_task" class="flex_start">
  18. <div class="Layout" style="padding-left:15px">
  19. <div class="queryName">任务名称</div>
  20. <el-input v-model="form_task.name" size="small" clearable style="width:77% !important;" placeholder="请输入标题或ID" @change="get_taskList()" />
  21. </div>
  22. <div class="Layout marginLeft">
  23. <div class="queryName">负责人</div>
  24. <el-select
  25. v-model="form_task.PersonInCharge"
  26. clearable
  27. filterable
  28. remote
  29. placeholder="请输入姓名或邮箱前缀"
  30. :remote-method="remoteMethod"
  31. :loading="loading"
  32. size="small"
  33. @change="get_taskList()"
  34. >
  35. <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="test2(item, 0)">
  36. <div class="flex_start">
  37. <div class="deptName">{{ item.deptName }}</div>
  38. <div style="min-width:80px">{{ item.name }}</div>
  39. <div class="deptName">{{ item.idap }}</div>
  40. </div>
  41. </el-option>
  42. </el-select>
  43. </div>
  44. <div class="Layout marginLeft">
  45. <div class="queryName">优先级</div>
  46. <el-select v-model="form_task.priority" size="small" clearable filterable placeholder="请选择" @change="get_taskList()">
  47. <el-option v-for="item in arr_priority" :key="item.value" :label="item.name" :value="item.value" />
  48. </el-select>
  49. </div>
  50. </el-form>
  51. </div>
  52. <span class="screen" @click="showSelect">{{ goodName }}</span>
  53. </div>
  54. <div v-show="DetailedScreening" class="stylus-more">
  55. <div>
  56. <div class="Layout">
  57. <el-form :model="form_task" class="flex_start">
  58. <div class="Layout">
  59. <div class="queryName">所属项目</div>
  60. <el-select v-model="form_task.projectId" size="small" clearable filterable placeholder="请选择">
  61. <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
  62. </el-select>
  63. </div>
  64. <div class="Layout marginLeft">
  65. <div class="queryName">所属需求</div>
  66. <el-select v-model="form_task.requireId" size="small" clearable filterable placeholder="请选择">
  67. <el-option v-for="item in demandList" :key="item.id" :label="item.name" :value="item.id" />
  68. </el-select>
  69. </div>
  70. <div class="Layout marginLeft">
  71. <div class="queryName">模块</div>
  72. <el-cascader v-model="form_task.moduleIds" size="small" clearable collapse-tags :props="props" :options="business_platform_Modular" placeholder="请选择" style="width:77% !important;" @click.native="bugDataGet" />
  73. </div>
  74. </el-form>
  75. </div>
  76. <div class="Layout" style="margin: 15px 0;">
  77. <el-form :model="form_task" class="flex_start">
  78. <div class="Layout">
  79. <div class="queryName">状态</div>
  80. <el-select v-model="form_task.status" size="small" clearable filterable placeholder="请选择">
  81. <el-option v-for="item in daStatus" :key="item.code" :label="item.msg" :value="item.code" />
  82. </el-select>
  83. </div>
  84. <div class="Layout marginLeft">
  85. <div class="queryName">健康状态</div>
  86. <el-select v-model="form_task.stage" size="small" clearable filterable placeholder="请选择">
  87. <el-option v-for="item in healthStage" :key="item.code" :label="item.msg" :value="item.code" />
  88. </el-select>
  89. </div>
  90. <div class="Layout marginLeft">
  91. <div class="queryName">创建人</div>
  92. <el-select
  93. v-model="form_task.creater"
  94. clearable
  95. filterable
  96. remote
  97. placeholder="请输入姓名或邮箱前缀"
  98. :remote-method="remoteMethod"
  99. :loading="loading"
  100. size="small"
  101. >
  102. <el-option v-for="item in options" :key="item.idap" :label="item.name" :value="test2(item, 0)">
  103. <div class="flex_start">
  104. <div class="deptName">{{ item.deptName }}</div>
  105. <div style="min-width:80px">{{ item.name }}</div>
  106. <div class="deptName">{{ item.idap }}</div>
  107. </div>
  108. </el-option>
  109. </el-select>
  110. </div>
  111. </el-form>
  112. </div>
  113. <div align="right">
  114. <el-button type="primary" size="mini" @click="get_taskList(form_task)">筛 选</el-button>
  115. <el-button size="mini" @click="query_Reset">重 置</el-button>
  116. </div>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="stylus-content">
  121. <el-table
  122. v-loading="table_loading"
  123. :data="task_table"
  124. style="width: 100%;"
  125. highlight-current-row
  126. :header-cell-style="{ 'color':'rgba(74,74,74,1)','font-size':'14px','font-weight':'500' }"
  127. :cell-style="{ 'font-size':'14px','color':'rgba(102,102,102,1)' }"
  128. size="small"
  129. show-overflow-tooltip="true"
  130. >
  131. <el-table-column label="优先级" min-width="100" prop="priority" sortable align="left">
  132. <template slot-scope="scope">
  133. <div class="div_priority" :style="{background: priorityColors[scope.row.priority]}">{{ scope.row.priorityString }}</div>
  134. </template>
  135. </el-table-column>
  136. <el-table-column label="任务名称" min-width="250" show-overflow-tooltip align="left">
  137. <template slot-scope="scope">
  138. <span style="font-size: 12px;color: rgba(167,174,188,1);">
  139. {{ scope.row.taskIdSting }}
  140. <span
  141. v-if="scope.row.tagNotification !== null"
  142. :class="{
  143. 'tagNotification': scope.row.tagType === 0,
  144. 'tagNotification1': scope.row.tagType === 1
  145. }"
  146. >
  147. {{ scope.row.tagNotification }}
  148. </span>
  149. </span><br>
  150. <span class="stylus-hover" @click="link_task(scope.row.id)">{{ scope.row.name }}</span>
  151. </template>
  152. </el-table-column>
  153. <el-table-column label="所属项目" min-width="250" align="center" show-overflow-tooltip>
  154. <template slot-scope="scope">{{ scope.row.projectName }}</template>
  155. </el-table-column>
  156. <el-table-column label="所属需求" min-width="250" align="center" show-overflow-tooltip>
  157. <template slot-scope="scope">{{ scope.row.requireName }}</template>
  158. </el-table-column>
  159. <el-table-column label="状态" min-width="150" align="center" show-overflow-tooltip>
  160. <template slot-scope="scope">{{ scope.row.statusString }}</template>
  161. </el-table-column>
  162. <el-table-column label="是否免测" min-width="80" align="center">
  163. <template slot-scope="scope">{{ scope.row.noTestString }}</template>
  164. </el-table-column>
  165. <el-table-column label="开发负责人" min-width="100" align="center">
  166. <template
  167. slot-scope="scope"
  168. >{{ scope.row.rdObject !== null? scope.row.rdObject.name: '' }}</template>
  169. </el-table-column>
  170. <el-table-column label="测试负责人" min-width="100" align="center">
  171. <template
  172. slot-scope="scope"
  173. >{{ scope.row.qaObject !== null?scope.row.qaObject.name: '' }}</template>
  174. </el-table-column>
  175. <el-table-column label="创建日期" min-width="120" align="center" show-overflow-tooltip>
  176. <template slot-scope="scope">{{ scope.row.createTime }}</template>
  177. </el-table-column>
  178. </el-table>
  179. <div align="right">
  180. <el-pagination
  181. background
  182. :current-page="currentPage"
  183. :page-sizes="[15,30,45,total]"
  184. :page-size="15"
  185. layout="total, sizes, prev, pager, next, jumper"
  186. :total="total"
  187. @size-change="handleSizeChange"
  188. @current-change="handleCurrentChange"
  189. />
  190. </div>
  191. </div>
  192. <!-- 弹窗 -->
  193. <openDialog v-if="dialog_open" ref="task_createdUpdata" />
  194. </div>
  195. </template>
  196. <script>
  197. import {
  198. taskList,
  199. configShowTaskEnum,
  200. memberQueryMemberInfoByIDAPorName,
  201. configShowRequirementVersionEnum,
  202. projectListProject,
  203. showTaskListEnum
  204. } from '@/api/taskIndex' // ajax
  205. import { settingQueryBizModuleList } from '@/api/defectManage'
  206. import openDialog from '@/views/projectManage/dialog_vue'
  207. import '@/views/projectManage/publicCss/index.css'
  208. export default {
  209. components: {
  210. openDialog
  211. },
  212. data() {
  213. return {
  214. header_show: true,
  215. props: { multiple: true },
  216. priorityColors: ['#F56C6C', '#FF8952', '#F5E300', '#7ED321', '#61D3B8', '#69B3FF', '#BDBDBD'],
  217. arr_priority: [{ value: 0, name: 'P0' }, { value: 1, name: 'P1' }, { value: 2, name: 'P2' }, { value: 3, name: 'P3' }],
  218. dialog_open: false,
  219. curIndex: 1,
  220. pageSize: 15,
  221. goodName: '更多筛选',
  222. options: [],
  223. daStatus: [],
  224. healthStage: [],
  225. list: [],
  226. userInformation: localStorage.getItem('username'),
  227. userNames: localStorage.getItem('realname'),
  228. form_task: {},
  229. noTest: [], // 是否免测
  230. BusinessLine: [], // 业务线
  231. appClient: [], // 涉及业务线
  232. arr_platform: [], // 平台数据
  233. business_platform_Modular: [], // 模块数据
  234. arr_taskName: [], // 任务名称数据
  235. projectList: [], // 归属项目数据
  236. demandList: [], // 需求list
  237. dialogFormVisible: false,
  238. currentPage: 0,
  239. DetailedScreening: false,
  240. total: 0,
  241. isToOne: true,
  242. loading: false,
  243. table_loading: false,
  244. test: {},
  245. task_table: [],
  246. form: {},
  247. arry: []
  248. }
  249. },
  250. created() {
  251. this.get_taskList()
  252. this.get_taskSelect()
  253. this.$store.state.data.status = true
  254. },
  255. destroyed() {
  256. this.$store.state.data.status = false
  257. },
  258. methods: {
  259. test2(item, e) {
  260. // 获取团队人员信息
  261. if (typeof this.test[item.idap] === 'undefined') {
  262. item.role = e
  263. this.test[item.idap] = item
  264. }
  265. return item.idap
  266. },
  267. get_taskList(e) {
  268. // 查询
  269. if (this.isToOne) {
  270. this.curIndex = 1
  271. this.currentPage = 1
  272. }
  273. this.table_loading = true
  274. this.form_task.bizId = Number(localStorage.getItem('bizId'))
  275. this.form_task.pageSize = this.pageSize
  276. this.form_task.curIndex = this.curIndex
  277. for (const key in this.form_task) { // 接口不接受空值的处理
  278. if (this.form_task[key] === '') {
  279. delete this.form_task[key]
  280. }
  281. }
  282. taskList(this.form_task).then(res => {
  283. this.task_table = res.data
  284. this.total = res.total
  285. this.table_loading = false
  286. })
  287. configShowRequirementVersionEnum({ bizId: Number(localStorage.getItem('bizId')) }).then(res => {
  288. // 获取需求(查询)
  289. this.demandList = res.data
  290. })
  291. this.isToOne = true
  292. },
  293. remoteMethod(query) {
  294. // 人员查询
  295. if (query !== '') {
  296. this.loading = true
  297. setTimeout(() => {
  298. this.loading = false
  299. memberQueryMemberInfoByIDAPorName({ memberIDAP: query }).then(res => {
  300. const obj = {}
  301. this.options = res.data.reduce((cur, next) => {
  302. obj[next.idap] ? '' : obj[next.idap] = true && cur.push(next)
  303. return cur
  304. }, [])
  305. })
  306. }, 200)
  307. } else {
  308. this.options = []
  309. }
  310. },
  311. showSelect() {
  312. this.DetailedScreening = !this.DetailedScreening
  313. this.goodName === '更多筛选' ? this.goodName = '收起筛选' : this.goodName = '更多筛选'
  314. },
  315. team_dates(e) {
  316. // 改变成员
  317. this.form.arry = []
  318. for (const i in e) {
  319. this.form.arry.push(this.test[e[i]])
  320. }
  321. this.arry = this.form.arry.map(item => {
  322. return { memberIDAP: item.idap, department: item.deptid, role: 0 }
  323. })
  324. },
  325. open_created() {
  326. // 打开弹窗
  327. this.dialog_open = true
  328. this.$nextTick(() => {
  329. this.$refs.task_createdUpdata.init(1)
  330. })
  331. },
  332. link_task(e) {
  333. this.$router.push({ name: '任务详情', query: { id: e }})
  334. },
  335. query_Reset() {
  336. // 重置
  337. this.$set(this.form_task, 'bizId', '')
  338. this.$set(this.form_task, 'status', '')
  339. this.$set(this.form_task, 'stage', '')
  340. this.$set(this.form_task, 'id', '')
  341. this.$set(this.form_task, 'projectId', '')
  342. this.$set(this.form_task, 'requireId', '')
  343. this.$set(this.form_task, 'PersonInCharge', '')
  344. this.$set(this.form_task, 'Participant', '')
  345. this.$set(this.form_task, 'creater', '')
  346. this.$message({
  347. message: '已重置',
  348. type: 'success',
  349. duration: 1000,
  350. offset: 150
  351. })
  352. },
  353. handleSizeChange(size) {
  354. // 分页
  355. this.pageSize = size
  356. this.isToOne = false
  357. this.get_taskList(1)
  358. },
  359. handleCurrentChange(curIndex) {
  360. // 分页
  361. this.curIndex = curIndex
  362. this.currentPage = curIndex
  363. this.isToOne = false
  364. this.get_taskList()
  365. },
  366. get_taskSelect() {
  367. // 下拉菜单数据
  368. configShowTaskEnum().then(res => {
  369. this.healthStage = res.data.taskStage
  370. this.noTest = res.data.noTest // 是否免测
  371. this.taskSource = res.data.taskSource // 归属需求
  372. this.appClient = res.data.appClient // 涉及客户端
  373. })
  374. showTaskListEnum().then(res => {
  375. this.daStatus = res.data.taskStatus
  376. })
  377. projectListProject({ bizId: Number(localStorage.getItem('bizId')) }).then(res => {
  378. this.projectList = res.data
  379. })
  380. },
  381. bugDataGet() { // 所属模块
  382. settingQueryBizModuleList(Number(localStorage.getItem('bizId'))).then(res => {
  383. this.business_platform_Modular = res.data.map(item => ({
  384. ...item,
  385. value: item.id,
  386. label: item.moduleName,
  387. children: item.childModules.length === 0 ? null : item.childModules.map(item1 => ({
  388. ...item1,
  389. value: item1.id,
  390. label: item1.moduleName,
  391. children: item1.childModules.length === 0 ? null : item1.childModules.map(item2 => ({
  392. ...item2,
  393. value: item2.id,
  394. label: item2.moduleName
  395. }))
  396. }))
  397. }))
  398. })
  399. }
  400. }
  401. }
  402. </script>
  403. <style>
  404. .el-loading-mask {
  405. z-index: 8;
  406. }
  407. .requirement-xx .el-table .cell {
  408. padding: 5px 0;
  409. font-size: 14px;
  410. font-family: MicrosoftYaHei;
  411. }
  412. .requirement-xx .el-table .el-table__body tr:hover td { color: #409EFF; background: #EDF6FF; } /*hover时字体, 背景颜色*/
  413. .footer {
  414. text-align: right;
  415. margin: 1%;
  416. background-color: #ffffff;
  417. border-radius: 4px;
  418. }
  419. .bgborder .el-table .cell {
  420. box-sizing: border-box;
  421. overflow: hidden;
  422. text-overflow: ellipsis;
  423. word-break: break-all;
  424. line-height: 23px;
  425. padding-right: 10px;
  426. margin: -6px 0 -2px 0 !important;
  427. }
  428. .el-table .warning-row {
  429. background: oldlace;
  430. }
  431. .drop_down {
  432. font-size: 14px;
  433. color: #333333;
  434. }
  435. .requirement_el-dropdown-menu {
  436. max-height: 300px !important;
  437. max-width: 200px;
  438. overflow: auto !important;
  439. }
  440. .el-dropdown-menu__item:not(.is-disabled):hover {
  441. background-color: #f6f7fa;
  442. color: #606266;
  443. }
  444. .div_priority {
  445. color: #ffffff;
  446. width:fit-content;
  447. padding: 0 12px;
  448. border-radius: 4px;
  449. margin-left: 4px;
  450. }
  451. .tagNotification {
  452. background: rgba(255,137,82,15%);
  453. color: #FF8952;
  454. padding: 0 5px;
  455. border-radius: 8px;
  456. margin-left: 10px;
  457. }
  458. .tagNotification1 {
  459. background: rgba(245,108,108,17%);
  460. color: #F56C6C;
  461. padding: 0 5px;
  462. border-radius: 8px;
  463. margin-left: 10px;
  464. }
  465. </style>
  466. <style lang="stylus" scoped>
  467. .stylus-head >>> .el-form-item__label
  468. color #333333
  469. font-weight 400
  470. .stylus-content >>> .el-table .el-table__body tr:hover td
  471. // color #409EFF !important
  472. background #EDF6FF
  473. .stylus-head >>> .el-divider--horizontal
  474. margin 10px 0
  475. .stylus-head >>> .el-form-item
  476. margin-bottom 0
  477. .stylus-head
  478. width 100%
  479. padding 15px
  480. margin-bottom: 10px
  481. background-color white
  482. border-radius 4px
  483. .stylus-title
  484. display flex
  485. justify-content space-between
  486. align-items center
  487. .stylus-more
  488. background rgba(252,252,252,1)
  489. border-radius 4px
  490. padding 15px
  491. min-height 100px
  492. margin-top 22px
  493. border 1px solid rgba(238,238,238,1)
  494. width 100%
  495. .stylus-content
  496. width 100%
  497. padding 0.3% 1% 1% 1%
  498. margin:0 auto
  499. background-color white
  500. border-radius 4px
  501. min-height: calc(100vh - 209px);
  502. .stylus-hover:hover
  503. color #409EFF !important
  504. cursor pointer
  505. </style>