销售结算接口
This commit is contained in:
@ -3,17 +3,29 @@ import { defHttp } from '/@/utils/http/axios';
|
||||
import { ErrorMessageMode } from '/#/axios';
|
||||
|
||||
enum Api {
|
||||
Page = '/dayPlan/pngSettleHdrEc/page',
|
||||
// Page = '/dayPlan/pngSettleHdrEc/page',
|
||||
Page = '/magic-api/dayPlan//pngSettleSalesHdrEcPage',
|
||||
List = '/dayPlan/pngSettleHdrEc/list',
|
||||
Info = '/dayPlan/pngSettleHdrEc/info',
|
||||
LngPngSettleHdr = '/dayPlan/pngSettleHdrEc',
|
||||
uploadBill = '/dayPlan/pngSettleHdrEc/uploadBill',
|
||||
|
||||
|
||||
|
||||
|
||||
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分页列表
|
||||
*/
|
||||
|
||||
@ -414,6 +414,7 @@
|
||||
await formRef.value.validateFields();
|
||||
let tipNum = 0
|
||||
let list = cloneDeep(dataList.value)
|
||||
list.sort((a, b) => Number(a.sort) - Number(b.sort));
|
||||
for(let i=0;i<list.length;i++) {
|
||||
list[i].lngContractSalesPngPointTransList = list[i].lngContractSalesPngPointTransList || []
|
||||
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].ksId = formStateContract.kId
|
||||
}
|
||||
list[i].sort = i+1
|
||||
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].dateTo = list[i].lngContractSalesPngPointTransList[j].dateTo ? dayjs(list[i].lngContractSalesPngPointTransList[j].dateTo).format('YYYY-MM-DD HH:mm:ss') : null
|
||||
|
||||
@ -26,7 +26,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算月',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 100,
|
||||
width: 80,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -53,7 +53,7 @@ export const columns: BasicColumn[] = [
|
||||
title: '结算说明',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 150,
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -85,11 +85,11 @@ export const columns: BasicColumn[] = [
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'comId',
|
||||
dataIndex: 'comName',
|
||||
title: '交易主体',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 120,
|
||||
width: 100,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
@ -98,16 +98,16 @@ export const columns: BasicColumn[] = [
|
||||
title: '备注',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 130,
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
{
|
||||
dataIndex: 'lngFileUploadList',
|
||||
title: '附件',
|
||||
dataIndex: 'billList',
|
||||
title: '对账单',
|
||||
componentType: 'input',
|
||||
align: 'left',
|
||||
width: 130,
|
||||
width: 120,
|
||||
sorter: true,
|
||||
},
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<PageWrapper dense fixedHeight contentFullHeight contentClass="flex">
|
||||
<a-spin :spinning="spinning" tip="加载中...">
|
||||
<BasicTable @register="registerTable" ref="tableRef" @row-dbClick="dbClickRow">
|
||||
|
||||
<template #toolbar>
|
||||
@ -14,21 +15,22 @@
|
||||
</a-button>
|
||||
</template>
|
||||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template #bodyCell="{ column, record,index }">
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<TableAction :actions="getActions(record)" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'lngFileUploadList'">
|
||||
<template v-if="column.dataIndex === 'billList'">
|
||||
<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"/>
|
||||
<div v-for="(item, idx) in record.lngFileUploadList">
|
||||
<div v-for="(item, idx) in record.billList">
|
||||
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
</BasicTable>
|
||||
</a-spin>
|
||||
<PngSettleHdrEcModal @register="registerModal" @success="handleSuccess" />
|
||||
<DataLog :logId="logId" :logPath="logPath" v-model:visible="modalVisible"/>
|
||||
</PageWrapper>
|
||||
@ -41,7 +43,7 @@
|
||||
import { ref, computed, onMounted, onUnmounted, watch } from 'vue';
|
||||
|
||||
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 { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useI18n } from '/@/hooks/web/useI18n';
|
||||
@ -60,10 +62,15 @@
|
||||
import Upload from '/@/components/Form/src/components/Upload.vue';
|
||||
import { parseDownloadUrl} from '/@/api/system/file';
|
||||
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 tableName = 'PngSettleHdrEc';
|
||||
const columnName = 'PngSettleHdrEc';
|
||||
const spinning = ref(false)
|
||||
|
||||
const { bus, CREATE_FLOW, FLOW_PROCESSED, FORM_LIST_MODIFIED } = useEventBus();
|
||||
|
||||
@ -119,8 +126,9 @@
|
||||
fieldMapToTime: [['datePlan', ['startDate', 'endDate'], 'YYYY-MM']],
|
||||
showResetButton: true,
|
||||
},
|
||||
immediate: false,
|
||||
beforeFetch: (params) => {
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id' };
|
||||
return { ...params, FormId: formIdComputedRef.value, PK: 'id',page: params.limit,cuCode:curCuCode.value };
|
||||
},
|
||||
afterFetch: (res) => {
|
||||
tableData.value = res || []
|
||||
@ -131,6 +139,12 @@
|
||||
showTableSetting: true,
|
||||
|
||||
striped: false,
|
||||
actionColumn: {
|
||||
width: 60,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
slots: { customRender: 'action' },
|
||||
},
|
||||
tableSetting: {
|
||||
size: false,
|
||||
setting: false,
|
||||
@ -159,11 +173,18 @@
|
||||
const onUpload = (index) => {
|
||||
curIdx.value = index
|
||||
}
|
||||
const uploadChange = (val) => {
|
||||
const uploadChange = async (val) => {
|
||||
let data = getDataSource()
|
||||
let record = data[curIdx.value]
|
||||
record.lngFileUploadList = val
|
||||
updateTableDataRecord(record.id, record)
|
||||
spinning.value = true
|
||||
try {
|
||||
let obj = {"id":record.id,"billList":val}
|
||||
await uploadBill(obj)
|
||||
reload()
|
||||
spinning.value = false
|
||||
} catch (error) {
|
||||
spinning.value = false
|
||||
}
|
||||
}
|
||||
const handleDownload = (info) => {
|
||||
const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl);
|
||||
@ -221,8 +242,10 @@
|
||||
|
||||
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) {
|
||||
bus.on(FLOW_PROCESSED, handleRefresh);
|
||||
bus.on(CREATE_FLOW, handleRefresh);
|
||||
|
||||
Reference in New Issue
Block a user