spring
14 小时以前 fa4ea8dd99638f58da60ac283186113619cc7e6e
src/views/inventoryManagement/stockManagement/Subtract.vue
@@ -69,6 +69,7 @@
import {ref, computed, getCurrentInstance} from "vue";
import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
import {subtractStockInventory} from "@/api/inventoryManagement/stockInventory.js";
import {subtractStockUnInventory} from "@/api/inventoryManagement/stockUninventory.js";
const props = defineProps({
  visible: {
@@ -78,7 +79,12 @@
  record: {
    type: Object,
    default: () => {},
  }
  },
  type: {
    type: String,
    required: true,
    default: 'qualified',
  },
});
const emit = defineEmits(['update:visible', 'completed']);
@@ -163,13 +169,23 @@
        proxy.$modal.msgError("请选择规格");
        return;
      }
      subtractStockInventory(formState.value).then(res => {
        // 关闭模态框
        isShow.value = false;
        // 告知父组件已完成
        emit('completed');
        proxy.$modal.msgSuccess("提交成功");
      })
      if (props.type === 'qualified') {
        subtractStockInventory(formState.value).then(res => {
          // 关闭模态框
          isShow.value = false;
          // 告知父组件已完成
          emit('completed');
          proxy.$modal.msgSuccess("提交成功");
        })
      } else {
        subtractStockUnInventory(formState.value).then(res => {
          // 关闭模态框
          isShow.value = false;
          // 告知父组件已完成
          emit('completed');
          proxy.$modal.msgSuccess("提交成功");
        })
      }
    }
  })
};