|
|
|
@ -59,8 +59,6 @@ |
|
|
|
<el-form-item class="button-group-col"> |
|
|
|
<el-row :gutter="8" type="flex" class="button-row" > |
|
|
|
<el-button type="primary" @click="openOneKeyDialog">一键创建</el-button> |
|
|
|
<!-- <el-button type="warning" @click="toggleBatchEdit">{{ batchEditMode ? '取消修改' : '批量修改' }}</el-button> |
|
|
|
<el-button v-if="batchEditMode" type="success" @click="saveBatchPlan">保存修改</el-button>--> |
|
|
|
<el-button type="warning" @click="openCreateProofDialog()">新增打样</el-button> |
|
|
|
<el-button type="success" plain :loading="syncBatchNpiLoading" @click="syncBatchProjectPartToNpi()">同步项目物料到NPI</el-button> |
|
|
|
<el-button type="success" plain :loading="syncBatchProofLoading" @click="syncBatchProofToNpi()">同步打样到NPI</el-button> |
|
|
|
@ -73,9 +71,13 @@ |
|
|
|
@click="openBuProcessConfigDialog" |
|
|
|
>事业部进度设置</el-button> |
|
|
|
<el-button type="info" v-if="isAuth('833001005:set2')" plain @click="openDefaultProcessConfigDialog">默认进度设置</el-button> |
|
|
|
<el-tooltip style="margin-top: 2px;margin-left: 10px" |
|
|
|
content="已完成后,双击日期选择框可回退为未完成" |
|
|
|
<el-tooltip |
|
|
|
style="margin-top: 3px; margin-left: 10px" |
|
|
|
placement="top"> |
|
|
|
<template slot="content"> |
|
|
|
<div>- 已完成后,双击日期选择框可回退为未完成</div> |
|
|
|
<div>- 双击Comments可编辑,回车或点击✓保存</div> |
|
|
|
</template> |
|
|
|
<i class="el-icon-question default-process-tip-icon"></i> |
|
|
|
</el-tooltip> |
|
|
|
</el-row> |
|
|
|
@ -94,7 +96,7 @@ |
|
|
|
@row-click="rowClick" |
|
|
|
style="width: 100%; margin-top: 8px" |
|
|
|
> |
|
|
|
<el-table-column type="selection" width="45" /> |
|
|
|
<el-table-column type="selection" width="25" /> |
|
|
|
<el-table-column |
|
|
|
v-for="(item, trackingColumnIndex) in visibleTrackingColumns" |
|
|
|
:key="`${item.columnProp}_${trackingColumnIndex}`" |
|
|
|
@ -108,16 +110,19 @@ |
|
|
|
> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span |
|
|
|
v-if="isProjectPartSyncColumn(item.columnProp)" |
|
|
|
:class="getProjectPartSyncTextClass(scope.row)" |
|
|
|
>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</span> |
|
|
|
<span |
|
|
|
v-else-if="item.columnProp === 'proofingNo'" |
|
|
|
:class="getProofSyncTextClass(scope.row)" |
|
|
|
>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</span> |
|
|
|
v-if="isSyncIconTrackingColumn(item.columnProp)" |
|
|
|
class="project-part-sync-text" |
|
|
|
> |
|
|
|
<i |
|
|
|
v-if="isTrackingColumnSynced(scope.row, item.columnProp)" |
|
|
|
class="el-icon-success project-part-sync-icon" |
|
|
|
aria-hidden="true" |
|
|
|
></i> |
|
|
|
{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }} |
|
|
|
</span> |
|
|
|
<a |
|
|
|
v-else-if="item.columnProp === 'proofingStatus'" |
|
|
|
:style="{ color: (scope.row.proofingStatus === '打样完成' || scope.row.proofingStatus === '打样结束') ? '#67c23a' : '#046e97' }" |
|
|
|
:style="{ color: (scope.row.proofingStatus === '打样完成') ? '#67c23a' : '#046e97' }" |
|
|
|
>{{ scope.row.proofingStatus || '进行中' }}</a> |
|
|
|
<div |
|
|
|
v-else-if="item.columnProp === 'trackingStatus'" |
|
|
|
@ -153,41 +158,36 @@ |
|
|
|
v-if="isProcessColumnVisibleForRow(scope.row, item)" |
|
|
|
:class="['process-cell', isProcessStatusComplete(scope.row, item) ? 'is-complete' : '']" |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-if="batchEditMode" |
|
|
|
v-model="scope.row[item.actualField]" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
placeholder="实际完成日期" |
|
|
|
style="width: 120px" |
|
|
|
/> |
|
|
|
<div |
|
|
|
v-else |
|
|
|
:class="['process-content', isProcessStatusComplete(scope.row, item) ? 'is-complete' : '']" |
|
|
|
@mouseenter="handleProcessTooltipMouseEnter(scope.row, item, $event)" |
|
|
|
@mousemove="handleProcessTooltipMouseMove($event)" |
|
|
|
@mouseleave="handleProcessTooltipMouseLeave" |
|
|
|
> |
|
|
|
<el-date-picker |
|
|
|
v-model="scope.row[item.actualField]" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
placeholder="" |
|
|
|
style="width: 122px" |
|
|
|
@change="handleProcessDateChange(scope.row, item, $event)" |
|
|
|
@dblclick.native.stop="handleProcessDateDoubleClick(scope.row, item)" |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
v-if="!isProcessStatusComplete(scope.row, item)" |
|
|
|
class="process-complete-btn" |
|
|
|
type="success" |
|
|
|
size="mini" |
|
|
|
plain |
|
|
|
title="标记为已完成" |
|
|
|
@click.stop="markProcessComplete(scope.row, item)" |
|
|
|
>✓</el-button> |
|
|
|
<template v-if="isTrackingRowProcessReadonly(scope.row)"> |
|
|
|
<span class="process-date-display">{{ scope.row[item.actualField] || '' }}</span> |
|
|
|
</template> |
|
|
|
<template v-else> |
|
|
|
<el-date-picker |
|
|
|
v-model="scope.row[item.actualField]" |
|
|
|
type="date" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
format="yyyy-MM-dd" |
|
|
|
placeholder="" |
|
|
|
style="width: 122px" |
|
|
|
@change="handleProcessDateChange(scope.row, item, $event)" |
|
|
|
@dblclick.native.stop="handleProcessDateDoubleClick(scope.row, item)" |
|
|
|
/> |
|
|
|
<el-button |
|
|
|
v-if="!isProcessStatusComplete(scope.row, item)" |
|
|
|
class="process-complete-btn" |
|
|
|
type="success" |
|
|
|
size="mini" |
|
|
|
plain |
|
|
|
title="标记为已完成" |
|
|
|
@click.stop="markProcessComplete(scope.row, item)" |
|
|
|
>✓</el-button> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-else class="process-cell process-cell--masked"></div> |
|
|
|
@ -197,16 +197,7 @@ |
|
|
|
<el-table-column label="Comments" width="220"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="comments-cell" @dblclick.stop="startCommentsEdit(scope.row)"> |
|
|
|
<template v-if="batchEditMode"> |
|
|
|
<el-input |
|
|
|
v-model="scope.row.comments" |
|
|
|
class="comments-edit-input" |
|
|
|
size="mini" |
|
|
|
clearable |
|
|
|
placeholder="请输入Comments" |
|
|
|
/> |
|
|
|
</template> |
|
|
|
<template v-else-if="isCommentsEditing(scope.row)"> |
|
|
|
<template v-if="isCommentsEditing(scope.row)"> |
|
|
|
<el-input |
|
|
|
v-model="commentsDraft" |
|
|
|
v-focus-comments-input="isCommentsEditing(scope.row)" |
|
|
|
@ -228,17 +219,17 @@ |
|
|
|
:loading="commentsSaveLoading" |
|
|
|
@mousedown.native.prevent |
|
|
|
@click.stop="saveCommentsEdit(scope.row)" |
|
|
|
>√</el-button> |
|
|
|
>✓</el-button> |
|
|
|
</template> |
|
|
|
<span v-else class="comments-text" :title="scope.row.comments || ''">{{ scope.row.comments || '-' }}</span> |
|
|
|
<span v-else class="comments-text" :title="scope.row.comments || ''">{{ scope.row.comments || '' }}</span> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" fixed="right" width="150" align="center"> |
|
|
|
<el-table-column label="操作" fixed="right" width="80" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a @click="openOneKeyDialog('edit', scope.row)">修改</a> |
|
|
|
<a class="action-link delete-link" @click="deleteProof(scope.row)">删除</a> |
|
|
|
<a class="action-link end-link" v-if="scope.row.proofingNo && scope.row.proofingStatus !== '打样完成'" @click="finishProof(scope.row)">打样完成</a> |
|
|
|
<a @click="openOneKeyDialog('edit', scope.row)" v-if="scope.row.proofingNo && scope.row.proofingStatus !== '打样完成'">修改</a> |
|
|
|
<a class="action-link delete-link" v-if="scope.row.proofingNo && 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> |
|
|
|
@ -727,11 +718,10 @@ |
|
|
|
</el-col> |
|
|
|
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('proofingStatus')"> |
|
|
|
<el-form-item label="打样状态"> |
|
|
|
<el-select v-model="oneKeyForm.proofingStatus" clearable style="width: 100%"> |
|
|
|
<el-select disabled 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-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -950,42 +940,6 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="更新工序状态" :visible.sync="processDialogVisible" width="620px" :close-on-click-modal="false"> |
|
|
|
<el-form :model="processForm" label-position="top" label-width="120px" :inline="true"> |
|
|
|
<el-form-item label="工序"> |
|
|
|
<el-input v-model="processForm.processName" disabled style="width: 180px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="状态" required> |
|
|
|
<el-select v-model="processForm.status" style="width: 180px"> |
|
|
|
<el-option label="未完成" value="未完成" /> |
|
|
|
<el-option label="进行中" value="进行中" /> |
|
|
|
<el-option label="已完成" value="已完成" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="实际完成日期"> |
|
|
|
<el-date-picker v-model="processForm.actualDate" type="date" value-format="yyyy-MM-dd" format="yyyy-MM-dd" style="width: 180px" /> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input type="textarea" :rows="2" v-model="processForm.remark" style="width: 570px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<el-table :data="processHistoryRows" border stripe height="220" style="margin-top: 32px"> |
|
|
|
<el-table-column prop="changedDate" label="修改时间" width="120" /> |
|
|
|
<el-table-column prop="changedBy" label="修改人" width="70" /> |
|
|
|
<el-table-column prop="oldStatus" label="原状态" width="60" /> |
|
|
|
<el-table-column prop="newStatus" label="新状态" width="60" /> |
|
|
|
<el-table-column prop="oldActualDate" label="原实际" width="90" /> |
|
|
|
<el-table-column prop="newActualDate" label="新实际" width="90" /> |
|
|
|
<el-table-column prop="remark" label="备注" show-overflow-tooltip /> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div slot="footer"> |
|
|
|
<el-button @click="processDialogVisible = false">取消</el-button> |
|
|
|
<el-button type="primary" :loading="saveProcessLoading" @click="submitProcessUpdate">保存</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog |
|
|
|
title="打样完成" |
|
|
|
:visible.sync="finishDialogVisible" |
|
|
|
@ -1066,7 +1020,6 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import { |
|
|
|
batchUpdateProofTrackingPlan, |
|
|
|
createProofTrackingRecord, |
|
|
|
deleteProofTracking, |
|
|
|
exportProofTracking, |
|
|
|
@ -1570,7 +1523,6 @@ export default { |
|
|
|
currentRow: null, |
|
|
|
manualSelectedTrackingId: null, |
|
|
|
selectionRows: [], |
|
|
|
batchEditMode: false, |
|
|
|
processHistoryMap: {}, |
|
|
|
processTooltipHoverKey: '', |
|
|
|
processTooltip: { |
|
|
|
@ -1579,7 +1531,6 @@ export default { |
|
|
|
left: 0, |
|
|
|
top: 0 |
|
|
|
}, |
|
|
|
processHistoryRows: [], |
|
|
|
commentsEditingTrackingId: null, |
|
|
|
commentsDraft: '', |
|
|
|
commentsSaveLoading: false, |
|
|
|
@ -1603,10 +1554,6 @@ export default { |
|
|
|
proofDialogApplyLoading: false, |
|
|
|
proofDialogApplyQueryToken: 0, |
|
|
|
|
|
|
|
processDialogVisible: false, |
|
|
|
saveProcessLoading: false, |
|
|
|
processForm: {}, |
|
|
|
|
|
|
|
finishDialogVisible: false, |
|
|
|
finishSaveLoading: false, |
|
|
|
finishForm: { |
|
|
|
@ -1838,8 +1785,9 @@ export default { |
|
|
|
} |
|
|
|
return this.normalizeTrackingColumnBoolean(column.columnHidden, false) === false |
|
|
|
}, |
|
|
|
isProjectPartSyncColumn (columnProp) { |
|
|
|
return ['projectNo', 'projectDesc', 'testPartNo', 'partDesc'].indexOf(columnProp) > -1 |
|
|
|
// 同步图标只展示在项目编码、项目物料与打样单号三列,避免整列变色影响可读性。 |
|
|
|
isSyncIconTrackingColumn (columnProp) { |
|
|
|
return ['projectNo', 'testPartNo', 'proofingNo'].indexOf(columnProp) > -1 |
|
|
|
}, |
|
|
|
getTrackingColumnDisplayValue (row, columnProp) { |
|
|
|
if (!row || !columnProp) { |
|
|
|
@ -3811,7 +3759,7 @@ export default { |
|
|
|
return !!row && row.trackingId === this.commentsEditingTrackingId |
|
|
|
}, |
|
|
|
startCommentsEdit (row) { |
|
|
|
if (this.batchEditMode || !row || !row.trackingId || this.commentsSaveLoading) { |
|
|
|
if (!row || !row.trackingId || this.commentsSaveLoading) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.commentsEditingTrackingId = row.trackingId |
|
|
|
@ -3996,11 +3944,11 @@ export default { |
|
|
|
const proofingId = row.proofingId || row.proofing_id || row.trackingId || null |
|
|
|
return this.isSyncedByIdRule(proofingId) |
|
|
|
}, |
|
|
|
getProjectPartSyncTextClass (row) { |
|
|
|
return this.isProjectPartSynced(row) ? 'sync-text--ok' : 'sync-text--pending' |
|
|
|
}, |
|
|
|
getProofSyncTextClass (row) { |
|
|
|
return this.isProofSynced(row) ? 'sync-text--ok' : 'sync-text--pending' |
|
|
|
isTrackingColumnSynced (row, columnProp) { |
|
|
|
if (columnProp === 'proofingNo') { |
|
|
|
return this.isProofSynced(row) |
|
|
|
} |
|
|
|
return this.isProjectPartSynced(row) |
|
|
|
}, |
|
|
|
getProjectCategoryValue (source) { |
|
|
|
if (!source) { |
|
|
|
@ -5225,94 +5173,13 @@ export default { |
|
|
|
this.$message.error('新增打样异常') |
|
|
|
}) |
|
|
|
}, |
|
|
|
toggleBatchEdit () { |
|
|
|
this.batchEditMode = !this.batchEditMode |
|
|
|
if (this.batchEditMode) { |
|
|
|
this.cancelCommentsEdit() |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
const tableRef = this.$refs.trackingTable |
|
|
|
if (tableRef && tableRef.doLayout) { |
|
|
|
tableRef.doLayout() |
|
|
|
} |
|
|
|
if (this.batchEditMode) { |
|
|
|
setTimeout(() => { |
|
|
|
this.scrollToRawMaterialColumn() |
|
|
|
}, 0) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
scrollToRawMaterialColumn () { |
|
|
|
const tableRef = this.$refs.trackingTable |
|
|
|
if (!tableRef || !tableRef.$el) { |
|
|
|
return |
|
|
|
} |
|
|
|
const headerWrapper = tableRef.headerWrapper || tableRef.$el.querySelector('.el-table__header-wrapper') |
|
|
|
const bodyWrapper = tableRef.bodyWrapper || tableRef.$el.querySelector('.el-table__body-wrapper') |
|
|
|
if (!headerWrapper || !bodyWrapper) { |
|
|
|
return |
|
|
|
} |
|
|
|
const headerCells = headerWrapper.querySelectorAll('th') |
|
|
|
let targetCell = null |
|
|
|
for (let i = 0; i < headerCells.length; i++) { |
|
|
|
const text = (headerCells[i].innerText || '').replace(/\s+/g, ' ').trim() |
|
|
|
if (text === 'Raw Material') { |
|
|
|
targetCell = headerCells[i] |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
if (!targetCell) { |
|
|
|
return |
|
|
|
} |
|
|
|
const fixedLeftWrapper = tableRef.$el.querySelector('.el-table__fixed') |
|
|
|
const fixedLeftWidth = fixedLeftWrapper ? fixedLeftWrapper.offsetWidth : 0 |
|
|
|
const nextScrollLeft = Math.max(targetCell.offsetLeft - fixedLeftWidth - 8, 0) |
|
|
|
bodyWrapper.scrollLeft = nextScrollLeft |
|
|
|
headerWrapper.scrollLeft = nextScrollLeft |
|
|
|
}, |
|
|
|
saveBatchPlan () { |
|
|
|
const rows = this.selectionRows && this.selectionRows.length > 0 ? this.selectionRows : this.dataList |
|
|
|
if (!rows || rows.length === 0) { |
|
|
|
this.$message.warning('没有可保存的数据') |
|
|
|
return |
|
|
|
} |
|
|
|
const payloadRows = rows.map(row => ({ |
|
|
|
trackingId: row.trackingId, |
|
|
|
rawMaterialActualDate: row.rawMaterialActualDate, |
|
|
|
cylinderCutterActualDate: row.cylinderCutterActualDate, |
|
|
|
laminationActualDate: row.laminationActualDate, |
|
|
|
printingActualDate: row.printingActualDate, |
|
|
|
etchingActualDate: row.etchingActualDate, |
|
|
|
slittingPackingActualDate: row.slittingPackingActualDate, |
|
|
|
bondingActualDate: row.bondingActualDate, |
|
|
|
cl60Cl822ActualDate: row.cl60Cl822ActualDate, |
|
|
|
spottingActualDate: row.spottingActualDate, |
|
|
|
encodingActualDate: row.encodingActualDate, |
|
|
|
dieCutActualDate: row.dieCutActualDate, |
|
|
|
inspectionActualDate: row.inspectionActualDate, |
|
|
|
deliveryPackageActualDate: row.deliveryPackageActualDate, |
|
|
|
comments: row.comments == null ? '' : String(row.comments), |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
})) |
|
|
|
batchUpdateProofTrackingPlan({ |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
rows: payloadRows |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('批量修改成功') |
|
|
|
this.batchEditMode = false |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '批量修改失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('批量修改异常') |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleProcessDateChange (row, processCol, dateVal) { |
|
|
|
if (!row || !processCol) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
|
return |
|
|
|
} |
|
|
|
const actualDate = this.formatDate(dateVal) |
|
|
|
// 业务要求:表格选择日期仅更新日期,不自动改变工序状态(状态由“√”动作控制)。 |
|
|
|
const currentStatus = row[processCol.statusField] ? String(row[processCol.statusField]).trim() : '' |
|
|
|
@ -5327,6 +5194,9 @@ export default { |
|
|
|
if (!row || !processCol || this.isProcessStatusComplete(row, processCol)) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
|
return |
|
|
|
} |
|
|
|
// 若用户已手工选择日期,打勾仅改状态,不覆盖已选日期;无日期时才补当天。 |
|
|
|
const currentActualDate = this.formatDate(row[processCol.actualField]) |
|
|
|
const nextActualDate = currentActualDate || this.formatDate(new Date()) |
|
|
|
@ -5340,6 +5210,9 @@ export default { |
|
|
|
if (!row || !processCol || !this.isProcessStatusComplete(row, processCol)) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
|
return |
|
|
|
} |
|
|
|
// 按页面交互约定:已完成工序允许双击日期输入框进行回退。 |
|
|
|
this.rollbackProcessComplete(row, processCol) |
|
|
|
}, |
|
|
|
@ -5347,6 +5220,9 @@ export default { |
|
|
|
if (!row || !processCol || !this.isProcessStatusComplete(row, processCol)) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.isTrackingRowProcessReadonly(row)) { |
|
|
|
return |
|
|
|
} |
|
|
|
const currentActualDate = this.formatDate(row[processCol.actualField]) |
|
|
|
this.$confirm('确定回退该工序状态为“未完成”吗?', '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
@ -5402,51 +5278,6 @@ export default { |
|
|
|
this.getDataList() |
|
|
|
}) |
|
|
|
}, |
|
|
|
openProcessDialog (row, processCol) { |
|
|
|
if (!row || !processCol) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.currentRow = row |
|
|
|
this.processForm = { |
|
|
|
trackingId: row.trackingId, |
|
|
|
processCode: processCol.code, |
|
|
|
processName: processCol.label, |
|
|
|
status: row[processCol.statusField] || '未完成', |
|
|
|
actualDate: row[processCol.actualField] || '', |
|
|
|
remark: '' |
|
|
|
} |
|
|
|
this.processHistoryRows = [] |
|
|
|
this.processDialogVisible = true |
|
|
|
this.loadProcessHistory(row, processCol, true) |
|
|
|
}, |
|
|
|
submitProcessUpdate () { |
|
|
|
if (!this.processForm.trackingId || !this.processForm.processCode) { |
|
|
|
this.$message.error('参数缺失') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.processForm.status) { |
|
|
|
this.$message.error('请选择状态') |
|
|
|
return |
|
|
|
} |
|
|
|
const inData = Object.assign({}, this.processForm, { |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
}) |
|
|
|
this.saveProcessLoading = true |
|
|
|
updateProofTrackingProcess(inData).then(({ data }) => { |
|
|
|
this.saveProcessLoading = false |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('工序更新成功') |
|
|
|
this.processDialogVisible = false |
|
|
|
this.processHistoryMap = {} |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error(data.msg || '工序更新失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.saveProcessLoading = false |
|
|
|
this.$message.error('工序更新异常') |
|
|
|
}) |
|
|
|
}, |
|
|
|
finishProof (row) { |
|
|
|
const current = row || this.currentRow |
|
|
|
if (!current || !current.trackingId) { |
|
|
|
@ -5586,21 +5417,17 @@ export default { |
|
|
|
showTooltip() |
|
|
|
return |
|
|
|
} |
|
|
|
this.loadProcessHistory(row, processCol, false).then(() => { |
|
|
|
this.loadProcessHistory(row, processCol).then(() => { |
|
|
|
showTooltip() |
|
|
|
}) |
|
|
|
}, |
|
|
|
loadProcessHistory (row, processCol, refreshDialog) { |
|
|
|
loadProcessHistory (row, processCol) { |
|
|
|
if (!row || !row.trackingId) { |
|
|
|
return Promise.resolve([]) |
|
|
|
} |
|
|
|
const cacheKey = this.getProcessCacheKey(row, processCol) |
|
|
|
if (Object.prototype.hasOwnProperty.call(this.processHistoryMap, cacheKey)) { |
|
|
|
const cachedRows = this.processHistoryMap[cacheKey] || [] |
|
|
|
if (refreshDialog) { |
|
|
|
this.processHistoryRows = cachedRows |
|
|
|
} |
|
|
|
return Promise.resolve(cachedRows) |
|
|
|
return Promise.resolve(this.processHistoryMap[cacheKey] || []) |
|
|
|
} |
|
|
|
return queryProofTrackingProcessHistory({ |
|
|
|
trackingId: row.trackingId, |
|
|
|
@ -5611,15 +5438,9 @@ export default { |
|
|
|
rows = data.rows || [] |
|
|
|
// Vue2 对对象新增 key 需要使用 $set 才能触发视图更新(tooltip 才会刷新历史列表) |
|
|
|
this.$set(this.processHistoryMap, cacheKey, rows) |
|
|
|
if (refreshDialog) { |
|
|
|
this.processHistoryRows = rows |
|
|
|
} |
|
|
|
} |
|
|
|
return rows |
|
|
|
}).catch(() => { |
|
|
|
if (refreshDialog) { |
|
|
|
this.processHistoryRows = [] |
|
|
|
} |
|
|
|
this.$set(this.processHistoryMap, cacheKey, []) |
|
|
|
return [] |
|
|
|
}) |
|
|
|
@ -5831,7 +5652,11 @@ export default { |
|
|
|
} |
|
|
|
const proofingStatus = String(row.proofingStatus).trim() |
|
|
|
// 打样已结束时,Tracking Status 统一收敛为灰色 Complete,避免继续显示进度预警。 |
|
|
|
return proofingStatus === '打样完成' || proofingStatus === '打样结束' |
|
|
|
return proofingStatus === '打样完成' |
|
|
|
}, |
|
|
|
isTrackingRowProcessReadonly (row) { |
|
|
|
// Complete 行不再允许维护工序日期与状态,统一改为只读文本展示。 |
|
|
|
return this.isProofingFinishedForTrackingStatus(row) |
|
|
|
}, |
|
|
|
getTrackingStatusText (row) { |
|
|
|
if (this.isProofingFinishedForTrackingStatus(row)) { |
|
|
|
@ -6132,13 +5957,17 @@ export default { |
|
|
|
color: #35b4b4; |
|
|
|
} |
|
|
|
|
|
|
|
.sync-text--ok { |
|
|
|
color: #67c23a; |
|
|
|
font-weight: 600; |
|
|
|
.project-part-sync-text { |
|
|
|
display: inline-flex; |
|
|
|
align-items: center; |
|
|
|
} |
|
|
|
|
|
|
|
.sync-text--pending { |
|
|
|
color: #606266; |
|
|
|
.project-part-sync-icon { |
|
|
|
margin-left: -4px; |
|
|
|
margin-right: 2px; |
|
|
|
color: #1f7a35; |
|
|
|
font-size: 10px; |
|
|
|
transform: translateY(-1px); |
|
|
|
} |
|
|
|
|
|
|
|
.tracking-status { |
|
|
|
@ -6218,6 +6047,13 @@ export default { |
|
|
|
line-height: 18px; |
|
|
|
} |
|
|
|
|
|
|
|
.process-date-display { |
|
|
|
display: inline-block; |
|
|
|
min-width: 74px; |
|
|
|
text-align: center; |
|
|
|
color: #606266; |
|
|
|
} |
|
|
|
|
|
|
|
.process-complete-btn { |
|
|
|
padding: 4px 8px; |
|
|
|
min-width: 12px; |
|
|
|
|