situationDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <template>
  2. <view :class="[isAdmin?'detail-page isAdmin':'detail-page']">
  3. <tm-top-menu v-if="isAdmin">
  4. <button class="copy-btn" @click="editSituation('POST')">复制创建</button>
  5. </tm-top-menu>
  6. <view class="content-info">
  7. <view class="top-box">
  8. <view class="subscript">
  9. <!-- <image class="sub-pic" src="../../static/sDetail-subscript.png"></image> -->
  10. <text class="sub-text">{{topic}}</text>
  11. </view>
  12. <text class="name-text">{{name}}</text>
  13. <text class="time-text">| 情境起止时间:{{startDate}}~{{endDate}}</text>
  14. <text class="nextTime-text">| 下次查核时间:{{nextCheckTime}}</text>
  15. <text class="startEndTime-text" v-show="isStartEndTimeShow">| {{startEndTime}}</text>
  16. <text class="team-text">{{checkGroupName}}</text>
  17. </view>
  18. <view class="list-box">
  19. <view class="check-list" v-show="isCheckImproveShow" @click="gotoCheckPage">
  20. <image class="check-pic" src="../../static/check-list.png"></image>
  21. <text class="list-title">查核列表</text>
  22. <text class="list-info">{{checkStatus}}</text>
  23. </view>
  24. <view class="improve-list" v-show="isCheckImproveShow" @click="gotoImprovePage">
  25. <image class="improve-pic" src="../../static/improve-list.png"></image>
  26. <text class="list-title">改善列表</text>
  27. <text class="list-info">查看改善记录</text>
  28. </view>
  29. <view class="plan-list" v-show="isCheckLeader" @click="gotoPlanPage">
  30. <image class="check-pic" src="../../static/check-list.png"></image>
  31. <text class="list-title">计划列表</text>
  32. <text class="list-info">共{{planCount}}次查核计划,剩余{{toDistribute}}个待分配</text>
  33. </view>
  34. </view>
  35. <view class="info-box">
  36. <view class="text-box">
  37. <text class="info-text">{{description}}</text>
  38. </view>
  39. </view>
  40. </view>
  41. <view class="button-box">
  42. <view class="btn-left btn-item" @click="delSituation" v-show="isAdmin">
  43. <text class="left-text">作废</text>
  44. </view>
  45. <view class="btn-right btn-item" @click="editSituation('PUT')" v-show="canEdit">
  46. <text class="right-text">编辑</text>
  47. </view>
  48. <view class="btn-center btn-item" v-show="isChecker" @click="startUnplanned">
  49. <text class="center-text">开始一次计划外查核</text>
  50. </view>
  51. <view class="btn-left btn-item" v-show="isUnplanned" @click="createCheck">
  52. <text class="left-text">新建一个计划外查核</text>
  53. </view>
  54. <view class="btn-right btn-item" v-show="isUnplanned" @click="startCheck">
  55. <text class="right-text">提前开始一个计划内查核</text>
  56. </view>
  57. </view>
  58. <popup ref="popup" :situationID="situationID"></popup>
  59. <tm-callback-listpage/>
  60. </view>
  61. </template>
  62. <script>
  63. import popup from './components/bottom-popup.vue';
  64. import {dateHandle} from "../../utils/dateHandle.js";
  65. export default {
  66. data() {
  67. return {
  68. nowPermission:'',//用户当前权限
  69. situationID:'',//情境id
  70. checkGroupName:'',//查核组名
  71. checkStatus:'',//查核状态
  72. name:'',//查核名
  73. description:'',//描述
  74. startDate:'',//查核开始时间
  75. endDate:'',//查核结束时间
  76. nextCheckTime:'',//下次查核时间
  77. topic:'',//个案或系统
  78. startEndTime:'',//距离情境开始或结束时间
  79. planCount:'',//总查核计划数
  80. toDistribute:'',//待分配计划数
  81. firstCheckTime:'',//首次查核时间
  82. isCheckImproveShow:false,//查核改善列表是否显示
  83. isStartEndTimeShow:false,//距离情境开始或结束时间是否显示
  84. isAdmin:false,//是否为管理员
  85. isCheckLeader:false,//是否为查核组长
  86. isChecker:false,//是否为查核者
  87. isUnplanned:false,//是否计划外查核
  88. checkFlag:'',//计划查核标志,是新建还是提前开始
  89. checkID:'',//新建查核计划时,计划列表中的前一个计划 id
  90. checkItemList:[],//时间区间包含当前时间的item
  91. checkGroupId: 0, // 查核组id
  92. }
  93. },
  94. computed: {
  95. canEdit: function() {
  96. return this.compareTime(this.firstCheckTime) && this.isAdmin;
  97. }
  98. },
  99. onLoad({ situationId }){ // situationId:情景id
  100. this.situationID=situationId;
  101. },
  102. created: function() {
  103. this.nowPermission=uni.getStorageSync('nowPermission');
  104. this.isAdmin=this.nowPermission==1?true:false;
  105. this.isCheckLeader=this.nowPermission==2?true:false;
  106. this.isChecker=this.nowPermission==3?true:false;
  107. this.isStartEndTimeShow=this.nowPermission==2||this.nowPermission==3?true:false;
  108. this.isCheckImproveShow=this.nowPermission==1||this.nowPermission==4||this.nowPermission==3?true:false;
  109. this.$store.dispatch({
  110. type: 'situationDetail/commActions',
  111. payload: {
  112. key: 'situationDetail',
  113. data:{
  114. id: this.situationID
  115. }
  116. }
  117. }).then((data) => {
  118. if (data) {
  119. this.name=data.name;
  120. this.description=data.description;
  121. this.startDate=data.startDate;
  122. this.endDate=data.endDate;
  123. this.nextCheckTime=data.nextCheckTime;
  124. this.checkGroupName=data.checkGroupName;
  125. this.topic=data.topic==0?'个案':'系统';
  126. this.checkStatus=data.checkStatus;
  127. this.startEndTime=data.startEndTime;
  128. this.planCount=data.planCount;
  129. this.toDistribute=data.toDistribute;
  130. this.situationType = data.situationType;
  131. this.firstCheckTime=data.firstCheckTime;
  132. this.checkGroupId = data.checkGroupId;
  133. }
  134. });
  135. },
  136. methods: {
  137. delSituation(){
  138. uni.showModal({
  139. title:'提示',
  140. content:'请确认是否作废此情境,作废的情境无法被还原',
  141. success: (res) => {
  142. if(res.confirm){
  143. this.$store.dispatch({
  144. type: 'situationDetail/commActions',
  145. payload: {
  146. key: 'situationDelete',
  147. data:{
  148. id:this.situationID
  149. }
  150. }
  151. }).then((data) => {
  152. if (data) {
  153. uni.showModal({
  154. title:'提示',
  155. content:'作废成功',
  156. showCancel: false,
  157. success: (res) => {
  158. uni.navigateTo({url: `/pages/situationsCenter/situationsCenter`});
  159. }
  160. });
  161. }
  162. });
  163. }
  164. }
  165. })
  166. },
  167. editSituation(type){
  168. let url=`/pages/creatingSituations/creatingSituations?id=${this.situationID}&type=${type}`;
  169. if(type === 'PUT') {
  170. let editEnable=this.compareTime(this.firstCheckTime);
  171. if(editEnable){
  172. uni.navigateTo({url});
  173. } else{
  174. uni.showModal({
  175. title:'提示',
  176. content:'已进行过一次查核,不可编辑',
  177. showCancel:false
  178. })
  179. }
  180. } else {
  181. uni.navigateTo({url});
  182. }
  183. },
  184. compareTime(time){
  185. if(!time)return false;
  186. let myDate=dateHandle.todayDate().replace(/-/g,"/");
  187. let firstCheckTime=time.replace(/-/g,"/");
  188. firstCheckTime=Date.parse(firstCheckTime);
  189. myDate=Date.parse(myDate);
  190. if(myDate>firstCheckTime){
  191. return false;
  192. }else{
  193. return true;
  194. }
  195. },
  196. gotoCheckPage(){
  197. //跳转到查核列表
  198. uni.navigateTo({
  199. url: `/pages/checkList/checkList?situationId=${this.situationID}&situationType=${this.situationType}`
  200. });
  201. },
  202. gotoImprovePage(){
  203. //跳转到改善列表
  204. uni.navigateTo({
  205. url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.situationID}`
  206. });
  207. },
  208. gotoPlanPage(){
  209. //跳转到计划列表
  210. uni.navigateTo({
  211. url: `/pages/planList/planList?situationId=${this.situationID}&checkGroupId=${this.checkGroupId}`
  212. });
  213. },
  214. startUnplanned(){
  215. this.isUnplanned=true;
  216. this.isChecker=false;
  217. },
  218. startCheck(){
  219. this.$refs.popup.show();
  220. },
  221. createCheck(){
  222. this.$store.dispatch({
  223. type: 'situationDetail/commActions',
  224. payload: {
  225. key: 'planList',
  226. data:{
  227. situationId:this.situationID
  228. }
  229. }
  230. }).then((data) => {
  231. if (data) {
  232. data.map((item,index)=>{
  233. if(this.compareTime(item.startDate)==false||this.compareTime(item.endDate)){
  234. this.checkItemList.push(item);
  235. }
  236. else{
  237. return;
  238. }
  239. });
  240. this.$store.dispatch({
  241. type: 'situationDetail/commActions',
  242. payload: {
  243. key: 'createCheck',
  244. data:{
  245. checkId:this.checkItemList[0].id
  246. }
  247. }
  248. }).then((data) => {
  249. if(data){
  250. this.gotoCheckPage();
  251. }
  252. });
  253. }
  254. });
  255. }
  256. },
  257. components: {
  258. popup,
  259. }
  260. }
  261. </script>
  262. <style lang="less">
  263. .detail-page{
  264. position: relative;
  265. height: 100%;
  266. .copy-btn {
  267. border: 0;
  268. height: 50rpx;
  269. &::after {
  270. border: 0;
  271. }
  272. }
  273. &.isadmin {
  274. padding-top: 50rpx;
  275. }
  276. .content-info{
  277. background-color: #FFFFFF;
  278. .top-box{
  279. width: 750rpx;
  280. height: 300rpx;
  281. background: linear-gradient(270deg, #3071F2 0%, #4C95FC 100%);
  282. .subscript{
  283. width: 84.37rpx;
  284. height: 35rpx;
  285. float: right;
  286. margin-top: 15rpx;
  287. text-align: center;
  288. background-image: url(../../static/sDetail-subscript.png);
  289. .sub-text{
  290. font-size: 17.5rpx;
  291. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  292. font-weight: 500;
  293. color: #2E6CE6;
  294. line-height: 35rpx;
  295. }
  296. }
  297. .name-text{
  298. font-size: 40rpx;
  299. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  300. font-weight: 400;
  301. color: #FFFFFF;
  302. float: left;
  303. margin-left: 50rpx;
  304. margin-top: 50rpx;
  305. margin-bottom: 31.25rpx;
  306. }
  307. .time-text{
  308. overflow: hidden;
  309. position: absolute;
  310. top: 165rpx;
  311. left: 55rpx;
  312. width: 70%;
  313. white-space: nowrap;
  314. font-size: 20rpx;
  315. font-weight: 400;
  316. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  317. text-overflow: ellipsis;
  318. color: #FFFFFF;
  319. }
  320. .nextTime-text{
  321. font-size: 20rpx;
  322. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  323. font-weight: 400;
  324. color: #FFFFFF;
  325. position: absolute;
  326. left: 55rpx;
  327. top: 205rpx;
  328. }
  329. .startEndTime-text{
  330. font-size: 20rpx;
  331. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  332. font-weight: 400;
  333. color: #FFFFFF;
  334. position: absolute;
  335. left: 55rpx;
  336. top: 240rpx;
  337. }
  338. .team-text{
  339. font-size: 20rpx;
  340. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  341. font-weight: 400;
  342. color: #FFFFFF;
  343. position: absolute;
  344. top: 165rpx;
  345. right: 50rpx;
  346. }
  347. }
  348. .list-box{
  349. width: 687.5rpx;
  350. height: 137.5rpx;
  351. background: #FFFFFF;
  352. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  353. border-radius: 16px;
  354. position: absolute;
  355. left: 31.25rpx;
  356. top: 280rpx;
  357. .check-list{
  358. width: 225rpx;
  359. height: 97.5rpx;
  360. float: left;
  361. margin-top: 40rpx;
  362. margin-left: 81.25rpx;
  363. .check-pic{
  364. width: 38.75rpx;
  365. height: 41.87rpx;
  366. margin-top: 8.12rpx;
  367. }
  368. .list-title{
  369. font-size: 25rpx;
  370. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  371. font-weight: 400;
  372. color: #292C33;
  373. position: absolute;
  374. left: 145rpx;
  375. top: 40rpx;
  376. }
  377. .list-info{
  378. font-size: 17.5rpx;
  379. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  380. font-weight: 400;
  381. color: #666F80;
  382. position: absolute;
  383. left: 145rpx;
  384. top: 80rpx;
  385. }
  386. }
  387. .improve-list{
  388. width: 225rpx;
  389. height:97.5rpx;
  390. float: right;
  391. margin-top: 40rpx;
  392. margin-right: 81.25rpx;
  393. .improve-pic{
  394. width: 40rpx;
  395. height: 40rpx;
  396. margin-top: 8.12rpx;
  397. }
  398. .list-title{
  399. font-size: 25rpx;
  400. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  401. font-weight: 400;
  402. color: #292C33;
  403. position: absolute;
  404. top: 40rpx;
  405. left: 458.75rpx;
  406. }
  407. .list-info{
  408. font-size: 17.5rpx;
  409. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  410. font-weight: 400;
  411. color: #666F80;
  412. position: absolute;
  413. top: 80rpx;
  414. left: 458.75rpx;
  415. }
  416. }
  417. .plan-list{
  418. width: 225rpx;
  419. height: 97.5rpx;
  420. float: left;
  421. margin-top: 40rpx;
  422. margin-left: 81.25rpx;
  423. .check-pic{
  424. width: 38.75rpx;
  425. height: 41.87rpx;
  426. margin-top: 8.12rpx;
  427. }
  428. .list-title{
  429. font-size: 25rpx;
  430. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  431. font-weight: 400;
  432. color: #292C33;
  433. position: absolute;
  434. left: 145rpx;
  435. top: 40rpx;
  436. }
  437. .list-info{
  438. font-size: 17.5rpx;
  439. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  440. font-weight: 400;
  441. color: #666F80;
  442. position: absolute;
  443. left: 145rpx;
  444. top: 80rpx;
  445. }
  446. }
  447. }
  448. .info-box{
  449. overflow: hidden;
  450. padding-bottom: 20rpx;
  451. .text-box{
  452. width: 687.5rpx;
  453. margin-top: 116.87rpx;
  454. margin-left: 31.25rpx;
  455. .info-text{
  456. font-size: 22.5rpx;
  457. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  458. font-weight: 400;
  459. color: #292C33;
  460. }
  461. }
  462. }
  463. }
  464. .button-box{
  465. display: flex;
  466. flex-direction: row;
  467. width: 750rpx;
  468. height: 75rpx;
  469. position: fixed;
  470. bottom: 0;
  471. .btn-item {
  472. flex: 1;
  473. }
  474. .btn-center{
  475. background: #3377FF;
  476. text-align: center;
  477. .center-text{
  478. font-size: 22.5rpx;
  479. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  480. font-weight: 400;
  481. color: #FFFFFF;
  482. line-height: 75rpx;
  483. }
  484. }
  485. .btn-left{
  486. // width: 375rpx;
  487. // height: 75rpx;
  488. background: #FFFFFF;
  489. // float: left;
  490. text-align: center;
  491. border: 0.62rpx solid #DADEE6;
  492. .left-text{
  493. font-size: 22.5rpx;
  494. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  495. font-weight: 400;
  496. color: #3377FF;
  497. line-height: 75rpx;
  498. }
  499. }
  500. .btn-right{
  501. // width: 375rpx;
  502. // height: 75rpx;
  503. background: #3377FF;
  504. // float: right;
  505. text-align: center;
  506. .right-text{
  507. font-size: 22.5rpx;
  508. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  509. font-weight: 400;
  510. color: #FFFFFF;
  511. line-height: 75rpx;
  512. }
  513. }
  514. }
  515. }
  516. </style>