diff --git a/src/views/modules/sampleTracking/projectProofTracking.vue b/src/views/modules/sampleTracking/projectProofTracking.vue index 1bcb83d..a9732fa 100644 --- a/src/views/modules/sampleTracking/projectProofTracking.vue +++ b/src/views/modules/sampleTracking/projectProofTracking.vue @@ -170,6 +170,10 @@ {{ getTrackingRoleDisplayValue(scope.row, 'projectOwnerName', 'pic') }} + {{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} {{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} @@ -597,7 +601,7 @@ @blur="handleOneKeyPartNoBlur"> @@ -653,7 +657,7 @@ - IQC + IQC @@ -671,7 +675,7 @@ - SQE + SQE @@ -686,19 +690,19 @@ - FQC2 + FQC2 - IPQC-Hardtag + IPQC-Hardtag - 前道工程师 + 前道工程师 @@ -1552,12 +1556,13 @@ export default { cQualityEngineer3: { apiKey: '4', title: 'FQC1', nameField: 'cQualityEngineer3Name' }, cManufactureEngineer: { apiKey: '5', title: 'MFG', nameField: 'cManufactureEngineerName' }, engineer: { apiKey: '6', title: 'Engineer', nameField: 'engineerName' }, - cQualityEngineer4: { apiKey: '7', title: 'SQE', nameField: 'cQualityEngineer4Name' }, - cQualityEngineer5: { apiKey: '7', title: 'FQC2', nameField: 'cQualityEngineer5Name' }, - cQualityEngineer6: { apiKey: '7', title: 'IQC', nameField: 'cQualityEngineer6Name' }, + // 以下角色与 NPI 项目页一致,走 Chooselist tag,不能复用文档工程师的 searchBusinessInfo7。 + cQualityEngineer4: { tagNo: 2006, title: 'SQE', nameField: 'cQualityEngineer4Name' }, + cQualityEngineer5: { tagNo: 2007, title: 'FQC2', nameField: 'cQualityEngineer5Name' }, + cQualityEngineer6: { tagNo: 2008, title: 'IQC', nameField: 'cQualityEngineer6Name' }, docEngineer: { apiKey: '7', title: '文档工程师', nameField: 'docEngineerName' }, - ipqcHardTag: { apiKey: '7', title: 'IPQC-Hardtag', nameField: 'ipqcHardTagName' }, - cQualityEngineer7: { apiKey: '7', title: '前道工程师', nameField: 'cQualityEngineer7Name' }, + ipqcHardTag: { tagNo: 2010, title: 'IPQC-Hardtag', nameField: 'ipqcHardTagName' }, + cQualityEngineer7: { tagNo: 2012, title: '前道工程师', nameField: 'cQualityEngineer7Name' }, docEngineer2: { apiKey: '8', title: '文档工程师2', nameField: 'docEngineer2Name' } }, dataList: [], @@ -1903,6 +1908,17 @@ export default { const value = row[columnProp] return this.isBlankValue(value) ? '' : String(value) }, + isDeliveryVarianceAlert (row) { + // Delivery Variance = Baseline - Delivery&Package 实际日期;-8/-9 这类小于 -7 的值表示延误超过 7 天,需要标红。 + if (!row || this.isBlankValue(row.deliveryVariance)) { + return false + } + const variance = Number(row.deliveryVariance) + if (Number.isNaN(variance)) { + return false + } + return variance < -7 + }, getTrackingRoleDisplayValue (row, nameField, valueField) { if (!row) { return '' @@ -3538,11 +3554,40 @@ export default { this.$refs.baseList.init(val, strVal, '') }) }, + getRoleFieldByTagNo (tagNo) { + const numericTag = Number(tagNo) + const fieldKeys = Object.keys(this.roleConfig || {}) + for (let i = 0; i < fieldKeys.length; i++) { + const fieldKey = fieldKeys[i] + if (Number(this.roleConfig[fieldKey].tagNo) === numericTag) { + return fieldKey + } + } + return '' + }, + buildRoleValueFromChooserRow (row) { + if (!row) { + return '' + } + const username = row.username || row.user_name || '' + const userDisplay = row.user_display || row.userDisplay || '' + if (!username && !userDisplay) { + return '' + } + return username + '-' + userDisplay + }, getBaseData (val) { if (this.tagNo === 509) { this.oneKeyForm.customerNo = val.customer_no this.oneKeyForm.customerDesc = val.customer_desc + return } + // IQC/SQE/FQC2/IPQC-Hardtag/前道工程师与 NPI 项目页共用 Chooselist 回填规则。 + const roleField = this.getRoleFieldByTagNo(this.tagNo) + if (!roleField) { + return + } + this.setOneKeyRoleFieldValue(roleField, this.buildRoleValueFromChooserRow(val)) }, customerNoBlur () { if (!this.oneKeyForm.customerNo) { @@ -3636,6 +3681,10 @@ export default { if (!roleCfg) { return } + if (roleCfg.tagNo) { + this.getBaseList(roleCfg.tagNo) + return + } this.roleDialogField = field this.roleDialogApiKey = roleCfg.apiKey this.roleDialogTitle = roleCfg.title @@ -3656,13 +3705,10 @@ export default { }) }, pickRole (row) { - const roleCfg = this.roleConfig[this.roleDialogField] - if (!roleCfg) { + if (!this.roleDialogField) { return } - const value = row.username + '-' + row.userDisplay - this.oneKeyForm[this.roleDialogField] = value - this.oneKeyForm[roleCfg.nameField] = row.userDisplay + this.setOneKeyRoleFieldValue(this.roleDialogField, this.buildRoleValueFromChooserRow(row)) this.roleDialogVisible = false }, getEmptyOneKeyForm () { @@ -6254,6 +6300,11 @@ export default { background: #fde2e2; } +.delivery-variance-alert { + color: #f56c6c; + font-weight: 700; +} + .tracking-status--unknown { background: #f4f4f5; }