<template>
  <div class="other">
      <el-form label-width="120px"  ref="form" :model="form">
         <div class="divider">
           <div class="title">
             <div class="ele-bg-primary"></div>
             <span>采购</span>
           </div>
           <div class="ele-bg-primary ele-width"></div>
         </div>
         <el-row :gutter="24">
           <el-col :span="8">
             <el-form-item label="采购单位">
                <el-input  v-model="form.procureUnit"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="计价单位">
                <el-input  v-model="form.priceUnit"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="采购组织" prop="procureGroup">
               <deptSelect v-model="form.procureGroup" @changeGroup="searchDeptNodeClick"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="采购员" prop="purchaserId">
               <personSelect
                 ref="directorRef"
                 v-model="form.purchaserId"
                 @selfChange="handleDirectorChange"
                 :init="false"
               />
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="默认供应商" prop="supplier">
                <el-input  v-model="form.supplier"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="允许退料" prop="isReturn">
               <el-radio v-model="form.isReturn" label="1">是</el-radio>
               <el-radio v-model="form.isReturn" label="0">否</el-radio>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="是否请购" prop="isApplay" >
                <el-radio v-model="form.isApplay" label="1">是</el-radio>
                <el-radio v-model="form.isApplay" label="0">否</el-radio>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="货源控制" prop="isControl">
                <el-radio v-model="form.isControl" label="1">是</el-radio>
                <el-radio v-model="form.isControl" label="0">否</el-radio>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="收货上限比例" prop="upperLimit">
                <el-input v-model="form.upperLimit">
                    <template slot="append">%</template>
                </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="收货提前天数" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="收货延迟天数" prop="delayDays">
                <el-input  v-model="form.delayDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="收货下限比例" prop="lowerLimit">
                <el-input v-model="form.lowerLimit">
                    <template slot="append">%</template>
                </el-input>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="默认条码规则" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="最小包装数" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="重复打印数" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="委外单位" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
           <el-col :span="8">
             <el-form-item label="委外计价单位" prop="earlyDays">
                <el-input  v-model="form.earlyDays"/>
             </el-form-item>
           </el-col>
         </el-row>
      </el-form>
  </div>
</template>

<script>
  import deptSelect from '@/components/CommomSelect/dept-select.vue'
  import personSelect from '@/components/CommomSelect/person-select.vue';
  export default {
    props: {
      form: {
        type: Object,
        default: {}
      }
    },
    components: { deptSelect , personSelect },
    data() {
      return {


      };
    },

    methods: {
      // 选择所属部门
      searchDeptNodeClick (id, info) {
        // 根据部门获取人员
        const params = { executeGroupId: id };
        this.$nextTick(() => {
          this.$refs.directorRef.getList(params);
        });
      },
      //选择负责人
      handleDirectorChange (id, info) {
      },


    }
  };
</script>

<style lang="scss" scoped>
  .other{
    background: #fff;
    padding: 1px 17px;
  }
  .divider {
    margin: 0px 0 20px;
    .title {
      display: flex;
      align-items: center;
      margin-bottom: 10px;
      div {
        width: 8px;
        height: 20px;
        margin-right: 10px;
      }
      span {
        font-size: 20px;
      }
    }
    .ele-width{
      width: 100%;
      height: 2px;
    }
  }
  .form-line{
    display: flex;
    align-items: center;
    justify-content: space-between;
    .line-select{
      margin-left:15px;
    }
  }
</style>
