gaoluyang
2025-11-28 d96af1249dbd445707fecd8817d681525bad1dd6
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -1,5 +1,5 @@
<template>
  <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增手动入库' : '编辑手动入库'" width="70%"
  <el-dialog v-model="dialogFormVisible" :title="operationType === 'add' ? '新增自定义入库' : '编辑自定义入库'" width="70%"
    @close="closeDia">
    <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef">
      <div style="margin-bottom: 10px;" v-if="operationType === 'add'">
@@ -31,12 +31,12 @@
            <el-input v-model="scope.row.unit" placeholder="请输入单位" />
          </template>
        </el-table-column>
        <el-table-column label="供应商" prop="supplierName" width="200">
        <!-- <el-table-column label="供应商" prop="supplierName" width="200">
          <template #default="scope">
            <el-input v-model="scope.row.supplierName" placeholder="请输入供应商" />
          </template>
        </el-table-column>
        <el-table-column label="物品类型" prop="itemType" width="140">
        </el-table-column> -->
        <el-table-column label="物品类型" prop="itemType">
          <template #default="scope">
            <el-select v-model="scope.row.itemType" placeholder="请选择物品类型" style="width: 100%">
              <el-option
@@ -48,7 +48,7 @@
            </el-select>
          </template>
        </el-table-column>
        <el-table-column label="入库数量" prop="inboundNum" width="150">
        <el-table-column label="入库数量" prop="inboundNum">
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.inboundNum" @change="() => calculateTotalPrice(scope.row)" />
          </template>
@@ -65,45 +65,45 @@
            />
          </template>
        </el-table-column>
        <el-table-column label="税率(%)" prop="taxRate" width="150">
          <template #default="scope">
            <el-select v-model="scope.row.taxRate" placeholder="请选择税率" style="width: 100%" @change="() => calculateExclusivePrice(scope.row)">
              <el-option
                v-for="item in taxRateOptions"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </template>
        </el-table-column>
        <el-table-column
          label="含税单价(元)"
          prop="taxInclusiveUnitPrice"
          width="180"
        >
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="calculateTotalPrice(scope.row)" />
          </template>
        </el-table-column>
        <el-table-column
          label="含税总价(元)"
          prop="taxInclusiveTotalPrice"
          width="180"
        >
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveTotalPrice" @change="calculateExclusivePrice(scope.row)" />
          </template>
        </el-table-column>
        <el-table-column
          label="不含税总价(元)"
          prop="taxExclusiveTotalPrice"
          width="180"
        >
          <template #default="scope">
            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxExclusiveTotalPrice" />
          </template>
        </el-table-column>
<!--        <el-table-column label="税率(%)" prop="taxRate" width="150">-->
<!--          <template #default="scope">-->
<!--            <el-select v-model="scope.row.taxRate" placeholder="请选择税率" style="width: 100%" @change="() => calculateExclusivePrice(scope.row)">-->
<!--              <el-option-->
<!--                v-for="item in taxRateOptions"-->
<!--                :key="item.value"-->
<!--                :label="item.label"-->
<!--                :value="item.value"-->
<!--              />-->
<!--            </el-select>-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--          label="含税单价(元)"-->
<!--          prop="taxInclusiveUnitPrice"-->
<!--          width="180"-->
<!--        >-->
<!--          <template #default="scope">-->
<!--            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveUnitPrice" @change="calculateTotalPrice(scope.row)" />-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--          label="含税总价(元)"-->
<!--          prop="taxInclusiveTotalPrice"-->
<!--          width="180"-->
<!--        >-->
<!--          <template #default="scope">-->
<!--            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxInclusiveTotalPrice" @change="calculateExclusivePrice(scope.row)" />-->
<!--          </template>-->
<!--        </el-table-column>-->
<!--        <el-table-column-->
<!--          label="不含税总价(元)"-->
<!--          prop="taxExclusiveTotalPrice"-->
<!--          width="180"-->
<!--        >-->
<!--          <template #default="scope">-->
<!--            <el-input-number :step="0.01" :min="0" style="width: 100%" v-model="scope.row.taxExclusiveTotalPrice" />-->
<!--          </template>-->
<!--        </el-table-column>-->
        <el-table-column label="操作" width="80" v-if="operationType === 'add'">
          <template #default="scope">
            <el-button type="danger" size="small" @click="removeProductRow(scope.$index)">删除</el-button>
@@ -235,7 +235,7 @@
      return
    }
    // 验证手动添加的数据必填字段
    // 验证自定义添加的数据必填字段
    for (let i = 0; i < productList.value.length; i++) {
      const product = productList.value[i];
      if (!product.productCategory || !product.specificationModel || !product.unit) {
@@ -279,7 +279,7 @@
      await addStockInCustom(payloadList)
    }
    proxy.$modal.msgSuccess(operationType.value === 'edit' ? '编辑手动入库成功' : '新增手动入库成功')
    proxy.$modal.msgSuccess(operationType.value === 'edit' ? '编辑自定义入库成功' : '新增自定义入库成功')
    closeDia()
    emit('success')