situationDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. <template>
  2. <view class="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.firstCheckTime=data.firstCheckTime;
  131. this.checkGroupId = data.checkGroupId;
  132. }
  133. });
  134. },
  135. methods: {
  136. delSituation(){
  137. uni.showModal({
  138. title:'提示',
  139. content:'请确认是否作废此情境,作废的情境无法被还原',
  140. success: (res) => {
  141. if(res.confirm){
  142. this.$store.dispatch({
  143. type: 'situationDetail/commActions',
  144. payload: {
  145. key: 'situationDelete',
  146. data:{
  147. id:this.situationID
  148. }
  149. }
  150. }).then((data) => {
  151. if (data) {
  152. uni.showModal({
  153. title:'提示',
  154. content:'作废成功',
  155. showCancel: false,
  156. success: (res) => {
  157. uni.navigateTo({url: `/pages/situationsCenter/situationsCenter`});
  158. }
  159. });
  160. }
  161. });
  162. }
  163. }
  164. })
  165. },
  166. editSituation(type){
  167. let url=`/pages/creatingSituations/creatingSituations?id=${this.situationID}&type=${type}`;
  168. if(type === 'PUT') {
  169. let editEnable=this.compareTime(this.firstCheckTime);
  170. if(editEnable){
  171. uni.navigateTo({url});
  172. } else{
  173. uni.showModal({
  174. title:'提示',
  175. content:'已进行过一次查核,不可编辑',
  176. showCancel:false
  177. })
  178. }
  179. } else {
  180. uni.navigateTo({url});
  181. }
  182. },
  183. compareTime(time){
  184. if(!time)return false;
  185. let myDate=dateHandle.todayDate().replace(/-/g,"/");
  186. let firstCheckTime=time.replace(/-/g,"/");
  187. firstCheckTime=Date.parse(firstCheckTime);
  188. myDate=Date.parse(myDate);
  189. if(myDate>firstCheckTime){
  190. return false;
  191. }else{
  192. return true;
  193. }
  194. },
  195. gotoCheckPage(){
  196. //跳转到查核列表
  197. uni.navigateTo({
  198. url: `/pages/checkList/checkList?situationId=${this.situationID}`
  199. });
  200. },
  201. gotoImprovePage(){
  202. //跳转到改善列表
  203. uni.navigateTo({
  204. url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.situationID}`
  205. });
  206. },
  207. gotoPlanPage(){
  208. //跳转到计划列表
  209. uni.navigateTo({
  210. url: `/pages/planList/planList?situationId=${this.situationID}&checkGroupId=${this.checkGroupId}`
  211. });
  212. },
  213. startUnplanned(){
  214. this.isUnplanned=true;
  215. this.isChecker=false;
  216. },
  217. startCheck(){
  218. this.$refs.popup.show();
  219. },
  220. createCheck(){
  221. this.$store.dispatch({
  222. type: 'situationDetail/commActions',
  223. payload: {
  224. key: 'planList',
  225. data:{
  226. situationId:this.situationID
  227. }
  228. }
  229. }).then((data) => {
  230. if (data) {
  231. data.map((item,index)=>{
  232. if(this.compareTime(item.startDate)==false||this.compareTime(item.endDate)){
  233. this.checkItemList.push(item);
  234. }
  235. else{
  236. return;
  237. }
  238. });
  239. this.$store.dispatch({
  240. type: 'situationDetail/commActions',
  241. payload: {
  242. key: 'createCheck',
  243. data:{
  244. checkId:this.checkItemList[0].id
  245. }
  246. }
  247. }).then((data) => {
  248. if(data){
  249. this.gotoCheckPage();
  250. }
  251. });
  252. }
  253. });
  254. }
  255. },
  256. components: {
  257. popup,
  258. }
  259. }
  260. </script>
  261. <style lang="less">
  262. .detail-page{
  263. position: relative;
  264. padding-top: 50rpx;
  265. height: 100%;
  266. .copy-btn {
  267. border: 0;
  268. height: 50rpx;
  269. &::after {
  270. border: 0;
  271. }
  272. }
  273. .content-info{
  274. background-color: #FFFFFF;
  275. .top-box{
  276. width: 750rpx;
  277. height: 300rpx;
  278. background: linear-gradient(270deg, #3071F2 0%, #4C95FC 100%);
  279. .subscript{
  280. width: 84.37rpx;
  281. height: 35rpx;
  282. float: right;
  283. margin-top: 15rpx;
  284. text-align: center;
  285. background-image: url(../../static/sDetail-subscript.png);
  286. .sub-text{
  287. font-size: 17.5rpx;
  288. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  289. font-weight: 500;
  290. color: #2E6CE6;
  291. line-height: 35rpx;
  292. }
  293. }
  294. .name-text{
  295. font-size: 40rpx;
  296. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  297. font-weight: 400;
  298. color: #FFFFFF;
  299. float: left;
  300. margin-left: 50rpx;
  301. margin-top: 50rpx;
  302. margin-bottom: 31.25rpx;
  303. }
  304. .time-text{
  305. overflow: hidden;
  306. position: absolute;
  307. top: 165rpx;
  308. left: 55rpx;
  309. width: 70%;
  310. white-space: nowrap;
  311. font-size: 20rpx;
  312. font-weight: 400;
  313. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  314. text-overflow: ellipsis;
  315. color: #FFFFFF;
  316. }
  317. .nextTime-text{
  318. font-size: 20rpx;
  319. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  320. font-weight: 400;
  321. color: #FFFFFF;
  322. position: absolute;
  323. left: 55rpx;
  324. top: 205rpx;
  325. }
  326. .startEndTime-text{
  327. font-size: 20rpx;
  328. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  329. font-weight: 400;
  330. color: #FFFFFF;
  331. position: absolute;
  332. left: 55rpx;
  333. top: 240rpx;
  334. }
  335. .team-text{
  336. font-size: 20rpx;
  337. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  338. font-weight: 400;
  339. color: #FFFFFF;
  340. position: absolute;
  341. top: 165rpx;
  342. right: 50rpx;
  343. }
  344. }
  345. .list-box{
  346. width: 687.5rpx;
  347. height: 137.5rpx;
  348. background: #FFFFFF;
  349. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  350. border-radius: 16px;
  351. position: absolute;
  352. left: 31.25rpx;
  353. top: 280rpx;
  354. .check-list{
  355. width: 225rpx;
  356. height: 97.5rpx;
  357. float: left;
  358. margin-top: 40rpx;
  359. margin-left: 81.25rpx;
  360. .check-pic{
  361. width: 38.75rpx;
  362. height: 41.87rpx;
  363. margin-top: 8.12rpx;
  364. }
  365. .list-title{
  366. font-size: 25rpx;
  367. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  368. font-weight: 400;
  369. color: #292C33;
  370. position: absolute;
  371. left: 145rpx;
  372. top: 40rpx;
  373. }
  374. .list-info{
  375. font-size: 17.5rpx;
  376. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  377. font-weight: 400;
  378. color: #666F80;
  379. position: absolute;
  380. left: 145rpx;
  381. top: 80rpx;
  382. }
  383. }
  384. .improve-list{
  385. width: 225rpx;
  386. height:97.5rpx;
  387. float: right;
  388. margin-top: 40rpx;
  389. margin-right: 81.25rpx;
  390. .improve-pic{
  391. width: 40rpx;
  392. height: 40rpx;
  393. margin-top: 8.12rpx;
  394. }
  395. .list-title{
  396. font-size: 25rpx;
  397. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  398. font-weight: 400;
  399. color: #292C33;
  400. position: absolute;
  401. top: 40rpx;
  402. left: 458.75rpx;
  403. }
  404. .list-info{
  405. font-size: 17.5rpx;
  406. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  407. font-weight: 400;
  408. color: #666F80;
  409. position: absolute;
  410. top: 80rpx;
  411. left: 458.75rpx;
  412. }
  413. }
  414. .plan-list{
  415. width: 225rpx;
  416. height: 97.5rpx;
  417. float: left;
  418. margin-top: 40rpx;
  419. margin-left: 81.25rpx;
  420. .check-pic{
  421. width: 38.75rpx;
  422. height: 41.87rpx;
  423. margin-top: 8.12rpx;
  424. }
  425. .list-title{
  426. font-size: 25rpx;
  427. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  428. font-weight: 400;
  429. color: #292C33;
  430. position: absolute;
  431. left: 145rpx;
  432. top: 40rpx;
  433. }
  434. .list-info{
  435. font-size: 17.5rpx;
  436. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  437. font-weight: 400;
  438. color: #666F80;
  439. position: absolute;
  440. left: 145rpx;
  441. top: 80rpx;
  442. }
  443. }
  444. }
  445. .info-box{
  446. overflow: hidden;
  447. padding-bottom: 20rpx;
  448. .text-box{
  449. width: 687.5rpx;
  450. margin-top: 116.87rpx;
  451. margin-left: 31.25rpx;
  452. .info-text{
  453. font-size: 22.5rpx;
  454. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  455. font-weight: 400;
  456. color: #292C33;
  457. }
  458. }
  459. }
  460. }
  461. .button-box{
  462. display: flex;
  463. flex-direction: row;
  464. width: 750rpx;
  465. height: 75rpx;
  466. position: fixed;
  467. bottom: 0;
  468. .btn-item {
  469. flex: 1;
  470. }
  471. .btn-center{
  472. background: #3377FF;
  473. text-align: center;
  474. .center-text{
  475. font-size: 22.5rpx;
  476. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  477. font-weight: 400;
  478. color: #FFFFFF;
  479. line-height: 75rpx;
  480. }
  481. }
  482. .btn-left{
  483. // width: 375rpx;
  484. // height: 75rpx;
  485. background: #FFFFFF;
  486. // float: left;
  487. text-align: center;
  488. border: 0.62rpx solid #DADEE6;
  489. .left-text{
  490. font-size: 22.5rpx;
  491. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  492. font-weight: 400;
  493. color: #3377FF;
  494. line-height: 75rpx;
  495. }
  496. }
  497. .btn-right{
  498. // width: 375rpx;
  499. // height: 75rpx;
  500. background: #3377FF;
  501. // float: right;
  502. text-align: center;
  503. .right-text{
  504. font-size: 22.5rpx;
  505. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  506. font-weight: 400;
  507. color: #FFFFFF;
  508. line-height: 75rpx;
  509. }
  510. }
  511. }
  512. }
  513. </style>