<!--
 * @Author: zqm
 * @Date: 2022-03-25 17:12:43
 * @LastEditTime: 2022-03-28 17:37:21
 * @LastEditors: Please set LastEditors
 * @Description: 留抵退税弹窗
 * @FilePath: \tableDisplayBusiness\src\components\taxCredit.vue
-->
<template>
  <!-- 增值税期末留抵税额退税提示 -->
  <el-dialog title="提示" :visible.sync="ldtsShow" width="30%" center :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false">
    <p class="zzsldtsTipBox" style="text-indent:2em;">尊敬的纳税人您好，根据系统扫描，您可能符合《财政部 税务总局 海关总署关于深化增值税改革有关政策的公告》（2019年第39号）、《财政部 税务总局关于进一步加大增值税期末留抵退税政策实施力度的公告》（财政部 税务总局 2022年第14号）中规定的申请退还留抵税额的条件。请您及时、准确地判定是否符合上述政策规定的申请退还留抵税额的条件。如符合，您可以通过电子税务局或前往办税服务厅申请退还留抵税额。</p>
    <div class="zzsldtsBtn">
      <el-button type="primary" @click="zzsldts('1')">符合条件，立即申请留抵退税</el-button>
    </div>
    <div class="zzsldtsBtn">
      <el-button type="primary" @click="zzsldts('2')">符合条件，暂不申请留抵退税</el-button>
    </div>
    <div class="zzsldtsBtn">
      <el-button type="primary" @click="zzsldts('3')">不符合条件，不申请留抵退税</el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  name: "taxCredit",
  data() {
    return {
      ldtsShow: false
    }
  },
  methods: {
    zzsldts(type) {
      if (type == '1') {
        this.getZzsldtsJd('1')
        this.getZzsldtsUrl()
        this.ldtsShow = false;
      } else if (type == '2') {
        this.getZzsldtsJd('2')
        this.$alert('如您后续需要申请留抵退税，仍可以继续按规定申请办理。', '提示', {
          type: 'warning',
          confirmButtonText: '确定',
          callback: action => {
            this.ldtsShow = false;
          }
        });
      } else {
        this.getZzsldtsJd('3')
        this.ldtsShow = false;
      }
    },
    // 20969 税务局记录纳税人留抵税额选择的是哪个按钮 前端开发
    getZzsldtsJd(index) {
      var _self = this
      var ldseUrl = interfacePrefix + config.saveZzsLdczlx
      var params = {
        "djxh": this.$store.state.data.openData.djxh,
        "yzpzxh": this.$store.state.data.openData.yzpzxh,
        "czlx": index
      }
      this.ajax.post(ldseUrl, params, function (data) {
        if (data.returnCode == '00') {
          console.log('saveZzsLdczlx接口请求成功')
        } else {
          console.log('saveZzsLdczlx接口请求失败')
        }
        if (index != "1") {
          _self.$parent.hcpFun();
        }
      }, "json", true);
    },
    getZzsldtsUrl() {
      var _self = this
      var params = {
        "djxh": this.$store.state.data.openData.djxh,
      }
      //   if (this.selectRowData.saveUserId == 'ssfwpt') {
      //     params.token = this.selectRowData.token;
      //     params.rylx = this.selectRowData.rylx;
      //     params.zjlx = this.selectRowData.zjlx;
      //     params.zjhm = this.selectRowData.zjhm;
      //     params.dlDjxh = this.selectRowData.dlDjxh;
      //   }
      var ldseTipsUrl = interfacePrefix + config.getZzsQmldseTs
      this.ajax.post(ldseTipsUrl, params, function (data) {
        if (data.ifSuccess == true) {
          if (data.uRL == 'undefined' && data.uRL == undefined && data.uRL == 'null' && data.uRL == null && data.uRL == '') {
            var url = data.uRL;
            window.open(url, "_blank");
          }
        } else {
          _self.$alert("访问出错，请退出后重新登录", '提示', { type: 'warning' });
        }
         _self.$parent.hcpFun();
      }, "json", true);
    },
  }
}
</script>

<style scoped>
.zzsldtsTipBox {
  text-align: justify;
  margin-bottom: 20px;
}
.zzsldtsBtn {
  padding: 5px 10px;
  text-align: center;
}
</style>
