|
|
|
@ -111,7 +111,7 @@ |
|
|
|
<el-input v-model="modalData.drawingNo" readonly style="width: 150px" placeholder="获取编码后填入"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" :label="' '"> |
|
|
|
<el-button type="primary" @click="openDrawingNoDialog">获取编码</el-button> |
|
|
|
<el-button type="primary" :loading="drawingNoSaving" @click="openDrawingNoDialog">获取编码</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="客户料号" prop="customerPartNo" :rules="rules.customerPartNo"> |
|
|
|
<el-input v-model="modalData.customerPartNo" clearable style="width: 120px"></el-input> |
|
|
|
@ -1029,6 +1029,7 @@ import { |
|
|
|
updateRevision, |
|
|
|
deleteRevision, |
|
|
|
partInformationEdit2, |
|
|
|
updatePartDrawingNo, |
|
|
|
getProjectPartList, |
|
|
|
addProjectPart, // 新增项目物料 |
|
|
|
deleteProjectPart, // 删除项目物料 |
|
|
|
@ -1913,6 +1914,7 @@ import CodeGeneration from "../../code/generation.vue"; |
|
|
|
manufacturingInfoFlag: false, // Manufacturing标识 |
|
|
|
planningInfoFlag: false, // planning标识 |
|
|
|
partItemInfoFlag: false, // 属性信息标识 |
|
|
|
drawingNoSaving: false, |
|
|
|
saveLoading: false |
|
|
|
} |
|
|
|
}, |
|
|
|
@ -3887,9 +3889,41 @@ import CodeGeneration from "../../code/generation.vue"; |
|
|
|
this.drawingNoDialogVisible = true; |
|
|
|
}, |
|
|
|
|
|
|
|
handleCodeGenerated(drawingNo) { |
|
|
|
async autoSaveDrawingNo(drawingNo, previousDrawingNo) { |
|
|
|
if (this.modalData.flag !== '2' || this.modalData.status !== 'Y') { |
|
|
|
return |
|
|
|
} |
|
|
|
this.drawingNoSaving = true |
|
|
|
const payload = { |
|
|
|
site: this.modalData.site, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
drawingNo, |
|
|
|
updateBy: this.$store.state.user.name |
|
|
|
} |
|
|
|
try { |
|
|
|
const {data} = await updatePartDrawingNo(payload) |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.$message.success('编码已自动保存') |
|
|
|
this.searchTable() |
|
|
|
} else { |
|
|
|
this.modalData.drawingNo = previousDrawingNo |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.modalData.drawingNo = previousDrawingNo |
|
|
|
this.$message.error(error) |
|
|
|
} finally { |
|
|
|
this.drawingNoSaving = false |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleCodeGenerated(drawingNo) { |
|
|
|
const previousDrawingNo = this.modalData.drawingNo |
|
|
|
this.modalData.drawingNo = drawingNo; |
|
|
|
this.drawingNoDialogVisible = false; |
|
|
|
await this.autoSaveDrawingNo(drawingNo, previousDrawingNo) |
|
|
|
}, |
|
|
|
|
|
|
|
handlePartDrawingDetail(row) { |
|
|
|
|