进销存-付款单

This commit is contained in:
1378012178@qq.com 2025-11-24 15:14:36 +08:00
parent 46488a8e0d
commit 65b830e69a
7 changed files with 247 additions and 50 deletions

View File

@ -5,6 +5,7 @@ const { createConfirm } = useMessage();
enum Api { enum Api {
list = '/cgd/nuInvoicingCgdMain/list', list = '/cgd/nuInvoicingCgdMain/list',
calcList = '/cgd/nuInvoicingCgdMain/calcList',
save='/cgd/nuInvoicingCgdMain/add', save='/cgd/nuInvoicingCgdMain/add',
edit='/cgd/nuInvoicingCgdMain/edit', edit='/cgd/nuInvoicingCgdMain/edit',
deleteOne = '/cgd/nuInvoicingCgdMain/delete', deleteOne = '/cgd/nuInvoicingCgdMain/delete',
@ -32,6 +33,12 @@ export const getImportUrl = Api.importExcel;
*/ */
export const list = (params) => defHttp.get({ url: Api.list, params }); export const list = (params) => defHttp.get({ url: Api.list, params });
/**
*
* @param params
*/
export const calcList = (params) => defHttp.get({ url: Api.calcList, params });
/** /**
* *
* @param params * @param params

View File

@ -7,36 +7,47 @@ import { getWeekMonthQuarterYear } from '/@/utils';
export const columns: BasicColumn[] = [ export const columns: BasicColumn[] = [
{ {
title: '付款单单号', title: '付款单单号',
align: "center", align: 'center',
dataIndex: 'fkdNo' dataIndex: 'fkdNo',
width: 200,
}, },
{ {
title: '供应商名称', title: '供应商名称',
align: "center", align: 'center',
dataIndex: 'gysName' dataIndex: 'gysName',
width: 400,
}, },
{ {
title: '总金额', title: '总金额(元)',
align: "center", align: 'center',
dataIndex: 'totalPrice' dataIndex: 'totalPrice',
customRender: ({ text }) => {
const num = parseFloat(text);
// 处理无效值
if (isNaN(num)) {
return '0.00';
}
// 格式化为两位小数
return num.toFixed(2);
},
}, },
{ {
title: '付款状态', title: '付款状态',
align: "center", align: 'center',
dataIndex: 'status_dictText' dataIndex: 'status_dictText',
}, },
{ {
title: '付款时间', title: '付款时间',
align: "center", align: 'center',
dataIndex: 'fksj' dataIndex: 'fksj',
}, },
]; ];
// 高级查询数据 // 高级查询数据
export const superQuerySchema = { export const superQuerySchema = {
fkdNo: {title: '付款单单号',order: 0,view: 'text', type: 'string',}, fkdNo: { title: '付款单单号', order: 0, view: 'text', type: 'string' },
gysName: {title: '供应商名称',order: 2,view: 'text', type: 'string',}, gysName: { title: '供应商名称', order: 2, view: 'text', type: 'string' },
totalPrice: {title: '总金额',order: 5,view: 'number', type: 'number',}, totalPrice: { title: '总金额', order: 5, view: 'number', type: 'number' },
status: {title: '付款状态 0待付款 1作废 2已付款',order: 6,view: 'list', type: 'string',dictCode: 'invoicing_payment_status',}, status: { title: '付款状态 0待付款 1作废 2已付款', order: 6, view: 'list', type: 'string', dictCode: 'invoicing_payment_status' },
fksj: {title: '付款时间',order: 7,view: 'datetime', type: 'string',}, fksj: { title: '付款时间', order: 7, view: 'datetime', type: 'string' },
}; };

View File

@ -178,7 +178,7 @@ function getTableAction(record) {
{ {
label: '详情', label: '详情',
onClick: handleDetail.bind(null, record), onClick: handleDetail.bind(null, record),
ifShow: record.status != '1' // ifShow: record.status != '1'
}, },
{ {
label: '付款', label: '付款',

View File

@ -1,6 +1,17 @@
<template> <template>
<BasicTable @register="registerTable"> <BasicTable @register="registerTable">
<template #tableTitle> <template #tableTitle>
<div style="width:100%;display: flex;justify-content: space-between;">
<div class="divider-content">
<!-- 总金额{{ zongJinE }} -->
</div>
<div style="float: right;">
<span style="color: red;font-size: 16px; font-weight: bold;">
总金额{{ handlePriceFormat(zongJinE || zongJinECalc) }}
</span>
<span style="margin-left: 20px;"> 单位</span>
</div>
</div>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<TableAction /> <TableAction />
@ -16,15 +27,22 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { listAndJh } from '../../cgd/NuInvoicingCgdInfo.api'; import { listAndJh } from '../../cgd/NuInvoicingCgdInfo.api';
import { wlColumns } from './cgd.data'; import { wlColumns } from './cgd.data';
import { any } from 'vue-types';
// props // props
const props = defineProps({ const props = defineProps({
cgdId: { cgdId: {
type: String, type: String,
default: '' default: ''
},
zongJinE: {
type: any,
default: null
} }
}); });
const zongJinECalc = ref()
// //
const emit = defineEmits(['total-amount-change']); const emit = defineEmits(['total-amount-change']);
@ -39,8 +57,10 @@ const { tableContext } = useListPage({
canResize: false, canResize: false,
useSearchForm: false, useSearchForm: false,
showActionColumn: false, showActionColumn: false,
showTableSetting: false,
immediate: false, immediate: false,
showIndexColumn: true, showIndexColumn: true,
scroll: { y: '50vh' },
actionColumn: { actionColumn: {
width: 120, width: 120,
fixed: 'right', fixed: 'right',
@ -53,6 +73,7 @@ const { tableContext } = useListPage({
// //
if (data && data.length > 0) { if (data && data.length > 0) {
const totalAmount = data[0].zongJinE || ''; const totalAmount = data[0].zongJinE || '';
zongJinECalc.value = totalAmount
emit('total-amount-change', totalAmount); emit('total-amount-change', totalAmount);
} }
return data; return data;
@ -69,8 +90,35 @@ watch(() => props.cgdId, (newCgdId) => {
} }
}); });
function handlePriceFormat(text) {
{
const num = parseFloat(text);
//
if (isNaN(num)) {
return '0.00';
}
//
return num.toFixed(2);
}
}
// //
defineExpose({ defineExpose({
reload reload
}); });
</script> </script>
<style lang="less" scoped>
:deep .jeecg-basic-table-header__toolbar {
display: none;
}
.divider-content {
font-weight: bold;
font-size: 16px;
color: red;
white-space: nowrap;
margin-left: 14px;
}
</style>

View File

@ -2,7 +2,7 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<JFormContainer :disabled="true"> <JFormContainer :disabled="true">
<template #detail> <template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" <a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol2" :wrapperCol="wrapperCol2"
name="NuInvoicingFkdMainForm"> name="NuInvoicingFkdMainForm">
<a-row class="card-class"> <a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;"> <a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
@ -14,6 +14,15 @@
<a-input v-model:value="formData.gysName"></a-input> <a-input v-model:value="formData.gysName"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<JFormContainer :disabled="true" style="margin-top:-60px ;">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuInvoicingFkdMainForm">
<a-row class="card-class">
<a-col :span="12"> <a-col :span="12">
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuInvoicingFkdMainForm-openingBank" <a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuInvoicingFkdMainForm-openingBank"
name="openingBank"> name="openingBank">
@ -26,18 +35,18 @@
<a-input v-model:value="formData.openingBankNo"></a-input> <a-input v-model:value="formData.openingBankNo"></a-input>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-item label="结账状态" v-bind="validateInfos.status_dictText"
id="NuInvoicingFkdMainForm-status_dictText" name="status_dictText">
<a-input v-model:value="formData.status_dictText"></a-input>
</a-form-item>
</a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="总金额(元)" v-bind="validateInfos.totalPrice" id="NuInvoicingFkdMainForm-totalPrice" <a-form-item label="总金额(元)" v-bind="validateInfos.totalPrice" id="NuInvoicingFkdMainForm-totalPrice"
name="totalPrice"> name="totalPrice">
<a-input-number v-model:value="formData.totalPrice" style="width: 100%" /> <a-input-number v-model:value="formData.totalPrice" style="width: 100%" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12">
<a-form-item label="结账状态" v-bind="validateInfos.status_dictText"
id="NuInvoicingFkdMainForm-status_dictText" name="status_dictText">
<a-input v-model:value="formData.status_dictText"></a-input>
</a-form-item>
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</template> </template>
@ -52,12 +61,12 @@
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="付款凭证" v-bind="validateInfos.fkpz" id="NuInvoicingFkdMainForm-fkpz" name="fkpz"> <a-form-item label="付款凭证" v-bind="validateInfos.fkpz" id="NuInvoicingFkdMainForm-fkpz" name="fkpz">
<j-image-upload :fileMax="0" v-model:value="formData.fkpz"></j-image-upload> <j-image-upload :fileMax="disabled ? 1 : 0" v-model:value="formData.fkpz"></j-image-upload>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="12"> <a-col :span="12">
<a-form-item label="发票" v-bind="validateInfos.fp" id="NuInvoicingFkdMainForm-fp" name="fp"> <a-form-item label="发票" v-bind="validateInfos.fp" id="NuInvoicingFkdMainForm-fp" name="fp">
<j-image-upload :fileMax="0" v-model:value="formData.fp"></j-image-upload> <j-image-upload :fileMax="disabled ? 1 : 0" v-model:value="formData.fp"></j-image-upload>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -82,7 +91,7 @@
</template> </template>
</JFormContainer> </JFormContainer>
<CgdTableList :cgdId="cgdIdsValue" /> <CgdTableList :cgdId="cgdIdsValue" :zongJinE="formData.totalPrice"/>
</a-spin> </a-spin>
</template> </template>

View File

@ -2,14 +2,14 @@
<div> <div>
<!--供应商选择--> <!--供应商选择-->
<div class="jeecg-basic-table-form-container"> <div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" <a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol2"
:wrapper-col="wrapperCol"> :wrapper-col="wrapperCol2">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :lg="6"> <a-col :lg="8">
<a-form-item name="gysId"> <a-form-item name="gysId">
<template #label><span title="供应商">供应商</span></template> <template #label><span title="供应商">供应商</span></template>
<j-search-select placeholder="请选择供应商" v-model:value="queryParam.gysId" <j-search-select placeholder="请选择供应商" v-model:value="queryParam.gysId"
dict="view_cgd_gys,gys_name,gys_id,cgd_type = '2'" allow-clear @change="searchQuery()" /> dict="view_cgd_gys,gys_name,gys_id,cgd_type = '2'" allow-clear @change="changeGysFunc()" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row> </a-row>
@ -25,8 +25,8 @@
<template #label> <template #label>
<a-select v-model:value="timeSearchValue" :allow-clear="false" @change="handleTimeSearchChange"> <a-select v-model:value="timeSearchValue" :allow-clear="false" @change="handleTimeSearchChange">
<a-select-option value="qgDate">采购日期</a-select-option> <a-select-option value="qgDate">采购日期</a-select-option>
<a-select-option value="jhTime_">拣货日期</a-select-option> <a-select-option value="jhTime">拣货日期</a-select-option>
<a-select-option value="wjTime_">完结日期</a-select-option> <a-select-option value="wjTime">完结日期</a-select-option>
</a-select> </a-select>
</template> </template>
<a-range-picker value-format="YYYY-MM-DD" v-model:value="currentDateRange" @change="handleDateRangeChange" <a-range-picker value-format="YYYY-MM-DD" v-model:value="currentDateRange" @change="handleDateRangeChange"
@ -42,14 +42,13 @@
</a-col> </a-col>
</span> </span>
</a-col> </a-col>
<a-col :lg="4" :push="8"> <!-- <a-col :lg="4" :push="8">
<a-form-item> <a-form-item>
<span>总金额</span> <span>总金额</span>
<a-button type="link" @click="queryTotalPirceFunc()" v-if="zongJiaGeValue == null">查看</a-button> <a-button type="link" @click="queryTotalPirceFunc()" v-if="zongJiaGeValue == null">查看</a-button>
<span v-else>{{ zongJiaGeValue }} </span> <span v-else>{{ zongJiaGeValue }} </span>
</a-form-item> </a-form-item>
</a-col> -->
</a-col>
</a-row> </a-row>
</a-form> </a-form>
</div> </div>
@ -57,6 +56,8 @@
<BasicTable @register="registerTable" :row-selection="rowSelection"> <BasicTable @register="registerTable" :row-selection="rowSelection">
<!--插槽:table标题--> <!--插槽:table标题-->
<template #tableTitle> <template #tableTitle>
<span style="color: red;font-size: 15px; font-weight: bold;">已勾选总金额 {{ formatPrice(selectedTotalAmount) }}
</span>
</template> </template>
<!--操作栏--> <!--操作栏-->
<template #action="{ record }"> <template #action="{ record }">
@ -84,7 +85,7 @@ import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage'; import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './cgd.data'; import { columns } from './cgd.data';
import { saveOrUpdate } from '../NuInvoicingFkdMain.api'; import { saveOrUpdate } from '../NuInvoicingFkdMain.api';
import { list } from '../../cgd/NuInvoicingCgdMain.api' import { calcList } from '../../cgd/NuInvoicingCgdMain.api'
import { calcTotalPrice } from '../../cgd/NuInvoicingCgdInfo.api' import { calcTotalPrice } from '../../cgd/NuInvoicingCgdInfo.api'
import { downloadFile } from '/@/utils/common/renderUtils'; import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
@ -108,15 +109,17 @@ const currentDateRange = ref([]);
const visible = ref(false) const visible = ref(false)
const registerForm = ref() const registerForm = ref()
const zongJiaGeValue = ref(null)// const zongJiaGeValue = ref(null)//
const selectedTotalAmount = ref(0);//
//table //table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: { tableProps: {
title: '进销存-付款单主信息', title: '进销存-付款单主信息',
api: list, api: calcList,
columns, columns,
canResize: false, canResize: false,
useSearchForm: false, useSearchForm: false,
pagination: false, pagination: false,
scroll: { y: '50vh' },
actionColumn: { actionColumn: {
width: 120, width: 120,
fixed: 'right', fixed: 'right',
@ -134,6 +137,8 @@ const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
// //
zongJiaGeValue.value = null zongJiaGeValue.value = null
selectedRows.value = selectedRows_; selectedRows.value = selectedRows_;
// xiaoJi
calculateSelectedTotal();
}, },
}, },
}, },
@ -182,6 +187,16 @@ function getTableAction(record) {
]; ];
} }
/**
* 变更供应商
*/
function changeGysFunc() {
//
selectedRows.value = [];
selectedRowKeys.value = [];
selectedTotalAmount.value = 0;
searchQuery()
}
/** /**
* 查询 * 查询
@ -196,6 +211,14 @@ function searchQuery() {
function searchReset() { function searchReset() {
formRef.value.resetFields(); formRef.value.resetFields();
selectedRowKeys.value = []; selectedRowKeys.value = [];
//
['qgDate', 'jhTime', 'wjTime'].forEach(field => {
queryParam[field + '_begin'] = '';
queryParam[field + '_end'] = '';
queryParam['[]'] = '';
queryParam[field] = undefined;
});
currentDateRange.value = [];
// //
reload(); reload();
} }
@ -267,7 +290,7 @@ async function scfkd() {
const handleTimeSearchChange = (value) => { const handleTimeSearchChange = (value) => {
// //
['qgDate', 'jhTime_', 'wjTime_'].forEach(field => { ['qgDate', 'jhTime', 'wjTime'].forEach(field => {
if (field !== value) { if (field !== value) {
queryParam[field + '_begin'] = ''; queryParam[field + '_begin'] = '';
queryParam[field + '_end'] = ''; queryParam[field + '_end'] = '';
@ -279,9 +302,57 @@ const handleTimeSearchChange = (value) => {
}; };
const handleDateRangeChange = (dates) => { const handleDateRangeChange = (dates) => {
queryParam[timeSearchValue.value] = dates; if (dates && dates.length === 2) {
// jhTimewjTime
if (timeSearchValue.value === 'jhTime' || timeSearchValue.value === 'wjTime') {
queryParam[timeSearchValue.value + '_begin'] = dates[0] + ' 00:00:00';
queryParam[timeSearchValue.value + '_end'] = dates[1] + ' 23:59:59';
} else {
//
queryParam[timeSearchValue.value + '_begin'] = dates[0];
queryParam[timeSearchValue.value + '_end'] = dates[1];
}
} else {
delete queryParam[timeSearchValue.value + '_begin'];
delete queryParam[timeSearchValue.value + '_end'];
}
}; };
/**
* 计算已勾选行的总金额
*/
function calculateSelectedTotal() {
if (!selectedRows.value || selectedRows.value.length === 0) {
selectedTotalAmount.value = 0;
return;
}
// xiaoJi
selectedTotalAmount.value = selectedRows.value.reduce((total, row) => {
// xiaoJi
const amount = parseFloat(row.xiaoJi) || 0;
return total + amount;
}, 0);
}
/**
* 金额格式化函数
*/
function formatPrice(value) {
if (value == null || value === '') {
return '0.00';
}
const num = parseFloat(value);
if (isNaN(num)) {
return '0.00';
}
//
return num.toFixed(2);
}
defineExpose({ defineExpose({
scfkd scfkd
}); });

View File

@ -14,6 +14,21 @@ export const columns: BasicColumn[] = [
title: '供应商', title: '供应商',
align: 'center', align: 'center',
dataIndex: 'gysName', dataIndex: 'gysName',
width: 400,
},
{
title: '付款金额(元)',
align: 'center',
dataIndex: 'xiaoJi',
customRender: ({ text }) => {
const num = parseFloat(text);
// 处理无效值
if (isNaN(num)) {
return '0.00';
}
// 格式化为两位小数
return num.toFixed(2);
},
}, },
{ {
title: '采购日期', title: '采购日期',
@ -48,9 +63,9 @@ export const wlColumns: BasicColumn[] = [
dataIndex: 'wlName', dataIndex: 'wlName',
}, },
{ {
title: '到货单价', title: '规格型号',
align: 'center', align: 'center',
dataIndex: 'arrivalPrice', dataIndex: 'wlSpecificationModel',
}, },
{ {
title: '采购单位', title: '采购单位',
@ -58,14 +73,50 @@ export const wlColumns: BasicColumn[] = [
dataIndex: 'wlUnits', dataIndex: 'wlUnits',
}, },
{ {
title: '入库数量', title: '采购单价',
align: 'center', align: 'center',
dataIndex: 'rksl', dataIndex: 'procurementPrice',
customRender: ({ text }) => {
const num = parseFloat(text);
// 处理无效值
if (isNaN(num)) {
return '0.00';
}
// 格式化为两位小数
return num.toFixed(2);
},
}, },
{ {
title: '小计(元)', title: '到货单价',
align: 'center',
dataIndex: 'crkje',
customRender: ({ text }) => {
const num = parseFloat(text);
// 处理无效值
if (isNaN(num)) {
return '0.00';
}
// 格式化为两位小数
return num.toFixed(2);
},
},
{
title: '入库数量',
align: 'center',
dataIndex: 'crksl',
},
{
title: '小计',
align: 'center', align: 'center',
dataIndex: 'xiaoJi', dataIndex: 'xiaoJi',
customRender: ({ text }) => {
const num = parseFloat(text);
// 处理无效值
if (isNaN(num)) {
return '0.00';
}
// 格式化为两位小数
return num.toFixed(2);
},
}, },
]; ];