1、调整业务模块
This commit is contained in:
@@ -140,23 +140,14 @@
|
||||
></el-col>
|
||||
<el-col v-if="billPayment" :span="6"
|
||||
><el-form-item label="汇票单号" prop="billLedgerId"
|
||||
><el-select
|
||||
v-model="form.billLedgerId"
|
||||
><el-input
|
||||
v-model="form.billNo"
|
||||
readonly
|
||||
:disabled="readonly"
|
||||
filterable
|
||||
remote
|
||||
reserve-keyword
|
||||
:remote-method="loadBillOptions"
|
||||
:loading="billLoading"
|
||||
placeholder="请选择可用汇票"
|
||||
@change="handleBillChange"
|
||||
><el-option
|
||||
v-for="item in billOptions"
|
||||
:key="item.id"
|
||||
:label="`${item.billNo}|余额${formatMoney(item.availableBalance)}|${
|
||||
item.maturityDate
|
||||
}`"
|
||||
:value="item.id" /></el-select></el-form-item
|
||||
><template #append
|
||||
><el-button :disabled="readonly" @click="openBillDialog">选择</el-button></template
|
||||
></el-input></el-form-item
|
||||
></el-col>
|
||||
<el-col :span="6"
|
||||
><el-form-item label="收款方"
|
||||
@@ -501,6 +492,54 @@
|
||||
</el-tab-pane>
|
||||
</el-tabs></div
|
||||
></el-dialog>
|
||||
<el-dialog v-model="billDialogVisible" title="选择汇票" width="80%" append-to-body>
|
||||
<div class="payment-form-page__reference-search">
|
||||
<el-form :model="billQuery" label-position="right" label-width="160px" @submit.prevent>
|
||||
<div class="payment-form-page__reference-search-fields">
|
||||
<el-form-item label="汇票筛选">
|
||||
<el-input
|
||||
v-model="billQuery.keyword"
|
||||
clearable
|
||||
placeholder="请输入汇票号、出票单位或收票单位"
|
||||
@keyup.enter="handleBillSearch"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="payment-form-page__reference-search-actions">
|
||||
<el-button type="primary" @click="handleBillSearch">搜索</el-button>
|
||||
<el-button @click="resetBillSearch">清空</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<el-table v-loading="billPage.loading" :data="billRows" border>
|
||||
<el-table-column prop="billNo" label="汇票单号" min-width="180" />
|
||||
<el-table-column prop="issuerName" label="出票单位" min-width="160" />
|
||||
<el-table-column prop="receiverName" label="收票单位" min-width="160" />
|
||||
<el-table-column prop="faceAmount" label="票面金额" min-width="120">
|
||||
<template #default="{ row }">{{ formatMoney(row.faceAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="availableBalance" label="可用余额" min-width="120">
|
||||
<template #default="{ row }">{{ formatMoney(row.availableBalance) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="maturityDate" label="到期日期" min-width="120" />
|
||||
<el-table-column label="操作" width="100" fixed="right">
|
||||
<template #default="{ row }">
|
||||
<el-link type="primary" @click="selectBill(row)">选择</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div class="payment-form-page__reference-pagination">
|
||||
<el-pagination
|
||||
v-model:current-page="billPage.current"
|
||||
v-model:page-size="billPage.size"
|
||||
:total="billPage.total"
|
||||
:page-sizes="[10, 20, 50, 100]"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
@current-change="loadBillPage"
|
||||
@size-change="handleBillSizeChange"
|
||||
/>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<el-dialog
|
||||
v-model="attachmentDocumentPreviewVisible"
|
||||
:title="attachmentPreviewFile.name || '附件预览'"
|
||||
@@ -552,6 +591,7 @@ import pdfWorkerSrc from 'pdfjs-dist/build/pdf.worker.mjs?url';
|
||||
import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/paymentApplication';
|
||||
import * as billLedgerApi from '@/api/payment/billLedger';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { getList as getProjectList } from '@/api/business/project-apply';
|
||||
import { getDetail as getContractDetail } from '@/api/business/contract-manage';
|
||||
import * as formalApi from '@/api/settlement/formalSettlement';
|
||||
@@ -674,6 +714,17 @@ export default {
|
||||
contractRows: [],
|
||||
billOptions: [],
|
||||
billLoading: false,
|
||||
billDialogVisible: false,
|
||||
billQuery: {
|
||||
keyword: '',
|
||||
},
|
||||
billRows: [],
|
||||
billPage: {
|
||||
current: 1,
|
||||
size: 10,
|
||||
total: 0,
|
||||
loading: false,
|
||||
},
|
||||
receiptAccountOptions: [],
|
||||
receiptAccountLoading: false,
|
||||
firstContractPayment: false,
|
||||
@@ -696,7 +747,7 @@ export default {
|
||||
zoom: true,
|
||||
},
|
||||
paymentTypeOptions: api.paymentTypeOptions,
|
||||
paymentMethodOptions: api.paymentMethodOptions,
|
||||
paymentMethodOptions: [],
|
||||
attachmentFileTypes: [
|
||||
'pdf',
|
||||
'bmp',
|
||||
@@ -740,7 +791,7 @@ export default {
|
||||
return this.hasPermission(code);
|
||||
},
|
||||
billPayment() {
|
||||
return this.form.paymentMethod !== 'bank_transfer';
|
||||
return this.isBillPaymentMethod();
|
||||
},
|
||||
paymentAmountBase() {
|
||||
if (this.form.paymentType === 'project_advance') return 0;
|
||||
@@ -976,6 +1027,7 @@ export default {
|
||||
return body?.data || body;
|
||||
},
|
||||
async initialize() {
|
||||
await this.loadPaymentMethodOptions();
|
||||
if (this.recordId) {
|
||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||
this.form = {
|
||||
@@ -1020,6 +1072,37 @@ export default {
|
||||
? paymentType
|
||||
: 'project_advance';
|
||||
},
|
||||
async loadPaymentMethodOptions() {
|
||||
try {
|
||||
const data = this.unwrapData(await getDictionary({ code: 'pay_method' }));
|
||||
const records = Array.isArray(data) ? data : data?.records || [];
|
||||
this.paymentMethodOptions = records
|
||||
.map(item => ({
|
||||
...item,
|
||||
label: item.dictValue || item.label || item.name || item.dictKey || item.value,
|
||||
value: item.dictKey || item.value || item.dictValue || item.name,
|
||||
}))
|
||||
.filter(item => item.label && item.value);
|
||||
} catch (error) {
|
||||
this.paymentMethodOptions = [];
|
||||
this.$message.warning('付款方式字典加载失败,请稍后重试');
|
||||
}
|
||||
},
|
||||
isBillPaymentMethod(value = this.form.paymentMethod) {
|
||||
const selected = this.paymentMethodOptions.find(
|
||||
item => String(item.value) === String(value)
|
||||
);
|
||||
const searchableText = [
|
||||
selected?.dictKey,
|
||||
selected?.dictValue,
|
||||
selected?.label,
|
||||
selected?.name,
|
||||
selected?.value,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(' ');
|
||||
return searchableText.includes('汇票');
|
||||
},
|
||||
getTransferredPreSettlementIds() {
|
||||
const payloadIds = (this.transferPayload?.sourcePreSettlements || []).map(
|
||||
item => item.preSettlementId || item.id
|
||||
@@ -1566,14 +1649,13 @@ export default {
|
||||
}
|
||||
this.contractPaymentRatioExceeded = exceeded;
|
||||
},
|
||||
validateRequiredAttachments() {
|
||||
if (!this.missingAttachmentMaterials.length) return true;
|
||||
notifyMissingAttachments() {
|
||||
if (!this.missingAttachmentMaterials.length) return;
|
||||
this.$message.warning(
|
||||
`请先上传付款申请所需材料:${this.missingAttachmentMaterials
|
||||
`付款申请所需材料未上传,请核对:${this.missingAttachmentMaterials
|
||||
.map(item => item.label)
|
||||
.join('、')}`
|
||||
);
|
||||
return false;
|
||||
},
|
||||
handleTypeChange() {
|
||||
this.form.invoices = [];
|
||||
@@ -1648,20 +1730,10 @@ export default {
|
||||
try {
|
||||
const response = await formalApi.getContractOptions('', projectId);
|
||||
this.contractOptions = (this.unwrapData(response) || []).filter(
|
||||
item => String(item.projectId || '') === String(projectId)
|
||||
item =>
|
||||
String(item.projectId || '') === String(projectId) &&
|
||||
String(item.contractCategory || '').trim() === '承运商合同'
|
||||
);
|
||||
if (
|
||||
this.form.contractId &&
|
||||
this.form.contractName &&
|
||||
!this.contractOptions.some(item => String(item.id) === String(this.form.contractId))
|
||||
) {
|
||||
this.contractOptions.unshift({
|
||||
id: this.form.contractId,
|
||||
contractNo: this.form.contractNo,
|
||||
contractName: this.form.contractName,
|
||||
projectId,
|
||||
});
|
||||
}
|
||||
} catch (error) {
|
||||
this.contractOptions = [];
|
||||
this.$message.warning('项目合同加载失败,请稍后重试');
|
||||
@@ -1807,6 +1879,8 @@ export default {
|
||||
this.form.billLedgerId = null;
|
||||
this.form.billNo = '';
|
||||
this.billOptions = [];
|
||||
this.billRows = [];
|
||||
this.billDialogVisible = false;
|
||||
return;
|
||||
}
|
||||
await this.loadBillOptions();
|
||||
@@ -1823,10 +1897,49 @@ export default {
|
||||
this.billLoading = false;
|
||||
}
|
||||
},
|
||||
handleBillChange(id) {
|
||||
const selected = this.billOptions.find(item => String(item.id) === String(id));
|
||||
this.form.billNo = selected?.billNo || '';
|
||||
this.$refs.formRef?.validateField('billLedgerId').catch(() => {});
|
||||
async openBillDialog() {
|
||||
if (this.readonly || !this.billPayment) return;
|
||||
this.billDialogVisible = true;
|
||||
this.billQuery.keyword = '';
|
||||
this.billPage.current = 1;
|
||||
await this.loadBillPage();
|
||||
},
|
||||
async loadBillPage() {
|
||||
if (!this.billPayment) return;
|
||||
this.billPage.loading = true;
|
||||
try {
|
||||
const response = await billLedgerApi.getAvailablePage(
|
||||
this.billPage.current,
|
||||
this.billPage.size,
|
||||
String(this.billQuery.keyword || '').trim() || undefined,
|
||||
this.form.deptId,
|
||||
this.form.billLedgerId
|
||||
);
|
||||
const data = this.unwrapData(response) || {};
|
||||
this.billRows = data.records || [];
|
||||
this.billPage.total = Number(data.total || 0);
|
||||
} finally {
|
||||
this.billPage.loading = false;
|
||||
}
|
||||
},
|
||||
handleBillSearch() {
|
||||
this.billPage.current = 1;
|
||||
this.loadBillPage();
|
||||
},
|
||||
resetBillSearch() {
|
||||
this.billQuery.keyword = '';
|
||||
this.handleBillSearch();
|
||||
},
|
||||
handleBillSizeChange() {
|
||||
this.billPage.current = 1;
|
||||
this.loadBillPage();
|
||||
},
|
||||
selectBill(row) {
|
||||
this.form.billLedgerId = row.id;
|
||||
this.form.billNo = row.billNo || '';
|
||||
this.billOptions = [row];
|
||||
this.billDialogVisible = false;
|
||||
this.$nextTick(() => this.$refs.formRef?.validateField('billLedgerId').catch(() => {}));
|
||||
},
|
||||
referenceParams(type) {
|
||||
const { settlementNo, projectName, contractName } = this.referenceQuery;
|
||||
@@ -2200,7 +2313,7 @@ export default {
|
||||
this.$message.warning('请选择所属项目');
|
||||
return false;
|
||||
}
|
||||
if (validateMaterials && !this.validateRequiredAttachments()) return false;
|
||||
if (validateMaterials) this.notifyMissingAttachments();
|
||||
try {
|
||||
this.validateInvoices();
|
||||
this.validatePaymentRecords();
|
||||
|
||||
Reference in New Issue
Block a user