testTempDetails.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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="content" v-if="item!=null">
  7. <div class="desct">
  8. 测一测模板信息
  9. </div>
  10. <el-descriptions title="" :column="3" border>
  11. <el-descriptions-item label="名称" >
  12. <span v-if="item!=null">{{item.name}}</span>
  13. </el-descriptions-item>
  14. <el-descriptions-item label="模板编号" >
  15. <span v-if="item!=null">{{item.tempCode}}</span>
  16. </el-descriptions-item>
  17. <el-descriptions-item label="状态" >
  18. <dict-tag :options="statusOptions" :value="item.status"/>
  19. </el-descriptions-item>
  20. <el-descriptions-item label="创建时间" >
  21. <span v-if="item!=null">{{item.createTime}}</span>
  22. </el-descriptions-item>
  23. <el-descriptions-item label="修改时间" >
  24. <span v-if="item!=null">{{item.updateTime}}</span>
  25. </el-descriptions-item>
  26. </el-descriptions>
  27. </div>
  28. <div class="content" v-for="mb in itemTypeJson">
  29. <div class="desct">
  30. {{mb.itemType}}
  31. </div>
  32. <el-table :data="mb.item" :cell-style="{ textAlign: 'center' }" :header-cell-style="{textAlign: 'center'}" border>
  33. <el-table-column label="名称" prop="name" width="200px">
  34. <template slot-scope="scope">
  35. {{ scope.row.name }}
  36. </template>
  37. </el-table-column>
  38. <el-table-column label="内容" prop="value" >
  39. <template slot-scope="scope">
  40. <div style="white-space: pre-wrap;">
  41. {{ scope.row.value }}
  42. </div>
  43. </template>
  44. </el-table-column>
  45. </el-table>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { listTestTemp, getTestTemp, delTestTemp, addTestTemp, updateTestTemp, exportTestTemp } from "@/api/store/testTemp";
  51. export default {
  52. name: "testTempDetails",
  53. props:["data"],
  54. data() {
  55. return {
  56. // 状态字典
  57. statusOptions: [],
  58. itemTypeJson:[],
  59. item:null,
  60. }
  61. },
  62. created() {
  63. this.getDicts("sys_company_status").then(response => {
  64. this.statusOptions = response.data;
  65. });
  66. },
  67. methods: {
  68. getDetails(orderId) {
  69. this.item=null;
  70. getTestTemp(orderId).then(response => {
  71. this.item = response.data;
  72. this.itemTypeJson= JSON.parse(this.item.itemTypeJson)
  73. });
  74. },
  75. }
  76. }
  77. </script>
  78. <style>
  79. .el-descriptions-item__content {
  80. max-width: 150px;
  81. min-width: 100px;
  82. }
  83. .content{
  84. height: 100%;
  85. background-color: #fff;
  86. padding: 0px 20px 20px;
  87. margin: 20px;
  88. }
  89. .el-descriptions-item__label.is-bordered-label{
  90. font-weight: normal;
  91. }
  92. .desct{
  93. padding-top: 20px;
  94. padding-bottom: 20px;
  95. color: #524b4a;
  96. font-weight: bold;
  97. }
  98. </style>