situationDetail.vue 14 KB

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