企业新增支持业务种类和历史利率

This commit is contained in:
wkc
2026-04-30 09:21:56 +08:00
parent 761b9a0612
commit 01a0bee5c0

View File

@@ -60,6 +60,22 @@
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="业务种类" prop="businessType">
<el-select v-model="form.businessType" placeholder="请选择业务种类" style="width: 100%" @change="handleBusinessTypeChange">
<el-option label="新客" value="新客"/>
<el-option label="存量新增" value="存量新增"/>
<el-option label="存量转贷" value="存量转贷"/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-if="isStockTransfer">
<el-form-item label="历史贷款利率" prop="loanRateHistory">
<el-input v-model="form.loanRateHistory" placeholder="请选择历史贷款合同" :readonly="true"/>
</el-form-item>
</el-col>
</el-row>
<!-- 企业标识 -->
<el-divider content-position="left">企业标识</el-divider>
@@ -93,6 +109,12 @@
</el-col>
</el-row>
</el-form>
<history-contract-selector
:visible.sync="showHistorySelector"
:contracts="historyContracts"
:loading="historyLoading"
@select="handleHistoryContractSelect"
/>
<div slot="footer" class="dialog-footer">
<el-button type="primary" :loading="submitting" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
@@ -101,10 +123,14 @@
</template>
<script>
import {createCorporateWorkflow} from "@/api/loanPricing/workflow"
import {createCorporateWorkflow, queryHistoryContracts} from "@/api/loanPricing/workflow"
import HistoryContractSelector from "./HistoryContractSelector"
export default {
name: "CorporateCreateDialog",
components: {
HistoryContractSelector
},
props: {
visible: {
type: Boolean,
@@ -151,6 +177,10 @@ export default {
'1', '2', '3', '4', '5', '6', '7', '8', '9', '10'
],
submitting: false,
showHistorySelector: false,
historyLoading: false,
historyContracts: [],
selectedHistoryContract: null,
form: {
orgCode: '892000',
runType: '1',
@@ -161,6 +191,8 @@ export default {
guarType: undefined,
applyAmt: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
isGreenLoan: false,
isTradeBuildEnt: false,
collType: undefined,
@@ -190,6 +222,12 @@ export default {
loanTerm: [
{required: true, validator: validateLoanTerm, trigger: "change"}
],
businessType: [
{required: true, message: "请选择业务种类", trigger: "change"}
],
loanRateHistory: [
{required: true, message: "请选择历史贷款合同", trigger: "change"}
],
collType: [
{required: true, message: "请选择抵质押类型", trigger: "change"}
]
@@ -208,6 +246,9 @@ export default {
isCollateralGuarantee() {
return this.form.guarType === '抵押' || this.form.guarType === '质押'
},
isStockTransfer() {
return this.form.businessType === '存量转贷'
},
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一类', '二类', '三类', '四类', '其他']
@@ -243,12 +284,18 @@ export default {
guarType: undefined,
applyAmt: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
isGreenLoan: false,
isTradeBuildEnt: false,
collType: undefined,
collThirdParty: false
}
this.submitting = false
this.showHistorySelector = false
this.historyLoading = false
this.historyContracts = []
this.selectedHistoryContract = null
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate()
@@ -274,10 +321,55 @@ export default {
}
})
},
handleBusinessTypeChange(value) {
this.clearHistoryContract()
if (value === '存量转贷') {
this.queryHistoryContracts()
}
},
queryHistoryContracts() {
if (!this.form.custIsn) {
this.$modal.msgWarning("客户内码不能为空")
return
}
this.historyLoading = true
queryHistoryContracts(this.form.custIsn).then(response => {
this.historyContracts = response.data || []
if (this.historyContracts.length === 0) {
this.$modal.msgWarning("未查询到历史贷款合同")
return
}
this.showHistorySelector = true
}).finally(() => {
this.historyLoading = false
})
},
handleHistoryContractSelect(row) {
if (!row.loan_rate_history) {
this.$modal.msgWarning("历史贷款利率不能为空")
return
}
this.selectedHistoryContract = row
this.form.loanRateHistory = row.loan_rate_history
},
clearHistoryContract() {
this.selectedHistoryContract = null
this.form.loanRateHistory = undefined
this.historyContracts = []
this.$nextTick(() => {
if (this.$refs.form) {
this.$refs.form.clearValidate(['loanRateHistory'])
}
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.isStockTransfer && !this.form.loanRateHistory) {
this.$modal.msgWarning("请选择历史贷款合同")
return
}
this.submitting = true
// 转换开关值为字符串
const data = {
@@ -291,6 +383,9 @@ export default {
delete data.collType
delete data.collThirdParty
}
if (!this.isStockTransfer) {
delete data.loanRateHistory
}
createCorporateWorkflow(data).then(response => {
this.$modal.msgSuccess("新增成功")