调整预结算、正式结算
This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
v-if="hasPermission('pre_settlement_formal')"
|
||||
type="primary"
|
||||
plain
|
||||
disabled
|
||||
:disabled="!selection.length"
|
||||
@click="handleFormalSettlement"
|
||||
>
|
||||
尾款结算
|
||||
@@ -315,7 +315,6 @@ import {
|
||||
applyAdvance,
|
||||
approve,
|
||||
exportList,
|
||||
formalSettlement,
|
||||
getDetail,
|
||||
getList,
|
||||
getPrintTemplates,
|
||||
@@ -325,6 +324,7 @@ import {
|
||||
} from '@/api/settlement/preSettlement';
|
||||
import { preSettlementSearchFields } from '@/option/settlement/preSettlementSearch';
|
||||
import { preSettlementTableColumns } from '@/option/settlement/preSettlementTable';
|
||||
import { createSettlementTransfer } from '@/utils/settlement-transfer';
|
||||
import { downloadFile } from '@/utils/util';
|
||||
import PreSettlementEditor from './components/pre-settlement-editor.vue';
|
||||
|
||||
@@ -535,23 +535,37 @@ export default {
|
||||
this.advanceDialog.submitting = false;
|
||||
}
|
||||
},
|
||||
async handleFormalSettlement() {
|
||||
const row = this.selectedOne('尾款结算');
|
||||
if (!row) return;
|
||||
if (
|
||||
row.approvalStatus !== 'approved' ||
|
||||
row.settlementType !== 'payable' ||
|
||||
row.formalSettlementNo
|
||||
) {
|
||||
this.$message.warning('仅审批通过、未转正式结算的应付预结算单可发起尾款结算');
|
||||
handleFormalSettlement() {
|
||||
if (!this.selection.length) {
|
||||
this.$message.warning('请选择需要转正式结算的预结算单');
|
||||
return;
|
||||
}
|
||||
await this.$confirm('转正式结算后无法发起预付,确认继续?', '提示', {
|
||||
type: 'warning',
|
||||
if (this.selection.some(row => row.approvalStatus !== 'approved')) {
|
||||
this.$message.warning('仅审核通过的预结算单可转正式结算');
|
||||
return;
|
||||
}
|
||||
const hasCompleteProjectIds = this.selection.every(
|
||||
row => row.projectId !== undefined && row.projectId !== null && row.projectId !== ''
|
||||
);
|
||||
const projectKeys = new Set(
|
||||
this.selection.map(row =>
|
||||
hasCompleteProjectIds ? String(row.projectId) : String(row.projectName || '')
|
||||
)
|
||||
);
|
||||
if (projectKeys.size > 1) {
|
||||
this.$message.warning('尾款结算只能选择同一项目下的预结算单');
|
||||
return;
|
||||
}
|
||||
const transferToken = createSettlementTransfer({
|
||||
sourcePreSettlements: this.selection.map(row => ({
|
||||
...row,
|
||||
preSettlementId: row.preSettlementId || row.id,
|
||||
})),
|
||||
});
|
||||
this.$router.push({
|
||||
path: '/settlement/formal-settlement/form',
|
||||
query: { mode: 'add', name: '新增正式结算', transferToken },
|
||||
});
|
||||
const { data } = await formalSettlement(row.id);
|
||||
this.$message.success(`正式结算单已生成:${data?.data || ''}`);
|
||||
this.loadTable();
|
||||
},
|
||||
async openPrintDialog() {
|
||||
const row = this.selectedOne('打印结算单');
|
||||
|
||||
Reference in New Issue
Block a user