checkMainPoints.vue 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358
  1. <template>
  2. <view class="checkMainPoints">
  3. <tm-top-menu>
  4. <view class="top-search">
  5. <view class="search">
  6. <input confirm-type="search"
  7. @input="filterFromName"
  8. placeholder="搜索查核要点或查核项" />
  9. <image src="../../static/search.png"></image>
  10. </view>
  11. <view class="top-btn-wrap">
  12. <view class="btn-list" v-if="nowPermission == 3">
  13. <com-button v-for="(item, index) in btnArr"
  14. :btnText="item.label"
  15. :type="active === item.id ? 'pramary':'default'"
  16. v-on:btnClick="btnClick(item.id)"/>
  17. </view>
  18. <view class="select-wrap"
  19. v-else-if="nowPermission == 2 || nowPermission == 1"
  20. @click="toggleModal(!showModal)">
  21. <text>{{getCheckPointName}}</text>
  22. <image :src="`../../static/${showModal?'open':'close'}-icon.png`"></image>
  23. </view>
  24. </view>
  25. </view>
  26. </tm-top-menu>
  27. <tm-modal v-show="showModal" v-on:click="toggleModal(false)">
  28. <view class="content-list">
  29. <view class="list-item"
  30. v-for="(item, index) in point"
  31. :class="{active: checkPointId === item.checkPointId}"
  32. @click="checkPointHandle(item.checkPointId)">
  33. <text>{{item.checkPointName}}</text>
  34. <image class="check-img"
  35. v-if="checkPointId === item.checkPointId"
  36. src="../../static/checkStatus.png"></image>
  37. </view>
  38. </view>
  39. </tm-modal>
  40. <view class="list" v-for="(item, index) in detailList" :key="index">
  41. <view class="title">查核要点一:{{item.checkPointName}}</view>
  42. <view class="item"
  43. v-for="(child, n) in item.responseList"
  44. @click="childClick(child)"
  45. :key="n">
  46. <view class="top-box">
  47. <view class="top-box-left">
  48. <view class="index-icon">{{n + 1}}</view>
  49. <text>{{child.checkItemName}}</text>
  50. <!-- <text>ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)的抢救全过程(访谈)</text> -->
  51. </view>
  52. <image src="../../static/tuli.png"
  53. @click="goLegendDetails($event ,child.checkItemId)"></image>
  54. </view>
  55. <view class="children">
  56. <view class="child">
  57. <text>{{child.deptName || '--'}}</text>
  58. <text>查核单位</text>
  59. </view>
  60. <view class="child">
  61. <text>{{child.checkModelName || '--'}}</text>
  62. <text>查核方式</text>
  63. </view>
  64. <view class="child">
  65. <text>{{child.lastResult || '--'}}</text>
  66. <text>上次结果</text>
  67. </view>
  68. <view class="child">
  69. <text>{{child.checkResult || '--'}}</text>
  70. <text>本次结果</text>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. </template>
  77. <script>
  78. import {_stopPropagation} from "../../utils/compatible.js";
  79. export default {
  80. data() {
  81. return {
  82. btnArr: [
  83. {id: 0, label: '全部'},
  84. {id: 1, label: '未查核'},
  85. {id: 2, label: '已查核'},
  86. ],
  87. showModal: false,
  88. detailList: [],
  89. copyDetailList: [],
  90. point: [{checkPointId: 'all', checkPointName: '全部要点'}],
  91. checkPointId: 'all',
  92. nowPermission: uni.getStorageSync('nowPermission'),
  93. active: 0
  94. };
  95. },
  96. computed: {
  97. getCheckPointName() {
  98. let item=this.point.find((item)=> item.checkPointId === this.checkPointId);
  99. return item ? item.checkPointName : '';
  100. },
  101. },
  102. onLoad: function ({checkId,deptId}) {
  103. this.dispatch('checkTaskDetailList', {checkId,deptId}).then((data)=>{
  104. if(data) {
  105. this.detailList = data;
  106. this.copyDetailList = data;
  107. data.map(({checkPointId,checkPointName})=>{
  108. this.point.push({checkPointId, checkPointName});
  109. });
  110. }
  111. });
  112. },
  113. methods: {
  114. btnClick(id) {
  115. this.active = id;
  116. this.filterCompleteFlag(id);
  117. },
  118. childClick(child) {
  119. // 查核者,管理员
  120. if(this.nowPermission == 1 || this.nowPermission == 3) {
  121. let str = '';
  122. if(child.checkResult) {
  123. // 跳转到查核项详情
  124. str = 'auditItemDetails/auditItemDetails';
  125. } else {
  126. // 跳转到查核结果提交
  127. str = 'mainPointsDetail/mainPointsDetail';
  128. }
  129. uni.navigateTo({
  130. url: `/pages/${str}?id=${child.id}`
  131. });
  132. }
  133. },
  134. toggleModal(flage) {
  135. this.showModal = flage;
  136. },
  137. checkPointHandle(id) {
  138. this.checkPointId = id;
  139. if(id === 'all') {
  140. this.detailList = [...this.copyDetailList];
  141. } else {
  142. this.detailList = this.copyDetailList
  143. .filter((item)=> item.checkPointId === id);
  144. }
  145. },
  146. filterCompleteFlag(btnId) {
  147. if(btnId === 0) {
  148. this.detailList = [...this.copyDetailList];
  149. } else {
  150. let completeFlag = btnId === 1 ? false : true;
  151. this.detailList = this.copyDetailList.map((item)=>{
  152. return {
  153. ...item,
  154. responseList: item.responseList
  155. .filter((child)=> child.completeFlag === completeFlag)
  156. }
  157. });
  158. }
  159. },
  160. filterFromName(e) {
  161. const {value} = e.detail;
  162. if(value === '') {
  163. this.detailList = [...this.copyDetailList];
  164. } else {
  165. this.detailList = [];
  166. this.copyDetailList.map((item)=>{
  167. let responseList = item.responseList
  168. .filter((child)=> child.checkItemName.indexOf(value) >= 0);
  169. if(item.checkPointName.indexOf(value) >= 0) {
  170. this.detailList.push({...item});
  171. } else if(responseList.length > 0) {
  172. this.detailList.push({...item, responseList});
  173. }
  174. });
  175. }
  176. },
  177. goLegendDetails(e, checkItemId) {
  178. _stopPropagation(e);
  179. //跳转到图例详情
  180. uni.navigateTo({
  181. url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}`
  182. });
  183. },
  184. dispatch(key, data) {
  185. return this.$store.dispatch({type: 'checkList/commActions', key, data});
  186. },
  187. }
  188. }
  189. </script>
  190. <style lang="less">
  191. .checkMainPoints {
  192. padding-top: 105rpx;
  193. font-size: 22.5rpx;
  194. line-height: 33.75rpx;
  195. background-color: #F5F6FA;
  196. .top-search {
  197. display: flex;
  198. flex-direction: row;
  199. align-items: center;
  200. padding: 25rpx;
  201. background-color: #fff;
  202. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  203. .search {
  204. position: relative;
  205. width: 100%;
  206. height: 55rpx;
  207. line-height: 55rpx;
  208. background-color: #F0F2F7;
  209. input {
  210. padding: 0 45rpx 0 15rpx;
  211. height: 55rpx;
  212. line-height: 55rpx;
  213. font-size: 22.5rpx;
  214. }
  215. image {
  216. position: absolute;
  217. top: 16.87rpx;
  218. right: 15rpx;
  219. width: 21.25rpx;
  220. height: 21.25rpx;
  221. }
  222. }
  223. .top-btn-wrap {
  224. padding-left: 25rpx;
  225. .btn-list {
  226. display: flex;
  227. flex-direction: row;
  228. .com-button {
  229. margin-left: 5rpx;
  230. &:first-child {
  231. margin-left: 0;
  232. }
  233. }
  234. }
  235. .select-wrap {
  236. display: flex;
  237. flex-direction: row;
  238. align-items: center;
  239. white-space: nowrap;
  240. image {
  241. margin-left: 9.37rpx;
  242. width: 12.5rpx;
  243. height: 12.5rpx;
  244. }
  245. }
  246. }
  247. }
  248. .content-list {
  249. padding-top: 105rpx;
  250. width: 100%;
  251. background-color: #fff;
  252. .list-item {
  253. display: flex;
  254. flex-direction: row;
  255. justify-content: space-between;
  256. align-items: center;
  257. border-bottom: 1px solid #DADEE6;
  258. padding: 0 25rpx;
  259. width: 100%;
  260. height: 87.5rpx;
  261. font-size: 22.5rpx;
  262. line-height: 33.75rpx;
  263. color: #292C33;
  264. .check-img {
  265. float: right;
  266. width: 19.37rpx;
  267. height: 14.37rpx;
  268. }
  269. &.active {
  270. color: #3377FF;
  271. }
  272. }
  273. }
  274. .list {
  275. .title {
  276. padding-left: 25rpx;
  277. width: 100%;
  278. height: 62.5rpx;
  279. line-height: 62.5rpx;
  280. color: #666F80;
  281. }
  282. .item {
  283. margin-top: 15rpx;
  284. padding: 25rpx 0;
  285. min-height: 167.5rpx;
  286. background-color: #fff;
  287. &:nth-child(2) {
  288. margin-top: 0;
  289. }
  290. .top-box {
  291. display: flex;
  292. flex-direction: row;
  293. justify-content: space-between;
  294. align-items: center;
  295. .top-box-left {
  296. display: flex;
  297. flex-direction: row;
  298. width: calc(100% - 55rpx);
  299. .index-icon {
  300. margin-right: 15rpx;
  301. border-radius: 0 62.5rpx 62.5rpx 0;
  302. width: 50rpx;
  303. height: 35rpx;
  304. line-height: 35rpx;
  305. text-align: center;
  306. color: #fff;
  307. background-color: #66B2FE;
  308. }
  309. >text {
  310. display: -webkit-box;
  311. overflow: hidden;
  312. width: calc(100% - 65rpx);
  313. text-overflow: ellipsis;
  314. -webkit-line-clamp: 2;
  315. /*! autoprefixer: off */
  316. -webkit-box-orient: vertical;
  317. }
  318. }
  319. image {
  320. margin-right: 15rpx;
  321. width: 40rpx;
  322. height: 40rpx;
  323. }
  324. }
  325. .children {
  326. display: flex;
  327. flex-direction: row;
  328. align-items: center;
  329. margin-top: 18.75rpx;
  330. .child {
  331. display: flex;
  332. flex-direction: column;
  333. justify-content: center;
  334. align-items: center;
  335. flex: 1;
  336. border-right: 1px solid #DADEE6;
  337. text {
  338. font-weight: 500;
  339. &:last-child {
  340. font-size: 17.5rpx;
  341. line-height: 26.25rpx;
  342. color: #7A8599;
  343. font-weight: 400;
  344. }
  345. }
  346. &:last-child {
  347. border-right: 0;
  348. }
  349. }
  350. }
  351. }
  352. }
  353. }
  354. </style>