gongchunyi
2026-08-12 d8b5f4beee560f2ae0acaaf55931adcad18a0d4a
src/views/procurementManagement/purchaseReturnOrder/index.vue
@@ -45,8 +45,13 @@
            @click="handleDetail(row)"
            >详情</el-button
          >
          <el-button link size="small" @click="handleDelete(row)"
            >删除</el-button
          <el-button
            link
            size="small"
            :disabled="row.stockOutApproved"
            :style="{ color: row.stockOutApproved ? '#c0c4cc' : undefined }"
            @click="handleDelete(row)"
            >{{ row.stockOutApproved }}</el-button
          >
        </template>
      </PIMTable>
@@ -116,10 +121,10 @@
            detailData.createUserName || "--"
          }}</el-descriptions-item>
          <el-descriptions-item label="创建时间">{{
            detailData.createTime || "--"
            formatDate(detailData.createTime) || "--"
          }}</el-descriptions-item>
          <el-descriptions-item label="最近更新时间">{{
            detailData.updateTime || "--"
            formatDate(detailData.updateTime) || "--"
          }}</el-descriptions-item>
          <el-descriptions-item label="备注" :span="3">{{
            detailData.remark || "--"
@@ -337,12 +342,14 @@
  {
    label: "创建时间",
    prop: "createTime",
    width: 170,
    width: 130,
    formatData: (val) => formatDate(val),
  },
  {
    label: "最近更新时间",
    prop: "updateTime",
    width: 170,
    width: 130,
    formatData: (val) => formatDate(val),
  },
  {
    label: "备注",
@@ -365,6 +372,7 @@
      },
      {
        name: "删除",
        disabled: (row) => !!row.stockOutApproved,
        clickFun: (row) => {
          handleDelete(row);
        },
@@ -498,6 +506,19 @@
  return num.toFixed(2);
};
const formatDate = (value) => {
  if (!value) return "";
  return String(value).slice(0, 10);
};
/** 已退货数量 = 入库行总数量 − 当前可退货数量(剩余) */
const calcAlreadyReturned = (row) => {
  const total = Number(row?.stockInNum ?? row?.totalQuantity ?? row?.quantity ?? 0);
  const un = Number(row?.unQuantity ?? 0);
  if (!Number.isFinite(total) || !Number.isFinite(un)) return 0;
  return Math.max(total - un, 0);
};
onMounted(() => {
  getList();
});