shebeijilu.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <div class="stepsViewScroll">
  3. <div class="recordBox" v-for="(item, index) in equitListData" :key="index">
  4. <div class="headerText titleText">{{ item.equitType }}</div>
  5. <div class="describeBox">
  6. <div class="describeText">精度要求</div>
  7. <div class="describeText" style="color: black">
  8. {{ item.accuracy }}
  9. </div>
  10. </div>
  11. <!-- 变量控制样式 -->
  12. <div class="footerBtn">
  13. <el-button
  14. v-if="!item.equitCode"
  15. class="bottomBtn"
  16. style="background-color: #0a59f7"
  17. @click="openScanCode(index)"
  18. >点击扫描设备</el-button
  19. >
  20. <div v-else class="infoBox">
  21. <div class="info">
  22. <div>
  23. <div class="describeText" style="text-align: left">
  24. {{ item.equitName }}
  25. </div>
  26. <div class="describeText" style="text-align: left">
  27. {{ item.equitCode }}
  28. </div>
  29. </div>
  30. </div>
  31. <div class="info">
  32. <div></div>
  33. <div>
  34. <div class="describeText" style="text-align: right">
  35. 检定有效期
  36. </div>
  37. <div class="describeText" style="text-align: right">
  38. {{ item.validDate }}
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <PopScanCode
  46. v-model:inputValue="inputValueVal"
  47. v-model:showStatus="showStatusVal"
  48. @submit="scanCode"
  49. title="请扫描设备"
  50. />
  51. </div>
  52. </template>
  53. <script lang="ts" setup>
  54. import { equitList, equitUpdate, queryByCode } from "@/api/prosteps/shebeijilu";
  55. import { useProcessStore } from "@/store";
  56. defineOptions({ name: "Shebeijilu" });
  57. const store = useProcessStore();
  58. const equitListData = ref([]);
  59. const selectIndex = ref(null);
  60. const getEquitList = async () => {
  61. const { data } = await equitList({
  62. seqNo: store.scanInfo.seqNo,
  63. operationId: store.odersData.operationId,
  64. processId: store.scanInfo.id,
  65. pageSize: 9999,
  66. pageNo: 1,
  67. });
  68. equitListData.value = data;
  69. };
  70. const inputValueVal = ref("");
  71. const showStatusVal = ref(false);
  72. const equitCheck = async () => {
  73. await equitUpdate({});
  74. };
  75. const openScanCode = (index) => {
  76. showStatusVal.value = true;
  77. selectIndex.value = index;
  78. };
  79. const scanCode = async () => {
  80. const { data, code } = await queryByCode({
  81. deviceNo: inputValueVal.value,
  82. recordId: equitListData.value[selectIndex.value].id,
  83. });
  84. if (code == "200") {
  85. ElMessage.success("绑定成功!");
  86. equitListData.value[selectIndex.value] = data;
  87. inputValueVal.value = "";
  88. showStatusVal.value = false;
  89. }
  90. };
  91. onMounted(() => {
  92. getEquitList();
  93. });
  94. </script>
  95. <style lang="scss" scoped>
  96. .recordBox {
  97. min-width: 600px;
  98. height: 210px;
  99. background-color: white;
  100. border-radius: 16px;
  101. display: flex;
  102. padding: $p20;
  103. flex-direction: column;
  104. justify-content: space-between;
  105. .headerText {
  106. }
  107. .describeBox {
  108. }
  109. //按钮样式
  110. .footerBtn {
  111. width: 100%;
  112. height: 70px;
  113. background-color: #00000015;
  114. border-radius: 16px;
  115. overflow: hidden;
  116. .bottomBtn {
  117. width: 100%;
  118. height: 100%;
  119. font-size: $f24;
  120. color: white;
  121. }
  122. .footerInfo {
  123. width: 100%;
  124. height: 70px;
  125. background-color: #00000015;
  126. border-radius: 16px;
  127. overflow: hidden;
  128. }
  129. .infoBox {
  130. display: flex !important;
  131. align-items: center;
  132. justify-content: space-between;
  133. width: 100%;
  134. height: 100%;
  135. padding: $p20 $p10;
  136. .info {
  137. width: 50%;
  138. padding: 0 20px;
  139. display: flex;
  140. align-items: center;
  141. justify-content: space-between;
  142. }
  143. }
  144. }
  145. //描述样式
  146. }
  147. </style>