Browse Source

QMS修改

master
shenzhouyu 2 weeks ago
parent
commit
7453d52bbc
  1. 2
      src/api/qc/qc.js
  2. 183
      src/views/modules/qc/FAIResultEntry.vue
  3. 183
      src/views/modules/qc/FQCResultEntry.vue
  4. 159
      src/views/modules/qc/IPQCResultEntry.vue
  5. 163
      src/views/modules/qc/IQCResultEntry.vue
  6. 154
      src/views/modules/qc/PQCResultEntry.vue

2
src/api/qc/qc.js

@ -209,6 +209,8 @@ export const actionFQCInspection = data => createAPI(`/pms/qc/actionFQCInspectio
export const dataAcquisition = data => createAPI(`/pms/qc/dataAcquisition`,'post',data) export const dataAcquisition = data => createAPI(`/pms/qc/dataAcquisition`,'post',data)
export const getEquipmentNoList = data => createAPI(`/pms/qc/getEquipmentNoList`,'post',data) export const getEquipmentNoList = data => createAPI(`/pms/qc/getEquipmentNoList`,'post',data)
export const getResponsibleOperatorList = data => createAPI(`/pms/qc/getResponsibleOperatorList`,'post',data) export const getResponsibleOperatorList = data => createAPI(`/pms/qc/getResponsibleOperatorList`,'post',data)
export const getMhmResponsibleRoleList = data => createAPI(`/pms/qc/getMhmResponsibleRoleList`,'post',data)
export const getMhmRoleByName = data => createAPI(`/pms/qc/getMhmRoleByName`,'post',data)
export const getDataContentList = data => createAPI(`/pms/qc/getDataContentList`,'post',data) export const getDataContentList = data => createAPI(`/pms/qc/getDataContentList`,'post',data)
export const getObjectList = data => createAPI(`/pms/qc/getObjectList`,'post',data) export const getObjectList = data => createAPI(`/pms/qc/getObjectList`,'post',data)
export const getObjectListBy = data => createAPI(`/pms/qc/getObjectListBy`,'post',data) export const getObjectListBy = data => createAPI(`/pms/qc/getObjectListBy`,'post',data)

183
src/views/modules/qc/FAIResultEntry.vue

@ -736,7 +736,7 @@
<el-form :inline="true" label-position="top" :model="operatorData"> <el-form :inline="true" label-position="top" :model="operatorData">
<el-form-item :label="'所属角色'"> <el-form-item :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2"> <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option v-for="i in roleList" :key="i.roleId" :label="i.roleName" :value="i.roleId">
<el-option v-for="i in operatorRoleList" :key="i.roleId" :label="i.roleName" :value="i.roleId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -858,6 +858,8 @@ import {
searchPartAttributeDetails, // searchPartAttributeDetails, //
getEamPropertiesItemByItemNo, getEamPropertiesItemByItemNo,
getCollectorDataByItem, getCollectorDataByItem,
getResponsibleOperatorList,
getMhmResponsibleRoleList,
} from '@/api/qc/qc.js' } from '@/api/qc/qc.js'
import { import {
getTableDefaultListLanguage, getTableDefaultListLanguage,
@ -900,6 +902,12 @@ export default {
} }
return this.tableData.slice(start, end) return this.tableData.slice(start, end)
}, },
operatorRoleList() {
if (this.operatorData.flag === '2' && this.detailData.buNo === '04-MHM') {
return this.mhmRoleList
}
return this.roleList
},
}, },
watch: { watch: {
detailData: { detailData: {
@ -2239,6 +2247,8 @@ export default {
authFile: false, authFile: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
roleList: [], roleList: [],
mhmRoleList: [],
defaultCollaborativeRoleName: 'FAI操作员',
operatorList: [], operatorList: [],
operatorData: { operatorData: {
flag: '', flag: '',
@ -2529,132 +2539,163 @@ export default {
getOperatorList() { getOperatorList() {
this.operatorData.flag = '1' this.operatorData.flag = '1'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator
).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
this.setDefaultCollaborativeRole(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
},
isMhmResponsibleBu() {
return this.detailData.buNo === '04-MHM'
},
setDefaultCollaborativeRole(callback) {
const apply = () => {
if (this.roleList.length > 0) { if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.find((item) => item.roleName === roleName)
const roleId = match ? match.roleId : this.roleList[0].roleId
this.$set(
this.operatorData,
'roleId',
roleId != null && roleId !== '' ? Number(roleId) : ''
) )
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else { } else {
this.operatorData.roleId = this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', '')
} }
callback && callback()
}
if (this.roleList.length > 0) {
apply()
} else { } else {
this.operatorData.roleId = ''
getUserRoleList().then(({ data }) => {
this.roleList = data && data.code === 0 ? data.rows || [] : []
apply()
})
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator
).split(';')
},
fetchCollaborativeOperatorData(tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => { getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach((val) => { this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true) this.$refs.operatorTable.toggleRowSelection(val, true)
) )
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList() {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
)
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
loadMhmRoleList(callback) {
if (this.mhmRoleList.length > 0) {
callback && callback()
return
} }
getMhmResponsibleRoleList({}).then(({ data }) => {
if (data && data.code === 0) {
this.mhmRoleList = data.rows || []
}
callback && callback()
})
},
fetchResponsibleOperatorData(tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
this.operatorData.roleName = ''
request = getResponsibleOperatorList(this.operatorData)
} else { } else {
this.operatorData.roleId = ''
request = getOperatorList(this.operatorData)
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (
this.detailData.responsiblePerson == null
? ''
: this.detailData.responsiblePerson
).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
request.then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach((val) => { this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true) this.$refs.operatorTable.toggleRowSelection(val, true)
) )
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList() {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (
this.detailData.responsiblePerson == null
? ''
: this.detailData.responsiblePerson
).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
const openDialog = () => {
this.fetchResponsibleOperatorData(tempDataList, true)
}
if (this.isMhmResponsibleBu()) {
this.loadMhmRoleList(() => {
this.operatorData.roleId = ''
openDialog()
})
} else {
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
)
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
}
} else {
this.operatorData.roleId = ''
}
openDialog()
}
},
// //
getOperatorList2() { getOperatorList2() {
if (this.operatorData.flag === '1') { if (this.operatorData.flag === '1') {
//
let tempDataList = ( let tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator this.detailData.operator == null ? '' : this.detailData.operator
).split(';') ).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true)
)
}
})
} else {
this.operatorList = []
}
})
this.fetchCollaborativeOperatorData(tempDataList, false)
} else { } else {
//
let tempDataList = ( let tempDataList = (
this.detailData.responsiblePerson == null this.detailData.responsiblePerson == null
? '' ? ''
: this.detailData.responsiblePerson : this.detailData.responsiblePerson
).split(';') ).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true)
)
}
})
} else {
this.operatorList = []
}
})
this.fetchResponsibleOperatorData(tempDataList, false)
} }
}, },

183
src/views/modules/qc/FQCResultEntry.vue

@ -718,7 +718,7 @@
<el-form :inline="true" label-position="top" :model="operatorData"> <el-form :inline="true" label-position="top" :model="operatorData">
<el-form-item :label="'所属角色'"> <el-form-item :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2"> <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option v-for="i in roleList" :key="i.roleId" :label="i.roleName" :value="i.roleId">
<el-option v-for="i in operatorRoleList" :key="i.roleId" :label="i.roleName" :value="i.roleId">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -842,6 +842,8 @@ import {
searchPartAttributeDetails, // searchPartAttributeDetails, //
getEamPropertiesItemByItemNo, getEamPropertiesItemByItemNo,
getCollectorDataByItem, getCollectorDataByItem,
getResponsibleOperatorList,
getMhmResponsibleRoleList,
} from '@/api/qc/qc.js' } from '@/api/qc/qc.js'
import { import {
getTableDefaultListLanguage, getTableDefaultListLanguage,
@ -884,6 +886,12 @@ export default {
} }
return this.tableData.slice(start, end) return this.tableData.slice(start, end)
}, },
operatorRoleList() {
if (this.operatorData.flag === '2' && this.detailData.buNo === '04-MHM') {
return this.mhmRoleList
}
return this.roleList
},
}, },
watch: { watch: {
detailData: { detailData: {
@ -2222,6 +2230,8 @@ export default {
authFile: false, authFile: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
roleList: [], roleList: [],
mhmRoleList: [],
defaultCollaborativeRoleName: 'FQC操作员',
operatorList: [], operatorList: [],
operatorData: { operatorData: {
flag: '', flag: '',
@ -2511,132 +2521,163 @@ export default {
getOperatorList() { getOperatorList() {
this.operatorData.flag = '1' this.operatorData.flag = '1'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator
).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
this.setDefaultCollaborativeRole(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
},
isMhmResponsibleBu() {
return this.detailData.buNo === '04-MHM'
},
setDefaultCollaborativeRole(callback) {
const apply = () => {
if (this.roleList.length > 0) { if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.find((item) => item.roleName === roleName)
const roleId = match ? match.roleId : this.roleList[0].roleId
this.$set(
this.operatorData,
'roleId',
roleId != null && roleId !== '' ? Number(roleId) : ''
) )
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else { } else {
this.operatorData.roleId = this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', '')
} }
callback && callback()
}
if (this.roleList.length > 0) {
apply()
} else { } else {
this.operatorData.roleId = ''
getUserRoleList().then(({ data }) => {
this.roleList = data && data.code === 0 ? data.rows || [] : []
apply()
})
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator
).split(';')
},
fetchCollaborativeOperatorData(tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => { getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach((val) => { this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true) this.$refs.operatorTable.toggleRowSelection(val, true)
) )
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList() {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
)
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
loadMhmRoleList(callback) {
if (this.mhmRoleList.length > 0) {
callback && callback()
return
} }
getMhmResponsibleRoleList({}).then(({ data }) => {
if (data && data.code === 0) {
this.mhmRoleList = data.rows || []
}
callback && callback()
})
},
fetchResponsibleOperatorData(tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
this.operatorData.roleName = ''
request = getResponsibleOperatorList(this.operatorData)
} else { } else {
this.operatorData.roleId = ''
request = getOperatorList(this.operatorData)
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (
this.detailData.responsiblePerson == null
? ''
: this.detailData.responsiblePerson
).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
request.then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach((val) => { this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true) this.$refs.operatorTable.toggleRowSelection(val, true)
) )
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定', confirmButtonText: '确定',
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList() {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (
this.detailData.responsiblePerson == null
? ''
: this.detailData.responsiblePerson
).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
const openDialog = () => {
this.fetchResponsibleOperatorData(tempDataList, true)
}
if (this.isMhmResponsibleBu()) {
this.loadMhmRoleList(() => {
this.operatorData.roleId = ''
openDialog()
})
} else {
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(
(item) => item.roleName === '机修人员'
)
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
}
} else {
this.operatorData.roleId = ''
}
openDialog()
}
},
// //
getOperatorList2() { getOperatorList2() {
if (this.operatorData.flag === '1') { if (this.operatorData.flag === '1') {
//
let tempDataList = ( let tempDataList = (
this.detailData.operator == null ? '' : this.detailData.operator this.detailData.operator == null ? '' : this.detailData.operator
).split(';') ).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true)
)
}
})
} else {
this.operatorList = []
}
})
this.fetchCollaborativeOperatorData(tempDataList, false)
} else { } else {
//
let tempDataList = ( let tempDataList = (
this.detailData.responsiblePerson == null this.detailData.responsiblePerson == null
? '' ? ''
: this.detailData.responsiblePerson : this.detailData.responsiblePerson
).split(';') ).split(';')
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach((val) => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() =>
this.$refs.operatorTable.toggleRowSelection(val, true)
)
}
})
} else {
this.operatorList = []
}
})
this.fetchResponsibleOperatorData(tempDataList, false)
} }
}, },

159
src/views/modules/qc/IPQCResultEntry.vue

@ -797,7 +797,7 @@
<el-form-item :label="'所属角色'"> <el-form-item :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2"> <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option <el-option
v-for = "i in roleList"
v-for = "i in operatorRoleList"
:key = "i.roleId" :key = "i.roleId"
:label = "i.roleName" :label = "i.roleName"
:value = "i.roleId"> :value = "i.roleId">
@ -950,6 +950,8 @@
searchPartAttributeDetails, // searchPartAttributeDetails, //
getEamPropertiesItemByItemNo, getEamPropertiesItemByItemNo,
getCollectorDataByItem, getCollectorDataByItem,
getResponsibleOperatorList,
getMhmResponsibleRoleList,
} from "@/api/qc/qc.js" } from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -984,6 +986,12 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
operatorRoleList () {
if (this.operatorData.flag === '2' && this.detailData.buNo === '04-MHM') {
return this.mhmRoleList
}
return this.roleList
} }
}, },
watch: { watch: {
@ -2371,6 +2379,8 @@
authFile: false, authFile: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
roleList: [], roleList: [],
mhmRoleList: [],
defaultCollaborativeRoleName: 'IPQC操作员',
operatorList: [], operatorList: [],
operatorData: { operatorData: {
flag: '', flag: '',
@ -2693,108 +2703,141 @@
getOperatorList () { getOperatorList () {
this.operatorData.flag = '1' this.operatorData.flag = '1'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
this.setDefaultCollaborativeRole(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
},
isMhmResponsibleBu () {
return this.detailData.buNo === '04-MHM'
},
setDefaultCollaborativeRole (callback) {
const apply = () => {
if (this.roleList.length > 0) { if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.find(item => item.roleName === roleName)
const roleId = match ? match.roleId : this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', roleId != null && roleId !== '' ? Number(roleId) : '')
} else { } else {
this.operatorData.roleId = this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', '')
} }
callback && callback()
}
if (this.roleList.length > 0) {
apply()
} else { } else {
this.operatorData.roleId = ''
getUserRoleList().then(({ data }) => {
this.roleList = (data && data.code === 0) ? (data.rows || []) : []
apply()
})
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
},
fetchCollaborativeOperatorData (tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
loadMhmRoleList (callback) {
if (this.mhmRoleList.length > 0) {
callback && callback()
return
}
getMhmResponsibleRoleList({}).then(({ data }) => {
if (data && data.code === 0) {
this.mhmRoleList = data.rows || []
} }
callback && callback()
})
},
fetchResponsibleOperatorData (tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
this.operatorData.roleName = ''
request = getResponsibleOperatorList(this.operatorData)
} else { } else {
this.operatorData.roleId = ''
request = getOperatorList(this.operatorData)
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
request.then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
const openDialog = () => {
this.fetchResponsibleOperatorData(tempDataList, true)
} }
if (this.isMhmResponsibleBu()) {
this.loadMhmRoleList(() => {
this.operatorData.roleId = ''
openDialog()
}) })
} else { } else {
this.operatorList = []
}
})
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else { } else {
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
this.operatorData.roleId = this.roleList[0].roleId
} }
})
} else { } else {
this.operatorList = []
this.operatorData.roleId = ''
} }
})
openDialog()
}
},
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.fetchCollaborativeOperatorData(tempDataList, false)
} else {
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.fetchResponsibleOperatorData(tempDataList, false)
} }
}, },

163
src/views/modules/qc/IQCResultEntry.vue

@ -658,7 +658,7 @@
<el-form-item :label="'所属角色'"> <el-form-item :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2"> <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option <el-option
v-for = "i in roleList"
v-for = "i in operatorRoleList"
:key = "i.roleId" :key = "i.roleId"
:label = "i.roleName" :label = "i.roleName"
:value = "i.roleId"> :value = "i.roleId">
@ -799,6 +799,8 @@
overLoadSearchPartInfo, // overLoadSearchPartInfo, //
getEamPropertiesItemByItemNo, getEamPropertiesItemByItemNo,
getCollectorDataByItem, getCollectorDataByItem,
getResponsibleOperatorList,
getMhmResponsibleRoleList,
} from "@/api/qc/qc.js" } from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -833,6 +835,12 @@
end = this.tableData.length end = this.tableData.length
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
},
operatorRoleList () {
if (this.operatorData.flag === '2' && this.detailData.buNo === '04-MHM') {
return this.mhmRoleList
}
return this.roleList
} }
}, },
watch: { watch: {
@ -1912,6 +1920,8 @@
authFile: false, authFile: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
roleList: [], roleList: [],
mhmRoleList: [],
defaultCollaborativeRoleName: 'IQC操作员',
operatorList: [], operatorList: [],
operatorData: { operatorData: {
flag: '', flag: '',
@ -2188,108 +2198,145 @@
getOperatorList () { getOperatorList () {
this.operatorData.flag = '1' this.operatorData.flag = '1'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
this.setDefaultCollaborativeRole(() => {
this.$nextTick(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
})
},
isMhmResponsibleBu () {
return this.detailData.buNo === '04-MHM'
},
// 04-MHM BU
setDefaultCollaborativeRole (callback) {
const apply = () => {
if (this.roleList.length > 0) { if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.find(item => item.roleName === roleName)
const role = match || this.roleList[0]
this.$set(this.operatorData, 'roleId', role.roleId != null && role.roleId !== '' ? Number(role.roleId) : '')
} else { } else {
this.operatorData.roleId = this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', '')
}
callback && callback()
} }
if (this.roleList.length > 0) {
apply()
} else { } else {
this.operatorData.roleId = ''
getUserRoleList().then(({ data }) => {
this.roleList = (data && data.code === 0) ? (data.rows || []) : []
apply()
})
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
},
// getOperatorListsys_user getResponsibleOperatorList
fetchCollaborativeOperatorData (tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else {
this.operatorData.roleId = this.roleList[0].roleId
loadMhmRoleList (callback) {
if (this.mhmRoleList.length > 0) {
callback && callback()
return
}
getMhmResponsibleRoleList({}).then(({ data }) => {
if (data && data.code === 0) {
this.mhmRoleList = data.rows || []
} }
callback && callback()
})
},
fetchResponsibleOperatorData (tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
this.operatorData.roleName = ''
request = getResponsibleOperatorList(this.operatorData)
} else { } else {
this.operatorData.roleId = ''
request = getOperatorList(this.operatorData)
} }
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
request.then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
const openDialog = () => {
this.fetchResponsibleOperatorData(tempDataList, true)
} }
if (this.isMhmResponsibleBu()) {
this.loadMhmRoleList(() => {
this.operatorData.roleId = ''
openDialog()
}) })
} else { } else {
this.operatorList = []
}
})
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else { } else {
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
this.operatorData.roleId = this.roleList[0].roleId
} }
})
} else { } else {
this.operatorList = []
this.operatorData.roleId = ''
} }
})
openDialog()
}
},
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.fetchCollaborativeOperatorData(tempDataList, false)
} else {
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.fetchResponsibleOperatorData(tempDataList, false)
} }
}, },

154
src/views/modules/qc/PQCResultEntry.vue

@ -894,7 +894,7 @@
<el-form-item :label="'所属角色'"> <el-form-item :label="'所属角色'">
<el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2"> <el-select v-model="operatorData.roleId" placeholder="请选择" style="width: 120px" @change="getOperatorList2">
<el-option <el-option
v-for = "i in roleList"
v-for = "i in operatorRoleList"
:key = "i.roleId" :key = "i.roleId"
:label = "i.roleName" :label = "i.roleName"
:value = "i.roleId"> :value = "i.roleId">
@ -1053,6 +1053,8 @@ import {
querySopNum,//Sop querySopNum,//Sop
previewSopFile,//Sop previewSopFile,//Sop
getColumnDisplayFlagList,// getColumnDisplayFlagList,//
getResponsibleOperatorList,
getMhmResponsibleRoleList,
} from "@/api/qc/qc.js" } from "@/api/qc/qc.js"
import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js"
import Chooselist from '@/views/modules/common/Chooselist_eam' import Chooselist from '@/views/modules/common/Chooselist_eam'
@ -1089,6 +1091,12 @@ export default {
} }
return this.tableData.slice(start,end) return this.tableData.slice(start,end)
}, },
operatorRoleList () {
if (this.operatorData.flag === '2' && this.detailData.buNo === '04-MHM') {
return this.mhmRoleList
}
return this.roleList
},
// returntemplateId(){ // returntemplateId(){
// let a = this.modalData.operationDesc // let a = this.modalData.operationDesc
// let list = this.operationList // let list = this.operationList
@ -2515,6 +2523,8 @@ export default {
authFile: false, authFile: false,
menuId: this.$route.meta.menuId, menuId: this.$route.meta.menuId,
roleList: [], roleList: [],
mhmRoleList: [],
defaultCollaborativeRoleName: 'PQC操作员',
operatorList: [], operatorList: [],
operatorData: { operatorData: {
flag: '', flag: '',
@ -2787,91 +2797,141 @@ export default {
getOperatorList () { getOperatorList () {
this.operatorData.flag = '1' this.operatorData.flag = '1'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
this.setDefaultLineInspectionRole()
//
const tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection()) this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
this.setDefaultCollaborativeRole(() => {
this.fetchCollaborativeOperatorData(tempDataList, true)
})
},
setDefaultCollaborativeRole (callback) {
const apply = () => {
if (this.roleList.length > 0) {
const roleName = this.isMhmResponsibleBu() ? this.defaultCollaborativeRoleName : '系统管理员'
const match = this.roleList.filter(item => item.roleName === roleName)
const roleId = match.length > 0 ? match[0].roleId : this.roleList[0].roleId
this.$set(this.operatorData, 'roleId', roleId != null && roleId !== '' ? Number(roleId) : '')
} else {
this.$set(this.operatorData, 'roleId', '')
}
callback && callback()
}
if (this.roleList.length > 0) {
apply()
} else {
getUserRoleList().then(({ data }) => {
this.roleList = (data && data.code === 0) ? (data.rows || []) : []
apply()
})
}
},
fetchCollaborativeOperatorData (tempDataList, showDialog) {
this.operatorData.roleName = ''
getOperatorList(this.operatorData).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
this.setDefaultLineInspectionRole()
isMhmResponsibleBu () {
return this.detailData.buNo === '04-MHM'
},
//
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
loadMhmRoleList (callback) {
if (this.mhmRoleList.length > 0) {
callback && callback()
return
}
getMhmResponsibleRoleList({}).then(({ data }) => {
if (data && data.code === 0) {
this.mhmRoleList = data.rows || []
}
callback && callback()
})
},
fetchResponsibleOperatorData (tempDataList, showDialog) {
let request
if (this.isMhmResponsibleBu()) {
this.operatorData.roleName = ''
request = getResponsibleOperatorList(this.operatorData)
} else {
request = getOperatorList(this.operatorData)
}
request.then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.operatorList = data.rows this.operatorList = data.rows
this.operatorList.forEach(val => { this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) { if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true)) this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
} }
}) })
if (showDialog) {
this.operatorModelFlag = true this.operatorModelFlag = true
} else {
}
} else if (showDialog) {
this.$alert(data.msg, '错误', { this.$alert(data.msg, '错误', {
confirmButtonText: '确定' confirmButtonText: '确定'
}) })
} else {
this.operatorList = []
} }
}) })
}, },
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
//
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
//
getResponsiblePersonList () {
this.operatorData.flag = '2'
this.operatorData.bu = this.detailData.site + '_' + this.detailData.buNo
const tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.$nextTick(() => this.$refs.operatorTable.clearSelection())
const openDialog = () => {
this.fetchResponsibleOperatorData(tempDataList, true)
} }
if (this.isMhmResponsibleBu()) {
this.loadMhmRoleList(() => {
this.operatorData.roleId = ''
openDialog()
}) })
} else { } else {
this.operatorList = []
}
})
if (this.roleList.length > 0) {
let filterList = this.roleList.filter(item => item.roleName === '机修人员')
if (filterList.length > 0) {
this.operatorData.roleId = filterList[0].roleId
} else { } else {
//
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
getOperatorList(this.operatorData).then(({data}) => {
if (data && data.code === 0) {
this.operatorList = data.rows
this.operatorList.forEach(val => {
//
if (tempDataList.includes(val.adminID)) {
this.$nextTick(() => this.$refs.operatorTable.toggleRowSelection(val, true))
this.operatorData.roleId = this.roleList[0].roleId
} }
})
} else { } else {
this.operatorList = []
this.operatorData.roleId = ''
} }
})
openDialog()
}
},
//
getOperatorList2 () {
if (this.operatorData.flag === '1') {
let tempDataList = (this.detailData.operator == null ? '' : this.detailData.operator).split(';')
this.fetchCollaborativeOperatorData(tempDataList, false)
} else {
let tempDataList = (this.detailData.responsiblePerson == null ? '' : this.detailData.responsiblePerson).split(';')
this.fetchResponsibleOperatorData(tempDataList, false)
} }
}, },

Loading…
Cancel
Save