<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="状态" >
         <dict-tag :options="tempTypeOptions" :value="item.tempType"/>
    </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="itemJson" :cell-style="{ textAlign: 'center' }" :header-cell-style="{textAlign: 'center'}">
    <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 { listInquiryTemp, getInquiryTemp, delInquiryTemp, addInquiryTemp, updateInquiryTemp, exportInquiryTemp } from "@/api/his/inquiryTemp";
  export default {
    name: "patientdetails",
    props:["data"],
    data() {
      return {
       // 状态字典
       tempTypeOptions: [],
        item:null,
        itemJson:[],
      }
    },
    created() {
   this.getDicts("sys_inquiry_temp_type").then(response => {
     this.tempTypeOptions = response.data;
   });

    },
    methods: {
      getDetails(orderId) {
          this.item=null;
          getInquiryTemp(orderId).then(response => {
              this.item = response.data;
              this.itemJson=JSON.parse(response.data.itemJson);
          });
      },

    }
  }
</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>


