|
|
|
@ -32,6 +32,7 @@ |
|
|
|
<el-row :gutter="8" type="flex" class="button-row" > |
|
|
|
<el-button type="primary" @click="openOneKeyDialog">一键创建项目/物料</el-button> |
|
|
|
<el-button type="primary" @click="openCreateProofDialog()">新增打样</el-button> |
|
|
|
<el-button type="success" :loading="syncNpiLoading" @click="syncToNpi()">同步到NPI</el-button> |
|
|
|
<el-button type="warning" @click="toggleBatchEdit">{{ batchEditMode ? '取消修改' : '批量修改' }}</el-button> |
|
|
|
<el-button v-if="batchEditMode" type="success" @click="saveBatchPlan">保存修改</el-button> |
|
|
|
</el-row> |
|
|
|
@ -115,7 +116,16 @@ |
|
|
|
<el-table-column label="Comments" width="220"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div class="comments-cell" @dblclick.stop="startCommentsEdit(scope.row)"> |
|
|
|
<template v-if="isCommentsEditing(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)"> |
|
|
|
<el-input |
|
|
|
v-model="commentsDraft" |
|
|
|
v-focus-comments-input="isCommentsEditing(scope.row)" |
|
|
|
@ -143,8 +153,9 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作" fixed="right" width="150" align="center"> |
|
|
|
<el-table-column label="操作" fixed="right" width="230" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<a class="action-link" @click="syncToNpi(scope.row)">同步NPI</a> |
|
|
|
<a @click="openCreateProofDialog(scope.row)">新增打样</a> |
|
|
|
<a class="action-link end-link" v-if="scope.row.proofingStatus !== '打样完成'" @click="finishProof(scope.row)">打样完成</a> |
|
|
|
</template> |
|
|
|
@ -713,6 +724,7 @@ import { |
|
|
|
oneKeyCreateProofTracking, |
|
|
|
queryProofTrackingProcessHistory, |
|
|
|
searchProofTracking, |
|
|
|
syncProjectPartTracking, |
|
|
|
updateProofTrackingComments, |
|
|
|
updateProofTrackingProcess |
|
|
|
} from '@/api/sampleTracking/sampleTracking' |
|
|
|
@ -858,6 +870,7 @@ export default { |
|
|
|
}, |
|
|
|
dataList: [], |
|
|
|
dataListLoading: false, |
|
|
|
syncNpiLoading: false, |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 20, |
|
|
|
totalPage: 0, |
|
|
|
@ -1250,7 +1263,7 @@ export default { |
|
|
|
return !!row && row.trackingId === this.commentsEditingTrackingId |
|
|
|
}, |
|
|
|
startCommentsEdit (row) { |
|
|
|
if (!row || !row.trackingId || this.commentsSaveLoading) { |
|
|
|
if (this.batchEditMode || !row || !row.trackingId || this.commentsSaveLoading) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.commentsEditingTrackingId = row.trackingId |
|
|
|
@ -1416,6 +1429,40 @@ export default { |
|
|
|
}) |
|
|
|
this.proofDialogVisible = true |
|
|
|
}, |
|
|
|
syncToNpi (row) { |
|
|
|
const current = row || this.currentRow || (this.selectionRows.length > 0 ? this.selectionRows[0] : null) |
|
|
|
if (!current) { |
|
|
|
this.$message.warning('请先选择一条记录') |
|
|
|
return |
|
|
|
} |
|
|
|
const projectPartId = current.projectPartId || current.project_part_id |
|
|
|
if (!projectPartId) { |
|
|
|
this.$message.warning('项目物料ID缺失,无法同步') |
|
|
|
return |
|
|
|
} |
|
|
|
this.currentRow = current |
|
|
|
const operator = this.$store.state.user.name |
|
|
|
this.syncNpiLoading = true |
|
|
|
syncProjectPartTracking({ |
|
|
|
projectPartId: projectPartId, |
|
|
|
updateBy: operator, |
|
|
|
createBy: operator, |
|
|
|
userName: operator |
|
|
|
}).then(({ data }) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const projectIdMsg = data.projectId || current.projectId || '' |
|
|
|
const projectPartIdMsg = data.projectPartId || projectPartId |
|
|
|
this.$message.success(`同步成功`) |
|
|
|
this.getDataList() |
|
|
|
} else { |
|
|
|
this.$message.error((data && data.msg) || '同步到NPI失败') |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.$message.error('同步到NPI异常') |
|
|
|
}).finally(() => { |
|
|
|
this.syncNpiLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
validateProofDialogData () { |
|
|
|
if (!this.proofDialogData.projectId || !this.proofDialogData.projectPartId) { |
|
|
|
this.$message.warning('项目或项目料号信息不完整') |
|
|
|
@ -1500,6 +1547,9 @@ export default { |
|
|
|
}, |
|
|
|
toggleBatchEdit () { |
|
|
|
this.batchEditMode = !this.batchEditMode |
|
|
|
if (this.batchEditMode) { |
|
|
|
this.cancelCommentsEdit() |
|
|
|
} |
|
|
|
this.$nextTick(() => { |
|
|
|
const tableRef = this.$refs.trackingTable |
|
|
|
if (tableRef && tableRef.doLayout) { |
|
|
|
@ -1561,6 +1611,7 @@ export default { |
|
|
|
dieCutActualDate: row.dieCutActualDate, |
|
|
|
inspectionActualDate: row.inspectionActualDate, |
|
|
|
deliveryPackageActualDate: row.deliveryPackageActualDate, |
|
|
|
comments: row.comments == null ? '' : String(row.comments), |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
})) |
|
|
|
batchUpdateProofTrackingPlan({ |
|
|
|
|