1.海川开心-录入日期都默认当天,封装公用组件和方法
| | |
| | | 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}`;
|
| | | }
|
| | |
|
| | |
| | | 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(); |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 获取当前日期并格式化为 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(); |
| | |
| | | } 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(); |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 获取当前日期并格式化为 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(); |
| | |
| | | } 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"; |
| | |
| | | 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) { |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | <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() |
| | |
| | | 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, |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | { |
| | | dataType: "action", |
| | | label: "操作", |
| | | width: 100, |
| | | width: 140, |
| | | align: "center", |
| | | fixed: 'right', |
| | | operation: [ |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | 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); |
| | |
| | | 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, |
| | | }); |
| | |
| | | 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, |
| | |
| | | if (form.value.taskId) { |
| | | setDeviceModel(form.value.taskId); |
| | | } |
| | | } else if (type === 'add') { |
| | | // 新增时设置登记日期为当天 |
| | | form.value.registrationDate = getCurrentDate(); |
| | | // 新增时设置录入人为当前登录账户 |
| | | form.value.inspector = userStore.id; |
| | | } |
| | | } |
| | | |
| | |
| | | getStockInPageByProduct, |
| | | getStockInPageByCustom, |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore(); |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | 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(); |
| | | }); |
| | |
| | | delStockManage, |
| | | stockOut, |
| | | } from "@/api/inventoryManagement/stockManage.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | }).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类型获取弹框标题 |
| | |
| | | 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() |
| | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | function getCurrentDate() { |
| | | return formatDateTime(new Date(), false); |
| | | } |
| | | |
| | | const openDialog = async (type, row) => { |
| | | operationType.value = type |
| | |
| | | addStockInCustom, |
| | | updateStockInCustom, |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | function getCurrentDate() { |
| | | return formatDateTime(new Date(), false); |
| | | } |
| | | |
| | | const itemTypeOptions = [ |
| | | { label: '物料', value: '物料' }, |
| | |
| | | supplierName: form.value.supplierName || '', |
| | | itemType: '', |
| | | inboundNum: 0, |
| | | inboundDate: '', |
| | | inboundDate: getCurrentDate(), // 默认当天日期 |
| | | quantityStock: 0, |
| | | taxInclusiveUnitPrice: 0, |
| | | taxInclusiveTotalPrice: 0, |
| | |
| | | import { |
| | | addStockInCustom, updateProduct |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const userStore = useUserStore() |
| | | const { proxy } = getCurrentInstance() |
| | |
| | | return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`; |
| | | } |
| | | |
| | | function getCurrentDate() { |
| | | return formatDateTime(new Date(), false); |
| | | } |
| | | |
| | | const itemTypeOptions = [ |
| | | { label: '物料', value: '物料' }, |
| | |
| | | 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() |
| | | |
| | |
| | | import { |
| | | updateManagement, updateManagementByCustom, updateStockIn |
| | | } from "@/api/inventoryManagement/stockIn.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | // 导入三个独立的弹框组件 |
| | | import FormDiaProduction from './components/FormDiaProduction.vue' |
| | |
| | | }).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() |
| | |
| | | updatePaymentRegistration |
| | | } from "@/api/procurementManagement/procurementInvoiceLedger.js"; |
| | | import useFormData from "@/hooks/useFormData"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | const tableColumn = ref([ |
| | |
| | | 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 = () => { |
| | |
| | | > |
| | | 编辑 |
| | | </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 |
| | |
| | | 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(); |
| | | |
| | |
| | | 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("请先选择税率"); |
| | |
| | | <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> |
| | |
| | | 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> |
| | | |
| | | |
| | | |
| | | |
| | |
| | | addOrUpdateDeliveryLedger, |
| | | delDeliveryLedger, |
| | | } from "@/api/salesManagement/deliveryLedger.js"; |
| | | import { getCurrentDate } from "@/utils/index.js"; |
| | | |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 获取当前日期并格式化为 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(); |
| | |
| | | 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([]); |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 获取当前日期并格式化为 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]; |
| | |
| | | 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(); |
| | |
| | | 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 }; |
| | |
| | | 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) => { |