|
|
|
@ -9,7 +9,9 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-button type="primary" @click="queryBatchNo" :loading="batchLoading">查询批次号</el-button> |
|
|
|
<el-button type="primary" @click="queryBatchNo" :loading="batchLoading" |
|
|
|
|
|
|
|
>查询批次号</el-button |
|
|
|
|
|
|
|
> |
|
|
|
</el-col> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
|
|
|
|
@ -112,8 +114,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
saveLoading:false, |
|
|
|
saveLoading: false, |
|
|
|
batchLoading:false, |
|
|
|
batchLoading: false, |
|
|
|
openShow: false, |
|
|
|
openShow: false, |
|
|
|
wcData: [], |
|
|
|
wcData: [], |
|
|
|
formError: '', // 全局错误提示 |
|
|
|
formError: '', // 全局错误提示 |
|
|
|
@ -155,18 +157,22 @@ export default { |
|
|
|
this.openShow = this.showDialog; |
|
|
|
this.openShow = this.showDialog; |
|
|
|
this.getWorkCenterList(); |
|
|
|
this.getWorkCenterList(); |
|
|
|
// 初始添加一行(可选) |
|
|
|
// 初始添加一行(可选) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
// 根据零件查询批次号 |
|
|
|
// 根据零件查询批次号 |
|
|
|
queryBatchNo(){ |
|
|
|
queryBatchNo() { |
|
|
|
this.batchLoading = true; |
|
|
|
this.batchLoading = true; |
|
|
|
queryBatch({partCode: this.form.partCode}).then(res=>{ |
|
|
|
queryBatch({ partCode: this.form.partCode }) |
|
|
|
this.form.tableData = res.data.data || []; |
|
|
|
.then(res => { |
|
|
|
this.batchLoading = false; |
|
|
|
if (res.data.data) { |
|
|
|
}).catch(err=>{ |
|
|
|
this.form.tableData.push(res.data.data); |
|
|
|
this.batchLoading = false; |
|
|
|
} |
|
|
|
}) |
|
|
|
// this.form.tableData = res.data.data || []; |
|
|
|
|
|
|
|
this.batchLoading = false; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
this.batchLoading = false; |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
getWorkCenterList() { |
|
|
|
getWorkCenterList() { |
|
|
|
getWorkCenterList().then(res => { |
|
|
|
getWorkCenterList().then(res => { |
|
|
|
@ -221,32 +227,33 @@ export default { |
|
|
|
}); |
|
|
|
}); |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
this.saveLoading = true |
|
|
|
this.saveLoading = true; |
|
|
|
|
|
|
|
|
|
|
|
// 调用接口提交(实际项目替换) |
|
|
|
// 调用接口提交(实际项目替换) |
|
|
|
saveDeclare(this.form.tableData).then(res=>{ |
|
|
|
saveDeclare(this.form.tableData) |
|
|
|
this.$message.success('操作成功'); |
|
|
|
.then(res => { |
|
|
|
this.saveLoading = false |
|
|
|
this.$message.success('操作成功'); |
|
|
|
|
|
|
|
this.saveLoading = false; |
|
|
|
|
|
|
|
|
|
|
|
this.closeDialog(); |
|
|
|
this.closeDialog(); |
|
|
|
}).catch(err=>{ |
|
|
|
}) |
|
|
|
this.saveLoading = false |
|
|
|
.catch(err => { |
|
|
|
}) |
|
|
|
this.saveLoading = false; |
|
|
|
// try { |
|
|
|
}); |
|
|
|
// const res = saveDeclare(this.form.tableData); |
|
|
|
// try { |
|
|
|
// if (res.code === 200) { |
|
|
|
// const res = saveDeclare(this.form.tableData); |
|
|
|
// this.$message.success('操作成功'); |
|
|
|
// if (res.code === 200) { |
|
|
|
// this.closeDialog(); |
|
|
|
// this.$message.success('操作成功'); |
|
|
|
// this.$emit('submitSuccess', submitData); |
|
|
|
// this.closeDialog(); |
|
|
|
// } else { |
|
|
|
// this.$emit('submitSuccess', submitData); |
|
|
|
// this.$message.error(res.msg || '操作失败'); |
|
|
|
// } else { |
|
|
|
// } |
|
|
|
// this.$message.error(res.msg || '操作失败'); |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
// } catch (err) { |
|
|
|
// } catch (err) { |
|
|
|
// this.$message.error(err); |
|
|
|
// this.$message.error(err); |
|
|
|
// console.error('提交失败:', err); |
|
|
|
// console.error('提交失败:', err); |
|
|
|
// } |
|
|
|
// } |
|
|
|
}); |
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -283,7 +290,7 @@ export default { |
|
|
|
font-size: 14px; |
|
|
|
font-size: 14px; |
|
|
|
line-height: 1.5; |
|
|
|
line-height: 1.5; |
|
|
|
} |
|
|
|
} |
|
|
|
:deep(.el-table .el-table__cell) { |
|
|
|
:deep(.el-table .el-table-body .el-table__cell) { |
|
|
|
height: 50px !important; |
|
|
|
height: 50px !important; |
|
|
|
padding: 0 !important; |
|
|
|
padding: 0 !important; |
|
|
|
line-height: 50px !important; |
|
|
|
line-height: 50px !important; |
|
|
|
|