|
|
|
@ -44,6 +44,7 @@ |
|
|
|
@click="openBuProcessConfigDialog" |
|
|
|
>事业部进度设置</el-button> |
|
|
|
<el-button type="info" v-if="isAuth('833001005:set2')" plain @click="openDefaultProcessConfigDialog">默认进度设置</el-button> |
|
|
|
<el-button type="danger" plain :loading="deleteProofLoading" @click="deleteSelectedProofs">删除</el-button> |
|
|
|
<el-tooltip |
|
|
|
style="margin-top: 3px; margin-left: 10px" |
|
|
|
placement="top"> |
|
|
|
@ -203,6 +204,9 @@ |
|
|
|
<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-form-item> |
|
|
|
</el-form> |
|
|
|
@ -258,10 +262,10 @@ |
|
|
|
>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</a> |
|
|
|
<span v-else>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</span> |
|
|
|
</span> |
|
|
|
<a |
|
|
|
<span |
|
|
|
v-else-if="item.columnProp === 'proofingStatus'" |
|
|
|
:style="{ color: (scope.row.proofingStatus === '打样完成') ? '#67c23a' : '#046e97' }" |
|
|
|
>{{ scope.row.proofingStatus || '进行中' }}</a> |
|
|
|
:style="{ color: getProofingStatusColor(scope.row) }" |
|
|
|
>{{ scope.row.proofingStatus || '进行中' }}</span> |
|
|
|
<div |
|
|
|
v-else-if="item.columnProp === 'trackingStatus'" |
|
|
|
:class="getTrackingStatusClass(scope.row)" |
|
|
|
@ -394,8 +398,6 @@ |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a @click="openOneKeyDialog('edit', scope.row)" v-if="scope.row.proofingStatus !== '打样完成'">修改</a> |
|
|
|
<a class="action-link detail-link" @click="openOneKeyDialog('detail', scope.row)" v-if="scope.row.proofingNo && scope.row.proofingStatus === '打样完成'">详情</a> |
|
|
|
<a class="action-link delete-link" v-if="scope.row.proofingStatus === '草稿'" @click="deleteProof(scope.row)">删除</a> |
|
|
|
<!-- <a class="action-link end-link" v-if="scope.row.proofingNo && scope.row.proofingStatus === '进行中'" @click="finishProof(scope.row)">打样完成</a>--> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
@ -902,12 +904,22 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('proofingStatus')"> |
|
|
|
<el-form-item label="打样状态"> |
|
|
|
<el-select disabled v-model="oneKeyForm.proofingStatus" clearable style="width: 100%"> |
|
|
|
<el-option label="草稿" value="草稿" /> |
|
|
|
<el-option label="进行中" value="进行中" /> |
|
|
|
<el-option label="打样完成" value="打样完成" /> |
|
|
|
<!-- 新建固定草稿;修改只允许改成终止/取消/报废,选项按打开弹窗时的原状态生成,避免选中后丢掉“保持原状态”。 --> |
|
|
|
<el-select |
|
|
|
v-model="oneKeyForm.proofingStatus" |
|
|
|
:disabled="oneKeyDialogMode === 'create'" |
|
|
|
placeholder="请选择" |
|
|
|
style="width: 100%" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in oneKeyProofingStatusOptions" |
|
|
|
:key="`oneKeyProofingStatus_${item}`" |
|
|
|
:label="item" |
|
|
|
:value="item" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<div v-if="oneKeyDialogMode !== 'create'" class="proofing-status-change-tip">仅可更改为终止、取消、报废,保存后同步到NPI</div> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('requiredDeliveryDate')"> |
|
|
|
<el-form-item label="预计完成日期"> |
|
|
|
@ -1248,7 +1260,7 @@ |
|
|
|
<script> |
|
|
|
import { |
|
|
|
createProofTrackingRecord, |
|
|
|
deleteProofTracking, |
|
|
|
deleteProofTrackingBatch, |
|
|
|
exportProofTracking, |
|
|
|
finishProofTracking, |
|
|
|
oneKeyCreateProofTracking, |
|
|
|
@ -1858,6 +1870,10 @@ export default { |
|
|
|
exportLoading: false, |
|
|
|
syncBatchNpiLoading: false, |
|
|
|
syncBatchProofLoading: false, |
|
|
|
deleteProofLoading: false, |
|
|
|
proofingStatusChangeOptions: ['终止', '取消', '报废'], |
|
|
|
deletableProofingStatuses: ['草稿', '终止', '取消', '报废'], |
|
|
|
oneKeyOriginalProofingStatus: '', |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 50, |
|
|
|
totalPage: 0, |
|
|
|
@ -2016,6 +2032,25 @@ export default { |
|
|
|
return null |
|
|
|
} |
|
|
|
return this.proofDialogApplyOptions.find(item => item && item.applyNo === selectedApplyNo) || null |
|
|
|
}, |
|
|
|
oneKeyProofingStatusOptions () { |
|
|
|
if (this.oneKeyDialogMode === 'create') { |
|
|
|
return ['草稿', '进行中', '打样完成'] |
|
|
|
} |
|
|
|
// 选项锚定打开弹窗时的原状态,避免选中终止后“进行中”从下拉里消失,用户无法在保存前改回。 |
|
|
|
const currentStatus = this.oneKeyOriginalProofingStatus |
|
|
|
? String(this.oneKeyOriginalProofingStatus).trim() |
|
|
|
: '' |
|
|
|
const options = [] |
|
|
|
if (currentStatus && this.proofingStatusChangeOptions.indexOf(currentStatus) === -1) { |
|
|
|
options.push(currentStatus) |
|
|
|
} |
|
|
|
this.proofingStatusChangeOptions.forEach(item => { |
|
|
|
if (options.indexOf(item) === -1) { |
|
|
|
options.push(item) |
|
|
|
} |
|
|
|
}) |
|
|
|
return options |
|
|
|
} |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
@ -5709,6 +5744,7 @@ export default { |
|
|
|
this.oneKeyPartNoSnapshot = '' |
|
|
|
this.oneKeyProjectRoleBaseline = {} |
|
|
|
this.oneKeyForm = this.getEmptyOneKeyForm() |
|
|
|
this.oneKeyOriginalProofingStatus = this.getNormalizedProofingStatus(this.oneKeyForm) |
|
|
|
const selectedSearchBuNo = this.getSelectedSearchBuNo() |
|
|
|
if (selectedSearchBuNo) { |
|
|
|
// 一键创建默认沿用查询区 BU,避免用户重复选择。 |
|
|
|
@ -5768,6 +5804,7 @@ export default { |
|
|
|
throw new Error(`未找到对应的项目物料信息,无法${actionText}`) |
|
|
|
} |
|
|
|
this.oneKeyForm = this.buildOneKeyEditForm(current, projectRows[0], partRows[0]) |
|
|
|
this.oneKeyOriginalProofingStatus = this.getNormalizedProofingStatus(this.oneKeyForm) |
|
|
|
this.snapshotOneKeyProjectRoles(projectRows[0]) |
|
|
|
this.oneKeyProjectNoSnapshot = this.normalizeProjectNo(this.oneKeyForm.projectNo) |
|
|
|
this.oneKeyPartNoSnapshot = this.isBlankValue(this.oneKeyForm.testPartNo) ? '' : String(this.oneKeyForm.testPartNo).trim() |
|
|
|
@ -5794,9 +5831,36 @@ export default { |
|
|
|
return |
|
|
|
} |
|
|
|
this.saveOneKeyLoading = true |
|
|
|
// 详情入口对应已完成记录;即使表单中的状态被修改,也必须先确认。 |
|
|
|
if (this.oneKeyDialogMode === 'detail' || |
|
|
|
(this.oneKeyDialogMode === 'edit' && this.isProofingFinishedForTrackingStatus(this.oneKeyForm))) { |
|
|
|
const previousStatus = this.oneKeyOriginalProofingStatus |
|
|
|
? String(this.oneKeyOriginalProofingStatus).trim() |
|
|
|
: '' |
|
|
|
const nextStatus = inData.proofingStatus ? String(inData.proofingStatus).trim() : '' |
|
|
|
const proofingStatusChanged = this.oneKeyDialogMode !== 'create' && nextStatus !== previousStatus |
|
|
|
if (proofingStatusChanged && this.proofingStatusChangeOptions.indexOf(nextStatus) === -1) { |
|
|
|
this.saveOneKeyLoading = false |
|
|
|
this.$message.warning('打样状态只能更改为终止、取消、报废') |
|
|
|
return |
|
|
|
} |
|
|
|
if (proofingStatusChanged) { |
|
|
|
try { |
|
|
|
await this.$confirm( |
|
|
|
`确认将打样状态从「${previousStatus || '-'}」更改为「${nextStatus}」并同步到NPI吗?`, |
|
|
|
'提示', |
|
|
|
{ |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
} |
|
|
|
) |
|
|
|
} catch (e) { |
|
|
|
this.saveOneKeyLoading = false |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
// 详情或已完成记录改其他字段时仍要确认;本次若已确认过状态变更,不再重复弹窗。 |
|
|
|
const originalFinished = this.isProofingFinishedForTrackingStatus({ proofingStatus: previousStatus }) |
|
|
|
if (!proofingStatusChanged && (this.oneKeyDialogMode === 'detail' || |
|
|
|
(this.oneKeyDialogMode === 'edit' && originalFinished))) { |
|
|
|
try { |
|
|
|
await this.$confirm('打样已完成,是否确定修改?', '提示', { |
|
|
|
confirmButtonText: '确定修改', |
|
|
|
@ -5813,11 +5877,11 @@ export default { |
|
|
|
if (!data || data.code !== 0) { |
|
|
|
throw new Error((data && data.msg) || '修改项目/物料/打样失败') |
|
|
|
} |
|
|
|
this.$message.success('项目/物料/打样修改成功') |
|
|
|
this.$message.success(proofingStatusChanged ? '项目/物料/打样修改成功,打样状态已同步到NPI' : '项目/物料/打样修改成功') |
|
|
|
this.oneKeyDialogVisible = false |
|
|
|
this.getDataList() |
|
|
|
}).catch((e) => { |
|
|
|
this.$message.error((e && e.message) || '项目/物料/打样修改异常') |
|
|
|
this.showTrackingActionError((e && e.message) || '项目/物料/打样修改异常', '修改未完成') |
|
|
|
}).finally(() => { |
|
|
|
this.saveOneKeyLoading = false |
|
|
|
}) |
|
|
|
@ -6399,19 +6463,105 @@ export default { |
|
|
|
} |
|
|
|
this.finishDialogVisible = true |
|
|
|
}, |
|
|
|
deleteProof (row) { |
|
|
|
const current = row || this.currentRow |
|
|
|
if (!current || !current.trackingId) { |
|
|
|
this.$message.warning('请先选择记录') |
|
|
|
getNormalizedProofingStatus (row) { |
|
|
|
if (!row || this.isBlankValue(row.proofingStatus)) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
return String(row.proofingStatus).trim() |
|
|
|
}, |
|
|
|
getProofingStatusColor (row) { |
|
|
|
const proofingStatus = this.getNormalizedProofingStatus(row) |
|
|
|
if (proofingStatus === '打样完成') { |
|
|
|
return '#67c23a' |
|
|
|
} |
|
|
|
// 终止/取消/报废不再按进行中的蓝色展示,避免看起来还能继续推进。 |
|
|
|
if (this.proofingStatusChangeOptions.indexOf(proofingStatus) > -1) { |
|
|
|
return '#909399' |
|
|
|
} |
|
|
|
return '#046e97' |
|
|
|
}, |
|
|
|
isProofingClosedStatus (row) { |
|
|
|
return this.proofingStatusChangeOptions.indexOf(this.getNormalizedProofingStatus(row)) > -1 |
|
|
|
}, |
|
|
|
canDeleteProofStatus (row) { |
|
|
|
return this.deletableProofingStatuses.indexOf(this.getNormalizedProofingStatus(row)) > -1 |
|
|
|
}, |
|
|
|
getProofDeleteRowLabel (row) { |
|
|
|
const proofingNo = row && !this.isBlankValue(row.proofingNo) ? String(row.proofingNo).trim() : '' |
|
|
|
if (proofingNo) { |
|
|
|
return proofingNo |
|
|
|
} |
|
|
|
if (row && row.trackingId) { |
|
|
|
return `ID:${row.trackingId}` |
|
|
|
} |
|
|
|
return '-' |
|
|
|
}, |
|
|
|
showTrackingActionError (message, title) { |
|
|
|
const failMsg = message || '操作失败' |
|
|
|
if (failMsg.indexOf('请先同步') > -1 || failMsg.indexOf('缺少') > -1 || failMsg.length > 80) { |
|
|
|
this.$alert(failMsg, title || '操作未完成', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm('确定删除该打样记录吗?该操作仅删除打样记录,不会删除项目和项目物料。', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
deleteProofTracking({ |
|
|
|
trackingId: current.trackingId, |
|
|
|
this.$message.error(failMsg) |
|
|
|
}, |
|
|
|
deleteSelectedProofs () { |
|
|
|
if (this.deleteProofLoading) { |
|
|
|
return |
|
|
|
} |
|
|
|
const selectedRows = Array.isArray(this.selectionRows) ? this.selectionRows : [] |
|
|
|
if (selectedRows.length === 0) { |
|
|
|
this.$message.warning('请先勾选要删除的打样记录') |
|
|
|
return |
|
|
|
} |
|
|
|
const invalidRows = [] |
|
|
|
const trackingIdMap = {} |
|
|
|
const trackingIds = [] |
|
|
|
selectedRows.forEach(row => { |
|
|
|
if (!this.canDeleteProofStatus(row)) { |
|
|
|
invalidRows.push(row) |
|
|
|
return |
|
|
|
} |
|
|
|
if (!row || !row.trackingId || trackingIdMap[row.trackingId]) { |
|
|
|
return |
|
|
|
} |
|
|
|
trackingIdMap[row.trackingId] = true |
|
|
|
trackingIds.push(row.trackingId) |
|
|
|
}) |
|
|
|
if (invalidRows.length > 0) { |
|
|
|
const preview = invalidRows.slice(0, 8).map(row => { |
|
|
|
const statusText = this.getNormalizedProofingStatus(row) || '空' |
|
|
|
return `${this.getProofDeleteRowLabel(row)}(${statusText})` |
|
|
|
}).join('、') |
|
|
|
const moreText = invalidRows.length > 8 ? `等${invalidRows.length}条` : '' |
|
|
|
this.$alert( |
|
|
|
`仅草稿、终止、取消、报废状态可以删除。<br/>不允许删除:${preview}${moreText}`, |
|
|
|
'无法删除', |
|
|
|
{ |
|
|
|
confirmButtonText: '确定', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
} |
|
|
|
) |
|
|
|
return |
|
|
|
} |
|
|
|
if (trackingIds.length === 0) { |
|
|
|
this.$message.warning('勾选记录缺少打样跟踪ID,无法删除') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$confirm( |
|
|
|
`确认删除选中的 ${trackingIds.length} 条打样记录吗?<br/>删除后不可恢复,且不会删除项目和项目物料。`, |
|
|
|
'提示', |
|
|
|
{ |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning', |
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
} |
|
|
|
).then(() => { |
|
|
|
this.deleteProofLoading = true |
|
|
|
deleteProofTrackingBatch({ |
|
|
|
trackingIds: trackingIds, |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -6419,11 +6569,13 @@ export default { |
|
|
|
this.processHistoryMap = {} |
|
|
|
this.resetProcessTooltip() |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error((data && data.msg) || '删除打样记录失败') |
|
|
|
return |
|
|
|
} |
|
|
|
this.$message.error((data && data.msg) || '删除打样记录失败') |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('删除打样记录异常') |
|
|
|
}).finally(() => { |
|
|
|
this.deleteProofLoading = false |
|
|
|
}) |
|
|
|
}).catch(() => {}) |
|
|
|
}, |
|
|
|
@ -6781,10 +6933,13 @@ export default { |
|
|
|
return proofingStatus === '打样完成' |
|
|
|
}, |
|
|
|
isTrackingRowProcessReadonly (row) { |
|
|
|
// Complete 行不再允许维护工序日期与状态,统一改为只读文本展示。 |
|
|
|
return this.isProofingFinishedForTrackingStatus(row) |
|
|
|
// 打样完成,以及终止/取消/报废,都不再允许改工序,避免关闭后仍推进进度。 |
|
|
|
return this.isProofingFinishedForTrackingStatus(row) || this.isProofingClosedStatus(row) |
|
|
|
}, |
|
|
|
getTrackingStatusText (row) { |
|
|
|
if (this.isProofingClosedStatus(row)) { |
|
|
|
return this.getNormalizedProofingStatus(row) |
|
|
|
} |
|
|
|
const statusType = this.getTrackingStatusType(row) |
|
|
|
if (statusType === 'trialPrepare') { |
|
|
|
return 'Trial prepare' |
|
|
|
@ -6799,6 +6954,9 @@ export default { |
|
|
|
return `${statusPrefix}-${this.getFirstPendingProcessLabel(row)}` |
|
|
|
}, |
|
|
|
getTrackingStatusClass (row) { |
|
|
|
if (this.isProofingClosedStatus(row)) { |
|
|
|
return 'tracking-status tracking-status--complete' |
|
|
|
} |
|
|
|
const statusType = this.getTrackingStatusType(row) |
|
|
|
if (statusType === 'trialPrepare') { |
|
|
|
return 'tracking-status tracking-status--delay' |
|
|
|
@ -7294,6 +7452,13 @@ export default { |
|
|
|
cursor: pointer; |
|
|
|
} |
|
|
|
|
|
|
|
.proofing-status-change-tip { |
|
|
|
margin-top: 2px; |
|
|
|
color: #909399; |
|
|
|
font-size: 12px; |
|
|
|
line-height: 16px; |
|
|
|
} |
|
|
|
|
|
|
|
.npi-jump-link:hover { |
|
|
|
text-decoration: underline; |
|
|
|
} |
|
|
|
@ -7555,10 +7720,6 @@ export default { |
|
|
|
color: #e6a23c; |
|
|
|
} |
|
|
|
|
|
|
|
.delete-link { |
|
|
|
color: #f56c6c; |
|
|
|
} |
|
|
|
|
|
|
|
.end-link { |
|
|
|
color: #a303ff; |
|
|
|
} |
|
|
|
|