进销存-付款单

This commit is contained in:
1378012178@qq.com 2025-11-24 10:35:55 +08:00
parent ff7bb73ff6
commit 46488a8e0d
10 changed files with 1425 additions and 10 deletions

View File

@ -1,16 +1,19 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/cgd/nuInvoicingCgdInfo/list',
save='/cgd/nuInvoicingCgdInfo/add',
edit='/cgd/nuInvoicingCgdInfo/edit',
listAndJh = '/cgd/nuInvoicingCgdInfo/listAndJh',
save = '/cgd/nuInvoicingCgdInfo/add',
edit = '/cgd/nuInvoicingCgdInfo/edit',
deleteOne = '/cgd/nuInvoicingCgdInfo/delete',
deleteBatch = '/cgd/nuInvoicingCgdInfo/deleteBatch',
importExcel = '/cgd/nuInvoicingCgdInfo/importExcel',
exportXls = '/cgd/nuInvoicingCgdInfo/exportXls',
sxd = '/cgd/nuInvoicingCgdSxd/list',
calcTotalPrice = '/cgd/nuInvoicingCgdInfo/calcTotalPrice',
}
/**
@ -24,6 +27,12 @@ export const getExportUrl = Api.exportXls;
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const listAndJh = (params) => defHttp.get({ url: Api.listAndJh, params });
/**
*
* @param params
@ -35,11 +44,11 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
};
/**
*
@ -54,12 +63,12 @@ export const batchDelete = (params, handleSuccess) => {
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
}
},
});
}
};
/**
*
@ -69,4 +78,16 @@ export const batchDelete = (params, handleSuccess) => {
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
};
/**
*
* @param params
*/
export const sxdList = (params) => defHttp.get({ url: Api.sxd, params });
/**
* +
* @param params
*/
export const calcTotalPrice = (params) => defHttp.get({ url: Api.calcTotalPrice, params });

View File

@ -0,0 +1,89 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
const { createConfirm } = useMessage();
enum Api {
list = '/fkd/nuInvoicingFkdMain/list',
save = '/fkd/nuInvoicingFkdMain/add',
edit = '/fkd/nuInvoicingFkdMain/edit',
deleteOne = '/fkd/nuInvoicingFkdMain/delete',
deleteBatch = '/fkd/nuInvoicingFkdMain/deleteBatch',
importExcel = '/fkd/nuInvoicingFkdMain/importExcel',
exportXls = '/fkd/nuInvoicingFkdMain/exportXls',
cancellation = '/fkd/nuInvoicingFkdMain/cancellation',
fkdCgdIds = '/fkd/nuInvoicingFkdInfo/queryCgdIds',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
/**
* ids
* @param params
*/
export const queryFkdCgdIds = (params) => defHttp.get({ url: Api.fkdCgdIds, params }, { isTransformResponse: false });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params, handleSuccess) => {
return defHttp.delete({ url: Api.deleteOne, params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
};
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({ url: Api.deleteBatch, data: params }, { joinParamsToUrl: true }).then(() => {
handleSuccess();
});
},
});
};
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
};
/**
*
* @param params
* @param isUpdate
*/
export const cancellation = (params) => {
return defHttp.post({ url: Api.cancellation, params }, { isTransformResponse: false });
};

View File

@ -0,0 +1,42 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '付款单单号',
align: "center",
dataIndex: 'fkdNo'
},
{
title: '供应商名称',
align: "center",
dataIndex: 'gysName'
},
{
title: '总金额',
align: "center",
dataIndex: 'totalPrice'
},
{
title: '付款状态',
align: "center",
dataIndex: 'status_dictText'
},
{
title: '付款时间',
align: "center",
dataIndex: 'fksj'
},
];
// 高级查询数据
export const superQuerySchema = {
fkdNo: {title: '付款单单号',order: 0,view: 'text', type: 'string',},
gysName: {title: '供应商名称',order: 2,view: 'text', type: 'string',},
totalPrice: {title: '总金额',order: 5,view: 'number', type: 'number',},
status: {title: '付款状态 0待付款 1作废 2已付款',order: 6,view: 'list', type: 'string',dictCode: 'invoicing_payment_status',},
fksj: {title: '付款时间',order: 7,view: 'datetime', type: 'string',},
};

View File

@ -0,0 +1,270 @@
<template>
<div class="p-2">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="gysId">
<template #label><span title="供应商">供应商</span></template>
<j-search-select placeholder="请选择供应商" v-model:value="queryParam.gysId"
dict="nu_invoicing_fkd_main,gys_name,gys_id" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="status">
<template #label><span title="付款状态">付款状态</span></template>
<j-dict-select-tag placeholder="请选择付款状态" v-model:value="queryParam.status"
dictCode="invoicing_payment_status" allow-clear />
</a-form-item>
</a-col>
<a-col :lg="6">
<a-form-item name="fksj">
<template #label><span title="付款时间">付款时间</span></template>
<a-range-picker value-format="YYYY-MM-DD" v-model:value="queryParam.fksj" class="query-group-cust" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" v-auth="'fkd:nu_invoicing_fkd_main:add'" @click="createFkdFunc()"
preIcon="ant-design:plus-outlined">生成付款单</a-button>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
<!-- 表单区域 -->
<NuInvoicingFkdMainModal ref="registerModal" @success="handleSuccess"></NuInvoicingFkdMainModal>
</div>
</template>
<script lang="ts" name="fkd-nuInvoicingFkdMain" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, superQuerySchema } from './NuInvoicingFkdMain.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, cancellation } from './NuInvoicingFkdMain.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import NuInvoicingFkdMainModal from './components/NuInvoicingFkdMainModal.vue'
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { cloneDeep } from "lodash-es";
import { useMessage } from '/@/hooks/web/useMessage';
const { createMessage, createConfirm } = useMessage();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const userStore = useUserStore();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '进销存-付款单主信息',
api: list,
columns,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 180,
fixed: 'right',
},
beforeFetch: async (params) => {
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery);
},
},
exportConfig: {
name: "进销存-付款单主信息",
url: getExportUrl,
params: queryParam,
},
importConfig: {
url: getImportUrl,
success: handleSuccess
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 24,
sm: 4,
xl: 6,
xxl: 4
});
const wrapperCol = reactive({
xs: 24,
sm: 20,
});
/**
* 生成付款单
*/
function createFkdFunc() {
registerModal.value.disableSubmit = false;
registerModal.value.createFkd();
}
/**
* 付款
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
/**
* 作废
* @param record_
*/
function handleZfFunc(record_) {
createConfirm({
title: '作废',
content: `确定要将供应商【` + record_.gysName + `】 付款单号为【` + record_.fkdNo + `】的付款单作废吗?`,
iconType: 'warning',
onOk: () => {
cancellation({ id: record_.id }).then(res => {
reload()
createMessage.success(res.message);
})
},
onCancel: () => {
createMessage.info('已取消操作')
},
});
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
ifShow: record.status != '1'
},
{
label: '付款',
onClick: handleEdit.bind(null, record),
ifShow: record.status == '0'
},
{
label: '作废',
onClick: handleZfFunc.bind(null, record),
ifShow: record.status == '0'
}
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
let rangeField = 'fksj,'
/**
* 设置范围查询条件
*/
async function setRangeQuery() {
let queryParamClone = cloneDeep(queryParam);
if (rangeField) {
let fieldsValue = rangeField.split(',');
fieldsValue.forEach(item => {
if (queryParamClone[item]) {
let range = queryParamClone[item];
queryParamClone[item + '_begin'] = range[0];
queryParamClone[item + '_end'] = range[1];
delete queryParamClone[item];
} else {
queryParamClone[item + '_begin'] = '';
queryParamClone[item + '_end'] = '';
}
})
}
return queryParamClone;
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,76 @@
<template>
<BasicTable @register="registerTable">
<template #tableTitle>
</template>
<template #action="{ record }">
<TableAction />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</template>
<script lang="ts" setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { listAndJh } from '../../cgd/NuInvoicingCgdInfo.api';
import { wlColumns } from './cgd.data';
// props
const props = defineProps({
cgdId: {
type: String,
default: ''
}
});
//
const emit = defineEmits(['total-amount-change']);
const queryParam = reactive<any>({});
// table
const { tableContext } = useListPage({
tableProps: {
title: '采购单明细列表',
api: listAndJh,
columns: wlColumns,
canResize: false,
useSearchForm: false,
showActionColumn: false,
immediate: false,
showIndexColumn: true,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
queryParam.cgdId = props.cgdId;
return Object.assign(params, queryParam);
},
afterFetch: (data) => {
//
if (data && data.length > 0) {
const totalAmount = data[0].zongJinE || '';
emit('total-amount-change', totalAmount);
}
return data;
}
},
});
const [registerTable, { reload, setLoading }] = tableContext;
// cgdId
watch(() => props.cgdId, (newCgdId) => {
if (newCgdId) {
reload();
}
});
//
defineExpose({
reload
});
</script>

View File

@ -0,0 +1,260 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="true">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuInvoicingFkdMainForm">
<a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'基本信息'" />
</a-col>
<a-col :span="12">
<a-form-item label="供应商" v-bind="validateInfos.gysName" id="NuInvoicingFkdMainForm-gysName"
name="gysName">
<a-input v-model:value="formData.gysName"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="开户行" v-bind="validateInfos.openingBank" id="NuInvoicingFkdMainForm-openingBank"
name="openingBank">
<a-input v-model:value="formData.openingBank"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="账号信息" v-bind="validateInfos.openingBankNo" id="NuInvoicingFkdMainForm-openingBankNo"
name="openingBankNo">
<a-input v-model:value="formData.openingBankNo"></a-input>
</a-form-item>
</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-form-item label="总金额(元)" v-bind="validateInfos.totalPrice" id="NuInvoicingFkdMainForm-totalPrice"
name="totalPrice">
<a-input-number v-model:value="formData.totalPrice" style="width: 100%" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<JFormContainer :disabled="disabled" style="margin-top:-60px ;">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol2" :wrapperCol="wrapperCol2"
name="NuInvoicingFkdMainForm">
<a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'付款凭证'" />
</a-col>
<a-col :span="12">
<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>
</a-form-item>
</a-col>
<a-col :span="12">
<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>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<JFormContainer :disabled="disabled" style="margin-top:-60px ;">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol3" :wrapperCol="wrapperCol3"
name="NuInvoicingFkdMainForm">
<a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'备注信息'" />
</a-col>
<a-col :span="24">
<a-form-item label="备注" v-bind="validateInfos.bz" id="NuInvoicingFkdMainForm-bz" name="bz">
<a-textarea v-model:value="formData.bz" :rows="3" placeholder="请输入备注" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<CgdTableList :cgdId="cgdIdsValue" />
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate, queryFkdCgdIds } from '../NuInvoicingFkdMain.api';
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import CgdTableList from './CgdTableList.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
fkdNo: '',
gysName: '',
openingBank: '',
openingBankNo: '',
totalPrice: undefined,
fksj: '',
fkpz: '',
fp: '',
bz: '',
status_dictText: '',
});
const { createMessage, createConfirm } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 4 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 4 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 2 } });
const wrapperCol3 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const confirmLoading = ref<boolean>(false);
const cgdIdsValue = ref('')
//
const validatorRules = reactive({
fkpz: [{ required: true, message: '请上传付款凭证' },],
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
queryFkdCgdIds({ pkId: record.id }).then(res => {
cgdIdsValue.value = res.result
})
nextTick(() => {
resetFields();
const tmpData = {};
Object.keys(formData).forEach((key) => {
if (record.hasOwnProperty(key)) {
tmpData[key] = record[key]
}
})
//
Object.assign(formData, tmpData);
});
}
/**
* 提交数据
*/
async function submitForm() {
try {
//
await validate();
} catch ({ errorFields }) {
if (errorFields) {
const firstField = errorFields[0];
if (firstField) {
formRef.value.scrollToField(firstField.name, { behavior: 'smooth', block: 'center' });
}
}
return Promise.reject(errorFields);
}
createConfirm({
title: '付款',
content: `是否确认付款?`,
iconType: 'warning',
onOk: async () => {
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
},
onCancel: () => {
},
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 0px;
}
.card-class {
padding-top: 24px;
padding-bottom: 24px;
padding-left: 14px;
padding-right: 14px;
// background-color: rgba(255, 255, 255, 0.9);
background-color: #fcfdff;
border-radius: 10px;
// box-shadow: rgba(0, 0, 0, 0.1) 0px 2px 12px;
margin-bottom: 14px;
}
</style>

View File

@ -0,0 +1,117 @@
<template>
<!-- 详情/付款 -->
<a-drawer :title="title" width="80vw" v-model:visible="visible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleCancel">
<NuInvoicingFkdMainForm v-if="visible" ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit"
:formBpm="false">
</NuInvoicingFkdMainForm>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
<a-button type="primary" @click="handleOk" v-if="!disableSubmit">确认</a-button>
</template>
</a-drawer>
<!-- 生成付款单 -->
<a-drawer :title="'生成付款单'" width="80vw" v-model:visible="scfkdVisible" :closable="true"
:footer-style="{ textAlign: 'right' }" :bodyStyle="{ padding: '14px' }" @close="handleScfkdCancel">
<NuInvoicingScfkdList v-if="scfkdVisible" ref="scfkdForm" @ok="scfkdCallback" />
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleScfkdCancel">取消</a-button>
<a-button type="primary" @click="handleScfkdOk">生成</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import NuInvoicingFkdMainForm from './NuInvoicingFkdMainForm.vue'
import NuInvoicingScfkdList from './NuInvoicingScfkdList.vue'
import JModal from '/@/components/Modal/src/JModal/JModal.vue';
const title = ref<string>('');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
const scfkdVisible = ref(false)
const scfkdForm = ref()
/**
* 生成付款单
*/
function createFkd() {
title.value = '生成付款单';
scfkdVisible.value = true
}
/**
* 详情/付款
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '付款';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
/**
* 生成付款单生成
*/
function handleScfkdOk() {
scfkdForm.value.scfkd()
}
/**
* 生成付款单取消
*/
function handleScfkdCancel() {
scfkdVisible.value = false
emit('success');
}
/**
* 生成付款单成功回调
*/
function scfkdCallback() {
scfkdVisible.value = false
emit('success');
}
defineExpose({
createFkd,
edit,
disableSubmit,
});
</script>
<style lang="less">
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>
<style lang="less" scoped></style>

View File

@ -0,0 +1,320 @@
<template>
<div>
<!--供应商选择-->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol"
:wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="6">
<a-form-item name="gysId">
<template #label><span title="供应商">供应商</span></template>
<j-search-select placeholder="请选择供应商" v-model:value="queryParam.gysId"
dict="view_cgd_gys,gys_name,gys_id,cgd_type = '2'" allow-clear @change="searchQuery()" />
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!-- 时间查询 -->
<div class="jeecg-basic-table-form-container">
<a-form ref="formRef" @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol2"
:wrapper-col="wrapperCol2">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item>
<template #label>
<a-select v-model:value="timeSearchValue" :allow-clear="false" @change="handleTimeSearchChange">
<a-select-option value="qgDate">采购日期</a-select-option>
<a-select-option value="jhTime_">拣货日期</a-select-option>
<a-select-option value="wjTime_">完结日期</a-select-option>
</a-select>
</template>
<a-range-picker value-format="YYYY-MM-DD" v-model:value="currentDateRange" @change="handleDateRangeChange"
class="query-group-cust" />
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset"
style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
<a-col :lg="4" :push="8">
<a-form-item>
<span>总金额</span>
<a-button type="link" @click="queryTotalPirceFunc()" v-if="zongJiaGeValue == null">查看</a-button>
<span v-else>{{ zongJiaGeValue }} </span>
</a-form-item>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" :row-selection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<template v-slot:bodyCell="{ column, record, index, text }">
</template>
</BasicTable>
</div>
<!-- 采购单详情 -->
<a-drawer title="采购单详情" width="70vw" v-model:visible="visible" :closable="true" :footer-style="{ textAlign: 'right' }"
:bodyStyle="{ padding: '14px' }" @close="handleCancel">
<cgdInfo v-if="visible" ref="registerForm">
</cgdInfo>
<template #footer>
<a-button type="primary" style="margin-right: 8px" @click="handleCancel">关闭</a-button>
</template>
</a-drawer>
</template>
<script lang="ts" name="fkd-scfkd" setup>
import { ref, reactive, nextTick } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './cgd.data';
import { saveOrUpdate } from '../NuInvoicingFkdMain.api';
import { list } from '../../cgd/NuInvoicingCgdMain.api'
import { calcTotalPrice } from '../../cgd/NuInvoicingCgdInfo.api'
import { downloadFile } from '/@/utils/common/renderUtils';
import { useUserStore } from '/@/store/modules/user';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import JSelectMultiple from '/@/components/Form/src/jeecg/components/JSelectMultiple.vue';
import JSearchSelect from '/@/components/Form/src/jeecg/components/JSearchSelect.vue';
import { cloneDeep } from "lodash-es";
import cgdInfo from './cgdInfo.vue';
import { useMessage } from '/@/hooks/web/useMessage';
const emit = defineEmits(['ok']);
const { createMessage } = useMessage();
const formRef = ref();
const queryParam = reactive<any>({});
const toggleSearchStatus = ref<boolean>(false);
const userStore = useUserStore();
const registerModal = ref()
const selectedRows = ref<Recordable[]>([]);
const timeSearchValue = ref('qgDate')
const currentDateRange = ref([]);
const visible = ref(false)
const registerForm = ref()
const zongJiaGeValue = ref(null)//
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '进销存-付款单主信息',
api: list,
columns,
canResize: false,
useSearchForm: false,
pagination: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: async (params) => {
let rangerQuery = await setRangeQuery();
return Object.assign(params, rangerQuery, queryParam, {
resourceFrontView: 'fukuandan',
pageSize: -1
});
},
rowSelection: {
type: 'checkbox',
onChange: (selectedKeys, selectedRows_) => {
//
zongJiaGeValue.value = null
selectedRows.value = selectedRows_;
},
},
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
const labelCol = reactive({
xs: 6,
sm: 6,
xl: 6,
xxl: 6
});
const wrapperCol = reactive({
xs: 14,
sm: 14,
});
const labelCol2 = reactive({
xs: 10,
sm: 10,
xl: 10,
xxl: 7
});
const wrapperCol2 = reactive({
xs: 14,
sm: 17,
});
/**
* 详情
*/
function handleDetail(record: Recordable) {
visible.value = true
nextTick(() => {
registerForm.value.init(record)
})
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
formRef.value.resetFields();
selectedRowKeys.value = [];
//
reload();
}
let rangeField = 'fksj,'
/**
* 设置范围查询条件
*/
async function setRangeQuery() {
let queryParamClone = cloneDeep(queryParam);
if (rangeField) {
let fieldsValue = rangeField.split(',');
fieldsValue.forEach(item => {
if (queryParamClone[item]) {
let range = queryParamClone[item];
queryParamClone[item + '_begin'] = range[0];
queryParamClone[item + '_end'] = range[1];
delete queryParamClone[item];
} else {
queryParamClone[item + '_begin'] = '';
queryParamClone[item + '_end'] = '';
}
})
}
return queryParamClone;
}
/**
* 关闭采购单详情
*/
function handleCancel() {
visible.value = false
}
/**
* 查询总价
*/
function queryTotalPirceFunc() {
if (!!selectedRows.value && !!selectedRows.value.length) {
calcTotalPrice({ cgdId: selectedRows.value.map(item => item.id).join(',') }).then(res => {
zongJiaGeValue.value = res
})
}
}
/**
* 生成付款单
*/
async function scfkd() {
if (!!selectedRows.value && !!selectedRows.value.length) {
selectedRows.value[0].cgdIds = selectedRows.value.map(item => item.id).join(',')
selectedRows.value[0].totalPrice = await calcTotalPrice({ cgdId: selectedRows.value.map(item => item.id).join(',') })
console.log("🌊 ~ scfkd ~ selectedRows.value[0]:", selectedRows.value[0])
saveOrUpdate(selectedRows.value[0], false)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
} else {
createMessage.warning('请选择单据');
}
}
const handleTimeSearchChange = (value) => {
//
['qgDate', 'jhTime_', 'wjTime_'].forEach(field => {
if (field !== value) {
queryParam[field + '_begin'] = '';
queryParam[field + '_end'] = '';
queryParam['[]'] = '';
queryParam[field] = undefined;
}
});
currentDateRange.value = [];
};
const handleDateRangeChange = (dates) => {
queryParam[timeSearchValue.value] = dates;
};
defineExpose({
scfkd
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0px;
.table-page-search-submitButtons {
display: block;
margin-bottom: 14px;
white-space: nowrap;
}
.query-group-cust {
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center
}
.ant-form-item:not(.ant-form-item-with-help) {
margin-bottom: 14px;
height: 32px;
}
:deep(.ant-picker),
:deep(.ant-input-number) {
width: 100%;
}
}
</style>

View File

@ -0,0 +1,71 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { rules } from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '采购单号',
align: 'center',
dataIndex: 'cgdNo',
},
{
title: '供应商',
align: 'center',
dataIndex: 'gysName',
},
{
title: '采购日期',
align: 'center',
dataIndex: 'qgDate',
},
{
title: '拣货日期',
align: 'center',
dataIndex: 'jhTime',
customRender: ({ text }) => {
if (!text) return '';
return text.toString().substring(0, 10);
},
},
{
title: '完结日期',
align: 'center',
dataIndex: 'wjTime',
customRender: ({ text }) => {
if (!text) return '';
return text.toString().substring(0, 10);
},
},
];
//列表数据
export const wlColumns: BasicColumn[] = [
{
title: '物料名称',
align: 'center',
dataIndex: 'wlName',
},
{
title: '到货单价',
align: 'center',
dataIndex: 'arrivalPrice',
},
{
title: '采购单位',
align: 'center',
dataIndex: 'wlUnits',
},
{
title: '入库数量',
align: 'center',
dataIndex: 'rksl',
},
{
title: '小计(元)',
align: 'center',
dataIndex: 'xiaoJi',
},
];

View File

@ -0,0 +1,149 @@
<template>
<a-spin :spinning="confirmLoading">
<JFormContainer :disabled="true">
<template #detail>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol"
name="NuInvoicingFkdMainForm">
<a-row class="card-class">
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'采购单信息'" />
</a-col>
<a-col :span="12">
<a-form-item label="采购单号" v-bind="validateInfos.cgdNo" id="NuInvoicingFkdMainForm-cgdNo" name="cgdNo">
<a-input v-model:value="formData.cgdNo"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="采购日期" v-bind="validateInfos.qgDate" id="NuInvoicingFkdMainForm-qgDate" name="qgDate">
<a-input v-model:value="formData.qgDate"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="拣货日期" v-bind="validateInfos.jhTime" id="NuInvoicingFkdMainForm-jhTime" name="jhTime">
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="formData.jhTime"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="完结日期" v-bind="validateInfos.wjTime" id="NuInvoicingFkdMainForm-wjTime" name="wjTime">
<a-date-picker format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="formData.wjTime"
style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="总金额(元)" v-bind="validateInfos.zje" id="NuInvoicingFkdMainForm-zje" name="zje">
<a-input v-model:value="formData.zje"></a-input>
</a-form-item>
</a-col>
<a-col :span="24" style="border-bottom: 2px solid #f7f7f7; margin-bottom: 14px;">
<SectionDivider :title="'随行单'" />
</a-col>
<a-col :span="23" :push="1">
<a-form-item label="" :value="sxdValue">
<j-image-upload :fileMax="0" :value="sxdValue" :disabled="true"
:show-upload-button="false"></j-image-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</template>
</JFormContainer>
<CgdTableList :cgdId="cgdInfo?.id" @total-amount-change="handleTotalAmountChange" />
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { listAndJh, sxdList } from '../../cgd/NuInvoicingCgdInfo.api'
import { useListPage } from '/@/hooks/system/useListPage';
import { wlColumns } from './cgd.data'
import { Form } from 'ant-design-vue';
import JFormContainer from '/@/components/Form/src/container/JFormContainer.vue';
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import CgdTableList from './CgdTableList.vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: () => ({}) },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const formData = reactive<Record<string, any>>({
wlName: '',//
arrivalPrice: '',//
wlUnits: '',//
rksl: '',//
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
const sxdValue = ref()//
const cgdInfo = ref({})
//
const validatorRules = reactive({
});
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: false });
//
const disabled = computed(() => {
if (props.formBpm === true) {
if (props.formData.disabled === false) {
return false;
} else {
return true;
}
}
return props.formDisabled;
});
//
const handleTotalAmountChange = (totalAmount) => {
formData.zje = totalAmount;
};
/**
* 初始化
* @param record
*/
function init(record) {
cgdInfo.value = record
console.log("🌊 ~ init ~ 采购单信息:", cgdInfo.value)
Object.keys(record).forEach(key => {
formData[key] = record[key]
})
confirmLoading.value = false
//
sxdList({ cgdId: record.id }).then(res => {
const pics = res?.records?.map(item => item.sxdPic).filter(Boolean) || []
sxdValue.value = pics.join(',')
})
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.antd-modal-form {
padding: 0px;
}
.card-class {
padding-top: 24px;
padding-bottom: 24px;
padding-left: 14px;
padding-right: 14px;
background-color: #fcfdff;
border-radius: 10px;
margin-bottom: 14px;
}
</style>