gaoluyang
5 小时以前 2e77330d87341624c88301562fd137b58f9a101a
1.海川开心-录入日期都默认当天,封装公用组件和方法
已修改28个文件
535 ■■■■ 文件已修改
src/utils/index.js 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/customerFile/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/basicData/supplierManage/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/afterSalesHandling/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/expiryAfterSales/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/customerService/feedbackRegistration/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/energyManagement/energyPower/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/energyManagement/waterManagement/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/energyManagement/waterManagement/components/waterBillForm.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/calibration/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/measurementEquipment/components/formDia.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/equipmentManagement/upkeep/Modal/formDia.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/dispatchLog/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/issueManagement/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/components/formDia.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/receiptManagement/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/inventoryManagement/stockManagement/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/paymentEntry/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementInvoiceLedger/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/procurementManagement/procurementLedger/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/reportAnalysis/projectProfit/index.vue 314 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/deliveryLedger/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/invoiceLedger/index.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/salesManagement/salesLedger/index.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/utils/index.js
@@ -396,3 +396,16 @@
export function isEqual(obj1, obj2) {
  return JSON.stringify(obj1) === JSON.stringify(obj2);
}
/**
 * 获取当前日期并格式化为 YYYY-MM-DD
 * @returns {string} 格式化的日期字符串
 */
export function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
src/views/basicData/customerFile/index.vue
@@ -244,6 +244,7 @@
import { userListNoPage } from "@/api/system/user.js";
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -583,14 +584,6 @@
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
onMounted(() => {
    getList();
src/views/basicData/supplierManage/index.vue
@@ -236,6 +236,7 @@
} from "@/api/basicData/supplierManageFile.js";
import useUserStore from "@/store/modules/user";
import { getToken } from "@/utils/auth.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const userStore = useUserStore();
@@ -521,14 +522,6 @@
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
onMounted(() => {
  getList();
src/views/collaborativeApproval/approvalProcess/components/infoFormDia.vue
@@ -213,6 +213,7 @@
} from "@/api/salesManagement/salesLedger.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import { getToken } from "@/utils/auth";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
import useUserStore from "@/store/modules/user";
@@ -400,14 +401,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 上传前校检
function handleBeforeUpload(file) {
src/views/customerService/afterSalesHandling/components/formDia.vue
@@ -131,6 +131,7 @@
import useUserStore from "@/store/modules/user.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {afterSalesServiceAdd, afterSalesServiceDispose, afterSalesServiceUpdate} from "@/api/customerService/index.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -194,14 +195,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/customerService/expiryAfterSales/components/formDia.vue
@@ -160,6 +160,7 @@
<script setup>
import {ref, computed} from "vue";
import useUserStore from "@/store/modules/user.js";
import { getCurrentDate } from "@/utils/index.js";
// import {userListNoPageByTenantId} from "@/api/system/user.js"; // 暂时注释掉,使用假数据
// import {expiryAfterSalesAdd, expiryAfterSalesUpdate} from "@/api/customerService/index.js"; // 暂时注释掉,使用假数据
const { proxy } = getCurrentInstance()
@@ -272,14 +273,6 @@
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0");
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
src/views/customerService/feedbackRegistration/components/formDia.vue
@@ -81,6 +81,7 @@
import useUserStore from "@/store/modules/user.js";
import {userListNoPageByTenantId} from "@/api/system/user.js";
import {afterSalesServiceAdd, afterSalesServiceUpdate} from "@/api/customerService/index.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -149,14 +150,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/energyManagement/energyPower/components/formDia.vue
@@ -122,6 +122,7 @@
import {ref} from "vue";
import useUserStore from "@/store/modules/user.js";
import {deviceList, equipmentEnergyAdd, equipmentEnergyUpdate, areaListTree} from "@/api/energyManagement/index.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -217,14 +218,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/energyManagement/waterManagement/components/formDia.vue
@@ -128,6 +128,7 @@
import {ref, reactive, nextTick} from "vue";
import useUserStore from "@/store/modules/user.js";
import {waterDeviceList, waterEquipmentAdd, waterEquipmentUpdate} from "@/api/energyManagement/waterManagement.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -203,14 +204,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/energyManagement/waterManagement/components/waterBillForm.vue
@@ -109,6 +109,7 @@
import {ref, reactive, nextTick, watch} from "vue";
import useUserStore from "@/store/modules/user.js";
import {waterDeviceList, waterBillAdd, waterBillUpdate} from "@/api/energyManagement/waterManagement.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -192,14 +193,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/equipmentManagement/calibration/index.vue
@@ -134,7 +134,7 @@
    {
        dataType: "action",
        label: "操作",
        width: 100,
        width: 140,
        align: "center",
        fixed: 'right',
        operation: [
src/views/equipmentManagement/measurementEquipment/components/calibrationDia.vue
@@ -131,6 +131,7 @@
import {getToken} from "@/utils/auth.js";
import {ledgerRecordUpdate, ledgerRecordVerifying} from "@/api/equipmentManagement/calibration.js";
import {delLedgerFile} from "@/api/salesManagement/salesLedger.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -250,14 +251,6 @@
    dialogFormVisible.value = false;
    emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
    openDialog,
});
src/views/equipmentManagement/measurementEquipment/components/formDia.vue
@@ -126,6 +126,7 @@
import {afterSalesServiceAdd, afterSalesServiceUpdate} from "@/api/customerService/index.js";
import {getToken} from "@/utils/auth.js";
import {measuringInstrumentAdd, measuringInstrumentUpdate} from "@/api/equipmentManagement/measurementEquipment.js";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits(['close'])
const dialogFormVisible = ref(false);
@@ -236,14 +237,6 @@
  dialogFormVisible.value = false;
  emit('close')
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
defineExpose({
  openDialog,
});
src/views/equipmentManagement/upkeep/Modal/formDia.vue
@@ -139,12 +139,15 @@
import {userListNoPageByTenantId} from "@/api/system/user.js";
import { getDeviceLedger } from "@/api/equipmentManagement/ledger";
import { deviceMaintenanceTaskAdd, deviceMaintenanceTaskEdit } from "@/api/equipmentManagement/upkeep";
import { getCurrentDate } from "@/utils/index.js";
import useUserStore from "@/store/modules/user.js";
const { proxy } = getCurrentInstance()
const emit = defineEmits()
const dialogVisitable = ref(false);
const operationType = ref('add');
const deviceOptions = ref([]);
const userStore = useUserStore();
const data = reactive({
    form: {
        taskId: undefined,
@@ -210,6 +213,11 @@
        if (form.value.taskId) {
            setDeviceModel(form.value.taskId);
        }
    } else if (type === 'add') {
        // 新增时设置登记日期为当天
        form.value.registrationDate = getCurrentDate();
        // 新增时设置录入人为当前登录账户
        form.value.inspector = userStore.id;
    }
}
src/views/inventoryManagement/dispatchLog/index.vue
@@ -324,6 +324,7 @@
    getStockInPageByProduct,
    getStockInPageByCustom,
} from "@/api/inventoryManagement/stockIn.js";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -789,14 +790,6 @@
    const seconds = String(date.getSeconds()).padStart(2, "0");
    return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
    const today = new Date();
    const year = today.getFullYear();
    const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
    const day = String(today.getDate()).padStart(2, "0");
    return `${year}-${month}-${day}`;
}
onMounted(() => {
    getList();
});
src/views/inventoryManagement/issueManagement/index.vue
@@ -162,6 +162,7 @@
    delStockManage,
    stockOut,
} from "@/api/inventoryManagement/stockManage.js";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -410,14 +411,6 @@
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
}
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
// 根据tab类型获取弹框标题
src/views/inventoryManagement/receiptManagement/components/formDia.vue
@@ -78,6 +78,7 @@
  selectProductRecordListByPuechaserId
} from "@/api/inventoryManagement/stockIn.js";
import { purchaseListPage } from "@/api/procurementManagement/procurementLedger.js";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -338,9 +339,6 @@
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function getCurrentDate() {
  return formatDateTime(new Date(), false);
}
const openDialog = async (type, row) => {
  operationType.value = type
src/views/inventoryManagement/receiptManagement/components/formDiaManual.vue
@@ -104,6 +104,7 @@
  addStockInCustom,
  updateStockInCustom,
} from "@/api/inventoryManagement/stockIn.js";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -132,9 +133,6 @@
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function getCurrentDate() {
  return formatDateTime(new Date(), false);
}
const itemTypeOptions = [
  { label: '物料', value: '物料' },
@@ -175,7 +173,7 @@
    supplierName: form.value.supplierName || '',
    itemType: '',
    inboundNum: 0,
    inboundDate: '',
    inboundDate: getCurrentDate(), // 默认当天日期
    quantityStock: 0,
    taxInclusiveUnitPrice: 0,
    taxInclusiveTotalPrice: 0,
src/views/inventoryManagement/receiptManagement/components/formDiaProduct.vue
@@ -81,6 +81,7 @@
import {
    addStockInCustom, updateProduct
} from "@/api/inventoryManagement/stockIn.js";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore()
const { proxy } = getCurrentInstance()
@@ -109,9 +110,6 @@
  return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
}
function getCurrentDate() {
  return formatDateTime(new Date(), false);
}
const itemTypeOptions = [
  { label: '物料', value: '物料' },
src/views/inventoryManagement/receiptManagement/index.vue
@@ -186,11 +186,7 @@
import FormDia from './components/formDia.vue'
import FormDiaManual from './components/formDiaManual.vue'
import FormDiaProduct from './components/formDiaProduct.vue'
// 获取当前日期
function getCurrentDate() {
  return dayjs().format('YYYY-MM-DD')
}
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance()
src/views/inventoryManagement/stockManagement/index.vue
@@ -205,6 +205,7 @@
import {
    updateManagement, updateManagementByCustom, updateStockIn
} from "@/api/inventoryManagement/stockIn.js";
import { getCurrentDate } from "@/utils/index.js";
// 导入三个独立的弹框组件
import FormDiaProduction from './components/FormDiaProduction.vue'
@@ -551,14 +552,6 @@
  }).catch(() => {
    proxy.$modal.msg("已取消")
  })
}
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从0开始
  const day = String(today.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}
onMounted(() => {
  getList()
src/views/procurementManagement/paymentEntry/index.vue
@@ -283,6 +283,7 @@
    updatePaymentRegistration
} from "@/api/procurementManagement/procurementInvoiceLedger.js";
import useFormData from "@/hooks/useFormData";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const tableColumn = ref([
@@ -573,14 +574,6 @@
      proxy.$modal.msg("已取消");
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 导出
const handleExport = () => {
src/views/procurementManagement/procurementInvoiceLedger/index.vue
@@ -78,7 +78,7 @@
          >
            编辑
          </el-button>
                    <el-button link type="primary" size="small" @click="downLoadFile(row)">附件</el-button>
                    <el-button link type="primary" @click="downLoadFile(row)">附件</el-button>
          <el-button
            type="primary"
                        link
src/views/procurementManagement/procurementLedger/index.vue
@@ -818,6 +818,7 @@
import useUserStore from "@/store/modules/user";
import { modelList, productTreeList } from "@/api/basicData/product.js";
import dayjs from "dayjs";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore();
@@ -1312,14 +1313,6 @@
      proxy.$modal.msg("已取消");
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
const mathNum = () => {
    if (!productForm.value.taxRate) {
        proxy.$modal.msgWarning("请先选择税率");
src/views/reportAnalysis/projectProfit/index.vue
@@ -1,30 +1,32 @@
<template>
  <div class="app-container">
    <el-form :model="filters" :inline="true" label-width="80px">
      <el-form-item label="客户名称">
        <el-input v-model="filters.customerName" placeholder="请输入客户名称" />
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="getTableData"> 搜索 </el-button>
        <el-button @click="resetFilters"> 重置 </el-button>
        <el-button @click="handleOut"> 导出 </el-button>
      </el-form-item>
    </el-form>
    <div class="table_list">
      <PIMTable
        rowKey="id"
        :column="columns"
        :tableLoading="loading"
        :tableData="dataList"
        :page="{
    <div class="app-container">
        <el-form :model="filters" :inline="true" label-width="80px">
            <el-form-item label="客户名称">
                <el-input v-model="filters.customerName" placeholder="请输入客户名称" clearable style="width: 240px"/>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="getTableData"> 搜索 </el-button>
                <el-button @click="resetFilters"> 重置 </el-button>
                <el-button @click="handleOut"> 导出 </el-button>
            </el-form-item>
        </el-form>
        <div class="table_list">
            <PIMTable
                rowKey="id"
                :column="columns"
                :tableLoading="loading"
                :tableData="dataList"
                :page="{
          current: pagination.currentPage,
          size: pagination.pageSize,
          total: pagination.total,
          total: pagination.total
        }"
        @pagination="changePage"
      ></PIMTable>
    </div>
  </div>
                :isShowSummary="true"
                :summaryMethod="summarizeMainTable"
                @pagination="changePage"
            ></PIMTable>
        </div>
    </div>
</template>
<script setup>
@@ -36,225 +38,89 @@
const { proxy } = getCurrentInstance();
defineOptions({
  name: "项目利润",
    name: "项目利润",
});
const {
  loading,
  filters,
  columns,
  dataList,
  pagination,
  resetFilters,
  onCurrentChange,
    loading,
    filters,
    columns,
    dataList,
    pagination,
    getTableData,
    resetFilters,
    onCurrentChange,
} = usePaginationApi(
  getPurchaseList,
  {
    customerName: undefined,
  },
  [
    {
      label: "销售合同号",
      align: "center",
      prop: "customerContractNo",
    },
    {
      label: "客户名称",
      align: "center",
      prop: "customerName",
    },
    {
      label: "合同金额",
      align: "center",
      prop: "contractAmount",
    },
    {
      label: "采购金额",
      align: "center",
      prop: "purchaseAmount",
    },
    {
      label: "利润",
      align: "center",
      prop: "balance",
    },
    {
      label: "利润率",
      align: "center",
      prop: "balanceRatio",
    },
  ]
    getPurchaseList,
    {
        customerName: undefined,
    },
    [
        {
            label: "销售合同号",
            align: "center",
            prop: "customerContractNo",
        },
        {
            label: "客户名称",
            align: "center",
            prop: "customerName",
        },
        {
            label: "合同金额",
            align: "center",
            prop: "contractAmount",
        },
        {
            label: "采购金额",
            align: "center",
            prop: "purchaseAmount",
        },
        {
            label: "利润",
            align: "center",
            prop: "balance",
        },
        {
            label: "利润率",
            align: "center",
            prop: "balanceRatio",
        },
    ]
);
// 设置假数据
const mockData = [
  {
    customerContractNo: "HCKX20251220011",
    customerName: "巴楚县高宏军 - 新疆名利商贸有限公司",
    contractAmount: "10189.00",
    purchaseAmount: "6113.00",
    balance: "4076.00",
    balanceRatio: "40.0%"
  },
  {
    customerContractNo: "HCKX20251220002",
    customerName: "喀什福新源商贸有限公司",
    contractAmount: "35321.00",
    purchaseAmount: "19436.00",
    balance: "15885.00",
    balanceRatio: "45.0%"
  },
  {
    customerContractNo: "HCKX20251220001",
    customerName: "郑州振亿商贸有限公司",
    contractAmount: "26491.00",
    purchaseAmount: "13245.50",
    balance: "13245.50",
    balanceRatio: "50.0%"
  },
  {
    customerContractNo: "HCKX20251220009",
    customerName: "阜康苗绪涛",
    contractAmount: "58868.00",
    purchaseAmount: "35321.00",
    balance: "23547.00",
    balanceRatio: "40.0%"
  },
  {
    customerContractNo: "HCKX20251210013",
    customerName: "河北援疆引擎科技有限公司",
    contractAmount: "41678.00",
    purchaseAmount: "18755.10",
    balance: "22922.90",
    balanceRatio: "55.0%"
  },
  {
    customerContractNo: "HCKX20251220015",
    customerName: "王文 - 阿克苏友鑫商贸有限公司",
    contractAmount: "37358.00",
    purchaseAmount: "20547.00",
    balance: "16811.00",
    balanceRatio: "45.0%"
  },
  {
    customerContractNo: "HCKX20251220010",
    customerName: "阿勒泰张蒙",
    contractAmount: "203773.60",
    purchaseAmount: "81509.44",
    balance: "122264.16",
    balanceRatio: "60.0%"
  },
  {
    customerContractNo: "HCKX20250930002",
    customerName: "乌鲁木齐市众筹商贸有限公司",
    contractAmount: "56612.30",
    purchaseAmount: "28306.15",
    balance: "28306.15",
    balanceRatio: "50.0%"
  },
  {
    customerContractNo: "HCKX20251220016",
    customerName: "新疆天润商贸有限公司",
    contractAmount: "89245.00",
    purchaseAmount: "53547.00",
    balance: "35698.00",
    balanceRatio: "40.0%"
  },
  {
    customerContractNo: "HCKX20251220017",
    customerName: "哈密市宏达贸易有限公司",
    contractAmount: "123456.00",
    purchaseAmount: "55555.20",
    balance: "67900.80",
    balanceRatio: "55.0%"
  },
  {
    customerContractNo: "HCKX20251220018",
    customerName: "伊犁哈萨克自治州贸易公司",
    contractAmount: "78912.00",
    purchaseAmount: "31564.80",
    balance: "47347.20",
    balanceRatio: "60.0%"
  },
  {
    customerContractNo: "HCKX20251220019",
    customerName: "克拉玛依石油贸易有限公司",
    contractAmount: "156789.00",
    purchaseAmount: "78394.50",
    balance: "78394.50",
    balanceRatio: "50.0%"
  },
  {
    customerContractNo: "HCKX20251220020",
    customerName: "石河子农业贸易公司",
    contractAmount: "234567.00",
    purchaseAmount: "129011.85",
    balance: "105555.15",
    balanceRatio: "45.0%"
  },
  {
    customerContractNo: "HCKX20251220021",
    customerName: "吐鲁番葡萄贸易有限公司",
    contractAmount: "98765.00",
    purchaseAmount: "59259.00",
    balance: "39506.00",
    balanceRatio: "40.0%"
  },
  {
    customerContractNo: "HCKX20251220022",
    customerName: "和田玉石贸易公司",
    contractAmount: "345678.00",
    purchaseAmount: "138271.20",
    balance: "207406.80",
    balanceRatio: "60.0%"
  }
];
// 重写获取表格数据的方法,使用假数据
const loadMockData = () => {
  loading.value = true;
  setTimeout(() => {
    dataList.value = mockData;
    pagination.total = mockData.length;
    loading.value = false;
  }, 500);
const changePage = ({ page, limit }) => {
    pagination.currentPage = page;
    pagination.pageSize = limit;
    onCurrentChange(page);
};
// 重写getTableData方法
const getTableData = () => {
  loadMockData();
};
const changePage = ({ page }) => {
  pagination.currentPage = page;
  onCurrentChange(page);
// 主表合计方法
const summarizeMainTable = (param) => {
    return proxy.summarizeTable(param, ["contractAmount", "purchaseAmount", "balance"]);
};
// 导出
const handleOut = () => {
  ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
    confirmButtonText: "确认",
    cancelButtonText: "取消",
    type: "warning",
  })
    .then(() => {
      proxy.download("/purchase/report/export", {}, "项目利润.xlsx");
    })
    .catch(() => {
      proxy.$modal.msg("已取消");
    });
    ElMessageBox.confirm("选中的内容将被导出,是否确认导出?", "导出", {
        confirmButtonText: "确认",
        cancelButtonText: "取消",
        type: "warning",
    })
        .then(() => {
            proxy.download("/purchase/report/export", {}, "项目利润.xlsx");
        })
        .catch(() => {
            proxy.$modal.msg("已取消");
        });
};
onMounted(() => {
  getTableData();
    getTableData();
});
</script>
<style lang="scss" scoped>
.table_list {
  margin-top: unset;
    margin-top: unset;
}
</style>
src/views/salesManagement/deliveryLedger/index.vue
@@ -100,6 +100,7 @@
  addOrUpdateDeliveryLedger,
  delDeliveryLedger,
} from "@/api/salesManagement/deliveryLedger.js";
import { getCurrentDate } from "@/utils/index.js";
 
const { proxy } = getCurrentInstance();
@@ -284,14 +285,6 @@
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0");
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
onMounted(() => {
  getList();
src/views/salesManagement/invoiceLedger/index.vue
@@ -170,6 +170,7 @@
import useFormData from "@/hooks/useFormData";
import dayjs from "dayjs";
import FileList from "./fileList.vue";
import { getCurrentDate } from "@/utils/index.js";
const { proxy } = getCurrentInstance();
const tableData = ref([]);
@@ -412,14 +413,6 @@
    });
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
const changeDateRange = (date) => {
  if (date) {
    searchForm.invoiceDateStart = date[0];
src/views/salesManagement/salesLedger/index.vue
@@ -491,6 +491,7 @@
import { modelList, productTreeList } from "@/api/basicData/product.js";
import useFormData from "@/hooks/useFormData.js";
import dayjs from "dayjs";
import { getCurrentDate } from "@/utils/index.js";
const userStore = useUserStore();
const { proxy } = getCurrentInstance();
@@ -770,7 +771,10 @@
    customerOption.value = res;
  });
  form.value.entryPerson = userStore.id;
  if (type !== "add") {
  if (type === "add") {
    // 新增时设置录入日期为当天
    form.value.entryDate = getCurrentDate();
  } else {
    currentId.value = row.id;
    getSalesLedgerWithProducts({ id: row.id, type: 1 }).then((res) => {
      form.value = { ...res };
@@ -1310,14 +1314,6 @@
    const seconds = String(date.getSeconds()).padStart(2, "0");
    return `${year}/${month}/${day} ${hours}:${minutes}:${seconds}`;
};
// 获取当前日期并格式化为 YYYY-MM-DD
function getCurrentDate() {
  const today = new Date();
  const year = today.getFullYear();
  const month = String(today.getMonth() + 1).padStart(2, "0"); // 月份从0开始
  const day = String(today.getDate()).padStart(2, "0");
  return `${year}-${month}-${day}`;
}
// 计算产品总数量
const getTotalQuantity = (products) => {