<!--
|
* @Author: your name
|
* @Date: 2019-10-21 15:40:58
|
* @LastEditTime: 2019-11-22 15:16:20
|
* @LastEditors: Please set LastEditors
|
* @Description: In User Settings Edit
|
* @FilePath: /e:\Demo\cts-web\src\views\area\projectManagement\add\ProjectReg.vue
|
-->
|
<template>
|
<el-container>
|
<el-main style="padding:0px">
|
<el-form :label-position="labelPosition" :model="form">
|
<!-- <el-row>
|
<p class="title">基本信息</p>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请编号">
|
<el-input v-model="form.serNo" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请人姓名">
|
<el-input v-model="form.applyName" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请人工号">
|
<el-input v-model="form.applyUserId" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请人直属机构">
|
<el-input v-model="form.applyOrgName" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请人所属一级内部机构">
|
<el-input v-model="form.applyFirstLevelOrgName" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
<el-col :md="12" :lg="8">
|
<el-form-item label="申请时间">
|
<el-input v-model="form.applyDate" readonly></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row> -->
|
<el-row>
|
<p class="title">开通产品信息</p>
|
<project-reg-table></project-reg-table>
|
</el-row>
|
</el-form>
|
<div v-if="detailsParams.projectType !== '3'">
|
<el-form :label-position="labelPosition" :model="creditForm" :rules="rules">
|
<el-row>
|
<p
|
class="title message"
|
v-if="creditForm.creditAmount.visible && detailsParams.opertion !== '02'"
|
>授信信息</p>
|
<el-col :md="12" :lg="8" v-if="creditForm.creditAmount.visible && detailsParams.opertion !== '02'">
|
<el-form-item label="授信额度(元):" prop="creditAmount">
|
<el-input v-model="creditForm.creditAmount.value" :readonly="!creditForm.creditAmount.writeAble"></el-input>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
<!-- 申报信息 -->
|
<!-- <el-form ref="form" :label-position="labelPosition" :model="reportForm">
|
<el-row>
|
<p class="title">申报信息</p>
|
<el-col :span="24" v-if="reportConfig.remark.visible" class="el-form-textarea">
|
<area-text
|
:input-type="'textarea'"
|
:input-rows="3"
|
:config="reportConfig.remark"
|
:placeholder="applyInfoTip"
|
v-model="reportForm.remark"
|
:placeholderContent="'地区申请项目准入需严格履行尽调责任,请简要概括含楼盘介绍、开发商股东及历史开发楼盘介绍、本项目优劣势及风险点提示等信息。'"
|
></area-text>
|
</el-col>
|
</el-row>
|
<el-row v-if="reportConfig.changetype.visible">
|
<el-col :span="8">
|
<area-select
|
:config="reportConfig.changetype"
|
v-model="reportForm.changetype"
|
class="changeType"
|
></area-select>
|
</el-col>
|
</el-row>
|
<el-row v-if="reportConfig.changeinfo.visible">
|
<el-col :span="24" class="el-form-textarea">
|
<area-text
|
:input-type="'textarea'"
|
:input-rows="3"
|
:config="reportConfig.changeinfo"
|
v-model="reportForm.changeinfo"
|
></area-text>
|
</el-col>
|
</el-row>
|
</el-form> -->
|
</div>
|
</el-main>
|
</el-container>
|
</template>
|
|
<script>
|
import {
|
queryApprovalBaseInfo,
|
queryApplyCreditAmountInfo,
|
insertOrUpdateProductInfo,
|
queryProjectProductInfos,
|
queryProjectDeclarationInfo,
|
updateProjectDeclarationInfo
|
} from '@/api/area'
|
import { mapState } from 'vuex'
|
import ProjectRegTable from './components/ProjectRegTable'
|
import AreaInput from '../../components/AreaInput'
|
import AreaText from '../../components/AreaText'
|
import AreaSelect from '../../components/AreaSelect'
|
export default {
|
components: { ProjectRegTable, AreaInput, AreaText, AreaSelect },
|
props: ['nextChange'],
|
data: function() {
|
return {
|
labelPosition: 'right',
|
form: {
|
serNo: '',
|
applyName: '',
|
applyUserId: '',
|
applyOrgId: '',
|
applyOrgName: '',
|
applyFirstLevelOrgId: '',
|
applyFirstLevelOrgName: '',
|
applyDate: ''
|
},
|
config: {},
|
creditForm: {
|
creditAmount: ''
|
},
|
oldForm: {
|
creditAmount: ''
|
},
|
creditAmount: {
|
visible: false,
|
required: false,
|
writeAble: false
|
},
|
rules: {
|
creditAmount: {
|
required: true,
|
message: '请输入授信信息',
|
trigger: 'blur'
|
}
|
},
|
reportForm: {
|
remark: '',
|
changetype: '',
|
changeinfo: ''
|
},
|
oldReportForm:{
|
remark:'',
|
changeinfo:''
|
},
|
reportConfig: {},
|
isReportSubmit: true, // 是否需要再次调用reportSubmit方法
|
applyInfoTip:
|
'地区申请项目准入需严格履行尽调责任,请简要概括含楼盘介绍、开发商股东及历史开发楼盘介绍、本项目优劣势及风险点提示等信息。'
|
}
|
},
|
computed: {
|
...mapState({
|
detailsParams: state => state.risk.detailsParams
|
})
|
},
|
created() {
|
this.initForm()
|
},
|
methods: {
|
initForm() {
|
// 初始化表单
|
const { menuPhaseNo } = this.detailsParams
|
this.reportConfig = Object.assign({}, this.reportConfig, this.reportForm)
|
Object.keys(this.reportConfig).forEach(key => {
|
let params = {
|
visible: false,
|
required: false,
|
writeAble: false
|
}
|
this.$set(this.reportConfig, key, params)
|
})
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
// 查看基本信息
|
queryApprovalBaseInfo(params).then(res => {
|
this.form = res.result
|
})
|
if (this.detailsParams.projectType !== 3) {
|
// 查询授信额度
|
queryApplyCreditAmountInfo(params).then(res => {
|
this.creditForm.creditAmount = res.result.position
|
this.oldForm.creditAmount = this.creditForm.creditAmount.value
|
// this.creditAmount = res.result.position
|
// this.oldForm = res.result.position
|
})
|
}
|
// 查看申报信息
|
queryProjectDeclarationInfo(params).then(res => {
|
this.reportConfig = this._.merge(this.reportConfig, res.result)
|
Object.keys(this.reportForm).forEach(key => {
|
this.$set(this.reportForm, key, this.reportConfig[key].value)
|
})
|
this.oldReportForm.changeinfo = res.result.changeinfo ? res.result.changeinfo.value :''
|
this.oldReportForm.remark = res.result.remark.value
|
if (menuPhaseNo === '0040' || menuPhaseNo === '0050') {
|
this.reportConfig.changeinfo.writeAble = false
|
}
|
})
|
},
|
submitForm() {
|
this.$emit('handleNextPage', true)
|
return
|
if (this.detailsParams.projectType !== '3') {
|
let params = {
|
objecttype: this.detailsParams.objectType,
|
position: Number(this.creditForm.creditAmount.value),
|
serialno: this.detailsParams.objectNo
|
}
|
insertOrUpdateProductInfo(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
// this.$emit('handleNextPage', true)
|
if (this.isReportSubmit) {
|
this.reportSubmit()
|
} else {
|
this.$emit('handleNextPage', true)
|
}
|
}
|
})
|
} else {
|
this.$emit('handleNextPage', true)
|
}
|
/* // 前端对表格有无数据校验。现由后台校验返回
|
let params = {
|
objectType: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
projectFlag: this.detailsParams.projectFlag,
|
projectType: this.detailsParams.projectType,
|
serialno: this.detailsParams.objectNo
|
}
|
queryProjectProductInfos(params).then(res => {
|
if(res.result.total > 0){
|
let params = {
|
objecttype: this.detailsParams.objectType,
|
position: Number(this.creditForm.creditAmount),
|
serialno: this.detailsParams.objectNo
|
}
|
insertOrUpdateProductInfo(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
this.$emit('handleNextPage', true)
|
}
|
})
|
}else{
|
this.$message.warning('请先录入产品信息!')
|
}
|
}) */
|
},
|
reportSubmit() {
|
this.$refs['form'].validate(async valid => {
|
if (valid) {
|
let params = {
|
remark: this.reportForm.remark,
|
changeinfo: this.reportForm.changeinfo,
|
changetype: this.reportForm.changetype,
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
dataType: this.detailsParams.dataType,
|
isTempSave: false
|
}
|
const { code } = await updateProjectDeclarationInfo(params)
|
if (code === '00') {
|
this.$emit('handleNextPage', true)
|
}
|
} else {
|
this.$message.warning(
|
'当前页面存在必填项未录入或数据录入错误,请检查!'
|
)
|
}
|
})
|
},
|
handleSave(saveOpinion) {
|
// console.log(saveOpinion)
|
this.$refs['form'].validate(valid => {
|
if (valid) {
|
let params = {
|
objecttype: this.detailsParams.objectType,
|
position: Number(this.creditForm.creditAmount.value),
|
serialno: this.detailsParams.objectNo
|
}
|
if (this.detailsParams.projectType !== '3') {
|
this.reportSave()
|
}
|
insertOrUpdateProductInfo(params).then(res => {
|
if (res.code === '00') {
|
if (!saveOpinion) {
|
this.oldForm.creditAmount = this.creditForm.creditAmount.value
|
} else {
|
if (this.detailsParams.projectType === '3') {
|
this.$message.success('保存成功')
|
}
|
this.$emit('commitSaveBefore', true)
|
}
|
} else {
|
this.$emit('commitSaveBefore', false)
|
}
|
})
|
|
} else {
|
this.$message.warning(
|
'当前页面存在必填项未录入或数据录入错误,请检查!'
|
)
|
}
|
})
|
},
|
handleSaveDraft() {
|
// this.$message.success('保存成功!')
|
this.isReportSubmit = false
|
if (this.detailsParams.projectType === '3') {
|
this.$message.success('保存成功')
|
} else {
|
this.reportSave()
|
this.oldForm.creditAmount = this.creditForm.creditAmount.value
|
}
|
},
|
reportSave() {
|
let params = {
|
remark: this.reportForm.remark,
|
changeinfo: this.reportForm.changeinfo,
|
changetype: this.reportForm.changetype,
|
serialno: this.detailsParams.objectNo,
|
objecttype: this.detailsParams.objectType,
|
position: Number(this.creditForm.creditAmount),
|
serialno: this.detailsParams.objectNo
|
}
|
insertOrUpdateProductInfo(params).then(res => {
|
if (res.code === '00') {
|
if (!saveOpinion) {
|
this.$message.success('保存成功')
|
this.oldForm.creditAmount = this.creditForm.creditAmount
|
} else {
|
this.$emit('commitSaveBefore', true)
|
}
|
} else {
|
this.$emit('commitSaveBefore', false)
|
}
|
})
|
},
|
handleSaveDraft () {
|
// console.log(saveOpinion)
|
// let params = {
|
// objecttype: this.detailsParams.objectType,
|
// position: Number(this.creditForm.creditAmount),
|
// serialno: this.detailsParams.objectNo
|
// }
|
// insertOrUpdateProductInfo(params).then(res => {
|
// if (res.code === '00') {
|
// this.$message.success('保存成功!')
|
// }else{
|
// this.$emit('commitSaveBefore',false)
|
// }
|
// })
|
// 申请信息页面。基本信息都是只读的
|
this.$message.success('保存成功!')
|
this.creditForm.creditAmount = this.oldForm.creditAmount
|
}
|
},
|
beforeRouteLeave(to, from, next) {
|
if (this.detailsParams.menuPhaseNo === '0040' || this.detailsParams.menuPhaseNo === '0050') {
|
this.reportForm.changeinfo = this.oldReportForm.changeinfo
|
}
|
if (this.nextChange && this.detailsParams.projectType !== '3') {
|
if (this.creditForm.creditAmount.value != this.oldForm.creditAmount || this.reportForm.changeinfo && (this.reportForm.changeinfo != this.oldReportForm.changeinfo )|| this.reportForm.remark != this.oldReportForm.remark) {
|
this.$confirm(`当前页面有未保存的数据,是否放弃保存`, '提示', {
|
confirmButtonText: '是',
|
cancelButtonText: '否',
|
customClass: 'pro_messages_box',
|
confirmButtonClass: 'pro_messages_box_confirm',
|
cancelButtonClass: 'pro_messages_box_cancel',
|
center: true
|
})
|
.then(() => {
|
next()
|
})
|
.catch(() => {})
|
return
|
}
|
}
|
next()
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
.title.message {
|
margin-top: 22px;
|
}
|
|
.changeType {
|
/deep/ .el-form-item__label {
|
width: 145px !important;
|
}
|
}
|
</style>
|