checkList.vue 5.5 KB

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