import commonFunctions from '~/mixin/commonFunctions.js';
import Api from '~/service/Api';
export default {
  mixins: [commonFunctions],
  methods: {
    async tabClick (tab) {
      if (this.isInDisplay) {
        return;
      }
    },
    // 保留
    onConresRescon () {
      this.$confirm(`Do you really want to reserve ${this.model.concnt} reference(s) in sector "${this.model.sector}" for address "${this.model.pta.nam}" in role "${this.model.rol}"`, '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        let params = {
          transName: this.trnName,
          ...this.model
        };
        const loading = this.loading();
        Api.post('/business/conres/rescon', params).then(res => {
          if (res.respCode == SUCCESS) {
            this.tableData = res.data.map((item) => {
              return {
                reference: item,
                notes: ""
              }
            })
          }
        });
        this.dialogTable = true
        loading.close()
      })
    },
    //显示历史预约参考号
    showReservedData () {
      let params = {
        usr: window.sessionStorage.getItem("userName") || ""
      };
      const loading = this.loading();
      Api.post('/business/conresRule/showReservedData', params).then(res => {
        if (res.respCode == SUCCESS) {
          this.showData = res.data.map((item) => {
            return {
              reference: item,
              notes: ""
            }
          })
        }
      });
      this.dialogShow = true
      loading.close()
    },
    // 退出
    handleCancel () {
      this.$confirm("确认退出?", "提示", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning"
      }).then(() => {
        this.$store.commit('delTagsArry', this.$route.path)
        this.$router.back()
      })
    }
  }
};