<template>
|
<div class="product">
|
<div class="borrower">
|
<p class="title">
|
<span></span>
|
股东信息
|
</p>
|
<el-button
|
type="primary"
|
icon="el-icon-circle-plus-outline"
|
v-if="applyInfo.phaseNo <='0060' && !isReadonly"
|
@click="addShareholder"
|
size="medium"
|
>新增</el-button
|
>
|
<!-- <el-button
|
type="primary"
|
icon="el-icon-circle-plus-outline"
|
size="medium"
|
@click="selectOwner"
|
v-if="
|
(applyInfo.flowno == 'MortgageFlow' ||
|
applyInfo.flowno == 'BuildingBusinessFlow') &&
|
show
|
"
|
>选择产权人</el-button
|
> -->
|
<el-table
|
stripe
|
:data="shareholderData"
|
style="margin-top: 30px"
|
highlight-current-row
|
:cell-style="cell"
|
:header-cell-style="{ background: '#f5f5f5', color: '#222222' }"
|
>
|
<el-table-column min-width="150">
|
<template slot="header">
|
<span>
|
<!-- <span class="red-star">*</span> -->
|
<span style="padding-left: 8px">股东类别</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.shareholderclassifyCn
|
}}</span>
|
<el-select
|
style="display: block; padding-left: 15px"
|
v-model="row.shareholderclassify"
|
filterable
|
placeholder="请选择"
|
size="small"
|
v-show="row.isEdit"
|
@change="handleShareholderclassifyChange(row,row.shareholderclassify)"
|
>
|
<el-option
|
v-for="item in shareholderclassifyList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column min-width="150">
|
<template slot="header">
|
<span>
|
<!-- <span class="red-star">*</span> -->
|
<span style="padding-left: 8px">股东类型</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.shareholdertypeCn
|
}}</span>
|
<el-select
|
style="display: block; padding-left: 15px"
|
v-model="row.shareholdertype"
|
filterable
|
placeholder="请选择"
|
size="small"
|
v-show="row.isEdit"
|
@change="handleShareholdertypeChange(row,row.shareholdertype)"
|
>
|
<el-option
|
v-for="item in shareholderTypeList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<!-- <span class="red-star">*</span> -->
|
<span style="padding-left: 8px">所属企业</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.customername
|
}}</span>
|
<el-select
|
style="display: block; padding-left: 15px"
|
v-model="row.customerid"
|
filterable
|
placeholder="请选择"
|
size="small"
|
v-show="row.isEdit"
|
@change="handleCustomerChange(row,row.customerid)"
|
>
|
<el-option
|
v-for="item in customerList"
|
:key="item.customerid"
|
:label="item.customername"
|
:value="item.customerid"
|
></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">股东名称</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 15px" v-show="!row.isEdit">{{
|
row.shareholdername
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
size="small"
|
v-show="row.isEdit"
|
v-model="row.shareholdername"
|
placeholder="请输入"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">证件类型</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.certtypeCn
|
}}</span>
|
<el-select
|
style="display: block; padding-left: 15px"
|
v-model="row.certtype"
|
filterable
|
placeholder="请选择"
|
size="small"
|
v-show="row.isEdit"
|
disabled
|
>
|
<el-option
|
v-for="item in certtypeList"
|
:key="item.itemno"
|
:label="item.itemname"
|
:value="item.itemno"
|
></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">证件号码</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.certid
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
maxlength="50"
|
size="small"
|
v-show="row.isEdit"
|
v-model="row.certid"
|
placeholder="请输入"
|
@change="row.certid = row.certid.toUpperCase()"
|
></el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">电话号码</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.phone
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
maxlength="50"
|
size="small"
|
v-show="row.isEdit"
|
v-model.trim="row.phone"
|
placeholder="请输入"
|
></el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">股东联系人姓名</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.shareholderContactsName?row.shareholderContactsName:'--'
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
maxlength="50"
|
size="small"
|
v-show="row.isEdit"
|
v-model="row.shareholderContactsName"
|
placeholder="股东为企业时输入"
|
></el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">股东联系人证件号码</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.shareholderContactsIDNum?row.shareholderContactsIDNum:'--'
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
maxlength="50"
|
size="small"
|
v-show="row.isEdit"
|
v-model="row.shareholderContactsIDNum"
|
placeholder="股东为企业时输入"
|
></el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column min-width="200">
|
<template slot="header">
|
<span>
|
<span style="padding-left: 8px">股东联系人手机号</span>
|
</span>
|
</template>
|
<template slot-scope="{ row }">
|
<span style="padding-left: 8px" v-show="!row.isEdit">{{
|
row.shareholderContactsPhone?row.shareholderContactsPhone:'--'
|
}}</span>
|
<el-input
|
style="padding-left: 15px"
|
maxlength="50"
|
size="small"
|
v-show="row.isEdit"
|
v-model="row.shareholderContactsPhone"
|
placeholder="股东为企业时输入"
|
></el-input>
|
</template>
|
</el-table-column>
|
|
<el-table-column label="股东信息管理" min-width="110" v-if="applyInfo.phaseNo <= '0060' && !isReadonly">
|
<template slot-scope="scope">
|
<el-button
|
type="text"
|
@click.native="handleEdit(scope.row)"
|
v-if="!scope.row.isEdit"
|
>修改</el-button
|
>
|
<el-button
|
type="text"
|
@click.native="handleSave(scope.row, scope.$index)"
|
v-else
|
>保存</el-button
|
>
|
<el-button
|
type="text"
|
@click.native="handleCancel(scope.row, scope.$index)"
|
v-if="scope.row.isCancel"
|
>取消</el-button
|
>
|
<el-button
|
type="text"
|
@click.native="handleDelete(scope.row, scope.$index)"
|
v-else
|
>删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
<el-pagination
|
background
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page.sync="currentPage"
|
:page-sizes="[10, 20, 50, 100]"
|
:page-size="10"
|
layout="prev, pager, next, jumper, total, sizes"
|
:total="total"
|
></el-pagination>
|
</div>
|
|
<div class="btn">
|
<!-- <el-button
|
size="medium"
|
plain
|
@click="saveDraft(shareholderForm)"
|
v-if="applyInfo.phaseNo == '0040' || applyInfo.phaseNo == '0010'"
|
>保存草稿</el-button
|
> -->
|
<el-button
|
size="medium"
|
plain
|
@click="prevStep"
|
v-if="(applyInfo.phaseNo == '0040' || applyInfo.phaseNo == '0010') && !isReadonly"
|
>上一步</el-button
|
>
|
<el-button
|
size="medium"
|
plain
|
@click="prevStep"
|
v-else
|
>上一步</el-button
|
>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="submit(shareholderForm)"
|
v-if="(applyInfo.phaseNo == '0040' || applyInfo.phaseNo == '0010' || applyInfo.phaseNo == '0060') && !isReadonly"
|
>下一步</el-button
|
>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="nextPage"
|
v-else
|
>下一步</el-button
|
>
|
</div>
|
</div>
|
</template>
|
<script>
|
import {
|
qryPropertyList,
|
getDictionaryList,
|
delProperty,
|
saveProperty,
|
qryEnpShareholderInfo, //查询股东信息
|
addOrUpdateShareholderInfo, //新增股东信息
|
delShareholderInfo, //删除股东信息
|
getShareholderEnt,
|
qryGuarantorOrCoBorrower
|
} from "@api/product";
|
import { setStorage, getStorage } from "@/utils/storage";
|
import common from "@/utils/common";
|
import { CPCHANNELOPTIONS } from "../../../../comprehensiveTransaction/utils/optionsConfig";
|
let phoneExp = new RegExp(/^1(2|3|4|5|6|7|8|9)\d{9}$/);
|
let representativeIDExp = new RegExp(
|
/^\d{6}(18|19|20)?\d{2}(0[1-9]|1[012])(0[1-9]|[12]\d|3[01])\d{3}(\d|[xX])$/
|
);
|
|
export default {
|
data() {
|
return {
|
applyInfo: this.$store.state.product.applyInfo,
|
applyMenu: this.$store.state.product.applyMenu,
|
ownerData: [],
|
ownerForm: [],
|
initialArr: [],
|
certtypeList: [],
|
customerList: [],
|
shareholderData: [], //股东数据本地增删改
|
shareholderForm: [], //服务器返回股东数据
|
shareholderTypeList: [], //股东类型
|
shareholderclassifyList: [], //股东类别
|
guarantorData:[], // 担保人信息
|
total: 0,
|
currentPage: 1,
|
loanApprovalApply: {
|
isHandle: "00",
|
phaseFlag: "03",
|
projectname: "",
|
serialNo: "",
|
currentPage: "1",
|
pageSize: "10"
|
},
|
};
|
},
|
computed: {
|
isReadonly() {
|
return this.$parent._data.applyMenu[this.$parent._data.activeIndex].readonly == 'Y'
|
}
|
// isowner() {
|
// return this.propertyData.isowner;
|
// },
|
},
|
watch: {
|
|
},
|
async created() {
|
const that = this;
|
//查询股东信息
|
|
// qryEnpShareholderInfo({
|
// objectno: this.applyInfo.serialNo,
|
// objecttype: "jbo.app.SHAREHOLDER_INFO",
|
// }).then((res) => {
|
// this.shareholderData = [];
|
// this.initialArr = [];
|
// this.shareholderForm = res.result;
|
// if (res.result.records.length) {
|
// res.result.records.forEach((val) => {
|
// const obj = {};
|
// for (const key in val) {
|
// obj[key] = val[key];
|
// // obj.certtypeDesc = val["certtype"].valueDesc;
|
// }
|
|
// this.shareholderData.push(obj);
|
// this.initialArr.push(Object.assign({}, obj));
|
// });
|
// }
|
// });
|
this.getEnpShareholderInfo(this.loanApprovalApply)
|
this.getEnpGuarantorInfo()
|
// 证件类型列表
|
this.qryDictionaryList("ShareholderType", function (arr) {
|
that.shareholderTypeList = arr;
|
});
|
this.qryDictionaryList("CertType", function (arr) {
|
that.certtypeList = arr;
|
});
|
this.qryDictionaryList("ShareholderClassify", function (arr) {
|
that.shareholderclassifyList = arr;
|
});
|
//股东类别
|
|
this.customerList = await this.getShareholderEnt()
|
|
},
|
methods: {
|
//查询担保人信息
|
getEnpGuarantorInfo() {
|
if (!this.applyInfo.serialNo) return;
|
qryGuarantorOrCoBorrower({
|
applySerialNo: this.applyInfo.serialNo,
|
customerId: this.applyInfo.customerid,
|
relationtype: '02'
|
}).then((res) => {
|
this.guarantorData = [];
|
if (res.result.length) {
|
res.result.forEach((val) => {
|
const obj = {};
|
for (const key in val) {
|
obj[key] = val[key];
|
}
|
this.guarantorData.push(obj);
|
});
|
}
|
});
|
},
|
//单元格css
|
cell({ row, column, rowIndex, columnIndex }) {
|
const { applyInfo, index } = this;
|
const { refuseFlag } = applyInfo;
|
if (refuseFlag == 1) {
|
const { houseInfoBatch } = this.$store.state.product.fields;
|
const { propertyList } = houseInfoBatch[index];
|
for (let i = 0; i < propertyList.length; i++) {
|
const object = propertyList[i];
|
for (const key in object) {
|
if (row[key] != object[key] && column.property == key) {
|
return { color: "#222", "font-weight": "700" };
|
}
|
}
|
}
|
}
|
},
|
handleCustomerChange(row,customerid) {
|
row.customername = this.customerList.find(res=>{
|
return res.customerid == customerid
|
}).customername
|
},
|
getShareholderEnt(shareholderClassify = 1) {
|
return new Promise((resolve) => {
|
getShareholderEnt({
|
applySerialNo: this.applyInfo.serialNo,
|
shareholderClassify: shareholderClassify
|
}).then((res) => {
|
resolve(res.result);
|
});
|
});
|
},
|
qryDictionaryList(code, callback) {
|
getDictionaryList({
|
codeNo: code,
|
productId: this.applyInfo.productID,
|
}).then((res) => {
|
callback(res.result);
|
});
|
},
|
|
// async getOwnerInfo(val) {
|
// if (val == 1) {
|
// // 是产权人需要自动添加产权人信息
|
// if (this.propertyData.serialno) {
|
// // 如果产权人已经有产权人信息则直接return,没有则调接口保存产权人
|
// for (let index = 0; index < this.ownerData.length; index++) {
|
// if (this.ownerData[index].certid == this.propertyData.certid) {
|
// return;
|
// }
|
// }
|
// const res = await this.save({
|
// applyserialno: this.applyInfo.serialNo,
|
// relativeserialno: this.propertyData.serialno,
|
// propertyowner: this.propertyData.customername,
|
// certtype: this.propertyData.cuscerttype,
|
// certid: this.propertyData.certid,
|
// });
|
// if (res.code == "00") {
|
// this.getPropertyList();
|
// }
|
// } else {
|
// this.certtypeList.forEach((val) => {
|
// if (this.propertyData.cuscerttype == val.itemno) {
|
// this.ownerData.unshift({
|
// certtypeDesc: val.itemname,
|
// propertyowner: this.propertyData.customername,
|
// certtype: this.propertyData.cuscerttype,
|
// certid: this.propertyData.certid,
|
// applyserialno: this.applyInfo.serialNo,
|
// });
|
// }
|
// });
|
// }
|
// } else {
|
// // 非产权人需要删除借款人的产权信息
|
// if (this.propertyData.serialno) {
|
// this.ownerData.forEach(async (val) => {
|
// if (val.certid == this.propertyData.certid) {
|
// const res = await this.del(val.serialno);
|
// if (res.code == "00") {
|
// this.getPropertyList();
|
// }
|
// }
|
// });
|
// } else {
|
// this.ownerData.forEach((val, index) => {
|
// if (val.certid == this.propertyData.certid) {
|
// this.ownerData.splice(index, 1);
|
// }
|
// });
|
// }
|
// }
|
// this.propertyData.index = this.index;
|
// this.propertyData.propertyList = this.ownerData;
|
// this.$emit("sendPropertyForm", this.propertyData);
|
// },
|
|
//查询股东信息
|
getEnpShareholderInfo(pageParam) {
|
console.log('getEnpShareholderInfo',pageParam)
|
if (!this.applyInfo.serialNo) return;
|
|
qryEnpShareholderInfo({
|
objectno: this.applyInfo.serialNo,
|
objecttype: "jbo.app.SHAREHOLDER_INFO",
|
currentPage: pageParam.currentPage,
|
pageSize: pageParam.pageSize,
|
}).then((res) => {
|
this.shareholderData = [];
|
this.shareholderForm = res.result;
|
if (res.result.records.length) {
|
res.result.records.forEach((val) => {
|
const obj = {};
|
for (const key in val) {
|
obj[key] = val[key];
|
}
|
|
this.shareholderData.push(obj);
|
});
|
|
this.total = res.result.total;
|
}else {
|
if (pageParam.currentPage > 1) {
|
pageParam.currentPage--;
|
this.getEnpShareholderInfo(pageParam);
|
}else {
|
this.total = res.result.total;
|
}
|
}
|
});
|
},
|
handleSizeChange(val) {
|
this.loanApprovalApply.pageSize = val;
|
this.getEnpShareholderInfo(this.loanApprovalApply)
|
},
|
handleCurrentChange(val) {
|
this.loanApprovalApply.currentPage = val;
|
this.getEnpShareholderInfo(this.loanApprovalApply)
|
},
|
//根据股东是企业还是个人,选择默认证件类型
|
handleShareholdertypeChange(row,val) {
|
// row.customerid = ''
|
// row.customername = ''
|
if (val === '01') {
|
row.certtype = '05'
|
}else if (val === '02') {
|
row.certtype = '01'
|
}
|
},
|
async handleShareholderclassifyChange(row, val) {
|
row.customerid = ''
|
row.customername = ''
|
|
this.customerList = await this.getShareholderEnt(val)
|
},
|
// 添加股东
|
addShareholder() {
|
for (let i = 0; i < this.shareholderData.length; i++) {
|
if (this.shareholderData[i].isEdit) {
|
this.$message.warning("请先保存当前股东信息再新增");
|
return;
|
}
|
}
|
//最多只能添加5条股东信息
|
// if (this.shareholderForm.records.length > 4) {
|
// this.$message.warning("最多只能添加五条股东信息");
|
// return
|
// }
|
|
this.shareholderData.unshift({
|
shareholdername: "",
|
certtypeDesc: "",
|
certid: "",
|
customername: "",
|
customerid: "",
|
isEdit: true,
|
});
|
},
|
// 保存
|
async handleSave(row, index) {
|
if (!row.shareholdertype) {
|
this.$message.warning("股东类型不能为空");
|
return;
|
}
|
if (!row.shareholdername) {
|
this.$message.warning("股东名称不能为空");
|
return;
|
}
|
if (!row.customerid) {
|
this.$message.warning("所属企业不能为空");
|
return;
|
}
|
if (!row.certtype) {
|
this.$message.warning("证件类型不能为空");
|
return;
|
}
|
if (!row.certid) {
|
this.$message.warning("证件号码不能为空");
|
return;
|
}
|
if (!representativeIDExp.test(row.certid) && row.certtype == "01") {
|
this.$message.warning("证件号码格式不正确");
|
return;
|
}
|
if (!phoneExp.test(row.phone) && row.shareholdertype != '01') {
|
this.$message.warning("电话号码格式不正确");
|
return;
|
}
|
//股东为企业,添加判断
|
if (row.shareholdertype === "01") {
|
if (!row.shareholderContactsName) {
|
this.$message.warning("股东联系人不能为空");
|
return;
|
}
|
if (!representativeIDExp.test(row.shareholderContactsIDNum)) {
|
this.$message.warning("股东联系人证件号码格式不正确");
|
return;
|
}
|
|
if (!phoneExp.test(row.shareholderContactsPhone)) {
|
this.$message.warning("股东联系人电话号码格式不正确");
|
return;
|
}
|
}
|
|
for (let i = 0; i < this.shareholderData.length; i++) {
|
if (
|
index != i &&
|
row.certid == this.shareholderData[i].certid &&
|
row.certtype == this.shareholderData[i].certtype &&
|
row.shareholdername == this.shareholderData[i].shareholdername &&
|
row.shareholderclassify == this.shareholderData[i].shareholderclassify
|
) {
|
this.$message.warning("股东已存在,请重新填写");
|
return;
|
}
|
}
|
row.applyserialno = this.applyInfo.serialNo;
|
// debugger
|
if (this.applyInfo.serialNo) {
|
// row.relativeserialno = this.applyInfo.serialNo;
|
row.objectno = this.applyInfo.serialNo;
|
row.objecttype = "jbo.app.SHAREHOLDER_INFO";
|
// 同步返回保存是否成功
|
const res = await this.save(row);
|
if (res.code == "00") {
|
this.getEnpShareholderInfo(this.loanApprovalApply);
|
} else {
|
// this.$message.warning("系统错误,请重试");
|
return;
|
}
|
}
|
// else {
|
// this.certtypeList.forEach((val) => {
|
// if (row.certtype == val.itemno) {
|
// this.$set(row, "isEdit", false);
|
// this.$set(row, "certtypeDesc", val.itemname);
|
// }
|
// });
|
// this.propertyData.index = this.index;
|
// this.propertyData.propertyList = this.ownerData;
|
// this.$emit("sendPropertyForm", this.propertyData);
|
// for (let i = 0; i < this.initialArr.length; i++) {
|
// if (i == index) {
|
// return;
|
// }
|
// }
|
// this.initialArr.push(Object.assign({}, row));
|
// }
|
},
|
// 保存接口
|
save(row) {
|
return new Promise((resolve) => {
|
addOrUpdateShareholderInfo(row).then((res) => {
|
resolve(res);
|
});
|
});
|
},
|
// 删除接口
|
del(serialno) {
|
return new Promise((resolve) => {
|
delShareholderInfo({ serialno: serialno }).then((res) => {
|
resolve(res);
|
});
|
});
|
},
|
// 修改
|
handleEdit(row) {
|
for (let i = 0; i < this.shareholderData.length; i++) {
|
if (this.shareholderData.length > 1 && this.shareholderData[i].isEdit) {
|
this.$message.warning("请先保存当前股东信息");
|
return;
|
}
|
}
|
this.$set(row, "isEdit", true);
|
this.$set(row, "isCancel", true);
|
},
|
// 取消
|
handleCancel(row, index) {
|
const arr = [];
|
for (let i = 0; i < this.initialArr.length; i++) {
|
if (i == index) {
|
for (const key in row) {
|
if (
|
key != "isEdit" &&
|
key != "isCancel" &&
|
row[key] != this.initialArr[i][key]
|
) {
|
arr.push(key);
|
}
|
}
|
}
|
}
|
if (arr.length) {
|
common.comfirm("提示", "当前有数据未保存,是否放弃保存?", () => {
|
this.$set(row, "isEdit", false);
|
this.$set(row, "isCancel", false);
|
arr.forEach((val) => {
|
for (const key in this.initialArr[index]) {
|
if (this.initialArr[index].hasOwnProperty(val)) {
|
this.shareholderData[index][key] = this.initialArr[index][key];
|
}
|
}
|
});
|
});
|
} else {
|
this.$set(row, "isEdit", false);
|
this.$set(row, "isCancel", false);
|
}
|
},
|
// 删除
|
handleDelete(row, index) {
|
// for (let i = 0; i < this.shareholderData.length; i++) {
|
// if (
|
// this.shareholderData.length == 1 &&
|
// !this.shareholderData[i].isEdit
|
// ) {
|
// this.$message.warning("至少保留一个股东信息");
|
// return;
|
// }
|
// }
|
if (!row.isEdit) {
|
common.comfirm(
|
"提示",
|
`请确认是否需要删除股东:${row.shareholdername}?`,
|
async () => {
|
if (row.serialno) {
|
const res = await this.del(row.serialno);
|
if (res.code == "00") {
|
this.$message.success("删除成功");
|
this.getEnpShareholderInfo(this.loanApprovalApply);
|
}
|
} else {
|
this.getEnpShareholderInfo(this.loanApprovalApply);
|
}
|
}
|
);
|
} else {
|
this.getEnpShareholderInfo(this.loanApprovalApply);
|
}
|
},
|
//保存草稿
|
async saveDraft(arr) {
|
},
|
// 上一步
|
prevStep() {
|
this.applyMenu.forEach((val, index) => {
|
if (val.tabname == "股东信息") {
|
common.tabInfo(
|
this.applyMenu[index - 1].tabname,
|
this.applyInfo.flowno,
|
this
|
);
|
}
|
});
|
},
|
//提交下一步
|
async submit(arr) {
|
console.log(arr);
|
// 担保人为企业 担保人股东不能为空
|
const guarantor = this.guarantorData.filter(item=> item.borrowertype == '01') || []
|
const records = arr.records.filter(item => item.shareholderclassify == '2') || []
|
if(guarantor.length > 0 && records.length < 1){
|
this.$message.warning("请添加担保人股东信息");
|
return
|
}
|
|
// 借款类型为企业的时候 借款人股东不能为空
|
const isBorrower = this.guarantorData.filter(item => item.borrowertype == '01') || []
|
const isBorrower2 = arr.records.filter(item => item.shareholderclassify == '1') || []
|
if(isBorrower.length > 0 && isBorrower2.length < 1){
|
this.$message.warning("请添借款人股东信息");
|
return
|
}
|
|
arr.records.length > 0?
|
this.nextPage():
|
this.$message.warning("请添加股东信息");
|
},
|
// 下一页
|
nextPage() {
|
// 调用父组件的查询左侧tab的方法
|
this.$parent.updateApplyTabTree("股东信息");
|
},
|
},
|
};
|
</script>
|
<style lang="stylus">
|
.owner {
|
width: 100%;
|
padding-left: 10px;
|
|
.red-star {
|
width: 7px;
|
display: inline-block;
|
vertical-align: middle;
|
color: #FF4300;
|
}
|
|
>.el-button {
|
padding: 9px 12px;
|
}
|
|
>p {
|
height: 20px;
|
color: #222222;
|
font-weight: 500;
|
font-size: 14px;
|
position: relative;
|
margin-bottom: 30px;
|
|
span {
|
width: 2px;
|
height: 14px;
|
background-color: #0081F0;
|
position: absolute;
|
left: -10px;
|
top: 50%;
|
transform: translateY(-50%);
|
}
|
}
|
}
|
</style>
|