+
@@ -235,6 +235,7 @@
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'inventoryAffirmDueDate'})"
format="YYYY-MM-DD"
+ :disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.inventoryAffirmDueDate"
style="width: 100%"/>
@@ -244,6 +245,7 @@
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'taskAffirmDueDate'})"
format="YYYY-MM-DD"
+ :disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.taskAffirmDueDate"
style="width: 100%"/>
@@ -336,14 +338,9 @@
-
-
- {{$t('StudioEngineer')}}
-
-
-
-
- {{$t('regulatoryEngineerOrcertifiedEngineer')}}
+
+
+ {{item.roleName}}
@@ -386,7 +383,8 @@
},
data() {
return {
- columns: [
+ roleSwitchingList: [],
+ columnsAll: [
{
title: this.$t('standard'),
align: 'center',
@@ -683,6 +681,7 @@
],
visibleFile: false,
JLoading: false,
+ isRoleSwitching: true,
formInlineComment: {},
rulesComment: {
commentContent: [
@@ -801,19 +800,19 @@
{
type: 'Personnel',
value: 'regulationOwnerId',
- valueName:'regulationOwnerIdName',
+ valueName: 'regulationOwnerIdName',
text: this.$t('regulatoryEngineer')
},
{
type: 'Personnel',
value: 'homologationEngineerId',
- valueName:'homologationEngineerIdName',
+ valueName: 'homologationEngineerIdName',
text: this.$t('certifiedEngineer')
},
{
type: 'Personnel',
value: 'engineeringInterfacePerson',
- valueName:'engineeringInterfacePersonName',
+ valueName: 'engineeringInterfacePersonName',
text: this.$t('engineeringInterfacePerson')
}
],
@@ -837,6 +836,7 @@
if (this.$route.query.studioEngineer == this.userInfo().id) {
this.JLoading = true
this.getAndUserId()
+ this.getRoleByUserId()
} else {
this.isDisplay = false
}
@@ -861,6 +861,18 @@
}
}
return columnResult
+ },
+ columns() {
+ let columnResult = JSON.parse(JSON.stringify(this.columnsAll))
+ if (!this.isRoleSwitching) {
+ for (var i = 0; i < columnResult.length; i++) {
+ if (columnResult[i].title === this.$t('operation')) {
+ columnResult.splice(i, 1)
+ i--
+ }
+ }
+ }
+ return columnResult
}
},
methods: {
@@ -868,6 +880,18 @@
handleModule() {
downloadFile(this.url.exportTemplate, this.$t('listOfRegulations') + this.$t('importTemplate') + '.xls', {})
},
+ disabledDate(current) {
+ return current && current < moment().subtract(1, 'day')
+ },
+ getRoleByUserId() {
+ getAction('/sys/role/getRoleByUserId', {}).then((res) => {
+ if (res.success) {
+ this.roleSwitchingList = res.result || []
+ } else {
+ this.roleSwitchingList = []
+ }
+ })
+ },
getAndUserId() {
let query = {
projectLibraryId: this.$route.query.id,
@@ -878,10 +902,14 @@
this.isDisplay = true
this.formInlineRoleSwitching.roleSwitchingCode = res.result.roleCode
this.AndUserId = res.result.id
+ this.isRoleSwitching = true
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
+ if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
+ this.isRoleSwitching = false
+ }
}
this.JLoading = false
} else {
@@ -1020,10 +1048,14 @@
this.confirmLoadingRoleSwitching = true
postAction(this.url.AndUserIdEdit, query).then((res) => {
if (res.success) {
+ this.isRoleSwitching = true
if (this.formInlineRoleSwitching.roleSwitchingCode == '0') {
this.isDisplay = true
} else {
this.isDisplay = false
+ if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
+ this.isRoleSwitching = false
+ }
}
this.$message.success(this.$t('OperationSuccessful'))
this.visibleRoleSwitching = false
@@ -1044,10 +1076,11 @@
this.visibleRoleSwitching = true
this.$nextTick(() => {
this.$refs.ruleFormRoleSwitching.clearValidate()
- if (this.isDisplay) {
+ if (!this.formInlineRoleSwitching.roleSwitchingCode) {
this.formInlineRoleSwitching.roleSwitchingCode = '0'
- } else {
- this.formInlineRoleSwitching.roleSwitchingCode = '4'
+ }
+ if (!(this.roleSwitchingList.some(val => val.roleCode == this.formInlineRoleSwitching.roleSwitchingCode))) {
+ this.formInlineRoleSwitching.roleSwitchingCode = this.roleSwitchingList[0].roleCode
}
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
})
@@ -1148,6 +1181,9 @@
} else {
roleCode = 4
}
+ if (this.formInlineRoleSwitching.roleSwitchingCode == '11' || this.formInlineRoleSwitching.roleSwitchingCode == '12') {
+ roleCode = 0
+ }
let query = {
...this.queryParamQuery,
...this.queryParam,
@@ -1155,6 +1191,7 @@
roleCode: roleCode
}
this.loading = true
+ this.getRoleByUserId()
getAction(this.url.list, query).then((res) => {
if (res.success) {
this.dataSource = res.result