checkList.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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>{{createTitle}}</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. createTitle: function() {
  79. let item = this.planList.find((item)=> item.id === this.checkId);
  80. if(item) {
  81. let name = item.name;
  82. return name.slice(0, name.length - 3) + `/${this.planList.length}` + name.slice(-3);
  83. } else {
  84. return '';
  85. }
  86. }
  87. },
  88. onLoad: function ({situationId}) {
  89. this.dispatch('planList', {situationId}).then((data)=>{
  90. if(data) {
  91. this.planList = data;
  92. let checkArr = data.filter((item)=> Number(item.status)=== 2).sort((a,b)=>a.createTime - b.createTime);
  93. this.checkId = checkArr ? checkArr[checkArr.length - 1].id
  94. : data.length > 0 ? data[0].id : '';
  95. this.getDepList();
  96. }
  97. });
  98. },
  99. methods: {
  100. checkItem: function(e, id) {
  101. _stopPropagation(e);
  102. if(this.checkId === id) return;
  103. this.checkId = id;
  104. this.getDepList();
  105. },
  106. getDepList: function() {
  107. this.dispatch('depList', {checkId: this.checkId}).then((data)=>{
  108. if(data) {
  109. this.depList = data.sort((a,b)=> {
  110. if(a.sort && b.sort) return a.sort - b.sort;
  111. });
  112. this.showModalHandle(false);
  113. }
  114. });
  115. },
  116. showModalHandle: function(showModal) {
  117. this.showModal = showModal;
  118. },
  119. gotoCheckMainPointsPage({checkId, deptId}) {
  120. //跳转到查核要点
  121. uni.navigateTo({
  122. url: `/pages/checkMainPoints/checkMainPoints?checkId=${checkId}&deptId=${deptId}`
  123. });
  124. },
  125. dispatch: function(key, data) {
  126. return this.$store.dispatch({type: 'checkList/commActions', key, data});
  127. },
  128. }
  129. }
  130. </script>
  131. <style lang="less">
  132. .check-map-list-page {
  133. position: relative;
  134. height: 100%;
  135. }
  136. .check-map-list {
  137. padding: 25rpx;
  138. padding-top: 75rpx;
  139. height: 100%;
  140. .top-menu {
  141. overflow: hidden;
  142. display: flex;
  143. flex-direction: row;
  144. justify-content: center;
  145. align-items: center;
  146. height: 50rpx;
  147. image {
  148. margin-left: 9.37rpx;
  149. width: 12.5rpx;
  150. height: 12.5rpx;
  151. }
  152. }
  153. .item {
  154. position: relative;
  155. }
  156. .icon-wrap {
  157. position: absolute;
  158. top: 0;
  159. right: 0;
  160. width: 100rpx;
  161. height: 35rpx;
  162. image {
  163. width: 100%;
  164. height: 100%;
  165. }
  166. text {
  167. position: absolute;
  168. left: 28.75rpx;
  169. line-height: 35rpx;
  170. font-size: 17.5rpx;
  171. color: #fff;
  172. }
  173. }
  174. .footer {
  175. display: flex;
  176. flex-direction: row;
  177. justify-content: space-between;
  178. align-items: center;
  179. margin: 0 25rpx 16.87rpx;
  180. border-top: 1px solid #DADEE6;
  181. padding-top: 16.25rpx;
  182. font-size: 17.5rpx;
  183. line-height: 26.25rpx;
  184. color: #666E80;
  185. }
  186. }
  187. .content-list {
  188. padding-top: 50rpx;
  189. width: 100%;
  190. height: 100%;
  191. background-color: #fff;
  192. .list-item {
  193. display: flex;
  194. flex-direction: row;
  195. justify-content: space-between;
  196. align-items: center;
  197. border-bottom: 1px solid #DADEE6;
  198. padding: 0 25rpx;
  199. width: 100%;
  200. height: 87.5rpx;
  201. font-size: 22.5rpx;
  202. line-height: 33.75rpx;
  203. color: #292C33;
  204. .check-img {
  205. float: right;
  206. width: 19.37rpx;
  207. height: 14.37rpx;
  208. }
  209. >view {
  210. display: flex;
  211. flex-direction: row;
  212. .item-icon {
  213. border-radius: 5rpx;
  214. padding: 6.25rpx 11.25rpx;
  215. line-height: 26.25rpx;
  216. color: #29CC96;
  217. background-color: #e9f9f4;
  218. &.icon2 {
  219. color: #FFAA00;
  220. background-color: #fff9ef;
  221. }
  222. }
  223. }
  224. &.active {
  225. color: #3377FF;
  226. }
  227. }
  228. }
  229. </style>