Files
laws_weilai/jero-web/src/views/projectManagement/ProjectDetails/index.vue
T

608 lines
22 KiB
Java

<template>
<div class="doc-detail">
<div class="Virtual-detail-header" style="position: fixed;top: 0">
<div class="Virtual-detail-title">
<span style="line-height: 64px;display: inline-block;float: left">
<a-icon @click="backClick" type="left-circle" theme="filled"
style="margin-right: 8px;font-size: 30px;color: #21c9cc;"/>
</span>
<span>
{{this.title}}
</span>
</div>
<div class="Virtual-detail-text-right">
<!-- <div class="operator-text"-->
<!-- v-if="textTitle === $t('listOfRegulations')"-->
<!-- v-has="'projectComment:list'"-->
<!-- @click="commentClick">-->
<!-- <a-icon type="message"/>-->
<!-- {{$t('comment')}}-->
<!-- </div>-->
<div class="operator-text"
v-if="textTitle === $t('listOfRegulations')"
v-has="'projectComment:list'"
@click="todocenterClick">
<a-icon type="qrcode"/>
{{$t('todocenter')}}
</div>
<div class="operator-text" v-has="'projectLawsInventoryLog:page'"
v-if="textTitle === $t('listOfRegulations')"
@click="UpdateLogClick">
<a-icon type="reload"/>
{{$t('UpdateLog')}}
</div>
<div class="operator-text" v-has="'projectHistoryVersions:list'"
v-if="textTitle === $t('listOfRegulations')"
@click="historicalVersionClick">
<a-icon type="clock-circle"/>
{{$t('historicalVersion')}}
</div>
<a-popconfirm overlayClassName="popconfirmDetails"
:visible="visible"
@visibleChange="handleVisibleChange"
placement="bottomRight">
<template slot="title" id="popconfirmDetails">
<div @click="roleSwitchingClick(item.roleCode)"
v-for="(item,index) in roleSwitchingList"
class="operator-text-title"
:class="{'operator-text-title-color':item.roleName == roleSwitchName ? true : false}"
:title="item.roleName">
{{ item.roleName }}
</div>
<JLoading :loading="JTextLoading"></JLoading>
</template>
<div class="operator-text" style="position: relative"
v-if="(textTitle === $t('certificationList') || textTitle === $t('listOfRegulations')) && roleSwitchName">
<a-icon type="select"/>
{{roleSwitchName}}
</div>
</a-popconfirm>
<!-- <div class="operator-text"-->
<!-- v-if="(textTitle === $t('certificationList') || textTitle === $t('listOfRegulations')) && roleSwitchName"-->
<!-- @click="roleSwitchingClick">-->
<!-- <a-icon type="select"/>-->
<!-- {{roleSwitchName}}-->
<!-- </div>-->
</div>
</div>
<div style="padding: 52px 0 0 0;background: #ffffff;height:100%">
<div class="detail-content" style="height: 100%">
<div v-if="isDisplay" class="Virtual-detail-left">
<div class="Virtual-detail-left-text" :title="$t('projectDetails')"
v-has="'projectLawsInventory:projectDetails'"
v-if="isTrue"
@click="textClick(0,$t('projectDetails'))">
<a-icon type="container"/>
{{$t('projectDetails')}}
</div>
<div class="Virtual-detail-left-text" v-has="'projectLawsInventory:list'" :title="$t('listOfRegulations')"
@click="textClick(1,$t('listOfRegulations'))">
<a-icon type="control"/>
{{$t('listOfRegulations')}}
</div>
<div class="Virtual-detail-left-text" :title="$t('certificationList')"
v-has="'projectLawsInventory:CertificationList'"
@click="textClick(6,$t('certificationList'))">
<a-icon type="safety"/>
{{$t('certificationList')}}
</div>
<!-- <div class="Virtual-detail-left-text" :title="$t('taskList')"-->
<!-- v-has="'projectLawsInventory:taskList'"-->
<!-- @click="textClick(2,$t('taskList'))">-->
<!-- <a-icon type="safety"/>-->
<!-- {{$t('taskList')}}-->
<!-- </div>-->
<!-- <div class="Virtual-detail-left-text" v-has="'ncrTrack:queryPageInfo'" :title="$t('nonConformance')"-->
<!-- @click="textClick(3,$t('nonConformance'))">-->
<!-- <a-icon type="safety-certificate"/>-->
<!-- {{$t('nonConformance')}}-->
<!-- </div>-->
<div class="Virtual-detail-left-text" v-has="'params:manifest:page'"
:title="$t('TaskParameterCollection')"
@click="textClick(4,$t('TaskParameterCollection'))">
<a-icon type="profile"/>
{{$t('TaskParameterCollection')}}
</div>
<!-- <div class="Virtual-detail-left-text"-->
<!-- :title="$t('projectStatus')"-->
<!-- v-has="'projectLawsInventory:ProjectStatus'"-->
<!-- @click="textClick(5,$t('projectStatus'))">-->
<!-- <a-icon type="cluster"/>-->
<!-- {{$t('projectStatus')}}-->
<!-- </div>-->
<a-icon @click="textIconClick" type="menu-fold" class="text-icon"/>
</div>
<div v-if="!isDisplay" class="Virtual-detail-left-One">
<div class="Virtual-detail-left-text"
:title="$t('projectDetails')"
v-has="'projectLawsInventory:projectDetails'"
v-if="isTrue"
@click="textClick(0,$t('projectDetails'))">
<a-icon type="container"/>
</div>
<div class="Virtual-detail-left-text" v-has="'projectLawsInventory:list'" :title="$t('listOfRegulations')"
@click="textClick(1,$t('listOfRegulations'))">
<a-icon type="control"/>
</div>
<div class="Virtual-detail-left-text" :title="$t('certificationList')"
v-has="'projectLawsInventory:CertificationList'"
@click="textClick(6,$t('certificationList'))">
<a-icon type="safety"/>
</div>
<!-- <div class="Virtual-detail-left-text" :title="$t('taskList')"-->
<!-- v-has="'projectLawsInventory:taskList'"-->
<!-- @click="textClick(2,$t('taskList'))">-->
<!-- <a-icon type="safety"/>-->
<!-- </div>-->
<!-- <div class="Virtual-detail-left-text" v-has="'ncrTrack:queryPageInfo'" :title="$t('nonConformance')"-->
<!-- @click="textClick(3,$t('nonConformance'))">-->
<!-- <a-icon type="safety-certificate"/>-->
<!-- </div>-->
<div class="Virtual-detail-left-text" v-has="'params:manifest:page'"
:title="$t('TaskParameterCollection')"
@click="textClick(4,$t('TaskParameterCollection'))">
<a-icon type="profile"/>
</div>
<!-- <div class="Virtual-detail-left-text"-->
<!-- :title="$t('projectStatus')"-->
<!-- v-has="'projectLawsInventory:ProjectStatus'"-->
<!-- @click="textClick(5,$t('projectStatus'))">-->
<!-- <a-icon type="cluster"/>-->
<!-- </div>-->
<a-icon @click="textIconClick" type="menu-unfold" class="text-icon-one"/>
</div>
<div class="Virtual-detail-right"
:style="{'width':isDisplay?'calc(100% - 240px)':'calc(100% - 66px)'}">
<ProjectDetailsName @TaskListChange="TaskListChange" v-if="textTitle === $t('projectDetails')"/>
<listOfRegulations v-else-if="textTitle === $t('listOfRegulations')"
ref="listOfRegulationsRef"
@getRoleSwitch="getRoleSwitch"
@getRoleSwitchingList="getRoleSwitchingList"
:areaOfResponsibilityList="areaOfResponsibilityList"/>
<!-- <TaskList :isDisplayNum="isDisplayNum" :areaOfResponsibility="areaOfResponsibility"-->
<!-- v-else-if="textTitle === $t('taskList')"/>-->
<TaskParameterCollection v-else-if="textTitle === $t('TaskParameterCollection')"/>
<nonConformance v-else-if="textTitle === $t('nonConformance')"/>
<!-- <projectStatus @TaskListChange="TaskListChange"-->
<!-- v-else-if="textTitle === $t('projectStatus')"/>-->
<certificationList ref="certificationListRef"
:isDisplayNum="isDisplayNum"
:areaOfResponsibility="areaOfResponsibility"
@getRoleSwitch="getRoleSwitch"
@getRoleSwitchingList="getRoleSwitchingList"
v-else-if="textTitle === $t('certificationList')"/>
</div>
</div>
</div>
<updateLog :url="url" ref="updateLogRef"/>
<historicalVersionList ref="historicalVersionListRef"/>
<commentList ref="commentListRef"/>
<JLoading :loading="loading"></JLoading>
</div>
</template>
<script>
import TaskList from '../components/TaskList'
import listOfRegulations from '../components/listOfRegulations'
import ProjectDetailsName from '../components/ProjectDetails'
import TaskParameterCollection from '../components/TaskParameterCollection'
import nonConformance from '../components/nonConformance'
import projectStatus from '../components/projectStatus'
import updateLog from '@/components/UpdateLog/index'
import historicalVersionList from '../components/historicalVersionList'
import commentList from '../components/commentList'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import certificationList from '../components/certificationList/index'
import { mapGetters } from 'vuex'
export default {
name: 'ProjectDetails',
components: {
TaskList,
listOfRegulations,
ProjectDetailsName,
TaskParameterCollection,
nonConformance,
updateLog,
historicalVersionList,
commentList,
projectStatus,
certificationList
},
data() {
return {
title: '',
isDisplayNum: '',
textTitle: '',
isTrue: true,
loading: false,
JTextLoading: false,
isDisplay: true,
areaOfResponsibilityList: {},
url: {
logList: '/project/projectLawsInventoryLogEO/page',
historicalVersionUrl: '',
queryUserPremissionByProjectLibraryId: '/project/projectCertificationDirectoryEO/queryUserPremissionByProjectLibraryId'
},
roleSwitchListCn: {
'0': 'studio工程师',
'1': '法规工程师',
'2': '认证工程师',
'4': '法规工程师/认证工程师',
'11': 'R&H Manager',
'12': '系统管理员',
'13': 'Viewer',
'14': '品牌管理员',
'20': '工程接口人',
'21': '责任人',
'30': '工程接口人',
'31': '责任人'
},
roleSwitchListEn: {
'0': 'R&H Studio',
'1': 'studio',
'2': 'homo',
'4': 'Regulatory Engineer/Certification Engineer',
'11': 'R&H Manager',
'12': 'admin',
'13': 'Viewer',
'14': 'BrandAdministrator',
'20': 'Interface person',
'21': 'Person liable',
'30': 'Engineering interface person',
'31': 'Person liable'
},
areaOfResponsibility: {},
engineeringInterfacePerson: '',
roleSwitchName: '',
roleSwitchingList: [],
visible: false
}
},
created() {
document.title = this.$route.query.projectName ? this.$t('projectDetails') + '-' + this.$route.query.projectName : this.$t('projectDetails')
this.title = this.$route.query.projectName
},
mounted() {
this.getTaskId()
if (this.$route.query.type) {
if (this.$route.query.type == '101') {
this.textColor(this.$t('projectDetails'))
this.textTitle = this.$t('projectDetails')
} else if (this.$route.query.type == '102') {
this.textColor(this.$t('listOfRegulations'))
this.textTitle = this.$t('listOfRegulations')
} else if (this.$route.query.type == '103') {
// this.textColor(this.$t('taskList'))
// this.textTitle = this.$t('taskList')
this.$router.push({
path:'/projectRegulationTasks',
})
} else if (this.$route.query.type == '104') {
// this.textColor(this.$t('nonConformance'))
// this.textTitle = this.$t('nonConformance')
} else if (this.$route.query.type == '105') {
this.textColor(this.$t('TaskParameterCollection'))
this.textTitle = this.$t('TaskParameterCollection')
} else if (this.$route.query.type == '106') {
this.textColor(this.$t('certificationList'))
this.textTitle = this.$t('certificationList')
}
} else {
if (this.userInfo().userRoleList && this.userInfo().userRoleList.length > 0) {
if (this.userInfo().userRoleList.length == 1 && this.userInfo().userRoleList[0].roleCode == 'sdt') {
this.getList()
} else {
this.textColor(0)
}
} else {
this.textColor(0)
}
}
},
methods: {
textIconClick() {
this.isDisplay = !this.isDisplay
},
...mapGetters(['userInfo']),
textColor(name) {
let textColor = document.getElementsByClassName('Virtual-detail-left-text-color')
if (textColor && textColor.length > 0) {
textColor[0].classList.remove('Virtual-detail-left-text-color')
}
let text = document.getElementsByClassName('Virtual-detail-left-text')
if (name == 0) {
text[name].classList.add('Virtual-detail-left-text-color')
this.textTitle = text[name].title
} else {
if (text && text.length > 0) {
for (let i = 0; i < text.length; i++) {
if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
}
}
}
}
},
textClick(num, name) {
this.areaOfResponsibilityList = {}
this.areaOfResponsibility = {}
this.textTitle = name
let textColor = document.getElementsByClassName('Virtual-detail-left-text-color')
if (textColor && textColor.length > 0) {
textColor[0].classList.remove('Virtual-detail-left-text-color')
}
let text = document.getElementsByClassName('Virtual-detail-left-text')
for (let i = 0; i < text.length; i++) {
if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
} else if (text[i].title == name) {
text[i].classList.add('Virtual-detail-left-text-color')
}
}
},
//待办中心跳转
todocenterClick() {
this.$router.push({
path: '/projectRegulationTasks',
query: {
projectName: this.$route.query.projectName
}
})
},
UpdateLogClick() {
this.$refs.updateLogRef.getList({ projectLibraryId: this.$route.query.id })
},
historicalVersionClick() {
this.$refs.historicalVersionListRef.getList()
},
commentClick() {
this.$refs.commentListRef.getData()
},
getTaskId() {
let query = {
projectLibraryId: this.$route.query.id
}
getAction(this.url.queryUserPremissionByProjectLibraryId, query).then((res) => {
if (res.success) {
this.isDisplayNum = res.result
}
})
},
getList() {
let query = {
projectId: this.$route.query.id
}
this.loading = true
postAction('/project/projectRelatedPersonnel/page', query).then((res) => {
if (res.success) {
let dataSource = res.result || []
dataSource.forEach(res => {
if (res.engineeringInterfacePerson || res.certificationEngineer || res.lawEngineer) {
this.engineeringInterfacePerson += res.engineeringInterfacePerson + ',' + res.certificationEngineer + ',' + res.lawEngineer + ','
}
})
if (this.engineeringInterfacePerson.includes(this.userInfo().id) ||
this.$route.query.studioEngineer == this.userInfo().id) {
this.isTrue = true
} else {
this.isTrue = false
}
this.$nextTick(() => {
this.textColor(0)
})
this.loading = false
} else {
this.textColor(0)
this.loading = false
}
})
},
TaskListChange(item) {
if (item.isListing && item.isListing == '1') {
this.areaOfResponsibilityList = item
this.textTitle = this.$t('listOfRegulations')
} else {
this.areaOfResponsibility = item
this.textTitle = this.$t('certificationList')
}
let textColor = document.getElementsByClassName('Virtual-detail-left-text-color')
if (textColor && textColor.length > 0) {
textColor[0].classList.remove('Virtual-detail-left-text-color')
}
let text = document.getElementsByClassName('Virtual-detail-left-text')
for (let i = 0; i < text.length; i++) {
if (text[i].title == this.textTitle) {
text[i].classList.add('Virtual-detail-left-text-color')
}
}
},
backClick() {
this.$router.push({
path: '/projectLibrary'
})
},
roleSwitchingClick(roleCode) {
this.JTextLoading = true
if (this.textTitle === this.$t('listOfRegulations')) {
this.$refs.listOfRegulationsRef.handleOkRoleSwitching(roleCode)
} else {
this.$refs.certificationListRef.handleOkRoleSwitching(roleCode)
}
},
getRoleSwitchingList(list) {
this.roleSwitchingList = list || []
this.roleSwitchingList = [...this.roleSwitchingList]
},
handleVisibleChange(visible) {
this.visible = visible
},
getRoleSwitch(value) {
let long = localStorage.getItem('language') || 'zh-cn'
if (long == 'zh-cn') {
this.roleSwitchName = this.roleSwitchListCn[value]
} else {
this.roleSwitchName = this.roleSwitchListEn[value]
}
this.JTextLoading = false
this.visible = false
}
}
}
</script>
<style lang="less" scoped>
@import '~@assets/less/common.less';
.doc-detail {
background: #fff;
height: 100%;
position: relative;
.Virtual-detail-header {
width: 100%;
height: 56px;
line-height: 56px;
padding: 0 32px 0 32px;
box-sizing: border-box;
display: flex;
justify-content: space-between;
border-bottom: 2px #eff1f3 solid;
background: #fff;
.Virtual-detail-title {
display: inline-block;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-size: 20px;
font-weight: 400;
color: #040B29;
line-height: 55px;
}
.doc-detail-right {
width: 800px;
line-height: 68px;
display: flex;
}
}
.Virtual-detail-left {
width: 240px;
flex: 0 0 240px;
padding: 16px 24px;
box-sizing: border-box;
font-size: 16px;
line-height: 3;
float: left;
transition: all 0.2s;
.Virtual-detail-left-text {
padding: 2px 12px;
cursor: pointer;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
.Virtual-detail-left-One {
width: 66px;
flex: 0 0 66px;
display: inline-block;
padding: 16px 16px;
box-sizing: border-box;
font-size: 18px;
right: 0;
transition: all 0.2s;
.Virtual-detail-left-text {
padding: 2px 8px;
cursor: pointer;
margin-bottom: 18px;
color: rgb(0, 0, 0);
}
}
.Virtual-detail-right {
border-left: 2px #eff1f3 solid;
height: 100%;
float: right;
overflow: auto;
transition: all 0.2s;
}
}
.Virtual-detail-left-text-color {
background: #eff1f3;
border-radius: 4px;
}
.Virtual-detail-text-right {
}
.text-icon {
color: rgb(0, 0, 0);
font-size: 22px;
position: absolute;
left: 200px;
bottom: 20px;
transition: all 0.2s;
}
.text-icon-one {
color: rgb(0, 0, 0);
font-size: 22px;
position: absolute;
left: 22px;
bottom: 20px;
transition: all 0.2s;
}
.operator-text-title {
cursor: pointer;
margin-right: 22px;
font-size: 14px;
font-weight: 400;
color: #040B29;
margin-bottom: 22px;
}
.operator-text-title:last-child {
margin-bottom: 0;
}
.operator-text-title-color {
color: #00B3BE;
}
</style>
<style>
.popconfirmDetails {
z-index: 999;
top: 42px !important;
}
.popconfirmDetails .ant-popover-buttons {
display: none !important;
}
.popconfirmDetails .anticon-exclamation-circle {
display: none !important;
}
</style>