Merge remote-tracking branch 'refs/remotes/origin/master' into feature/bfi-api-rate
# Conflicts: # pnpm-lock.yaml # src/axios.js # src/views/settlement/formal-settlement.vue # src/views/vehicle/customer-archive.vue
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
<vehicle-attachment-table v-model="form.attachments" :readonly="readonly" :max-size="10" />
|
||||
</section-card>
|
||||
|
||||
<div class="bill-payment-form-page__actions">
|
||||
<div v-if="!isPublicViewPage" class="bill-payment-form-page__actions">
|
||||
<template v-if="!readonly">
|
||||
<el-button type="primary" :loading="saving" :disabled="submitting" @click="saveDraft">
|
||||
保存
|
||||
@@ -139,6 +139,8 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/billPayment';
|
||||
import * as billLedgerApi from '@/api/payment/billLedger';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyForm = () => ({
|
||||
id: null,
|
||||
@@ -194,7 +196,10 @@ export default {
|
||||
return this.$route.query.id || '';
|
||||
},
|
||||
readonly() {
|
||||
return this.$route.query.mode === 'view';
|
||||
return this.$route.query.mode === 'view' || this.isPublicViewPage;
|
||||
},
|
||||
isPublicViewPage() {
|
||||
return this.$route.path === '/payment/bill-payment/public-view';
|
||||
},
|
||||
},
|
||||
created() {
|
||||
@@ -215,6 +220,10 @@ export default {
|
||||
}
|
||||
},
|
||||
async initialize() {
|
||||
if (this.isPublicViewPage) {
|
||||
await this.loadPublicDetail();
|
||||
return;
|
||||
}
|
||||
if (this.recordId) {
|
||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||
this.form = {
|
||||
@@ -228,6 +237,15 @@ export default {
|
||||
this.form.deptName = this.userInfo?.deptName || this.userInfo?.dept_name || '';
|
||||
this.form.paymentDate = this.$dayjs().format('YYYY-MM-DD');
|
||||
},
|
||||
async loadPublicDetail() {
|
||||
if (!this.recordId) return;
|
||||
const data = this.unwrapData(await getMkPublicDetail('bill-payment', this.recordId));
|
||||
this.form = {
|
||||
...emptyForm(),
|
||||
...data,
|
||||
attachments: this.parse(data.attachmentsJson),
|
||||
};
|
||||
},
|
||||
validateUsedAmount(rule, value, callback) {
|
||||
const amount = Number(value);
|
||||
const balance = Number(this.form.availableBalance || 0);
|
||||
@@ -323,7 +341,14 @@ export default {
|
||||
try {
|
||||
const id = this.unwrapData(await api.save(this.payload()));
|
||||
this.form.id = id;
|
||||
const previousApprovalStatus = this.form.approvalStatus || '';
|
||||
await api.submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'bill-payment',
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.paymentNo || this.form.billNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.goBack();
|
||||
} finally {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<mk-public-shell biz-type="bill-payment" :get-form="getForm">
|
||||
<bill-payment-form ref="page" />
|
||||
</mk-public-shell>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||
import BillPaymentForm from '@/views/payment/bill-payment-form.vue';
|
||||
|
||||
export default {
|
||||
name: 'BillPaymentPublicView',
|
||||
components: { MkPublicShell, BillPaymentForm },
|
||||
methods: {
|
||||
getForm() {
|
||||
const form = this.$refs.page?.form || {};
|
||||
return { ...form, subject: form.paymentNo || form.billNo || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -10,38 +10,26 @@
|
||||
:rows="rows"
|
||||
:loading="loading"
|
||||
:page="page"
|
||||
:mk-enabled="mkEnabled"
|
||||
@add="openCreate"
|
||||
@view="openView"
|
||||
@edit="openEdit"
|
||||
@delete="handleDelete"
|
||||
@flow="openFlow"
|
||||
@submit="handleSubmit"
|
||||
@mk-audit="handleMkAudit"
|
||||
@approve="handleApprove"
|
||||
@return="handleReturn"
|
||||
@void="handleVoid"
|
||||
@page-change="handlePageChange"
|
||||
@size-change="handleSizeChange"
|
||||
/>
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="620px" append-to-body>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="单据号">
|
||||
{{ flowDialog.row.paymentNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="单据状态">
|
||||
{{ flowDialog.row.approvalStatusName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前节点">
|
||||
{{ flowDialog.row.currentNode || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前处理人">
|
||||
{{ flowDialog.row.currentProcessor || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as api from '@/api/payment/billPayment';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import BillPaymentSearch from './components/bill-payment-search.vue';
|
||||
import BillPaymentTable from './components/bill-payment-table.vue';
|
||||
|
||||
@@ -62,11 +50,18 @@ export default {
|
||||
rows: [],
|
||||
loading: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
flowDialog: { visible: false, row: {} },
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.loadTable();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
unwrapData(response) {
|
||||
@@ -125,9 +120,35 @@ export default {
|
||||
if (this.rows.length === 1 && this.page.current > 1) this.page.current -= 1;
|
||||
this.loadTable();
|
||||
},
|
||||
openFlow(row) {
|
||||
this.flowDialog.row = row;
|
||||
this.flowDialog.visible = true;
|
||||
async handleSubmit(row) {
|
||||
const previousApprovalStatus = row.approvalStatus || '';
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'bill-payment',
|
||||
bizId: row.id,
|
||||
subjectName: row.paymentNo || row.billNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
},
|
||||
handleMkAudit(row) {
|
||||
if (!row?.id) {
|
||||
this.$message.warning('汇票付款ID为空,无法打开审核页');
|
||||
return;
|
||||
}
|
||||
getMKApprovalUrl({ bizId: String(row.id) })
|
||||
.then(res => {
|
||||
const url = res?.data?.data;
|
||||
if (!url) {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
return;
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
});
|
||||
},
|
||||
async handleApprove(row) {
|
||||
await api.approve({ id: row.id });
|
||||
|
||||
@@ -50,19 +50,40 @@
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="row.approvalStatus !== 'draft'"
|
||||
v-if="
|
||||
['draft', 'returned'].includes(row.approvalStatus) &&
|
||||
hasPermission('bill_payment_submit')
|
||||
"
|
||||
type="primary"
|
||||
@click="$emit('flow', row)"
|
||||
@click="$emit('submit', row)"
|
||||
>提交</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
mkEnabled &&
|
||||
row.approvalStatus === 'reviewing' &&
|
||||
hasPermission('bill_payment_approve')
|
||||
"
|
||||
type="primary"
|
||||
@click="$emit('mk-audit', row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="row.approvalStatus === 'reviewing' && hasPermission('bill_payment_approve')"
|
||||
v-if="
|
||||
!mkEnabled &&
|
||||
row.approvalStatus === 'reviewing' &&
|
||||
hasPermission('bill_payment_approve')
|
||||
"
|
||||
type="primary"
|
||||
@click="$emit('approve', row)"
|
||||
>通过</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="row.approvalStatus === 'reviewing' && hasPermission('bill_payment_approve')"
|
||||
v-if="
|
||||
!mkEnabled &&
|
||||
row.approvalStatus === 'reviewing' &&
|
||||
hasPermission('bill_payment_approve')
|
||||
"
|
||||
type="danger"
|
||||
@click="$emit('return', row)"
|
||||
>驳回</el-link
|
||||
@@ -94,6 +115,7 @@
|
||||
<script>
|
||||
import { mapGetters } from 'vuex';
|
||||
import { billPaymentTableColumns } from '@/option/payment/billPayment';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
export default {
|
||||
name: 'BillPaymentTable',
|
||||
@@ -101,13 +123,15 @@ export default {
|
||||
rows: { type: Array, default: () => [] },
|
||||
loading: { type: Boolean, default: false },
|
||||
page: { type: Object, required: true },
|
||||
mkEnabled: { type: Boolean, default: false },
|
||||
},
|
||||
emits: [
|
||||
'add',
|
||||
'view',
|
||||
'edit',
|
||||
'delete',
|
||||
'flow',
|
||||
'submit',
|
||||
'mk-audit',
|
||||
'approve',
|
||||
'return',
|
||||
'void',
|
||||
@@ -120,7 +144,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['permission', 'userInfo']),
|
||||
isAdmin() {
|
||||
return String(this.userInfo?.authority || '').includes('admin');
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
||||
@@ -405,7 +405,7 @@
|
||||
</el-form-item>
|
||||
</section-card>
|
||||
|
||||
<div class="invoice-form-page__actions">
|
||||
<div v-if="!isPublicViewPage" 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"
|
||||
@@ -491,6 +491,8 @@ import { getList as getReceivablePayableDetailList } from '@/api/settlement/rece
|
||||
import { getDictionary } from '@/api/system/dictbiz';
|
||||
import { invoiceApplicationDetailColumns } from '@/option/payment/invoiceApplication';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
let localId = 0;
|
||||
const emptyLine = () => ({
|
||||
@@ -584,7 +586,10 @@ export default {
|
||||
return this.$route.query.id || '';
|
||||
},
|
||||
readonly() {
|
||||
return this.$route.query.mode === 'view';
|
||||
return this.$route.query.mode === 'view' || this.isPublicViewPage;
|
||||
},
|
||||
isPublicViewPage() {
|
||||
return this.$route.path === '/payment/invoice-application/public-view';
|
||||
},
|
||||
canSave() {
|
||||
const code = this.recordId ? 'invoice_application_edit' : 'invoice_application_add';
|
||||
@@ -656,6 +661,10 @@ export default {
|
||||
.filter(Boolean);
|
||||
},
|
||||
async initialize() {
|
||||
if (this.isPublicViewPage) {
|
||||
await this.loadPublicDetail();
|
||||
return;
|
||||
}
|
||||
await Promise.all([this.loadInvoiceItems(), this.loadTransportTypeOptions()]);
|
||||
const userInfo = this.$store.getters.userInfo || {};
|
||||
if (!this.recordId) {
|
||||
@@ -663,6 +672,21 @@ export default {
|
||||
return;
|
||||
}
|
||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||
this.applyDetail(data);
|
||||
if (this.settlementIds.length) {
|
||||
await Promise.all([this.loadReceiverInformation(), this.loadSettlementDetails(false)]);
|
||||
}
|
||||
if (this.readonly)
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
this.$nextTick(this.restoreDetailSelection);
|
||||
},
|
||||
async loadPublicDetail() {
|
||||
if (!this.recordId) return;
|
||||
const data = this.unwrapData(await getMkPublicDetail('invoice-application', this.recordId));
|
||||
this.applyDetail(data);
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
},
|
||||
applyDetail(data) {
|
||||
this.form = {
|
||||
...emptyForm(),
|
||||
...data,
|
||||
@@ -683,12 +707,6 @@ export default {
|
||||
sheet.lines.forEach(line => this.syncInvoiceItemLine(line, false))
|
||||
);
|
||||
this.selectedDetailIds = (data.details || []).map(item => item.formalSettlementDetailId);
|
||||
if (this.settlementIds.length) {
|
||||
await Promise.all([this.loadReceiverInformation(), this.loadSettlementDetails(false)]);
|
||||
}
|
||||
if (this.readonly)
|
||||
this.$nextTick(() => this.$refs.formRef?.clearValidate('departmentEmails'));
|
||||
this.$nextTick(this.restoreDetailSelection);
|
||||
},
|
||||
async loadInvoiceItems() {
|
||||
const data = this.unwrapData(await getInvoiceItems());
|
||||
@@ -1183,7 +1201,14 @@ export default {
|
||||
}
|
||||
const saved = await this.saveDraft();
|
||||
if (!saved) return;
|
||||
const previousApprovalStatus = this.form.approvalStatus || '';
|
||||
await api.submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-application',
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.applicationNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.goBack();
|
||||
},
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<mk-public-shell biz-type="invoice-application" :get-form="getForm">
|
||||
<invoice-application-form ref="page" />
|
||||
</mk-public-shell>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||
import InvoiceApplicationForm from '@/views/payment/invoice-application-form.vue';
|
||||
|
||||
export default {
|
||||
name: 'InvoiceApplicationPublicView',
|
||||
components: { MkPublicShell, InvoiceApplicationForm },
|
||||
methods: {
|
||||
getForm() {
|
||||
const form = this.$refs.page?.form || {};
|
||||
return { ...form, subject: form.applicationNo || form.projectName || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -152,14 +152,20 @@
|
||||
>提交</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="hasPermission('invoice_application_view') && row.approvalStatus !== 'draft'"
|
||||
v-if="
|
||||
mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="openFlow(row)"
|
||||
@click="handleMkAudit(row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_application_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleApprove(row)"
|
||||
@@ -167,7 +173,9 @@
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_application_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="danger"
|
||||
@click="handleReturn(row)"
|
||||
@@ -198,42 +206,6 @@
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="900px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="开票申请单号">
|
||||
{{ flowDialog.row.applicationNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="状态">
|
||||
{{ flowDialog.row.approvalStatusName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前节点">
|
||||
{{ flowDialog.row.currentNode || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前处理人">
|
||||
{{ flowDialog.row.currentProcessor || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table
|
||||
v-loading="flowDialog.loading"
|
||||
:data="flowDialog.records"
|
||||
border
|
||||
class="invoice-page__flow-table"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column prop="actionName" label="操作" min-width="110" align="center" />
|
||||
<el-table-column label="原状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.fromStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="新状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.toStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operatorName" label="操作人" min-width="110" align="center" />
|
||||
<el-table-column prop="createTime" label="操作时间" min-width="170" align="center" />
|
||||
<el-table-column prop="reason" label="原因" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="kingdeeBillNo" label="金蝶单据号" min-width="150" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -245,6 +217,8 @@ import * as api from '@/api/payment/invoiceApplication';
|
||||
import * as formalSettlementApi from '@/api/settlement/formalSettlement';
|
||||
import { invoiceApplicationTableColumns } from '@/option/payment/invoiceApplication';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
applicationNo: '',
|
||||
@@ -273,7 +247,7 @@ export default {
|
||||
loading: false,
|
||||
batchSyncing: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
flowDialog: { visible: false, loading: false, row: {}, records: [] },
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -282,6 +256,13 @@ export default {
|
||||
mounted() {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -358,19 +339,6 @@ export default {
|
||||
this.$message.error('正式结算单详情加载失败');
|
||||
}
|
||||
},
|
||||
async openFlow(row) {
|
||||
this.flowDialog.row = { ...row };
|
||||
this.flowDialog.records = [];
|
||||
this.flowDialog.visible = true;
|
||||
this.flowDialog.loading = true;
|
||||
try {
|
||||
const detail = this.unwrapData(await api.getDetail(row.id));
|
||||
this.flowDialog.row = { ...row, ...detail };
|
||||
this.flowDialog.records = detail.records || [];
|
||||
} finally {
|
||||
this.flowDialog.loading = false;
|
||||
}
|
||||
},
|
||||
async handleDelete(row) {
|
||||
await this.$confirm('确认删除该开票申请?', '提示', { type: 'warning' });
|
||||
await api.remove(row.id);
|
||||
@@ -378,10 +346,35 @@ export default {
|
||||
this.loadTable();
|
||||
},
|
||||
async handleSubmit(row) {
|
||||
const previousApprovalStatus = row.approvalStatus || '';
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-application',
|
||||
bizId: row.id,
|
||||
subjectName: row.applicationNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
},
|
||||
handleMkAudit(row) {
|
||||
if (!row?.id) {
|
||||
this.$message.warning('开票申请ID为空,无法打开审核页');
|
||||
return;
|
||||
}
|
||||
getMKApprovalUrl({ bizId: String(row.id) })
|
||||
.then(res => {
|
||||
const url = res?.data?.data;
|
||||
if (!url) {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
return;
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
});
|
||||
},
|
||||
async handleApprove(row) {
|
||||
await this.$confirm('确认审批通过该开票申请?', '提示', { type: 'warning' });
|
||||
await api.approve({ id: row.id });
|
||||
@@ -455,19 +448,6 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
statusName(status) {
|
||||
return (
|
||||
{
|
||||
draft: '草稿',
|
||||
reviewing: '审批中',
|
||||
approved: '审批通过',
|
||||
returned: '已驳回',
|
||||
voided: '已作废',
|
||||
}[status] ||
|
||||
status ||
|
||||
'-'
|
||||
);
|
||||
},
|
||||
displayValue(value) {
|
||||
return value === null || value === undefined || value === '' ? '-' : value;
|
||||
},
|
||||
|
||||
@@ -134,7 +134,7 @@
|
||||
</el-form-item>
|
||||
</section-card>
|
||||
|
||||
<div class="receipt-form-page__actions">
|
||||
<div v-if="!isPublicViewPage" class="receipt-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"
|
||||
@@ -212,6 +212,8 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/invoiceReceipt';
|
||||
import KingdeeInvoicePoolDialog from '@/components/kingdee-invoice-pool-dialog/main.vue';
|
||||
import VehicleAttachmentTable from '@/components/vehicle-attachment-table/main.vue';
|
||||
import { getMkPublicDetail } from '@/api/mk-process';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyForm = () => ({
|
||||
id: null,
|
||||
@@ -274,7 +276,10 @@ export default {
|
||||
return this.$route.query.id || '';
|
||||
},
|
||||
readonly() {
|
||||
return this.$route.query.mode === 'view';
|
||||
return this.$route.query.mode === 'view' || this.isPublicViewPage;
|
||||
},
|
||||
isPublicViewPage() {
|
||||
return this.$route.path === '/payment/invoice-receipt/public-view';
|
||||
},
|
||||
canSave() {
|
||||
const code = this.recordId ? 'invoice_receipt_edit' : 'invoice_receipt_add';
|
||||
@@ -323,6 +328,10 @@ export default {
|
||||
.filter(Boolean);
|
||||
},
|
||||
async initialize() {
|
||||
if (this.isPublicViewPage) {
|
||||
await this.loadPublicDetail();
|
||||
return;
|
||||
}
|
||||
const userInfo = this.$store.getters.userInfo || {};
|
||||
const userEmail = userInfo.email || '';
|
||||
this.departmentEmailOptions = userEmail ? [userEmail] : [];
|
||||
@@ -331,6 +340,15 @@ export default {
|
||||
return;
|
||||
}
|
||||
const data = this.unwrapData(await api.getDetail(this.recordId));
|
||||
this.applyDetail(data);
|
||||
if (this.settlementIds.length) await this.loadReferenceInformation();
|
||||
},
|
||||
async loadPublicDetail() {
|
||||
if (!this.recordId) return;
|
||||
const data = this.unwrapData(await getMkPublicDetail('invoice-receipt', this.recordId));
|
||||
this.applyDetail(data);
|
||||
},
|
||||
applyDetail(data) {
|
||||
this.form = {
|
||||
...emptyForm(),
|
||||
...data,
|
||||
@@ -342,7 +360,6 @@ export default {
|
||||
})),
|
||||
attachments: this.parse(data.attachmentsJson),
|
||||
};
|
||||
if (this.settlementIds.length) await this.loadReferenceInformation();
|
||||
},
|
||||
validateInvoice(rule, value, callback) {
|
||||
if (!value) {
|
||||
@@ -541,7 +558,14 @@ export default {
|
||||
async submitForm() {
|
||||
const saved = await this.saveDraft();
|
||||
if (!saved) return;
|
||||
const previousApprovalStatus = this.form.approvalStatus || '';
|
||||
await api.submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-receipt',
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.invoiceNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.goBack();
|
||||
},
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<template>
|
||||
<mk-public-shell biz-type="invoice-receipt" :get-form="getForm">
|
||||
<invoice-receipt-form ref="page" />
|
||||
</mk-public-shell>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import MkPublicShell from '@/views/mk/mk-public-shell.vue';
|
||||
import InvoiceReceiptForm from '@/views/payment/invoice-receipt-form.vue';
|
||||
|
||||
export default {
|
||||
name: 'InvoiceReceiptPublicView',
|
||||
components: { MkPublicShell, InvoiceReceiptForm },
|
||||
methods: {
|
||||
getForm() {
|
||||
const form = this.$refs.page?.form || {};
|
||||
return { ...form, subject: form.invoiceNo || form.projectName || '' };
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -147,14 +147,20 @@
|
||||
>提交</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="hasPermission('invoice_receipt_view') && row.approvalStatus !== 'draft'"
|
||||
v-if="
|
||||
mkEnabled &&
|
||||
hasPermission('invoice_receipt_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="openFlow(row)"
|
||||
@click="handleMkAudit(row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_receipt_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_receipt_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleApprove(row)"
|
||||
@@ -162,7 +168,9 @@
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('invoice_receipt_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('invoice_receipt_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="danger"
|
||||
@click="handleReturn(row)"
|
||||
@@ -191,42 +199,6 @@
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="900px" append-to-body>
|
||||
<el-descriptions :column="2" border>
|
||||
<el-descriptions-item label="发票号码">
|
||||
{{ flowDialog.row.invoiceNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
{{ flowDialog.row.approvalStatusName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前节点">
|
||||
{{ flowDialog.row.currentNode || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前处理人">
|
||||
{{ flowDialog.row.currentProcessor || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-table
|
||||
v-loading="flowDialog.loading"
|
||||
:data="flowDialog.records"
|
||||
border
|
||||
class="receipt-page__flow-table"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="64" align="center" />
|
||||
<el-table-column prop="actionName" label="操作" min-width="110" align="center" />
|
||||
<el-table-column label="原状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.fromStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="新状态" min-width="100" align="center">
|
||||
<template #default="{ row }">{{ statusName(row.toStatus) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="operatorName" label="操作人" min-width="110" align="center" />
|
||||
<el-table-column prop="createTime" label="操作时间" min-width="170" align="center" />
|
||||
<el-table-column prop="reason" label="原因" min-width="160" show-overflow-tooltip />
|
||||
<el-table-column prop="kingdeeBillNo" label="金蝶单据号" min-width="150" />
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -237,6 +209,8 @@ import * as XLSX from 'xlsx';
|
||||
import * as api from '@/api/payment/invoiceReceipt';
|
||||
import { invoiceReceiptTableColumns } from '@/option/payment/invoiceReceipt';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
invoiceNo: '',
|
||||
@@ -266,7 +240,7 @@ export default {
|
||||
loading: false,
|
||||
pushLoading: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
flowDialog: { visible: false, loading: false, row: {}, records: [] },
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -275,6 +249,13 @@ export default {
|
||||
mounted() {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -323,19 +304,6 @@ export default {
|
||||
query: { mode: 'view', id: row.id },
|
||||
});
|
||||
},
|
||||
async openFlow(row) {
|
||||
this.flowDialog.row = { ...row };
|
||||
this.flowDialog.records = [];
|
||||
this.flowDialog.visible = true;
|
||||
this.flowDialog.loading = true;
|
||||
try {
|
||||
const detail = this.unwrapData(await api.getDetail(row.id));
|
||||
this.flowDialog.row = { ...row, ...detail };
|
||||
this.flowDialog.records = detail.records || [];
|
||||
} finally {
|
||||
this.flowDialog.loading = false;
|
||||
}
|
||||
},
|
||||
async handleDelete(row) {
|
||||
await this.$confirm('确认删除该收票登记?', '提示', { type: 'warning' });
|
||||
await api.remove(row.id);
|
||||
@@ -343,10 +311,35 @@ export default {
|
||||
this.loadTable();
|
||||
},
|
||||
async handleSubmit(row) {
|
||||
const previousApprovalStatus = row.approvalStatus || '';
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'invoice-receipt',
|
||||
bizId: row.id,
|
||||
subjectName: row.invoiceNo || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
},
|
||||
handleMkAudit(row) {
|
||||
if (!row?.id) {
|
||||
this.$message.warning('收票登记ID为空,无法打开审核页');
|
||||
return;
|
||||
}
|
||||
getMKApprovalUrl({ bizId: String(row.id) })
|
||||
.then(res => {
|
||||
const url = res?.data?.data;
|
||||
if (!url) {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
return;
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
});
|
||||
},
|
||||
async handleApprove(row) {
|
||||
await this.$confirm('确认审批通过该收票登记?', '提示', { type: 'warning' });
|
||||
await api.approve({ id: row.id });
|
||||
@@ -418,19 +411,6 @@ export default {
|
||||
''
|
||||
);
|
||||
},
|
||||
statusName(status) {
|
||||
return (
|
||||
{
|
||||
draft: '草稿',
|
||||
reviewing: '审批中',
|
||||
approved: '审批通过',
|
||||
returned: '已驳回',
|
||||
voided: '已作废',
|
||||
}[status] ||
|
||||
status ||
|
||||
'-'
|
||||
);
|
||||
},
|
||||
displayValue(value) {
|
||||
return value === null || value === undefined || value === '' ? '-' : value;
|
||||
},
|
||||
|
||||
@@ -2672,12 +2672,13 @@ export default {
|
||||
// 提交前静默保存,避免同时弹出「保存成功」与材料缺失 toast
|
||||
const saved = await this.saveDraft({ showSuccess: false });
|
||||
if (!saved) return;
|
||||
const previousApprovalStatus = this.form.approvalStatus || '';
|
||||
await api.submit({ id: this.form.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'payment-application',
|
||||
formInstanceId: this.form.id,
|
||||
bizId: this.form.id,
|
||||
subjectName: this.form.paymentNo || '',
|
||||
approvalStatus: this.form.approvalStatus || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.goBack();
|
||||
|
||||
@@ -160,14 +160,29 @@
|
||||
>编辑</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="hasPermission('payment_application_submit') && row.approvalStatus === 'draft'"
|
||||
v-if="
|
||||
hasPermission('payment_application_submit') &&
|
||||
['draft', 'returned'].includes(row.approvalStatus)
|
||||
"
|
||||
type="primary"
|
||||
@click="handleSubmit(row)"
|
||||
>提交</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('payment_application_approve') && row.approvalStatus === 'reviewing'
|
||||
mkEnabled &&
|
||||
hasPermission('payment_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleMkAudit(row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
!mkEnabled &&
|
||||
hasPermission('payment_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="primary"
|
||||
@click="handleApprove(row)"
|
||||
@@ -175,18 +190,14 @@
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('payment_application_approve') && row.approvalStatus === 'reviewing'
|
||||
!mkEnabled &&
|
||||
hasPermission('payment_application_approve') &&
|
||||
row.approvalStatus === 'reviewing'
|
||||
"
|
||||
type="danger"
|
||||
@click="handleReturn(row)"
|
||||
>驳回</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="hasPermission('payment_application_view') && row.approvalStatus !== 'draft'"
|
||||
type="primary"
|
||||
@click="openFlow(row)"
|
||||
>流程</el-link
|
||||
>
|
||||
<el-link
|
||||
v-if="
|
||||
hasPermission('payment_application_void') && row.approvalStatus === 'approved'
|
||||
@@ -217,22 +228,6 @@
|
||||
/>
|
||||
</div>
|
||||
</section>
|
||||
<el-dialog v-model="flowDialog.visible" title="审批流程" width="620px" append-to-body>
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item label="付款申请单号">
|
||||
{{ flowDialog.row.paymentNo || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="审核状态">
|
||||
{{ flowDialog.row.approvalStatusName || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前节点">
|
||||
{{ flowDialog.row.currentNode || '-' }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="当前处理人">
|
||||
{{ flowDialog.row.currentProcessor || '-' }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-dialog>
|
||||
</basic-container>
|
||||
</template>
|
||||
|
||||
@@ -242,7 +237,8 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/paymentApplication';
|
||||
import { paymentApplicationTableColumns } from '@/option/payment/paymentApplication';
|
||||
import organizationSearch from '@/mixins/organization-search';
|
||||
import { submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
import { getMKApprovalUrl } from '@/api/system/business-process';
|
||||
import { loadMkEnabled, submitMkApprovalFlow } from '@/utils/mk-approval';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
paymentNo: '',
|
||||
@@ -276,7 +272,7 @@ export default {
|
||||
syncLoading: false,
|
||||
resultSyncing: false,
|
||||
page: { current: 1, size: 10, total: 0 },
|
||||
flowDialog: { visible: false, row: {} },
|
||||
mkEnabled: false,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -288,6 +284,13 @@ export default {
|
||||
mounted() {
|
||||
this.loadOrganizationOptions();
|
||||
this.loadTable();
|
||||
loadMkEnabled()
|
||||
.then(enabled => {
|
||||
this.mkEnabled = !!enabled;
|
||||
})
|
||||
.catch(() => {
|
||||
this.mkEnabled = false;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
hasPermission(code) {
|
||||
@@ -372,12 +375,13 @@ export default {
|
||||
this.loadTable();
|
||||
},
|
||||
async handleSubmit(row) {
|
||||
const previousApprovalStatus = row.approvalStatus || '';
|
||||
await api.submit({ id: row.id });
|
||||
await submitMkApprovalFlow({
|
||||
bizType: 'payment-application',
|
||||
formInstanceId: row.id,
|
||||
bizId: row.id,
|
||||
subjectName: row.paymentNo || '',
|
||||
approvalStatus: row.approvalStatus || '',
|
||||
approvalStatus: previousApprovalStatus,
|
||||
});
|
||||
this.$message.success('提交成功');
|
||||
this.loadTable();
|
||||
@@ -387,16 +391,30 @@ export default {
|
||||
this.$message.success('审批通过');
|
||||
this.loadTable();
|
||||
},
|
||||
handleMkAudit(row) {
|
||||
if (!row?.id) {
|
||||
this.$message.warning('付款申请ID为空,无法打开审核页');
|
||||
return;
|
||||
}
|
||||
getMKApprovalUrl({ bizId: String(row.id) })
|
||||
.then(res => {
|
||||
const url = res?.data?.data;
|
||||
if (!url) {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
return;
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
})
|
||||
.catch(() => {
|
||||
this.$message.error('获取审核跳转地址失败');
|
||||
});
|
||||
},
|
||||
async handleReturn(row) {
|
||||
const { value } = await this.$prompt('请输入驳回原因', '审批驳回');
|
||||
await api.returnBill({ id: row.id, reason: value });
|
||||
this.$message.success('已驳回');
|
||||
this.loadTable();
|
||||
},
|
||||
openFlow(row) {
|
||||
this.flowDialog.row = row;
|
||||
this.flowDialog.visible = true;
|
||||
},
|
||||
async handleVoid(row) {
|
||||
const { value } = await this.$prompt('请输入作废原因', '作废付款申请');
|
||||
await api.voidBill({ id: row.id, reason: value });
|
||||
|
||||
@@ -157,6 +157,7 @@ import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/receiptClaimRecord';
|
||||
import { receiptClaimRecordTableColumns } from '@/option/payment/receiptClaimRecord';
|
||||
import SectionCard from '@/components/section-card/main.vue';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
receiptNoticeNo: '',
|
||||
@@ -195,10 +196,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['permission', 'userInfo']),
|
||||
isAdmin() {
|
||||
const authority = this.userInfo?.authority;
|
||||
return Array.isArray(authority)
|
||||
? authority.includes('admin')
|
||||
: String(authority || '').includes('admin');
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
@@ -271,6 +271,7 @@ import { ArrowDown, ArrowUp } from '@element-plus/icons-vue';
|
||||
import { mapGetters } from 'vuex';
|
||||
import * as api from '@/api/payment/receiptFlow';
|
||||
import { receiptFlowTableColumns } from '@/option/payment/receiptFlow';
|
||||
import { isAdministrator } from '@/utils/auth';
|
||||
|
||||
const emptyQuery = () => ({
|
||||
receiptNoticeNo: '',
|
||||
@@ -312,10 +313,7 @@ export default {
|
||||
computed: {
|
||||
...mapGetters(['permission', 'userInfo']),
|
||||
isAdmin() {
|
||||
const authority = this.userInfo?.authority;
|
||||
return Array.isArray(authority)
|
||||
? authority.includes('admin')
|
||||
: String(authority || '').includes('admin');
|
||||
return isAdministrator(this.userInfo);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
|
||||
Reference in New Issue
Block a user