|  |  | 
 |  |  |         </view> | 
 |  |  |       </template> | 
 |  |  |     </z-paging> | 
 |  |  |     <Scan ref="scanRef" /> | 
 |  |  |     <wd-toast /> | 
 |  |  |   </view> | 
 |  |  |   <Scan ref="scanRef" /> | 
 |  |  | </template> | 
 |  |  |  | 
 |  |  | <script setup lang="ts"> | 
 |  |  | import CardTitle from "@/components/card-title/index.vue"; | 
 |  |  | import MonofilCard from "../components/MonofilCard.vue"; | 
 |  |  | import { useToast } from "wot-design-uni"; | 
 |  |  | import { onLoad, onUnload, onShow, onHide } from "@dcloudio/uni-app"; | 
 |  |  | import Scan from "@/components/scan/index.vue"; | 
 |  |  | import ManageApi from "@/api/product/manage"; | 
 |  |  | 
 |  |  | const pagingRef = ref(); | 
 |  |  | const scanRef = ref(); | 
 |  |  | const cardList = ref<any[]>([]); | 
 |  |  | const toast = useToast(); | 
 |  |  |  | 
 |  |  | const getScanCode = async (code: any) => { | 
 |  |  |   console.log("自定义扫描的结果回调函数:", code); | 
 |  |  | 
 |  |  |   const { data } = await TwistApi.getScarn({ | 
 |  |  |     outPutId: codeArr[1], | 
 |  |  |   }); | 
 |  |  |   pagingRef.value.complete([data]); | 
 |  |  |   const exists = cardList.value.some((item) => item.id === data.id); | 
 |  |  |   if (!exists) { | 
 |  |  |     cardList.value.push(data); | 
 |  |  |     pagingRef.value.complete(cardList.value); | 
 |  |  |   } else { | 
 |  |  |     toast.error("该单丝已领用,请勿重复扫码"); | 
 |  |  |   } | 
 |  |  | }; | 
 |  |  |  | 
 |  |  | const openScan = () => { |