checkList.vue 5.3 KB

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