healthLifeDetails.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <div style="background-color: #f0f2f5; padding-bottom: 20px; min-height: 100%; " >
  3. <div style="padding: 20px; background-color: #fff;">
  4. 健康生活
  5. </div>
  6. <div class="contentx" v-if="item!=null">
  7. <div class="desct">
  8. 健康生活信息
  9. </div>
  10. <el-descriptions title="" :column="3" border>
  11. <el-descriptions-item label="类型" ><dict-tag :options="typeOptions" :value="item.type"/></el-descriptions-item>
  12. <el-descriptions-item label="创建时间" ><span v-if="item!=null">{{item.createTime}}</span></el-descriptions-item>
  13. </el-descriptions>
  14. </div>
  15. <div class="contentx" v-if="item!=null">
  16. <div class="desct">
  17. 表单内容
  18. </div>
  19. <el-descriptions title="" :column="1" border direction="vertical">
  20. <el-descriptions-item label="内容" >
  21. <div v-show="formJson != null&&formJson!=''" style="margin-left: 30px;">
  22. <div v-for="(history, index) in formJson" :key="index">
  23. <span >{{index+1}}.{{history.name}}</span>
  24. <div v-if="'1' == history.type || '3' == history.type">
  25. <el-row v-for="(answerItem,i) in history.question" :key="i">
  26. <el-col :span="23" :offset="1"> <el-radio disabled v-model="history.value" :label="answerItem.name"></el-radio></el-col>
  27. </el-row>
  28. </div>
  29. <div v-if="'2' == history.type">
  30. <el-row v-for="(answerItem,i) in history.question" :key="i">
  31. <el-col :span="23" :offset="1">
  32. <el-checkbox-group v-model="(history.value).split(',')">
  33. <el-checkbox :label="answerItem.name" disabled></el-checkbox>
  34. </el-checkbox-group>
  35. </el-col>
  36. </el-row>
  37. </div>
  38. </div>
  39. </div>
  40. </el-descriptions-item>
  41. </el-descriptions>
  42. </div>
  43. </div>
  44. </template>
  45. <script>
  46. import { listHealthLife, getHealthLife, delHealthLife, addHealthLife, updateHealthLife, exportHealthLife } from "@/api/his/healthLife";
  47. export default {
  48. name: "healthLife",
  49. props:["data"],
  50. data() {
  51. return {
  52. typeOptions: [],
  53. item:null,
  54. formJson:null,
  55. }
  56. },
  57. created() {
  58. this.getDicts("sys_health_life_type").then(response => {
  59. this.typeOptions = response.data;
  60. });
  61. },
  62. methods: {
  63. getDetails(id) {
  64. this.item=null;
  65. this.formJson=null;
  66. getHealthLife(id).then(response => {
  67. this.item = response.data;
  68. if(this.item.formJson!=null&&this.item.formJson!=''){
  69. this.formJson = JSON.parse(this.item.formJson)
  70. }
  71. });
  72. },
  73. }
  74. }
  75. </script>
  76. <style>
  77. .contentx{
  78. height: 100%;
  79. background-color: #fff;
  80. padding: 0px 20px 20px;
  81. margin: 20px;
  82. }
  83. .el-descriptions-item__label.is-bordered-label{
  84. font-weight: normal;
  85. }
  86. .el-descriptions-item__content {
  87. max-width: 150px;
  88. min-width: 100px;
  89. }
  90. .desct{
  91. padding-top: 20px;
  92. padding-bottom: 20px;
  93. color: #524b4a;
  94. font-weight: bold;
  95. }
  96. </style>