<!--
|
* @Descripttion:
|
* @version:
|
* @Author: Pengjiantian
|
* @Date: 2019-08-26 15:08:09
|
* @LastEditors : PengJianTian
|
* @LastEditTime : 2019-12-26 11:26:57
|
-->
|
<template>
|
<div style="min-width:1054px">
|
<el-container>
|
<!-- <el-header>企业管理</el-header> -->
|
<el-container class="partnerContainer">
|
<el-aside class="partnerSidebar" width="160px">
|
<el-menu :default-active="$route.path">
|
<el-menu-item-group v-if="mainTain">
|
<el-menu-item>
|
<!-- <router-link :to="'/area/enterprise/' + step"> -->
|
<!-- <el-button
|
v-if="enterpriseParams.changeClickFlag === '1'"
|
round
|
@click="retrunLastPage"
|
size="mini"
|
class="returnList"
|
style="font-size:12px;width:93px"
|
>
|
<i class="el-icon-back"></i>
|
返回上一级
|
</el-button> -->
|
<el-button
|
round
|
@click="returnList"
|
size="mini"
|
class="returnList"
|
style="font-size:12px"
|
>
|
<i class="el-icon-back"></i>
|
返回列表
|
</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/enterprise/' + 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"
|
></router-view>
|
</el-main>
|
</el-container>
|
<el-footer id="enterprise">
|
<el-row :gutter="20" type="flex" justify="space-around">
|
<!-- 根据阶段号来区分显示上一页/上一步 -->
|
<el-col
|
:span="8"
|
v-if="enterpriseParams.phaseno || enterpriseParams.likePhaseno|| enterpriseParams.clickType == 1"
|
>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="saveBtn && noneSave"
|
@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>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="updateNextBtn && !submitBtn"
|
@click="handleNextPage"
|
>下一页</el-button>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="submitBtn"
|
@click="handleSubmit"
|
>提交</el-button>
|
</el-col>
|
<el-col :span="8" v-else>
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="saveBtn && noneSave"
|
@click="handleSaveDraft"
|
>保存草稿</el-button>
|
<template v-if="applyStageTwoPage">
|
<el-button
|
class="blankBtn submitBtn"
|
size="mini"
|
v-if="prevPageBtn"
|
@click="handlePrevPage"
|
>上一步</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>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="updateNextBtn && !submitBtn"
|
@click="handleSubmit"
|
>下一步</el-button>
|
</template>
|
<template v-else>
|
<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>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="updateNextBtn && !submitBtn"
|
@click="handleNextPage"
|
>下一页</el-button>
|
</template>
|
<el-button
|
class="blueBtn submitBtn"
|
size="mini"
|
type="primary"
|
v-if="submitBtn"
|
@click="handleSubmit"
|
>提交</el-button>
|
</el-col>
|
</el-row>
|
</el-footer>
|
</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 '../style/messagesBox.styl'
|
import { queryEnterpriseTabTree, enpFlowSubmit } from '@/api/area/enterprise'
|
import { mapState } from 'vuex'
|
export default {
|
data: function() {
|
return {
|
pageType: '',
|
//
|
currentTab: [],
|
currentIndex: 1,
|
menus: [],
|
currentMenus: [],
|
index: 0,
|
urls: [
|
{ tabname: '企业信息', url: 'enterpriseBaseInfo' },
|
{ tabname: '申请信息', url: 'applyInfo' },
|
{ tabname: '项目公司', url: 'projectCompany' },
|
{ tabname: '影像资料信息', url: 'imageInfo' },
|
{ tabname: '审批意见', url: 'approveOpinion' },
|
{ tabname: '历史审批意见', url: 'approveHistory' },
|
{ tabname: '流程流转记录', url: 'flowRecord' },
|
{ tabname: '维护记录', url: 'changeHistory' }
|
],
|
commitDialogVisible: false,
|
nextChange: true, // 上/下一步不需要对数据保存提示 上/下一页需要对数据进行保存提示
|
mainTain: true,
|
}
|
},
|
created() {
|
if (this.$route.path.includes('details')) {
|
const { clickType, tempSerialNo, masterSerialNo, objectType, changeClickFlag = '', phaseno = '', step = '', taskAdjustment = '' } = this.$route.query
|
let enterpriseParams = {
|
clickType,
|
tempSerialNo,
|
masterSerialNo,
|
objectType,
|
changeClickFlag,
|
phaseno,
|
step,
|
taskAdjustment
|
}
|
this.$store.commit('SET_enterpriseParams', enterpriseParams)
|
// console.log(1111)
|
}
|
this.initMenu()
|
},
|
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.enterpriseParams.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.enterpriseParams.step)) {
|
return (
|
this.enterpriseParams.step +
|
'?phaseno=' +
|
this.enterpriseParams.phaseno
|
)
|
} else {
|
return 'index'
|
}
|
},
|
...mapState({
|
enterpriseParams: state => state.risk.enterpriseParams
|
}),
|
// 历史审批意见,流程流转记录,无保存草稿按钮控制
|
noneSave() {
|
if (
|
this.$route.path.includes('approveHistory') ||
|
this.$route.path.includes('flowRecord') ||
|
this.$route.path.includes('projectCompany')
|
) {
|
return false
|
} else {
|
return true
|
}
|
},
|
// 申请阶段历史审批意见和流程流转记录按钮显示 上/下一页
|
applyStageTwoPage() {
|
if (
|
this.$route.path.includes('approveHistory') ||
|
this.$route.path.includes('flowRecord')
|
) {
|
return false
|
} else {
|
return true
|
}
|
}
|
},
|
methods: {
|
async initMenu(test) {
|
const { mainTain } = this.$route.query
|
if (mainTain) {
|
this.mainTain = false
|
// console.log(this.mainTain)
|
}
|
const { changeClickFlag } = this.enterpriseParams
|
let params = null
|
if (changeClickFlag === '1' || changeClickFlag === '2') {
|
params = {
|
serialno: this.enterpriseParams.tempSerialNo,
|
searchType: this.enterpriseParams.clickType,
|
changeClickFlag
|
}
|
} else {
|
params = {
|
serialno: this.enterpriseParams.tempSerialNo,
|
searchType: this.enterpriseParams.clickType
|
}
|
}
|
if (
|
!this._.isEmpty(this.enterpriseParams.step) &&
|
this.enterpriseParams.clickType === 1
|
) {
|
params.searchType = '2'
|
}
|
let res = await queryEnterpriseTabTree(params)
|
this.menus = res.result
|
this.menus.forEach(item => {
|
item.url = this._.find(this.urls, { tabname: item.tabname }).url
|
})
|
// console.log(this.enterpriseParams)
|
if (changeClickFlag !== '2') {
|
if (!this.enterpriseParams.phaseno) {
|
this.menus.map(item => {
|
if (item.tabname === '申请信息') {
|
item.open = 'Y'
|
}
|
if (item.tabname === '影像资料信息') {
|
item.open = 'Y'
|
}
|
})
|
}
|
}
|
this.currentTab = this.menus.filter(item => item.open === 'Y')
|
this.currentIndex = this.menus.findIndex(item => item.open === 'Y')
|
this.currentMenus = this.menus.filter(item => item.edit === 'Y')
|
this.enterpriseParams.clickType === 1
|
? (this.pageType = 'details')
|
: (this.pageType = 'update')
|
// console.log(this.pageType)
|
if (changeClickFlag === '1') {
|
this.pageType = 'details'
|
}
|
// 展示屏蔽
|
// this.$router.push({
|
// path: '/area/enterprise/' + this.pageType + '/' + this.currentTab[0].url
|
// })
|
},
|
handleGo(value, index) {
|
this.index = index
|
this.currentIndex = this.currentMenus.findIndex(
|
item => item.tabname === this.menus[index].tabname
|
)
|
// console.log(this.pageType)
|
this.$router.push({
|
path: '/area/enterprise/' + this.pageType + '/' + value
|
})
|
},
|
handlePrevPage() {
|
this.nextChange = true
|
this.currentIndex -= 1
|
let params = this.currentMenus[this.currentIndex].url
|
this.$router.push({
|
path: '/area/enterprise/' + this.pageType + '/' + params
|
})
|
},
|
handleNextPage() {
|
this.nextChange = true
|
this.currentIndex += 1
|
let params = this.currentMenus[this.currentIndex].url
|
this.$router.push({
|
path: '/area/enterprise/' + this.pageType + '/' + params
|
})
|
},
|
notNext() {
|
this.currentIndex -= 1
|
// if (this.currentIndex === 0) {
|
// this.prevPageBtn = false
|
// }
|
},
|
handleUpdateNext() {
|
this.nextChange = false
|
if (this.submitBtn) {
|
this.handleFlowSubmit()
|
return false
|
}
|
this.currentIndex += 1
|
this.$set(this.menus[this.currentIndex], 'edit', 'Y')
|
this.currentMenus = this.menus.filter(item => item.edit === 'Y')
|
let params = this.currentMenus[this.currentIndex].url
|
this.$router.push({
|
path: '/area/enterprise/' + this.pageType + '/' + params
|
})
|
},
|
// 保存 -- 校验
|
handleSave() {
|
this.$refs['childPage'].handleSave()
|
},
|
// 保存草稿 -- 不校验
|
handleSaveDraft() {
|
this.$refs['childPage'].handleSaveDraft()
|
},
|
handleSubmit() {
|
this.nextChange = false
|
this.$refs['childPage'].handleSubmit()
|
},
|
// 流程提交
|
handleFlowSubmit() {
|
let params = {
|
objectNo: this.enterpriseParams.tempSerialNo,
|
objectType: this.enterpriseParams.objectType
|
}
|
enpFlowSubmit(params).then(res => {
|
if (res.code === '00') {
|
this.commitDialogVisible = true
|
/* this.$message.success('提交成功!')
|
if (!this._.isEmpty(this.enterpriseParams.phaseno)) {
|
this.$router.push({ path: '/area/enterprise/check?phaseno=' + this.enterpriseParams.phaseno })
|
} else {
|
this.$router.push({ path: '/area/enterprise/index' })
|
} */
|
}
|
})
|
},
|
// 确定
|
enterMessages() {
|
this.commitDialogVisible = false
|
if (!this.commitDialogVisible) {
|
if (!this._.isEmpty(this.enterpriseParams.phaseno)) {
|
this.$router.push({
|
path:
|
'/area/enterprise/check?phaseno=' + this.enterpriseParams.phaseno
|
})
|
} else {
|
this.$router.push({ path: '/area/enterprise/index' })
|
}
|
}
|
},
|
// 返回列表
|
returnList() {
|
// if(this.enterpriseParams.clickType == 0){
|
// this.$confirm(`当前有数据未保存,是否继续`, '保存信息确认', {
|
// confirmButtonText: '确定',
|
// cancelButtonText: '取消',
|
// customClass: 'enp_messages_box',
|
// confirmButtonClass: 'enp_messages_box_confirm',
|
// cancelButtonClass: 'enp_messages_box_cancel',
|
// center: true
|
// })
|
// .then(() => {
|
// this.$router.push(`/area/enterprise/${this.step}`)
|
// })
|
// .catch(() => {})
|
// }else{
|
const { taskAdjustment } = this.enterpriseParams
|
if (taskAdjustment) {
|
this.$router.push(`/comprehensiveTransaction/adjustEnterpriseTask`)
|
} else {
|
this.nextChange = true
|
this.$router.push(`/area/enterprise/${this.step}`)
|
}
|
// }
|
},
|
// 重新刷新左侧页签
|
// changeTree() {
|
// this.initMenu()
|
// },
|
retrunLastPage() {
|
this.enterpriseParams.changeClickFlag = '2'
|
let test = true
|
this.initMenu(test)
|
}
|
}
|
}
|
</script>
|
|
<style lang="stylus" scoped>
|
.el-aside {
|
height: 100%;
|
}
|
|
.el-menu {
|
border-right: none;
|
}
|
|
#enterprise.el-footer {
|
position: fixed;
|
z-index: 1000;
|
width: 100%;
|
bottom: 0;
|
background-color: white;
|
height: 100px;
|
padding-top: 20px;
|
}
|
|
.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: -2px;
|
|
.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>
|