liding
9 天以前 380bff56969c0f3d2db224b9cb9968a2e073e927
feat(approval): 添加发货审批产品信息展示功能
已修改2个文件
73 ■■■■■ 文件已修改
src/api/salesManagement/salesLedger.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue 63 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/salesManagement/salesLedger.js
@@ -17,6 +17,14 @@
    params: query,
  });
}
// 查询单个销售产品详情
export function getSalesProductById(query) {
  return request({
    url: "/sales/product/getById",
    method: "get",
    params: query,
  });
}
// 查询客户名称列表
export function customerList(query) {
  return request({
@@ -116,4 +124,4 @@
        method: "get",
        params: query,
    });
}
}
src/views/collaborativeApproval/approvalProcess/components/approvalDia.vue
@@ -228,6 +228,40 @@
        </el-skeleton>
      </div>
      <!-- 发货审批:展示对应产品信息 -->
      <div v-if="isShipmentApproval" style="margin: 10px 0 18px;">
        <el-divider content-position="left">产品信息</el-divider>
        <el-skeleton :loading="shipmentProductLoading" animated>
          <template #template>
            <el-skeleton-item variant="h3" style="width: 30%" />
            <el-skeleton-item variant="text" style="width: 100%" />
            <el-skeleton-item variant="text" style="width: 100%" />
          </template>
          <template #default>
            <el-empty
              v-if="!currentShipmentProduct || !currentShipmentProduct.id"
              description="未查询到对应产品信息"
            />
            <template v-else>
              <el-descriptions :column="2" border>
                <el-descriptions-item label="产品大类">
                  {{ currentShipmentProduct.productCategory || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="规格型号">
                  {{ currentShipmentProduct.specificationModel || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="单位">
                  {{ currentShipmentProduct.unit || "-" }}
                </el-descriptions-item>
                <el-descriptions-item label="数量">
                  {{ currentShipmentProduct.quantity ?? "-" }}
                </el-descriptions-item>
              </el-descriptions>
            </template>
          </template>
        </el-skeleton>
      </div>
      
      <el-form :model="{ activities }" ref="formRef" label-position="top">
@@ -295,6 +329,7 @@
import { getQuotationList } from "@/api/salesManagement/salesQuotation.js";
import { getPurchaseByCode } from "@/api/procurementManagement/procurementLedger.js";
import { getStockInRecordById } from "@/api/inventoryManagement/stockInRecord.js";
import { getSalesProductById } from "@/api/salesManagement/salesLedger.js";
const emit = defineEmits(['close'])
const { proxy } = getCurrentInstance()
@@ -318,8 +353,11 @@
const currentPurchase = ref({})
const stockInLoading = ref(false)
const currentStockIn = ref({})
const shipmentProductLoading = ref(false)
const currentShipmentProduct = ref({})
const isQuotationApproval = computed(() => Number(props.approveType) === 6)
const isPurchaseApproval = computed(() => Number(props.approveType) === 5)
const isShipmentApproval = computed(() => Number(props.approveType) === 7)
const isInventoryApproval = computed(() => Number(props.approveType) === 9)
const data = reactive({
@@ -366,6 +404,7 @@
  currentQuotation.value = {}
  currentPurchase.value = {}
  currentStockIn.value = {}
  currentShipmentProduct.value = {}
    userListNoPageByTenantId().then((res) => {
        userList.value = res.data;
    });
@@ -423,6 +462,26 @@
      }).finally(() => {
        purchaseLoading.value = false
      })
    }
  }
  // 发货审批:根据审批列表中的 recordId 查询对应产品详情
  if (isShipmentApproval.value) {
    const recordId = row?.recordId;
    form.value.recordId = recordId ?? form.value.recordId;
    if (recordId) {
      shipmentProductLoading.value = true;
      getSalesProductById({ id: recordId })
        .then((res) => {
          currentShipmentProduct.value = res?.data || res || {};
        })
        .catch((err) => {
          console.error("查询发货产品详情失败:", err);
          proxy.$modal.msgError("查询发货产品详情失败");
        })
        .finally(() => {
          shipmentProductLoading.value = false;
        });
    }
  }
@@ -510,6 +569,8 @@
  currentPurchase.value = {}
  stockInLoading.value = false
  currentStockIn.value = {}
  shipmentProductLoading.value = false
  currentShipmentProduct.value = {}
  emit('close')
};
defineExpose({
@@ -548,4 +609,4 @@
    width: 200px;
    height: 60px;
}
</style>
</style>