gaoluyang
2026-06-01 677a8679b5140ca6019f974c092de103df8f8559
src/views/inventoryManagement/stockManagement/BindDeviceDialog.vue
@@ -53,7 +53,7 @@
<script setup>
  import { ref, computed, onMounted, getCurrentInstance } from "vue";
  import { getLedgerPage } from "@/api/equipmentManagement/ledger.js";
  import { bindIotDevice } from "@/api/inventoryManagement/stockInventory.js";
  import { createStockInventory } from "@/api/inventoryManagement/stockInventory.js";
  const props = defineProps({
    visible: {
@@ -124,7 +124,15 @@
        submitLoading.value = true;
        // 将设备ID数组转换为逗号分隔的字符串
        const warehouse = formState.value.deviceIds.join(",");
        bindIotDevice(props.record.id, warehouse)
        // 使用库存新增/编辑接口,warehouse 字段传设备ID
        const submitData = {
          id: props.record.id,
          productModelId: props.record.productModelId,
          batchNo: props.record.batchNo,
          qualitity: props.record.qualitity,
          warehouse: warehouse,
        };
        createStockInventory(submitData)
          .then(res => {
            submitLoading.value = false;
            proxy.$modal.msgSuccess("绑定成功");