lng销售结算

This commit is contained in:
‘huanghaiixia’
2026-03-20 18:13:06 +08:00
parent 4d5bbd8188
commit d24e882e6c
8 changed files with 176 additions and 137 deletions

View File

@ -3,16 +3,50 @@ import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios'; import { ErrorMessageMode } from '/#/axios';
enum Api { enum Api {
Page = '/dayPlan/lngSettleHdr/page', // Page = '/dayPlan/lngSettleHdr/page',
Page = '/magic-api/dayPlan/lngSettleHdr/page',
List = '/dayPlan/lngSettleHdr/list', List = '/dayPlan/lngSettleHdr/list',
Info = '/dayPlan/lngSettleHdr/info', Info = '/dayPlan/lngSettleHdr/info',
LngLngSettleHdr = '/dayPlan/lngSettleHdr', 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<LngLngSettleHdrPageModel>(
{
url: Api.cancel,
data: ids,
},
{
errorMessageMode: mode,
},
);
}
export async function getLngLngSettleHdrMonth(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngSettleHdrPageModel>(
{
url: Api.getSettMonth,
params
},
{
errorMessageMode: mode,
},
);
}
export async function getLngLngSettleHdrPageAdd(params: LngLngSettleHdrPageParams, mode: ErrorMessageMode = 'modal') {
return defHttp.get<LngLngSettleHdrPageResult>(
{
url: Api.querySettList,
params,
},
{
errorMessageMode: mode,
},
);
}
/** /**
* @description: 查询LngLngSettleHdr分页列表 * @description: 查询LngLngSettleHdr分页列表
*/ */

View File

@ -4,16 +4,11 @@
@visible-change="handleVisibleChange" > @visible-change="handleVisibleChange" >
<div class="box"> <div class="box">
<a-checkbox class="checkItem" v-model:checked="checked" @change="checkChange">仅显示未结算</a-checkbox> <a-checkbox class="checkItem" v-model:checked="checked" @change="checkChange">仅显示未结算</a-checkbox>
<BasicTable @register="registerTable" class="measureListModal"> <BasicTable @register="registerTable" class="priceLngHdrListModal">
<template #bodyCell="{ column, record, index }"> <template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'settledSign'"> <template v-if="column.dataIndex === 'settledSign'">
{{ Number(record.settledSign) == 1 ? '已结算': '未结算' }} {{ Number(record.settledSign) == 1 ? '已结算': '未结算' }}
</template> </template>
<template v-if="column.dataIndex === 'file'">
<div v-for="item in (record.lngFileUploadList )" class="fileCSS">
<a @click="handleDownload(item)">{{item.fileOrg}}</a>
</div>
</template>
</template> </template>
</BasicTable> </BasicTable>
</div> </div>
@ -27,12 +22,10 @@
import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table'; import { BasicTable, useTable, FormSchema, BasicColumn, TableAction } from '/@/components/Table';
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 { 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 { 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({ const props = defineProps({
selectType: { type: String, default: 'checkbox' }, selectType: { type: String, default: 'checkbox' },
pageType: String pageType: String
@ -52,36 +45,12 @@
}, },
}, },
]; ];
let columnsNew = cloneDeep(columns)
const columns: BasicColumn[] = [ columnsNew.splice(-5,5)
{ dataIndex: 'datePlan', title: '计划日期', align: 'left', width: 100}, columnsNew.push(
{ dataIndex: 'dateMea', title: '计量日期', align: 'left',width: 100}, {dataIndex: 'kName',title: '销售合同',componentType: 'input',align: 'left',width: 180,sorter: true},
{ dataIndex: 'cuSname', title: '客户', align: 'left', }, {dataIndex: 'comName',title: '供应商',componentType: 'input',align: 'left',width: 180,sorter: true,},
{ dataIndex: 'pointDelyName', title: '下载点', align: 'left',}, { dataIndex: 'settledSign', title: '已结算', align: 'left',width: 100})
{ 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},
];
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
const { notification } = useMessage(); const { notification } = useMessage();
@ -101,9 +70,9 @@
const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,clearSelectedRowKeys }] = useTable({ const [registerTable, { getDataSource, setTableData, updateTableDataRecord, reload,clearSelectedRowKeys }] = useTable({
title: t('待结算记录'), title: t('待结算记录'),
api: props.pageType=='supplier'?getLngPngSettleHdrPageAddPur: getLngPngSettleHdrPageAdd, api: getLngLngSettleHdrPageAdd,
rowKey: props.pageType=='supplier' ? 'salesPurId': 'salesId', rowKey: 'salesId',
columns: props.pageType=='supplier' ? columnsPur: columns, columns: columnsNew,
bordered: true, bordered: true,
pagination: true, pagination: true,
@ -126,16 +95,6 @@
}, },
afterFetch: (res) => { afterFetch: (res) => {
tableData.value = 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: { rowSelection: {
type: props.selectType, type: props.selectType,
@ -147,8 +106,8 @@
(val) => { (val) => {
if (val) { if (val) {
let arr = DataFormat.format(val, [ let arr = DataFormat.format(val, [
FormatOption.createQty('qtyMeaGj'), FormatOption.createQty('qtyMeaGjSales'),
FormatOption.createQty('qtyMeaM3'), FormatOption.createQty('qtyMeaM3Sales'),
]); ]);
if (arr.length) { if (arr.length) {
setTableData(arr) setTableData(arr)
@ -170,11 +129,6 @@
const checkChange = (val) => { const checkChange = (val) => {
reload(); 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) { function onSelectChange(rowKeys: string[], e) {
selectedKeys.value = rowKeys; selectedKeys.value = rowKeys;
selectedValues.value = e selectedValues.value = e
@ -202,11 +156,11 @@
</script> </script>
<style > <style >
.measureListModal .basicCol{ .priceLngHdrListModal .basicCol{
position: inherit !important; position: inherit !important;
top: 0; top: 0;
} }
.measureListModal .ant-col-8 { .priceLngHdrListModal .ant-col-8 {
width: 450px !important; width: 450px !important;
max-width: 450px !important;; max-width: 450px !important;;
} }
@ -221,10 +175,4 @@
left: 17px; left: 17px;
z-index: 104; z-index: 104;
} }
.fileCSS a{
width: 100%;
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
}
</style> </style>

View File

@ -8,7 +8,7 @@
<span>结算总量(吉焦){{ numObj.qtySettleGjAll }}</span> <span>结算总量(吉焦){{ numObj.qtySettleGjAll }}</span>
<span>结算总金额(){{ numObj.amount }}</span> <span>结算总金额(){{ numObj.amount }}</span>
</div> </div>
<div class="price-box"> <div class="price-box" v-if="!disabled">
<div> <div>
<span class="btn-title">修改价格/吉焦</span> <span class="btn-title">修改价格/吉焦</span>
<a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model:value="formData.priceGj" placeholder="请输入" @search="editBtn('priceGj')"/> <a-input-search type="number" enter-button="批量修改" style="width: 200px" :min="0" v-model:value="formData.priceGj" placeholder="请输入" @search="editBtn('priceGj')"/>
@ -24,6 +24,21 @@
</div> </div>
<a-table :columns="columns" :data-source="dataList" :scroll="{x: 1800}" :rowKey="rowKey" :pagination="false" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }"> <a-table :columns="columns" :data-source="dataList" :scroll="{x: 1800}" :rowKey="rowKey" :pagination="false" :row-selection="{ selectedRowKeys: selectedKeys, onChange: onSelectChange }">
<template #bodyCell="{ column, record, index }"> <template #bodyCell="{ column, record, index }">
<template v-if="column.dataIndex === 'qtySettleGj'">
<input-number v-model:value="record.qtySettleGj" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'qtySettleTon'">
<input-number v-model:value="record.qtySettleTon" :disabled="disabled" :digits="3" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'priceGj'">
<input-number v-model:value="record.priceGj" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'priceTon'">
<input-number v-model:value="record.priceTon" :disabled="disabled" :digits="4" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'amount'">
<input-number v-model:value="record.amount" :disabled="disabled" :digits="2" :min="0" style="width: 100%" />
</template>
<template v-if="column.dataIndex === 'operation'"> <template v-if="column.dataIndex === 'operation'">
<a v-if="!disabled" @click="btnCheck(record, index, 'delete')">删除</a> <a v-if="!disabled" @click="btnCheck(record, index, 'delete')">删除</a>
</template> </template>
@ -45,7 +60,6 @@
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
import priceLngHdrListModal from '/@/components/common/priceLngHdrListModal.vue'; import priceLngHdrListModal from '/@/components/common/priceLngHdrListModal.vue';
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat'; import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
import { kStringMaxLength } from 'node:buffer';
const router = useRouter(); const router = useRouter();
const { t } = useI18n(); const { t } = useI18n();
@ -58,12 +72,12 @@ import { kStringMaxLength } from 'node:buffer';
{ title: t('计划日期'), dataIndex: 'datePlan', width:120}, { title: t('计划日期'), dataIndex: 'datePlan', width:120},
{ title: t('车头号'), dataIndex: 'noTractor', width:120}, { title: t('车头号'), dataIndex: 'noTractor', width:120},
{ title: t('挂车号'), dataIndex: 'noTrailer', width:120}, { title: t('挂车号'), dataIndex: 'noTrailer', width:120},
{ title: t('进厂皮重时间'), dataIndex: 'timeIn', width:120}, { title: t('进厂皮重时间'), dataIndex: 'timeIn', width:160},
{ title: t('出厂毛重时间'), dataIndex: 'timeOut', width:120}, { title: t('出厂毛重时间'), dataIndex: 'timeOut', width:160},
{ title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:120}, { title: t('装车量(吉焦)'), dataIndex: 'qtyMeaGj', width:140},
{ title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:120}, { title: t('装车量(吨)'), dataIndex: 'qtyMeaTon', width:140},
{ title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 140}, { title: t('结算量(吉焦)'), dataIndex: 'qtySettleGj', width: 150},
{ title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 130}, { title: t('结算量(吨)'), dataIndex: 'qtySettleTon', width: 140},
{ title: t('结算价格(元/吉焦)'), dataIndex: 'priceGj', width: 180}, { title: t('结算价格(元/吉焦)'), dataIndex: 'priceGj', width: 180},
{ title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 170}, { title: t('结算价格(元/吨)'), dataIndex: 'priceTon', width: 170},
{ title: t('结算金额(元)'), dataIndex: 'amount', width: 140}, { title: t('结算金额(元)'), dataIndex: 'amount', width: 140},
@ -95,7 +109,7 @@ import { kStringMaxLength } from 'node:buffer';
} }
dataList.value.forEach(v=> { dataList.value.forEach(v=> {
selectedKeys.value.forEach(i => { selectedKeys.value.forEach(i => {
if (v.id == i) { if (v.salesId == i) {
v[k] = formData[k] v[k] = formData[k]
} }
}) })
@ -109,7 +123,7 @@ import { kStringMaxLength } from 'node:buffer';
} }
let obj = { let obj = {
cpCode: props.formState.cpCode, cpCode: props.formState.cpCode,
comId: props.formState.comId // comId: props.formState.comId
} }
openModalHdr(true,{isUpdate: false, searchParams: obj}) openModalHdr(true,{isUpdate: false, searchParams: obj})
} else { } else {
@ -128,8 +142,8 @@ import { kStringMaxLength } from 'node:buffer';
} }
} }
const handleSuccessHdr = (val) => { const handleSuccessHdr = (val) => {
val.forEach(i =>{ val.forEach(v =>{
delete i.lngFileUploadList v.cpCode = v.cuCode
}) })
if (!dataList.value.length) { if (!dataList.value.length) {
dataList.value = val dataList.value = val
@ -171,11 +185,11 @@ import { kStringMaxLength } from 'node:buffer';
let amount = 0 let amount = 0
val.forEach(v => { val.forEach(v => {
if (Number(v.settleTimes) == 1){ if (Number(v.settleTimes) == 1){
qtySettleGjOne+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0 qtySettleGjOne+=Number(v.qtySettleGj || 0)
} else { } else {
qtySettleGjNum+=Number((v.qtySettleGj || '').replace(/,/g, '')) || 0 qtySettleGjNum+=Number(v.qtySettleGj || 0)
} }
amount+=Number((v.amount || '').replace(/,/g, '')) || 0 amount+=Number(v.amount|| 0)
}) })
numObj.value.qtySettleGjOne = qtySettleGjOne.toFixed(3) numObj.value.qtySettleGjOne = qtySettleGjOne.toFixed(3)
numObj.value.qtySettleGjNum = qtySettleGjNum.toFixed(3) numObj.value.qtySettleGjNum = qtySettleGjNum.toFixed(3)

View File

@ -18,7 +18,7 @@ export const searchFormSchema: FormSchema[] = [
}, },
}, },
{ {
field: 'cuName', field: 'cpName',
label: '客户', label: '客户',
component: 'Input', component: 'Input',
}, },
@ -30,7 +30,7 @@ export const columns: BasicColumn[] = [
title: '结算月', title: '结算月',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 100,
sorter: true, sorter: true,
}, },
@ -39,7 +39,7 @@ export const columns: BasicColumn[] = [
title: '结算月开始日期', title: '结算月开始日期',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },
@ -48,16 +48,16 @@ export const columns: BasicColumn[] = [
title: '结算月结束日期', title: '结算月结束日期',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },
{ {
dataIndex: 'cuSname', dataIndex: 'cpName',
title: '客户简称', title: '客户简称',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 140,
sorter: true, sorter: true,
}, },
@ -66,7 +66,7 @@ export const columns: BasicColumn[] = [
title: '结算总数量(吨)', title: '结算总数量(吨)',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 130,
sorter: true, sorter: true,
}, },
@ -75,7 +75,7 @@ export const columns: BasicColumn[] = [
title: '结算总金额(元)', title: '结算总金额(元)',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 130,
sorter: true, sorter: true,
}, },
@ -84,7 +84,7 @@ export const columns: BasicColumn[] = [
title: '交易主体', title: '交易主体',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 120,
sorter: true, sorter: true,
}, },
@ -93,7 +93,7 @@ export const columns: BasicColumn[] = [
title: '结算说明', title: '结算说明',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 150,
sorter: true, sorter: true,
}, },
@ -102,7 +102,7 @@ export const columns: BasicColumn[] = [
title: '附件', title: '附件',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 150,
sorter: true, sorter: true,
}, },
@ -111,7 +111,7 @@ export const columns: BasicColumn[] = [
title: '审批状态', title: '审批状态',
componentType: 'input', componentType: 'input',
align: 'left', align: 'left',
width: 80,
sorter: true, sorter: true,
}, },
]; ];

View File

@ -48,8 +48,8 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
<a-form-item label="结算总数量()" name="qtySettleM3"> <a-form-item label="结算总数量()" name="qtySettleTon">
<a-input v-model:value="formState.qtySettleM3" disabled/> <a-input v-model:value="formState.qtySettleTon" disabled/>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="8"> <a-col :span="8">
@ -98,7 +98,7 @@
import type { Rule } from 'ant-design-vue/es/form'; import type { Rule } from 'ant-design-vue/es/form';
import { getDictionary } from '/@/api/sales/Customer'; import { getDictionary } from '/@/api/sales/Customer';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import { addLngPngSettleHdr,updateLngPngSettleHdr, getLngPngSettleHdr, getLngPngSettleHdrDate} from '/@/api/dayPlan/PngSettleHdr'; import { addLngLngSettleHdr,updateLngLngSettleHdr, getLngLngSettleHdr,getLngLngSettleHdrMonth} from '/@/api/dayPlan/LngSettleHdr';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { getAppEnvConfig } from '/@/utils/env'; import { getAppEnvConfig } from '/@/utils/env';
import { message } from 'ant-design-vue'; import { message } from 'ant-design-vue';
@ -109,8 +109,8 @@
import { getAllCom} from '/@/api/contract/ContractPurInt'; import { getAllCom} from '/@/api/contract/ContractPurInt';
import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat'; import { DataFormat, FormatOption, DATE_FORMAT, FormatType } from '/@/utils/dataFormat';
const tableName = 'PngSettleHdr'; const tableName = 'LngSettleHdr';
const columnName = 'PngSettleHdr' const columnName = 'LngSettleHdr'
const formType = ref('2'); // 0 新建 1 修改 2 查看 const formType = ref('2'); // 0 新建 1 修改 2 查看
const formRef = ref(); const formRef = ref();
@ -196,20 +196,26 @@
}); });
const uploadChange = (val) => { const uploadChange = (val) => {
val.forEach(v=> {
v.tableId = ''
})
dataFileAccount.value = val dataFileAccount.value = val
} }
const uploadListChange = (val) => { const uploadListChange = (val) => {
val.forEach(v=> {
v.tableId = ''
})
dataFile.value = val dataFile.value = val
} }
async function getInfo(id) { async function getInfo(id) {
spinning.value = true spinning.value = true
try { try {
let data = await getLngPngSettleHdr(id) let data = await getLngLngSettleHdr(id)
spinning.value = false spinning.value = false
Object.assign(formState, {...data}) Object.assign(formState, {...data})
Object.assign(dataFile.value, formState.lngFileUploadList || []) Object.assign(dataFile.value, formState.lngFileUploadList || [])
Object.assign(dataFileAccount.value, formState.billList || []) Object.assign(dataFileAccount.value, formState.billList || [])
Object.assign(dataList.value, formState.lngPngSettleSalesList || []) Object.assign(dataList.value, formState.lngLngSettleList || [])
formState.settleMonth = formState.settleMonth ? dayjs(formState.settleMonth) : null formState.settleMonth = formState.settleMonth ? dayjs(formState.settleMonth) : null
formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null formState.dateFrom = formState.dateFrom ? dayjs(formState.dateFrom) : null
formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null formState.dateTo = formState.dateTo ? dayjs(formState.dateTo) : null
@ -222,7 +228,7 @@
const numFormat = () => { const numFormat = () => {
dataList.value = DataFormat.format(dataList.value, [ dataList.value = DataFormat.format(dataList.value, [
FormatOption.createQty('qtySettleGj'), FormatOption.createQty('qtySettleGj'),
FormatOption.createQty('qtySettleM3'), FormatOption.createQty('qtySettleTon'),
FormatOption.createQty('qtyMeaGj'), FormatOption.createQty('qtyMeaGj'),
FormatOption.createQty('qtyMeaM3'), FormatOption.createQty('qtyMeaM3'),
FormatOption.createAmt('amount'), FormatOption.createAmt('amount'),
@ -231,16 +237,16 @@
]); ]);
let obj = { let obj = {
qtySettleGj: formState.qtySettleGj, qtySettleGj: formState.qtySettleGj,
qtySettleM3: formState.qtySettleM3, qtySettleTon: formState.qtySettleTon,
amount: formState.amount amount: formState.amount
} }
let a = DataFormat.format({...obj}, [ let a = DataFormat.format({...obj}, [
FormatOption.createQty('qtySettleGj'), FormatOption.createQty('qtySettleGj'),
FormatOption.createQty('qtySettleM3'), FormatOption.createQty('qtySettleTon'),
FormatOption.createAmt('amount'), FormatOption.createAmt('amount'),
]); ]);
formState.qtySettleGj = a.qtySettleGj formState.qtySettleGj = a.qtySettleGj
formState.qtySettleM3 = a.qtySettleM3 formState.qtySettleTon = a.qtySettleTon
formState.amount = a.amount formState.amount = a.amount
} }
const settleChange = (val) => { const settleChange = (val) => {
@ -251,23 +257,23 @@
const numClear = () => { const numClear = () => {
if (!dataList.value.length) { if (!dataList.value.length) {
formState.qtySettleGj = '' formState.qtySettleGj = ''
formState.qtySettleM3 = '' formState.qtySettleTon = ''
formState.amount = '' formState.amount = ''
} }
} }
const tableCount = () => { const tableCount = () => {
let qtySettleGj = 0 let qtySettleGj = 0
let qtySettleM3 = 0 let qtySettleTon = 0
let amount = 0 let amount = 0
dataList.value.forEach(v => { dataList.value.forEach(v => {
if (Number(v.settleTimes) == 1){ if (Number(v.settleTimes) == 1){
qtySettleGj+=Number(v.qtySettleGj) || 0 qtySettleGj+=Number(v.qtySettleGj) || 0
qtySettleM3+=Number(v.qtySettleM3) || 0 qtySettleTon+=Number(v.qtySettleTon) || 0
} }
amount+=Number(v.amount) || 0 amount+=Number(v.amount) || 0
}) })
formState.qtySettleGj = qtySettleGj.toFixed(3) formState.qtySettleGj = qtySettleGj.toFixed(3)
formState.qtySettleM3 = qtySettleM3.toFixed(3) formState.qtySettleTon = qtySettleTon.toFixed(3)
formState.amount = amount.toFixed(2) formState.amount = amount.toFixed(2)
numFormat() numFormat()
} }
@ -280,12 +286,11 @@
cpCode: formState.cpCode, cpCode: formState.cpCode,
comId: formState.comId comId: formState.comId
} }
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) { if (formState.cpCode && formState.comId && !formState.dateFrom) {
let data = await getLngPngSettleHdrDate(obj) || [] let data = await getLngLngSettleHdrMonth(obj) || []
if (data.length) { formState.dateFrom = data?.dateFrom ? dayjs(data?.dateFrom) : null
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null formState.dateTo = null
formState.dateTo = null
}
} }
}) })
async function getOption() { async function getOption() {
@ -333,10 +338,10 @@
...formState, ...formState,
lngFileUploadList: dataFile.value, lngFileUploadList: dataFile.value,
billList: dataFileAccount.value, billList: dataFileAccount.value,
lngPngSettleSalesList: dataList.value, lngLngSettleList: dataList.value,
} }
spinning.value = true; spinning.value = true;
let request = !formState.id ? addLngPngSettleHdr :updateLngPngSettleHdr let request = !formState.id ? addLngLngSettleHdr :updateLngLngSettleHdr
try { try {
const data = await request(obj); const data = await request(obj);
@ -347,7 +352,7 @@
// 同意保存不提示 // 同意保存不提示
if (!type) { if (!type) {
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: data?.id ? t('新增成功!') : t('修改成功!') description: data?.id ? t('新增成功!') : t('修改成功!')
}); //提示消息 }); //提示消息
} }

View File

@ -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 { getLngLngSettleHdrPage, deleteLngLngSettleHdr} from '/@/api/dayPlan/LngSettleHdr'; import { getLngLngSettleHdrPage, deleteLngLngSettleHdr,cancelLngSettleHdr} from '/@/api/dayPlan/LngSettleHdr';
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';
@ -82,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":"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":"check","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"取消对账单","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":false},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":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":"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":"check","icon":"ant-design:check-outlined","isDefault":false},{"isUse":true,"name":"数据日志","code":"datalog","icon":"ant-design:profile-outlined","isDefault":true},{"isUse":true,"name":"取消对账单","code":"cancel","icon":"ant-design:rollback-outlined","isDefault":true},{"isUse":true,"name":"删除","code":"delete","icon":"ant-design:delete-outlined","isDefault":true},{"isUse":true,"name":"刷新","code":"refresh","icon":"ant-design:reload-outlined","isDefault":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(()=>{
@ -97,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,} const btnEvent = {add : handleAdd,edit : handleEdit,refresh : handleRefresh,view : handleView,startwork : handleStartwork,flowRecord : handleFlowRecord,approve : handleApprove,delete : handleDelete,datalog: handleDatalog, cancel: handelCancel}
const { currentRoute } = useRouter(); const { currentRoute } = useRouter();
const router = useRouter(); const router = useRouter();
@ -115,11 +115,13 @@
const draftsId = ref(); const draftsId = ref();
const visibleApproveProcessRef = ref(false); const visibleApproveProcessRef = ref(false);
const tableData = ref([])
const selectedKeys = ref([])
const taskIdRef = ref(''); const taskIdRef = ref('');
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 }] = useTable({ const [registerTable, { reload, setTableData,clearSelectedRowKeys }] = useTable({
title: '' || (formName + '列表'), title: '' || (formName + '列表'),
api: getLngLngSettleHdrPage, api: getLngLngSettleHdrPage,
rowKey: 'id', rowKey: 'id',
@ -150,6 +152,10 @@
dataIndex: 'action', dataIndex: 'action',
slots: { customRender: 'action' }, slots: { customRender: 'action' },
}, },
rowSelection: {
type: 'checkbox',
onChange: onSelectChange
},
tableSetting: { tableSetting: {
size: false, size: false,
setting: false, setting: false,
@ -174,6 +180,9 @@
deep: true, deep: true,
} }
); );
function onSelectChange(rowKeys: string[]) {
selectedKeys.value = rowKeys;
}
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);
const fileName = info.response ? info.response.data.fileOrg : info.fileOrg; const fileName = info.response ? info.response.data.fileOrg : info.fileOrg;
@ -235,6 +244,22 @@
btnEvent[code](); btnEvent[code]();
} }
async function handelCancel() {
if(!selectedKeys.value.length) {
notification.warning({
message: '提示',
description: t('请选择需要取消对账的数据'),
});
return
}
await cancelLngSettleHdr(selectedKeys.value)
handleSuccess();
notification.success({
message: '提示',
description: t('取消成功!'),
});
clearSelectedRowKeys()
}
function handleDatalog (record: Recordable) { function handleDatalog (record: Recordable) {
modalVisible.value = true modalVisible.value = true
logId.value = record.id logId.value = record.id
@ -262,17 +287,30 @@
} }
function handleEdit(record: Recordable) { function handleEdit(record: Recordable) {
if (schemaIdComputedRef.value) {
router.push({ router.push({
path: '/form/LngSettleHdr/' + record.id + '/updateForm', path: '/flow/' + schemaIdComputedRef.value + '/0/createFlow',
query: { query: {
formPath: 'dayPlan/LngSettleHdr', formPath: 'dayPlan/LngSettleHdr',
formName: "编辑"+formName, formName: "编辑"+formName,
formId:currentRoute.value.meta.formId, formId:currentRoute.value.meta.formId,
type:'edit', type:'edit',
id: record.id id: record.id
} }
}); });
} else {
router.push({
path: '/form/LngSettleHdr/' + record.id + '/updateForm',
query: {
formPath: 'dayPlan/LngSettleHdr',
formName: "编辑"+formName,
formId:currentRoute.value.meta.formId,
type:'edit',
id: record.id
}
});
}
} }
function handleApprove () { function handleApprove () {
const { processId, taskIds, schemaId } = record.workflowData || {}; const { processId, taskIds, schemaId } = record.workflowData || {};
@ -302,7 +340,7 @@
deleteLngLngSettleHdr(ids).then((_) => { deleteLngLngSettleHdr(ids).then((_) => {
handleSuccess(); handleSuccess();
notification.success({ notification.success({
message: 'Tip', message: '提示',
description: t('删除成功!'), description: t('删除成功!'),
}); });
}); });

View File

@ -288,7 +288,7 @@
cpCode: formState.cpCode, cpCode: formState.cpCode,
comId: formState.comId comId: formState.comId
} }
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) { if ( formState.cpCode && formState.comId && !formState.dateFrom) {
let data = await getLngPngSettleHdrDate(obj) || [] let data = await getLngPngSettleHdrDate(obj) || []
if (data.length) { if (data.length) {
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null

View File

@ -288,7 +288,7 @@
cpCode: formState.cpCode, cpCode: formState.cpCode,
comId: formState.comId comId: formState.comId
} }
if (!pageId.value && formState.cpCode && formState.comId && !formState.dateFrom) { if ( formState.cpCode && formState.comId && !formState.dateFrom) {
let data = await getLngPngSettleHdrDate(obj) || [] let data = await getLngPngSettleHdrDate(obj) || []
if (data.length) { if (data.length) {
formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null formState.dateFrom = data[0]?.dateTo ? dayjs(data[0]?.dateTo) : null