checkList.vue 5.8 KB

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