scanCode.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <template>
  2. <div class="midPopUp" @click="handleClose" v-if="modelValue">
  3. <div class="container" @click.stop>
  4. <div class="headerTittle">{{ title }}</div>
  5. <div class="describeText">请扫料箱编码</div>
  6. <ScanCodeInput v-model="scanCode" @keyup.enter="handleSubmit" />
  7. <div class="bottomBtn">
  8. <el-button class="leftBtn" @click="handleClose">关闭</el-button>
  9. <el-button class="rightBtn" @click="handleSubmit" type="primary">确定</el-button>
  10. </div>
  11. <BindingScan v-model="showBinding" :operationId="operationId" :workOrderCode="workOrderCode" @close="handleClose" />
  12. </div>
  13. </div>
  14. </template>
  15. <script lang="ts" setup>
  16. import ScanCodeInput from "@/components/ScanCodeInput/index.vue";
  17. import BindingScan from "./bindingScan.vue";
  18. import { getBoxDetail } from "@/api/prepare";
  19. const props = defineProps({
  20. modelValue: {
  21. type: Boolean,
  22. default: false,
  23. },
  24. title: {
  25. type: String,
  26. },
  27. workOrderCode: {
  28. type: String,
  29. },
  30. operationId: {
  31. type: String,
  32. },
  33. });
  34. const boxInfoData = ref({});
  35. provide("boxInfoData", boxInfoData);
  36. const scanCode = ref("");
  37. const showBinding = ref(false);
  38. const emits = defineEmits(["update:modelValue", "scancodefnc", "gettable"]);
  39. const handleClose = () => {
  40. scanCode.value = "";
  41. emits("update:modelValue", false);
  42. emits("gettable");
  43. };
  44. const handleSubmit = () => {
  45. getBoxInfo();
  46. };
  47. const getBoxInfo = async () => {
  48. const { data } = await getBoxDetail({
  49. workOrderCode: props.workOrderCode,
  50. operationId: props.operationId,
  51. vehicleCode: scanCode.value,
  52. });
  53. if (data.isEnable == 1) {
  54. boxInfoData.value = data;
  55. showBinding.value = true;
  56. } else {
  57. ElMessage.warning("该物料箱包含其他物料!");
  58. return;
  59. }
  60. };
  61. </script>
  62. <style lang="scss" scoped>
  63. .midPopUp {
  64. z-index: 4;
  65. }
  66. .container {
  67. background-color: #f1f3f5;
  68. display: flex;
  69. flex-direction: column;
  70. justify-content: space-between;
  71. height: 300px;
  72. padding: 20px 40px;
  73. }
  74. .infoBox {
  75. width: 100%;
  76. height: 80px;
  77. background-color: white;
  78. border-radius: 16px;
  79. margin-bottom: $p10;
  80. }
  81. .bottomBtn {
  82. width: 100%;
  83. height: 70px;
  84. display: flex;
  85. align-items: center;
  86. justify-content: space-between;
  87. padding: $p10 10% 0 10%;
  88. .leftBtn {
  89. height: 55px;
  90. width: 45%;
  91. border-radius: 16px;
  92. font-size: $f20;
  93. color: black;
  94. background-color: #00000015;
  95. border: 0px;
  96. }
  97. .rightBtn {
  98. height: 55px;
  99. width: 45%;
  100. border-radius: 16px;
  101. font-size: $f20;
  102. color: white;
  103. }
  104. }
  105. </style>