spring
2026-04-25 4fd0a0ccf35a239fe8c8f9385db2e8c4a0ad2f04
src/views/inventoryManagement/stockManagement/New.vue
@@ -99,9 +99,9 @@
</template>
<script setup>
import {ref, computed, getCurrentInstance} from "vue";
import {ref, computed, watch, getCurrentInstance} from "vue";
import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
import {createStockInventory} from "@/api/inventoryManagement/stockInventory.js";
import {addStockInRecordOnly} from "@/api/inventoryManagement/stockInventory.js";
import {createStockUnInventory} from "@/api/inventoryManagement/stockUninventory.js";
const props = defineProps({
@@ -127,7 +127,7 @@
  unit: "",
  type: undefined,
  qualitity: 0,
  batchNo: "",
  batchNo: null,
  warnNum: 0,
  remark: '',
});
@@ -143,6 +143,13 @@
const showProductSelectDialog = ref(false);
// 批号为空时转为 null
watch(() => formState.value.batchNo, (val) => {
  if (val === '') {
    formState.value.batchNo = null;
  }
});
let { proxy } = getCurrentInstance()
const closeModal = () => {
@@ -155,7 +162,7 @@
    unit: "",
    type: undefined,
    qualitity: 0,
    batchNo: "",
    batchNo: null,
    warnNum: 0,
    remark: '',
  };
@@ -190,7 +197,7 @@
        return;
      }
      if (formState.value.type === 'qualified') {
        createStockInventory(formState.value).then(res => {
        addStockInRecordOnly(formState.value).then(res => {
          // 关闭模态框
          isShow.value = false;
          // 告知父组件已完成