checkMainPoints.vue 9.2 KB

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