销售结算接口

This commit is contained in:
‘huanghaiixia’
2026-04-08 15:04:23 +08:00
parent dc58c91b67
commit a29e4faeac
4 changed files with 63 additions and 26 deletions

View File

@ -3,17 +3,29 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
enum Api { enum Api {
Page = '/dayPlan/pngSettleHdrEc/page', // Page = '/dayPlan/pngSettleHdrEc/page',
Page = '/magic-api/dayPlan//pngSettleSalesHdrEcPage',
List = '/dayPlan/pngSettleHdrEc/list', List = '/dayPlan/pngSettleHdrEc/list',
Info = '/dayPlan/pngSettleHdrEc/info', Info = '/dayPlan/pngSettleHdrEc/info',
LngPngSettleHdr = '/dayPlan/pngSettleHdrEc', LngPngSettleHdr = '/dayPlan/pngSettleHdrEc',
uploadBill = '/dayPlan/pngSettleHdrEc/uploadBill',
DataLog = '/dayPlan/pngSettleHdrEc/datalog', DataLog = '/dayPlan/pngSettleHdrEc/datalog',
} }
export async function uploadBill(lngPngSettleHdr: Recordable, mode: ErrorMessageMode = 'modal') {
return defHttp.post<boolean>(
{
url: Api.uploadBill,
params:lngPngSettleHdr,
},
{
errorMessageMode: mode,
},
);
}
/** /**
* @description: 查询LngPngSettleHdr分页列表 * @description: 查询LngPngSettleHdr分页列表
*/ */

View File

@ -414,6 +414,7 @@
await formRef.value.validateFields(); await formRef.value.validateFields();
let tipNum = 0 let tipNum = 0
let list = cloneDeep(dataList.value) let list = cloneDeep(dataList.value)
list.sort((a, b) => Number(a.sort) - Number(b.sort));
for(let i=0;i<list.length;i++) { for(let i=0;i<list.length;i++) {
list[i].lngContractSalesPngPointTransList = list[i].lngContractSalesPngPointTransList || [] list[i].lngContractSalesPngPointTransList = list[i].lngContractSalesPngPointTransList || []
list[i].dateFrom = list[i].dateFrom ? dayjs(list[i].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null list[i].dateFrom = list[i].dateFrom ? dayjs(list[i].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
@ -435,6 +436,7 @@
list[i].pointDelyCode = formState.pointDelyCode list[i].pointDelyCode = formState.pointDelyCode
list[i].ksId = formStateContract.kId list[i].ksId = formStateContract.kId
} }
list[i].sort = i+1
for(let j = 0; j<list[i].lngContractSalesPngPointTransList.length;j++) { for(let j = 0; j<list[i].lngContractSalesPngPointTransList.length;j++) {
list[i].lngContractSalesPngPointTransList[j].dateFrom = list[i].lngContractSalesPngPointTransList[j].dateFrom ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null list[i].lngContractSalesPngPointTransList[j].dateFrom = list[i].lngContractSalesPngPointTransList[j].dateFrom ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateFrom).format('YYYY-MM-DD HH:mm:ss') : null
list[i].lngContractSalesPngPointTransList[j].dateTo = list[i].lngContractSalesPngPointTransList[j].dateTo ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateTo).format('YYYY-MM-DD HH:mm:ss') : null list[i].lngContractSalesPngPointTransList[j].dateTo = list[i].lngContractSalesPngPointTransList[j].dateTo ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateTo).format('YYYY-MM-DD HH:mm:ss') : null

View File

@ -26,7 +26,7 @@ export const columns: BasicColumn[] = [
title: '结算月', title: '结算月',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100, width: 80,
sorter: true, sorter: true,
}, },
@ -53,7 +53,7 @@ export const columns: BasicColumn[] = [
title: '结算说明', title: '结算说明',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 150, width: 120,
sorter: true, sorter: true,
}, },
@ -85,11 +85,11 @@ export const columns: BasicColumn[] = [
}, },
{ {
dataIndex: 'comId', dataIndex: 'comName',
title: '交易主体', title: '交易主体',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120, width: 100,
sorter: true, sorter: true,
}, },
@ -98,16 +98,16 @@ export const columns: BasicColumn[] = [
title: '备注', title: '备注',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 130, width: 120,
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'lngFileUploadList', dataIndex: 'billList',
title: '附件', title: '对账单',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 130, width: 120,
sorter: true, sorter: true,
}, },

View File

@ -1,5 +1,6 @@
<template> <template>
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex"> <PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
<a-spin :spinning="spinning" tip="加载中...">
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow"> <BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
<template #toolbar> <template #toolbar>
@ -14,21 +15,22 @@
</a-button> </a-button>
</template> </template>
</template> </template>
<template #bodyCell="{ column, record }"> <template #bodyCell="{ column, record,index }">
<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> <div>
<Upload :file-list="record.lngFileUploadList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName" <Upload :file-list="record.billList" :showUploadList="false" v-model:value="tableId" v-model:tableName="tableName" v-model:columnName="columnName"
:multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/> :multiple="true" :dataDelete="true" :isShowTip="false" :isShowBtnIcon="false" @click="onUpload(index)" @change="uploadChange" :showDownloadIcon="false"/>
<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>
</div> </div>
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
</a-spin>
<PngSettleHdrEcModal @register="registerModal" @success="handleSuccess" /> <PngSettleHdrEcModal @register="registerModal" @success="handleSuccess" />
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/> <DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
</PageWrapper> </PageWrapper>
@ -41,7 +43,7 @@
import { ref, computed, onMounted, onUnmounted, watch } from 'vue'; import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table'; import { BasicTable, useTable, TableAction, ActionItem } from '/@/components/Table';
import { getLngPngSettleHdrPage, deleteLngPngSettleHdr} from '/@/api/dayPlan/PngSettleHdrEc'; import { getLngPngSettleHdrPage, deleteLngPngSettleHdr,uploadBill} from '/@/api/dayPlan/PngSettleHdrEc';
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';
@ -60,10 +62,15 @@
import Upload from '/@/components/Form/src/components/Upload.vue'; import Upload from '/@/components/Form/src/components/Upload.vue';
import { parseDownloadUrl} from '/@/api/system/file'; import { parseDownloadUrl} from '/@/api/system/file';
import { downloadByUrl } from '/@/utils/file/download'; import { downloadByUrl } from '/@/utils/file/download';
import { getCompDept } from '/@/api/approve/Appro';
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const userInfo = userStore.getUserInfo;
const curCuCode = ref('')
const tableId = ''; const tableId = '';
const tableName = 'PngSettleHdrEc'; const tableName = 'PngSettleHdrEc';
const columnName = 'PngSettleHdrEc'; const columnName = 'PngSettleHdrEc';
const spinning = ref(false)
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus(); const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
@ -119,8 +126,9 @@
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM']], fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM']],
showResetButton: true, showResetButton: true,
}, },
immediate: false,
beforeFetch: (params) => { beforeFetch: (params) => {
return { ...params, FormId: formIdComputedRef.value, PK: 'id' }; return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit,cuCode:curCuCode.value };
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableData.value = res || [] tableData.value = res || []
@ -131,6 +139,12 @@
showTableSetting: true, showTableSetting: true,
striped: false, striped: false,
actionColumn: {
width: 60,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
},
tableSetting: { tableSetting: {
size: false, size: false,
setting: false, setting: false,
@ -159,11 +173,18 @@
const onUpload = (index) => { const onUpload = (index) => {
curIdx.value = index curIdx.value = index
} }
const uploadChange = (val) => { const uploadChange = async (val) => {
let data = getDataSource() let data = getDataSource()
let record = data[curIdx.value] let record = data[curIdx.value]
record.lngFileUploadList = val spinning.value = true
updateTableDataRecord(record.id, record) try {
let obj = {"id":record.id,"billList":val}
await uploadBill(obj)
reload()
spinning.value = false
} catch (error) {
spinning.value = false
}
} }
const handleDownload = (info) => { const handleDownload = (info) => {
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl); const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
@ -221,8 +242,10 @@
reload(); reload();
} }
onMounted(() => { onMounted(async() => {
const res = await getCompDept(userInfo.id)
curCuCode.value = res?.comp?.cuCode
reload({searchInfo:{'limit':1,'size':10,'page':1}});
if (schemaIdComputedRef.value) { if (schemaIdComputedRef.value) {
bus.on(FLOW_PROCESSED, handleRefresh); bus.on(FLOW_PROCESSED, handleRefresh);
bus.on(CREATE_FLOW, handleRefresh); bus.on(CREATE_FLOW, handleRefresh);