Commit 5449a1f7 authored by linxin's avatar linxin

解决冲突

parents 223660a9 8c013a07
...@@ -98,6 +98,7 @@ export default { ...@@ -98,6 +98,7 @@ export default {
unRepay_flag: false, unRepay_flag: false,
repaying_flag: false, repaying_flag: false,
repayed_flag: false, repayed_flag: false,
bp_type: '', // 用户类型
} }
}, },
computed: {}, computed: {},
...@@ -169,6 +170,16 @@ export default { ...@@ -169,6 +170,16 @@ export default {
vm.unRepay_flag = false vm.unRepay_flag = false
vm.repaying_flag = false vm.repaying_flag = false
vm.repayed_flag = false vm.repayed_flag = false
if (window.localStorage.multipleRole === 'TENANT') {
vm.bp_type = 'TENANT'
} else if (window.localStorage.bp_type === 'TENANT' && !window.localStorage.multipleRole) {
vm.bp_type = 'TENANT'
} else {
vm.bp_type = ''
}
vm.recordQuery('全部', vm.lists)
} else if (from.name === 'MyInfo') {
vm.bp_type = vm.$route.params.bp_type
vm.recordQuery('全部', vm.lists) vm.recordQuery('全部', vm.lists)
} }
}) })
...@@ -194,6 +205,7 @@ export default { ...@@ -194,6 +205,7 @@ export default {
let param = { let param = {
user_phone: window.localStorage.user_phone, user_phone: window.localStorage.user_phone,
searchInput: vm.searchInput, searchInput: vm.searchInput,
bp_type: vm.bp_type,
pagenum: 1, pagenum: 1,
pagesize: 10, pagesize: 10,
contract_status_n: status, contract_status_n: status,
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<h-content class="repay-content"> <h-content class="repay-content">
<div class="header"> <div class="header">
合同单据 合同单据
<div class="download">电子版下载 <img src="@/assets/contractInquire/download.png" alt=""></div> <div class="download" @click="downLoad">电子版下载 <img src="@/assets/contractInquire/download.png" alt=""></div>
</div> </div>
<list-item :item-height="44" class="invoice"> <list-item :item-height="44" class="invoice">
<item> <item>
...@@ -143,6 +143,23 @@ export default { ...@@ -143,6 +143,23 @@ export default {
}, },
}) })
}, },
downLoad () {
let vm = this
let url = $config.basePath + 'get_download_app'
let param = {
project_id: vm.$route.params.project_id,
phone: window.localStorage.user_phone,
}
vm.hlsPopup.showLoading('数据加载中')
vm.hlsHttp.post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
if (res.result === 'S') {
vm.url = res.info.fileUrl
} else {
hlsPopup.showLongCenter(res.message)
}
})
},
// 合同明细 // 合同明细
detailQuery () { detailQuery () {
let vm = this let vm = this
......
...@@ -159,6 +159,7 @@ export default { ...@@ -159,6 +159,7 @@ export default {
vm.$post(url, param).then(function (res) { vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading() vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
window.localStorage.setItem('bp_type', res.info.user_bp_type)
vm.user_bp_status = res.info.user_bp_status vm.user_bp_status = res.info.user_bp_status
vm.user_bp_class = res.info.user_bp_class vm.user_bp_class = res.info.user_bp_class
vm.bp_id = res.info.user_bp_id vm.bp_id = res.info.user_bp_id
......
...@@ -12,7 +12,8 @@ ...@@ -12,7 +12,8 @@
<div slot="center">个人中心</div> <div slot="center">个人中心</div>
</h-header> </h-header>
<div :class="['top',(multipleRole!=='GUTA'&&user_bp_type!=='GUTA')?'has':'antiHas']" style="margin-top:-1px;"> <!-- <div :class="['top',(multipleRole!=='GUTA'&&user_bp_type!=='GUTA')?'has':'antiHas']" style="margin-top:-1px;"> -->
<div class="top" style="margin-top:-1px;">
<div class="card-top"> <div class="card-top">
<img :src="upLoadObj" @click="checkType" > <img :src="upLoadObj" @click="checkType" >
<div class="sign"> <div class="sign">
...@@ -26,18 +27,19 @@ ...@@ -26,18 +27,19 @@
</div> </div>
</div> </div>
</div> </div>
<div v-if="multipleRole!=='GUTA'&&user_bp_type!=='GUTA'" class="card"> <!-- <div v-if="multipleRole!=='GUTA'&&user_bp_type!=='GUTA'" class="card"> -->
<div class="card">
<div class="card-info"> <div class="card-info">
<div class="card-bottom"> <div class="card-bottom">
<div v-if="(user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')" @click="goStart"> <div v-if="((user_bp_type!=='TENANT')&&(user_bp_type!=='GUTA')&&(multipleRole!=='GUTA')&&(multipleRole!=='TENANT'))||multipleRole==='AGENT'" @click="goStart">
<img src="@/assets/myInfo/car.png" > <img src="@/assets/myInfo/car.png" >
<p>发车申请</p> <p>发车申请</p>
</div> </div>
<div v-if="(user_bp_type==='TENANT')" @click="changePay"> <div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changePay">
<img src="@/assets/myInfo/pay.png" > <img src="@/assets/myInfo/pay.png" >
<p>首付还款</p> <p>首付还款</p>
</div> </div>
<div v-if="(user_bp_type==='TENANT')" @click="changeRent"> <div v-if="((user_bp_type==='TENANT')&&(multipleRole==='TENANT'))||(multipleRole==='TENANT')||((user_bp_type==='TENANT')&&(!multipleRole))" @click="changeRent">
<img src="@/assets/myInfo/refund.png" > <img src="@/assets/myInfo/refund.png" >
<p>租金还款</p> <p>租金还款</p>
</div> </div>
...@@ -45,6 +47,14 @@ ...@@ -45,6 +47,14 @@
<img src="@/assets/myInfo/promise.png" > <img src="@/assets/myInfo/promise.png" >
<p>缴纳保证金</p> <p>缴纳保证金</p>
</div> </div>
<div v-if="((user_bp_type==='GUTA')&&(multipleRole==='GUTA'))||(multipleRole==='GUTA')||((user_bp_type==='GUTA')&&(!multipleRole))" @click="changeContract('GUTA')">
<img src="@/assets/myInfo/under.png" >
<p>我担保的合同</p>
</div>
<div v-if="((user_bp_type==='AGENT')&&(multipleRole==='AGENT'))||(multipleRole==='AGENT')||((user_bp_type==='AGENT')&&(!multipleRole))" @click="changeContract('AGENT')">
<img src="@/assets/myInfo/agent.png" >
<p>我办理的合同</p>
</div>
</div> </div>
</div> </div>
</div> </div>
...@@ -53,7 +63,7 @@ ...@@ -53,7 +63,7 @@
<div class="content-top"> <div class="content-top">
<div class="userInfo">我的合同</div> <div class="userInfo">我的合同</div>
<div class="my-contract"> <div class="my-contract">
<div v-if="user_bp_type === 'AGENT' || user_bp_type === 'OFFICE'" class="content-wrap" @click="goCreate"> <div v-if="(user_bp_type === 'AGENT'&&multipleRole==='AGENT') || user_bp_type === 'OFFICE'||multipleRole==='AGENT'||(user_bp_type === 'AGENT'&&!multipleRole)" class="content-wrap" @click="goCreate">
<!-- <span <!-- <span
v-if="signCount > 0" v-if="signCount > 0"
:class="{'content-wrap-class-width':signCount>99, 'content-wrap-class':signCount<99}" :class="{'content-wrap-class-width':signCount>99, 'content-wrap-class':signCount<99}"
...@@ -85,7 +95,7 @@ ...@@ -85,7 +95,7 @@
<p>待面签</p> <p>待面签</p>
</div> </div>
<div <div
v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')" v-if="((user_bp_type==='TENANT')||(user_bp_type==='GUTA')||(multipleRole==='GUTA')||(multipleRole==='TENANT'))&&multipleRole!=='AGENT'"
class="content-wrap" class="content-wrap"
@click="goCarConfirm" @click="goCarConfirm"
> >
...@@ -100,7 +110,7 @@ ...@@ -100,7 +110,7 @@
</div> </div>
<list-item :item-height="44" class="list"> <list-item :item-height="44" class="list">
<item <item
v-if="(user_bp_type==='TENANT')||(user_bp_type==='GUTA')" v-if="((user_bp_type==='TENANT')||(user_bp_type==='GUTA'||(multipleRole==='GUTA')||(multipleRole==='TENANT')))&&multipleRole!=='AGENT'"
@click.native="goReimburse" @click.native="goReimburse"
> >
<img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" > <img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" >
...@@ -192,31 +202,34 @@ export default { ...@@ -192,31 +202,34 @@ export default {
carCount: '0', carCount: '0',
description: '', description: '',
bp_identity: '', bp_identity: '',
bp_type_n: '',
approveBtn: false, approveBtn: false,
elecStatus: false, elecStatus: false,
roleSwitchFlag: false, // 选择角色模态框显示标志 roleSwitchFlag: false, // 选择角色模态框显示标志
roleList: [ multiRoleList: [], // 查到的多角色
{
bp_type: 'TENANT',
bp_type_desc: '主承租人',
},
{
bp_type: 'GUTA',
bp_type_desc: '担保人',
},
],
type: [ type: [
{ {
bp_type: '0', bp_type: '0',
bp_type_desc: '修改信息', bp_type_n: '修改信息',
}, },
{ {
bp_type: '1', bp_type: '1',
bp_type_desc: '重新选择用户类型', bp_type_n: '重新选择用户类型',
}, },
], ],
} }
}, },
computed: {
'roleList' () {
let obj = {
bp_type: this.user_bp_type,
bp_type_n: this.bp_type_n,
}
let arr = [...this.multiRoleList]
arr.push(obj)
return arr
},
},
watch: { watch: {
user_bp_type (newVal, oldVal) { user_bp_type (newVal, oldVal) {
if (newVal === 'AGENT') { if (newVal === 'AGENT') {
...@@ -281,6 +294,7 @@ export default { ...@@ -281,6 +294,7 @@ export default {
vm.multipleRole = window.localStorage.getItem('multipleRole') vm.multipleRole = window.localStorage.getItem('multipleRole')
vm.userQuery() vm.userQuery()
vm.numQuery() vm.numQuery()
vm.getMultipleRole()
}) })
next() next()
}, },
...@@ -331,6 +345,9 @@ export default { ...@@ -331,6 +345,9 @@ export default {
} else if (role.bp_type === 'GUTA') { } else if (role.bp_type === 'GUTA') {
window.localStorage.setItem('multipleRole', 'GUTA') window.localStorage.setItem('multipleRole', 'GUTA')
this.multipleRole = 'GUTA' this.multipleRole = 'GUTA'
} else if (role.bp_type === 'AGENT') {
window.localStorage.setItem('multipleRole', 'AGENT')
this.multipleRole = 'AGENT'
} }
console.log('选择后的角色为:' + role) console.log('选择后的角色为:' + role)
}, },
...@@ -435,6 +452,15 @@ export default { ...@@ -435,6 +452,15 @@ export default {
name: 'MyProductList', name: 'MyProductList',
}) })
}, },
// 进入
changeContract (e) {
this.$router.push({
name: 'ContractRecords',
params: {
bp_type: e,
},
})
},
// 进入发车申请 // 进入发车申请
goStart () { goStart () {
if (this.bp_id) { if (this.bp_id) {
...@@ -640,8 +666,8 @@ export default { ...@@ -640,8 +666,8 @@ export default {
} else if (index === 1) { } else if (index === 1) {
this.changePageHead() this.changePageHead()
} else if (index === 2) { } else if (index === 2) {
if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA')) && (vm.user_bp_status === 'APPROVED')) { if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA') || (vm.user_bp_type === 'AGENT')) && (vm.user_bp_status === 'APPROVED')) {
this.$refs.roleSwitchRoleList.show() vm.$refs.roleSwitchRoleList.show()
} else { } else {
hlsPopup.showLongCenter('您当前尚无可用角色') hlsPopup.showLongCenter('您当前尚无可用角色')
} }
...@@ -649,6 +675,21 @@ export default { ...@@ -649,6 +675,21 @@ export default {
}, },
}) })
}, },
getMultipleRole () {
let vm = this
let url = process.env.basePath + 'bp_role_query'
let param = {
master: {
bp_id: window.localStorage.getItem('bp_id'),
bp_type: window.localStorage.getItem('bp_type'),
},
}
vm.hlsHttp.post(url, param).then(function (res) {
if (res.result === 'S') {
vm.multiRoleList = res.lists
}
})
},
// 图片上传入口 // 图片上传入口
imgUploadShow (check_id) { imgUploadShow (check_id) {
let vm = this let vm = this
...@@ -851,6 +892,7 @@ export default { ...@@ -851,6 +892,7 @@ export default {
vm.user_bp_name = res.info.user_bp_name vm.user_bp_name = res.info.user_bp_name
vm.user_bp_type = res.info.user_bp_type vm.user_bp_type = res.info.user_bp_type
vm.user_phone = res.info.user_phone vm.user_phone = res.info.user_phone
vm.bp_type_n = res.info.user_bp_type_n
vm.watchBpStatus() vm.watchBpStatus()
vm.getHead() vm.getHead()
if (vm.user_bp_type === 'AGENT') { if (vm.user_bp_type === 'AGENT') {
...@@ -858,7 +900,7 @@ export default { ...@@ -858,7 +900,7 @@ export default {
} else { } else {
vm.isAGENT = false vm.isAGENT = false
} }
if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT') { if (vm.user_bp_type === 'GUTA' || vm.user_bp_type === 'TENANT' || vm.user_bp_type === 'AGENT') {
vm.isMultiRole = true vm.isMultiRole = true
} else { } else {
vm.isMultiRole = false vm.isMultiRole = false
...@@ -1113,7 +1155,7 @@ export default { ...@@ -1113,7 +1155,7 @@ export default {
height: 121px; height: 121px;
background-color: #fff; background-color: #fff;
border-radius: 4px; border-radius: 4px;
margin-top: 18px; margin-top: 8px;
} }
.userInfo { .userInfo {
height: 45px; height: 45px;
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<div <div
v-for="(item,index) in roleList" :key="index" :class="{'item-active':index === switchIndex}" class="role-item" v-for="(item,index) in roleList" :key="index" :class="{'item-active':index === switchIndex}" class="role-item"
@click="chooseRole(index)"> @click="chooseRole(index)">
<span>{{ item.bp_type_desc }}</span> <span>{{ item.bp_type_n }}</span>
</div> </div>
<div :class="{'content-btn-active':switchIndex !== ''}" class="content-btn" @click="roleConfirm"><span>确定</span></div> <div :class="{'content-btn-active':switchIndex !== ''}" class="content-btn" @click="roleConfirm"><span>确定</span></div>
</div> </div>
......
...@@ -210,6 +210,8 @@ export default { ...@@ -210,6 +210,8 @@ export default {
master: { master: {
bp_id: bp_id, bp_id: bp_id,
company_id: '2145', company_id: '2145',
bp_class: 'NP',
business_num: window.localStorage.getItem('business_num'),
}, },
} }
vm.hlsPopup.showLoading('请稍候') vm.hlsPopup.showLoading('请稍候')
......
...@@ -20,13 +20,14 @@ ...@@ -20,13 +20,14 @@
@click="selectIdTypeOnly()" @click="selectIdTypeOnly()"
> >
</item> </item>
<item v-if="isApproved&&isMultiRole&&!hasMultiRole" :showArrow="true" @click.native="selectIdType()"> <item v-if="isApproved&&isMultiRole&&!hasMultiRole" :showArrow="true" @click.native="selectIdType">
<div slot="name" class="required">客户类型</div> <div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP"> <div slot="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span> <span>{{ baseInfo.bp_type_n }}</span>
<span> <span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
{{ multiBpType.bp_type_n }} <span v-for="(item,index) in multiBpTypeSelectList" :key="item.bp_type">
<img v-if="multiBpType.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP" > {{ item.bp_type_n }}
<img v-if="item.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP(item)" >
</span> </span>
</div> </div>
</item> </item>
...@@ -34,7 +35,7 @@ ...@@ -34,7 +35,7 @@
<div slot="name" class="required">客户类型</div> <div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP"> <div slot="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span> <span>{{ baseInfo.bp_type_n }}</span>
<span v-if="multiRole.bp_type_n">{{ multiRole.bp_type_n }}</span> <span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
</div> </div>
</item> </item>
<item v-if="(isPaople&&from)||(isPaople&&isSelected)"> <item v-if="(isPaople&&from)||(isPaople&&isSelected)">
...@@ -326,7 +327,7 @@ export default { ...@@ -326,7 +327,7 @@ export default {
isApproved: false, isApproved: false,
isSave: false, isSave: false,
isAGENT: this.$route.params.isAGENT, isAGENT: this.$route.params.isAGENT,
isMultiRole: this.$route.params.isMultiRole, // 能否选择多角色 isMultiRole: false, // 能否选择多角色
isSelected: false, isSelected: false,
hasMultiRole: false, // 是否有第二个角色 hasMultiRole: false, // 是否有第二个角色
from: false, from: false,
...@@ -343,11 +344,13 @@ export default { ...@@ -343,11 +344,13 @@ export default {
bankList: [], bankList: [],
maritalList: [], maritalList: [],
districtList: [], districtList: [],
multiBpTypeSelectList: [], // 添加的角色
img_url: {}, img_url: {},
multiRole: { multiRole: {
bp_type_n: '', bp_type_n: '',
bp_type: '', bp_type: '',
}, // 查询出来的第二个角色 }, // 查询出来的第二个角色
multiRoleList: [], // 查询出来的多角色
baseInfo: { baseInfo: {
bp_type_n: '', bp_type_n: '',
academic_background_n: '', academic_background_n: '',
...@@ -445,15 +448,18 @@ export default { ...@@ -445,15 +448,18 @@ export default {
beforeRouteEnter (to, from, next) { beforeRouteEnter (to, from, next) {
// 绑定查询入口 // 绑定查询入口
next(vm => { next(vm => {
if (from.fullPath === '/tab/my-info') {
if (vm.$route.params.status === 'APPROVED') { if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true vm.isApproved = true
} else { } else {
vm.isApproved = false vm.isApproved = false
} }
vm.isMultiRole = vm.$route.params.isMultiRole vm.isMultiRole = vm.$route.params.isMultiRole
if (from.fullPath === '/tab/my-info') {
vm.list = {} vm.list = {}
vm.multiBpType = {} vm.multiBpType = {}
vm.multiBpTypeSelectList = []// 选择的角色
vm.multiRoleList = []// 查询的角色
vm.upload_list = [] // 上传图片列表 vm.upload_list = [] // 上传图片列表
vm.dowload_list = [] // 下载图片列表 vm.dowload_list = [] // 下载图片列表
vm.img_url = {} vm.img_url = {}
...@@ -484,7 +490,7 @@ export default { ...@@ -484,7 +490,7 @@ export default {
window.localStorage.setItem('from', true) window.localStorage.setItem('from', true)
vm.basicInfoQuery() vm.basicInfoQuery()
vm.loadItemList() // 附件查询 vm.loadItemList() // 附件查询
vm.checkHasmultiple()// 查询是否有新角色 vm.getMultipleRole()// 获取第二角色
} else if (from.name === 'UserBind') { } else if (from.name === 'UserBind') {
vm.list = {} vm.list = {}
window.localStorage.setItem('from', false) window.localStorage.setItem('from', false)
...@@ -556,9 +562,14 @@ export default { ...@@ -556,9 +562,14 @@ export default {
timeFormat (str) { timeFormat (str) {
return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}` return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}`
}, },
deleteBP () { deleteBP (e) {
this.multiBpType.bp_type_n = '' let deleteIndex
this.multiBpType.bp_type = '' this.multiBpTypeSelectList.forEach((i, index, arr) => {
if (arr[index].bp_type.indexOf(e.bp_type) !== -1) {
deleteIndex = index
}
})
this.multiBpTypeSelectList.splice(deleteIndex, 1)
this.isAddNewType = false this.isAddNewType = false
}, },
addNewRole () { addNewRole () {
...@@ -576,6 +587,8 @@ export default { ...@@ -576,6 +587,8 @@ export default {
if (res.result === 'S') { if (res.result === 'S') {
hlsPopup.showLongCenter('新增成功') hlsPopup.showLongCenter('新增成功')
vm.isAddNewType = false vm.isAddNewType = false
let item = vm.multiBpTypeSelectList.pop()
vm.multiRoleList.push(item)
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
...@@ -781,30 +794,43 @@ export default { ...@@ -781,30 +794,43 @@ export default {
} }
}) })
}, },
checkHasmultiple () { async getMultipleRole () {
let vm = this let vm = this
let url = process.env.basePath + 'bp_role_check' let url = process.env.basePath + 'bp_role_query'
let flag = vm.checkHasmultiple()
let param = { let param = {
master: {
bp_id: window.localStorage.getItem('bp_id'), bp_id: window.localStorage.getItem('bp_id'),
bp_type: window.localStorage.getItem('bp_type'),
},
} }
// vm.hlsPopup.showLoading('请稍后') if (flag) {
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.multiRoleList = res.lists
if (res.lists.length === 0 || res.lists.length === 1) {
vm.hasMultiRole = false
} else if (res.lists.length === 2) {
vm.hasMultiRole = true vm.hasMultiRole = true
if (vm.baseInfo.bp_type === 'TENANT') {
vm.multiRole.bp_type_n = '担保人'
vm.multiRole.bp_type = 'GUTA'
} else if (vm.baseInfo.bp_type === 'GUTA') {
vm.multiRole.bp_type_n = '承租人'
vm.multiRole.bp_type = 'TENANT'
} }
}
})
}
},
async checkHasmultiple () {
let vm = this
let url = process.env.basePath + 'bp_role_check'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
}
let res = await vm.hlsHttp.post(url, param)
if (res.result === 'S') {
// vm.hasMultiRole = true
return true
} else { } else {
vm.hasMultiRole = false vm.hasMultiRole = false
vm.multiRole.bp_type = '' return false
vm.multiRole.bp_type_n = ''
} }
})
}, },
// 基本信息保存前校验 // 基本信息保存前校验
bindCheck () { bindCheck () {
...@@ -817,6 +843,7 @@ export default { ...@@ -817,6 +843,7 @@ export default {
} else if (vm.baseInfo.bp_type === 'OFFICE') { } else if (vm.baseInfo.bp_type === 'OFFICE') {
business_num = vm.baseInfo.business_license_num business_num = vm.baseInfo.business_license_num
} }
window.localStorage.setItem('business_num', business_num)
let url = process.env.basePath + 'bp_bind_check' let url = process.env.basePath + 'bp_bind_check'
let param = { let param = {
bp_class: 'NP', bp_class: 'NP',
...@@ -851,7 +878,7 @@ export default { ...@@ -851,7 +878,7 @@ export default {
window.localStorage.setItem('bp_id', res.bp_id) window.localStorage.setItem('bp_id', res.bp_id)
window.localStorage.setItem('bp_name', vm.baseInfo.bp_name) window.localStorage.setItem('bp_name', vm.baseInfo.bp_name)
window.localStorage.setItem('bp_type', vm.baseInfo.bp_type) window.localStorage.setItem('bp_type', vm.baseInfo.bp_type)
// vm.bindCheck() vm.bindCheck()
vm.$router.push({ vm.$router.push({
name: 'NPInvoiceInfo', name: 'NPInvoiceInfo',
}) })
...@@ -1269,16 +1296,20 @@ export default { ...@@ -1269,16 +1296,20 @@ export default {
this.$refs.myTestareaLive.rows = addNum + 1 this.$refs.myTestareaLive.rows = addNum + 1
} }
}, },
selectIdType (e) { selectIdType () {
let vm = this let vm = this
let List let List
if (vm.baseInfo.bp_type === 'TENANT') { if (vm.baseInfo.bp_type === 'TENANT') {
List = vm.typeList.filter(i => { List = vm.typeList.filter(i => {
return i.code === 'GUTA' return i.code === 'GUTA' || i.code === 'AGENT'
}) })
} else if (vm.baseInfo.bp_type === 'GUTA') { } else if (vm.baseInfo.bp_type === 'GUTA') {
List = vm.typeList.filter(i => { List = vm.typeList.filter(i => {
return i.code === 'TENANT' return i.code === 'TENANT' || i.code === 'AGENT'
})
} else if (vm.baseInfo.bp_type === 'AGENT') {
List = vm.typeList.filter(i => {
return i.code === 'TENANT' || i.code === 'GUTA'
}) })
} }
vm.hlsPopup.selectList({ vm.hlsPopup.selectList({
...@@ -1288,8 +1319,31 @@ export default { ...@@ -1288,8 +1319,31 @@ export default {
returnItem: function (index, obj) { returnItem: function (index, obj) {
vm.multiBpType.bp_type = obj.bp_type vm.multiBpType.bp_type = obj.bp_type
vm.multiBpType.bp_type_n = obj.bp_type_n vm.multiBpType.bp_type_n = obj.bp_type_n
let selectList = false
let queryList = false
let baseInfo = false
vm.multiBpTypeSelectList.forEach((item, index, arr) => {
if (item.bp_type === vm.multiBpType.bp_type) {
selectList = true
}
})
vm.multiRoleList.forEach((item, index, arr) => {
if (item.bp_type === vm.multiBpType.bp_type) {
queryList = true
}
})
if (vm.baseInfo.bp_type === vm.multiBpType.bp_type) {
baseInfo = true
}
if (baseInfo || queryList || selectList) {
hlsPopup.showLongCenter('您已经添加了该角色')
vm.isAddNewType = false
vm.isSelected = false
} else {
vm.multiBpTypeSelectList.push(vm.multiBpType)
vm.isAddNewType = true vm.isAddNewType = true
vm.isSelected = true vm.isSelected = true
}
}, },
}) })
}, },
......
...@@ -296,6 +296,8 @@ export default { ...@@ -296,6 +296,8 @@ export default {
master: { master: {
bp_id: this.$route.params.bp_id, bp_id: this.$route.params.bp_id,
company_id: '2145', company_id: '2145',
bp_class: 'ORG',
business_num: window.localStorage.getItem('business_num'),
}, },
} }
let vm = this let vm = this
......
...@@ -27,13 +27,14 @@ ...@@ -27,13 +27,14 @@
@click="selectIdType()" @click="selectIdType()"
> >
</item> </item>
<item v-if="isApproved&&isMultiRole&&!hasMultiRole" :showArrow="true" @click.native="selectIdMultiType()"> <item v-if="isApproved&&isMultiRole&&!hasMultiRole" :showArrow="true" @click.native="selectIdType">
<div slot="name" class="required">客户类型</div> <div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP"> <div slot="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span> <span>{{ baseInfo.bp_type_n }}</span>
<span> <span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
{{ multiBpType.bp_type_n }} <span v-for="(item,index) in multiBpTypeSelectList" :key="item.bp_type">
<img v-if="multiBpType.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP"> {{ item.bp_type_n }}
<img v-if="item.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP(item)" >
</span> </span>
</div> </div>
</item> </item>
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
<div slot="name" class="required">客户类型</div> <div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP"> <div slot="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span> <span>{{ baseInfo.bp_type_n }}</span>
<span v-if="multiRole.bp_type_n">{{ multiRole.bp_type_n }}</span> <span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
</div> </div>
</item> </item>
<item v-if="bp_type_flag"> <item v-if="bp_type_flag">
...@@ -438,6 +439,8 @@ export default { ...@@ -438,6 +439,8 @@ export default {
backList: [], backList: [],
saveInfo: {}, saveInfo: {},
lastInfo: {}, lastInfo: {},
multiBpTypeSelectList: [], // 添加的角色
multiRoleList: [], // 查询出来的多角色
msg_flag: false, msg_flag: false,
maritalList: [], maritalList: [],
getBankList: [], getBankList: [],
...@@ -581,16 +584,18 @@ export default { ...@@ -581,16 +584,18 @@ export default {
next(vm => { next(vm => {
vm.getBpType() vm.getBpType()
vm.getProvince() vm.getProvince()
if (from.fullPath === '/tab/my-info') { /* || from.fullPath === '/margin-first-pay' */
vm.legal_personMsg = {}
if (vm.$route.params.status === 'APPROVED') { if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true vm.isApproved = true
window.localStorage.setItem('isApproved', vm.isApproved) window.localStorage.setItem('isApproved', vm.isApproved)
} }
vm.isMultiRole = vm.$route.params.isMultiRole vm.isMultiRole = vm.$route.params.isMultiRole
if (from.fullPath === '/tab/my-info') { /* || from.fullPath === '/margin-first-pay' */
vm.legal_personMsg = {}
window.localStorage.setItem('from', true) window.localStorage.setItem('from', true)
vm.baseInfo = {} vm.baseInfo = {}
vm.authMsg = {} vm.authMsg = {}
vm.multiBpTypeSelectList = []// 选择的角色
vm.multiRoleList = []// 查询的角色
vm.bp_id = vm.$route.params.bp_id vm.bp_id = vm.$route.params.bp_id
vm.idCardFront = '' // 身份证正面图片 vm.idCardFront = '' // 身份证正面图片
vm.idCardBack = '' // 身份证反面图片 vm.idCardBack = '' // 身份证反面图片
...@@ -617,6 +622,7 @@ export default { ...@@ -617,6 +622,7 @@ export default {
vm.licenseImgUrlFlag = false // 营业执照照片,为false则用查询出来的,为true则用拍照出来的 vm.licenseImgUrlFlag = false // 营业执照照片,为false则用查询出来的,为true则用拍照出来的
vm.laImgUrlFlag = false // 授权书图片,为false则用查询出来的,为true则用拍照出来的 vm.laImgUrlFlag = false // 授权书图片,为false则用查询出来的,为true则用拍照出来的
vm.getbaseInfo() vm.getbaseInfo()
vm.getMultipleRole()// 获取第二角色
} else if (from.name === 'UserBind') { } else if (from.name === 'UserBind') {
window.localStorage.setItem('from', false) window.localStorage.setItem('from', false)
vm.multiBpType = { vm.multiBpType = {
...@@ -735,37 +741,55 @@ export default { ...@@ -735,37 +741,55 @@ export default {
next() next()
}, */ }, */
methods: { methods: {
checkHasmultiple () { async getMultipleRole () {
let vm = this let vm = this
let url = process.env.basePath + 'bp_role_check' let url = process.env.basePath + 'bp_role_query'
let flag = vm.checkHasmultiple()
let param = { let param = {
master: {
bp_id: window.localStorage.getItem('bp_id'), bp_id: window.localStorage.getItem('bp_id'),
bp_type: window.localStorage.getItem('bp_type'),
},
} }
// vm.hlsPopup.showLoading('请稍后') if (flag) {
vm.hlsHttp.post(url, param).then(function (res) { vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') { if (res.result === 'S') {
vm.multiRoleList = res.lists
if (res.lists.length === 0 || res.lists.length === 1) {
vm.hasMultiRole = false
} else if (res.lists.length === 2) {
vm.hasMultiRole = true vm.hasMultiRole = true
if (vm.baseInfo.bp_type === 'TENANT') {
vm.multiRole.bp_type_n = '担保人'
vm.multiRole.bp_type = 'GUTA'
} else if (vm.baseInfo.bp_type === 'GUTA') {
vm.multiRole.bp_type_n = '承租人'
vm.multiRole.bp_type = 'TENANT'
} }
}
})
}
},
async checkHasmultiple () {
let vm = this
let url = process.env.basePath + 'bp_role_check'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
}
let res = await vm.hlsHttp.post(url, param)
if (res.result === 'S') {
// vm.hasMultiRole = true
return true
} else { } else {
vm.hasMultiRole = false vm.hasMultiRole = false
vm.multiRole.bp_type = '' return false
vm.multiRole.bp_type_n = ''
} }
})
}, },
timeFormat (str) { timeFormat (str) {
return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}` return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}`
}, },
deleteBP () { deleteBP (e) {
this.multiBpType.bp_type_n = '' let deleteIndex
this.multiBpType.bp_type = '' this.multiBpTypeSelectList.forEach((i, index, arr) => {
if (arr[index].bp_type.indexOf(e.bp_type) !== -1) {
deleteIndex = index
}
})
this.multiBpTypeSelectList.splice(deleteIndex, 1)
this.isAddNewType = false this.isAddNewType = false
}, },
selectIdMultiType (e) { selectIdMultiType (e) {
...@@ -866,6 +890,7 @@ export default { ...@@ -866,6 +890,7 @@ export default {
if (vm.baseInfo.bp_type === 'TENANT' || vm.baseInfo.bp_type === 'GUTA') { if (vm.baseInfo.bp_type === 'TENANT' || vm.baseInfo.bp_type === 'GUTA') {
business_num = vm.baseInfo.agent_username business_num = vm.baseInfo.agent_username
} }
window.localStorage.setItem('business_num', business_num)
let url = process.env.basePath + 'bp_bind_check' let url = process.env.basePath + 'bp_bind_check'
let param = { let param = {
bp_class: 'ORG', bp_class: 'ORG',
...@@ -1259,20 +1284,53 @@ export default { ...@@ -1259,20 +1284,53 @@ export default {
}) })
}, },
// 客户类型下拉框 // 客户类型下拉框
selectIdType (e) { selectIdType () {
let vm = this let vm = this
let List
if (vm.baseInfo.bp_type === 'TENANT') {
List = vm.typeList.filter(i => {
return i.code === 'GUTA' || i.code === 'AGENT'
})
} else if (vm.baseInfo.bp_type === 'GUTA') {
List = vm.typeList.filter(i => {
return i.code === 'TENANT' || i.code === 'AGENT'
})
} else if (vm.baseInfo.bp_type === 'AGENT') {
List = vm.typeList.filter(i => {
return i.code === 'TENANT' || i.code === 'GUTA'
})
}
vm.hlsPopup.selectList({ vm.hlsPopup.selectList({
list: vm.typeList, list: List,
code: 'bp_type', code: 'bp_type',
object: {}, object: {},
returnItem: function (index, obj) { returnItem: function (index, obj) {
vm.baseInfo.bp_type = obj.bp_type vm.multiBpType.bp_type = obj.bp_type
vm.baseInfo.bp_type_n = obj.bp_type_n vm.multiBpType.bp_type_n = obj.bp_type_n
if ( let selectList = false
vm.baseInfo.bp_type === 'TENANT' || let queryList = false
vm.baseInfo.bp_type === 'GUTA' let baseInfo = false
) { vm.multiBpTypeSelectList.forEach((item, index, arr) => {
vm.bp_type_flag = true if (item.bp_type === vm.multiBpType.bp_type) {
selectList = true
}
})
vm.multiRoleList.forEach((item, index, arr) => {
if (item.bp_type === vm.multiBpType.bp_type) {
queryList = true
}
})
if (vm.baseInfo.bp_type === vm.multiBpType.bp_type) {
baseInfo = true
}
if (baseInfo || queryList || selectList) {
hlsPopup.showLongCenter('您已经添加了该角色')
vm.isAddNewType = false
vm.isSelected = false
} else {
vm.multiBpTypeSelectList.push(vm.multiBpType)
vm.isAddNewType = true
vm.isSelected = true
} }
}, },
}) })
...@@ -1373,6 +1431,8 @@ export default { ...@@ -1373,6 +1431,8 @@ export default {
if (res.result === 'S') { if (res.result === 'S') {
hlsPopup.showLongCenter('新增成功') hlsPopup.showLongCenter('新增成功')
vm.isAddNewType = false vm.isAddNewType = false
let item = vm.multiBpTypeSelectList.pop()
vm.multiRoleList.push(item)
} else { } else {
hlsPopup.showLongCenter(res.message) hlsPopup.showLongCenter(res.message)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment