123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224 |
- <template>
- <view class="popup-page" v-show="showModalStatus">
- <view class="popup-box" v-show="showModalStatus">
- <view class="item-box" v-for="(item,index) in planList" :key="index">
- <view class="radio-item" @click="toggleSelect(item,index)">
- <image class="icon" :src="`/static/${item.isChecked ? 'check-radio' : 'check-no'}.png`"></image>
- </view>
- <text :class="item.nameClass">{{item.name}}({{item.startDate}} ~ {{item.endDate}})</text>
- <view class="compeleted-box" v-if="item.isCompeleted">
- <text class="compeleted-text" >已完成</text>
- </view>
- <view class="continued-box" v-if="item.isContinued">
- <text class="continued-text" >进行中</text>
- </view>
- <image class="checked-pic" v-if="item.isContinued" src="../../../static/checkStatus.png"></image>
- </view>
- </view>
- <view class="btn-confirm" @click="saveChange">
- <text class="btn-text">确定</text>
- </view>
- </view>
- </template>
- <script>
- export default {
- props:{
- situationID:String,
- },
- data() {
- return {
- currentType:this.type,//当前类型
- selectedPlanID:'',//选择的计划id
- showModalStatus:false,//查核计划选择弹框
- flag:-3,//是否为进行中计划,判断下一个未开始的查核计划
- planList:[],//查核计划列表
- arrUnstarted:[],//未开始计划数组
- }
- },
- created: function() {
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'planList',
- data:{
- situationId:this.situationID
- }
- }
- }).then((data) => {
- if (data) {
- this.planList=data.map((item,index)=>{
- if(item.status==1){
- this.arrUnstarted.push(item);
- this.flag=this.arrUnstarted[0].id;
- }
- return {
- id:item.id,
- name:item.name,
- startDate:item.startDate,
- endDate:item.endDate,
- status:item.status,
- isCompeleted:item.status==3?true:false,
- isContinued:item.status==2?true:false,
- isChecked:false,
- nameClass:item.id==this.flag?'item-text':'disable-text',
- }
- });
- }
- });
- },
- methods: {
- show(){
- this.showModalStatus=true;
- },
- hide(){
- this.showModalStatus=false;
- },
- hidePopupBox(){
- this.hide();
- },
- toggleSelect(item,index) {
- this.planList.map((item,index)=>{
- item.isChecked=false;
- });
- if(item.id==this.flag){
- this.planList[index].isChecked=true;
- this.selectedPlanID=item.id;
- }
- else{
- return;
- }
-
- },
- saveChange(){
- this.$store.dispatch({
- type: 'situationDetail/commActions',
- payload: {
- key: 'planAdvance',
- data:{
- checkId:this.selectedPlanID
- }
- }
- }).then((data)=>{
- if(data){
- this.hide();
- }
- });
- },
- },
- }
- </script>
- <style lang="less">
- .popup-page{
- height: 100%;
- width: 100%;
- position: fixed;
- top: 0rpx;
- left: 0rpx;
- z-index: 10001;
- // background: rgba(0,0,0,0.5);
- background-color: #FFFFFF;
- .popup-box{
- width: 100%;
- position: fixed;
- top: 0rpx;
- left: 0rpx;
- z-index: 2000;
- background-color: #FFFFFF;
- display: flex;
- flex-direction: column;
- overflow: hidden;
- .item-box{
- width: 100%;
- height: 87.5rpx;
- border: 0.62rpx solid #DADEE6;
- .radio-item {
- float: left;
- margin-left: 25rpx;
- margin-top: 30rpx;
-
- .icon {
- width: 25rpx;
- height: 25rpx;
- }
- }
- .item-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #292C33;
- line-height: 87.5rpx;
- margin-left: 25rpx;
- float: left;
- }
- .disable-text{
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #666E80;
- line-height: 87.5rpx;
- margin-left: 25rpx;
- float: left;
- }
- .compeleted-box{
- width: 75rpx;
- height: 31.25rpx;
- border-radius: 8px;
- background: rgba(41, 204, 150, 0.1);
- text-align: center;
- float: left;
- margin-top: 28.12rpx;
- .compeleted-text{
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Medium, SourceHanSansCN;
- font-weight: 500;
- color: #29CC96;
- line-height: 31.25rpx;
- }
- }
- .continued-box{
- width: 75rpx;
- height: 31.25rpx;
- border-radius: 8px;
- background: rgba(255, 204, 102, 0.1);
- text-align: center;
- float: left;
- margin-top: 28.12rpx;
- .continued-text{
- width: 75rpx;
- height: 31.25rpx;
- font-size: 17.5rpx;
- font-family: SourceHanSansCN-Medium, SourceHanSansCN;
- font-weight: 500;
- color: #FFAA00;
- line-height: 31.25rpx;
- }
- }
- .checked-pic{
- width: 19.37rpx;
- height: 14.37rpx;
- float: right;
- margin-top: 36.87rpx;
- margin-right: 25rpx;
- }
- }
- }
- .btn-confirm {
- width: 750rpx;
- height: 75rpx;
- background: #3377FF;
- position: fixed;
- bottom: 0rpx;
- .btn-text {
- font-size: 22.5rpx;
- font-family: SourceHanSansCN-Normal, SourceHanSansCN;
- font-weight: 400;
- color: #FFFFFF;
- line-height: 75rpx;
- margin-left: 352.5rpx;
- }
- }
- }
- </style>
|