checkMainPoints.vue 11 KB

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