info.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <div class="commonTitle">故障详情</div>
  3. <el-scrollbar class="barHeight">
  4. <div class="textItem" v-for="(item, index) in infoTopData" :key="index">
  5. <div class="left describeText">{{ item.bond }}</div>
  6. <div class="right describeText">
  7. {{ showInfoValue(item.value) ? showInfoValue(item.value) : "-" }}
  8. </div>
  9. </div>
  10. <el-divider />
  11. <div class="textItem" v-for="(item, index) in infoBottomData" :key="index">
  12. <div class="left describeText">{{ item.bond }}</div>
  13. <div class="right describeText">
  14. {{ showInfoValue(item.value) ? showInfoValue(item.value) : "-" }}
  15. </div>
  16. </div>
  17. </el-scrollbar>
  18. </template>
  19. <script lang="ts" setup>
  20. import { getEscalationFaultById } from "@/api/repair";
  21. const ordersDataArray = inject("ordersDataArray");
  22. const selectOrderIndex = inject("selectOrderIndex");
  23. const infoData = ref({ });
  24. const showInfoValue = (value: string) => {
  25. return infoData.value[value];
  26. };
  27. const getInfoData = async (id: any) => {
  28. const { data } = await getEscalationFaultById(id);
  29. infoData.value = data;
  30. };
  31. const infoTopData = [
  32. {
  33. bond: "产品名称",
  34. value: "materialName",
  35. },
  36. {
  37. bond: "型号",
  38. value: "spec",
  39. },
  40. {
  41. bond: "产品图号",
  42. value: "faultNumber",
  43. },
  44. {
  45. bond: "产品代号",
  46. value: "materialCode",
  47. },
  48. {
  49. bond: "阶段",
  50. value: "stageDictValue",
  51. },
  52. ];
  53. const infoBottomData = [
  54. {
  55. bond: "单据编号",
  56. value: "",
  57. },
  58. {
  59. bond: "归档编号",
  60. value: "archiveNumber",
  61. },
  62. {
  63. bond: "工作令号",
  64. value: "workOrderNumber",
  65. },
  66. {
  67. bond: "批次",
  68. value: "",
  69. },
  70. {
  71. bond: "跟踪卡号",
  72. value: "",
  73. },
  74. {
  75. bond: "日期",
  76. value: "created",
  77. },
  78. {
  79. bond: "生产数量",
  80. value: "planNum",
  81. },
  82. {
  83. bond: "不合格品数量",
  84. value: "unqualifiedNum",
  85. },
  86. {
  87. bond: "不合格品分布情况及工序",
  88. value: "processes",
  89. },
  90. {
  91. bond: "不合格原因分类",
  92. value: "reason",
  93. },
  94. {
  95. bond: "责任/经办者",
  96. value: "personResponsible",
  97. },
  98. {
  99. bond: "检验员",
  100. value: "userName",
  101. },
  102. {
  103. bond: "是否首检",
  104. value: "firstInspection",
  105. },
  106. {
  107. bond: "特征和程度",
  108. value: "",
  109. },
  110. {
  111. bond: "处置措施",
  112. value: "disposalMeasures",
  113. },
  114. ];
  115. watch(selectOrderIndex, () => {
  116. getInfoData(ordersDataArray[selectOrderIndex].id);
  117. });
  118. </script>
  119. <style lang="scss" scoped>
  120. .describeText {
  121. line-height: 30px;
  122. }
  123. .barHeight {
  124. height: calc(100vh - 184px);
  125. }
  126. .textItem {
  127. width: 100%;
  128. display: flex;
  129. .left {
  130. width: 220px;
  131. display: inline-block;
  132. text-align: right;
  133. }
  134. .right {
  135. flex: 1;
  136. margin-left: $p10;
  137. color: black;
  138. }
  139. }
  140. </style>