<template>
 <div id="unit" class="span">
   <validator name='v'>
     <form novalidate class="auto form-horizontal select-overspread">
       <div class="form-group">
         <label for="f_hybridprice1"  class=" col-sm-2 control-label">混合气价1</label>
         <div class="col-sm-3">
           <v-select
                     v-model="mixmodel[0].f_mixprice"
                     placeholder="请选择"
                     :value.sync="mixmodel[0].f_mixprice"
                     :options='pricenames'
                     close-on-select>
           </v-select>
         </div>
         <label for="f_hybridprice2"  class=" col-sm-2 control-label">混合气价2</label>
         <div class="col-sm-3">
           <v-select
                     v-model="mixmodel[1].f_mixprice"
                     placeholder='请选择'
                     :value.sync="mixmodel[1].f_mixprice"
                     :options='pricenames'
                     close-on-select>
           </v-select>
         </div>
       </div>
     </form>
   </validator>
 </div>
</template>
<script>
/**
*阶梯气价管理组件
*/
export default {
  data () {
    return {
    }
  },
  props: ['mixmodel'],
  computed: {
    pricenames () {
      let arr = []
      if (this.$login.f.parent.orgtype === '总公司') {
        this.$GetSaleParam.getOnlyPrice().forEach((item) => {
          let temp = {}
          temp.label = item.label
          temp.value = item.value.f_price_id
          arr.push(temp)
        })
      } else {
        this.$GetSaleParam.getOnlyPrice().forEach((item) => {
          console.log('看看气价的分公司..', item.value, this.$login.f.f_filiale)
          if (item.value) {
            if (this.$login.f.f_fengongsi === item.value.f_filiale) {
              let temp = {}
              temp.label = item.label
              temp.value = item.value.f_price_id
              arr.push(temp)
            }
          }
        })
      }
      return [...arr]
    }
  }
}
</script>
<style>
</style>
