|
|
@ -30,12 +30,13 @@ |
|
|
</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> |
|
|
<el-button type="success" :loading="syncNpiLoading" @click="syncToNpi()">同步到NPI</el-button> |
|
|
<el-button type="success" :loading="syncNpiLoading" @click="syncToNpi()">同步到NPI</el-button> |
|
|
|
|
|
<el-button type="success" plain :loading="syncProofLoading" @click="syncProofToNpi()">同步打样到NPI</el-button> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
@ -154,10 +155,11 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="操作" fixed="right" width="130" align="center"> |
|
|
|
|
|
|
|
|
<el-table-column label="操作" fixed="right" width="120" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<!-- <a class="action-link" @click="syncToNpi(scope.row)">同步NPI</a>--> |
|
|
<!-- <a class="action-link" @click="syncToNpi(scope.row)">同步NPI</a>--> |
|
|
<a @click="openCreateProofDialog(scope.row)">新增打样</a> |
|
|
|
|
|
|
|
|
<!-- <a class="action-link" @click="openCreateProofDialog(scope.row)">新增打样</a>--> |
|
|
|
|
|
<a class="action-link delete-link" @click="deleteProof(scope.row)">删除</a> |
|
|
<a class="action-link end-link" v-if="scope.row.proofingStatus !== '打样完成'" @click="finishProof(scope.row)">打样完成</a> |
|
|
<a class="action-link end-link" v-if="scope.row.proofingStatus !== '打样完成'" @click="finishProof(scope.row)">打样完成</a> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
@ -725,12 +727,14 @@ |
|
|
import { |
|
|
import { |
|
|
batchUpdateProofTrackingPlan, |
|
|
batchUpdateProofTrackingPlan, |
|
|
createProofTrackingRecord, |
|
|
createProofTrackingRecord, |
|
|
|
|
|
deleteProofTracking, |
|
|
finishProofTracking, |
|
|
finishProofTracking, |
|
|
oneKeyCreateProofTracking, |
|
|
oneKeyCreateProofTracking, |
|
|
queryProofTrackingProcessHistory, |
|
|
queryProofTrackingProcessHistory, |
|
|
searchProjectInfoTracking, |
|
|
searchProjectInfoTracking, |
|
|
searchProjectPartTracking, |
|
|
searchProjectPartTracking, |
|
|
searchProofTracking, |
|
|
searchProofTracking, |
|
|
|
|
|
syncProofTracking, |
|
|
syncProjectPartTracking, |
|
|
syncProjectPartTracking, |
|
|
updateProjectInfoTracking, |
|
|
updateProjectInfoTracking, |
|
|
updateProjectPartTracking, |
|
|
updateProjectPartTracking, |
|
|
@ -888,6 +892,7 @@ export default { |
|
|
dataList: [], |
|
|
dataList: [], |
|
|
dataListLoading: false, |
|
|
dataListLoading: false, |
|
|
syncNpiLoading: false, |
|
|
syncNpiLoading: false, |
|
|
|
|
|
syncProofLoading: false, |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
@ -1252,10 +1257,23 @@ export default { |
|
|
} |
|
|
} |
|
|
if (this.dataList.length > 0) { |
|
|
if (this.dataList.length > 0) { |
|
|
this.currentRow = this.dataList[0] |
|
|
this.currentRow = this.dataList[0] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.currentRow = null |
|
|
} |
|
|
} |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.trackingTable && typeof this.$refs.trackingTable.setCurrentRow === 'function') { |
|
|
|
|
|
this.$refs.trackingTable.setCurrentRow(this.currentRow || null) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
this.dataList = [] |
|
|
this.dataList = [] |
|
|
this.totalPage = 0 |
|
|
this.totalPage = 0 |
|
|
|
|
|
this.currentRow = null |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
if (this.$refs.trackingTable && typeof this.$refs.trackingTable.setCurrentRow === 'function') { |
|
|
|
|
|
this.$refs.trackingTable.setCurrentRow(null) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
this.$message.error(data.msg || '查询失败') |
|
|
this.$message.error(data.msg || '查询失败') |
|
|
} |
|
|
} |
|
|
}).catch(() => { |
|
|
}).catch(() => { |
|
|
@ -1806,32 +1824,88 @@ export default { |
|
|
} |
|
|
} |
|
|
const projectPartId = syncCheck.projectPartId |
|
|
const projectPartId = syncCheck.projectPartId |
|
|
this.currentRow = current |
|
|
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) { |
|
|
|
|
|
this.$message.success(`同步成功`) |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
} else { |
|
|
|
|
|
const failMsg = (data && data.msg) || '同步到NPI失败' |
|
|
|
|
|
if (failMsg.indexOf('缺少以下必填项') > -1) { |
|
|
|
|
|
this.$alert(failMsg, '同步校验未通过', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
const projectNo = current.projectNo || '-' |
|
|
|
|
|
const testPartNo = current.testPartNo || '-' |
|
|
|
|
|
const confirmMsg = `确认将项目编码[${projectNo}]物料编码[${testPartNo}]同步到NPI吗?` |
|
|
|
|
|
this.$confirm(confirmMsg, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
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) { |
|
|
|
|
|
this.$message.success(`同步成功`) |
|
|
|
|
|
this.getDataList() |
|
|
} else { |
|
|
} else { |
|
|
this.$message.error(failMsg) |
|
|
|
|
|
|
|
|
const failMsg = (data && data.msg) || '同步到NPI失败' |
|
|
|
|
|
if (failMsg.indexOf('缺少以下必填项') > -1) { |
|
|
|
|
|
this.$alert(failMsg, '同步校验未通过', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(failMsg) |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error('同步到NPI异常') |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.syncNpiLoading = false |
|
|
|
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error('同步到NPI异常') |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.syncNpiLoading = false |
|
|
|
|
|
}) |
|
|
}) |
|
|
}) |
|
|
|
|
|
.catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
syncProofToNpi (row) { |
|
|
|
|
|
const current = this.getActionRow(row) |
|
|
|
|
|
if (!current || !current.trackingId) { |
|
|
|
|
|
this.$message.warning('请先选择一条打样记录') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.currentRow = current |
|
|
|
|
|
const projectNo = current.projectNo || '-' |
|
|
|
|
|
const testPartNo = current.testPartNo || '-' |
|
|
|
|
|
const proofingNo = current.proofingNo || '-' |
|
|
|
|
|
const confirmMsg = `确认将当前打样记录同步到NPI吗?<br/>项目编码:${projectNo}<br/>物料编码:${testPartNo}<br/>打样单号:${proofingNo}` |
|
|
|
|
|
this.$confirm(confirmMsg, '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
dangerouslyUseHTMLString: true |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
const operator = this.$store.state.user.name |
|
|
|
|
|
this.syncProofLoading = true |
|
|
|
|
|
syncProofTracking({ |
|
|
|
|
|
trackingId: current.trackingId, |
|
|
|
|
|
updateBy: operator, |
|
|
|
|
|
createBy: operator, |
|
|
|
|
|
userName: operator |
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success('打样同步成功') |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
} else { |
|
|
|
|
|
const failMsg = (data && data.msg) || '同步打样到NPI失败' |
|
|
|
|
|
if (failMsg.indexOf('缺少以下必填项') > -1 || failMsg.indexOf('请先同步项目') > -1 || failMsg.indexOf('请先同步项目物料') > -1) { |
|
|
|
|
|
this.$alert(failMsg, '同步校验未通过', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(failMsg) |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error('同步打样到NPI异常') |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
this.syncProofLoading = false |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
validateProofDialogData () { |
|
|
validateProofDialogData () { |
|
|
if (!this.proofDialogData.projectId || !this.proofDialogData.projectPartId) { |
|
|
if (!this.proofDialogData.projectId || !this.proofDialogData.projectPartId) { |
|
|
@ -2118,6 +2192,34 @@ export default { |
|
|
} |
|
|
} |
|
|
this.finishDialogVisible = true |
|
|
this.finishDialogVisible = true |
|
|
}, |
|
|
}, |
|
|
|
|
|
deleteProof (row) { |
|
|
|
|
|
const current = row || this.currentRow |
|
|
|
|
|
if (!current || !current.trackingId) { |
|
|
|
|
|
this.$message.warning('请先选择记录') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$confirm('确定删除该打样记录吗?该操作仅删除打样记录,不会删除项目和项目物料。', '提示', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
type: 'warning' |
|
|
|
|
|
}).then(() => { |
|
|
|
|
|
deleteProofTracking({ |
|
|
|
|
|
trackingId: current.trackingId, |
|
|
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
|
|
}).then(({ data }) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.$message.success('打样记录删除成功') |
|
|
|
|
|
this.processHistoryMap = {} |
|
|
|
|
|
this.resetProcessTooltip() |
|
|
|
|
|
this.getDataList() |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error((data && data.msg) || '删除打样记录失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.$message.error('删除打样记录异常') |
|
|
|
|
|
}) |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
submitFinishProof () { |
|
|
submitFinishProof () { |
|
|
if (!this.finishForm.trackingId) { |
|
|
if (!this.finishForm.trackingId) { |
|
|
this.$message.warning('跟踪记录ID不能为空') |
|
|
this.$message.warning('跟踪记录ID不能为空') |
|
|
@ -2515,12 +2617,16 @@ export default { |
|
|
|
|
|
|
|
|
.action-link { |
|
|
.action-link { |
|
|
color: #0c4dbb; |
|
|
color: #0c4dbb; |
|
|
margin: 0 6px; |
|
|
|
|
|
|
|
|
margin: 0 4px; |
|
|
cursor: pointer; |
|
|
cursor: pointer; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.delete-link { |
|
|
|
|
|
color: #f56c6c; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.end-link { |
|
|
.end-link { |
|
|
color: #d9001b; |
|
|
|
|
|
|
|
|
color: #a303ff; |
|
|
} |
|
|
} |
|
|
</style> |
|
|
</style> |
|
|
|
|
|
|