<template>
|
<div>
|
<el-container>
|
<el-main style="padding:0px">
|
<el-form :label-position="labelPosition" :model="form">
|
<el-row>
|
<p class="title">申报信息</p>
|
<el-col :span="24" v-if="config.remark.visible" class="el-form-textarea">
|
<area-text
|
:input-type="'textarea'"
|
:input-rows="3"
|
:config="config.remark"
|
:placeholder="applyInfoTip"
|
v-model="form.remark"
|
:placeholderContent="'地区申请项目准入需严格履行尽调责任,请简要概括含楼盘介绍、开发商股东及历史开发楼盘介绍、本项目优劣势及风险点提示等信息。'"
|
></area-text>
|
</el-col>
|
</el-row>
|
<el-row v-if="config.changetype.visible">
|
<el-col :span="8">
|
<!-- <el-form-item :label="config.changetype.filedDescription" class="changeType">
|
<el-select v-model="value" placeholder="请选择" :disabled="config.changetype.writeAble" >
|
<el-option
|
v-for="item in options"
|
:key="item.value"
|
:label="item.valueDesc"
|
:value="item.value">
|
</el-option>
|
</el-select>
|
</el-form-item> -->
|
<area-select :config="config.changetype" v-model="form.changetype" class="changeType"></area-select>
|
</el-col>
|
</el-row>
|
<el-row v-if="config.changeinfo.visible">
|
<el-col :span="24" class="el-form-textarea">
|
<!-- <el-input type="textarea" :rows="5" v-model="config.changeinfo.value" :readonly="!config.changeinfo.writeAble" resize="none" ></el-input> -->
|
<area-text
|
:input-type="'textarea'"
|
:input-rows="3"
|
:config="config.changeinfo"
|
v-model="form.changeinfo"
|
></area-text>
|
</el-col>
|
</el-row>
|
</el-form>
|
</el-main>
|
</el-container>
|
</div>
|
</template>
|
|
<script>
|
import { queryProjectDeclarationInfo, updateProjectDeclarationInfo, projectQrycondition } from '@/api/area'
|
import { mapState } from 'vuex'
|
import AreaInput from '../../components/AreaInput'
|
import AreaText from '../../components/AreaText'
|
import AreaSelect from '../../components/AreaSelect'
|
export default {
|
// 申报信息
|
components: { AreaInput, AreaText, AreaSelect },
|
props: ['nextChange'],
|
data: function() {
|
return {
|
labelPosition: 'right',
|
form: {
|
remark: '',
|
changetype: '',
|
changeinfo: ''
|
},
|
oldForm: {},
|
options: '',
|
value: '',
|
config: {},
|
applyInfoTip: '地区申请项目准入需严格履行尽调责任,请简要概括含楼盘介绍、开发商股东及历史开发楼盘介绍、本项目优劣势及风险点提示等信息。'
|
}
|
},
|
computed: {
|
...mapState({
|
detailsParams: state => state.risk.detailsParams
|
})
|
},
|
created() {
|
this.nextChangeCopy = this.nextChange
|
this.getForm()
|
},
|
methods: {
|
getForm() {
|
// 初始化表单
|
const { menuPhaseNo } = this.detailsParams
|
this.config = Object.assign({}, this.config, this.form)
|
Object.keys(this.config).forEach(key => {
|
let params = {
|
visible: false,
|
required: false,
|
writeAble: false
|
}
|
this.$set(this.config, key, params)
|
})
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
queryProjectDeclarationInfo(params).then(res => {
|
this.config = this._.merge(this.config, res.result)
|
if (res.result.hasOwnProperty('changetype') && res.result.hasOwnProperty('changeinfo')) {
|
this.getChangeType()
|
}
|
Object.keys(this.form).forEach(key => {
|
this.$set(this.form, key, this.config[key].value)
|
})
|
if (menuPhaseNo === '0040' || menuPhaseNo === '0050') {
|
this.config.changeinfo.writeAble = false
|
}
|
Object.assign(this.oldForm, this.form)
|
// console.log(this.oldForm)
|
})
|
},
|
submitForm() {
|
let params = {
|
remark: this.form.remark,
|
changeinfo: this.form.changeinfo,
|
changetype: this.form.changetype,
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: false
|
}
|
Object.assign(params, this.form)
|
updateProjectDeclarationInfo(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success(res.result.resultsDesc)
|
this.$emit('handleNextPage', true)
|
}
|
})
|
},
|
handleSave(saveOpinion) {
|
let params = {
|
remark: this.form.remark,
|
changeinfo: this.form.changeinfo,
|
changetype: this.form.changetype,
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: true
|
}
|
updateProjectDeclarationInfo(params).then(res => {
|
if (res.code === '00') {
|
if (!saveOpinion) {
|
this.$message.success('保存成功!')
|
this.nextChangeCopy = false
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
} else {
|
this.$emit('commitSaveBefore', true)
|
this.nextChangeCopy = false
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
// this.$message.success(res.result.resultsDesc)
|
// return true
|
} else {
|
this.$emit('commitSaveBefore', false)
|
}
|
})
|
},
|
handleSaveDraft() {
|
let params = {
|
remark: this.form.remark,
|
changeinfo: this.form.changeinfo,
|
changetype: this.form.changetype,
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: false
|
}
|
Object.assign(params, this.form)
|
updateProjectDeclarationInfo(params).then(res => {
|
if (res.code === '00') {
|
this.$message.success('保存成功')
|
// this.$emit('handleNextPage', true)
|
this.oldForm = Object.assign(this.oldForm, this.form)
|
}
|
})
|
},
|
getChangeType() {
|
let params = { conditionName: this.config.changetype.codeNo }
|
projectQrycondition(params).then(res => {
|
this.options = res.result
|
})
|
}
|
},
|
beforeRouteLeave (to, from, next) {
|
// console.log(this.form)
|
// console.log(this.oldForm)
|
// console.log(this.nextChange)
|
if (this.nextChangeCopy) {
|
for (const key in this.oldForm) {
|
if (this.oldForm.hasOwnProperty(key)) {
|
if (this.oldForm[key] != this.form[key]) {
|
this.$confirm(`当前页面有未保存的数据,是否放弃保存`, '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
customClass: 'pro_messages_box',
|
confirmButtonClass: 'pro_messages_box_confirm',
|
cancelButtonClass: 'pro_messages_box_cancel',
|
center: true
|
})
|
.then(() => {
|
// this.$emit('realJumpPage',true)
|
next()
|
})
|
.catch(() => {
|
// this.$emit('realJumpPage',false)
|
this.$emit('notNext')
|
})
|
return
|
}
|
}
|
}
|
}
|
next()
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
.changeType
|
/deep/ .el-form-item__label
|
width 145px !important
|
</style>
|