<template>
  <el-dialog
    class="dialog-wrap"
    title="确认出库"
    width="80%"
    :visible.sync="visible"
    :before-close="handleClose">
    <el-form
      class="info-wrap"
      label-width="100px"
      :inline="true">
      <el-form-item label="销售">
        {{ confirmData.salesperson }}
      </el-form-item>
      <el-form-item label="会员类型">
        {{ memberType }}
      </el-form-item>
      <el-form-item label="总价">
        {{ confirmData.total_money }}
      </el-form-item>
      <el-form-item label="折扣">
        {{ confirmData.discount }}
      </el-form-item>
      <el-form-item label="支付方式">
        {{ confirmData.payChannel }}
      </el-form-item>
      <el-form-item label="渠道">
        {{ confirmData.channel }}
      </el-form-item>

      <el-form-item
        label="会员卡号"
        style="width:100%">
        <el-tag
          v-for="(i,index) in confirmData.iccardList"
          :key="index">
          {{ i }}
        </el-tag>
      </el-form-item>

      <el-form-item
        label="线上会员票号"
        v-if="confirmData.channel==='线上'"
        style="width:100%">
        <el-tag
          v-for="(i,index) in confirmData.ticketNoList"
          :key="index">
          {{ i }}
        </el-tag>
      </el-form-item>

      <el-form-item label="备注">
        {{ confirmData.remark }}
      </el-form-item>
    </el-form>
    <div class="dialog-btn-wrap">
      <el-button @click="handleClose">
        取消
      </el-button>
      <el-button
        type="primary"
        @click="handleSubmit"
      >
        确认出库
      </el-button>
    </div>
  </el-dialog>
</template>

<script>
export default {
  props: {
    memberType: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      confirmData: {},
      visible: false
    }
  },
  methods: {
    show (data) {
      this.visible = true
      this.confirmData = data
    },
    handleClose () {
      this.visible = false
    },
    handleSubmit () {
      this.handleClose()
      this.$emit('submit')
    }
  }
}
</script>

<style lang="scss" scoped>
.dialog-wrap {
  ::v-deep .el-form-item {
    display: inline-block; width: 30%;
  }
  ::v-deep .el-form-item__content{
      color:red;font-weight: bold; font-size: 1.2em;
  }
}
.info-wrap {
  padding: 20px;
}

</style>
