zhangwencui
2026-02-13 aef408c91928a8dfeb28a3f48190ead32aeb45d1
src/views/procurementManagement/invoiceEntry/index.vue
@@ -39,7 +39,7 @@
        <div></div>
        <div>
          <el-button @click="handleExport" style="margin-right: 10px">导出</el-button>
          <el-button type="primary" @click="handleAdd('add')">
          <el-button type="primary" @click="handleAdd('add')" :disabled="isInvoiceDisabled">
            来票登记
          </el-button>
<!--          <el-button type="danger" plain @click="handleDelete">删除</el-button>-->
@@ -68,9 +68,8 @@
        </template>
        <template #operation="{ row }">
          <el-button
            text
            link
            type="primary"
            size="small"
            @click="handleEdit('edit', row.id)"
          >
            编辑
@@ -85,7 +84,7 @@
<script setup>
import { usePaginationApi } from "@/hooks/usePaginationApi";
import {delRegistration, gePurchaseListPage} from "@/api/procurementManagement/invoiceEntry.js";
import { nextTick, onMounted, getCurrentInstance, ref } from "vue";
import { nextTick, onMounted, getCurrentInstance, ref, computed } from "vue";
import ExpandTable from "./components/ExpandTable.vue";
import Modal from "./components/Modal.vue";
import {ElMessageBox} from "element-plus";
@@ -113,6 +112,8 @@
  gePurchaseListPage,
  {
    purchaseContractNumber: undefined,
    // 只查询已审批通过(或指定状态为 3)的记录
    approvalStatus: 3,
  },
  [
    {
@@ -168,14 +169,14 @@
        return val ? parseFloat(val).toFixed(2) : 0;
      },
    },
    // {
    //   fixed: "right",
    //   label: "操作",
    //   dataType: "slot",
    //   slot: "operation",
    //   align: "center",
    //   width: "200px",
    // },
    {
      fixed: "right",
      label: "操作",
      dataType: "slot",
      slot: "operation",
      align: "center",
      width: 100,
    },
  ]
);
@@ -185,6 +186,18 @@
  );
};
// 计算是否可以来票登记:如果所有选中行的待来票金额都为0,则禁用按钮
const isInvoiceDisabled = computed(() => {
  if (selectedRows.value.length === 0) {
    return true;
  }
  // 如果所有选中行的待来票金额都为0或小于等于0,则禁用
  return selectedRows.value.every(row => {
    const amount = parseFloat(row.unReceiptPaymentAmount || 0);
    return amount <= 0;
  });
});
const handleAdd = (type) => {
   if (selectedRows.value.length < 1) {
      proxy.$modal.msgWarning("请至少选中一条数据");