checkList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <view class="check-map-list">
  3. <tm-top-menu>
  4. <view class="top-menu" @click="showModalHandle(!showModal)">
  5. <text>第{{checkIndex}}/{{planList.length}}次查核</text>
  6. <image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
  7. </view>
  8. </tm-top-menu>
  9. <view class="item"
  10. v-for="(item, index) in depList"
  11. @click="gotoCheckMainPointsPage(item)"
  12. :key="index">
  13. <view class="title-wrap">
  14. <text>{{item.deptName}}</text>
  15. <view>
  16. <image src="../../static/icon-map.png"></image>
  17. <text>{{item.deptClassName}}</text>
  18. </view>
  19. </view>
  20. <view class="content">
  21. <text>{{item.decs}}</text>
  22. <text>
  23. 要点概览:{{item.checkPointNames}}
  24. </text>
  25. </view>
  26. <view class="footer">
  27. <text>查核人:{{item.empName}}</text>
  28. <text v-if="item.startDate && item.endDate">
  29. {{item.startDate}}~{{item.endDate}}
  30. </text>
  31. </view>
  32. <view class="icon-wrap"
  33. v-if="Number(item.completeStatus) === 2 || Number(item.completeStatus) === 3">
  34. <image :src="`../../static/${Number(item.completeStatus) === 2 ?'hight-bg':'top-img'}.png`"></image>
  35. <text>{{item.completeDes}}</text>
  36. </view>
  37. </view>
  38. <view class="null" v-if="depList.length === 0">暂无数据</view>
  39. <tm-modal v-show="showModal" v-on:click="showModalHandle(false)">
  40. <view class="content-list">
  41. <view class="list-item"
  42. v-for="(item, index) in planList"
  43. :class="{active: checkId === item.id}"
  44. @click="checkItem($event, item.id)"
  45. :key="index">
  46. <view>
  47. <text>{{item.name}}({{item.startDate}} ~ {{item.endDate}})</text>
  48. <view class="item-icon"
  49. :class="{icon2: Number(item.status) === 2}"
  50. v-if="Number(item.status) !== 1">
  51. {{Number(item.status) === 2 ? '进行中' : '已完成'}}
  52. </view>
  53. </view>
  54. <image class="check-img"
  55. v-if="checkId === item.id"
  56. src="../../static/checkStatus.png"></image>
  57. </view>
  58. </view>
  59. </tm-modal>
  60. </view>
  61. </template>
  62. <script>
  63. import {_stopPropagation} from "../../utils/compatible.js";
  64. export default {
  65. data() {
  66. return {
  67. showModal: false,
  68. planList: [],
  69. checkId: '',
  70. depList: []
  71. };
  72. },
  73. computed: {
  74. checkIndex: function() {
  75. let index = this.planList.findIndex((item)=> item.id === this.checkId);
  76. if(index !== -1) {
  77. return index + 1;
  78. } else {
  79. return 0;
  80. }
  81. }
  82. },
  83. onLoad: function ({situationId}) {
  84. this.dispatch('planList', {situationId}).then((data)=>{
  85. if(data) {
  86. this.planList = data;
  87. let check = data.find((item)=> Number(item.status)=== 2);
  88. this.checkId = check ? check.id
  89. : data.length > 0 ? data[0].id : '';
  90. this.getDepList();
  91. }
  92. });
  93. },
  94. methods: {
  95. checkItem: function(e, id) {
  96. _stopPropagation(e);
  97. if(this.checkId === id) return;
  98. this.checkId = id;
  99. this.getDepList();
  100. },
  101. getDepList: function() {
  102. this.dispatch('depList', {checkId: this.checkId}).then((data)=>{
  103. if(data) {
  104. this.depList = data;
  105. this.showModalHandle(false);
  106. }
  107. });
  108. },
  109. showModalHandle: function(showModal) {
  110. this.showModal = showModal;
  111. },
  112. gotoCheckMainPointsPage({checkId, deptId}) {
  113. //跳转到查核要点
  114. uni.navigateTo({
  115. url: `/pages/checkMainPoints/checkMainPoints?checkId=${checkId}&deptId=${deptId}`
  116. });
  117. },
  118. dispatch: function(key, data) {
  119. return this.$store.dispatch({type: 'checkList/commActions', key, data});
  120. },
  121. }
  122. }
  123. </script>
  124. <style lang="less">
  125. .check-map-list {
  126. padding: 25rpx;
  127. padding-top: 75rpx;
  128. .top-menu {
  129. overflow: hidden;
  130. display: flex;
  131. flex-direction: row;
  132. justify-content: center;
  133. align-items: center;
  134. height: 50rpx;
  135. image {
  136. margin-left: 9.37rpx;
  137. width: 12.5rpx;
  138. height: 12.5rpx;
  139. }
  140. }
  141. .item {
  142. position: relative;
  143. }
  144. .icon-wrap {
  145. position: absolute;
  146. top: 0;
  147. right: 0;
  148. width: 100rpx;
  149. height: 35rpx;
  150. image {
  151. width: 100%;
  152. height: 100%;
  153. }
  154. text {
  155. position: absolute;
  156. left: 28.75rpx;
  157. line-height: 35rpx;
  158. font-size: 17.5rpx;
  159. color: #fff;
  160. }
  161. }
  162. .footer {
  163. display: flex;
  164. flex-direction: row;
  165. justify-content: space-between;
  166. align-items: center;
  167. margin: 0 25rpx 16.87rpx;
  168. border-top: 1px solid #DADEE6;
  169. padding-top: 16.25rpx;
  170. font-size: 17.5rpx;
  171. line-height: 26.25rpx;
  172. color: #666E80;
  173. }
  174. }
  175. .null {
  176. text-align: center;
  177. color: #999;
  178. }
  179. .content-list {
  180. padding-top: 50rpx;
  181. width: 100%;
  182. background-color: #fff;
  183. .list-item {
  184. display: flex;
  185. flex-direction: row;
  186. justify-content: space-between;
  187. align-items: center;
  188. border-bottom: 1px solid #DADEE6;
  189. padding: 0 25rpx;
  190. width: 100%;
  191. height: 87.5rpx;
  192. font-size: 22.5rpx;
  193. line-height: 33.75rpx;
  194. color: #292C33;
  195. .check-img {
  196. float: right;
  197. width: 19.37rpx;
  198. height: 14.37rpx;
  199. }
  200. >view {
  201. display: flex;
  202. flex-direction: row;
  203. .item-icon {
  204. border-radius: 5rpx;
  205. padding: 6.25rpx 11.25rpx;
  206. line-height: 26.25rpx;
  207. color: #29CC96;
  208. background-color: #e9f9f4;
  209. &.icon2 {
  210. color: #FFAA00;
  211. background-color: #fff9ef;
  212. }
  213. }
  214. }
  215. &.active {
  216. color: #3377FF;
  217. }
  218. }
  219. }
  220. </style>