checkMainPoints.vue 9.1 KB

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