chenhj
2025-07-29 3974ccbd9b2a0c13af91d472c8acd90e88f921f2
src/pages/production/twist/receive/monofil.vue
@@ -23,7 +23,7 @@
        </view>
      </template>
    </z-paging>
    <Scan ref="scanRef" />
    <Scan ref="scanRef" emitName="scanMono" />
    <wd-toast />
  </view>
</template>
@@ -88,14 +88,19 @@
  });
  if (code == 200) {
    pagingRef.value.complete(data);
    pagingRef.value.endRefresh();
  }
};
const save = async () => {
  const { code } = await TwistApi.addStrandedWireDish(cardList.value);
  const value = cardList.value.filter((item: { id?: number }) => item.id === undefined || item.id === null);
  const { code } = await TwistApi.addStrandedWireDish(value);
  if (code == 200) {
    toast.success("保存成功");
    cardList.value = [];
    pagingRef.value.refresh();
    getList();
  } else {
    toast.error("保存失败");
  }
@@ -103,12 +108,12 @@
onLoad((options: any) => {
  // 开启广播监听事件
  uni.$on("scan", getScanCode);
  uni.$on("scanMono", getScanCode);
  paramsId.value = options.id;
});
onUnload(() => {
  // 开启广播监听事件
  uni.$off("scan", getScanCode);
  uni.$off("scanMono", getScanCode);
});
</script>