checkMainPoints.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  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. <scroll-view @scroll="scrollHandle" scroll-y="true" :class="(detailList.length>0&&active != 2&&finishedStatus != 1)?'scroll-Y':'scroll-Y noBtn'" >
  33. <view class="list" v-for="(item, index) in detailList" :key="index">
  34. <view class="title" v-if="item.responseList.length > 0">查核要点:{{item.checkPointName}}</view>
  35. <view class="item" v-for="(child, n) in item.responseList" @click="childClick(child,item.checkPointId)"
  36. :key="n">
  37. <view class="top-box">
  38. <view class="top-box-left">
  39. <view class="index-icon">{{n + 1}}</view>
  40. <text>{{child.checkItemName}}</text>
  41. <!-- <text>ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)ICU病房查看危重病人的抢救全过程(访谈)的抢救全过程(访谈)</text> -->
  42. </view>
  43. <image src="../../static/tuli.png"
  44. @tap.stop="goLegendDetails($event ,child.checkItemId, item.checkPointId)"></image>
  45. </view>
  46. <view class="children">
  47. <view class="child">
  48. <text>{{child.deptName || '--'}}</text>
  49. <text>查核单位</text>
  50. </view>
  51. <view class="child">
  52. <text>{{child.checkModelName || '--'}}</text>
  53. <text>查核方式</text>
  54. </view>
  55. <view class="child">
  56. <text>{{child.lastResult || '--'}}</text>
  57. <text>上次结果</text>
  58. </view>
  59. <view class="child">
  60. <text>{{child.checkResult || '--'}}</text>
  61. <text>本次结果</text>
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. </scroll-view>
  67. <tm-callback-listpage />
  68. <view class="bottomBtnGroup">
  69. <view class="score">
  70. <view class="box">
  71. <text class="label">得分</text>
  72. <text class="currentScore">{{currentScore}}</text>
  73. </view>
  74. <view class="midLine"></view>
  75. <view class="box">
  76. <text class="label">总分</text>
  77. <text class="totalScore">{{totalScore}}</text>
  78. </view>
  79. </view>
  80. <view v-if="detailList.length>0&&active != 2&&finishedStatus != 1" @click="onkeyCheckHandle" class="botOneKeyCheck">完成</view>
  81. </view>
  82. <!-- <view v-if="detailList.length>0&&active != 2&&finishedStatus != 1" @click="onkeyCheckHandle" class="botOneKeyCheck">完成</view> -->
  83. </view>
  84. </template>
  85. <script>
  86. import {
  87. _stopPropagation
  88. } from "../../utils/compatible.js";
  89. export default {
  90. data() {
  91. return {
  92. btnArr: [{
  93. id: 0,
  94. label: '全部'
  95. },
  96. {
  97. id: 1,
  98. label: '未查核'
  99. },
  100. {
  101. id: 2,
  102. label: '已查核'
  103. },
  104. ],
  105. showModal: false,
  106. detailList: [],
  107. ifFromChildPage:false,
  108. copyDetailList: [],
  109. point: [{
  110. checkPointId: 'all',
  111. checkPointName: '全部要点'
  112. }],
  113. checkPointId: 'all',
  114. nowPermission: uni.getStorageSync('nowPermission'),
  115. active: 0,
  116. checkId: '',
  117. deptId: '',
  118. currentScrollHeight:0,
  119. finishedStatus:0,//所有计划里的查核项是否都以完成
  120. totalScore:0,
  121. currentScore:0,
  122. };
  123. },
  124. computed: {
  125. getCheckPointName() {
  126. let item = this.point.find((item) => item.checkPointId === this.checkPointId);
  127. return item ? item.checkPointName : '';
  128. },
  129. },
  130. onLoad: function({
  131. checkId,
  132. deptId,
  133. finishedStatus
  134. }) {
  135. this.deptId = deptId;
  136. this.checkId = checkId;
  137. this.finishedStatus = finishedStatus;
  138. this.checkTaskDetailList({
  139. deptId,
  140. checkId
  141. });
  142. },
  143. onShow: function() {
  144. if(this.ifFromChildPage){
  145. //页面重新拉取数据
  146. this.checkTaskDetailList({
  147. 'deptId':this.deptId,
  148. 'checkId':this.checkId
  149. });
  150. uni.pageScrollTo({
  151. scrollTop: this.currentScrollHeight,
  152. duration: 300
  153. });
  154. }
  155. },
  156. beforeDestroy(){
  157. this.ifFromChildPage=false;
  158. },
  159. methods: {
  160. //滚动监听事件,记录滚动高度
  161. scrollHandle(e){
  162. this.currentScrollHeight = e.detail.scrollTop;
  163. },
  164. //一键查核
  165. onkeyCheckHandle(){
  166. uni.showModal({
  167. title: '注意',
  168. content: '确定所有未填写查核结果项默认无缺失结果吗?',
  169. success:(res)=>{
  170. if (res.confirm) {
  171. console.log('用户点击确定');
  172. this.oneKeyCheckCommit();
  173. } else if (res.cancel) {
  174. console.log('用户点击取消');
  175. }
  176. }
  177. });
  178. },
  179. oneKeyCheckCommit(){
  180. let ids=[];
  181. console.log('this.detailList',this.detailList);
  182. this.detailList.forEach(item=>{
  183. // console.log(item.responseList);
  184. //筛选掉已查核项
  185. const temp = item.responseList.filter(v=>!v.checkResult);
  186. const arr = temp.map(v=>v.id);
  187. ids = ids.concat(arr);
  188. });
  189. this.$store.dispatch({
  190. type: 'checkMainPoints/commActions',
  191. key: 'oneKeyCheck',
  192. data: ids
  193. }).then(data=>{
  194. if(data){
  195. uni.showModal({
  196. title: '查核完成!',
  197. content: '',
  198. showCancel:false,
  199. success: function (res) {
  200. if (res.confirm) {
  201. console.log('用户点击确定');
  202. uni.navigateBack({
  203. delta: 1
  204. });
  205. }
  206. }
  207. });
  208. }
  209. });
  210. },
  211. btnClick(id) {
  212. // console.log({id});
  213. this.active = id;
  214. this.filterCompleteFlag(id);
  215. },
  216. checkTaskDetailList({
  217. checkId,
  218. deptId
  219. }) {
  220. this.dispatch('checkTaskDetailList', {
  221. checkId,
  222. deptId
  223. }).then((data) => {
  224. if (data) {
  225. // console.log({data});
  226. this.$store.commit('checkMainPoints/comChangeState',{key:'detailList',data:data.checkDetailMapResponses});
  227. if(!data.isBindResponsible){
  228. uni.showModal({
  229. title: '提示',
  230. content: '目前未批量分配当事人,是否前往选择?',
  231. success:(res)=>{
  232. if (res.confirm) {
  233. uni.navigateTo({
  234. url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&isFromCheckMainPoints=true`,
  235. });
  236. } else if (res.cancel) {
  237. console.log('用户点击取消');
  238. }
  239. }
  240. });
  241. }
  242. this.detailList = data.checkDetailMapResponses;
  243. this.copyDetailList = data.checkDetailMapResponses;
  244. this.currentScore = data.getScore;
  245. this.totalScore = data.totalScore;
  246. data.checkDetailMapResponses.map(({
  247. checkPointId,
  248. checkPointName
  249. }) => {
  250. this.point.push({
  251. checkPointId,
  252. checkPointName
  253. });
  254. });
  255. }
  256. });
  257. },
  258. childClick(child, checkPointId) {
  259. // 查核者,管理员
  260. if (this.nowPermission == 1 || this.nowPermission == 3) {
  261. let str = '',
  262. that = this;
  263. if (child.checkResult) {
  264. // 跳转到查核项详情
  265. str = 'auditItemDetails/auditItemDetails';
  266. } else {
  267. if (this.nowPermission == 1) {
  268. uni.showModal({
  269. title: '提示',
  270. content: '请切换至查核者角色再进行查核操作!',
  271. showCancel: false
  272. });
  273. return;
  274. } else {
  275. // 跳转到查核结果提交
  276. str = 'mainPointsDetail/mainPointsDetail';
  277. }
  278. }
  279. uni.navigateTo({
  280. url: `/pages/${str}?id=${child.id}&checkPointId=${checkPointId}&checkItemId=${child.checkItemId}`,
  281. success: function(res) {
  282. const currentGroup = that.detailList.filter(item => item.checkPointId ==
  283. checkPointId);
  284. // 通过eventChannel向被打开页面传送数据
  285. res.eventChannel.emit('acceptDataFromOpenerPage', {
  286. data: currentGroup
  287. });
  288. }
  289. });
  290. }
  291. },
  292. toggleModal(flage) {
  293. this.showModal = flage;
  294. },
  295. checkPointHandle(id) {
  296. this.checkPointId = id;
  297. if (id === 'all') {
  298. this.detailList = [...this.copyDetailList];
  299. } else {
  300. this.detailList = this.copyDetailList
  301. .filter((item) => item.checkPointId === id);
  302. }
  303. },
  304. filterCompleteFlag(btnId) {
  305. if (btnId === 0) {
  306. this.detailList = [...this.copyDetailList];
  307. } else {
  308. let completeFlag = btnId === 1 ? false : true;
  309. this.detailList = this.copyDetailList.map((item) => {
  310. return {
  311. ...item,
  312. responseList: item.responseList
  313. .filter((child) => child.completeFlag === completeFlag)
  314. }
  315. });
  316. }
  317. },
  318. filterFromName(e) {
  319. const {
  320. value
  321. } = e.detail;
  322. if (value === '') {
  323. this.detailList = [...this.copyDetailList];
  324. } else {
  325. this.detailList = [];
  326. this.copyDetailList.map((item) => {
  327. let responseList = item.responseList
  328. .filter((child) => child.checkItemName.indexOf(value) >= 0);
  329. if (item.checkPointName.indexOf(value) >= 0) {
  330. this.detailList.push({
  331. ...item
  332. });
  333. } else if (responseList.length > 0) {
  334. this.detailList.push({
  335. ...item,
  336. responseList
  337. });
  338. }
  339. });
  340. }
  341. },
  342. goLegendDetails(e, checkItemId, checkPointId) {
  343. _stopPropagation(e);
  344. //跳转到图例详情
  345. uni.navigateTo({
  346. url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}&checkPointId=${checkPointId}`
  347. });
  348. },
  349. dispatch(key, data) {
  350. return this.$store.dispatch({
  351. type: 'checkList/commActions',
  352. key,
  353. data
  354. });
  355. },
  356. }
  357. }
  358. </script>
  359. <style lang="less">
  360. .checkMainPoints {
  361. position: relative;
  362. padding-top: 105rpx;
  363. height: 100%;
  364. font-size: 22.5rpx;
  365. line-height: 33.75rpx;
  366. background-color: #F5F6FA;
  367. .botOneKeyCheck {
  368. text-align: center;
  369. height: 75rpx;
  370. width: 100%;
  371. line-height: 75rpx;
  372. font-size: 22.5rpx;
  373. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  374. font-weight: 400;
  375. color: #FFFFFF;
  376. background: #3377FF;
  377. }
  378. .bottomBtnGroup {
  379. position: fixed;
  380. width: 100%;
  381. left:0;
  382. bottom: 0;
  383. display: flex;
  384. flex-direction: row;
  385. border-top:1px solid #DADEE6;
  386. background-color: #fff;
  387. .score {
  388. display: flex;
  389. width: 50%;
  390. flex-direction: row;
  391. justify-content: center;
  392. align-items: center;
  393. height: 75rpx;
  394. .box {
  395. width: 50%;
  396. text-align: center;
  397. white-space: nowrap;
  398. vertical-align:bottom;
  399. .label {
  400. color: #666E80;
  401. font-size: 17.5rpx;
  402. margin-right: 10rpx;
  403. }
  404. .currentScore {
  405. font-size:30rpx;
  406. font-weight: bold;
  407. color: #3377FF;
  408. }
  409. .totalScore {
  410. font-size:30rpx;
  411. font-weight: bold;
  412. color: #292C33;
  413. }
  414. }
  415. .midLine {
  416. height:17.5rpx;
  417. border-left: 1px solid #DADEE6;
  418. }
  419. }
  420. .botOneKeyCheck {
  421. text-align: center;
  422. height: 75rpx;
  423. flex-grow: 1;
  424. line-height: 75rpx;
  425. font-size: 22.5rpx;
  426. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  427. font-weight: 400;
  428. color: #FFFFFF;
  429. background: #3377FF;
  430. }
  431. }
  432. .top-search {
  433. display: flex;
  434. flex-direction: row;
  435. align-items: center;
  436. padding: 25rpx;
  437. background-color: #fff;
  438. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  439. .search {
  440. position: relative;
  441. width: 100%;
  442. height: 55rpx;
  443. line-height: 55rpx;
  444. background-color: #F0F2F7;
  445. input {
  446. padding: 0 45rpx 0 15rpx;
  447. height: 55rpx;
  448. line-height: 55rpx;
  449. font-size: 22.5rpx;
  450. }
  451. image {
  452. position: absolute;
  453. top: 16.87rpx;
  454. right: 15rpx;
  455. width: 21.25rpx;
  456. height: 21.25rpx;
  457. }
  458. }
  459. .top-btn-wrap {
  460. padding-left: 25rpx;
  461. .btn-list {
  462. display: flex;
  463. flex-direction: row;
  464. .com-button {
  465. margin-left: 5rpx;
  466. &:first-child {
  467. margin-left: 0;
  468. }
  469. }
  470. }
  471. .select-wrap {
  472. display: flex;
  473. flex-direction: row;
  474. align-items: center;
  475. white-space: nowrap;
  476. image {
  477. margin-left: 9.37rpx;
  478. width: 12.5rpx;
  479. height: 12.5rpx;
  480. }
  481. }
  482. }
  483. }
  484. .content-list {
  485. padding-top: 105rpx;
  486. width: 100%;
  487. background-color: #fff;
  488. .list-item {
  489. display: flex;
  490. flex-direction: row;
  491. justify-content: space-between;
  492. align-items: center;
  493. border-bottom: 1px solid #DADEE6;
  494. padding: 0 25rpx;
  495. width: 100%;
  496. height: 87.5rpx;
  497. font-size: 22.5rpx;
  498. line-height: 33.75rpx;
  499. color: #292C33;
  500. .check-img {
  501. float: right;
  502. width: 19.37rpx;
  503. height: 14.37rpx;
  504. }
  505. &.active {
  506. color: #3377FF;
  507. }
  508. }
  509. }
  510. .scroll-Y {
  511. height: calc(100% - 75rpx);
  512. &.noBtn {
  513. height: 100%;
  514. }
  515. }
  516. .list {
  517. .title {
  518. padding-left: 25rpx;
  519. width: 100%;
  520. height: 62.5rpx;
  521. line-height: 62.5rpx;
  522. color: #666F80;
  523. }
  524. .item {
  525. margin-top: 15rpx;
  526. padding: 25rpx 0;
  527. min-height: 167.5rpx;
  528. background-color: #fff;
  529. &:nth-child(2) {
  530. margin-top: 0;
  531. }
  532. .top-box {
  533. display: flex;
  534. flex-direction: row;
  535. justify-content: space-between;
  536. align-items: center;
  537. .top-box-left {
  538. display: flex;
  539. flex-direction: row;
  540. width: calc(100% - 55rpx);
  541. .index-icon {
  542. margin-right: 15rpx;
  543. border-radius: 0 62.5rpx 62.5rpx 0;
  544. width: 50rpx;
  545. height: 35rpx;
  546. line-height: 35rpx;
  547. text-align: center;
  548. color: #fff;
  549. background-color: #66B2FE;
  550. }
  551. >text {
  552. display: -webkit-box;
  553. overflow: hidden;
  554. width: calc(100% - 65rpx);
  555. text-overflow: ellipsis;
  556. -webkit-line-clamp: 2;
  557. /*! autoprefixer: off */
  558. -webkit-box-orient: vertical;
  559. }
  560. }
  561. image {
  562. margin-right: 15rpx;
  563. width: 40rpx;
  564. height: 40rpx;
  565. }
  566. }
  567. .children {
  568. display: flex;
  569. flex-direction: row;
  570. align-items: center;
  571. margin-top: 18.75rpx;
  572. .child {
  573. display: flex;
  574. flex-direction: column;
  575. justify-content: center;
  576. align-items: center;
  577. flex: 1;
  578. border-right: 1px solid #DADEE6;
  579. text {
  580. font-weight: 500;
  581. &:last-child {
  582. font-size: 17.5rpx;
  583. line-height: 26.25rpx;
  584. color: #7A8599;
  585. font-weight: 400;
  586. }
  587. }
  588. &:last-child {
  589. border-right: 0;
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. </style>