diff --git a/cclqms-java/src/main/java/com/gaotao/modules/sys/service/impl/SysUserServiceImpl.java b/cclqms-java/src/main/java/com/gaotao/modules/sys/service/impl/SysUserServiceImpl.java index fd37fa4..c93c964 100644 --- a/cclqms-java/src/main/java/com/gaotao/modules/sys/service/impl/SysUserServiceImpl.java +++ b/cclqms-java/src/main/java/com/gaotao/modules/sys/service/impl/SysUserServiceImpl.java @@ -161,9 +161,10 @@ public class SysUserServiceImpl extends ServiceImpl i @Override public List userList(SysUserEntity params) { + SysUserEntity queryData = params == null ? new SysUserEntity() : params; return lambdaQuery() - .eq(SysUserEntity::getSite,params.getSite()) - .eq(SysUserEntity::getStatus,params.getStatus()) + .eq(StringUtils.isNotBlank(queryData.getSite()), SysUserEntity::getSite, queryData.getSite()) + .eq(queryData.getStatus() != null, SysUserEntity::getStatus, queryData.getStatus()) .orderBy(true,true,SysUserEntity::getUsername) .list(); } diff --git a/cclqms-vue/src/views/modules/mrb/mrbRecord.vue b/cclqms-vue/src/views/modules/mrb/mrbRecord.vue index 4111c64..4020f4c 100644 --- a/cclqms-vue/src/views/modules/mrb/mrbRecord.vue +++ b/cclqms-vue/src/views/modules/mrb/mrbRecord.vue @@ -262,7 +262,7 @@ - + @@ -640,10 +640,19 @@ - - - - + + {{ $t('mrb.field.ipqeSupervisorBi') }} + + + + + @@ -1212,7 +1221,7 @@ function formatYmd (value) { function buildDefaultForm (vm, docType) { return { - site: vm.$store.state.user.site, + site: '', buNo: '', siteBu: '', reportNo: `${TEMP_PREFIX}${Date.now()}-${Math.floor(Math.random() * 1000)}`, @@ -1248,6 +1257,7 @@ function buildDefaultForm (vm, docType) { conclusion: '', weeklyReviewInformation: '', ipqeProductionSupervisor: '', + ipqeProductionSupervisorName: '', ipqeProductionSupervisorList: [], productPn: '', productPnName: '', @@ -1329,7 +1339,7 @@ export default { inspectionOrderCandidateSelections: [], inspectionOrderCandidateTotal: 0, inspectionOrderCandidateQuery: { - site: this.$store.state.user.site, + site: '', buNo: '', reportType: DOC_TYPE_IQC, inspectionType: INSPECTION_TYPE_IQC, @@ -1360,7 +1370,7 @@ export default { tempCountersignItemRow: null, chooseCountersignModelFlag: false, chooseCountersignModelData: { - site: this.$store.state.user.site, + site: '', functionType: 'MRB', codeNo: '', itemNo: '', @@ -1371,6 +1381,7 @@ export default { mrbModelItemSelections: [], userOptionsLoading: false, userOptions: [], + personSelectTarget: 'sqeEngineer', sqeEngineerFlag: false, sqeEngineerDisplayList: [], sqeEngineerSelectionCache: [], @@ -1619,7 +1630,7 @@ export default { this.openAddDialog(reportType) this.$nextTick(() => { const first = sourceList[0] || {} - const site = String(first.site || this.$store.state.user.site || '').trim() + const site = String(first.site || this.resolveSiteByBuValue(first.buNo) || '').trim() const buNo = this.normalizeBuNoValue(first.buNo) if (site) { this.formData.site = site @@ -1738,6 +1749,8 @@ export default { const row = Object.assign({}, source || {}) row.type = this.normalizeType(row.type) row.issueScar = String(row.issueScar || '').trim().toUpperCase() + row.sqeEngineerName = row.sqeEngineerName || this.buildUserDisplayByCodes(this.parseMultiCode(row.sqeEngineer)) + row.ipqeProductionSupervisorName = row.ipqeProductionSupervisorName || this.buildUserDisplayByCodes(this.parseMultiCode(row.ipqeProductionSupervisor)) row.countersignItemList = this.normalizeCountersignItemList(row.countersignItemList || []) row.inspectionOrderList = this.normalizeInspectionOrderList(row.inspectionOrderList || [], row.type) return row @@ -1761,7 +1774,7 @@ export default { } this.currentBaseInfoAttachmentList = [] const query = { - site: row.site || this.$store.state.user.site, + site: row.site, reportNo: row.reportNo } getMrbInfo(query).then(({ data }) => { @@ -1784,7 +1797,7 @@ export default { return } getMrbApprovalList({ - site: rowData.site || this.$store.state.user.site, + site: rowData.site, menuId: this.menuId, reportNo: rowData.reportNo }).then(({ data }) => { @@ -1942,13 +1955,14 @@ export default { const form = Object.assign(buildDefaultForm(this, docType), source || {}) form.type = docType form.buNo = this.normalizeBuNoValue(form.buNo) - form.site = String(form.site || this.$store.state.user.site || '').trim() + form.site = String(source.site || '').trim() form.siteBu = this.buildSiteBuValue(form.site, form.buNo) form.mrbDate = formatYmd(form.mrbDate) form.issueScar = form.issueScar === 'Y' ? 'Y' : 'N' form.sqeEngineerList = this.parseMultiCode(form.sqeEngineer) - form.sqeEngineerName = source.sqeEngineerName || '' + form.sqeEngineerName = source.sqeEngineerName || this.buildUserDisplayByCodes(form.sqeEngineerList) form.ipqeProductionSupervisorList = this.parseMultiCode(form.ipqeProductionSupervisor) + form.ipqeProductionSupervisorName = source.ipqeProductionSupervisorName || this.buildUserDisplayByCodes(form.ipqeProductionSupervisorList) form.stationList = this.parseMultiCode(form.station) form.nonconformanceTypeList = this.parseMultiCode(form.nonconformanceType) form.materialPnName = source.materialPnName || '' @@ -2009,7 +2023,7 @@ export default { if (!Array.isArray(this.userBuList) || this.userBuList.length === 0) { return '' } - const site = String(this.$store.state.user.site || '').trim() + const site = String(this.formData.site || '').trim() const matched = this.userBuList.find(item => String(item.site || '').trim() === site) return String((matched || this.userBuList[0]).buNo || '').trim() }, @@ -2080,15 +2094,23 @@ export default { const value = String(siteBu || '').trim() if (!value) { this.formData.siteBu = '' + this.formData.site = '' this.formData.buNo = '' return } const site = this.resolveSiteByBuValue(value) const buNo = this.resolveBuNoBySiteBu(value) this.formData.siteBu = value - this.formData.site = site || this.formData.site || this.$store.state.user.site || '' + this.formData.site = site || this.formData.site || '' this.formData.buNo = buNo }, + resolveFormSite () { + const directSite = String(this.formData.site || '').trim() + if (directSite) { + return directSite + } + return String(this.resolveSiteByBuValue(this.formData.siteBu) || '').trim() + }, inspectionRowKey (row) { const data = row || {} return `${String(data.inspectionType || '').trim().toUpperCase()}|${String(data.buNo || '').trim()}|${String(data.inspectionNo || '').trim()}` @@ -2134,7 +2156,7 @@ export default { } exists.add(key) result.push({ - site: String(item.site || this.formData.site || this.$store.state.user.site || '').trim(), + site: String(item.site || this.resolveFormSite() || '').trim(), reportNo: String(item.reportNo || this.formData.reportNo || '').trim(), inspectionType, inspectionNo, @@ -2168,6 +2190,12 @@ export default { if (this.formReadOnly) { return } + const site = this.resolveFormSite() + if (!site) { + this.$message.warning(this.$t('mrb.message.selectBuBeforeInspectionOrder')) + return + } + this.formData.site = site this.formData.buNo = this.normalizeBuNoValue(this.formData.buNo) if (!this.formData.buNo) { this.$message.warning(this.$t('mrb.message.selectBuBeforeInspectionOrder')) @@ -2177,7 +2205,7 @@ export default { const lockedType = this.isIpqeType ? this.getCurrentIpqeInspectionType() : '' this.inspectionOrderTypeLocked = this.isIpqeType && !!lockedType this.inspectionOrderCandidateQuery = { - site: this.formData.site || this.$store.state.user.site, + site, buNo: this.formData.buNo, reportType, inspectionType: this.isIqcType ? INSPECTION_TYPE_IQC : (lockedType || INSPECTION_TYPE_IPQC), @@ -2205,7 +2233,7 @@ export default { const reportType = this.isIqcType ? DOC_TYPE_IQC : DOC_TYPE_IPQE const inspectionType = this.isIqcType ? INSPECTION_TYPE_IQC : (this.inspectionOrderTypeLocked ? this.getCurrentIpqeInspectionType() : INSPECTION_TYPE_IPQC) this.inspectionOrderCandidateQuery = { - site: this.formData.site || this.$store.state.user.site, + site: this.resolveFormSite(), buNo: this.formData.buNo, reportType, inspectionType, @@ -2230,8 +2258,14 @@ export default { if (!this.inspectionOrderChooseDialogVisible) { return } + const site = this.resolveFormSite() + if (!site) { + this.inspectionOrderCandidateList = [] + this.inspectionOrderCandidateTotal = 0 + return + } const payload = Object.assign({}, this.inspectionOrderCandidateQuery, { - site: this.formData.site || this.$store.state.user.site, + site, buNo: this.formData.buNo, reportType: this.isIqcType ? DOC_TYPE_IQC : DOC_TYPE_IPQE, inspectionType: this.isIqcType ? INSPECTION_TYPE_IQC : this.inspectionOrderCandidateQuery.inspectionType @@ -2341,7 +2375,7 @@ export default { if (!Array.isArray(itemList)) { return [] } - const site = String(this.formData.site || this.$store.state.user.site || '').trim() + const site = String(this.resolveFormSite() || '').trim() const reportNo = String(this.formData.reportNo || '').trim() const modelCodeNo = String(fallbackCodeNo || '').trim() const exists = new Set() @@ -2387,6 +2421,7 @@ export default { this.formData.sqeEngineer = this.joinMultiCode(this.formData.sqeEngineerList) this.formData.sqeEngineerName = this.buildUserDisplayByCodes(this.formData.sqeEngineerList) this.formData.ipqeProductionSupervisor = this.joinMultiCode(this.formData.ipqeProductionSupervisorList) + this.formData.ipqeProductionSupervisorName = this.buildUserDisplayByCodes(this.formData.ipqeProductionSupervisorList) this.formData.station = this.joinMultiCode(this.formData.stationList) this.formData.nonconformanceType = this.joinMultiCode(this.formData.nonconformanceTypeList) this.formData.countersignItemList = this.normalizeCountersignItemList(this.formData.countersignItemList, this.formData.countersignModelCodeNo) @@ -2551,8 +2586,13 @@ export default { cancelButtonText: this.$t('mrb.common.cancel'), type: 'warning' }).then(() => { + const site = String((approvedRows[0] && approvedRows[0].site) || '').trim() + if (!site) { + this.$message.error(this.$t('mrb.message.closeProcessFailed')) + return + } closeMrbProcess({ - site: this.$store.state.user.site, + site, documentNos: approvedRows.map(row => row.reportNo) }).then(({ data }) => { if (data && data.code === 0) { @@ -2707,7 +2747,6 @@ export default { } this.userOptionsLoading = true return userList({ - site: this.$store.state.user.site, status: 1 }).then(({ data }) => { if (data && data.code === 0 && Array.isArray(data.list)) { @@ -2721,13 +2760,25 @@ export default { } }).filter(item => item.value) this.syncSqeEngineerDisplay() + this.syncIpqeProductionSupervisorDisplay() + if (this.currentRow && this.currentRow.reportNo) { + this.currentRow = this.normalizeCurrentRow(this.currentRow) + } } else { this.userOptions = [] this.syncSqeEngineerDisplay() + this.syncIpqeProductionSupervisorDisplay() + if (this.currentRow && this.currentRow.reportNo) { + this.currentRow = this.normalizeCurrentRow(this.currentRow) + } } }).catch(() => { this.userOptions = [] this.syncSqeEngineerDisplay() + this.syncIpqeProductionSupervisorDisplay() + if (this.currentRow && this.currentRow.reportNo) { + this.currentRow = this.normalizeCurrentRow(this.currentRow) + } }).finally(() => { this.userOptionsLoading = false }) @@ -2756,6 +2807,30 @@ export default { this.$set(this.formData, 'sqeEngineerName', this.buildUserDisplayByCodes(list)) this.$set(this.formData, 'sqeEngineer', this.joinMultiCode(list)) }, + syncIpqeProductionSupervisorDisplay () { + const list = Array.isArray(this.formData.ipqeProductionSupervisorList) ? this.formData.ipqeProductionSupervisorList : [] + this.$set(this.formData, 'ipqeProductionSupervisorList', list) + this.$set(this.formData, 'ipqeProductionSupervisorName', this.buildUserDisplayByCodes(list)) + this.$set(this.formData, 'ipqeProductionSupervisor', this.joinMultiCode(list)) + }, + getPersonCodeListByTarget (target) { + if (target === 'ipqeProductionSupervisor') { + return Array.isArray(this.formData.ipqeProductionSupervisorList) ? this.formData.ipqeProductionSupervisorList : [] + } + return Array.isArray(this.formData.sqeEngineerList) ? this.formData.sqeEngineerList : [] + }, + setPersonCodeListByTarget (target, valueList) { + const normalizedList = Array.from(new Set((valueList || []) + .map(item => String(item || '').trim()) + .filter(item => item))) + if (target === 'ipqeProductionSupervisor') { + this.$set(this.formData, 'ipqeProductionSupervisorList', normalizedList) + this.syncIpqeProductionSupervisorDisplay() + return + } + this.$set(this.formData, 'sqeEngineerList', normalizedList) + this.syncSqeEngineerDisplay() + }, filterSqeEngineerOptions () { const operatorIdKeyword = String(this.sqeEngineerSearchData.operatorId || '').trim().toUpperCase() const operatorNameKeyword = String(this.sqeEngineerSearchData.operatorName || '').trim().toUpperCase() @@ -2767,7 +2842,7 @@ export default { return matchOperatorId && matchOperatorName }) }, - openSqeEngineerChooseModal () { + openPersonChooseModal (target) { if (this.formReadOnly) { return } @@ -2776,9 +2851,16 @@ export default { this.$message.warning(this.$t('mrb.message.noSelectableUsers')) return } + this.personSelectTarget = target || 'sqeEngineer' this.sqeEngineerFlag = true }) }, + openSqeEngineerChooseModal () { + this.openPersonChooseModal('sqeEngineer') + }, + openIpqeProductionSupervisorChooseModal () { + this.openPersonChooseModal('ipqeProductionSupervisor') + }, openSqeEngineerDialog () { this.sqeEngineerSearchData = { operatorId: '', @@ -2786,7 +2868,7 @@ export default { } this.filterSqeEngineerOptions() const selectedSet = new Set( - (this.formData.sqeEngineerList || []) + this.getPersonCodeListByTarget(this.personSelectTarget || 'sqeEngineer') .map(item => String(item || '').trim()) .filter(item => item) ) @@ -2817,16 +2899,21 @@ export default { const selectedCodes = (this.sqeEngineerSelectionCache || []) .map(item => String(item.value || '').trim()) .filter(item => item) - this.$set(this.formData, 'sqeEngineerList', Array.from(new Set(selectedCodes))) - this.syncSqeEngineerDisplay() + this.setPersonCodeListByTarget(this.personSelectTarget || 'sqeEngineer', selectedCodes) this.sqeEngineerFlag = false }, clearSqeEngineerSelection () { - this.$set(this.formData, 'sqeEngineerList', []) - this.syncSqeEngineerDisplay() + this.setPersonCodeListByTarget('sqeEngineer', []) + }, + clearIpqeProductionSupervisorSelection () { + this.setPersonCodeListByTarget('ipqeProductionSupervisor', []) }, queryMrbModelList () { - const site = this.formData.site || this.$store.state.user.site + const site = this.resolveFormSite() + if (!site) { + this.$message.warning(this.$t('mrb.message.selectBu')) + return Promise.resolve([]) + } const userBu = String( this.formData.buNo || this.$store.state.user.buNo || @@ -2888,15 +2975,22 @@ export default { this.mrbModelItemSelections = [] return Promise.resolve([]) } + const site = this.resolveFormSite() + if (!site) { + this.$message.warning(this.$t('mrb.message.selectBu')) + this.mrbModelItemList = [] + this.mrbModelItemSelections = [] + return Promise.resolve([]) + } return searchModalDetails({ - site: this.formData.site || this.$store.state.user.site, + site, functionType: 'MRB', codeNo }).then(({ data }) => { let list = [] if (data && data.code === 0 && Array.isArray(data.rows)) { list = data.rows.map(item => ({ - site: this.formData.site || this.$store.state.user.site, + site, itemNo: String(item.itemNo || item.propertiesItemNo || '').trim(), itemDesc: String(item.itemDesc || '').trim(), codeNo @@ -2946,7 +3040,7 @@ export default { const currentCodeNo = String(this.formData.countersignModelCodeNo || '').trim() const matched = modelList.find(item => item.codeNo === currentCodeNo) this.chooseCountersignModelData = { - site: this.formData.site || this.$store.state.user.site, + site: this.resolveFormSite(), functionType: 'MRB', codeNo: matched ? matched.codeNo : modelList[0].codeNo, itemNo: '', @@ -2984,7 +3078,7 @@ export default { selectedRows.forEach(itemB => { if (!mergedList.some(itemR => itemR.itemNo === itemB.itemNo)) { mergedList.push({ - site: this.formData.site || this.$store.state.user.site, + site: this.resolveFormSite(), reportNo: this.formData.reportNo, itemNo: itemB.itemNo, itemDesc: itemB.itemDesc, @@ -3106,7 +3200,7 @@ export default { return } checkMrbProcessControl({ - site: this.formData.site || this.$store.state.user.site, + site: this.resolveFormSite(), reportNo: this.formData.reportNo, roleId: 11 }).then(({ data }) => { @@ -3346,7 +3440,7 @@ export default { return '' }, getChooseListSiteSql (siteField = 'site') { - const site = String(this.formData.site || this.$store.state.user.site || '').trim() + const site = String(this.resolveFormSite() || '').trim() if (!site) { return '' } @@ -3423,7 +3517,7 @@ export default { this.$message.warning(this.$t('mrb.message.itemNoRequiredForAttachment')) return } - const site = String(this.formData.site || this.$store.state.user.site || '').trim() + const site = String(this.resolveFormSite() || '').trim() const reportNo = String(this.formData.reportNo || '').trim() if (!site) { this.$message.warning(this.$t('mrb.message.siteRequiredForAttachment')) @@ -3442,7 +3536,7 @@ export default { }) }, openBaseInfoAttachmentDialog () { - const site = String(this.formData.site || this.$store.state.user.site || '').trim() + const site = String(this.resolveFormSite() || '').trim() const reportNo = String(this.formData.reportNo || '').trim() if (!site) { this.$message.warning(this.$t('mrb.message.siteRequiredForAttachment')) @@ -3829,10 +3923,14 @@ export default { .mrb-dialog-tabs { width: 100%; height: 600px; + overflow-x: hidden; } /deep/ .mrb-dialog-tabs.el-tabs--left .el-tabs__header.is-left { width: 128px; + min-width: 128px; + max-width: 128px; + flex: 0 0 128px; margin-right: 10px; } @@ -3848,6 +3946,7 @@ export default { .mrb-dialog-tab-pane { height: 755px; overflow-y: auto; + overflow-x: hidden; } .mrb-inspection-toolbar { @@ -3887,6 +3986,7 @@ export default { /deep/ .mrb-dialog-tabs .el-tabs__content { padding: 10px 15px; + overflow-x: hidden; } /deep/ .customer-tab .el-tabs__content {