<template>
|
<el-container class="dataBack" v-loading="loading">
|
<el-main style="padding:0">
|
<el-form
|
:label-position="labelPosition"
|
:model="form"
|
ref="form"
|
:rules="rules"
|
v-show="!loading"
|
>
|
<el-row>
|
<p class="title">垫佣请款说明</p>
|
<!-- 垫佣节点 -->
|
<el-col :md="12" :lg="8" v-if="config.node.visible">
|
<area-input :config="config.node" v-model="form.node"></area-input>
|
</el-col>
|
<!-- 预估垫佣规模(万元) -->
|
<el-col :md="12" :lg="8" v-if="config.estimatescale.visible">
|
<area-input :config="config.estimatescale" v-model="form.estimatescale"></area-input>
|
</el-col>
|
<!-- 佣金垫付比例(%) -->
|
<el-col :md="12" :lg="8" v-if="config.commissionrate.visible">
|
<area-input :config="config.commissionrate" v-model="form.commissionrate"></area-input>
|
</el-col>
|
<!-- 项目垫佣期限(天) -->
|
<el-col :md="12" :lg="8" v-if="config.term.visible">
|
<area-input :config="config.term" v-model="form.term"></area-input>
|
</el-col>
|
<!-- 历史合作关系 -->
|
<el-col :lg="24" v-if="config.hispartnership.visible">
|
<area-text :config="config.hispartnership" v-model="form.hispartnership"></area-text>
|
</el-col>
|
<!-- <el-col :md="12" :lg="8" v-if="config.hispartnership.visible">
|
<area-input :config="config.hispartnership" v-model="form.hispartnership"></area-input>
|
</el-col> -->
|
</el-row>
|
|
<el-row>
|
<p class="title">项目授信</p>
|
<!-- 保理模式 -->
|
<el-col :md="12" :lg="8" v-if="config.factromodel.visible">
|
<area-select :config="config.factromodel" v-model="form.factromodel"></area-select>
|
</el-col>
|
<!-- 项目授信金额(元) -->
|
<el-col :md="12" :lg="8" v-if="config.position.visible">
|
<area-input :config="config.position" v-model="form.position"></area-input>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-main>
|
</el-container>
|
</template>
|
|
<script>
|
import AreaInput from '@/views/area/components/AreaInput'
|
import AreaInputInit from '@/views/area/components/AreaInputInit'
|
import AreaText from '@/views/area/components/AreaText'
|
import AreaSelect from '@/views/area/components/AreaSelect'
|
import AreaDate from '@/views/area/components/AreaDate'
|
import {
|
queryProjectCreditInformation,
|
updateProjectCreditInformation
|
} from '@/api/area'
|
import { mapState } from 'vuex'
|
export default {
|
components: { AreaInput, AreaInputInit, AreaText, AreaSelect, AreaDate },
|
props: ['nextChange'],
|
data: function() {
|
return {
|
loading: true,
|
labelPosition: 'right',
|
writeAble: false,
|
rules: {},
|
form: {
|
node: '', // 垫佣节点
|
estimatescale: '', // 预估垫佣规模(万元)
|
commissionrate: '', // 佣金垫付比例(%)
|
protype: '', // 开发商类型
|
term: '', // 项目垫佣期限(天)
|
hispartnership: '', // 历史合作关系
|
factromodel: '', // 保理模式
|
position: '' // 项目授信金额(元)
|
},
|
oldForm: {},
|
config: {}
|
}
|
},
|
computed: {
|
...mapState({
|
detailsParams: state => state.risk.detailsParams
|
}),
|
/* negativeMessages(){
|
const { balanceblacklist, cashflow, courtinvolved, cashflowexplain, courtinvolvedexplain } = this.config
|
if (balanceblacklist.visible && cashflow.visible && courtinvolved.visible && cashflowexplain.visible && courtinvolvedexplain.visible){
|
return true
|
} else {
|
return false
|
}
|
} */
|
badMsgTitle() {
|
if (
|
this.config.balanceblacklist.visible ||
|
this.config.cashflow.visible ||
|
this.config.courtinvolved.visible ||
|
this.config.cashflowexplain.visible ||
|
this.config.courtinvolvedexplain.visible
|
) {
|
return true
|
} else {
|
return false
|
}
|
}
|
},
|
watch: {
|
'form.cashflow': function(newVal) {
|
this.config.cashflowexplain.required = Boolean(
|
newVal === '01' || newVal === '02'
|
)
|
this.config.cashflowexplain.visible = Boolean(
|
newVal === '01' || newVal === '02'
|
)
|
this.config.cashflowexplain.writeAble = Boolean(
|
newVal === '01' || newVal === '02'
|
)
|
if (!this.config.cashflowexplain.visible) {
|
this.form.cashflowexplain = ''
|
}
|
},
|
'form.courtinvolved': function(newVal) {
|
// 失信信息/法院涉诉情况说明,有:显示,无:隐藏
|
this.config.courtinvolvedexplain.visible = Boolean(newVal === '1')
|
if (!this.config.courtinvolvedexplain.visible) {
|
this.form.courtinvolvedexplain = ''
|
}
|
}
|
},
|
created() {
|
this.initForm()
|
this.getForm()
|
},
|
methods: {
|
changeValue(val, name) {
|
this.form[`${name}`] = val
|
},
|
getForm() {
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
queryProjectCreditInformation(params).then(res => {
|
// console.log(res.result)
|
// 设置保理模式默认值
|
res.result &&
|
res.result.factromodel &&
|
!res.result.factromodel.value &&
|
(res.result.factromodel.value = '01')
|
this.config = this._.merge({}, this.config, res.result)
|
Object.keys(this.form).forEach(key => {
|
this.$set(this.form, key, this.config[key].value)
|
})
|
Object.assign(this.oldForm, this.form)
|
this.loading = false
|
})
|
},
|
initForm() {
|
Object.keys(this.form).forEach(key => {
|
let params = {
|
visible: false,
|
required: false,
|
writeAble: false
|
}
|
this.config[key] = Object.assign({}, this.config[key], params)
|
})
|
},
|
submitForm() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: false
|
}
|
params = Object.assign({}, params, this.form)
|
updateProjectCreditInformation(params).then(res => {
|
if (res.code === '00') {
|
/* this.$message({
|
message: res.result.resultsDesc,
|
type: 'success'
|
}) */
|
this.$emit('handleNextPage', true)
|
}
|
})
|
} else {
|
this.$message.warning(
|
'当前页面存在必填项未录入或数据录入错误,请检查!'
|
)
|
return false
|
}
|
})
|
},
|
handleSaveDraft() {
|
let params = {
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: true
|
}
|
Object.assign(params, this.form)
|
updateProjectCreditInformation(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
},
|
handleSave() {
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: true
|
}
|
Object.assign(params, this.form)
|
updateProjectCreditInformation(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
} else {
|
this.$message.warning(
|
'当前页面存在必填项未录入或数据录入错误,请检查!'
|
)
|
}
|
})
|
},
|
// 有无失信
|
hasTure(val) {
|
if (val === '1') {
|
this.config.courtinvolvedexplain.required = true
|
}
|
}
|
},
|
beforeRouteLeave(to, from, next) {
|
// console.log(this.form)
|
// console.log(this.oldForm)
|
// console.log(this.nextChange)
|
if (this.nextChange) {
|
for (const key in this.oldForm) {
|
if (this.oldForm.hasOwnProperty(key)) {
|
if (this.oldForm[key] && this.form[key]) {
|
// 不比较空值和undefined
|
if (this.oldForm[key] != this.form[key]) {
|
// console.log(this.form[key])
|
// console.log(this.oldForm[key])
|
this.$confirm(`当前页面有未保存的数据,是否放弃保存`, '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
customClass: 'pro_messages_box',
|
confirmButtonClass: 'pro_messages_box_confirm',
|
cancelButtonClass: 'pro_messages_box_cancel',
|
center: true
|
})
|
.then(() => {
|
next()
|
})
|
.catch(() => {
|
this.$emit('notNext')
|
})
|
return
|
}
|
}
|
}
|
}
|
}
|
next()
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
#el-form-textarea {
|
>>> .el-form-item__label {
|
margin-bottom: 48px;
|
}
|
}
|
</style>
|