<template>

  <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
    <div style="padding: 20px; background-color: #fff;">
      测一测模板项目详情
    </div>

<div class="content" v-if="item!=null">
    <div class="desct">
      测一测模板项目信息
    </div>
    <el-descriptions title="" :column="3" border>
    <el-descriptions-item label="标题" >
        <span v-if="item!=null">{{item.title}}</span>
    </el-descriptions-item>
    <el-descriptions-item label="模板名称" >
        <span v-if="item!=null">{{name}}</span>
    </el-descriptions-item>
    <el-descriptions-item label="项目类型" >
         <dict-tag :options="itemTypeOptions" :value="item.tempId"/>
    </el-descriptions-item>
    <el-descriptions-item label="排序" >
        <span v-if="item!=null">{{item.sort}}</span>
    </el-descriptions-item>
    <el-descriptions-item label="创建时间" >
        <span v-if="item!=null">{{item.createTime}}</span>
    </el-descriptions-item>
    <el-descriptions-item label="修改时间" >
        <span v-if="item!=null">{{item.updateTime}}</span>
    </el-descriptions-item>
        </el-descriptions>
            </div>
            <div class="content" v-if="item!=null">
<div class="desct">
  详情
</div>

  <el-table :data="scoreJson" :cell-style="{ textAlign: 'center' }" :header-cell-style="{textAlign: 'center'}" border>
    <el-table-column label="标题" prop="name" >
      <template slot-scope="scope">
        {{ scope.row.name }}
      </template>
    </el-table-column>
    <el-table-column label="分值" prop="score" >
      <template slot-scope="scope">
        {{ scope.row.score }}
      </template>
    </el-table-column>
  </el-table>


      </div>

      </div>
</template>

<script>
import { listTestTempItem, getTestTempItem, delTestTempItem, addTestTempItem, updateTestTempItem, exportTestTempItem } from "@/api/hisStore/testTempItem";
import { getAllTestTemp } from "@/api/hisStore/testTemp";
  export default {
    name: "patientdetails",
    props:["data"],
    data() {
      return {
       // 状态字典
       itemTypeOptions: [],
        item:null,
        scoreJson:[],
        TempList:[],
        name:null,
      }
    },
    created() {
     this.getDicts("test_temp_item_type").then(response => {
       this.itemTypeOptions = response.data;
     });

    },
    methods: {

      getDetails(orderId,name) {
          this.name=name;
          this.item=null;
          getTestTempItem(orderId).then(response => {
              this.item = response.data;
              this.scoreJson=JSON.parse(response.data.scoreJson);
          });
      },

    }
  }
</script>
<style>
  .el-descriptions-item__content {
    max-width: 150px;
    min-width: 100px;
  }
  .content{
      height: 100%;
      background-color: #fff;
     padding: 0px 20px 20px;

      margin: 20px;
  }
  .el-descriptions-item__label.is-bordered-label{
    font-weight: normal;
  }
  .desct{
      padding-top: 20px;
      padding-bottom: 20px;
      color: #524b4a;
      font-weight: bold;
    }
</style>


