Showing
1 changed file
with
5 additions
and
5 deletions
... | ... | @@ -94,7 +94,7 @@ |
94 | 94 | </el-form> |
95 | 95 | <el-row :gutter="10" class="mb8"> |
96 | 96 | <el-col :span="1.5"> |
97 | - <el-button type="primary" plain icon="Plus" @click="handleAdd" | |
97 | + <el-button type="primary" :disabled="scanCodeDisabled" plain icon="Plus" @click="handleAdd" | |
98 | 98 | >扫码</el-button |
99 | 99 | > |
100 | 100 | </el-col> |
... | ... | @@ -317,7 +317,7 @@ |
317 | 317 | <script setup> |
318 | 318 | import { getToken } from "@/utils/auth"; |
319 | 319 | import { formatDate } from "@/utils/index"; |
320 | -import { nextTick, onMounted, onUnmounted, ref } from "vue"; | |
320 | +import { nextTick, onMounted, onUnmounted, ref,computed } from "vue"; | |
321 | 321 | import { |
322 | 322 | scanSpecQueryList, |
323 | 323 | deviceTypeQueryList, |
... | ... | @@ -330,8 +330,6 @@ import { |
330 | 330 | searchBusinessInfo, |
331 | 331 | } from "@/api/system/scan"; |
332 | 332 | import { ElLoading } from "element-plus"; |
333 | -import { da, fa } from "element-plus/es/locales.mjs"; | |
334 | - | |
335 | 333 | const router = useRouter(); |
336 | 334 | const route = useRoute(); |
337 | 335 | const { proxy } = getCurrentInstance(); |
... | ... | @@ -411,6 +409,8 @@ const deviceTypeList = ref([]); |
411 | 409 | |
412 | 410 | const searchBusinessLoading = ref(false); |
413 | 411 | |
412 | +const scanCodeDisabled = computed(() => dataList.value.length >= 1) | |
413 | + | |
414 | 414 | const getDeviceTypeList = () => { |
415 | 415 | deviceTypeQueryList( |
416 | 416 | proxy.addDateRange(queryParams.value, dateRange.value) |
... | ... | @@ -473,7 +473,7 @@ function submitForm() { |
473 | 473 | // }); |
474 | 474 | |
475 | 475 | if ( |
476 | - dataList.value.length == 0 || | |
476 | + dataList.value.length <= 1 || | |
477 | 477 | form.value.businessId === dataList.value[0].businessId |
478 | 478 | ) { |
479 | 479 | const localStoreTableData = localStorage.getItem("localStoreTableData") | ... | ... |
Please
register
or
login
to post a comment