<template>
  <el-container :direction="vertical">
    <el-header height="" class="pdt">
      <h4>销售政策信息</h4>
      <el-divider></el-divider>
      <el-form
        :model="ruleForm"
        :rules="rules"
        ref="ruleForm"
        label-width="120px"
        size="small"
        label-position="left"
        class="demo-ruleForm"
      >
        <el-row type="flex">
          <el-col :span="8">
            <el-form-item label="营销活动" prop="name">
              <el-input v-model="ruleForm.name" placeholder="如未填写，则系统自动生成"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="营销活动标题" prop="name">
              <el-input v-model="ruleForm.name" placeholder="销售政策说明"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="部门" prop="name">
              <el-input v-model="ruleForm.name" placeholder="家用空调"></el-input>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="表头备注" prop="name">
            <el-input v-model="ruleForm.name" placeholder="新风机变频挂机。按提货数量1:3开单"></el-input>
          </el-form-item>
        </el-row>
        <el-row>
          <el-form-item label="政策封面图">
            <el-upload
              class="avatar-uploader"
              action="https://jsonplaceholder.typicode.com/posts/"
              :show-file-list="false"
              :on-success="handleAvatarSuccess"
              :before-upload="beforeAvatarUpload"
            >
              <img v-if="imageUrl" :src="imageUrl" class="avatar" />
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
          </el-form-item>
        </el-row>

        <el-row type="flex">
          <el-col :span="9">
            <el-form-item label="制单人" prop="name">
              <el-input v-model="ruleForm.name" placeholder=""></el-input> </el-form-item
          ></el-col>
          <el-col :span="9">
            <el-form-item label="制单日期" prop="name">
              <el-input v-model="ruleForm.name" placeholder="如未填写，则系统自动生成"></el-input> </el-form-item
          ></el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="9">
            <el-form-item label="生效日期" prop="name">
              <el-input v-model="ruleForm.name" placeholder=""></el-input> </el-form-item
          ></el-col>
          <el-col :span="9">
            <el-form-item label="失效日期" prop="name">
              <el-input v-model="ruleForm.name" placeholder=""></el-input> </el-form-item
          ></el-col>
        </el-row>
      </el-form>
    </el-header>
    <el-main>
      <el-row>
        <el-divider></el-divider>
        <el-row type="flex" align="middle">
          <el-col :span="2">
            <h4>货品信息</h4>
          </el-col>
        </el-row>
        <el-divider></el-divider>
      </el-row>

      <Transfer>
        <template #header>
          <el-row :gutter="20">
            <el-col :span="8" :offset="0">
              <el-input v-model="input" placeholder="" size="normal" clearable @change=""></el-input>
            </el-col>
            <el-col :span="8" :offset="0">
              <el-input v-model="input" placeholder="" size="normal" clearable @change=""></el-input>
            </el-col>
            <el-col :span="8">
              <el-button type="primary" size="default" @click="">确定</el-button>
              <el-button type="primary" size="default" @click="">重置</el-button>
            </el-col>
          </el-row>
        </template>
        <template #footer>
          <el-row>
            <el-button type="primary" size="default" @click="">保存</el-button>

            <el-button type="primary" size="default" @click="">重置</el-button>
          </el-row>
        </template>
      </Transfer>
    </el-main>

    <el-footer height="" class="footer"> </el-footer>
  </el-container>
</template>

<script>
import Pagination from './Pagination'
import Transfer from './Transfer'
export default {
  data() {
    return {
      input: '',

      ruleForm: {
        name: ''
      },
      listLoading: false,
      rules: {
        name: [
          { required: true, message: '', trigger: 'click' },
          { min: 3, max: 5, message: '', trigger: 'click' }
        ]
      },

      dataList: [
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        },
        {
          num: '2',
          name: '王小虎',
          province: '上海',
          city: '普陀区',
          address: '上海市普陀区金沙江路 1518 弄',
          zip: 200333
        }
      ],
      radio: ''
    }
  },

  methods: {
    handelLeftCheck(e) {
      console.log(e)
    }
  },
  components: {
    Transfer,
    Pagination
  }
}
</script>

<style lang="scss" scoped>
h4 {
  margin: 0;
}
.pdt {
  padding-top: 20px;
}

.radio {
  padding: 20px 0;
}
.el-divider--horizontal {
  margin: 20px 0;
}
.el-container .el-divider--horizontal {
  margin: 10px;
}

.el-select {
  width: 100%;
}

.footer {
  margin-bottom: 20px;
}
</style>
