info.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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. console.log(id, "2222");
  29. const { data } = await getEscalationFaultById(id);
  30. infoData.value = data;
  31. };
  32. const infoTopData = [
  33. {
  34. bond: "产品名称",
  35. value: "materialName",
  36. },
  37. {
  38. bond: "型号",
  39. value: "spec",
  40. },
  41. {
  42. bond: "产品图号",
  43. value: "faultNumber",
  44. },
  45. {
  46. bond: "产品代号",
  47. value: "materialCode",
  48. },
  49. {
  50. bond: "阶段",
  51. value: "stageDictValue",
  52. },
  53. ];
  54. const infoBottomData = [
  55. {
  56. bond: "单据编号",
  57. value: "",
  58. },
  59. {
  60. bond: "归档编号",
  61. value: "archiveNumber",
  62. },
  63. {
  64. bond: "工作令号",
  65. value: "workOrderNumber",
  66. },
  67. {
  68. bond: "批次",
  69. value: "",
  70. },
  71. {
  72. bond: "跟踪卡号",
  73. value: "",
  74. },
  75. {
  76. bond: "日期",
  77. value: "created",
  78. },
  79. {
  80. bond: "生产数量",
  81. value: "planNum",
  82. },
  83. {
  84. bond: "不合格品数量",
  85. value: "unqualifiedNum",
  86. },
  87. {
  88. bond: "不合格品分布情况及工序",
  89. value: "processes",
  90. },
  91. {
  92. bond: "不合格原因分类",
  93. value: "reason",
  94. },
  95. {
  96. bond: "责任/经办者",
  97. value: "personResponsible",
  98. },
  99. {
  100. bond: "检验员",
  101. value: "userName",
  102. },
  103. {
  104. bond: "是否首检",
  105. value: "firstInspection",
  106. },
  107. {
  108. bond: "特征和程度",
  109. value: "",
  110. },
  111. {
  112. bond: "处置措施",
  113. value: "disposalMeasures",
  114. },
  115. ];
  116. watch(selectOrderIndex, () => {
  117. getInfoData(ordersDataArray.value[selectOrderIndex.value].id);
  118. });
  119. </script>
  120. <style lang="scss" scoped>
  121. .describeText {
  122. line-height: 30px;
  123. }
  124. .barHeight {
  125. height: calc(100vh - 184px);
  126. }
  127. .textItem {
  128. width: 100%;
  129. display: flex;
  130. .left {
  131. width: 220px;
  132. display: inline-block;
  133. text-align: right;
  134. }
  135. .right {
  136. flex: 1;
  137. margin-left: $p10;
  138. color: black;
  139. }
  140. }
  141. </style>