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