diff --git a/src/api/dayPlan/LngSettleHdr/index.ts b/src/api/dayPlan/LngSettleHdr/index.ts index d6d4a65..e1cf200 100644 --- a/src/api/dayPlan/LngSettleHdr/index.ts +++ b/src/api/dayPlan/LngSettleHdr/index.ts @@ -3,16 +3,50 @@ import { defHttp } from '/@/utils/http/axios'; import { ErrorMessageMode } from '/#/axios'; enum Api { - Page = '/dayPlan/lngSettleHdr/page', + // Page = '/dayPlan/lngSettleHdr/page', + Page = '/magic-api/dayPlan/lngSettleHdr/page', List = '/dayPlan/lngSettleHdr/list', Info = '/dayPlan/lngSettleHdr/info', LngLngSettleHdr = '/dayPlan/lngSettleHdr', - - + querySettList = '/magic-api/dayPlan/querySettList', + cancel = '/dayPlan/lngSettleHdr/cancel', + getSettMonth = '/magic-api/dayPlan/getSettMonth' } - +export async function cancelLngSettleHdr(ids: string[], mode: ErrorMessageMode = 'modal') { + return defHttp.post( + { + url: Api.cancel, + data: ids, + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getLngLngSettleHdrMonth(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.getSettMonth, + params + }, + { + errorMessageMode: mode, + }, + ); +} +export async function getLngLngSettleHdrPageAdd(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') { + return defHttp.get( + { + url: Api.querySettList, + params, + }, + { + errorMessageMode: mode, + }, + ); +} /** * @description: 查询LngLngSettleHdr分页列表 */ diff --git a/src/components/common/priceLngHdrListModal.vue b/src/components/common/priceLngHdrListModal.vue index 43cd34c..348f33d 100644 --- a/src/components/common/priceLngHdrListModal.vue +++ b/src/components/common/priceLngHdrListModal.vue @@ -4,16 +4,11 @@ @visible-change="handleVisibleChange" >
仅显示未结算 - +
@@ -27,12 +22,10 @@ import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table'; import { useMessage } from '/@/hooks/web/useMessage'; import { useI18n } from '/@/hooks/web/useI18n'; - import { getLngPngSettleHdrPageAdd} from '/@/api/dayPlan/PngSettleHdr'; - import { getLngPngSettleHdrPageAddPur} from '/@/api/dayPlan/PngSettleHdrPur' - import { parseDownloadUrl} from '/@/api/system/file'; - import { downloadByUrl } from '/@/utils/file/download'; import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat'; - + import { getLngLngSettleHdrPageAdd, } from '/@/api/dayPlan/LngSettleHdr'; + import {formConfig, searchFormSchema, columns } from '/@/views/dayPlan/LngMeasurePur/components/config'; + import { cloneDeep } from 'lodash-es'; const props = defineProps({ selectType: { type: String, default: 'checkbox' }, pageType: String @@ -52,36 +45,12 @@ }, }, ]; - - const columns: BasicColumn[] = [ - { dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100}, - { dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100}, - { dataIndex: 'cuSname', title: '客户', align: 'left', }, - { dataIndex: 'pointDelyName', title: '下载点', align: 'left',}, - { dataIndex: 'comName', title: '交易主体', align: 'left',}, - { dataIndex: 'qtyMeaSalesGj', title: '完成量(吉焦)', align: 'left',width: 120}, - { dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120}, - { dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120}, - { dataIndex: 'ksName', title: '销售合同', align: 'left',}, - { dataIndex: 'file', title: '附件', align: 'left',width: 200}, - { dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100}, - ]; - const columnsPur: BasicColumn[] = [ - { dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100}, - { dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100}, - { dataIndex: 'suSname', title: '供应商', align: 'left', }, - { dataIndex: 'pointUpName', title: '上载点', align: 'left',}, - { dataIndex: 'cuSname', title: '客户', align: 'left',}, - { dataIndex: 'pointDelyName', title: '下载点', align: 'left',}, - { dataIndex: 'comName', title: '交易主体', align: 'left',}, - { dataIndex: 'qtyMeaPurGj', title: '完成量(吉焦)', align: 'left',width: 120}, - { dataIndex: 'qtyMeaPurM3', title: '完成量(方)', align: 'left',width: 120}, - { dataIndex: 'rateM3Gj', title: '比值(方/吉焦)', align: 'left',width: 120}, - { dataIndex: 'kpName', title: '采购合同', align: 'left',}, - { dataIndex: 'file', title: '附件', align: 'left',width: 200}, - { dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100}, - ]; - + let columnsNew = cloneDeep(columns) + columnsNew.splice(-5,5) + columnsNew.push( + {dataIndex: 'kName',title: '销售合同',componentType: 'input',align: 'left',width: 180,sorter: true}, + {dataIndex: 'comName',title: '供应商',componentType: 'input',align: 'left',width: 180,sorter: true,}, + { dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100}) const emit = defineEmits(['success', 'register']); const { notification } = useMessage(); @@ -101,9 +70,9 @@ const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,clearSelectedRowKeys }] = useTable({ title: t('待结算记录'), - api: props.pageType=='supplier'?getLngPngSettleHdrPageAddPur: getLngPngSettleHdrPageAdd, - rowKey: props.pageType=='supplier' ? 'salesPurId': 'salesId', - columns: props.pageType=='supplier' ? columnsPur: columns, + api: getLngLngSettleHdrPageAdd, + rowKey: 'salesId', + columns: columnsNew, bordered: true, pagination: true, @@ -126,16 +95,6 @@ }, afterFetch: (res) => { tableData.value = res || [] - tableData.value.forEach(v => { - let a = v.attachList ? v.attachList.split(',') : [] - v.lngFileUploadList = [] - a.forEach(k => { - v.lngFileUploadList.push({ - fileOrg: k.split('@')[0], - fileUrl: k.split('@')[1] - }) - }) - }) }, rowSelection: { type: props.selectType, @@ -147,8 +106,8 @@ (val) => { if (val) { let arr = DataFormat.format(val, [ - FormatOption.createQty('qtyMeaGj'), - FormatOption.createQty('qtyMeaM3'), + FormatOption.createQty('qtyMeaGjSales'), + FormatOption.createQty('qtyMeaM3Sales'), ]); if (arr.length) { setTableData(arr) @@ -170,11 +129,6 @@ const checkChange = (val) => { reload(); } - const handleDownload = (info) => { - const url = parseDownloadUrl(info.response ? info.response.data.fileUrl : info.fileUrl); - const fileName = info.response ? info.response.data.fileOrg : info.fileOrg; - downloadByUrl({ url, fileName: fileName}); - }; function onSelectChange(rowKeys: string[], e) { selectedKeys.value = rowKeys; selectedValues.value = e @@ -202,11 +156,11 @@ diff --git a/src/components/common/settleLngHdrList.vue b/src/components/common/settleLngHdrList.vue index 96bf906..f1225f1 100644 --- a/src/components/common/settleLngHdrList.vue +++ b/src/components/common/settleLngHdrList.vue @@ -8,7 +8,7 @@ 结算总量(吉焦):{{ numObj.qtySettleGjAll }} 结算总金额(元):{{ numObj.amount }} -
+
修改价格/吉焦 @@ -24,6 +24,21 @@