5fcb82c0c0
2、新增收付款模块
91 lines
2.1 KiB
Vue
91 lines
2.1 KiB
Vue
<template>
|
|
<basic-container class="pre-settlement-form-page">
|
|
<div class="pre-settlement-form-page__title">{{ pageTitle }}</div>
|
|
<pre-settlement-editor
|
|
v-model="editorVisible"
|
|
page-mode
|
|
:record-id="recordId"
|
|
:initial-data="transferPayload"
|
|
@success="handleSuccess"
|
|
/>
|
|
</basic-container>
|
|
</template>
|
|
|
|
<script>
|
|
import PreSettlementEditor from './components/pre-settlement-editor.vue';
|
|
import { readSettlementTransfer, removeSettlementTransfer } from '@/utils/settlement-transfer';
|
|
|
|
export default {
|
|
name: 'PreSettlementForm',
|
|
components: { PreSettlementEditor },
|
|
data() {
|
|
return {
|
|
editorVisible: true,
|
|
savedRecordId: '',
|
|
transferPayload: null,
|
|
};
|
|
},
|
|
computed: {
|
|
recordId() {
|
|
return this.$route.query.id || '';
|
|
},
|
|
pageTitle() {
|
|
return this.recordId || this.savedRecordId ? '编辑预结算' : '新增预结算';
|
|
},
|
|
},
|
|
watch: {
|
|
editorVisible(value) {
|
|
if (!value) this.goBack();
|
|
},
|
|
},
|
|
created() {
|
|
this.transferPayload = readSettlementTransfer(this.$route.query.transferToken);
|
|
this.syncTagTitle();
|
|
},
|
|
methods: {
|
|
handleSuccess(recordId) {
|
|
this.savedRecordId = recordId || this.savedRecordId;
|
|
this.syncTagTitle();
|
|
},
|
|
goBack() {
|
|
removeSettlementTransfer(this.$route.query.transferToken);
|
|
this.$router.push('/settlement/pre-settlement');
|
|
},
|
|
syncTagTitle() {
|
|
this.$nextTick(() => {
|
|
this.$store.commit('SET_TAG', {
|
|
fullPath: this.$route.fullPath,
|
|
name: this.pageTitle,
|
|
});
|
|
this.$router.$avueRouter.setTitle(this.pageTitle);
|
|
});
|
|
},
|
|
},
|
|
};
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
.pre-settlement-form-page {
|
|
&__title {
|
|
display: flex;
|
|
align-items: center;
|
|
min-height: 24px;
|
|
margin-bottom: 16px;
|
|
font-size: 18px;
|
|
font-weight: 600;
|
|
|
|
&::before {
|
|
width: 4px;
|
|
height: 20px;
|
|
margin-right: 8px;
|
|
background: #409eff;
|
|
content: '';
|
|
}
|
|
}
|
|
}
|
|
|
|
:deep(.pre-settlement-form-page.basic-container .basic-container__card > .el-card__body) {
|
|
padding: 0;
|
|
}
|
|
</style>
|