mission.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <view class="mission-page">
  3. <scroll-view class="scroll-y" scroll-y="true">
  4. <list-item
  5. v-for="(item, i) in improvingTaskList"
  6. :key="item.id"
  7. :task="item"
  8. />
  9. <view class="completed-box">
  10. <view class="btn-box" >
  11. <view class="btn" v-show="completeTaskList.length > 0" @click="toggleBtn">
  12. <image class="icon" :src="`/static/${btnSetting.icon}.png`"></image>
  13. <text class="text">
  14. {{ btnSetting.name }}
  15. </text>
  16. </view>
  17. </view>
  18. <template v-if="showCloseList">
  19. <list-item
  20. v-for="(item, i) in completeTaskList"
  21. :key="item.id"
  22. :task="item"
  23. :isComplete="true"
  24. />
  25. </template>
  26. </view>
  27. </scroll-view>
  28. <tm-tabbar />
  29. </view>
  30. </template>
  31. <script>
  32. // 任务列表
  33. import listItem from './components/list-item.vue';
  34. export default {
  35. data(){
  36. return {
  37. // 是否展开历史任务
  38. showCloseList: false,
  39. btnSetting: {
  40. icon: 'up-icon', // 图标名
  41. name: '展示历史任务' // 按钮显示名字
  42. },
  43. // 改善中任务
  44. improvingTaskList: [
  45. // {
  46. // appointFlag: false, // 已指派标志, 0 未指派 1已指派
  47. // checkGroupId: 1, // 查核组id
  48. // checkGroupName: "测试群组", // 查核组名称
  49. // checkId: 1,
  50. // checkItemId: 1, // 查核项目id
  51. // checkItemName: "测试点", // 查核项目名称
  52. // checkPlan: "第1/3次查核计划", // 查核计划
  53. // checkPointId: 1, // 查核要点id
  54. // checkPointName: "测试", // 查核要点名称(查核项)
  55. // createDate: "2021-02-03T01:44:09.000+0000", // 任务创建时间
  56. // createEmpId: 1, //创建人
  57. // createEmpName: "管理员", // 创建人姓名
  58. // delFlag: false,
  59. // deptId: 1, // 单位id
  60. // deptName: "测试部门", // 单位名称
  61. // desicion: "", // 改善工具:0,进行PDCA改善 1,暂不改善
  62. // endFlag: false, // 完结标识
  63. // id: 1, // 任务id
  64. // needApproveFlag: false, // 需要审核标志
  65. // recordTime: "2021-02-03 09:44:17", // 最终修改时间
  66. // situationId: 1, // 情景id
  67. // situationName: "测试情景", // 情景名称
  68. // taskType: 0, // 任务当前状态
  69. // updateTime: "2021-02-03T01:44:17.000+0000", // 修改时间 (发送时间)
  70. // improveEmpName: '', //改善人
  71. // improveEmpId: '', //改善人id
  72. // }
  73. ],
  74. // 历史任务
  75. completeTaskList: [],
  76. }
  77. },
  78. created() {
  79. this.getMissionList()
  80. },
  81. methods: {
  82. toggleBtn() {
  83. let flag = !this.showCloseList;
  84. this.showCloseList = flag;
  85. this.btnSetting = {
  86. icon: flag ? 'up-icon' : 'down-icon',
  87. name: flag ? '收起历史任务' : '展示历史任务'
  88. }
  89. },
  90. // 获取改善任务列表
  91. getMissionList(data) {
  92. this.$store.dispatch({
  93. type: 'mission/commActions',
  94. payload: {
  95. key: "getMissionList",
  96. data
  97. }
  98. }).then(data => {
  99. if(data) {
  100. this.improvingTaskList = data.improvingTaskResponses || [];
  101. this.completeTaskList = data.improveCompleteResponses || [];
  102. }
  103. });
  104. /** 请求参数 data
  105. * situationId: 情境id 当管路员或者查核者通过情境进入任务列表时 必传
  106. * checkItemId 单位负责人通过 查核要点进入改善任务列表时 必传
  107. */
  108. }
  109. },
  110. components: {
  111. listItem
  112. }
  113. }
  114. </script>
  115. <style lang="less">
  116. .mission-page {
  117. height: 100%;
  118. padding-top: 15rpx;
  119. .scroll-y {
  120. height: calc(100% - 87.5rpx);
  121. .completed-box {
  122. .btn-box {
  123. display: flex;
  124. justify-content: center;
  125. margin-bottom: 25rpx;
  126. height: 50rpx;
  127. .btn {
  128. display: flex;
  129. justify-content: center;
  130. align-items: center;
  131. width: 225rpx;
  132. height: 50rpx;
  133. border-radius: 37.5rpx;
  134. border: 1.25rpx solid #98A1B3;
  135. .icon {
  136. margin-right: 6.25rpx;
  137. width: 21.25rpx;
  138. height: 12.5rpx;
  139. }
  140. .text {
  141. font-size: 22.5rpx;
  142. color: #98A1B3;
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }
  149. </style>