index.vue 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. <template>
  2. <div class="mainContentBox">
  3. <div class="header">
  4. <ScanCodeInput
  5. v-model="inputValueC"
  6. placeholder="请扫码或输入当前用户信息,按回车键确认"
  7. style="width: 550px"
  8. @keyup.enter="handleSubmit"
  9. />
  10. <div v-if="userInfo" class="info">
  11. 当前检验用户:{{ userInfo?.userName }}
  12. </div>
  13. </div>
  14. <div class="bottom-container">
  15. <el-tabs
  16. v-model="activeName"
  17. class="demo-tabs"
  18. type="card"
  19. @tab-click="handleClick"
  20. >
  21. <el-tab-pane
  22. v-if="store.scanInfo.firstCheck == 1"
  23. label="首检"
  24. name="first"
  25. ><el-button
  26. type="primary"
  27. @click="addOpen(1)"
  28. class="titleText"
  29. style="
  30. width: 260px;
  31. height: 50px;
  32. border-radius: 16px;
  33. margin-bottom: 20px;
  34. "
  35. >新增
  36. </el-button>
  37. <FirstCheck
  38. ref="firstRef"
  39. @edit-open="editOpen"
  40. @get-page="getPage1"
  41. />
  42. </el-tab-pane>
  43. <el-tab-pane
  44. v-if="store.scanInfo.inspection == 1"
  45. label="过程检验"
  46. name="second"
  47. ><el-button
  48. type="primary"
  49. @click="addOpen(2)"
  50. class="titleText"
  51. style="
  52. width: 260px;
  53. height: 50px;
  54. border-radius: 16px;
  55. margin-bottom: 20px;
  56. "
  57. >新增
  58. </el-button>
  59. <RollCheck ref="rollRef" @edit-open="editOpen" />
  60. </el-tab-pane>
  61. </el-tabs>
  62. </div>
  63. <Info
  64. ref="infoRef"
  65. :addStatus
  66. :checkType
  67. :checkUser="userInfo?.userName"
  68. @get-page1="getPage1"
  69. @get-page2="getPage2"
  70. />
  71. </div>
  72. </template>
  73. <script lang="ts" setup>
  74. import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
  75. import { useProcessStore } from "@/store";
  76. import { checkUserLogin } from "@/api/prosteps/dianjian";
  77. import FirstCheck from "./first-check.vue";
  78. import RollCheck from "./roll-check.vue";
  79. import Info from "./info.vue";
  80. const store = useProcessStore();
  81. const addStatus = ref(true);
  82. const inputValueC = ref("");
  83. const checkType = ref(1);
  84. const infoRef = ref(null);
  85. const rollRef = ref(null);
  86. const firstRef = ref(null);
  87. const rowData = ref({});
  88. const editOpen = (checkType: any, rowData: any) => {
  89. if (checkType == 1) {
  90. rowData.value = rowData;
  91. infoRef.value.open();
  92. } else {
  93. rowData.value = rowData;
  94. infoRef.value.open();
  95. }
  96. };
  97. const addOpen = (type) => {
  98. checkType.value = type;
  99. addStatus.value = true;
  100. infoRef.value.open();
  101. };
  102. const getPage1 = () => {
  103. firstRef.value.dataList();
  104. };
  105. const getPage2 = () => {
  106. rollRef.value.dataList();
  107. };
  108. const userInfo = ref<any>(null);
  109. const handleSubmit = async () => {
  110. let res: any = await checkUserLogin(inputValueC.value);
  111. userInfo.value = res.data;
  112. };
  113. onMounted(() => {
  114. inputValueC.value = "";
  115. console.log("mounted");
  116. });
  117. const activeName = ref("first");
  118. const handleClick = (tab: any, event: Event) => {
  119. console.log(tab, event);
  120. };
  121. </script>
  122. <style lang="scss" scoped>
  123. .header {
  124. height: 60px;
  125. display: flex;
  126. align-items: center;
  127. justify-content: start;
  128. //border: 1px solid #ccc;
  129. .info {
  130. margin-left: 20px;
  131. font-size: 16px;
  132. color: #666;
  133. font-weight: bold;
  134. }
  135. }
  136. .bottom-container {
  137. margin-top: 10px;
  138. height: calc(100% - 70px);
  139. //border: 1px solid #ccc;
  140. }
  141. :deep(.el-tabs--card > .el-tabs__header .el-tabs__nav) {
  142. background: rgba(0, 0, 0, 0.1);
  143. border-radius: 16px 16px 16px 16px;
  144. overflow: hidden;
  145. border: 0;
  146. }
  147. :deep(.el-tabs--card > .el-tabs__header) {
  148. height: 80px;
  149. border: 0;
  150. overflow: hidden;
  151. border-radius: 16px 16px 16px 16px;
  152. }
  153. :deep(.el-tabs--card > .el-tabs__header .el-tabs__item) {
  154. width: 290px;
  155. height: 80px;
  156. border-radius: 0;
  157. font-weight: 500;
  158. font-size: 24px;
  159. overflow: hidden;
  160. background: transparent;
  161. border-color: transparent;
  162. }
  163. :deep(.el-tabs--card > .el-tabs__header .el-tabs__item.is-active) {
  164. background: white;
  165. border-radius: 16px 16px 16px 16px;
  166. border-color: transparent;
  167. overflow: hidden;
  168. }
  169. </style>