<template>
    <div class="inline-16">
        <el-button size="small" type="text" @click="onShow">详 情</el-button>
        <el-dialog
        title="商品组详情"
        :visible.sync="drawer"
        width="650px"

    >
      <div>
        <el-row :gutter="50">
          <el-form  ref="form"  size="mini" label-position="left" label-width="80px" disabled> 
            <el-col :span="15">
              <el-form-item   label="商品组名:">
                <p v-if="form.groupname">{{form.groupname}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="商品组号:">
                <p v-if="form.groupnum">{{form.groupnum}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="品牌名称:">
                <p v-if="form.brandname">{{form.brandname}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="15">
              <el-form-item   label="是否上架:">
                <p v-if="form.isonsale">上架</p>
                <p v-else>下架</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="产品名:">
                <p v-if="form.itemname">{{form.itemname}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="产品类别:">
                <p v-if="form.itemclassname">{{form.itemclassname}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="20">
              <el-form-item   label="标签:">
                <div v-if="tag">
                  <div v-for="(item,index) in form.tag1" :key="index" style="float:left;margin-left: 2%;margin-top: 2%;" >
                    <el-tag  size="small">{{form.tag1[index]}}</el-tag>
                  </div>
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="创建人员:">
                <p v-if="form.createby">{{form.createby}}</p>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item   label="更新人员:">
                <p v-if="form.changeby">{{form.changeby}}</p>
              </el-form-item>
            </el-col>
          </el-form>
        </el-row>
      </div>
    </el-dialog>
    </div>
  </template>
  
  <script>
  export default {
    name: "detail",
    props:["data"],
    data(){
        return {
            drawer:false,
            isonsale:"",
            tag:"",
            form:[]
        }
    },
    methods: {
        onShow(){
            this.drawer = true
            console.log(this.data)
            this.form = this.data
            if(this.form.tag1.length > 0){
              this.tag = true
            }else {
              this.tag = false
            }
            
            if(this.form.isonsale === 0){
              this.isonsale = false
            }else{
              this.isonsale = true
            }
        }
    },
    mounted(){
    }
  }
  
  </script>
  <style>
  </style>