<template>
  <ui-page :title="title">
    <div class="bi-settlement-rule-adjust-taxrate__form">
      <div class="bi-settlement-rule-adjust-taxrate__item">
        <span class="bi-settlement-rule-adjust-taxrate__label">输入结算税率</span>
        <div class="bi-settlement-rule-adjust-taxrate__target">
          <span class="bi-settlement-rule-adjust-taxrate__input">
            <ui-spinner
              v-model="formData.taxRate"
              @input="handleTaxRateChange"
            ></ui-spinner>
          </span>
          <span class="bi-settlement-rule-adjust-taxrate__unit">
            %
          </span>
        </div>
      </div>
    </div>
  </ui-page>
</template>
<script>
export default {
  name: 'BiSettlementRuleAdjustTaxrate',
  inject: ['AdjustRule'],
  props: {
    title: {
      type: String
    }
  },
  data() {
    return {
      formData: {
        taxRate: null
      }
    }
  },
  created() {
    this.formData.taxRate = this.AdjustRule.getData('taxRate')
  },
  methods: {
    handleTaxRateChange(value) {
      this.AdjustRule.setData('taxRate', value)
    }
  }
}
</script>

<style lang="less">
.bi-settlement-rule-adjust-taxrate__form{
  padding: 0 24px;
}
.bi-settlement-rule-adjust-taxrate__item{
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 36px 0;
}
.bi-settlement-rule-adjust-taxrate__label{
  margin-right: 12px;
}
.bi-settlement-rule-adjust-taxrate__input,
.bi-settlement-rule-adjust-taxrate__unit,
.bi-settlement-rule-adjust-taxrate__tips{
  display: inline-block;
  vertical-align: top;
}
.bi-settlement-rule-adjust-taxrate__unit{
  line-height: 24px;
  padding: 6px 0;
  margin-left: 12px;
}
.bi-settlement-rule-adjust-taxrate__tips{
  color: #999;
  line-height: 24px;
  padding: 6px 0;
  margin-left: 12px;
}
.bi-settlement-rule-adjust-taxrate__input{
  width: 120px;
}
</style>
