|
|
|
@ -825,7 +825,7 @@ export default {
|
|
|
|
|
//查询物料数据 |
|
|
|
|
let asd = await getListMaterial(this.page.currentPage, this.page.pageSize, { |
|
|
|
|
name: query, |
|
|
|
|
pid: this.stockList.materialId, |
|
|
|
|
// pid: this.stockList.materialId, |
|
|
|
|
}).then(); |
|
|
|
|
console.log('物料信息', asd.data.data); |
|
|
|
|
if (!!asd.data.data) { |
|
|
|
@ -1019,15 +1019,18 @@ export default {
|
|
|
|
|
// return ; |
|
|
|
|
// } |
|
|
|
|
if (!this.form.id) { |
|
|
|
|
/* const regex = /^\d+$/; |
|
|
|
|
if (regex.test(this.formInline.materialId)) { |
|
|
|
|
// console.log("全是数字"); |
|
|
|
|
asm.materialId = this.formInline.materialId |
|
|
|
|
} else { |
|
|
|
|
// console.log("包含非数字字符"); |
|
|
|
|
asm.materialId = this.formInline.materialCode; |
|
|
|
|
}*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let regexs = /^\s*\d+\s*$/;// 匹配一个或多个数字字符 |
|
|
|
|
if(!regexs.test(this.formInline.unpackingQuantity)){ |
|
|
|
|
this.$message.warning('请输入正确的拆箱数量'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
if(!regexs.test(this.formInline.packageNum)){ |
|
|
|
|
this.$message.warning('请输入正确的包装数量'); |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (parseInt(this.formInline.unpackingQuantity) > parseInt(this.getQuery.quantityStock)) { |
|
|
|
|
this.$message.warning('拆包数量大于在库数量!!!'); |
|
|
|
|
return; |
|
|
|
@ -1036,8 +1039,7 @@ export default {
|
|
|
|
|
const numbers = this.getQuery.packageNum.match(regex); // 使用match方法获取匹配到的数字数组 |
|
|
|
|
parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
|
|
|
|
|
this.formInline.storeNum = |
|
|
|
|
parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
this.formInline.storeNum = parseInt(numbers[0]) * parseInt(this.formInline.unpackingQuantity); |
|
|
|
|
} |
|
|
|
|
// this.formInline.id =this.stockList.id; |
|
|
|
|
this.formInline.materialId = this.stockList.materialId; |
|
|
|
@ -1047,8 +1049,10 @@ export default {
|
|
|
|
|
? this.stockList.storeId |
|
|
|
|
: null; |
|
|
|
|
|
|
|
|
|
console.log('提交的值', this.formInline); |
|
|
|
|
|
|
|
|
|
addParcels(this.formInline).then(() => { |
|
|
|
|
this.formInline = {}; |
|
|
|
|
this.unpackFormDisable={} |
|
|
|
|
this.box = false; |
|
|
|
|
this.dismantle = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
@ -1056,7 +1060,8 @@ export default {
|
|
|
|
|
type: 'success', |
|
|
|
|
message: '操作成功!', |
|
|
|
|
}); |
|
|
|
|
this.formInline = {}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
} else { |
|
|
|
|
update(this.form).then(() => { |
|
|
|
|