|
|
|
@ -23,6 +23,11 @@ |
|
|
|
<el-form-item label="料号描述"> |
|
|
|
<el-input v-model="searchData.partDesc" clearable placeholder="请输入料号描述" style="width: 160px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="分类"> |
|
|
|
<el-select v-model="searchData.dryWetType" clearable placeholder="全部" style="width: 100px"> |
|
|
|
<el-option v-for="item in dryWetTypeList" :key="`searchDryWet_${item}`" :label="item" :value="item" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="客户编码"> |
|
|
|
<el-input v-model="searchData.customerNo" clearable placeholder="请输入客户编码" style="width: 120px" /> |
|
|
|
</el-form-item> |
|
|
|
@ -49,6 +54,7 @@ |
|
|
|
</el-select> |
|
|
|
<el-button type="primary" @click="getDataList('Y')">查询</el-button> |
|
|
|
<el-button @click="resetSearch">重置</el-button> |
|
|
|
<el-button type="success" :loading="exportLoading" @click="exportTrackingData">导出</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item class="button-group-col"> |
|
|
|
<el-row :gutter="8" type="flex" class="button-row" > |
|
|
|
@ -477,13 +483,20 @@ |
|
|
|
<el-input v-model="oneKeyForm.partDesc" style="width: 100%"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('partType')"> |
|
|
|
<el-col :span="3" v-show="isOneKeyCreateFieldVisible('partType')"> |
|
|
|
<el-form-item label="料号状态"> |
|
|
|
<el-select v-model="oneKeyForm.partType" placeholder="请选择" clearable style="width: 100%"> |
|
|
|
<el-option v-for="item in partTypeList" :key="item" :label="item" :value="item"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="3" v-show="isOneKeyCreateFieldVisible('dryWetType')"> |
|
|
|
<el-form-item label="分类"> |
|
|
|
<el-select v-model="oneKeyForm.dry_wet_type" placeholder="请选择" clearable style="width: 100%"> |
|
|
|
<el-option v-for="item in dryWetTypeList" :key="item" :label="item" :value="item"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row :gutter="16"> |
|
|
|
@ -954,6 +967,7 @@ import { |
|
|
|
batchUpdateProofTrackingPlan, |
|
|
|
createProofTrackingRecord, |
|
|
|
deleteProofTracking, |
|
|
|
exportProofTracking, |
|
|
|
finishProofTracking, |
|
|
|
oneKeyCreateProofTracking, |
|
|
|
oneKeyUpdateProofTracking, |
|
|
|
@ -1109,6 +1123,20 @@ const DEFAULT_TRACKING_COLUMNS = [ |
|
|
|
columnWidth: 150, |
|
|
|
showOverflowTooltip: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
serialNumber: 'proofTrackingTable1DryWetType', |
|
|
|
columnProp: 'dryWetType', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '分类', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
columnSortable: false, |
|
|
|
status: true, |
|
|
|
fixed: '', |
|
|
|
columnWidth: 70, |
|
|
|
showOverflowTooltip: true |
|
|
|
}, |
|
|
|
{ |
|
|
|
serialNumber: 'proofTrackingTable1ProjectRegion', |
|
|
|
columnProp: 'cProjectRegion', |
|
|
|
@ -1242,6 +1270,7 @@ export default { |
|
|
|
buNo: '', |
|
|
|
testPartNo: '', |
|
|
|
partDesc: '', |
|
|
|
dryWetType: '', |
|
|
|
customerNo: '', |
|
|
|
proofingNo: '', |
|
|
|
projectPartSyncFlag: '', |
|
|
|
@ -1276,6 +1305,7 @@ export default { |
|
|
|
priorityList: ['Low', 'Middle', 'High'], |
|
|
|
projectStatusList: ['草稿', '进行中', '已关闭'], |
|
|
|
partTypeList: ['Active', 'On hold', 'Cancel', 'EOL'], |
|
|
|
dryWetTypeList: ['Dry', 'Wet'], |
|
|
|
partStatusList: ['草稿', '进行中', '已量产', '正式量产'], |
|
|
|
cProjectTypeDbList: [ |
|
|
|
{ cProjectTypeDb: 'Sustaining' }, |
|
|
|
@ -1303,6 +1333,7 @@ export default { |
|
|
|
'testPartNo', |
|
|
|
'partDesc', |
|
|
|
'partType', |
|
|
|
'dryWetType', |
|
|
|
'projectManager', |
|
|
|
'projectOwner', |
|
|
|
'engineer', |
|
|
|
@ -1363,6 +1394,7 @@ export default { |
|
|
|
}, |
|
|
|
dataList: [], |
|
|
|
dataListLoading: false, |
|
|
|
exportLoading: false, |
|
|
|
syncNpiLoading: false, |
|
|
|
syncProofLoading: false, |
|
|
|
pageIndex: 1, |
|
|
|
@ -2739,6 +2771,7 @@ export default { |
|
|
|
cQualityEngineer7: '', |
|
|
|
cQualityEngineer7Name: '', |
|
|
|
partType: '', |
|
|
|
dry_wet_type: '', |
|
|
|
partStatus: '草稿', |
|
|
|
projectPhase: '', |
|
|
|
tracker: '', |
|
|
|
@ -2850,12 +2883,103 @@ export default { |
|
|
|
this.$message.error('查询异常') |
|
|
|
}) |
|
|
|
}, |
|
|
|
async exportTrackingData () { |
|
|
|
if (this.exportLoading) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.searchData.site = this.$store.state.user.site |
|
|
|
this.searchData.userName = this.$store.state.user.name |
|
|
|
const exportTrackingColumns = this.visibleTrackingColumns.map(item => ({ |
|
|
|
columnProp: item.columnProp, |
|
|
|
columnLabel: item.columnLabel |
|
|
|
})) |
|
|
|
const exportProcessColumns = this.visibleProcessColumns.map(item => ({ |
|
|
|
code: item.code, |
|
|
|
label: item.label, |
|
|
|
planField: item.planField, |
|
|
|
actualField: item.actualField, |
|
|
|
statusField: item.statusField |
|
|
|
})) |
|
|
|
if (exportTrackingColumns.length === 0 && exportProcessColumns.length === 0) { |
|
|
|
this.$message.warning('当前没有可导出的列') |
|
|
|
return |
|
|
|
} |
|
|
|
const inData = Object.assign({}, this.searchData, { |
|
|
|
buNo: this.normalizeBuNo(this.searchData.buNo, this.searchData.site), |
|
|
|
exportTrackingColumns: exportTrackingColumns, |
|
|
|
exportProcessColumns: exportProcessColumns, |
|
|
|
exportCommentsColumn: true |
|
|
|
}) |
|
|
|
this.exportLoading = true |
|
|
|
try { |
|
|
|
const response = await exportProofTracking(inData) |
|
|
|
const blob = response && response.data ? response.data : null |
|
|
|
if (!blob) { |
|
|
|
this.$message.error('导出失败') |
|
|
|
return |
|
|
|
} |
|
|
|
if (blob.type && blob.type.indexOf('application/json') > -1) { |
|
|
|
const errorText = await blob.text() |
|
|
|
let errorMsg = '导出失败' |
|
|
|
try { |
|
|
|
const errorObj = JSON.parse(errorText) |
|
|
|
if (errorObj && errorObj.msg) { |
|
|
|
errorMsg = errorObj.msg |
|
|
|
} |
|
|
|
} catch (e) { |
|
|
|
} |
|
|
|
this.$message.error(errorMsg) |
|
|
|
return |
|
|
|
} |
|
|
|
const fileName = this.resolveProofTrackingExportFileName(response) |
|
|
|
const url = window.URL.createObjectURL(blob) |
|
|
|
const link = document.createElement('a') |
|
|
|
link.href = url |
|
|
|
link.setAttribute('download', fileName) |
|
|
|
document.body.appendChild(link) |
|
|
|
link.click() |
|
|
|
link.remove() |
|
|
|
window.URL.revokeObjectURL(url) |
|
|
|
} catch (e) { |
|
|
|
this.$message.error('导出失败') |
|
|
|
} finally { |
|
|
|
this.exportLoading = false |
|
|
|
} |
|
|
|
}, |
|
|
|
resolveProofTrackingExportFileName (response) { |
|
|
|
const defaultFileName = `项目打样跟踪_${this.getExportTimestamp()}.xlsx` |
|
|
|
const disposition = response && response.headers |
|
|
|
? (response.headers['content-disposition'] || response.headers['Content-Disposition'] || '') |
|
|
|
: '' |
|
|
|
if (!disposition) { |
|
|
|
return defaultFileName |
|
|
|
} |
|
|
|
const utf8Match = disposition.match(/filename\*=utf-8''([^;]+)/i) |
|
|
|
if (utf8Match && utf8Match[1]) { |
|
|
|
try { |
|
|
|
return decodeURIComponent(utf8Match[1]) |
|
|
|
} catch (e) { |
|
|
|
return utf8Match[1] |
|
|
|
} |
|
|
|
} |
|
|
|
const normalMatch = disposition.match(/filename="?([^";]+)"?/i) |
|
|
|
if (normalMatch && normalMatch[1]) { |
|
|
|
return normalMatch[1] |
|
|
|
} |
|
|
|
return defaultFileName |
|
|
|
}, |
|
|
|
getExportTimestamp () { |
|
|
|
const now = new Date() |
|
|
|
const pad = num => String(num).padStart(2, '0') |
|
|
|
return `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}` |
|
|
|
}, |
|
|
|
resetSearch () { |
|
|
|
this.searchData.projectNo = '' |
|
|
|
this.searchData.projectDesc = '' |
|
|
|
this.searchData.buNo = '' |
|
|
|
this.searchData.testPartNo = '' |
|
|
|
this.searchData.partDesc = '' |
|
|
|
this.searchData.dryWetType = '' |
|
|
|
this.searchData.customerNo = '' |
|
|
|
this.searchData.proofingNo = '' |
|
|
|
this.searchData.projectPartSyncFlag = '' |
|
|
|
@ -3077,6 +3201,7 @@ export default { |
|
|
|
this.oneKeyForm.testPartNo = '' |
|
|
|
this.oneKeyForm.partDesc = '' |
|
|
|
this.oneKeyForm.partType = '' |
|
|
|
this.oneKeyForm.dry_wet_type = '' |
|
|
|
return |
|
|
|
} |
|
|
|
if (previousProjectNo.toUpperCase() !== projectNo.toUpperCase()) { |
|
|
|
@ -3084,6 +3209,7 @@ export default { |
|
|
|
this.oneKeyForm.testPartNo = '' |
|
|
|
this.oneKeyForm.partDesc = '' |
|
|
|
this.oneKeyForm.partType = '' |
|
|
|
this.oneKeyForm.dry_wet_type = '' |
|
|
|
} |
|
|
|
this.oneKeyProjectNoSnapshot = projectNo |
|
|
|
this.loadOneKeyProofingApplyOptions(projectNo, { keepCurrentIfMissing: false }) |
|
|
|
@ -3544,6 +3670,7 @@ export default { |
|
|
|
this.oneKeyForm.testPartNo = '' |
|
|
|
this.oneKeyForm.partDesc = '' |
|
|
|
this.oneKeyForm.partType = '' |
|
|
|
this.oneKeyForm.dry_wet_type = '' |
|
|
|
} |
|
|
|
this.loadOneKeyProofingApplyOptions(projectNo, { keepCurrentIfMissing: false }) |
|
|
|
}, |
|
|
|
@ -3560,6 +3687,13 @@ export default { |
|
|
|
if (!this.isBlankValue(selectedPart.partType)) { |
|
|
|
this.oneKeyForm.partType = String(selectedPart.partType).trim() |
|
|
|
} |
|
|
|
// 接口可能返回 camelCase 或下划线字段名,这里统一兼容后回填到表单。 |
|
|
|
const selectedDryWetType = this.isBlankValue(selectedPart.dry_wet_type) |
|
|
|
? selectedPart.dryWetType |
|
|
|
: selectedPart.dry_wet_type |
|
|
|
if (!this.isBlankValue(selectedDryWetType)) { |
|
|
|
this.oneKeyForm.dry_wet_type = String(selectedDryWetType).trim() |
|
|
|
} |
|
|
|
// 业务要求:料号角色与项目角色存在差异时,界面需优先回填料号角色账号。 |
|
|
|
this.syncOneKeyPartRoleFields(selectedPart) |
|
|
|
}, |
|
|
|
@ -3697,6 +3831,7 @@ export default { |
|
|
|
ipqcHardTag: project.ipqcHardTag || part.ipqcHardTag || '', |
|
|
|
cQualityEngineer7: project.cQualityEngineer7 || part.cQualityEngineer7 || '', |
|
|
|
partType: part.partType || '', |
|
|
|
dry_wet_type: part.dry_wet_type || part.dryWetType || current.dry_wet_type || current.dryWetType || '', |
|
|
|
partStatus: part.status || part.partStatus || '草稿', |
|
|
|
projectPhase: current.projectPhase || '', |
|
|
|
tracker: current.tracker || project.projectOwner || part.projectOwner || '', |
|
|
|
@ -3843,6 +3978,7 @@ export default { |
|
|
|
this.searchData.projectDesc = '' |
|
|
|
this.searchData.testPartNo = '' |
|
|
|
this.searchData.partDesc = '' |
|
|
|
this.searchData.dryWetType = '' |
|
|
|
this.searchData.customerNo = '' |
|
|
|
this.searchData.proofingNo = '' |
|
|
|
this.searchData.projectPartSyncFlag = '' |
|
|
|
|