Commit d8c8f540 authored by JingChao's avatar JingChao

Merge branch 'develop' of https://hel.hand-china.com/xugong/hls-xcmg-vue-app into develop

parents d9e80315 cc9ce5d2
Pipeline #4637 canceled with stages
......@@ -237,8 +237,7 @@
"ajv-keywords": {
"version": "3.4.1",
"resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.4.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv-keywords%2Fdownload%2Fajv-keywords-3.4.1.tgz",
"integrity": "sha1-75FuJxxkrBIXH9g4TqrmsjRYVNo=",
"dev": true
"integrity": "sha1-75FuJxxkrBIXH9g4TqrmsjRYVNo="
},
"align-text": {
"version": "0.1.4",
......@@ -3659,8 +3658,7 @@
"emojis-list": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-2.1.0.tgz",
"integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=",
"dev": true
"integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k="
},
"encodeurl": {
"version": "1.0.2",
......@@ -4649,8 +4647,7 @@
"fast-json-stable-stringify": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz?cache=0&sync_timestamp=1576340291001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-json-stable-stringify%2Fdownload%2Ffast-json-stable-stringify-2.1.0.tgz",
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=",
"dev": true
"integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM="
},
"fast-levenshtein": {
"version": "2.0.6",
......@@ -6615,8 +6612,7 @@
"js-base64": {
"version": "2.5.1",
"resolved": "https://registry.npm.taobao.org/js-base64/download/js-base64-2.5.1.tgz",
"integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE=",
"dev": true
"integrity": "sha1-Hvo57yxfeYC7F4St5KivLeMpESE="
},
"js-tokens": {
"version": "3.0.2",
......@@ -6913,7 +6909,6 @@
"version": "1.2.3",
"resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-1.2.3.tgz",
"integrity": "sha1-H/XcaRHJ8KBiUxpMBLYJQGEIwsc=",
"dev": true,
"requires": {
"big.js": "^5.2.2",
"emojis-list": "^2.0.0",
......@@ -6923,14 +6918,12 @@
"big.js": {
"version": "5.2.2",
"resolved": "https://registry.npm.taobao.org/big.js/download/big.js-5.2.2.tgz",
"integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=",
"dev": true
"integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg="
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npm.taobao.org/json5/download/json5-1.0.1.tgz",
"integrity": "sha1-d5+wAYYE+oVOrL9iUhgNg1Q+Pb4=",
"dev": true,
"requires": {
"minimist": "^1.2.0"
}
......@@ -7277,8 +7270,7 @@
"minimist": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.0.tgz",
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"dev": true
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ="
},
"mississippi": {
"version": "2.0.0",
......@@ -7463,6 +7455,11 @@
"integrity": "sha1-r3d02FQCprfLlsH5G7JP3VjXwLA=",
"dev": true
},
"node-ensure": {
"version": "0.0.0",
"resolved": "http://r.cnpmjs.org/node-ensure/download/node-ensure-0.0.0.tgz",
"integrity": "sha1-7K52QVDemYYexcgQ/V0Jaxg5Mqc="
},
"node-forge": {
"version": "0.9.0",
"resolved": "https://registry.npm.taobao.org/node-forge/download/node-forge-0.9.0.tgz",
......@@ -8530,6 +8527,15 @@
"sha.js": "^2.4.8"
}
},
"pdfjs-dist": {
"version": "2.2.228",
"resolved": "http://r.cnpmjs.org/pdfjs-dist/download/pdfjs-dist-2.2.228.tgz",
"integrity": "sha1-d3sGigoWyWQYQzMDgHwYMFi0eqo=",
"requires": {
"node-ensure": "^0.0.0",
"worker-loader": "^2.0.0"
}
},
"performance-now": {
"version": "0.2.0",
"resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-0.2.0.tgz",
......@@ -11531,7 +11537,6 @@
"version": "0.4.7",
"resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-0.4.7.tgz?cache=0&sync_timestamp=1574946791935&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fschema-utils%2Fdownload%2Fschema-utils-0.4.7.tgz",
"integrity": "sha1-unT1l9K+LqiAExdG7hfQoJPGgYc=",
"dev": true,
"requires": {
"ajv": "^6.1.0",
"ajv-keywords": "^3.1.0"
......@@ -11541,7 +11546,6 @@
"version": "6.10.2",
"resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.10.2.tgz",
"integrity": "sha1-086gTWsBeyiUrWkED+yLYj60vVI=",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
......@@ -11552,14 +11556,12 @@
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-2.0.1.tgz?cache=0&sync_timestamp=1575383928809&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk="
},
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz",
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=",
"dev": true
"integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA="
}
}
},
......@@ -12937,7 +12939,6 @@
"version": "4.2.2",
"resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz",
"integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=",
"dev": true,
"requires": {
"punycode": "^2.1.0"
},
......@@ -12945,8 +12946,7 @@
"punycode": {
"version": "2.1.1",
"resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz",
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=",
"dev": true
"integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew="
}
}
},
......@@ -13894,6 +13894,15 @@
"integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=",
"dev": true
},
"worker-loader": {
"version": "2.0.0",
"resolved": "http://r.cnpmjs.org/worker-loader/download/worker-loader-2.0.0.tgz",
"integrity": "sha1-Rf2j73asqBV3GokQc5nuQRm0MKw=",
"requires": {
"loader-utils": "^1.0.0",
"schema-utils": "^0.4.0"
}
},
"wrap-ansi": {
"version": "2.1.0",
"resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-2.1.0.tgz",
......
......@@ -98,6 +98,7 @@ export default {
unRepay_flag: false,
repaying_flag: false,
repayed_flag: false,
bp_type: '', // 用户类型
}
},
computed: {},
......@@ -169,6 +170,16 @@ export default {
vm.unRepay_flag = false
vm.repaying_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)
}
})
......@@ -194,6 +205,7 @@ export default {
let param = {
user_phone: window.localStorage.user_phone,
searchInput: vm.searchInput,
bp_type: vm.bp_type,
pagenum: 1,
pagesize: 10,
contract_status_n: status,
......
......@@ -18,7 +18,7 @@
<h-content class="repay-content">
<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>
<list-item :item-height="44" class="invoice">
<item>
......@@ -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 () {
let vm = this
......
......@@ -159,6 +159,7 @@ export default {
vm.$post(url, param).then(function (res) {
vm.hlsPopup.hideLoading()
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_class = res.info.user_bp_class
vm.bp_id = res.info.user_bp_id
......
......@@ -12,7 +12,8 @@
<div slot="center">个人中心</div>
</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">
<img :src="upLoadObj" @click="checkType" >
<div class="sign">
......@@ -26,18 +27,19 @@
</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-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" >
<p>发车申请</p>
</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" >
<p>首付还款</p>
</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" >
<p>租金还款</p>
</div>
......@@ -45,6 +47,14 @@
<img src="@/assets/myInfo/promise.png" >
<p>缴纳保证金</p>
</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>
......@@ -53,7 +63,7 @@
<div class="content-top">
<div class="userInfo">我的合同</div>
<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
v-if="signCount > 0"
:class="{'content-wrap-class-width':signCount>99, 'content-wrap-class':signCount<99}"
......@@ -85,7 +95,7 @@
<p>待面签</p>
</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"
@click="goCarConfirm"
>
......@@ -100,7 +110,7 @@
</div>
<list-item :item-height="44" class="list">
<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"
>
<img slot="left-icon" src="@/assets/myInfo/myRefund.png" class="left-icon" >
......@@ -192,31 +202,34 @@ export default {
carCount: '0',
description: '',
bp_identity: '',
bp_type_n: '',
approveBtn: false,
elecStatus: false,
roleSwitchFlag: false, // 选择角色模态框显示标志
roleList: [
{
bp_type: 'TENANT',
bp_type_desc: '主承租人',
},
{
bp_type: 'GUTA',
bp_type_desc: '担保人',
},
],
multiRoleList: [], // 查到的多角色
type: [
{
bp_type: '0',
bp_type_desc: '修改信息',
bp_type_n: '修改信息',
},
{
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: {
user_bp_type (newVal, oldVal) {
if (newVal === 'AGENT') {
......@@ -281,6 +294,7 @@ export default {
vm.multipleRole = window.localStorage.getItem('multipleRole')
vm.userQuery()
vm.numQuery()
vm.getMultipleRole()
})
next()
},
......@@ -331,6 +345,9 @@ export default {
} else if (role.bp_type === 'GUTA') {
window.localStorage.setItem('multipleRole', 'GUTA')
this.multipleRole = 'GUTA'
} else if (role.bp_type === 'AGENT') {
window.localStorage.setItem('multipleRole', 'AGENT')
this.multipleRole = 'AGENT'
}
console.log('选择后的角色为:' + role)
},
......@@ -435,6 +452,15 @@ export default {
name: 'MyProductList',
})
},
// 进入
changeContract (e) {
this.$router.push({
name: 'ContractRecords',
params: {
bp_type: e,
},
})
},
// 进入发车申请
goStart () {
if (this.bp_id) {
......@@ -640,8 +666,8 @@ export default {
} else if (index === 1) {
this.changePageHead()
} else if (index === 2) {
if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA')) && (vm.user_bp_status === 'APPROVED')) {
this.$refs.roleSwitchRoleList.show()
if (((vm.user_bp_type === 'TENANT') || (vm.user_bp_type === 'GUTA') || (vm.user_bp_type === 'AGENT')) && (vm.user_bp_status === 'APPROVED')) {
vm.$refs.roleSwitchRoleList.show()
} else {
hlsPopup.showLongCenter('您当前尚无可用角色')
}
......@@ -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) {
let vm = this
......@@ -851,6 +892,7 @@ export default {
vm.user_bp_name = res.info.user_bp_name
vm.user_bp_type = res.info.user_bp_type
vm.user_phone = res.info.user_phone
vm.bp_type_n = res.info.user_bp_type_n
vm.watchBpStatus()
vm.getHead()
if (vm.user_bp_type === 'AGENT') {
......@@ -858,7 +900,7 @@ export default {
} else {
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
} else {
vm.isMultiRole = false
......@@ -1113,7 +1155,7 @@ export default {
height: 121px;
background-color: #fff;
border-radius: 4px;
margin-top: 18px;
margin-top: 8px;
}
.userInfo {
height: 45px;
......
......@@ -14,7 +14,7 @@
<div
v-for="(item,index) in roleList" :key="index" :class="{'item-active':index === switchIndex}" class="role-item"
@click="chooseRole(index)">
<span>{{ item.bp_type_desc }}</span>
<span>{{ item.bp_type_n }}</span>
</div>
<div :class="{'content-btn-active':switchIndex !== ''}" class="content-btn" @click="roleConfirm"><span>确定</span></div>
</div>
......
......@@ -210,6 +210,8 @@ export default {
master: {
bp_id: bp_id,
company_id: '2145',
bp_class: 'NP',
business_num: window.localStorage.getItem('business_num'),
},
}
vm.hlsPopup.showLoading('请稍候')
......
......@@ -20,13 +20,14 @@
@click="selectIdTypeOnly()"
>
</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="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span>
<span>
{{ multiBpType.bp_type_n }}
<img v-if="multiBpType.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP" >
<span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
<span v-for="(item,index) in multiBpTypeSelectList" :key="item.bp_type">
{{ item.bp_type_n }}
<img v-if="item.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP(item)" >
</span>
</div>
</item>
......@@ -34,7 +35,7 @@
<div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP">
<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>
</item>
<item v-if="(isPaople&&from)||(isPaople&&isSelected)">
......@@ -326,7 +327,7 @@ export default {
isApproved: false,
isSave: false,
isAGENT: this.$route.params.isAGENT,
isMultiRole: this.$route.params.isMultiRole, // 能否选择多角色
isMultiRole: false, // 能否选择多角色
isSelected: false,
hasMultiRole: false, // 是否有第二个角色
from: false,
......@@ -343,11 +344,13 @@ export default {
bankList: [],
maritalList: [],
districtList: [],
multiBpTypeSelectList: [], // 添加的角色
img_url: {},
multiRole: {
bp_type_n: '',
bp_type: '',
}, // 查询出来的第二个角色
multiRoleList: [], // 查询出来的多角色
baseInfo: {
bp_type_n: '',
academic_background_n: '',
......@@ -445,15 +448,18 @@ export default {
beforeRouteEnter (to, from, next) {
// 绑定查询入口
next(vm => {
if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true
} else {
vm.isApproved = false
}
vm.isMultiRole = vm.$route.params.isMultiRole
if (from.fullPath === '/tab/my-info') {
if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true
} else {
vm.isApproved = false
}
vm.isMultiRole = vm.$route.params.isMultiRole
vm.list = {}
vm.multiBpType = {}
vm.multiBpTypeSelectList = []// 选择的角色
vm.multiRoleList = []// 查询的角色
vm.upload_list = [] // 上传图片列表
vm.dowload_list = [] // 下载图片列表
vm.img_url = {}
......@@ -484,7 +490,7 @@ export default {
window.localStorage.setItem('from', true)
vm.basicInfoQuery()
vm.loadItemList() // 附件查询
vm.checkHasmultiple()// 查询是否有新角色
vm.getMultipleRole()// 获取第二角色
} else if (from.name === 'UserBind') {
vm.list = {}
window.localStorage.setItem('from', false)
......@@ -556,9 +562,14 @@ export default {
timeFormat (str) {
return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}`
},
deleteBP () {
this.multiBpType.bp_type_n = ''
this.multiBpType.bp_type = ''
deleteBP (e) {
let deleteIndex
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
},
addNewRole () {
......@@ -576,6 +587,8 @@ export default {
if (res.result === 'S') {
hlsPopup.showLongCenter('新增成功')
vm.isAddNewType = false
let item = vm.multiBpTypeSelectList.pop()
vm.multiRoleList.push(item)
} else {
hlsPopup.showLongCenter(res.message)
}
......@@ -781,30 +794,43 @@ export default {
}
})
},
checkHasmultiple () {
async getMultipleRole () {
let vm = this
let url = process.env.basePath + 'bp_role_query'
let flag = vm.checkHasmultiple()
let param = {
master: {
bp_id: window.localStorage.getItem('bp_id'),
bp_type: window.localStorage.getItem('bp_type'),
},
}
if (flag) {
vm.hlsHttp.post(url, param).then(function (res) {
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
}
}
})
}
},
async checkHasmultiple () {
let vm = this
let url = process.env.basePath + 'bp_role_check'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
}
// vm.hlsPopup.showLoading('请稍后')
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
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'
}
} else {
vm.hasMultiRole = false
vm.multiRole.bp_type = ''
vm.multiRole.bp_type_n = ''
}
})
let res = await vm.hlsHttp.post(url, param)
if (res.result === 'S') {
// vm.hasMultiRole = true
return true
} else {
vm.hasMultiRole = false
return false
}
},
// 基本信息保存前校验
bindCheck () {
......@@ -817,6 +843,7 @@ export default {
} else if (vm.baseInfo.bp_type === 'OFFICE') {
business_num = vm.baseInfo.business_license_num
}
window.localStorage.setItem('business_num', business_num)
let url = process.env.basePath + 'bp_bind_check'
let param = {
bp_class: 'NP',
......@@ -851,7 +878,7 @@ export default {
window.localStorage.setItem('bp_id', res.bp_id)
window.localStorage.setItem('bp_name', vm.baseInfo.bp_name)
window.localStorage.setItem('bp_type', vm.baseInfo.bp_type)
// vm.bindCheck()
vm.bindCheck()
vm.$router.push({
name: 'NPInvoiceInfo',
})
......@@ -1269,16 +1296,20 @@ export default {
this.$refs.myTestareaLive.rows = addNum + 1
}
},
selectIdType (e) {
selectIdType () {
let vm = this
let List
if (vm.baseInfo.bp_type === 'TENANT') {
List = vm.typeList.filter(i => {
return i.code === 'GUTA'
return i.code === 'GUTA' || i.code === 'AGENT'
})
} else if (vm.baseInfo.bp_type === 'GUTA') {
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({
......@@ -1288,8 +1319,31 @@ export default {
returnItem: function (index, obj) {
vm.multiBpType.bp_type = obj.bp_type
vm.multiBpType.bp_type_n = obj.bp_type_n
vm.isAddNewType = true
vm.isSelected = true
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.isSelected = true
}
},
})
},
......
......@@ -296,6 +296,8 @@ export default {
master: {
bp_id: this.$route.params.bp_id,
company_id: '2145',
bp_class: 'ORG',
business_num: window.localStorage.getItem('business_num'),
},
}
let vm = this
......
......@@ -27,13 +27,14 @@
@click="selectIdType()"
>
</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="content" class="typeBP">
<span>{{ baseInfo.bp_type_n }}</span>
<span>
{{ multiBpType.bp_type_n }}
<img v-if="multiBpType.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP">
<span v-for="(item,index) in multiRoleList" :key="index">{{ item.bp_type_n }}</span>
<span v-for="(item,index) in multiBpTypeSelectList" :key="item.bp_type">
{{ item.bp_type_n }}
<img v-if="item.bp_type_n" src="@/assets/userBind/deleteTag.png" @click.stop @click="deleteBP(item)" >
</span>
</div>
</item>
......@@ -41,7 +42,7 @@
<div slot="name" class="required">客户类型</div>
<div slot="content" class="typeBP">
<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>
</item>
<item v-if="bp_type_flag">
......@@ -438,6 +439,8 @@ export default {
backList: [],
saveInfo: {},
lastInfo: {},
multiBpTypeSelectList: [], // 添加的角色
multiRoleList: [], // 查询出来的多角色
msg_flag: false,
maritalList: [],
getBankList: [],
......@@ -581,16 +584,18 @@ export default {
next(vm => {
vm.getBpType()
vm.getProvince()
if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true
window.localStorage.setItem('isApproved', vm.isApproved)
}
vm.isMultiRole = vm.$route.params.isMultiRole
if (from.fullPath === '/tab/my-info') { /* || from.fullPath === '/margin-first-pay' */
vm.legal_personMsg = {}
if (vm.$route.params.status === 'APPROVED') {
vm.isApproved = true
window.localStorage.setItem('isApproved', vm.isApproved)
}
vm.isMultiRole = vm.$route.params.isMultiRole
window.localStorage.setItem('from', true)
vm.baseInfo = {}
vm.authMsg = {}
vm.multiBpTypeSelectList = []// 选择的角色
vm.multiRoleList = []// 查询的角色
vm.bp_id = vm.$route.params.bp_id
vm.idCardFront = '' // 身份证正面图片
vm.idCardBack = '' // 身份证反面图片
......@@ -617,6 +622,7 @@ export default {
vm.licenseImgUrlFlag = false // 营业执照照片,为false则用查询出来的,为true则用拍照出来的
vm.laImgUrlFlag = false // 授权书图片,为false则用查询出来的,为true则用拍照出来的
vm.getbaseInfo()
vm.getMultipleRole()// 获取第二角色
} else if (from.name === 'UserBind') {
window.localStorage.setItem('from', false)
vm.multiBpType = {
......@@ -735,37 +741,55 @@ export default {
next()
}, */
methods: {
checkHasmultiple () {
async getMultipleRole () {
let vm = this
let url = process.env.basePath + 'bp_role_query'
let flag = vm.checkHasmultiple()
let param = {
master: {
bp_id: window.localStorage.getItem('bp_id'),
bp_type: window.localStorage.getItem('bp_type'),
},
}
if (flag) {
vm.hlsHttp.post(url, param).then(function (res) {
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
}
}
})
}
},
async checkHasmultiple () {
let vm = this
let url = process.env.basePath + 'bp_role_check'
let param = {
bp_id: window.localStorage.getItem('bp_id'),
}
// vm.hlsPopup.showLoading('请稍后')
vm.hlsHttp.post(url, param).then(function (res) {
// vm.hlsPopup.hideLoading()
if (res.result === 'S') {
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'
}
} else {
vm.hasMultiRole = false
vm.multiRole.bp_type = ''
vm.multiRole.bp_type_n = ''
}
})
let res = await vm.hlsHttp.post(url, param)
if (res.result === 'S') {
// vm.hasMultiRole = true
return true
} else {
vm.hasMultiRole = false
return false
}
},
timeFormat (str) {
return `${str.substring(0, 4)}-${str.substring(4, 6)}-${str.substring(6)}`
},
deleteBP () {
this.multiBpType.bp_type_n = ''
this.multiBpType.bp_type = ''
deleteBP (e) {
let deleteIndex
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
},
selectIdMultiType (e) {
......@@ -866,6 +890,7 @@ export default {
if (vm.baseInfo.bp_type === 'TENANT' || vm.baseInfo.bp_type === 'GUTA') {
business_num = vm.baseInfo.agent_username
}
window.localStorage.setItem('business_num', business_num)
let url = process.env.basePath + 'bp_bind_check'
let param = {
bp_class: 'ORG',
......@@ -1259,20 +1284,53 @@ export default {
})
},
// 客户类型下拉框
selectIdType (e) {
selectIdType () {
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({
list: vm.typeList,
list: List,
code: 'bp_type',
object: {},
returnItem: function (index, obj) {
vm.baseInfo.bp_type = obj.bp_type
vm.baseInfo.bp_type_n = obj.bp_type_n
if (
vm.baseInfo.bp_type === 'TENANT' ||
vm.baseInfo.bp_type === 'GUTA'
) {
vm.bp_type_flag = true
vm.multiBpType.bp_type = obj.bp_type
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.isSelected = true
}
},
})
......@@ -1373,6 +1431,8 @@ export default {
if (res.result === 'S') {
hlsPopup.showLongCenter('新增成功')
vm.isAddNewType = false
let item = vm.multiBpTypeSelectList.pop()
vm.multiRoleList.push(item)
} else {
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