123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521 |
- <template>
- <view :class="[isAdmin?'detail-page isAdmin':'detail-page']">
- <tm-top-menu v-if="isAdmin">
- <button class="copy-btn" @click="editSituation('POST')">复制创建</button>
- </tm-top-menu>
- <view class="content-info">
- <view class="top-box">
- <view class="subscript">
- <!-- <image class="sub-pic" src="../../static/sDetail-subscript.png"></image> -->
- <text class="sub-text">{{topic}}</text>
- </view>
- <text class="name-text">{{name}}</text>
- <text class="time-text">| 情境起止时间:{{startDate}}~{{endDate}}</text>
- <text class="nextTime-text">| 下次查核时间:{{nextCheckTime}}</text>
- <text class="startEndTime-text" v-show="isStartEndTimeShow">| {{startEndTime}}</text>
- <text class="team-text">{{checkGroupName}}</text>
- </view>
- <view class="list-box">
- <view class="check-list" v-show="isCheckImproveShow" @click="gotoCheckPage">
- <image class="check-pic" src="../../static/check-list.png"></image>
- <text class="list-title">查核列表</text>
- <text class="list-info">{{checkStatus}}</text>
- </view>
- <view class="improve-list" v-show="isCheckImproveShow" @click="gotoImprovePage">
- <image class="improve-pic" src="../../static/improve-list.png"></image>
- <text class="list-title">改善列表</text>
- <text class="list-info">查看改善记录</text>
- </view>
- <view class="plan-list" v-show="isCheckLeader" @click="gotoPlanPage">
- <image class="check-pic" src="../../static/check-list.png"></image>
- <text class="list-title">计划列表</text>
- <text class="list-info">共{{planCount}}次查核计划,剩余{{toDistribute}}个待分配</text>
- </view>
- </view>
- <view class="info-box">
- <view class="text-box">
- <text class="info-text">{{description}}</text>
- </view>
- </view>
- </view>
- <view class="button-box">
- <view class="btn-left btn-item" @click="delSituation" v-show="isAdmin">
- <text class="left-text">作废</text>
- </view>
- <view class="btn-right btn-item" @click="editSituation('PUT')" v-show="canEdit">
- <text class="right-text">编辑</text>
- </view>
- <view class="btn-center btn-item" v-show="isChecker" @click="startUnplanned">
- <text class="center-text">开始一次计划外查核</text>
- </view>
- <view class="btn-left btn-item" v-show="isUnplanned" @click="createCheck">
- <text class="left-text">新建一个计划外查核</text>
- </view>
- <view class="btn-right btn-item" v-show="isUnplanned" @click="startCheck">
- <text class="right-text">提前开始一个计划内查核</text>
- </view>
- </view>
- <popup ref="popup" :situationID="situationID"></popup>
- <tm-callback-listpage/>
- </view>
- </template>
- <script>
- import popup from './components/bottom-popup.vue';
- import {dateHandle} from "../../utils/dateHandle.js";
- export default {
- data() {
- return {
- nowPermission:'',//用户当前权限
- situationID:'',//情境id
- checkGroupName:'',//查核组名
- checkStatus:'',//查核状态
- name:'',//查核名
- description:'',//描述
- startDate:'',//查核开始时间
- endDate:'',//查核结束时间
- nextCheckTime:'',//下次查核时间
- topic:'',//个案或系统
- startEndTime:'',//距离情境开始或结束时间
- planCount:'',//总查核计划数
- toDistribute:'',//待分配计划数
- firstCheckTime:'',//首次查核时间
- isCheckImproveShow:false,//查核改善列表是否显示
- isStartEndTimeShow:false,//距离情境开始或结束时间是否显示
- isAdmin:false,//是否为管理员
- isCheckLeader:false,//是否为查核组长
- isChecker:false,//是否为查核者
- isUnplanned:false,//是否计划外查核
- checkFlag:'',//计划查核标志,是新建还是提前开始
- checkID:'',//新建查核计划时,计划列表中的前一个计划 id
- checkItemList:[],//时间区间包含当前时间的item
- checkGroupId: 0, // 查核组id
- }
- },
- computed: {
- canEdit: function() {
- return this.compareTime(this.firstCheckTime) && this.isAdmin;
- }
- },
- onLoad({ situationId }){ // situationId:情景id
- this.situationID=situationId;
- },
- created: function() {
- this.nowPermission=uni.getStorageSync('nowPermission');
- this.isAdmin=this.nowPermission==1?true:false;
- this.isCheckLeader=this.nowPermission==2?true:false;
- this.isChecker=this.nowPermission==3?true:false;
- this.isStartEndTimeShow=this.nowPermission==2||this.nowPermission==3?true:false;
- this.isCheckImproveShow=this.nowPermission==1||this.nowPermission==4||this.nowPermission==3?true:false;
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'situationDetail',
- data:{
- id: this.situationID
- }
- }
- }).then((data) => {
- if (data) {
- this.name=data.name;
- this.description=data.description;
- this.startDate=data.startDate;
- this.endDate=data.endDate;
- this.nextCheckTime=data.nextCheckTime;
- this.checkGroupName=data.checkGroupName;
- this.topic=data.topic==0?'个案':'系统';
- this.checkStatus=data.checkStatus;
- this.startEndTime=data.startEndTime;
- this.planCount=data.planCount;
- this.toDistribute=data.toDistribute;
- this.firstCheckTime=data.firstCheckTime;
- this.checkGroupId = data.checkGroupId;
- }
- });
- },
- methods: {
- delSituation(){
- uni.showModal({
- title:'提示',
- content:'请确认是否作废此情境,作废的情境无法被还原',
- success: (res) => {
- if(res.confirm){
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'situationDelete',
- data:{
- id:this.situationID
- }
- }
- }).then((data) => {
- if (data) {
- uni.showModal({
- title:'提示',
- content:'作废成功',
- showCancel: false,
- success: (res) => {
- uni.navigateTo({url: `/pages/situationsCenter/situationsCenter`});
- }
- });
- }
- });
- }
- }
- })
- },
- editSituation(type){
- let url=`/pages/creatingSituations/creatingSituations?id=${this.situationID}&type=${type}`;
- if(type === 'PUT') {
- let editEnable=this.compareTime(this.firstCheckTime);
- if(editEnable){
- uni.navigateTo({url});
- } else{
- uni.showModal({
- title:'提示',
- content:'已进行过一次查核,不可编辑',
- showCancel:false
- })
- }
- } else {
- uni.navigateTo({url});
- }
- },
- compareTime(time){
- if(!time)return false;
- let myDate=dateHandle.todayDate().replace(/-/g,"/");
- let firstCheckTime=time.replace(/-/g,"/");
- firstCheckTime=Date.parse(firstCheckTime);
- myDate=Date.parse(myDate);
- if(myDate>firstCheckTime){
- return false;
- }else{
- return true;
- }
- },
- gotoCheckPage(){
- //跳转到查核列表
- uni.navigateTo({
- url: `/pages/checkList/checkList?situationId=${this.situationID}`
- });
- },
- gotoImprovePage(){
- //跳转到改善列表
- uni.navigateTo({
- url: `/pages/improve-mission-list/improve-mission-list?situationId=${this.situationID}`
- });
- },
- gotoPlanPage(){
- //跳转到计划列表
- uni.navigateTo({
- url: `/pages/planList/planList?situationId=${this.situationID}&checkGroupId=${this.checkGroupId}`
- });
- },
- startUnplanned(){
- this.isUnplanned=true;
- this.isChecker=false;
- },
- startCheck(){
- this.$refs.popup.show();
- },
- createCheck(){
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'planList',
- data:{
- situationId:this.situationID
- }
- }
- }).then((data) => {
- if (data) {
- data.map((item,index)=>{
- if(this.compareTime(item.startDate)==false||this.compareTime(item.endDate)){
- this.checkItemList.push(item);
- }
- else{
- return;
- }
- });
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'createCheck',
- data:{
- checkId:this.checkItemList[0].id
- }
- }
- }).then((data) => {
- if(data){
- this.gotoCheckPage();
- }
- });
- }
- });
- }
- },
- components: {
- popup,
- }
- }
- </script>
- <style lang="less">
- .detail-page{
- position: relative;
- height: 100%;
- .copy-btn {
- border: 0;
- height: 50rpx;
- &::after {
- border: 0;
- }
- }
-
- &.isadmin {
- padding-top: 50rpx;
- }
- .content-info{
- background-color: #FFFFFF;
- .top-box{
- width: 750rpx;
- height: 300rpx;
- background: linear-gradient(270deg, #3071F2 0%, #4C95FC 100%);
- .subscript{
- width: 84.37rpx;
- height: 35rpx;
- float: right;
- margin-top: 15rpx;
- text-align: center;
- background-image: url(../../static/sDetail-subscript.png);
- .sub-text{
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Medium, SourceHanSansCN;
- font-weight: 500;
- color: #2E6CE6;
- line-height: 35rpx;
- }
- }
- .name-text{
- font-size: 40rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- float: left;
- margin-left: 50rpx;
- margin-top: 50rpx;
- margin-bottom: 31.25rpx;
- }
- .time-text{
- overflow: hidden;
- position: absolute;
- top: 165rpx;
- left: 55rpx;
- width: 70%;
- white-space: nowrap;
- font-size: 20rpx;
- font-weight: 400;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- text-overflow: ellipsis;
- color: #FFFFFF;
- }
- .nextTime-text{
- font-size: 20rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- position: absolute;
- left: 55rpx;
- top: 205rpx;
- }
- .startEndTime-text{
- font-size: 20rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- position: absolute;
- left: 55rpx;
- top: 240rpx;
- }
- .team-text{
- font-size: 20rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- position: absolute;
- top: 165rpx;
- right: 50rpx;
- }
- }
- .list-box{
- width: 687.5rpx;
- height: 137.5rpx;
- background: #FFFFFF;
- box-shadow: 0px 10px 30px 0px rgba(0, 13, 51, 0.1);
- border-radius: 16px;
- position: absolute;
- left: 31.25rpx;
- top: 280rpx;
- .check-list{
- width: 225rpx;
- height: 97.5rpx;
- float: left;
- margin-top: 40rpx;
- margin-left: 81.25rpx;
- .check-pic{
- width: 38.75rpx;
- height: 41.87rpx;
- margin-top: 8.12rpx;
- }
- .list-title{
- font-size: 25rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- position: absolute;
- left: 145rpx;
- top: 40rpx;
- }
- .list-info{
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #666F80;
- position: absolute;
- left: 145rpx;
- top: 80rpx;
- }
- }
- .improve-list{
- width: 225rpx;
- height:97.5rpx;
- float: right;
- margin-top: 40rpx;
- margin-right: 81.25rpx;
- .improve-pic{
- width: 40rpx;
- height: 40rpx;
- margin-top: 8.12rpx;
- }
- .list-title{
- font-size: 25rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- position: absolute;
- top: 40rpx;
- left: 458.75rpx;
- }
- .list-info{
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #666F80;
- position: absolute;
- top: 80rpx;
- left: 458.75rpx;
- }
- }
- .plan-list{
- width: 225rpx;
- height: 97.5rpx;
- float: left;
- margin-top: 40rpx;
- margin-left: 81.25rpx;
- .check-pic{
- width: 38.75rpx;
- height: 41.87rpx;
- margin-top: 8.12rpx;
- }
- .list-title{
- font-size: 25rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- position: absolute;
- left: 145rpx;
- top: 40rpx;
- }
- .list-info{
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #666F80;
- position: absolute;
- left: 145rpx;
- top: 80rpx;
- }
- }
- }
- .info-box{
- overflow: hidden;
- padding-bottom: 20rpx;
- .text-box{
- width: 687.5rpx;
- margin-top: 116.87rpx;
- margin-left: 31.25rpx;
- .info-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- }
- }
- }
- }
- .button-box{
- display: flex;
- flex-direction: row;
- width: 750rpx;
- height: 75rpx;
- position: fixed;
- bottom: 0;
- .btn-item {
- flex: 1;
- }
- .btn-center{
- background: #3377FF;
- text-align: center;
- .center-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 75rpx;
- }
- }
- .btn-left{
- // width: 375rpx;
- // height: 75rpx;
- background: #FFFFFF;
- // float: left;
- text-align: center;
- border: 0.62rpx solid #DADEE6;
- .left-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #3377FF;
- line-height: 75rpx;
- }
- }
- .btn-right{
- // width: 375rpx;
- // height: 75rpx;
- background: #3377FF;
- // float: right;
- text-align: center;
- .right-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 75rpx;
- }
- }
- }
- }
- </style>
|