<template>
<div>
  <el-card>
    <div slot="header" class="clearfix">
      <span>渠道信息</span>
    </div>
    <el-form  label-width="100px">
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="中文名称">
            <el-input></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="英文名称">
            <el-input></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="内部名称中文">
            <el-input></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="内部名称英文">
            <el-input></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="类型编码">
            <el-input></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="简码">
            <el-input></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
           <el-form-item label="归属仓库">
             <el-checkbox-group v-model="value">
                 <el-checkbox v-for="(item ,index) in warehouseList" :key="item.id"  :label="item.id">
                   {{$l(item,'title')}}
               </el-checkbox>
             </el-checkbox-group>
           </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-row>
            <el-col>
              <el-form-item label="排序">
                <el-input></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item label="快递">
                <el-input></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col>
              <el-form-item label="预计到达时间">
                <el-input></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-col>
      </el-row>
      <el-row :gutter="20">
        <el-col :span="12">
          <el-form-item label="可出商品特性">
            <el-select multiple value>
              <el-option v-for="(item, index) in attrList" :value="item.id" :label="$l(item, 'attrName')"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
         <div style="display: flex; justify-content: space-between;">
           <h1>
             渠道包装列表
           </h1>
           <div>
             <el-button type="primary" >添加包装类型</el-button>
             <el-button type="text">选择渠道包装模板</el-button>
           </div>
         </div>
          <el-row :gutter="20">
            <el-col :span="2">包装类型1：</el-col>
            <el-col :span="5"> <dict-selector  :type="DICT_TYPE.ECW_PACKAGING_TYPE"></dict-selector></el-col>
            <el-col :span="16">
              <packaging-type></packaging-type>
            </el-col>
          </el-row>
       <el-form-item label="备注中文">
         <el-input></el-input>
       </el-form-item>
       <el-form-item label="备注英文">
         <el-input></el-input>
       </el-form-item>
      <el-form-item>
        <el-button type="primary">提交</el-button>
        <el-button>取消</el-button>
      </el-form-item>
    </el-form>
  </el-card>
</div>
</template>

<script>
import PackagingType from "@/views/ecw/channel/componrnts/packaging-type.vue";
import {getProductAttrList} from "@/api/ecw/productAttr";
import {getWarehouseList} from "@/api/ecw/warehouse";
import {DICT_TYPE} from "@/utils/dict";

export default {
  name: "edit",
  computed: {
    DICT_TYPE() {
      return DICT_TYPE
    }
  },
  components: {PackagingType},
  data(){
    return{
      attrList:[],
      warehouseList:[],
      value:[]
    }
  },
  created() {
    getProductAttrList().then(response => {
      this.attrList = response.data;
    })
    getWarehouseList({tradeType:2}).then(r =>{
      console.log('r',r.data)
      this.warehouseList = r.data
    })
  }
}
</script>

<style scoped>

</style>
