checkMainPoints.vue 9.3 KB

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