Merge remote-tracking branch 'origin/dev_新疆_大罗素马铃薯new' into dev_新疆_大罗素马铃薯new
已修改2个文件
45 ■■■■■ 文件已修改
src/views/inventoryManagement/stockManagement/New.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/Record.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/New.vue
@@ -49,6 +49,23 @@
                       value="unqualified" />
          </el-select>
        </el-form-item>
        <el-form-item label="仓库"
                      prop="warehouse"
                      :rules="[
                {
                required: true,
                message: '请选择仓库',
                trigger: 'change',
              }
            ]">
          <el-select v-model="formState.warehouse"
                     placeholder="请选择仓库">
            <el-option v-for="item in warehouseOptions"
                       :key="item.value"
                       :label="item.label"
                       :value="item.value" />
          </el-select>
        </el-form-item>
        <el-form-item label="库存数量"
                      prop="qualitity">
          <el-input-number v-model="formState.qualitity"
@@ -102,10 +119,11 @@
</template>
<script setup>
  import { ref, computed, watch, getCurrentInstance } from "vue";
  import { ref, computed, watch, getCurrentInstance, onMounted } from "vue";
  import ProductSelectDialog from "@/views/basicData/product/ProductSelectDialog.vue";
  import { addStockInRecordOnly } from "@/api/inventoryManagement/stockInventory.js";
  import { createStockUnInventory } from "@/api/inventoryManagement/stockUninventory.js";
  import { getDicts } from "@/api/system/dict/data";
  const props = defineProps({
    visible: {
@@ -128,6 +146,7 @@
    productName: "",
    productModelName: "",
    unit: "",
    warehouse: undefined,
    type: undefined,
    qualitity: 0,
    batchNo: null,
@@ -135,6 +154,9 @@
    createTime: "",
    remark: "",
  });
  // 仓库选项
  const warehouseOptions = ref([]);
  const isShow = computed({
    get() {
@@ -146,6 +168,21 @@
  });
  const showProductSelectDialog = ref(false);
  // 获取仓库字典数据
  const getWarehouseOptions = async () => {
    const res = await getDicts("warehouse");
    if (res.code === 200) {
      warehouseOptions.value = res.data.map(item => ({
        label: item.dictLabel,
        value: item.dictValue,
      }));
    }
  };
  onMounted(() => {
    getWarehouseOptions();
  });
  // 批号为空时转为 null
  watch(
@@ -167,6 +204,7 @@
      productName: "",
      productModelName: "",
      unit: "",
      warehouse: undefined,
      type: undefined,
      qualitity: 0,
      batchNo: null,
@@ -231,4 +269,4 @@
    handleSubmit,
    isShow,
  });
</script>
</script>
src/views/inventoryManagement/stockManagement/Record.vue
@@ -87,6 +87,9 @@
        <el-table-column label="批号"
                         prop="batchNo"
                         show-overflow-tooltip />
        <el-table-column label="仓库"
                         prop="warehouse"
                         show-overflow-tooltip />
        <el-table-column label="合格库存数量"
                         prop="qualifiedQuantity"
                         show-overflow-tooltip />