<template>
  <div>
    <div style="width: 80%;background-color: #545c64;margin: 0 auto;display: flex;justify-content:space-around;">
      <el-menu
        :default-active="activeIndex2"
        class="el-menu-demo"
        mode="horizontal"
        @select="handleSelect"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b">
        <el-menu-item index="1">门到门</el-menu-item>
        <el-menu-item index="2">门到港</el-menu-item>
        <el-menu-item index="3">港到门</el-menu-item>
        <el-menu-item index="4">港到港</el-menu-item>
      </el-menu>
    </div>
    <div class="outermost">
      <div v-if="selection === '1'">
        <el-input placeholder="请输入发货地址">
          <template slot="prepend">发货地址</template>
          <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">{{whether === false?'指定港口':'取消指定港口'}}</el-button>
        </el-input>
        <el-input placeholder="请输入货物名称">
          <template slot="prepend">货物名称</template>
        </el-input>
        <el-input placeholder="请输入收货地址">
          <template slot="prepend">收货地址</template>
        </el-input>
        <el-input placeholder="请输入预计装货时间">
          <template slot="prepend">预计装货时间</template>
        </el-input>
        <el-input placeholder="请输入起运港口" v-if="whether === true">
          <template slot="prepend">起运港口</template>
        </el-input>
        <el-input placeholder="请输入目的港口" v-if="whether === true">
          <template slot="prepend">目的港口</template>
        </el-input>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
      </div>
      <div v-if="selection === '2'">
        <el-input placeholder="请输入发货地址">
          <template slot="prepend">发货地址</template>
          <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">{{whether === false?'指定港口':'取消指定港口'}}</el-button>
        </el-input>
        <el-input placeholder="请输入货物名称">
          <template slot="prepend">货物名称</template>
        </el-input>
        <el-input placeholder="请输入预计装货时间">
          <template slot="prepend">预计装货时间</template>
        </el-input>
        <el-input placeholder="请输入起运港口" v-if="whether === true">
          <template slot="prepend">起运港口</template>
        </el-input>
        <el-input placeholder="请输入目的港口" v-if="whether === true">
          <template slot="prepend">目的港口</template>
        </el-input>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
      </div>
      <div v-if="selection === '3'">
        <el-input placeholder="请输入起运港口">
          <template slot="prepend">起运港口</template>
        </el-input>
        <el-input placeholder="请输入目的港口" v-if="whether === true">
          <template slot="prepend">目的港口</template>
        </el-input>
        <el-input placeholder="请输入货物名称">
          <template slot="prepend">货物名称</template>
        </el-input>
        <el-input placeholder="请输入收货地址">
          <template slot="prepend">收货地址</template>
          <el-button slot="append" icon="el-icon-d-caret" @click="whether = !whether">{{whether === false?'指定港口':'取消指定港口'}}</el-button>
        </el-input>
        <el-input placeholder="请输入预计装货时间">
          <template slot="prepend">预计装货时间</template>
        </el-input>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
      </div>
      <div v-if="selection === '4'">
        <el-input placeholder="请输入起运港口">
          <template slot="prepend">起运港口</template>
        </el-input>
        <el-input placeholder="请输入目的港口">
          <template slot="prepend">目的港口</template>
        </el-input>
        <el-input placeholder="请输入货物名称">
          <template slot="prepend">货物名称</template>
        </el-input>
        <el-input placeholder="请输入预计装货时间">
          <template slot="prepend">预计装货时间</template>
        </el-input>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
        <button style="width: 400px;height: 0;border: none;padding: 0;"></button>
      </div>
      <div>
        <el-button type="primary">船期查询</el-button>
      </div>
      <el-divider>查询船期</el-divider>
      <div style="width: 100%;padding: 10px;display: flex;justify-content: space-around;border: 1px solid #E8E8E8;box-shadow: 0 2px 7px 0 rgb(71 71 71 / 20%);">
        <div style="width: 50%;line-height: 40px;">
          <div style="background-color: #f10724;width: 80px;margin-top: 15px;margin-right: 5px;margin-left: 5px;height: 30px;line-height: 30px;border-radius: 20px;color: #ffffff;float: left">
            丹东
          </div>
          <div style="width: 40px;height: 60px;float: left">
            <div style="width: 100%;height: 30px;">
              <img style="width: 50%;" src="./ship.png" alt="">
            </div>
            <div style="width: 100%;height: 30px;line-height: 30px;border-top: 1px solid #f33434">
              驳
            </div>
          </div>
        </div>
        <div style="width: 25%;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-left: 1px solid #E8E8E8">
          <div>
            <span style="color: #999999">全程运输时长：</span>
            <span style="font-weight:bold">9天</span>
            <br>
            <span style="color: #999999">单证有效时间：</span>
            <span style="font-weight:bold">6天</span>
          </div>
        </div>
        <div style="width: 30%;border-left: 1px solid #E8E8E8;display:flex;justify-content: space-around">
          <div>
            <div>20GP</div>
            <div style="color:#bc1920 ">
              <span>￥</span>
              <span style="font-size: 20px;">2590</span>
              <span>起</span>
            </div>
          </div>
          <div>
            <div>40HC</div>
            <div style="color:#bc1920 ">
              <span>￥</span>
              <span style="font-size: 20px;">2590</span>
              <span>起</span>
            </div>
          </div>
          <div>
            <div>40RH</div>
            <div>
              <span>-</span>
              <span>-</span>
              <span>-</span>
            </div>
          </div>
        </div>
        <div style="width: 15%;margin: 0 auto;display: flex;align-items: center;justify-content: center;border-left: 1px solid #E8E8E8">
          <el-button type="primary">查看船期</el-button>
        </div>
      </div>
      <div style="width: 98%;background-color: #99a9bf;margin: 0 auto">
        <div style="float: left;padding: 5px;color:#ffffff;">
          <span>天津</span>
          →
          <span>青岛</span>
        </div>
        <div style="border: 1px solid #EBEEF5">
          <el-table
            :data="tableData"
            style="width: 100%">
            <el-table-column
              prop="date"
              label="预计开航"
              width="180">
              <template slot-scope="scope">
                {{scope.row.date}}
              </template>
            </el-table-column>
            <el-table-column
              prop="name"
              label="预计抵港"
              width="180">
            </el-table-column>
            <el-table-column
              prop="address"
              label="重箱回场截止时间">
            </el-table-column>
            <el-table-column
              prop="address"
              label="船名航次">
            </el-table-column>
            <el-table-column
              prop="address"
              label="20GP">
            </el-table-column>
            <el-table-column
              prop="address"
              label="40HC">
            </el-table-column>
            <el-table-column
              prop="address"
              label="40RH">
            </el-table-column>
          </el-table>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'inquiryAndOrder',
  data() {
    return {
      value1: '',
      selection: '1',
      whether:false,
      activeIndex: '1',
      activeIndex2: '1',
      labelPosition: 'right',
      formLabelAlign: {
        name: '',
        region: '',
        type: ''
      },
      tableData: [{
        date: '测试数据',
        name: '测试数据',
        address: '测试数据',
      }, {
        date: '测试数据',
        name: '测试数据',
        address: '测试数据'
      }, {
        date: '测试数据',
        name: '测试数据',
        address: '测试数据',
      }, {
        date: '测试数据',
        name: '测试数据',
        address: '测试数据'
      }]
    };
  },
  methods: {
    handleSelect(key, keyPath) {
      this.whether = false
      console.log(key, keyPath);
      this.selection = key;
    },
  }
};
</script>

<style scoped lang="scss">
.outermost {
  width: 80%;
  margin: auto auto 100px auto;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
}

.outermost > div:nth-child(1) {
  width: 80%;
  display: flex;
  display: -webkit-flex;
  justify-content: space-around;
  flex-direction: row;
  flex-wrap: wrap;
}

.outermost > div:nth-child(2) {
  width: 20%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center
}
.outermost > div:nth-child(1) > .el-input {
  width: 400px;
  margin-top: 5px;
  margin-bottom: 5px;
}
</style>
