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

This commit is contained in:
wkc
2026-04-30 09:20:12 +08:00
parent 801310ee10
commit 761b9a0612

View File

@@ -68,6 +68,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-row>
<el-col :span="12">
<el-form-item label="是否有经营佐证" prop="bizProof">
@@ -98,6 +114,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>
@@ -106,10 +128,14 @@
</template>
<script>
import {createPersonalWorkflow} from "@/api/loanPricing/workflow"
import {createPersonalWorkflow, queryHistoryContracts} from "@/api/loanPricing/workflow"
import HistoryContractSelector from "./HistoryContractSelector"
export default {
name: "PersonalCreateDialog",
components: {
HistoryContractSelector
},
props: {
visible: {
type: Boolean,
@@ -142,6 +168,10 @@ export default {
'1', '2', '3', '4', '5', '6'
],
submitting: false,
showHistorySelector: false,
historyLoading: false,
historyContracts: [],
selectedHistoryContract: null,
form: {
orgCode: '892000',
runType: '1',
@@ -153,6 +183,8 @@ export default {
applyAmt: undefined,
loanPurpose: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
bizProof: false,
loanLoop: false,
collType: undefined,
@@ -184,6 +216,12 @@ export default {
],
loanTerm: [
{required: true, message: "请选择借款期限", trigger: "change"}
],
businessType: [
{required: true, message: "请选择业务种类", trigger: "change"}
],
loanRateHistory: [
{required: true, message: "请选择历史贷款合同", trigger: "change"}
]
}
}
@@ -200,6 +238,9 @@ export default {
isCollateralGuarantee() {
return this.form.guarType === '抵押' || this.form.guarType === '质押'
},
isStockTransfer() {
return this.form.businessType === '存量转贷'
},
collateralTypeOptions() {
if (this.form.guarType === '抵押') {
return ['一类', '二类', '三类', '四类', '其他']
@@ -236,12 +277,18 @@ export default {
applyAmt: undefined,
loanPurpose: undefined,
loanTerm: undefined,
businessType: undefined,
loanRateHistory: undefined,
bizProof: false,
loanLoop: 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()
@@ -267,10 +314,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 = {
@@ -284,6 +376,9 @@ export default {
delete data.collType
delete data.collThirdParty
}
if (!this.isStockTransfer) {
delete data.loanRateHistory
}
createPersonalWorkflow(data).then(response => {
this.$modal.msgSuccess("新增成功")