<template>
  <ui-page :title="title">
    <div class="bi-settlement-rule-adjust-hurry__form">
      <div class="bi-settlement-rule-adjust-hurry__item">
        <ui-radio-group v-model="formData.item_rule_flag">
          <ui-radio label="0">不跟随项目规则</ui-radio>
          <ui-radio label="1">跟随项目规则</ui-radio>
        </ui-radio-group>
      </div>
      <div class="bi-settlement-rule-adjust-hurry__item">
        <span class="bi-settlement-rule-adjust-hurry__label">输入空跑补助</span>
        <div class="bi-settlement-rule-adjust-hurry__target">
          <span class="bi-settlement-rule-adjust-hurry__input">
            <ui-spinner
              v-model="formData.subsidy"
              :disabled="formData.item_rule_flag === '1'"
            ></ui-spinner>
          </span>
          <span class="bi-settlement-rule-adjust-hurry__unit">
            <ui-select
              v-model="formData.type"
              placeholder="单位"
              :items="unitOptions"
              :disabled="formData.item_rule_flag === '1'"
            ></ui-select>
          </span>
        </div>
      </div>
    </div>
  </ui-page>
</template>
<script>
export default {
  name: 'BiSettlementRuleAdjustHurry',
  inject: ['AdjustRule'],
  props: {
    title: {
      type: String
    }
  },
  data() {
    return {
      formData: {}
    }
  },
  computed: {
    unitOptions() {
      return [{
        text: '元',
        value: '元'
      }, {
        text: '方',
        value: '方'
      }]
    }
  },
  created() {
    this.formData = this.AdjustRule.getData('runRule')
  }
}
</script>
<style lang="less">
.bi-settlement-rule-adjust-hurry__form{
  padding: 0 24px;
}
.bi-settlement-rule-adjust-hurry__item{
  display: flex;
  flex-direction: row;
  align-items: center;
  margin: 36px 0;
}
.bi-settlement-rule-adjust-hurry__label{
  margin-right: 12px;
}
.bi-settlement-rule-adjust-hurry__input,
.bi-settlement-rule-adjust-hurry__unit,
.bi-settlement-rule-adjust-hurry__tips{
  display: inline-block;
  vertical-align: top;
}
.bi-settlement-rule-adjust-hurry__unit{
  line-height: 24px;
  margin-left: 12px;
  width: 100px;
}
.bi-settlement-rule-adjust-hurry__tips{
  color: #999;
  line-height: 24px;
  padding: 6px 0;
  margin-left: 12px;
}
.bi-settlement-rule-adjust-hurry__input{
  width: 120px;
}
</style>
