gaoluyang
2025-11-28 1ab015896fcf64ba99c5271837169a342109adae
src/views/salesManagement/invoiceLedger/index.vue
@@ -33,9 +33,9 @@
        <el-table-column label="销售合同号" prop="salesContractNo" show-overflow-tooltip width="180" />
        <el-table-column label="客户合同号" prop="customerContractNo" show-overflow-tooltip width="180" />
        <el-table-column label="客户名称" prop="customerName" show-overflow-tooltip width="240" />
        <el-table-column label="项目" prop="projectName" width="200" />
        <el-table-column label="项目" prop="projectName" width="320" />
        <el-table-column label="产品大类" prop="productCategory" width="200" />
        <el-table-column label="规格型号" prop="specificationModel" width="300" show-overflow-tooltip />
        <el-table-column label="规格型号" prop="specificationModel" width="160" show-overflow-tooltip />
        <el-table-column label="发票号" prop="invoiceNo" width="200" show-overflow-tooltip />
        <el-table-column label="发票金额(元)" prop="invoiceTotal" show-overflow-tooltip :formatter="formattedNumber"
          width="200" />
@@ -43,7 +43,7 @@
        <el-table-column label="录入人" prop="invoicePerson" show-overflow-tooltip />
        <el-table-column label="录入日期" prop="createTime" show-overflow-tooltip :formatter="formatDate" width="180" />
        <el-table-column label="开票日期" prop="invoiceDate" show-overflow-tooltip width="120" />
        <el-table-column label="发票" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip>
        <el-table-column label="发票" prop="invoiceFileName" width="120" align="center" show-overflow-tooltip fixed="right">
          <template #default="scope">
            <el-button v-if="scope.row.invoiceFileName" text bg type="primary"
              @click="handleFile(scope.row.commonFiles)">
@@ -56,7 +56,7 @@
        </el-table-column>
        <el-table-column fixed="right" label="操作" width="150" align="center">
          <template #default="scope">
            <el-button link type="primary" size="small" @click="openForm(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">编辑</el-button>
            <el-button link type="primary" size="small" @click="openForm(scope.row)">编辑</el-button>
            <el-button link type="primary" size="small" @click="delInvoiceLedger(scope.row)" :disabled="scope.row.invoicePerson !== userStore.nickName">删除</el-button>
          </template>
        </el-table-column>
@@ -185,12 +185,9 @@
  searchForm: {
    searchText: "",
    status: false,
    invoiceDate: [
      dayjs().startOf("month").format("YYYY-MM-DD"),
      dayjs().endOf("month").format("YYYY-MM-DD"),
    ],
    invoiceDateStart: dayjs().startOf("month").format("YYYY-MM-DD"),
    invoiceDateEnd: dayjs().endOf("month").format("YYYY-MM-DD"),
    invoiceDate: null,
    invoiceDateStart: undefined,
    invoiceDateEnd: undefined,
    createTimeStart: "", // 录入日期
  },
  form: {
@@ -248,7 +245,11 @@
const getList = () => {
  tableLoading.value = true;
  const { invoiceDate, ...rest } = searchForm;
  registrationProductPage({ ...rest, ...page }).then((res) => {
  // 将范围日期字段传递给后端
  const params = { ...rest, ...page };
  // 移除开票日期的默认值设置,只保留范围日期字段
  delete params.invoiceDate;
  registrationProductPage(params).then((res) => {
    tableLoading.value = false;
    tableData.value = res.data.records;
    total.value = res.data.total;
@@ -277,11 +278,9 @@
    fileList.value = res.data.fileList;
    if (!form.value.invoicePerson) {
      form.value.invoicePerson = userStore.nickName;
      form.value.entryDate = getCurrentDate();
      // 移除录入日期默认值设置,只处理范围日期字段
    }
    if (!form.value.invoiceDate) {
      form.value.invoiceDate = getCurrentDate();
    }
    // 移除开票日期默认值设置,只处理范围日期字段
  });
  dialogFormVisible.value = true;
};
@@ -437,6 +436,12 @@
};
onMounted(() => {
  // 设置开票日期范围默认值为当天
  const today = dayjs().format('YYYY-MM-DD');
  searchForm.invoiceDate = [today, today];
  // 设置范围日期字段的起始和结束时间
  searchForm.invoiceDateStart = today;
  searchForm.invoiceDateEnd = today;
  getList();
});
</script>