<template>
  <div>

      <el-dialog
        title="查看产品"
        :visible.sync="dialogVisible"
        width="90%"
        :close-on-click-modal="false"
        :modal-append-to-body="false"
        :before-close="handleClose">


            <div class="el-label"><i class="el-icon-collection-tag"></i>基本信息</div>
            <div class="el-line"></div>
            <el-table class="com-table" ref="multipleTable" :data="tableData"
                        tooltip-effect="dark" size="small" border style="width: 100%" v-loading="loading"
            >

           <el-table-column prop="idx"   label="序号" align="center" width="50px"/>
 

            <el-table-column label="业务属性" align="center">
              <el-table-column  prop="busiType"    label="业务类型" align="center"/>
              <el-table-column  prop="productName" label="产品名称" align="center"/>
              <el-table-column  prop="parterName"  label="企业名称" align="center"/>
            </el-table-column>

            <el-table-column label="介绍材料" align="center">
              <el-table-column  prop="isBlack"         label="黑名单"          align="center" width="60px">
                  <template slot-scope="scope">
                      <div v-if="scope.row.isBlack==0">否</div>
                      <div v-if="scope.row.isBlack==1">是</div>
                  </template>
              </el-table-column>

              <el-table-column  prop="businessLicense" label="企业法人营业执照" align="center">
                <template slot-scope="scope">
                  <down :files="scope.row.businessLicense"></down>
                </template>
              </el-table-column>
              <el-table-column  prop="orgCode"         label="组织机构代码证"   align="center">
                <template slot-scope="scope">
                  <down :files="scope.row.orgCode"></down>
                </template>
              </el-table-column>
              <el-table-column  prop="taxReg"          label="税务登记证"       align="center">
                <template slot-scope="scope">
                  <down :files="scope.row.taxReg"></down>
                </template>                
              </el-table-column>
              <el-table-column  prop="bankAccount"     label="银行开户许可证"   align="center">
                <template slot-scope="scope">
                    <down :files="scope.row.bankAccount"></down>
                </template>                
              </el-table-column>
              <el-table-column  prop="addService"      label="增值业务许可证"   align="center">
                <template slot-scope="scope">
                    <down :files="scope.row.addService"></down>
                </template>                
              </el-table-column>
              <el-table-column  prop="productInfo"     label="产品介绍"         align="center">
                <template slot-scope="scope">
                    <down :files="scope.row.productInfo"></down>                  
                </template>               
              </el-table-column>
              <el-table-column  prop="otherInfo"       label="其他说明材料"     align="center">
                <template slot-scope="scope">
                    <down :files="scope.row.otherInfo"></down> 
                </template>                
              </el-table-column>
            </el-table-column>


          
            <el-table-column label="内部评估材料" align="center">
                <el-table-column  label="内容资源" align="center">
                      <el-table-column   label="内容品质" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.contentQuality"></down> 
                      </template>                        
                      </el-table-column>
                      <el-table-column   label="内容授权" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.contentAuth"></down> 
                      </template>
                      </el-table-column>
                      <el-table-column   label="用户认知" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.userCognition"></down>                         
                      </template>                        
                      </el-table-column>
                </el-table-column>

                <el-table-column  label="创新性" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.innovation"></down>
                      </template>
                </el-table-column>
                <el-table-column  label="用户体验" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.userExperience"></down>
                      </template>                  
                </el-table-column>
                <el-table-column  label="资费" align="center">
                      <template slot-scope="scope">
                        <down :files="scope.row.fee"></down>
                      </template>                  
                </el-table-column>
                <el-table-column  label="信息安全" align="center">
                    <template slot-scope="scope">
                        <down :files="scope.row.infoSafety"></down>
                    </template>
                </el-table-column>
              </el-table-column>



            <el-table-column label="审核信息" align="center">
              <el-table-column  prop="isPass"          label="是否通过" align="center" width="50px">
                   <template slot-scope="scope">
                      <div v-if="scope.row.isPass==0">否</div>
                      <div v-if="scope.row.isPass==1">是</div>
                  </template>
              </el-table-column>
              <el-table-column  prop="s8"              label="总平均分"  align="center" width="60px"/>
              <el-table-column  prop="publishInRule"   label="2月内上线" align="center" width="60px">
                   <template slot-scope="scope">
                      <div v-if="scope.row.publishInRule==0">否</div>
                      <div v-if="scope.row.publishInRule==1">是</div>
                  </template>
              </el-table-column>
              <el-table-column  label="上线文档"  align="center" >
                  <template slot-scope="scope">
                    <down :files="scope.row.publishFile"></down>
                </template>       
            </el-table-column>
            </el-table-column>
          </el-table>

        <span slot="footer" class="dialog-footer">
          <el-button @click="handleClose">取 消</el-button>
          <el-button type="primary" @click="handleClose">确 定</el-button>
        </span>
      </el-dialog>

  </div>
</template>

<script>
import {strToHerf} from "@/utils/tv.js"
import down from "@/components/uploadNewDown.vue";

export default {
  components:{down},
  props:{
    itemId: { required: true,type: String},
    idx:{required: true,type: String},
    dialogVisible: {required: true,type: Boolean, default() {return false;},
    }
  },
  data(){
    return{
      loading:false,
      tableData:[],
      productName:""
    }
  },
  methods:{
    filesToUrl(files){
      return strToHerf(files)
    },
    handleClose(){
       this.$emit("closeWin")
       this.tableData=[]
    },
  
    loadData(){
      this.loading = true;
      this.$http({
        url: "/market/tvImport/queryImport",
        method: "post",
        headers: {
          "Content-Type": "application/json"
        },
        data:{"itemId":this.itemId,"idx":this.idx}
      }).then((res) => {
        if(res.data.result===0){
          this.tableData = res.data.body
          this.loading = false;
        }else{
          this.$message({ showClose: true, message: '系统异常',type: 'error'});
        }
      });
    },
 
  },
  watch:{
    dialogVisible(val,oldVal){
      if(val===true){
          this.loadData()
      }
    }
  },
  mounted(){
    //this.loadData()
  }
}
</script>
<style>
.el-label{
  color: #606266;
  border-bottom:1px dotted #bfc1c5;
  padding-bottom:5px;
}
.el-line{
  margin: 0px 0px 20px 0px;
}
</style>
