调整收付款问题
This commit is contained in:
@@ -188,7 +188,10 @@
|
||||
</el-row>
|
||||
</section-card>
|
||||
|
||||
<section-card title="开票内容"><template #extra><el-button v-if="!readonly" type="primary" @click="addSheet">添加</el-button></template>
|
||||
<section-card title="开票内容"
|
||||
><template #extra
|
||||
><el-button v-if="!readonly" type="primary" @click="addSheet">添加</el-button></template
|
||||
>
|
||||
<div v-for="(sheet, sheetIndex) in form.sheets" :key="sheet.localId" class="invoice-sheet">
|
||||
<div class="invoice-sheet__header">
|
||||
<span>第{{ sheetIndex + 1 }}张</span>
|
||||
@@ -247,17 +250,6 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="不含税单价" min-width="130">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
v-model="row.unitPriceNoTax"
|
||||
:disabled="readonly"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
:controls="false"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="含税金额" min-width="130">
|
||||
<template #default="{ row }">
|
||||
<el-input-number
|
||||
@@ -362,7 +354,11 @@
|
||||
show-overflow-tooltip
|
||||
>
|
||||
<template #default="{ row }">
|
||||
<el-link v-if="column.link && row[column.prop]" type="primary">
|
||||
<el-link
|
||||
v-if="column.link && row[column.prop]"
|
||||
type="primary"
|
||||
@click.stop="handleDetailLink(row, column)"
|
||||
>
|
||||
{{ row[column.prop] }}
|
||||
</el-link>
|
||||
<span
|
||||
@@ -371,9 +367,13 @@
|
||||
Number(row[column.prop]) === -1
|
||||
"
|
||||
></span>
|
||||
<span v-else-if="column.feeItemKeys">{{ formatMoney(getFeeItemValue(row, column.feeItemKeys)) }}</span>
|
||||
<span v-else-if="column.feeItemKeys">{{
|
||||
formatMoney(getFeeItemValue(row, column.feeItemKeys))
|
||||
}}</span>
|
||||
<span v-else-if="column.money">{{ formatMoney(row[column.prop]) }}</span>
|
||||
<span v-else-if="column.prop === 'transportType'">{{ transportTypeLabel(row.transportType) }}</span>
|
||||
<span v-else-if="column.prop === 'transportType'">{{
|
||||
transportTypeLabel(row.transportType)
|
||||
}}</span>
|
||||
<span v-else>{{ displayValue(row[column.prop]) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -400,17 +400,15 @@
|
||||
<div class="invoice-form-page__actions">
|
||||
<el-button @click="goBack">取消</el-button>
|
||||
<el-button v-if="!readonly" type="primary" plain @click="syncReferenceData">同步</el-button>
|
||||
<el-button
|
||||
v-if="!readonly && canSave"
|
||||
type="primary"
|
||||
plain
|
||||
@click="saveDraft"
|
||||
>保存</el-button>
|
||||
<el-button v-if="!readonly && canSave" type="primary" plain @click="saveDraft"
|
||||
>保存</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="!readonly && canSave && hasPermission('invoice_application_submit')"
|
||||
type="primary"
|
||||
@click="submitForm"
|
||||
>提交</el-button>
|
||||
>提交</el-button
|
||||
>
|
||||
</div>
|
||||
</el-form>
|
||||
|
||||
@@ -468,6 +466,8 @@
|
||||
import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/invoiceApplication';
|
||||
import { getAll as getInvoiceItems } from '@/api/base/invoice-item';
|
||||
import { getList as getWaybillList } from '@/api/business/waybill-manage';
|
||||
import { getList as getReceivablePayableDetailList } from '@/api/settlement/receivable-payable-detail';
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
@@ -662,7 +662,8 @@ export default {
|
||||
if (this.settlementIds.length) {
|
||||
await Promise.all([this.loadReceiverInformation(), this.loadSettlementDetails(false)]);
|
||||
}
|
||||
if (this.readonly) this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
if (this.readonly)
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
this.$nextTick(this.restoreDetailSelection);
|
||||
},
|
||||
async loadInvoiceItems() {
|
||||
@@ -683,8 +684,7 @@ export default {
|
||||
transportTypeLabel(value) {
|
||||
if (!value) return '-';
|
||||
return (
|
||||
this.transportTypeOptions.find(item => String(item.value) === String(value))?.label ||
|
||||
value
|
||||
this.transportTypeOptions.find(item => String(item.value) === String(value))?.label || value
|
||||
);
|
||||
},
|
||||
invoiceItemNames(categoryName) {
|
||||
@@ -840,7 +840,7 @@ export default {
|
||||
...item,
|
||||
formalSettlementId: item.id,
|
||||
settlementId: item.id,
|
||||
allocatedInvoiceAmount: 0,
|
||||
allocatedInvoiceAmount: rows.length === 1 ? Number(item.availableInvoiceAmount || 0) : 0,
|
||||
}));
|
||||
this.form.projectName = first.projectName;
|
||||
this.form.deptName = first.deptName;
|
||||
@@ -906,12 +906,10 @@ export default {
|
||||
const invoiceInfoEmails = [
|
||||
...this.receiverInvoiceOptions.flatMap(item => this.parseEmails(item.email)),
|
||||
];
|
||||
this.departmentEmailOptions = invoiceInfoEmails
|
||||
.filter(Boolean)
|
||||
.reduce((emails, email) => {
|
||||
if (!emails.some(item => item.toLowerCase() === email.toLowerCase())) emails.push(email);
|
||||
return emails;
|
||||
}, []);
|
||||
this.departmentEmailOptions = invoiceInfoEmails.filter(Boolean).reduce((emails, email) => {
|
||||
if (!emails.some(item => item.toLowerCase() === email.toLowerCase())) emails.push(email);
|
||||
return emails;
|
||||
}, []);
|
||||
this.form.departmentEmails = this.form.departmentEmails
|
||||
.filter(email =>
|
||||
this.departmentEmailOptions.some(option => option.toLowerCase() === email.toLowerCase())
|
||||
@@ -962,6 +960,56 @@ export default {
|
||||
if (this.readonly) return;
|
||||
this.selectedDetailIds = rows.map(item => item.formalSettlementDetailId || item.id);
|
||||
},
|
||||
handleDetailLink(row, column) {
|
||||
if (column.prop === 'documentNo') {
|
||||
this.openPayableDetail(row);
|
||||
return;
|
||||
}
|
||||
if (column.prop === 'waybillNo') this.openWaybillDetail(row);
|
||||
},
|
||||
async openPayableDetail(row) {
|
||||
let detailId = row.sourceDetailId || '';
|
||||
if (!detailId && row.documentNo) {
|
||||
try {
|
||||
const data = this.unwrapData(
|
||||
await getReceivablePayableDetailList(1, 1, {
|
||||
documentNo: row.documentNo,
|
||||
settlementType: 'payable',
|
||||
})
|
||||
);
|
||||
detailId = (Array.isArray(data) ? data : data?.records || [])[0]?.id || '';
|
||||
} catch {
|
||||
detailId = '';
|
||||
}
|
||||
}
|
||||
if (!detailId) {
|
||||
this.$message.info('当前记录未找到对应的应付明细');
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/settlement/payable-detail',
|
||||
query: { detailId },
|
||||
});
|
||||
},
|
||||
async openWaybillDetail(row) {
|
||||
let waybillId = row.waybillId || '';
|
||||
if (!waybillId && row.waybillNo) {
|
||||
try {
|
||||
const data = this.unwrapData(await getWaybillList(1, 1, { waybillNo: row.waybillNo }));
|
||||
waybillId = (Array.isArray(data) ? data : data?.records || [])[0]?.id || '';
|
||||
} catch {
|
||||
waybillId = '';
|
||||
}
|
||||
}
|
||||
if (!waybillId) {
|
||||
this.$message.info('当前记录未找到对应的运单详情');
|
||||
return;
|
||||
}
|
||||
this.$router.push({
|
||||
path: '/business/waybill-manage',
|
||||
query: { detailId: waybillId },
|
||||
});
|
||||
},
|
||||
restoreDetailSelection() {
|
||||
if (this.readonly || !this.$refs.detailTable) return;
|
||||
const selected = new Set(this.selectedDetailIds.map(String));
|
||||
|
||||
Reference in New Issue
Block a user