项目详情添加全局替换

This commit is contained in:
范强强
2023-07-14 15:11:10 +08:00
parent ebc1db0360
commit 7ed4fabd8d
3 changed files with 209 additions and 24 deletions
+4
View File
@@ -1905,4 +1905,8 @@ module.exports = {
knowledgeSharingHaveBeenStored:'Knowledge Sharing have been stored',
regulationMonthlyReportHaveBeenStored:'Regulation Monthly Report have been stored',
sendBackOne:'Return',
globalReplacement:'Global Replacement',
replacedPerson:'Replaced person',
replacementPerson:'Replacement Person',
thereReplaceableData:'There is currently no replaceable data',
}
+4
View File
@@ -3862,4 +3862,8 @@ module.exports = {
Notitleincluded:'不包含标题',
backToHomePage:'返回主页',
sendBackOne:'退回',
globalReplacement:'全局替换',
replacedPerson:'被替换人',
replacementPerson:'替换人',
thereReplaceableData:'当前没有可替换的数据',
}
@@ -11,6 +11,12 @@
</span>
</div>
<div class="Virtual-detail-text-right">
<div class="operator-text"
v-has="'projectComment:list'"
@click="globalReplacementClick">
<a-icon type="qrcode"/>
{{$t('globalReplacement')}}
</div>
<!-- <div class="operator-text"-->
<!-- v-if="textTitle === $t('listOfRegulations')"-->
<!-- v-has="'projectComment:list'"-->
@@ -45,7 +51,7 @@
<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}"
:class="{'operator-text-title-color' :item.roleName == roleSwitchName ? true : false}"
:title="item.roleName">
{{ item.roleName }}
</div>
@@ -103,13 +109,13 @@
<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>-->
<!-- <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">
@@ -143,12 +149,12 @@
@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>-->
<!-- <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"
@@ -159,12 +165,12 @@
@getRoleSwitch="getRoleSwitch"
@getRoleSwitchingList="getRoleSwitchingList"
:areaOfResponsibilityList="areaOfResponsibilityList"/>
<!-- <TaskList :isDisplayNum="isDisplayNum" :areaOfResponsibility="areaOfResponsibility"-->
<!-- v-else-if="textTitle === $t('taskList')"/>-->
<!-- <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')"/>-->
<!-- <projectStatus @TaskListChange="TaskListChange"-->
<!-- v-else-if="textTitle === $t('projectStatus')"/>-->
<certificationList ref="certificationListRef"
:isDisplayNum="isDisplayNum"
:areaOfResponsibility="areaOfResponsibility"
@@ -178,11 +184,51 @@
<historicalVersionList ref="historicalVersionListRef"/>
<commentList ref="commentListRef"/>
<JLoading :loading="loading"></JLoading>
<SelectedBy ref="SelectedByRef"
:isSingleChoice="true"
:title="$t('PersonnelSelection')"
@SelectedByForm="SelectedByForm"/>
<a-drawer
:title="$t('globalReplacement')"
:maskClosable="false"
:width="900"
placement="right"
:closable="true"
@close="handleCancel"
:visible="selectVisible"
style="height: 100%;overflow: auto;padding-bottom: 53px;">
<a-spin :spinning="submitLoading">
<a-table
ref="table"
:loading="selectLoading"
:pagination="false"
:scroll="{x: '100%',y:'calc(100vh - 300px)'}"
rowKey="id"
:data-source="dataSource"
:columns="columns"
>
<span slot="replacementPerson"
slot-scope="text,record,index"
:title="text">
<PersonnelSelection :query="{db_field_name:'newUserId',db_field_txt:$t('personLiable'),subscript:index}"
:isSingleChoice="true"
:personneQuery="record"
@change="PersonnelSelectionChange"
v-model="record.newUserIdName"/>
</span>
</a-table>
</a-spin>
<div class="drawer-bootom-button">
<a-button @click="handleCancel" style="margin-right: 16px">{{$t('cancel')}}</a-button>
<a-button @click="handleSubmit" type="primary" :loading="submitLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
</div>
</template>
<script>
import TaskList from '../components/TaskList'
import SelectedBy from '@/components/SelectedBy/index'
import listOfRegulations from '../components/listOfRegulations'
import ProjectDetailsName from '../components/ProjectDetails'
import TaskParameterCollection from '../components/TaskParameterCollection'
@@ -193,6 +239,7 @@
import commentList from '../components/commentList'
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import certificationList from '../components/certificationList/index'
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { mapGetters } from 'vuex'
export default {
@@ -207,15 +254,21 @@
historicalVersionList,
commentList,
projectStatus,
certificationList
certificationList,
SelectedBy,
PersonnelSelection
},
data() {
return {
title: '',
selectVisible: false,
confirmLoading: false,
submitLoading: false,
isDisplayNum: '',
textTitle: '',
isTrue: true,
loading: false,
selectLoading: false,
JTextLoading: false,
isDisplay: true,
areaOfResponsibilityList: {},
@@ -256,7 +309,43 @@
engineeringInterfacePerson: '',
roleSwitchName: '',
roleSwitchingList: [],
visible: false
visible: false,
userIds: '',
userName: '',
dataSource: [],
columns: [
{
title: this.$t('replacedPerson'),
align: 'left',
dataIndex: 'userName',
width: 180,
customRender: (value, row, index) => {
const obj = {
children: value,
attrs: {}
}
if (index === 0) {
obj.attrs.rowSpan = row.maxLength
} else {
obj.attrs.rowSpan = 0
}
return obj
}
},
{
title: this.$t('areaOfResponsibility'),
align: 'left',
dataIndex: 'title',
width: 180
},
{
title: this.$t('replacementPerson'),
align: 'left',
dataIndex: 'replacementPerson',
width: 180,
scopedSlots: { customRender: 'replacementPerson' }
}
]
}
},
created() {
@@ -270,7 +359,7 @@
this.textColor(this.$t('projectDetails'))
this.textTitle = this.$t('projectDetails')
} else if (this.$route.query.type == '102') {
if (this.$route.query.dutyTerritoryName){
if (this.$route.query.dutyTerritoryName) {
this.areaOfResponsibilityList = this.$route.query
}
this.textColor(this.$t('listOfRegulations'))
@@ -279,7 +368,7 @@
// this.textColor(this.$t('taskList'))
// this.textTitle = this.$t('taskList')
this.$router.push({
path:'/projectRegulationTasks',
path: '/projectRegulationTasks'
})
} else if (this.$route.query.type == '104') {
// this.textColor(this.$t('nonConformance'))
@@ -288,7 +377,7 @@
this.textColor(this.$t('TaskParameterCollection'))
this.textTitle = this.$t('TaskParameterCollection')
} else if (this.$route.query.type == '106') {
if (this.$route.query.dutyTerritoryName){
if (this.$route.query.dutyTerritoryName) {
this.areaOfResponsibility = this.$route.query
}
this.textColor(this.$t('certificationList'))
@@ -307,10 +396,81 @@
}
},
methods: {
...mapGetters(['userInfo']),
textIconClick() {
this.isDisplay = !this.isDisplay
},
...mapGetters(['userInfo']),
globalReplacementClick() {
this.$refs.SelectedByRef.getPush()
},
SelectedByForm(userIds, userName) {
this.userIds = userIds
this.userName = userName
this.selectVisible = true
this.$refs.SelectedByRef.visible = false
this.$refs.SelectedByRef.submitLoading = false
this.getUserAllDutyTerritoryList()
},
getUserAllDutyTerritoryList() {
let query = {
projectLibraryId: this.$route.query.id,
userName: this.userName,
userId: this.userIds
}
this.selectLoading = true
getAction('/project/projectLibraryBase/getUserAllDutyTerritoryList', query).then((res) => {
if (res.success) {
this.dataSource = res.result || []
this.dataSource.forEach(val => {
val.newUserId = ''
val.userName = this.userName
val.maxLength = this.dataSource.length
})
this.selectLoading = false
} else {
this.dataSource = []
this.selectLoading = false
}
})
},
handleCancel() {
this.selectVisible = false
},
handleSubmit() {
if (this.dataSource.length > 0) {
let replacementUserList = []
this.dataSource.forEach(res => {
replacementUserList.push({
dutyTerritory: res.value,
newUserId: res.newUserId || '',
newUserName: res.newUserIdName || ''
})
})
let query = {
userId: this.userIds,
projectLibraryId: this.$route.query.id,
replacementUserList: replacementUserList
}
this.submitLoading = true
getAction('/project/projectLibraryBase/overallReplacementUser', query).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.submitLoading = false
this.selectVisible = false
let textTitle = this.textTitle
this.textTitle = ''
this.$nextTick(() => {
this.textTitle = textTitle
})
} else {
this.$message.warning(this.$t('operationFailed'))
this.submitLoading = false
}
})
} else {
this.$message.warning(this.$t('thereReplaceableData'))
}
},
textColor(name) {
let textColor = document.getElementsByClassName('Virtual-detail-left-text-color')
if (textColor && textColor.length > 0) {
@@ -466,6 +626,10 @@
}
this.JTextLoading = false
this.visible = false
},
PersonnelSelectionChange(value, id, index) {
this.dataSource[index][value] = id
this.dataSource = [...this.dataSource]
}
}
}
@@ -597,6 +761,19 @@
.operator-text-title-color {
color: #00B3BE;
}
.drawer-bootom-button {
position: absolute;
bottom: 0;
z-index: 100;
width: 100%;
border-top: 1px solid #e8e8e8;
padding: 10px 16px;
text-align: right;
left: 0;
background: #fff;
border-radius: 0 0 2px 2px;
}
</style>
<style>
.popconfirmDetails {