<template>
  <modal v-model="modal" :footer-hide="true" width="700px">
    <!--  表单主要内容  -->
    <div class="content">
      <div class="title">
        付款申请
      </div>
      <div class="sub-title border">
        <span>基本信息</span>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">申请部门：</div>
          <div class="value">采购部</div>
        </div>
        <div class="col">
          <div class="label">申请人：</div>
          <div class="value">张三</div>
        </div>
        <div class="col">
          <div class="label">申请日期：</div>
          <div class="value">{{ $dayjs().format('YYYY-MM-DD') }}</div>
        </div>
      </div>
      <div class="sub-title border">
        <span>合同信息</span>
        <a class="go" href="#">查看合同条款</a>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">交货日期：</div>
          <div class="value"></div>
        </div>
        <div class="col">
          <div class="label">签约日期：</div>
          <div class="value"></div>
        </div>
        <div class="col"></div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">物料编码：</div>
          <div class="value"></div>
        </div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">物料名称：</div>
          <div class="value"></div>
        </div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">物料规格：</div>
          <div class="value"></div>
        </div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">供应商名称：</div>
          <div class="value"></div>
        </div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">采购数量：</div>
          <div class="value"></div>
        </div>
        <div class="col">
          <div class="label">采购单价：</div>
          <div class="value"></div>
        </div>
        <div class="col"></div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">合同金额：</div>
          <div class="value"></div>
        </div>
        <div class="col">
          <div class="label">合同账期：</div>
          <div class="value"></div>
        </div>
        <div class="col"></div>
      </div>
      <div class="sub-title border">
        <span>付款信息</span>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">申请支付：</div>
          <div class="value"></div>
        </div>
        <div class="col">
          <div class="label">历史已付：</div>
          <div class="value"></div>
        </div>
        <div class="col"></div>
      </div>
      <div class="row">
        <div class="col">
          <div class="label">付款说明：</div>
          <div class="value"></div>
        </div>
      </div>
    </div>
    <!--  决策辅助内容  -->
    <side-bar v-model="showSider">
      <div class="content" style="padding: 16px 10px;">
        <div class="title">决策辅助</div>
        <div class="card">
          <div class="sub-title border">合同执行情况</div>
          <div class="row">
            <div class="col">
              <div class="label">
                <Icon type="ios-checkmark-circle-outline" color="#16C400" size="16"/>
                采购数量：
              </div>
              <div class="value"></div>
            </div>
            <div class="col">
              <div class="label">累计入库：</div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">
                <Icon type="ios-checkmark-circle-outline" color="#16C400" size="16"/>
                质检合格率：
              </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">
                <Icon type="ios-checkmark-circle-outline" color="#16C400" size="16"/>
                付款期限：
              </div>
              <div class="value"></div>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="sub-title border">入库记录</div>
          <div class="row">
            <div class="col">
              <div class="label">入库时间： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">入库数量： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">质检时间： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">合格率： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="line"></div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">入库时间： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">入库数量： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">质检时间： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">合格率： </div>
              <div class="value"></div>
            </div>
          </div>
        </div>
        <div class="card">
          <div class="sub-title border">退货历史</div>
          <div class="row">
            <div class="col">
              <div class="label">退货日期： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">退货数量： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">退货金额： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="line"></div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">退货日期： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">退货数量： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">退货金额： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row" style="display: flex;justify-content: center;">
            <Button type="primary" size="small">本次结算</Button>
          </div>
        </div>
        <div class="card">
          <div class="sub-title border">供应商记录</div>
          <div class="row">
            <div class="col">
              <div class="label">累计采购： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">最新单价： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">累计退货： </div>
              <div class="value"></div>
            </div>
            <div class="col">
              <div class="label">退货率： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="line"></div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">历史最低单价： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <div class="col">
              <div class="label">历史最高单价： </div>
              <div class="value"></div>
            </div>
          </div>
          <div class="row">
            <line-chart style="height: 200px;width: 100%"></line-chart>
          </div>
        </div>
      </div>
    </side-bar>
    <div class="footer">
      <Button @click="cancel" class="btn" type="primary" style="background-color: #9D9D9D;">取消</Button>
      <Button @click="cfm" class="btn" type="primary">提交</Button>
    </div>
  </modal>
</template>

<script>
import SideBar from '_c/my-modal-pay/my-modal-sidebar'
import LineChart from './line-chart'
export default {
  name: 'pay-form',
  data () {
    return {
      modal: false,
      showSider: true
    }
  },
  components: {
    SideBar,
    LineChart
  },
  props: {
    value: {
      type: Boolean,
      default: false,
      require: true
    }
  },
  watch: {
    value: {
      handler (n) {
        this.modal = n
      },
      immediate: true
    },
    modal (n) {
      this.$emit('input', n)
    }
  },
  methods: {
    cfm () {

    },
    cancel () {
      this.modal = false
    }
  }
}
</script>

<style lang="less" scoped>
.content {
  .title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
  }
  .sub-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px;
    font-size: 14px;
    font-weight: bold;
    &.border {
      border-bottom: 1px solid #000000;
    }
    .go {
      font-size: 10px;
      font-weight: normal;
      color: #0000ff;
    }
  }
  .row {
    padding: 0 20px;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .col {
      flex: 1;
      display: flex;
      align-items: center;
    }
  }
  .card {
    margin-bottom: 5px;
    background-color: #FFFFFF;
    border: 1px solid rgba(215, 215, 215, 1);
    border-radius: 5px;
    .border {
      border-bottom: 1px solid #5d6c7b;
    }
    .line {
      width: 100%;
      border-bottom: 1px solid #5d6c7b;
    }
  }
}
.footer {
  padding-top: 2vw;
  width: 100%;
  display: flex;
  justify-content: center;
  .btn {
    border: none;
    width: 9vw;
    min-width: 100px;
    height: 2vw;
    min-height: 32px;
    font-size: .8vw;
    &:first-child {
      margin-right: 30px;
    }
  }
}
</style>
