<template>
  <div class="eibs-tab">
    <c-row>
      <c-col :span="12" style="padding-right: 20px;">
        <c-col :span="24">
					<el-form-item :label="$t('nitopn.是否报送跨境人民币2122表')" prop="rmbbop.rmb2122.rmbflg" label-width="200px">
						<c-select @change="query2122" :disabled="rmbControl" v-model="model.rmbbop.rmb2122.rmbflg" style="width: 100%" placeholder="请选择是否报送跨境人民币2122表" dbCode="vouflg">
						</c-select>
					</el-form-item>
				</c-col>
      </c-col>
    </c-row>
  </div>
</template>
<script>
    import event from '../event'

    export default {
  inject: ["root"],
  props: ["model", "codes"],
  mixins: [event],
  data() {
    return {};
  },
  computed: {
    rmbControl() {
      if(this.model.nidgrp.rec.fingua == "Y") {
        //修改新业务逻辑
        if(this.model.swiadd.ameamt > 0) {
          if(this.model.rmbbop.rmb2122.recgrp.ads.levyno != null && this.model.rmbbop.rmb2122.recgrp.ads.levyno != '') {
            return false;
          } else {
            return true;
          }
        } else if(this.model.swiadd.ameamt == 0) {
          if(this.model.rmbbop.rmb2122.recgrp.ads.levyno != null && this.model.rmbbop.rmb2122.recgrp.ads.levyno != '') {
            if(this.model.oldnidgrp.rec.hndtyp == 'OC') {
              if(this.model.rmbbop.rmb2122.benchange == '1') {
                if(this.model.swiadd.newliadat != "" && (this.model.oldnidgrp.rec.liadat == "" || this.model.oldnidgrp.rec.liadat == null)) {
                  return true;
                } else if(this.model.oldnidgrp.rec.liadat != "" && this.model.swiadd.newliadat != "" && this.model.swiadd.newliadat < this.model.oldnidgrp.rec.liadat){
                  return true;
                } else {
                  return false;
                }
              } else {
                if(this.model.oldnidgrp.rec.liadat != "" && this.model.swiadd.newliaflg == "X") {
                  return false;
                } else if(this.model.oldnidgrp.rec.liadat != "" && this.model.swiadd.newliadat != "" && this.model.swiadd.newliadat > this.model.oldnidgrp.rec.liadat){
                  return false;
                } else {
                  return true;
                }
              }
            } else {
              if(this.model.rmbbop.rmb2122.benchange == '1') {
                if(this.model.swiadd.newexpdat != "" && (this.model.oldnidgrp.rec.expdat == "" || this.model.oldnidgrp.rec.expdat == null)) {
                  return true;
                } else if(this.model.oldnidgrp.rec.expdat != "" && this.model.swiadd.newexpdat != "" && this.model.swiadd.newexpdat < this.model.oldnidgrp.rec.expdat){
                  return true;
                } else {
                  return false;
                }
              } else {
                if(this.model.oldnidgrp.rec.expdat != "" && this.model.swiadd.newexpflg == "X") {
                  return false;
                } else if(this.model.oldnidgrp.rec.expdat != "" && this.model.swiadd.newexpdat != "" && this.model.swiadd.newexpdat > this.model.oldnidgrp.rec.expdat){
                  return false;
                } else {
                  return true;
                }
              }
            }
          }
        } else {
          return true;
        }
      }
      return true;
    },
  },
  methods: {},
  created: function () {},
};
</script>
<style>
</style>