<!--
|
* @Descripttion:
|
* @version:
|
* @Author: Pengjiantian
|
* @Date: 2019-08-26 15:08:09
|
* @LastEditors: Please set LastEditors
|
* @LastEditTime: 2019-11-22 15:02:40
|
-->
|
<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.developbrand.visible">
|
<area-input :config="config.developbrand" v-model="form.developbrand"></area-input>
|
</el-col>
|
<!-- 开发商项目公司名称 -->
|
<el-col :md="12" :lg="8" v-if="config.developer.visible">
|
<area-input :config="config.developer" v-model="form.developer"></area-input>
|
</el-col>
|
<!-- 企业性质 -->
|
<el-col :md="12" :lg="8" v-if="config.companyroperty.visible">
|
<area-select :config="config.companyroperty" v-model="form.companyroperty"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.iscompanylist.visible">
|
<area-select :config="config.iscompanylist" v-model="form.iscompanylist"></area-select>
|
</el-col>
|
<!-- 项目公司实缴资本 -->
|
<el-col :md="12" :lg="8" v-if="config.companycapital.visible">
|
<area-select :config="config.companycapital" v-model="form.companycapital"></area-select>
|
</el-col>
|
<!-- 开发商资质等级 -->
|
<el-col :md="12" :lg="8" v-if="config.groupaptitude.visible">
|
<area-select :config="config.groupaptitude" v-model="form.groupaptitude"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.developeraptitude.visible">
|
<area-select :config="config.developeraptitude" v-model="form.developeraptitude"></area-select>
|
</el-col>
|
<!-- 销售额排名 -->
|
<el-col :md="12" :lg="8" v-if="config.localsalemoneyrank.visible">
|
<area-select :config="config.localsalemoneyrank" v-model="form.localsalemoneyrank"></area-select>
|
</el-col>
|
<el-col :md="12" :lg="8" v-if="config.salemoney.visible">
|
<area-select :config="config.salemoney" v-model="form.salemoney"></area-select>
|
</el-col>
|
<!-- 当地销售排名 -->
|
<el-col :md="12" :lg="8" v-if="config.localsalerank.visible">
|
<area-select :config="config.localsalerank" v-model="form.localsalerank"></area-select>
|
</el-col>
|
<!-- 当地住宅项目已开发量 -->
|
<el-col :md="12" :lg="8" v-if="config.localdeveloped.visible">
|
<area-select :config="config.localdeveloped" v-model="form.localdeveloped"></area-select>
|
</el-col>
|
<!-- 当地开发及销售排名情况说明 -->
|
<el-col :span="24" v-if="config.localsaleexplain.visible" id="el-form-textarea">
|
<area-text :config="config.localsaleexplain" v-model="form.localsaleexplain" :inputType="'textarea'" :inputRows="3"></area-text>
|
</el-col>
|
|
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.companycapital.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.companycapital" v-model="form.companycapital"></area-select>
|
</el-col>
|
|
|
<!-- <el-col :md="12" :lg="8" v-if="config.whitebank.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.whitebank" v-model="form.whitebank"></area-select>
|
</el-col>
|
|
|
|
<!-- <el-col :span="24" v-if="config.developcoveredarea.visible" id="el-form-textarea"> -->
|
<el-col :span="24" v-if="false" id="el-form-textarea">
|
<area-text :config="config.developcoveredarea" v-model="form.developcoveredarea" :inputType="'textarea'" :inputRows="3"></area-text>
|
</el-col>
|
</el-row>
|
|
<el-row v-if="badMsgTitle">
|
<!-- <p class="title" v-if="negativeMessages">负面信息</p> -->
|
<p class="title">负面信息</p>
|
<!-- <el-col :md="12" :lg="8" v-if="config.balanceblacklist.visible"> -->
|
<el-col :md="12" :lg="8" v-if="false">
|
<area-select :config="config.balanceblacklist" v-model="form.balanceblacklist"></area-select>
|
</el-col>
|
<!-- 开发商资金链情况 -->
|
<el-col :md="12" :lg="8" v-if="config.cashflow.visible">
|
<area-select :config="config.cashflow" v-model="form.cashflow" @change="cashflowChange()"></area-select>
|
</el-col>
|
<!-- 有无失信信息/法院涉诉 -->
|
<el-col :md="12" :lg="8" v-if="config.courtinvolved.visible">
|
<area-select :config="config.courtinvolved" v-model="form.courtinvolved"></area-select>
|
</el-col>
|
<!-- 现金流情况说明 -->
|
<el-col :span="24" v-if="config.cashflowexplain.visible" id="el-form-textarea">
|
<area-text :inputType="'textarea'" :inputRows="3" :config="config.cashflowexplain" v-model="form.cashflowexplain"></area-text>
|
</el-col>
|
<!-- 失信信息/法院涉诉情况说明 -->
|
<el-col :span="24" v-if="config.courtinvolvedexplain.visible" id="el-form-textarea">
|
<area-text :inputType="'textarea'" :inputRows="3" :config="config.courtinvolvedexplain" v-model="form.courtinvolvedexplain"></area-text>
|
</el-col>
|
|
|
|
</el-row>
|
</el-form>
|
</el-main>
|
</el-container>
|
</template>
|
|
<script>
|
import AreaInput from '@/views/area/components/AreaInput'
|
import AreaText from '@/views/area/components/AreaText'
|
import AreaSelect from '@/views/area/components/AreaSelect'
|
import AreaDate from '@/views/area/components/AreaDate'
|
import { queryDeveloperInformation, updateDeveloperInformation } from '@/api/area'
|
import { mapState } from 'vuex'
|
export default {
|
components: { AreaInput, AreaText, AreaSelect, AreaDate },
|
props: ['nextChange'],
|
data: function () {
|
return {
|
loading: true,
|
labelPosition: 'right',
|
writeAble: false,
|
rules: {},
|
form: {
|
developbrand: '', // 开发商品牌
|
developer: '', // 开发商项目公司名称
|
companyroperty: '', // 企业性质
|
iscompanylist: '', // 企业性质
|
companycapital: '', // 项目公司实缴资本
|
groupaptitude: '', // 开发商资质等级
|
developeraptitude: '', // 开发商资质等级
|
localsalemoneyrank: '', // 销售额排名
|
salemoney: '',// 销售额排名
|
localsalerank: '', // 当地销售排名
|
localdeveloped: '', // 当地住宅项目已开发量
|
localsaleexplain: '', // 当地开发及销售排名情况说明
|
cashflow: '', // 开发商资金链情况
|
courtinvolved: '', // 有无失信信息/法院涉诉
|
cashflowexplain: '', // 现金流情况说明
|
courtinvolvedexplain: '', // 失信信息/法院涉诉情况说明
|
|
whitebank: '',
|
developcoveredarea: '',
|
balanceblacklist: ''
|
|
},
|
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.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: {
|
getForm () {
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
queryDeveloperInformation(params).then(res => {
|
// console.log(res.result)
|
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)
|
updateDeveloperInformation(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)
|
updateDeveloperInformation(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)
|
updateDeveloperInformation(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
} else {
|
this.$message.warning('当前页面存在必填项未录入或数据录入错误,请检查!')
|
}
|
})
|
}
|
},
|
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
|
// >>> .el-form-item__content
|
// .el-textarea
|
// width 1200px
|
</style>
|