checkList.vue 6.2 KB

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