index.vue 4.5 KB

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