单据新增序列号重复问题修复

dev
郑明梁 2 years ago
parent 1dc77e2516
commit 0fc118ce2d

@ -68,4 +68,11 @@ export function getCodeListForEdit(params){
}); });
} }
export function checkTempCode(query) {
return axios({
url: "warehouse/inout/checkTempCode",
method: "post",
data: query
});
}

@ -652,6 +652,7 @@ export default {
this.codeFormData.batchNo = response.data.batchNo; this.codeFormData.batchNo = response.data.batchNo;
this.codeFormData.serialNo = response.data.serialNo; this.codeFormData.serialNo = response.data.serialNo;
this.codeFormData.orderId = this.orderFormData.billNo; this.codeFormData.orderId = this.orderFormData.billNo;
this.codeFormData.corpOrderId = this.orderFormData.corpOrderId;
this.$message({ this.$message({
type: 'error', type: 'error',
message: "提交失败!" + this.editTitle, message: "提交失败!" + this.editTitle,

@ -73,7 +73,8 @@
import { import {
findByCode, findByCode,
saveCode saveCode,
checkTempCode
} from "@/api/inout/code"; } from "@/api/inout/code";
import { isBlank } from '@/utils/strUtil' import { isBlank } from '@/utils/strUtil'
@ -113,7 +114,20 @@ export default {
methods: { methods: {
saveCode() { saveCode() {
if (this.editType == 1 || this.editType == "1") { if (this.editType == 1 || this.editType == "1") {
this.repeatAddCode(this.editData); //
if (!isBlank(this.editData.serialNo)) {
checkTempCode(this.editData).then((response) => {
if (response.code === 20000) {
this.repeatAddCode(this.editData);
return
} else {
this.$message.error(response.message);
return
}
});
}else{
this.repeatAddCode(this.editData);
}
} else { } else {
saveCode(this.editData) saveCode(this.editData)
.then((response) => { .then((response) => {

Loading…
Cancel
Save