checkMainPoints.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635
  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. const nowPermission = JSON.parse(uni.getStorageSync('nowPermission'));
  227. console.log({nowPermission});
  228. this.$store.commit('checkMainPoints/comChangeState',{key:'detailList',data:data.checkDetailMapResponses});
  229. if(!data.isBindResponsible&&data.checkDetailMapResponses.length>0&&nowPermission==3){
  230. //当未绑定当事人状态为false,可查核项大于0且当前角色是查核组员时
  231. uni.showModal({
  232. title: '提示',
  233. content: '目前未批量分配当事人,是否前往选择?',
  234. success:(res)=>{
  235. if (res.confirm) {
  236. uni.navigateTo({
  237. url: `/pages/responsibleList/responsibleList?deptId=${this.deptId}&isFromCheckMainPoints=true`,
  238. });
  239. } else if (res.cancel) {
  240. console.log('用户点击取消');
  241. }
  242. }
  243. });
  244. }
  245. this.detailList = data.checkDetailMapResponses;
  246. this.copyDetailList = data.checkDetailMapResponses;
  247. this.currentScore = data.getScore;
  248. this.totalScore = data.totalScore;
  249. data.checkDetailMapResponses.map(({
  250. checkPointId,
  251. checkPointName
  252. }) => {
  253. this.point.push({
  254. checkPointId,
  255. checkPointName
  256. });
  257. });
  258. }
  259. });
  260. },
  261. childClick(child, checkPointId) {
  262. // 查核者,管理员
  263. if (this.nowPermission == 1 || this.nowPermission == 3) {
  264. let str = '',
  265. that = this;
  266. if (child.checkResult&&!child.allowEdit) {
  267. // 当存在查核结果且不允许再修改时 跳转到查核项详情
  268. str = 'auditItemDetails/auditItemDetails';
  269. } else {
  270. if (this.nowPermission == 1) {
  271. uni.showModal({
  272. title: '提示',
  273. content: '请切换至查核者角色再进行查核操作!',
  274. showCancel: false
  275. });
  276. return;
  277. } else {
  278. // 跳转到查核结果提交
  279. str = 'mainPointsDetail/mainPointsDetail';
  280. }
  281. }
  282. uni.navigateTo({
  283. url: `/pages/${str}?id=${child.id}&checkPointId=${checkPointId}&checkItemId=${child.checkItemId}`,
  284. success: function(res) {
  285. const currentGroup = that.detailList.filter(item => item.checkPointId ==
  286. checkPointId);
  287. // 通过eventChannel向被打开页面传送数据
  288. res.eventChannel.emit('acceptDataFromOpenerPage', {
  289. data: currentGroup
  290. });
  291. }
  292. });
  293. }
  294. },
  295. toggleModal(flage) {
  296. this.showModal = flage;
  297. },
  298. checkPointHandle(id) {
  299. this.checkPointId = id;
  300. if (id === 'all') {
  301. this.detailList = [...this.copyDetailList];
  302. } else {
  303. this.detailList = this.copyDetailList
  304. .filter((item) => item.checkPointId === id);
  305. }
  306. },
  307. filterCompleteFlag(btnId) {
  308. if (btnId === 0) {
  309. this.detailList = [...this.copyDetailList];
  310. } else {
  311. let completeFlag = btnId === 1 ? false : true;
  312. this.detailList = this.copyDetailList.map((item) => {
  313. return {
  314. ...item,
  315. responseList: item.responseList
  316. .filter((child) => child.completeFlag === completeFlag)
  317. }
  318. });
  319. }
  320. },
  321. filterFromName(e) {
  322. const {
  323. value
  324. } = e.detail;
  325. if (value === '') {
  326. this.detailList = [...this.copyDetailList];
  327. } else {
  328. this.detailList = [];
  329. this.copyDetailList.map((item) => {
  330. let responseList = item.responseList
  331. .filter((child) => child.checkItemName.indexOf(value) >= 0);
  332. if (item.checkPointName.indexOf(value) >= 0) {
  333. this.detailList.push({
  334. ...item
  335. });
  336. } else if (responseList.length > 0) {
  337. this.detailList.push({
  338. ...item,
  339. responseList
  340. });
  341. }
  342. });
  343. }
  344. },
  345. goLegendDetails(e, checkItemId, checkPointId) {
  346. _stopPropagation(e);
  347. //跳转到图例详情
  348. uni.navigateTo({
  349. url: `/pages/legendDetails/legendDetails?checkItemId=${checkItemId}&checkPointId=${checkPointId}`
  350. });
  351. },
  352. dispatch(key, data) {
  353. return this.$store.dispatch({
  354. type: 'checkList/commActions',
  355. key,
  356. data
  357. });
  358. },
  359. }
  360. }
  361. </script>
  362. <style lang="less">
  363. .checkMainPoints {
  364. position: relative;
  365. padding-top: 105rpx;
  366. height: 100%;
  367. font-size: 22.5rpx;
  368. line-height: 33.75rpx;
  369. background-color: #F5F6FA;
  370. .botOneKeyCheck {
  371. text-align: center;
  372. height: 75rpx;
  373. width: 100%;
  374. line-height: 75rpx;
  375. font-size: 22.5rpx;
  376. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  377. font-weight: 400;
  378. color: #FFFFFF;
  379. background: #3377FF;
  380. }
  381. .bottomBtnGroup {
  382. position: fixed;
  383. width: 100%;
  384. left:0;
  385. bottom: 0;
  386. display: flex;
  387. flex-direction: row;
  388. border-top:1px solid #DADEE6;
  389. background-color: #fff;
  390. .score {
  391. display: flex;
  392. width: 50%;
  393. flex-direction: row;
  394. justify-content: center;
  395. align-items: center;
  396. height: 75rpx;
  397. .box {
  398. width: 50%;
  399. text-align: center;
  400. white-space: nowrap;
  401. vertical-align:bottom;
  402. .label {
  403. color: #666E80;
  404. font-size: 17.5rpx;
  405. margin-right: 10rpx;
  406. }
  407. .currentScore {
  408. font-size:30rpx;
  409. font-weight: bold;
  410. color: #3377FF;
  411. }
  412. .totalScore {
  413. font-size:30rpx;
  414. font-weight: bold;
  415. color: #292C33;
  416. }
  417. }
  418. .midLine {
  419. height:17.5rpx;
  420. border-left: 0.62rpx solid #DADEE6;
  421. }
  422. }
  423. .botOneKeyCheck {
  424. text-align: center;
  425. height: 75rpx;
  426. flex-grow: 1;
  427. line-height: 75rpx;
  428. font-size: 22.5rpx;
  429. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  430. font-weight: 400;
  431. color: #FFFFFF;
  432. background: #3377FF;
  433. }
  434. }
  435. .top-search {
  436. display: flex;
  437. flex-direction: row;
  438. align-items: center;
  439. padding: 25rpx;
  440. background-color: #fff;
  441. box-shadow: 0 3.75rpx 12.5rpx 0 rgba(0, 13, 51, 0.1);
  442. .search {
  443. position: relative;
  444. width: 100%;
  445. height: 55rpx;
  446. line-height: 55rpx;
  447. background-color: #F0F2F7;
  448. input {
  449. padding: 0 45rpx 0 15rpx;
  450. height: 55rpx;
  451. line-height: 55rpx;
  452. font-size: 22.5rpx;
  453. }
  454. image {
  455. position: absolute;
  456. top: 16.87rpx;
  457. right: 15rpx;
  458. width: 21.25rpx;
  459. height: 21.25rpx;
  460. }
  461. }
  462. .top-btn-wrap {
  463. padding-left: 25rpx;
  464. .btn-list {
  465. display: flex;
  466. flex-direction: row;
  467. .com-button {
  468. margin-left: 5rpx;
  469. &:first-child {
  470. margin-left: 0;
  471. }
  472. }
  473. }
  474. .select-wrap {
  475. display: flex;
  476. flex-direction: row;
  477. align-items: center;
  478. white-space: nowrap;
  479. image {
  480. margin-left: 9.37rpx;
  481. width: 12.5rpx;
  482. height: 12.5rpx;
  483. }
  484. }
  485. }
  486. }
  487. .content-list {
  488. padding-top: 105rpx;
  489. width: 100%;
  490. background-color: #fff;
  491. .list-item {
  492. display: flex;
  493. flex-direction: row;
  494. justify-content: space-between;
  495. align-items: center;
  496. border-bottom: 1px solid #DADEE6;
  497. padding: 0 25rpx;
  498. width: 100%;
  499. height: 87.5rpx;
  500. font-size: 22.5rpx;
  501. line-height: 33.75rpx;
  502. color: #292C33;
  503. .check-img {
  504. float: right;
  505. width: 19.37rpx;
  506. height: 14.37rpx;
  507. }
  508. &.active {
  509. color: #3377FF;
  510. }
  511. }
  512. }
  513. .scroll-Y {
  514. height: calc(100% - 75rpx);
  515. &.noBtn {
  516. height: 100%;
  517. }
  518. }
  519. .list {
  520. .title {
  521. padding-left: 25rpx;
  522. width: 100%;
  523. height: 62.5rpx;
  524. line-height: 62.5rpx;
  525. color: #666F80;
  526. }
  527. .item {
  528. margin-top: 15rpx;
  529. padding: 25rpx 0;
  530. min-height: 167.5rpx;
  531. background-color: #fff;
  532. &:nth-child(2) {
  533. margin-top: 0;
  534. }
  535. .top-box {
  536. display: flex;
  537. flex-direction: row;
  538. justify-content: space-between;
  539. align-items: center;
  540. .top-box-left {
  541. display: flex;
  542. flex-direction: row;
  543. width: calc(100% - 55rpx);
  544. .index-icon {
  545. margin-right: 15rpx;
  546. border-radius: 0 62.5rpx 62.5rpx 0;
  547. width: 50rpx;
  548. height: 35rpx;
  549. line-height: 35rpx;
  550. text-align: center;
  551. color: #fff;
  552. background-color: #66B2FE;
  553. }
  554. >text {
  555. display: -webkit-box;
  556. overflow: hidden;
  557. width: calc(100% - 65rpx);
  558. text-overflow: ellipsis;
  559. -webkit-line-clamp: 2;
  560. /*! autoprefixer: off */
  561. -webkit-box-orient: vertical;
  562. }
  563. }
  564. image {
  565. margin-right: 15rpx;
  566. width: 40rpx;
  567. height: 40rpx;
  568. }
  569. }
  570. .children {
  571. display: flex;
  572. flex-direction: row;
  573. align-items: center;
  574. margin-top: 18.75rpx;
  575. .child {
  576. display: flex;
  577. flex-direction: column;
  578. justify-content: center;
  579. align-items: center;
  580. flex: 1;
  581. border-right: 1px solid #DADEE6;
  582. text {
  583. font-weight: 500;
  584. &:last-child {
  585. font-size: 17.5rpx;
  586. line-height: 26.25rpx;
  587. color: #7A8599;
  588. font-weight: 400;
  589. }
  590. }
  591. &:last-child {
  592. border-right: 0;
  593. }
  594. }
  595. }
  596. }
  597. }
  598. }
  599. </style>