import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import commonDepend from "~/mixin/commonDepend";

export default {
  mixins: [commonFunctions,commonDepend],
  methods: {
    sndmsgChange(val) {
      if (val === '' && this.model.sndmsgFirstCancel && this.model.sndmsgPreviousValue === 'X' ) {
          this.$confirm('Are you sure, that ou don\'t want to send the message,although there are fees to the beneficiary? ', '', {
            confirmButtonText: 'OK',
            cancelButtonText: 'Cancel',
            type: 'warning',
            showClose: false
          }).then(() => {//yes的执行在这里写
            this.model.sndmsg= ''

          }).catch(() => {//No的功能在这里写
            this.model.sndmsg= 'X';
          });

          this.model.sndmsgFirstCancel = false;
      }

       if(val==='X' && !this.model.sndmsgFirstCancel && this.model.sndmsgPreviousValue===''){
        this.model.sndmsgFirstCancel = true;
        this.model.sndmsgPreviousValue = 'X';
      }else{
        this.model.sndmsgFirstCancel = false;
       }
    },

  },
};