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