|
|
@ -107,7 +107,11 @@ |
|
|
<el-form-item label="物料名称 / Part Desc." prop="partDesc" :rules="rules.partDesc" style="margin-left: -10px"> |
|
|
<el-form-item label="物料名称 / Part Desc." prop="partDesc" :rules="rules.partDesc" style="margin-left: -10px"> |
|
|
<el-input v-model="modalData.partDesc" clearable style="width: 300px"></el-input> |
|
|
<el-input v-model="modalData.partDesc" clearable style="width: 300px"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'" label="编码"> |
|
|
|
|
|
|
|
|
<el-form-item v-if="modalData.flag === '2' && modalData.status === 'Y'"> |
|
|
|
|
|
<template slot="label"> |
|
|
|
|
|
<span>编码</span> |
|
|
|
|
|
<el-button style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;" type="primary" :loading="drawingNoSaving" @click="saveDrawingNoOnly">保存编码</el-button> |
|
|
|
|
|
</template> |
|
|
<el-input |
|
|
<el-input |
|
|
:value="formatDrawingNoForDisplay(modalData.drawingNo)" |
|
|
:value="formatDrawingNoForDisplay(modalData.drawingNo)" |
|
|
style="width: 150px" |
|
|
style="width: 150px" |
|
|
@ -4046,6 +4050,31 @@ import CodeGeneration from "../../code/generation.vue"; |
|
|
this.drawingNoDialogVisible = true; |
|
|
this.drawingNoDialogVisible = true; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async saveDrawingNoOnly () { |
|
|
|
|
|
this.drawingNoSaving = true |
|
|
|
|
|
const payload = { |
|
|
|
|
|
site: this.modalData.site, |
|
|
|
|
|
partNo: this.modalData.partNo, |
|
|
|
|
|
drawingNo: this.modalData.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.$alert(data.msg, '错误', { |
|
|
|
|
|
confirmButtonText: '确定' |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
this.$message.error(error) |
|
|
|
|
|
} finally { |
|
|
|
|
|
this.drawingNoSaving = false |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
async autoSaveDrawingNo(drawingNo, previousDrawingNo) { |
|
|
async autoSaveDrawingNo(drawingNo, previousDrawingNo) { |
|
|
if (this.modalData.flag !== '2' || this.modalData.status !== 'Y') { |
|
|
if (this.modalData.flag !== '2' || this.modalData.status !== 'Y') { |
|
|
return |
|
|
return |
|
|
|