situationDetail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521
  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.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. height: 100%;
  265. .copy-btn {
  266. border: 0;
  267. height: 50rpx;
  268. &::after {
  269. border: 0;
  270. }
  271. }
  272. &.isadmin {
  273. padding-top: 50rpx;
  274. }
  275. .content-info{
  276. background-color: #FFFFFF;
  277. .top-box{
  278. width: 750rpx;
  279. height: 300rpx;
  280. background: linear-gradient(270deg, #3071F2 0%, #4C95FC 100%);
  281. .subscript{
  282. width: 84.37rpx;
  283. height: 35rpx;
  284. float: right;
  285. margin-top: 15rpx;
  286. text-align: center;
  287. background-image: url(../../static/sDetail-subscript.png);
  288. .sub-text{
  289. font-size: 17.5rpx;
  290. font-family: SourceHanSansCN-Medium, SourceHanSansCN;
  291. font-weight: 500;
  292. color: #2E6CE6;
  293. line-height: 35rpx;
  294. }
  295. }
  296. .name-text{
  297. font-size: 40rpx;
  298. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  299. font-weight: 400;
  300. color: #FFFFFF;
  301. float: left;
  302. margin-left: 50rpx;
  303. margin-top: 50rpx;
  304. margin-bottom: 31.25rpx;
  305. }
  306. .time-text{
  307. overflow: hidden;
  308. position: absolute;
  309. top: 165rpx;
  310. left: 55rpx;
  311. width: 70%;
  312. white-space: nowrap;
  313. font-size: 20rpx;
  314. font-weight: 400;
  315. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  316. text-overflow: ellipsis;
  317. color: #FFFFFF;
  318. }
  319. .nextTime-text{
  320. font-size: 20rpx;
  321. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  322. font-weight: 400;
  323. color: #FFFFFF;
  324. position: absolute;
  325. left: 55rpx;
  326. top: 205rpx;
  327. }
  328. .startEndTime-text{
  329. font-size: 20rpx;
  330. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  331. font-weight: 400;
  332. color: #FFFFFF;
  333. position: absolute;
  334. left: 55rpx;
  335. top: 240rpx;
  336. }
  337. .team-text{
  338. font-size: 20rpx;
  339. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  340. font-weight: 400;
  341. color: #FFFFFF;
  342. position: absolute;
  343. top: 165rpx;
  344. right: 50rpx;
  345. }
  346. }
  347. .list-box{
  348. width: 687.5rpx;
  349. height: 137.5rpx;
  350. background: #FFFFFF;
  351. box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
  352. border-radius: 16px;
  353. position: absolute;
  354. left: 31.25rpx;
  355. top: 280rpx;
  356. .check-list{
  357. width: 225rpx;
  358. height: 97.5rpx;
  359. float: left;
  360. margin-top: 40rpx;
  361. margin-left: 81.25rpx;
  362. .check-pic{
  363. width: 38.75rpx;
  364. height: 41.87rpx;
  365. margin-top: 8.12rpx;
  366. }
  367. .list-title{
  368. font-size: 25rpx;
  369. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  370. font-weight: 400;
  371. color: #292C33;
  372. position: absolute;
  373. left: 145rpx;
  374. top: 40rpx;
  375. }
  376. .list-info{
  377. font-size: 17.5rpx;
  378. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  379. font-weight: 400;
  380. color: #666F80;
  381. position: absolute;
  382. left: 145rpx;
  383. top: 80rpx;
  384. }
  385. }
  386. .improve-list{
  387. width: 225rpx;
  388. height:97.5rpx;
  389. float: right;
  390. margin-top: 40rpx;
  391. margin-right: 81.25rpx;
  392. .improve-pic{
  393. width: 40rpx;
  394. height: 40rpx;
  395. margin-top: 8.12rpx;
  396. }
  397. .list-title{
  398. font-size: 25rpx;
  399. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  400. font-weight: 400;
  401. color: #292C33;
  402. position: absolute;
  403. top: 40rpx;
  404. left: 458.75rpx;
  405. }
  406. .list-info{
  407. font-size: 17.5rpx;
  408. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  409. font-weight: 400;
  410. color: #666F80;
  411. position: absolute;
  412. top: 80rpx;
  413. left: 458.75rpx;
  414. }
  415. }
  416. .plan-list{
  417. width: 225rpx;
  418. height: 97.5rpx;
  419. float: left;
  420. margin-top: 40rpx;
  421. margin-left: 81.25rpx;
  422. .check-pic{
  423. width: 38.75rpx;
  424. height: 41.87rpx;
  425. margin-top: 8.12rpx;
  426. }
  427. .list-title{
  428. font-size: 25rpx;
  429. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  430. font-weight: 400;
  431. color: #292C33;
  432. position: absolute;
  433. left: 145rpx;
  434. top: 40rpx;
  435. }
  436. .list-info{
  437. font-size: 17.5rpx;
  438. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  439. font-weight: 400;
  440. color: #666F80;
  441. position: absolute;
  442. left: 145rpx;
  443. top: 80rpx;
  444. }
  445. }
  446. }
  447. .info-box{
  448. overflow: hidden;
  449. padding-bottom: 20rpx;
  450. .text-box{
  451. width: 687.5rpx;
  452. margin-top: 116.87rpx;
  453. margin-left: 31.25rpx;
  454. .info-text{
  455. font-size: 22.5rpx;
  456. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  457. font-weight: 400;
  458. color: #292C33;
  459. }
  460. }
  461. }
  462. }
  463. .button-box{
  464. display: flex;
  465. flex-direction: row;
  466. width: 750rpx;
  467. height: 75rpx;
  468. position: fixed;
  469. bottom: 0;
  470. .btn-item {
  471. flex: 1;
  472. }
  473. .btn-center{
  474. background: #3377FF;
  475. text-align: center;
  476. .center-text{
  477. font-size: 22.5rpx;
  478. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  479. font-weight: 400;
  480. color: #FFFFFF;
  481. line-height: 75rpx;
  482. }
  483. }
  484. .btn-left{
  485. // width: 375rpx;
  486. // height: 75rpx;
  487. background: #FFFFFF;
  488. // float: left;
  489. text-align: center;
  490. border: 0.62rpx solid #DADEE6;
  491. .left-text{
  492. font-size: 22.5rpx;
  493. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  494. font-weight: 400;
  495. color: #3377FF;
  496. line-height: 75rpx;
  497. }
  498. }
  499. .btn-right{
  500. // width: 375rpx;
  501. // height: 75rpx;
  502. background: #3377FF;
  503. // float: right;
  504. text-align: center;
  505. .right-text{
  506. font-size: 22.5rpx;
  507. font-family: SourceHanSansCN-Normal, SourceHanSansCN;
  508. font-weight: 400;
  509. color: #FFFFFF;
  510. line-height: 75rpx;
  511. }
  512. }
  513. }
  514. }
  515. </style>