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


export default {
  mixins: [commonFunctions],
  methods: {
    clsflgChange() {
      this.ifClsflg = "X";
      if (this.model.clsflg == true) {
        if (this.model.coninf.conexedat != "") {
          this.model.ncdgrp.rec.clsdat = this.model.coninf.conexedat
        }
        else {
          this.model.ncdgrp.rec.clsdat = new Date();
        }
      }
      else {
        this.model.ncdgrp.rec.clsdat = "";
      }
    },
    rejtypselChange() {
      if (this.model.rejtypsel == "I") {
        this.model.clsflg = false;
        this.model.ncdgrp.rec.clsdat = "";
      } else if (this.model.rejtypsel == "R" && this.ifClsflg == "") {
        this.model.clsflg = true;
        if (this.model.coninf.conexedat != "") {
          this.model.ncdgrp.rec.clsdat = this.model.coninf.conexedat
        }
        else {
          this.model.ncdgrp.rec.clsdat = new Date();
        }
      }
    },
  },
}