|
|
@ -30,8 +30,8 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item class="button-group-col"> |
|
|
<el-form-item class="button-group-col"> |
|
|
<el-row :gutter="8" type="flex" class="button-row" > |
|
|
<el-row :gutter="8" type="flex" class="button-row" > |
|
|
<el-button type="primary" @click="openOneKeyDialog">一键创建项目&物料</el-button> |
|
|
|
|
|
<el-button type="warning" plain @click="openOneKeyDialog('edit')">修改项目&物料</el-button> |
|
|
|
|
|
|
|
|
<el-button type="primary" @click="openOneKeyDialog">一键创建</el-button> |
|
|
|
|
|
<el-button type="warning" plain @click="openOneKeyDialog('edit')">一键修改</el-button> |
|
|
<el-button type="warning" @click="toggleBatchEdit">{{ batchEditMode ? '取消修改' : '批量修改' }}</el-button> |
|
|
<el-button type="warning" @click="toggleBatchEdit">{{ batchEditMode ? '取消修改' : '批量修改' }}</el-button> |
|
|
<el-button v-if="batchEditMode" type="success" @click="saveBatchPlan">保存修改</el-button> |
|
|
<el-button v-if="batchEditMode" type="success" @click="saveBatchPlan">保存修改</el-button> |
|
|
<el-button type="primary" @click="openCreateProofDialog()">新增打样</el-button> |
|
|
<el-button type="primary" @click="openCreateProofDialog()">新增打样</el-button> |
|
|
@ -185,7 +185,7 @@ |
|
|
}" |
|
|
}" |
|
|
>{{ processTooltip.content }}</div> |
|
|
>{{ processTooltip.content }}</div> |
|
|
|
|
|
|
|
|
<el-dialog :title="oneKeyDialogMode === 'edit' ? '修改项目/物料' : '一键创建项目/物料'" :visible.sync="oneKeyDialogVisible" :close-on-click-modal="false" width="1100px"> |
|
|
|
|
|
|
|
|
<el-dialog :title="oneKeyDialogMode === 'edit' ? '修改项目/物料/打样' : '一键创建项目/物料'" :visible.sync="oneKeyDialogVisible" :close-on-click-modal="false" width="1100px"> |
|
|
<el-form :model="oneKeyForm" label-position="top" class="one-key-grid-form"> |
|
|
<el-form :model="oneKeyForm" label-position="top" class="one-key-grid-form"> |
|
|
<el-row :gutter="16"> |
|
|
<el-row :gutter="16"> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
@ -401,7 +401,7 @@ |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="6" v-if="oneKeyDialogMode !== 'edit'"> |
|
|
|
|
|
|
|
|
<el-col :span="6"> |
|
|
<el-form-item label="项目阶段"> |
|
|
<el-form-item label="项目阶段"> |
|
|
<el-select v-model="oneKeyForm.projectPhase" clearable style="width: 100%"> |
|
|
<el-select v-model="oneKeyForm.projectPhase" clearable style="width: 100%"> |
|
|
<el-option v-for="item in projectPhaseList" :key="item" :label="item" :value="item" /> |
|
|
<el-option v-for="item in projectPhaseList" :key="item" :label="item" :value="item" /> |
|
|
@ -410,7 +410,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row :gutter="16" v-if="oneKeyDialogMode !== 'edit'"> |
|
|
|
|
|
|
|
|
<el-row :gutter="16"> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item label="打样单号"> |
|
|
<el-form-item label="打样单号"> |
|
|
<el-input v-model="oneKeyForm.proofingNo" style="width: 100%"></el-input> |
|
|
<el-input v-model="oneKeyForm.proofingNo" style="width: 100%"></el-input> |
|
|
@ -421,6 +421,8 @@ |
|
|
<el-select v-model="oneKeyForm.proofingStatus" clearable style="width: 100%"> |
|
|
<el-select v-model="oneKeyForm.proofingStatus" clearable style="width: 100%"> |
|
|
<el-option label="草稿" value="草稿" /> |
|
|
<el-option label="草稿" value="草稿" /> |
|
|
<el-option label="进行中" value="进行中" /> |
|
|
<el-option label="进行中" value="进行中" /> |
|
|
|
|
|
<el-option label="打样完成" value="打样完成" /> |
|
|
|
|
|
<el-option label="打样结束" value="打样结束" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
@ -442,7 +444,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-row :gutter="16" v-if="oneKeyDialogMode !== 'edit'"> |
|
|
|
|
|
|
|
|
<el-row :gutter="16"> |
|
|
<el-col :span="6"> |
|
|
<el-col :span="6"> |
|
|
<el-form-item label="预计交付日期"> |
|
|
<el-form-item label="预计交付日期"> |
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
@ -650,12 +652,9 @@ |
|
|
custom-class="finish-proof-dialog"> |
|
|
custom-class="finish-proof-dialog"> |
|
|
<div class="finish-dialog-tip"> |
|
|
<div class="finish-dialog-tip"> |
|
|
<i class="el-icon-info"></i> |
|
|
<i class="el-icon-info"></i> |
|
|
<span>确认后将直接标记为打样完成</span> |
|
|
|
|
|
|
|
|
<span>确认后将直接标记为<strong class="finish-tip-highlight">打样完成</strong></span> |
|
|
</div> |
|
|
</div> |
|
|
<el-form :model="finishForm" label-width="100px" class="finish-form"> |
|
|
<el-form :model="finishForm" label-width="100px" class="finish-form"> |
|
|
<el-form-item label="状态"> |
|
|
|
|
|
<el-tag type="success" effect="plain">打样完成</el-tag> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="实际完成日期" required> |
|
|
<el-form-item label="实际完成日期" required> |
|
|
<el-date-picker |
|
|
<el-date-picker |
|
|
v-model="finishForm.actualityDeliveryDate" |
|
|
v-model="finishForm.actualityDeliveryDate" |
|
|
@ -730,14 +729,13 @@ import { |
|
|
deleteProofTracking, |
|
|
deleteProofTracking, |
|
|
finishProofTracking, |
|
|
finishProofTracking, |
|
|
oneKeyCreateProofTracking, |
|
|
oneKeyCreateProofTracking, |
|
|
|
|
|
oneKeyUpdateProofTracking, |
|
|
queryProofTrackingProcessHistory, |
|
|
queryProofTrackingProcessHistory, |
|
|
searchProjectInfoTracking, |
|
|
searchProjectInfoTracking, |
|
|
searchProjectPartTracking, |
|
|
searchProjectPartTracking, |
|
|
searchProofTracking, |
|
|
searchProofTracking, |
|
|
syncProofTracking, |
|
|
syncProofTracking, |
|
|
syncProjectPartTracking, |
|
|
syncProjectPartTracking, |
|
|
updateProjectInfoTracking, |
|
|
|
|
|
updateProjectPartTracking, |
|
|
|
|
|
updateProofTrackingComments, |
|
|
updateProofTrackingComments, |
|
|
updateProofTrackingProcess |
|
|
updateProofTrackingProcess |
|
|
} from '@/api/sampleTracking/sampleTracking' |
|
|
} from '@/api/sampleTracking/sampleTracking' |
|
|
@ -1387,6 +1385,13 @@ export default { |
|
|
} |
|
|
} |
|
|
return row.projectPartId || row.project_part_id || null |
|
|
return row.projectPartId || row.project_part_id || null |
|
|
}, |
|
|
}, |
|
|
|
|
|
getProjectCategoryValue (source) { |
|
|
|
|
|
if (!source) { |
|
|
|
|
|
return '' |
|
|
|
|
|
} |
|
|
|
|
|
const category = source.cProjectTypeDb || source.projectCategory || source.project_category || source.c_project_type_db || '' |
|
|
|
|
|
return this.isBlankValue(category) ? '' : String(category).trim() |
|
|
|
|
|
}, |
|
|
isBlankValue (value) { |
|
|
isBlankValue (value) { |
|
|
return value == null || String(value).trim() === '' |
|
|
return value == null || String(value).trim() === '' |
|
|
}, |
|
|
}, |
|
|
@ -1444,8 +1449,8 @@ export default { |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.oneKeyDialogMode === 'edit') { |
|
|
if (this.oneKeyDialogMode === 'edit') { |
|
|
if (!inData.projectId || !inData.projectPartId) { |
|
|
|
|
|
this.$message.error('项目ID或项目物料ID缺失,无法修改') |
|
|
|
|
|
|
|
|
if (!inData.projectId || !inData.projectPartId || !inData.trackingId) { |
|
|
|
|
|
this.$message.error('项目/物料/打样记录ID缺失,无法修改') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
if (this.isBlankValue(inData.projectNo)) { |
|
|
if (this.isBlankValue(inData.projectNo)) { |
|
|
@ -1464,79 +1469,13 @@ export default { |
|
|
this.$message.error('料号描述不能为空') |
|
|
this.$message.error('料号描述不能为空') |
|
|
return false |
|
|
return false |
|
|
} |
|
|
} |
|
|
|
|
|
if (!this.isBlankValue(inData.proofingNumber) && !/^[1-9]\d*$/.test(String(inData.proofingNumber))) { |
|
|
|
|
|
this.$message.error('打样数量必须是正整数') |
|
|
|
|
|
return false |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
return true |
|
|
return true |
|
|
}, |
|
|
}, |
|
|
buildProjectInfoUpdatePayload (inData) { |
|
|
|
|
|
return { |
|
|
|
|
|
projectId: inData.projectId, |
|
|
|
|
|
site: inData.site, |
|
|
|
|
|
buNo: inData.buNo, |
|
|
|
|
|
projectNo: inData.projectNo, |
|
|
|
|
|
projectCategory: inData.projectCategory, |
|
|
|
|
|
projectName: inData.projectName, |
|
|
|
|
|
projectDesc: inData.projectDesc, |
|
|
|
|
|
status: inData.projectStatus || '草稿', |
|
|
|
|
|
projectSource: inData.projectSource, |
|
|
|
|
|
customerNo: inData.customerNo, |
|
|
|
|
|
finalCustomerId: inData.finalCustomerId, |
|
|
|
|
|
priority: inData.priorityLevel, |
|
|
|
|
|
remark: inData.remark, |
|
|
|
|
|
needDate: inData.needDate, |
|
|
|
|
|
cProjectRegion: inData.cProjectRegion, |
|
|
|
|
|
projectManager: inData.projectManager, |
|
|
|
|
|
projectOwner: inData.projectOwner, |
|
|
|
|
|
engineer: inData.engineer, |
|
|
|
|
|
cQualityEngineer1: inData.cQualityEngineer1, |
|
|
|
|
|
cQualityEngineer2: inData.cQualityEngineer2, |
|
|
|
|
|
cQualityEngineer3: inData.cQualityEngineer3, |
|
|
|
|
|
cQualityEngineer4: inData.cQualityEngineer4, |
|
|
|
|
|
cQualityEngineer5: inData.cQualityEngineer5, |
|
|
|
|
|
cQualityEngineer6: inData.cQualityEngineer6, |
|
|
|
|
|
cManufactureEngineer: inData.cManufactureEngineer, |
|
|
|
|
|
docEngineer: inData.docEngineer, |
|
|
|
|
|
docEngineer2: inData.docEngineer2, |
|
|
|
|
|
ipqcHardTag: inData.ipqcHardTag, |
|
|
|
|
|
cQualityEngineer7: inData.cQualityEngineer7, |
|
|
|
|
|
projectCreationDate: inData.projectCreationDate, |
|
|
|
|
|
projectCloseDate: inData.projectCloseDate, |
|
|
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
buildProjectPartUpdatePayload (inData) { |
|
|
|
|
|
return { |
|
|
|
|
|
projectPartId: inData.projectPartId, |
|
|
|
|
|
site: inData.site, |
|
|
|
|
|
projectId: inData.projectId, |
|
|
|
|
|
testPartNo: inData.testPartNo, |
|
|
|
|
|
partDesc: inData.partDesc, |
|
|
|
|
|
finalPartNo: inData.finalPartNo, |
|
|
|
|
|
projectManager: inData.projectManager, |
|
|
|
|
|
projectOwner: inData.projectOwner, |
|
|
|
|
|
buildDate: inData.buildDate, |
|
|
|
|
|
cQualityEngineer1: inData.cQualityEngineer1, |
|
|
|
|
|
cQualityEngineer2: inData.cQualityEngineer2, |
|
|
|
|
|
cQualityEngineer3: inData.cQualityEngineer3, |
|
|
|
|
|
cQualityEngineer4: inData.cQualityEngineer4, |
|
|
|
|
|
cQualityEngineer5: inData.cQualityEngineer5, |
|
|
|
|
|
cQualityEngineer6: inData.cQualityEngineer6, |
|
|
|
|
|
cManufactureEngineer: inData.cManufactureEngineer, |
|
|
|
|
|
docEngineer: inData.docEngineer, |
|
|
|
|
|
docEngineer2: inData.docEngineer2, |
|
|
|
|
|
engineer: inData.engineer, |
|
|
|
|
|
ipqcHardTag: inData.ipqcHardTag, |
|
|
|
|
|
cQualityEngineer7: inData.cQualityEngineer7, |
|
|
|
|
|
status: inData.partStatus || '草稿', |
|
|
|
|
|
partType: inData.partType, |
|
|
|
|
|
priority: inData.priorityLevel, |
|
|
|
|
|
projectCategory: inData.projectCategory, |
|
|
|
|
|
needDate: inData.needDate, |
|
|
|
|
|
customerNo: inData.customerNo, |
|
|
|
|
|
remark: inData.remark, |
|
|
|
|
|
closeDate: inData.closeDate, |
|
|
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
buildOneKeyEditForm (current, projectData, partData) { |
|
|
buildOneKeyEditForm (current, projectData, partData) { |
|
|
const project = projectData || {} |
|
|
const project = projectData || {} |
|
|
const part = partData || {} |
|
|
const part = partData || {} |
|
|
@ -1629,13 +1568,13 @@ export default { |
|
|
} |
|
|
} |
|
|
const current = this.getActionRow() |
|
|
const current = this.getActionRow() |
|
|
if (!current) { |
|
|
if (!current) { |
|
|
this.$message.warning('请先选择一条记录后再修改项目/物料') |
|
|
|
|
|
|
|
|
this.$message.warning('请先选择一条记录后再修改项目/物料/打样') |
|
|
this.oneKeyDialogMode = 'create' |
|
|
this.oneKeyDialogMode = 'create' |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const projectPartId = this.getTrackingProjectPartId(current) |
|
|
const projectPartId = this.getTrackingProjectPartId(current) |
|
|
if (!current.projectId || !projectPartId || !current.trackingId) { |
|
|
if (!current.projectId || !projectPartId || !current.trackingId) { |
|
|
this.$message.warning('当前记录缺少项目或物料信息,无法修改') |
|
|
|
|
|
|
|
|
this.$message.warning('当前记录缺少项目/物料/打样关键信息,无法修改') |
|
|
this.oneKeyDialogMode = 'create' |
|
|
this.oneKeyDialogMode = 'create' |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
@ -1677,7 +1616,7 @@ export default { |
|
|
this.oneKeyForm = this.buildOneKeyEditForm(current, projectRows[0], partRows[0]) |
|
|
this.oneKeyForm = this.buildOneKeyEditForm(current, projectRows[0], partRows[0]) |
|
|
this.oneKeyDialogVisible = true |
|
|
this.oneKeyDialogVisible = true |
|
|
}).catch((e) => { |
|
|
}).catch((e) => { |
|
|
this.$message.error((e && e.message) || '加载项目/物料信息异常') |
|
|
|
|
|
|
|
|
this.$message.error((e && e.message) || '加载项目/物料/打样信息异常') |
|
|
this.oneKeyDialogMode = 'create' |
|
|
this.oneKeyDialogMode = 'create' |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
this.saveOneKeyLoading = false |
|
|
this.saveOneKeyLoading = false |
|
|
@ -1690,22 +1629,15 @@ export default { |
|
|
} |
|
|
} |
|
|
this.saveOneKeyLoading = true |
|
|
this.saveOneKeyLoading = true |
|
|
if (this.oneKeyDialogMode === 'edit') { |
|
|
if (this.oneKeyDialogMode === 'edit') { |
|
|
const projectPayload = this.buildProjectInfoUpdatePayload(inData) |
|
|
|
|
|
const partPayload = this.buildProjectPartUpdatePayload(inData) |
|
|
|
|
|
updateProjectInfoTracking(projectPayload).then(({ data }) => { |
|
|
|
|
|
|
|
|
oneKeyUpdateProofTracking(inData).then(({ data }) => { |
|
|
if (!data || data.code !== 0) { |
|
|
if (!data || data.code !== 0) { |
|
|
throw new Error((data && data.msg) || '修改项目信息失败') |
|
|
|
|
|
|
|
|
throw new Error((data && data.msg) || '修改项目/物料/打样失败') |
|
|
} |
|
|
} |
|
|
return updateProjectPartTracking(partPayload) |
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
if (!data || data.code !== 0) { |
|
|
|
|
|
throw new Error((data && data.msg) || '修改项目物料失败') |
|
|
|
|
|
} |
|
|
|
|
|
this.$message.success('项目/物料修改成功') |
|
|
|
|
|
|
|
|
this.$message.success('项目/物料/打样修改成功') |
|
|
this.oneKeyDialogVisible = false |
|
|
this.oneKeyDialogVisible = false |
|
|
this.getDataList() |
|
|
this.getDataList() |
|
|
}).catch((e) => { |
|
|
}).catch((e) => { |
|
|
this.$message.error((e && e.message) || '项目/物料修改异常') |
|
|
|
|
|
|
|
|
this.$message.error((e && e.message) || '项目/物料/打样修改异常') |
|
|
}).finally(() => { |
|
|
}).finally(() => { |
|
|
this.saveOneKeyLoading = false |
|
|
this.saveOneKeyLoading = false |
|
|
}) |
|
|
}) |
|
|
@ -1739,6 +1671,8 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.currentRow = current |
|
|
this.currentRow = current |
|
|
|
|
|
const projectPartId = this.getTrackingProjectPartId(current) || current.id |
|
|
|
|
|
const projectCategory = this.getProjectCategoryValue(current) |
|
|
this.proofDialogData = Object.assign(this.getDefaultProofDialogData(), { |
|
|
this.proofDialogData = Object.assign(this.getDefaultProofDialogData(), { |
|
|
trackingId: null, |
|
|
trackingId: null, |
|
|
site: current.site || this.$store.state.user.site, |
|
|
site: current.site || this.$store.state.user.site, |
|
|
@ -1748,11 +1682,11 @@ export default { |
|
|
buNo: current.buNo, |
|
|
buNo: current.buNo, |
|
|
customerNo: current.customerNo, |
|
|
customerNo: current.customerNo, |
|
|
customerDesc: current.customerDesc, |
|
|
customerDesc: current.customerDesc, |
|
|
projectPartId: current.projectPartId || current.id, |
|
|
|
|
|
|
|
|
projectPartId: projectPartId, |
|
|
testPartNo: current.testPartNo, |
|
|
testPartNo: current.testPartNo, |
|
|
partDesc: current.partDesc, |
|
|
partDesc: current.partDesc, |
|
|
projectCategory: current.projectCategory, |
|
|
|
|
|
cProjectTypeDb: current.projectCategory, |
|
|
|
|
|
|
|
|
projectCategory: projectCategory, |
|
|
|
|
|
cProjectTypeDb: projectCategory, |
|
|
projectManager: current.projectManager, |
|
|
projectManager: current.projectManager, |
|
|
projectOwner: current.projectOwner, |
|
|
projectOwner: current.projectOwner, |
|
|
engineer: current.engineer, |
|
|
engineer: current.engineer, |
|
|
@ -1767,6 +1701,9 @@ export default { |
|
|
createBy: this.$store.state.user.name, |
|
|
createBy: this.$store.state.user.name, |
|
|
updateBy: this.$store.state.user.name |
|
|
updateBy: this.$store.state.user.name |
|
|
}) |
|
|
}) |
|
|
|
|
|
if (this.isBlankValue(projectCategory)) { |
|
|
|
|
|
this.$message.warning('未获取到项目分类,请手动选择') |
|
|
|
|
|
} |
|
|
this.proofDialogVisible = true |
|
|
this.proofDialogVisible = true |
|
|
}, |
|
|
}, |
|
|
validateSyncToNpiRow (row) { |
|
|
validateSyncToNpiRow (row) { |
|
|
@ -2607,6 +2544,12 @@ export default { |
|
|
color: #409eff; |
|
|
color: #409eff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.finish-tip-highlight { |
|
|
|
|
|
font-size: 13px; |
|
|
|
|
|
font-weight: 700; |
|
|
|
|
|
color: #1f2d3d; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.finish-proof-dialog .el-dialog__body { |
|
|
.finish-proof-dialog .el-dialog__body { |
|
|
padding-bottom: 8px; |
|
|
padding-bottom: 8px; |
|
|
} |
|
|
} |
|
|
|