<!--/*
|
* @Author: Pengjiantian
|
* @Date: 2020-04-17 10:29:00
|
* @Last Modified by: Pengjiantian
|
* @Last Modified time: 2020-04-17 10:29:00
|
*/ -->
|
<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.developer.visible">
|
<area-input :config="config.developer" v-model="form.developer"></area-input>
|
</el-col>
|
<!-- 开发商社会信用代码 -->
|
<el-col :md="12" :lg="8" v-if="config.prosocialcreditcode.visible">
|
<area-input :config="config.prosocialcreditcode" v-model="form.prosocialcreditcode"></area-input>
|
</el-col>
|
<!-- 开发商品牌 -->
|
<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.protype.visible">
|
<area-select :config="config.protype" v-model="form.protype"></area-select>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<p class="title">项目信息</p>
|
<!-- 与开发商合作模式 -->
|
<el-col :md="12" :lg="8" v-if="config.cooperationmodel.visible">
|
<area-select :config="config.cooperationmodel" v-model="form.cooperationmodel"></area-select>
|
</el-col>
|
<!-- 项目名称 -->
|
<el-col :md="12" :lg="8" v-if="config.productname.visible">
|
<area-input :config="config.productname" v-model="form.productname"></area-input>
|
</el-col>
|
<!-- 项目编码 -->
|
<el-col :md="12" :lg="8" v-if="config.productnumber.visible">
|
<area-input :config="config.productnumber" v-model="form.productnumber"></area-input>
|
</el-col>
|
<!-- 项目所在省 -->
|
<el-col :md="12" :lg="8" v-if="config.registerprovince.visible">
|
<el-form-item label="项目所在省" prop="registerprovince" :rules="rules">
|
<el-select
|
v-model="form.registerprovince"
|
filterable
|
clearable
|
placeholder="请选择"
|
:disabled="!config.registerprovince.writeAble"
|
>
|
<el-option
|
v-for="item in registerprovinceOptions"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<!-- 项目所在市 -->
|
<el-col :md="12" :lg="8" v-if="config.registercitys.visible">
|
<el-form-item label="项目所在市 " prop="registercitys" :rules="rules">
|
<el-select
|
v-model="form.registercitys"
|
filterable
|
placeholder="请选择"
|
clearable
|
:disabled="!config.registercitys.writeAble"
|
>
|
<el-option
|
v-for="item in registercitysOptions"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<!-- 项目所在区 -->
|
<el-col :md="12" :lg="8" v-if="config.registercounty.visible">
|
<el-form-item label="项目所在区" prop="registercounty" :rules="rules">
|
<el-select
|
v-model="form.registercounty"
|
filterable
|
placeholder="请选择"
|
clearable
|
:disabled="!config.registercounty.writeAble"
|
>
|
<el-option
|
v-for="item in registercountyOptions"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<!-- 项目所在省 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.registerprovince.visible">
|
<area-select :config="config.registerprovince" v-model="form.registerprovince"></area-select>
|
</el-col>-->
|
<!-- 项目所在市 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.registercitys.visible">
|
<area-select :config="config.registercitys" v-model="form.registercitys"></area-select>
|
</el-col>-->
|
<!-- 项目所在区 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.registercounty.visible">
|
<area-select :config="config.registercounty" v-model="form.registercounty"></area-select>
|
</el-col>-->
|
<!-- 物业类型 -->
|
<el-col :md="12" :lg="8" v-if="config.property.visible">
|
<area-select :config="config.property" v-model="form.property"></area-select>
|
</el-col>
|
<!-- 预售许可证楼栋号 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.presalelicensebuildnum.visible">
|
<area-input
|
:config="config.presalelicensebuildnum"
|
v-model="form.presalelicensebuildnum"
|
></area-input>
|
</el-col> -->
|
<el-col :lg="24" v-if="config.presalelicensebuildnum.visible">
|
<area-text :config="config.presalelicensebuildnum" v-model="form.presalelicensebuildnum"></area-text>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<p class="title">开发商合同</p>
|
<!-- 签约主体 -->
|
<el-col :md="12" :lg="8" v-if="config.signcontractentity.visible">
|
<area-input :config="config.signcontractentity" v-model="form.signcontractentity"></area-input>
|
</el-col>
|
<!-- 合同名称 -->
|
<el-col :md="12" :lg="8" v-if="config.contractname.visible">
|
<area-input :config="config.contractname" v-model="form.contractname"></area-input>
|
</el-col>
|
<!-- 合同编号 -->
|
<el-col :md="12" :lg="8" v-if="config.contractno.visible">
|
<area-input :config="config.contractno" v-model="form.contractno"></area-input>
|
</el-col>
|
<!-- 合同执行生效日期 -->
|
<el-col :md="12" :lg="8" v-if="config.effectivedate.visible">
|
<area-date :config="config.effectivedate" v-model="form.effectivedate" :remove="true"></area-date>
|
</el-col>
|
<!-- 合同执行失效日期 -->
|
<el-col :md="12" :lg="8" v-if="config.expirationdate.visible">
|
<area-date :config="config.expirationdate" v-model="form.expirationdate" :remove="true"></area-date>
|
</el-col>
|
<!-- 成功销售条件 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.salesucconditions.visible">
|
<area-input :config="config.salesucconditions" v-model="form.salesucconditions"></area-input>
|
</el-col> -->
|
<el-col :lg="24" v-if="config.salesucconditions.visible">
|
<area-text :config="config.salesucconditions" v-model="form.salesucconditions"></area-text>
|
</el-col>
|
<!-- 结算条件 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.settleconditions.visible">
|
<area-input :config="config.settleconditions" v-model="form.settleconditions"></area-input>
|
</el-col> -->
|
<el-col :lg="24" v-if="config.settleconditions.visible">
|
<area-text :config="config.settleconditions" v-model="form.settleconditions"></area-text>
|
</el-col>
|
<!-- 佣金条件 -->
|
<!-- <el-col :md="12" :lg="8" v-if="config.commissionconditions.visible">
|
<area-input :config="config.commissionconditions" v-model="form.commissionconditions"></area-input>
|
</el-col> -->
|
<el-col :lg="24" v-if="config.commissionconditions.visible">
|
<area-text :config="config.commissionconditions" v-model="form.commissionconditions"></area-text>
|
</el-col>
|
<!-- 期限单位 -->
|
<el-col :md="12" :lg="8" v-if="config.termunit.visible">
|
<area-select :config="config.termunit" v-model="form.termunit"></area-select>
|
</el-col>
|
<!-- 佣金回款周期(天) -->
|
<el-col :md="12" :lg="8" v-if="config.rebateterm.visible">
|
<area-input-init :config="config.rebateterm" v-model="form.rebateterm" @changeValue="changeValue"></area-input-init>
|
</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 {
|
queryDeveloperProjectInformation,
|
updateDeveloperProjectInformation,
|
getProvinceCodeList,
|
getCityCodeList,
|
getAreaCodeList
|
} 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: {
|
developer: '', // 开发商名称
|
prosocialcreditcode: '', // 开发商社会信用代码
|
developbrand: '', // 开发商品牌
|
protype: '', // 开发商类型
|
cooperationmodel: '', // 与开发商合作模式
|
productname: '', // 项目名称
|
productnumber: '', // 项目编码
|
registerprovince: '', // 项目所在省
|
registercitys: '', // 项目所在市
|
registercounty: '', // 项目所在区
|
property: '', // 物业类型
|
presalelicensebuildnum: '', // 预售许可证楼栋号
|
signcontractentity: '', // 签约主体
|
contractname: '', // 合同名称
|
contractno: '', // 合同编号
|
effectivedate: '', // 合同执行生效日期
|
expirationdate: '', // 合同执行失效日期
|
salesucconditions: '', // 成功销售条件
|
settleconditions: '', // 结算条件
|
commissionconditions: '', // 佣金条件
|
termunit: '', // 期限单位
|
rebateterm: '' // 佣金回款周期(天)
|
},
|
oldForm: {},
|
config: {},
|
// 省市区
|
registerprovinceOptions: [],
|
registercitysOptions: [],
|
registercountyOptions: []
|
}
|
},
|
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 = ''
|
}
|
},
|
// 省市区联动
|
'form.registerprovince': function(value, oldValue) {
|
if (value) {
|
this.getCityCodeList(value)
|
}
|
if (value !== oldValue && oldValue) {
|
this.form.registercitys = ''
|
}
|
// getCityCodeList(params).then(res => {
|
// this.registercitysOptions = res.result
|
// })
|
// this.form.registercitys = ''
|
// this.form.registercounty = ''
|
},
|
'form.registercitys': function(value, oldValue) {
|
if (value) {
|
this.getAreaCodeList(value)
|
}
|
if (value !== oldValue && oldValue) {
|
this.form.registercounty = ''
|
}
|
}
|
},
|
created() {
|
this.initForm()
|
this.getForm()
|
this.getProvinceCodeList()
|
},
|
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
|
}
|
queryDeveloperProjectInformation(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)
|
})
|
},
|
getProvinceCodeList() {
|
// 查询省
|
getProvinceCodeList({}).then(res => {
|
this.registerprovinceOptions = res.result
|
})
|
},
|
getCityCodeList(value) {
|
let params = {
|
codeNo: 'AreaCode',
|
itmeNo: value
|
}
|
getCityCodeList(params).then(res => {
|
this.registercitysOptions = res.result
|
})
|
},
|
getAreaCodeList(value) {
|
let params = {
|
codeNo: 'AreaCode',
|
itmeNo: value
|
}
|
getAreaCodeList(params).then(res => {
|
this.registercountyOptions = res.result
|
})
|
},
|
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)
|
updateDeveloperProjectInformation(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)
|
updateDeveloperProjectInformation(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)
|
updateDeveloperProjectInformation(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>
|