diff --git a/src/api/sampleTracking/sampleTracking.js b/src/api/sampleTracking/sampleTracking.js
index b3a5d0e..384f14c 100644
--- a/src/api/sampleTracking/sampleTracking.js
+++ b/src/api/sampleTracking/sampleTracking.js
@@ -14,6 +14,7 @@ export const syncProjectPartTracking = data => createAPI('/sampleTracking/projec
export const syncProofTracking = data => createAPI('/sampleTracking/proofTracking/sync', 'POST', data)
export const searchProofTracking = data => createAPI('/sampleTracking/proofTracking/search', 'POST', data)
+export const exportProofTracking = data => createAPI('/sampleTracking/proofTracking/export', 'POST', data, 'download')
export const oneKeyCreateProofTracking = data => createAPI('/sampleTracking/proofTracking/oneKeyCreate', 'POST', data)
export const oneKeyUpdateProofTracking = data => createAPI('/sampleTracking/proofTracking/oneKeyUpdate', 'POST', data)
export const createProofTrackingRecord = data => createAPI('/sampleTracking/proofTracking/createProofRecord', 'POST', data)
diff --git a/src/views/modules/eam/eamProjectInfo.vue b/src/views/modules/eam/eamProjectInfo.vue
index ad8f752..6ec426e 100644
--- a/src/views/modules/eam/eamProjectInfo.vue
+++ b/src/views/modules/eam/eamProjectInfo.vue
@@ -393,7 +393,7 @@
-
+
料号状态
@@ -406,7 +406,18 @@
-
+
+
+
+ 分类
+
+
+
+
+
+
+
+
优先级
@@ -1402,6 +1413,7 @@ import {updateColumnSize} from "../../../api/table";
finalPartNo:'',
finalPartDesc:'',
partType:'',
+ dry_wet_type:'',
wantedConfirmDate: new Date(),
status: '',
// active:'',
@@ -2647,6 +2659,13 @@ import {updateColumnSize} from "../../../api/table";
trigger: ['blur','change']
}
],
+ dry_wet_type:[
+ {
+ required: true,
+ message: ' ',
+ trigger: ['blur','change']
+ }
+ ],
projectManager:[
{
required: true,
@@ -3813,6 +3832,7 @@ import {updateColumnSize} from "../../../api/table";
projectCategory:'',
testPartNo:'',
partDesc:'',
+ dry_wet_type: 'Dry',
projectNo: '',
projectDesc:'',
projectCloseDate:'',
@@ -3916,6 +3936,7 @@ import {updateColumnSize} from "../../../api/table";
sqeeeEngineer: row.sqeeeEngineer || '',
projectCreationDate: row.projectCreationDate,
status: row.status,
+ dry_wet_type: row.dry_wet_type || row.dryWetType || '',
remark: row.remark,
// active: row.active,
createBy: this.$store.state.user.name,
@@ -4168,6 +4189,7 @@ import {updateColumnSize} from "../../../api/table";
testPartNo: 'P000000',
partDesc: '无物料',
partType: 'Active',
+ dry_wet_type: this.modalData.dry_wet_type || 'Dry',
remark: this.modalData.remark,
}
eamProjectInfoSave(this.modalData).then(({data}) => {
@@ -4249,6 +4271,7 @@ import {updateColumnSize} from "../../../api/table";
testPartNo: 'P000000',
partDesc: '无物料',
partType: 'Active',
+ dry_wet_type: this.modalData.dry_wet_type || 'Dry',
remark: this.modalData.remark,
}
eamProjectInfoSave(this.modalData).then(({data}) => {
@@ -4331,6 +4354,7 @@ import {updateColumnSize} from "../../../api/table";
buildDate : this.modalData.projectCreationDate,
priority: this.modalData.priority,
partType: this.modalData.partType,
+ dry_wet_type: this.modalData.dry_wet_type || 'Dry',
testPartNo: 'P000000',
partDesc: '无物料',
status: this.modalData.status,
@@ -4420,6 +4444,10 @@ import {updateColumnSize} from "../../../api/table";
this.$message.warning('请选择料号状态!')
return
}
+ if (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null) {
+ this.$message.warning('请选择分类!')
+ return
+ }
this.modalData.closeDate = this.modalData.projectCloseDate
this.modalData.buildDate = this.modalData.projectCreationDate
eamProjectPartInfoSave(this.modalData).then(({data}) => {
@@ -4452,6 +4480,10 @@ import {updateColumnSize} from "../../../api/table";
this.$message.warning('请选择料号状态!')
return
}
+ if (this.modalData.dry_wet_type === '' || this.modalData.dry_wet_type == null) {
+ this.$message.warning('请选择分类!')
+ return
+ }
this.modalData.closeDate = this.modalData.projectCloseDate
this.modalData.buildDate = this.modalData.projectCreationDate
eamProjectPartInfoEdit(this.modalData).then(({data}) => {
@@ -4829,6 +4861,7 @@ import {updateColumnSize} from "../../../api/table";
projectCreationDate: row.projectCreationDate,
status: '草稿',
partType: 'Active',
+ dry_wet_type: 'Dry',
remark: row.remark,
// active: row.active,
createBy: this.$store.state.user.name,
@@ -4942,6 +4975,7 @@ import {updateColumnSize} from "../../../api/table";
projectCreationDate: row.buildDate,
status: row.status,
partType: row.partType,
+ dry_wet_type: row.dry_wet_type || row.dryWetType || '',
remark: row.remark,
// active: row.active,
createBy: this.$store.state.user.name,
diff --git a/src/views/modules/eam/eamProjectPartInfo.vue b/src/views/modules/eam/eamProjectPartInfo.vue
index 49fc856..bb91af7 100644
--- a/src/views/modules/eam/eamProjectPartInfo.vue
+++ b/src/views/modules/eam/eamProjectPartInfo.vue
@@ -29,6 +29,16 @@
+
+
+
+
+
+
@@ -1848,6 +1858,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
projectDesc: '',
testPartNo: '',
partDesc: '',
+ dryWetType: '',
customerNo: '',
customerDesc: '',
buDesc: '',
@@ -1879,6 +1890,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
projectPartId: '',
testPartNo: '',
partDesc: '',
+ dryWetType: '',
customerNo: '',
customerDesc: '',
buDesc: '',
@@ -2672,6 +2684,24 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
fixed: '',
columnWidth: 100,
},
+ {
+ userId: this.$store.state.user.name,
+ functionId: 401004,
+ serialNumber: '401004Table1DryWetType',
+ tableId: "401004Table1",
+ tableName: "项目物料表",
+ columnProp: 'dryWetType',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '分类',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 80,
+ },
{
userId: this.$store.state.user.name,
functionId: 401004,
@@ -3837,6 +3867,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
status: '正式量产',
}
],
+ dryWetTypeList: ['Dry', 'Wet'],
userBuList: [],
menuId: this.$route.meta.menuId,
}
diff --git a/src/views/modules/sampleTracking/projectProofTracking.vue b/src/views/modules/sampleTracking/projectProofTracking.vue
index 4e60b1d..ccfc6f4 100644
--- a/src/views/modules/sampleTracking/projectProofTracking.vue
+++ b/src/views/modules/sampleTracking/projectProofTracking.vue
@@ -23,6 +23,11 @@
+
+
+
+
+
@@ -49,6 +54,7 @@
查询
重置
+ 导出
@@ -477,13 +483,20 @@
-
+
+
+
+
+
+
+
+
@@ -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 = ''