销售结算接口

This commit is contained in:
‘huanghaiixia’
2026-02-10 17:45:43 +08:00
parent 792e7758cc
commit 73b14aa299
6 changed files with 67 additions and 27 deletions

View File

@ -11,9 +11,21 @@ enum Api {
PageAdd = '/magic-api/dayPlan/pngSettleSalesHdrSelectPage', PageAdd = '/magic-api/dayPlan/pngSettleSalesHdrSelectPage',
date = '/magic-api/dayPlan/pngSettleSalesHdrSelectDateTo', date = '/magic-api/dayPlan/pngSettleSalesHdrSelectDateTo',
DtlList = '/magic-api/dayPlan/pngSettleSalesHdrDtlList', DtlList = '/magic-api/dayPlan/pngSettleSalesHdrDtlList',
LngPngSettleHdrCancel = '/dayPlan/pngSettleHdr/cancel',
}
export async function cancelLngPngSettleHdr(ids: string[], mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.LngPngSettleHdrCancel,
data: ids,
},
{
errorMessageMode: mode,
},
);
} }
export async function getLngPngSettleHdrDtlList(params, mode: ErrorMessageMode = 'modal') { export async function getLngPngSettleHdrDtlList(params, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngPngSettleHdrPageModel>( return defHttp.get<LngPngSettleHdrPageModel>(

View File

@ -6,19 +6,19 @@
<template v-if="column.dataIndex === 'priceDesc'"> <template v-if="column.dataIndex === 'priceDesc'">
{{ record.uomName + (record.uomCode == 'M3' ? record.rateQtyM3 : record.rateQtyGj) + record.priceName }} {{ record.uomName + (record.uomCode == 'M3' ? record.rateQtyM3 : record.rateQtyGj) + record.priceName }}
</template> </template>
<template v-if="column.dataIndex === 'qtySettleGj'"> <template v-if="column.dataIndex === 'qtySettleGj' && !isDisable">
<a-input-number v-model:value="record.qtySettleGj" :min="0" :precision="3" @change="numChange('qtySettleGj', record, index)" style="width: 100%" /> <a-input-number v-model:value="record.qtySettleGj" :min="0" :precision="3" @change="numChange('qtySettleGj', record, index)" style="width: 100%" />
</template> </template>
<template v-if="column.dataIndex === 'qtySettleM3'"> <template v-if="column.dataIndex === 'qtySettleM3'&& !isDisable">
<a-input-number v-model:value="record.qtySettleM3" :min="0" :precision="3" @change="numChange('qtySettleM3', record, index)" style="width: 100%" /> <a-input-number v-model:value="record.qtySettleM3" :min="0" :precision="3" @change="numChange('qtySettleM3', record, index)" style="width: 100%" />
</template> </template>
<template v-if="column.dataIndex === 'priceM3'"> <template v-if="column.dataIndex === 'priceM3'&& !isDisable">
<a-input-number v-model:value="record.priceM3" :min="0" :precision="4" @change="numChange('priceM3', record, index)" style="width: 100%" /> <a-input-number v-model:value="record.priceM3" :min="0" :precision="4" @change="numChange('priceM3', record, index)" style="width: 100%" />
</template> </template>
<template v-if="column.dataIndex === 'priceGj'"> <template v-if="column.dataIndex === 'priceGj'&& !isDisable">
<a-input-number v-model:value="record.priceGj" :min="0" :precision="4" @change="numChange('priceGj', record, index)" style="width: 100%" /> <a-input-number v-model:value="record.priceGj" :min="0" :precision="4" @change="numChange('priceGj', record, index)" style="width: 100%" />
</template> </template>
<template v-if="column.dataIndex === 'amount'"> <template v-if="column.dataIndex === 'amount'&& !isDisable">
<a-input-number v-model:value="record.amount" :min="0" :precision="2" @change="numChange('amount', record, index)" style="width: 100%" /> <a-input-number v-model:value="record.amount" :min="0" :precision="2" @change="numChange('amount', record, index)" style="width: 100%" />
</template> </template>
</template> </template>
@ -32,10 +32,12 @@
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
import { getLngPngSettleHdrDtlList} from '/@/api/dayPlan/PngSettleHdr'; import { getLngPngSettleHdrDtlList} from '/@/api/dayPlan/PngSettleHdr';
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
const { t } = useI18n(); const { t } = useI18n();
const tableData = ref([]) const tableData = ref([])
const curRecord = ref({}) const curRecord = ref({})
const isDisable = ref(false)
const columns= [ const columns= [
{ title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80}, { title: t('序号'), dataIndex: 'index', key: 'index', customRender: (column) => `${column.index + 1}` ,width: 80},
{ title: t('价格描述'), dataIndex: 'priceDesc', width:130}, { title: t('价格描述'), dataIndex: 'priceDesc', width:130},
@ -55,10 +57,18 @@
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
curRecord.value = data.record || {} curRecord.value = data.record || {}
isUpdate.value = !!data?.isUpdate; isUpdate.value = !!data?.isUpdate;
isDisable.value = data.isDisable
if (!(curRecord.value.lngPngSettleSalesDtlList || []).length) { if (!(curRecord.value.lngPngSettleSalesDtlList || []).length) {
getList() getList()
} else { } else {
tableData.value = curRecord.value.lngPngSettleSalesDtlList || [] tableData.value = curRecord.value.lngPngSettleSalesDtlList || []
tableData.value = DataFormat.format(tableData.value, [
FormatOption.createQty('qtySettleGj'),
FormatOption.createQty('qtySettleM3'),
FormatOption.createAmt('amount'),
FormatOption.createQty('priceGj',4),
FormatOption.createQty('priceM3',4),
]);
} }
}); });

View File

@ -240,7 +240,7 @@
async function handleReject() { async function handleReject() {
if (!selectedRowsData.value.length) { if (!selectedRowsData.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('请选择需要驳回的数据'), description: t('请选择需要驳回的数据'),
}); });
return; return;
@ -248,7 +248,7 @@
await rejectLngPngMeasureSalesPur(selectedRowsData.value) await rejectLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('已驳回!'), description: t('已驳回!'),
}); });
} }
@ -256,7 +256,7 @@
async function handleCancel() { async function handleCancel() {
if (!selectedRowsData.value.length) { if (!selectedRowsData.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('请选择需要取消的数据'), description: t('请选择需要取消的数据'),
}); });
return; return;
@ -264,14 +264,14 @@
await cancelLngPngMeasureSalesPur(selectedRowsData.value) await cancelLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('取消成功!'), description: t('取消成功!'),
}); });
} }
async function handleSubmit() { async function handleSubmit() {
if (!selectedRowsData.value.length) { if (!selectedRowsData.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('请选择需要确认的数据'), description: t('请选择需要确认的数据'),
}); });
return; return;
@ -283,14 +283,14 @@
await updateLngPngMeasureSalesPur(selectedRowsData.value) await updateLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('确认成功!'), description: t('确认成功!'),
}); });
} }
async function handleSave() { async function handleSave() {
if (!selectedRowsData.value.length) { if (!selectedRowsData.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('请选择需要保存的数据'), description: t('请选择需要保存的数据'),
}); });
return; return;
@ -302,7 +302,7 @@
await addLngPngMeasureSalesPur(selectedRowsData.value) await addLngPngMeasureSalesPur(selectedRowsData.value)
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('保存成功!'), description: t('保存成功!'),
}); });
@ -353,7 +353,7 @@
function handleBatchdelete() { function handleBatchdelete() {
if (!selectedKeys.value.length) { if (!selectedKeys.value.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('请选择需要删除的数据'), description: t('请选择需要删除的数据'),
}); });
return; return;
@ -367,7 +367,7 @@
}); });
if (cantDelete.length) { if (cantDelete.length) {
notification.warning({ notification.warning({
message: 'Tip', message: '提示',
description: t('含有不能删除的数据'), description: t('含有不能删除的数据'),
}); });
return; return;
@ -385,7 +385,7 @@
deleteLngPngMeasureSalesPur(ids).then((_) => { deleteLngPngMeasureSalesPur(ids).then((_) => {
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('删除成功!'), description: t('删除成功!'),
}); });
}); });

View File

@ -108,7 +108,7 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'deptId', dataIndex: 'billList',
title: '附件', title: '附件',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',

View File

@ -35,7 +35,7 @@
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="账期内含预收付款" name="rpSign"> <a-form-item label="账期内含预收付款" name="rpSign">
<a-select v-model:value="formState.rpSign" style="width: 100%" allow-clear> <a-select v-model:value="formState.rpSign" style="width: 100%" allow-clear :disabled="isDisable">
<a-select-option v-for="item in optionSelect.signList" :key="item.code" :value="item.code"> <a-select-option v-for="item in optionSelect.signList" :key="item.code" :value="item.code">
{{ item.name }} {{ item.name }}
</a-select-option> </a-select-option>
@ -89,7 +89,7 @@
<a v-if="!isDisable" @click="btnCheck(record, index, 'delete')">删除</a> <a v-if="!isDisable" @click="btnCheck(record, index, 'delete')">删除</a>
</template> </template>
<template v-if="column.dataIndex === 'priceDesc'"> <template v-if="column.dataIndex === 'priceDesc'">
<a v-if="!isDisable" @click="btnCheck(record, index, 'price')">{{record.priceDesc}}</a> <a @click="btnCheck(record, index, 'price')">{{record.priceDesc}}</a>
</template> </template>
</template> </template>
</a-table> </a-table>
@ -355,7 +355,7 @@
if (type == 'delete') { if (type == 'delete') {
dataList.value.splice(index, 1) dataList.value.splice(index, 1)
} else { } else {
openModalPrice(true,{isUpdate: false, record}) openModalPrice(true,{isUpdate: false, record,isDisable: isDisable.value})
} }
} }
const handleSuccessPrice = (arr, curRecord) => { const handleSuccessPrice = (arr, curRecord) => {

View File

@ -18,8 +18,8 @@
<template v-if="column.dataIndex === 'action'"> <template v-if="column.dataIndex === 'action'">
<TableAction :actions="getActions(record)" /> <TableAction :actions="getActions(record)" />
</template> </template>
<template v-if="column.dataIndex === 'lngFileUploadList'"> <template v-if="column.dataIndex === 'billList'">
<div v-for="(item, idx) in record.lngFileUploadList"> <div v-for="(item, idx) in record.billList">
<a @click="handleDownload(item)">{{item.fileOrg}}</a> <a @click="handleDownload(item)">{{item.fileOrg}}</a>
</div> </div>
</template> </template>
@ -39,7 +39,7 @@
import { Modal } from 'ant-design-vue'; import { Modal } from 'ant-design-vue';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue'; import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPngSettleHdrPage, deleteLngPngSettleHdr} from '/@/api/dayPlan/PngSettleHdr'; import { getLngPngSettleHdrPage, deleteLngPngSettleHdr, cancelLngPngSettleHdr} from '/@/api/dayPlan/PngSettleHdr';
import { PageWrapper } from '/@/components/Page'; import { PageWrapper } from '/@/components/Page';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from '/@/hooks/web/useI18n'; import { useI18n } from '/@/hooks/web/useI18n';
@ -55,6 +55,7 @@
import { getDraftInfo } from '/@/api/workflow/process'; import { getDraftInfo } from '/@/api/workflow/process';
import { isValidJSON } from '/@/utils/event/design'; import { isValidJSON } from '/@/utils/event/design';
import { downloadByUrl } from '/@/utils/file/download'; import { downloadByUrl } from '/@/utils/file/download';
import { parseDownloadUrl} from '/@/api/system/file';
import PngSettleHdrModal from './components/PngSettleHdrModal.vue'; import PngSettleHdrModal from './components/PngSettleHdrModal.vue';
import {formConfig, searchFormSchema, columns } from './components/config'; import {formConfig, searchFormSchema, columns } from './components/config';
@ -81,7 +82,7 @@
const tableRef = ref(); const tableRef = ref();
//所有按钮 //所有按钮
const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"生成对账单","code":"check","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消结算","code":"cancel","icon":"ant-design:close-outlined","isDefault":false},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]); const buttons = ref([{"isUse":true,"name":"新增","code":"add","icon":"ant-design:plus-outlined","isDefault":true,"type":"primary"},{"isUse":true,"name":"编辑","code":"edit","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"生成对账单","code":"check","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"取消结算","code":"cancel","icon":"ant-design:close-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":true},{"isUse":true,"name":"查看","code":"view","icon":"ant-design:eye-outlined","isDefault":true},{"isUse":true,"name":"发起审批","code":"startwork","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"查看流转记录","code":"flowRecord","icon":"ant-design:form-outlined","isDefault":true},{"isUse":true,"name":"审批","code":"approve","icon":"ant-design:check-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true,"isUse":true}]);
//展示在列表内的按钮 //展示在列表内的按钮
const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','approve']); const actionButtons = ref<string[]>(['view', 'edit','datalog', 'copyData', 'delete', 'startwork','flowRecord','approve']);
const buttonConfigs = computed(()=>{ const buttonConfigs = computed(()=>{
@ -96,7 +97,7 @@
return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code)); return buttonConfigs.value?.filter((x) => actionButtons.value.includes(x.code));
}); });
const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog : handleDatalog} const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog : handleDatalog,cancel:handleCancel}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
@ -120,7 +121,7 @@
const visibleFlowRecordModal = ref(false); const visibleFlowRecordModal = ref(false);
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const formName=currentRoute.value.meta?.title const formName=currentRoute.value.meta?.title
const [registerTable, { reload, setTableData, getDataSource }] = useTable({ const [registerTable, { reload, setTableData, getDataSource,clearSelectedRowKeys }] = useTable({
title: '' || (formName + '列表'), title: '' || (formName + '列表'),
api: getLngPngSettleHdrPage, api: getLngPngSettleHdrPage,
rowKey: 'id', rowKey: 'id',
@ -298,7 +299,7 @@
} }
} }
function handleApprove () { function handleApprove (record: Recordable) {
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
if (taskIds && taskIds.length) { if (taskIds && taskIds.length) {
router.push({ router.push({
@ -312,6 +313,23 @@
}); });
} }
} }
function handleCancel () {
if (!selectedKeys.value.length) {
notification.warning({
message: '提示',
description: t('请选择需要取消结算的数据'),
});
return
}
cancelLngPngSettleHdr(selectedKeys.value).then((_) => {
handleSuccess();
notification.success({
message: 'Tip',
description: t('取消成功!'),
});
clearSelectedRowKeys()
});
}
function handleDelete(record: Recordable) { function handleDelete(record: Recordable) {
deleteList([record.id]); deleteList([record.id]);
} }