<!--
|
* @Descripttion:
|
* @version:
|
* @Author: Pengjiantian
|
* @Date: 2019-08-26 15:08:09
|
* @LastEditors : PengJianTian
|
* @LastEditTime : 2019-12-26 11:36:50
|
-->
|
<template>
|
<div style="min-width:1054px">
|
<el-container>
|
<el-container class="partnerContainer">
|
<el-aside class="partnerSidebar" width="159px">
|
<el-menu :default-active="$route.path">
|
<el-menu-item-group v-if="mainTain">
|
<el-menu-item>
|
<el-button
|
round
|
size="mini"
|
@click="returnList"
|
class="returnList"
|
style="font-size:12px"
|
>
|
<i class="el-icon-back"></i>
|
返回列表
|
</el-button>
|
</el-menu-item>
|
</el-menu-item-group>
|
<!-- <el-menu-item-group>
|
<el-menu-item>
|
<router-link :to="'/area/partner/' + step"
|
><el-button round size="mini">返回列表</el-button>
|
</router-link></el-menu-item
|
>
|
</el-menu-item-group>-->
|
<div v-for="(item, index) in menus" :key="index">
|
<el-menu-item
|
:index="'/area/partner/' + pageType + '/' + item.url"
|
@click="handleGo(item.url, index)"
|
:disabled="item.edit === 'N'"
|
>
|
<span slot="title">{{ item.tabname }}</span>
|
</el-menu-item>
|
</div>
|
</el-menu>
|
</el-aside>
|
<el-container class="partnerContent" style="min-height:100vh">
|
<el-main style="padding:0 20px 160px">
|
<router-view
|
ref="childPage"
|
@handleNextPage="handleUpdateNext"
|
id="area"
|
:nextChange="nextChange"
|
@notNext="notNext"
|
@opinionSubmit="opinionSubmit"
|
></router-view>
|
</el-main>
|
</el-container>
|
<el-footer id="partner" style="height:100px">
|
<!-- {{partnerParams.phaseno}}{{nextChange}} {{partnerParams.likePhaseno}} -->
|
<el-row :gutter="20" type="flex" justify="space-around">
|
<el-col :span="8" v-if="partnerParams.phaseno !=='0010'||partnerParams.likePhaseno||partnerParams.pageType === 'details'">
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="saveBtn && noneSave && (renewAfterSave || $route.path.includes('approve'))"
|
@click="handleSave"
|
>保 存</el-button>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="prevPageBtn"
|
@click="handlePrevPage"
|
>上一页</el-button>
|
<!-- 详情 -->
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="detailsNextBtn"
|
@click="handleNextPage"
|
>下一页</el-button>
|
<!-- 新增 -->
|
<!-- v-if="updateNextBtn && !submitBtn && (!$route.path.includes('images')||pageType === 'update')" -->
|
<!-- 新增阶段没有phaseno-阶段号 -->
|
<!-- {{!$route.path.includes('images')}} {{partnerParams.phaseno}} -->
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="updateNextBtn && !submitBtn && !$route.path.includes('approve') && !$route.path.includes('flow') "
|
@click="handleNextPage"
|
>下一页</el-button>
|
<!-- (partnerParams.likePhaseno&&$route.path.includes('images')) 控制变更申请影像显示提交按钮 -->
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="$route.path.includes('update/approve')||(partnerParams.likePhaseno&&$route.path.includes('images'))"
|
@click="handleFlowSubmit"
|
>提交</el-button>
|
</el-col>
|
<el-col :span="8" v-else>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="saveBtn && noneSave"
|
@click="handleSaveDarft"
|
>保存草稿</el-button>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="prevPageBtn && noneSave && !$route.path.includes('info')"
|
@click="handlePrevPage"
|
>上一步</el-button>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="updateNextBtn && !submitBtn && !$route.path.includes('images') && noneSave"
|
@click="handleSubmit"
|
>下一步</el-button>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="!noneSave"
|
@click="handlePrevPage"
|
>上一页</el-button>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="!noneSave && !$route.path.includes('flow')"
|
@click="handleNextPage"
|
>下一页</el-button>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="submitBtn || (partnerParams.addState === '01' && $route.path.includes('images'))"
|
@click="handleFlowSubmit"
|
>提交</el-button>
|
</el-col>
|
</el-row>
|
</el-footer>
|
<el-dialog title="提示" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
|
<span>数据未保存,确定返回到列表吗?</span>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button type="primary" @click="clickSubmit">确 定</el-button>
|
</span>
|
</el-dialog>
|
</el-container>
|
<el-dialog
|
:visible.sync="commitDialogVisible"
|
width="20%"
|
center
|
:before-close="enterMessages"
|
>
|
<div class="messageCheck">
|
<i class="el-icon-success checkSuccess"></i>
|
<div class="tip">提交成功</div>
|
</div>
|
<span slot="footer" class="dialog-footer">
|
<el-button @click="enterMessages">确 定</el-button>
|
</span>
|
</el-dialog>
|
</el-container>
|
</div>
|
</template>
|
|
<script>
|
import '../../style/areaBuilding.styl'
|
import { queryChannelTabTree, submitChannelAdmitIn } from '@/api/area/partner'
|
import { mapState } from 'vuex'
|
export default {
|
data: function() {
|
return {
|
// 未保存的弹框
|
dialogVisible: false,
|
pageType: '',
|
//
|
currentTab: [],
|
currentIndex: 1,
|
menus: [],
|
currentMenus: [],
|
index: 0,
|
urls: [
|
{ tabname: '合作方信息', url: 'info' },
|
{ tabname: '申请信息', url: 'apply' },
|
{ tabname: '影像资料信息', url: 'images' },
|
{ tabname: '审批意见', url: 'approve' },
|
{ tabname: '历史审批意见', url: 'history' },
|
{ tabname: '流程流转记录', url: 'flow' },
|
{ tabname: '维护记录', url: 'maintain' }
|
],
|
form: '',
|
commitDialogVisible: false,
|
nextChange: true, // 上/下一步不需要对数据保存提示 上/下一页需要对数据进行保存提示
|
mainTain: true // 维护详情
|
}
|
},
|
created() {
|
if (this.$route.path.includes('details')) {
|
const { ftserialno, objectType, objectno, pageType, serialno, unifiedsocialcreditcode = '', queryType, phaseno = '', step = '', taskAdjustment = '' } = this.$route.query
|
let partnerParams = {
|
ftserialno,
|
objectType,
|
objectno,
|
pageType,
|
serialno,
|
unifiedsocialcreditcode,
|
queryType,
|
phaseno,
|
step,
|
taskAdjustment
|
}
|
this.$store.commit('SET_partnerParams', partnerParams)
|
// console.log(1111)
|
}
|
this.initMenu()
|
},
|
mounted() {
|
if (this.$route.path.includes('update')) {
|
this.form = this.$refs['childPage'].form
|
// 初始化保存当前页面表单
|
// this.form = Object.assign({},this.$refs['childPage'].form)
|
}
|
},
|
computed: {
|
prevPageBtn() {
|
return Boolean(this.currentMenus[this.currentIndex - 1])
|
},
|
detailsNextBtn() {
|
return Boolean(
|
this.currentMenus[this.currentIndex + 1] && this.pageType === 'details'
|
)
|
},
|
updateNextBtn() {
|
return Boolean(
|
this.currentMenus[this.currentIndex + 1] && this.pageType === 'update'
|
)
|
},
|
submitBtn() {
|
if (!this._.isEmpty(this.menus)) {
|
if (this._.isEmpty(this.partnerParams.phaseno)) {
|
// if (this.partnerParams.phaseno) {
|
return Boolean(
|
this.currentMenus[this.currentIndex].tabname === '影像资料信息' &&
|
this.pageType === 'update'
|
)
|
} else {
|
return Boolean(
|
this.currentMenus[this.currentIndex].tabname === '审批意见' &&
|
this.pageType === 'update'
|
)
|
}
|
} else {
|
return false
|
}
|
},
|
saveBtn() {
|
return Boolean(this.pageType === 'update')
|
},
|
step() {
|
if (!this._.isEmpty(this.partnerParams.step)) {
|
return 'check?phaseno=' + this.partnerParams.phaseno
|
} else {
|
return 'index'
|
}
|
},
|
...mapState({
|
partnerParams: state => state.risk.partnerParams
|
}),
|
// 历史审批意见,流程流转记录,维护记录无保存草稿按钮控制
|
noneSave() {
|
if (
|
this.$route.path.includes('history') ||
|
this.$route.path.includes('flow') ||
|
this.$route.path.includes('maintain')
|
) {
|
return false
|
} else {
|
return true
|
}
|
},
|
// 复审及之后节点保存按钮处理
|
renewAfterSave() {
|
if (
|
this.partnerParams.phaseno === '0040' ||
|
this.partnerParams.phaseno === '0050' ||
|
this.partnerParams.phaseno === '0060' ||
|
this.partnerParams.phaseno === '0070' ||
|
this.partnerParams.phaseno === '0090'
|
) {
|
return false
|
} else {
|
return true
|
}
|
}
|
},
|
methods: {
|
async initMenu() {
|
const { mainTain } = this.$route.query
|
if (mainTain) {
|
this.mainTain = false
|
}
|
let queryType = ''
|
this.partnerParams.pageType === 'update'
|
? (queryType = '1')
|
: (queryType = '0')
|
let params = {
|
serialno: this.partnerParams.serialno,
|
objectno: this.partnerParams.objectno,
|
objectType: this.partnerParams.objectType,
|
ftserialno: this.partnerParams.ftserialno,
|
queryType: this.partnerParams.queryType || queryType
|
}
|
// if (change) {
|
// params.queryType = '2'
|
// console.log(params.queryType)
|
// }
|
let res = await queryChannelTabTree(params)
|
this.menus = res.result.filter(item => item.visible === 'Y')
|
// 本地测试用
|
// this.menus = res.result.filter(item => item.visible === 'N')
|
// console.log(this.menus)
|
if (this.$route.path.includes('update')) {
|
// console.log(change)
|
this.menus = res.result.filter(item => item.tabname !== '维护记录')
|
}
|
if (this.partnerParams.phaseno) {
|
this.menus.map(item => {
|
if (item.tabname === '合作方信息') {
|
item.open = 'Y'
|
}
|
if (item.tabname === '申请信息') {
|
item.open = 'N'
|
}
|
if (item.tabname === '影像资料信息') {
|
item.open = 'Y'
|
}
|
})
|
}
|
this.menus.forEach(item => {
|
item.url = this._.find(this.urls, { tabname: item.tabname }).url
|
})
|
this.currentTab = this.menus.filter(item => item.open === 'Y') // this.currentTab 当前所处页签 open控制下一步的页签
|
this.currentIndex = this.menus.findIndex(item => item.open === 'Y') // this.currentIndex 当前所处页签下标 Y打开 N关闭
|
this.currentMenus = this.menus.filter(item => item.edit === 'Y') // edit控制也签是否置灰,this.currentMenus当前菜单 edit==='N'置灰
|
this.pageType = this.partnerParams.pageType
|
// console.log(this.currentTab ,this.currentIndex,this.pageType )
|
// 暂时屏蔽
|
// if (this.currentTab[0].url === 'info') {
|
// this.$router.push({
|
// path: '/area/partner/' + this.pageType + '/' + this.currentTab[0].url
|
// })
|
// }
|
},
|
handleGo(value, index) {
|
this.index = index
|
this.currentIndex = this.currentMenus.findIndex(
|
item => item.tabname === this.menus[index].tabname
|
)
|
this.$router.push({
|
path: '/area/partner/' + this.pageType + '/' + value
|
})
|
},
|
handlePrevPage() {
|
this.nextChange = true
|
this.currentIndex -= 1
|
let params = this.currentMenus[this.currentIndex].url
|
this.$router.push({
|
path: '/area/partner/' + this.pageType + '/' + params
|
})
|
},
|
handleNextPage() {
|
this.nextChange = true
|
this.currentIndex += 1
|
let params = this.currentMenus[this.currentIndex].url
|
this.$router.push({
|
path: '/area/partner/' + this.pageType + '/' + params
|
})
|
},
|
handleUpdateNext() {
|
this.nextChange = false
|
if (
|
this.partnerParams.phaseno !== '0010' &&
|
this.$route.path.includes('images')
|
) {
|
// console.log(this.partnerParams.phaseno)
|
// console.log(this.$route.path)
|
this.$router.push('/area/partner/update/approve')
|
}
|
this.currentIndex += 1
|
this.$set(this.menus[this.currentIndex], 'edit', 'Y')
|
this.currentMenus = this.menus.filter(item => item.edit === 'Y')
|
let params = this.menus[this.currentIndex].url
|
// console.log(this.currentMenus,params,this.currentIndex,this.pageType)
|
// console.log(this.$route.path)
|
this.$router.push({
|
path: '/area/partner/' + this.pageType + '/' + params
|
})
|
},
|
// 保存 -- 校验信息
|
handleSave() {
|
this.$refs['childPage'].handleSave()
|
},
|
// 保存草稿 -- 不校验信息
|
handleSaveDarft() {
|
this.$refs['childPage'].handleSaveDarft()
|
},
|
handleSubmit() {
|
this.nextChange = false
|
// let submitSave = true
|
// this.$refs['childPage'].handleSave(submitSave)
|
this.$refs['childPage'].handleSubmit()
|
},
|
handleFlowSubmit() {
|
let saveOpinion = true // 区别是否提示保存信息,点击保存提示,点击提交不提示
|
let params = {
|
serialno: this.partnerParams.serialno,
|
phaseno: this.partnerParams.phaseno,
|
objecttype: this.partnerParams.objectType
|
}
|
if (this.$route.path.includes('approve')) {
|
this.$refs['childPage'].handleSave(saveOpinion)
|
} else {
|
this.$refs['childPage'].handleSave(saveOpinion)
|
// console.log(1111)
|
submitChannelAdmitIn(params).then(res => {
|
if (res.code === '00') {
|
// this.$message.success('提交成功!')
|
this.commitDialogVisible = true
|
// this.partnerParams.phaseno !== '0010' 解决新增时,获取到0010阶段号后提交页面跳转至复核界面问题
|
// if (!this._.isEmpty(this.partnerParams.phaseno) && this.partnerParams.phaseno !== '0010' ) {
|
// this.$router.push({ path: '/area/partner/check?phaseno=' + this.partnerParams.phaseno })
|
// } else {
|
// this.$router.push({ path: '/area/partner/index' })
|
// }
|
}
|
})
|
}
|
// let params = {
|
// serialno: this.partnerParams.serialno,
|
// phaseno: this.partnerParams.phaseno,
|
// objecttype: this.partnerParams.objectType
|
// }
|
// submitChannelAdmitIn(params).then(res => {
|
// if (res.code === '00') {
|
// // this.$message.success('提交成功!')
|
// this.commitDialogVisible = true
|
// // this.partnerParams.phaseno !== '0010' 解决新增时,获取到0010阶段号后提交页面跳转至复核界面问题
|
// // if (!this._.isEmpty(this.partnerParams.phaseno) && this.partnerParams.phaseno !== '0010' ) {
|
// // this.$router.push({ path: '/area/partner/check?phaseno=' + this.partnerParams.phaseno })
|
// // } else {
|
// // this.$router.push({ path: '/area/partner/index' })
|
// // }
|
// }
|
// })
|
},
|
async opinionSubmit(bool) {
|
if (bool) {
|
let params = {
|
serialno: this.partnerParams.serialno,
|
phaseno: this.partnerParams.phaseno,
|
objecttype: this.partnerParams.objectType
|
}
|
submitChannelAdmitIn(params).then(res => {
|
if (res.code === '00') {
|
this.commitDialogVisible = true
|
}
|
})
|
}
|
},
|
// 确定
|
enterMessages() {
|
this.commitDialogVisible = false
|
if (!this.commitDialogVisible) {
|
// this.partnerParams.phaseno !== '0010' 解决新增时,获取到0010阶段号后提交页面跳转至复核界面问题
|
if (
|
!this._.isEmpty(this.partnerParams.phaseno) &&
|
this.partnerParams.phaseno !== '0010'
|
) {
|
this.$router.push({
|
path: '/area/partner/check?phaseno=' + this.partnerParams.phaseno
|
})
|
} else {
|
this.$router.push({ path: '/area/partner/index' })
|
}
|
}
|
},
|
// 返回列表
|
returnList() {
|
// 重新搜集表单数据
|
// let isSave = false
|
// if(this.$route.path.includes('update') && !this.$route.path.includes('approve')){
|
// if(this.$refs['childPage'].form){
|
// this.newFrom = this.$refs['childPage'].form
|
// // 修改后的表单
|
// // this.newFrom = Object.assign({},this.$refs['childPage'].form)
|
// for(let key in this.newFrom){
|
// if(this.newFrom[key].value === this.form[key].value){
|
// isSave = true
|
// }else{
|
// isSave = false
|
// this.dialogVisible = true
|
// break;
|
// }
|
// }
|
// if(isSave){
|
// this.$router.push({path:'/area/partner/' + this.step})
|
// }
|
// }else{
|
// this.$router.push({path:'/area/partner/' + this.step})
|
// }
|
// }else{
|
// console.log(this.step)
|
const { taskAdjustment } = this.partnerParams
|
if (taskAdjustment) {
|
this.$router.push({ path: '/comprehensiveTransaction/partnerTasksAdjustment' })
|
} else {
|
this.nextChange = true
|
this.$router.push({ path: '/area/partner/' + this.step })
|
}
|
// }
|
},
|
// 返回列表弹框关闭/遮罩时调用
|
handleClose(done) {
|
this.$confirm('确认关闭?')
|
.then(_ => {
|
done()
|
})
|
.catch(_ => {})
|
},
|
// 返回列表弹框确定调用
|
clickSubmit() {
|
this.dialogVisible = false
|
this.handleSave()
|
this.$router.push({ path: '/area/partner/' + this.step })
|
},
|
retrunLastPage() {
|
this.initMenu()
|
},
|
// 为保存点否
|
notNext() {
|
this.currentIndex -= 1
|
// if (this.currentIndex === 0) {
|
// this.prevPageBtn = false
|
// }
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
// .el-header{
|
// padding-left: 20px;
|
// height: 46px !important;
|
// line-height: 46px;
|
// font-size: 14px;
|
// background-color: #F9F9F9;
|
// }
|
.el-aside {
|
height: 100%;
|
}
|
|
.el-menu {
|
border-right: none;
|
}
|
|
#partner.el-footer {
|
position: fixed;
|
width: 100%;
|
bottom: 0;
|
background-color: white;
|
padding-top: 20px;
|
z-index: 1000;
|
}
|
|
.messageCheck {
|
display: flex;
|
flex-direction: column;
|
justify-content: center;
|
align-items: center;
|
}
|
|
.checkSuccess {
|
font-size: 80px;
|
color: rgb(82, 196, 26);
|
}
|
|
.tip {
|
margin-top: 10px;
|
font-size: 20px;
|
}
|
|
.returnList.el-button {
|
background: rgba(238, 238, 238, 1);
|
width: 83px;
|
height: 24px;
|
border none
|
>>> span {
|
position: relative;
|
left: -18px;
|
top: -1px;
|
|
.el-icon-back {
|
position: relative;
|
left: 6px;
|
top: -1px;
|
margin-right: 0px;
|
font-size: 14px;
|
font-weight: bold;
|
}
|
}
|
}
|
|
.partnerContainer {
|
.partnerSidebar {
|
position: fixed;
|
left: 0;
|
top: 0;
|
z-index: 1000;
|
background-color #fff;
|
}
|
|
.partnerContent {
|
margin-left: 160px;
|
}
|
|
>>>.el-footer {
|
.el-col-8 {
|
display: flex;
|
justify-content: center;
|
|
.submitBtn {
|
width: 120px;
|
height: 30px;
|
padding: 0;
|
|
span {
|
font-size: 14px;
|
height: 20px;
|
font-weight: 400;
|
line-height: 20px;
|
}
|
}
|
|
.blankBtn {
|
margin-left: 40px;
|
border-radius: 4px;
|
border: 1px solid rgba(204, 204, 204, 1);
|
color: rgba(85, 85, 85, 1);
|
|
&:nth-child(1) {
|
margin-left: 0;
|
}
|
}
|
|
.blueBtn {
|
margin-left: 40px;
|
background-color: rgba(0, 129, 240, 1);
|
border-radius: 4px;
|
color: rgba(255, 255, 255, 1);
|
}
|
}
|
}
|
}
|
</style>
|