checkMainPoints.vue 9.7 KB

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