<template>
|
<div>
|
<el-dialog :visible.sync="ownerVisible" :modal-append-to-body='false' :close-on-click-modal='false' @close="closeDialog" center>
|
<el-table stripe highlight-current-row :data="owners" :header-cell-style="{background:'#f5f5f5',color:'#222222'}" @selection-change="handleSelectionChange">
|
<el-table-column
|
type="selection"
|
width="55">
|
</el-table-column>
|
<el-table-column prop="customerName" label="客户姓名"></el-table-column>
|
<el-table-column prop="certTypeName" label="证件类型"></el-table-column>
|
<el-table-column prop="certId" label="身份证号"></el-table-column>
|
<el-table-column prop="relationShipName" label="与借款人关系"></el-table-column>
|
</el-table>
|
<span slot="footer" class="dialog-footer">
|
<el-button plain @click="closeDialog">返回</el-button>
|
<el-button type="primary" @click="submit">确定</el-button>
|
</span>
|
</el-dialog>
|
</div>
|
</template>
|
<script>
|
import {
|
selectPropertyInfo,
|
qryPropertyList,
|
saveProperty
|
} from "@/api/product";
|
export default {
|
props:['visible','propertyData','index'],
|
data () {
|
return {
|
owners:[],
|
owner:'',
|
ownerVisible:true,
|
selectOwners:[]
|
}
|
},
|
async created () {
|
this.getPropertyInfo()
|
},
|
methods: {
|
// 获取当前选中行
|
handleSelectionChange(array) {
|
if(this.propertyData.propertyList){
|
const arr = this.propertyData.propertyList
|
for (let i = 0; i < arr.length; i++) {
|
for (let j = 0; j < array.length; j++) {
|
if(array[j].certId==arr[i].certid&&array[j].certType==arr[i].certtype&&array[j].customerName==arr[i].propertyowner){
|
this.$message.warning('产权人已存在,请重新选择')
|
return;
|
}
|
}
|
}
|
}else{
|
this.propertyData.propertyList = []
|
}
|
this.selectOwners = array
|
},
|
// 查询产权人信息
|
async getPropertyList(){
|
const res = await qryPropertyList({
|
applyserialno: this.$store.state.product.applyInfo.serialNo,
|
relativeserialno:this.propertyData.serialno
|
})
|
const arr = []
|
if(res.result.length){
|
res.result.forEach(val => {
|
const obj = {}
|
for (const key in val) {
|
obj[key] = val[key].value
|
obj.certtypeDesc = val['certtype'].valueDesc
|
}
|
arr.push(obj)
|
});
|
}
|
this.propertyData.index = this.index
|
this.propertyData.propertyList = arr
|
this.$emit('sendPropertyForm',this.propertyData)
|
this.$emit('closeDialog',false)
|
},
|
submit(){
|
if(!this.selectOwners.length){
|
this.$message.warning('请选择产权人')
|
return;
|
}
|
let arr = []
|
if(this.propertyData.propertyList){
|
arr = this.propertyData.propertyList
|
}
|
this.eachArray(this.selectOwners).forEach(val => {
|
arr.push(val)
|
});
|
this.propertyData.index = this.index
|
this.propertyData.propertyList = arr
|
this.$emit('sendPropertyForm',this.propertyData)
|
this.$emit('closeDialog',this.index)
|
},
|
eachArray(array){
|
const arr = []
|
array.forEach(val => {
|
const obj = {
|
applyserialno:this.$store.state.product.applyInfo.serialNo,
|
propertyowner:val.customerName,
|
certtype:val.certType,
|
certtypeDesc:val.certTypeName,
|
certid:val.certId,
|
}
|
if(this.propertyData.serialno){
|
obj.relativeserialno = this.propertyData.serialno
|
}
|
arr.push(obj)
|
});
|
return arr
|
},
|
closeDialog(){
|
this.$emit('closeDialog',this.index)
|
},
|
// 查询产权人列表
|
getPropertyInfo(){
|
selectPropertyInfo({applySerialNo:this.$store.state.product.applyInfo.serialNo}).then(res=>{
|
this.owners = res.result
|
})
|
}
|
}
|
}
|
</script>
|
<style lang="stylus" scoped>
|
div
|
&>>>.el-dialog
|
width auto
|
max-width calc(100% - 180px)
|
min-width 850px
|
max-height 100%
|
overflow hidden
|
margin 0 !important
|
position absolute
|
left 50%
|
top 50%
|
transform translate(-50%,-50%)
|
.el-dialog__body
|
padding 0
|
margin 56px 20px 20px
|
max-height 576px
|
overflow auto
|
.el-dialog__header
|
padding 0
|
.el-dialog__footer
|
padding 0 0 20px
|
.el-button
|
width: 120px
|
font-size: 14px
|
line-height: 20px
|
padding: 5px 0
|
</style>
|