入库单据新增

This commit is contained in:
猫猫guowen
2025-09-17 14:53:13 +08:00
parent 080b4a3b7f
commit 75d40e2677

View File

@@ -62,17 +62,72 @@
<el-table :data="productList" border style="width: 100%">
<el-table-column type="index" label="序号" width="50" align="center"/>
<!-- <el-table-column label="主键" align="center" prop="productGuid" />-->
<el-table-column fixed label="物料编码" align="left" prop="productId" /><!--物料编码-->
<el-table-column fixed label="物料名称" align="left" prop="productName" /><!--物料名称-->
<el-table-column fixed label="型号" align="left" prop="spare1"/><!--英文描述-->
<el-table-column label="净重" align="right" prop="spare2"/><!--单件净重KG-->
<el-table-column label="颜色" align="left" prop="spare3" /><!--箱号-->
<el-table-column label="序列号" align="left" prop="spare4" /><!--包装方式-->
<el-table-column label="电压" align="right" prop="spare5" /><!--长MM-->
<el-table-column label="功率" align="right" prop="spare6" /><!--宽MM-->
<el-table-column label="相位" align="right" prop="spare7" /><!--高MM-->
<el-table-column label="毛重" align="right" prop="spare8" /><!--体积m³-->
<el-table-column label="备注" align="center" prop="remark" /><!--描述-->
<el-table-column fixed label="物料编码" align="left" prop="productId" />
<el-table-column fixed label="物料名称" align="left" prop="productName" />
<el-table-column label="型号" align="left">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare1"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="净重" align="right">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare2"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="颜色" align="left">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare3"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="序列号" align="left">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare4"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="电压" align="right">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare5"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="功率" align="right">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare6"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="相位" align="right">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare7"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="毛重" align="right">
<template slot-scope="scope">
<el-input
v-model="scope.row.spare8"
controls-position="right"
required="required"/>
</template>
</el-table-column>
<el-table-column label="数量" width="120" align="right">
<template slot-scope="scope">
<el-input-number
@@ -106,6 +161,13 @@
required="required"/>
</template>
</el-table-column>
<el-table-column label="描述" align="left" prop="remark">
<template slot-scope="scope">
<el-input
v-model="scope.row.remark"
controls-position="right"/>
</template>
</el-table-column>
<el-table-column label="操作" width="100" align="center">
<template slot-scope="scope">
<el-button
@@ -254,6 +316,7 @@ export default {
supplierName: undefined,
remark: undefined,
erpBill:undefined,
inType:undefined,
totalQuantity: 0,
// totalAmount: 0,
totalNetWeight:0,
@@ -269,6 +332,9 @@ export default {
supplierId: [
{required: true, message: "请选择供应商", trigger: "change"}
],
inType:[
{required: true, message: "请选择单据类型", trigger: "change"}
]
},
@@ -504,9 +570,56 @@ export default {
return;
}
//校验lotNo productGuid quantity 不能为空
if (this.productList.some(item => !item.productGuid || !item.quantity|| !item.lotNo||!item.spare9||!item.unit)) {
this.$modal.msgError('入库物料信息不完整');
return;
for (let i = 0; i < this.productList.length; i++) {
const item = this.productList[i];
if (!item.spare1) {
this.$modal.msgError(`物料编码 ${item.productId} 的型号未填写`);
return;
}
if (!item.spare2) {
this.$modal.msgError(`物料编码 ${item.productId} 的净重未填写`);
return;
}
if (!item.spare3) {
this.$modal.msgError(`物料编码 ${item.productId} 的颜色未填写`);
return;
}
if (!item.spare4) {
this.$modal.msgError(`物料编码 ${item.productId} 的序列号未填写`);
return;
}
if (!item.spare5) {
this.$modal.msgError(`物料编码 ${item.productId} 的电压未填写`);
return;
}
if (!item.spare6) {
this.$modal.msgError(`物料编码 ${item.productId} 的功率未填写`);
return;
}
if (!item.spare7) {
this.$modal.msgError(`物料编码 ${item.productId} 的相位未填写`);
return;
}
if (!item.spare8) {
this.$modal.msgError(`物料编码 ${item.productId} 的毛重未填写`);
return;
}
if (!item.quantity) {
this.$modal.msgError(`物料编码 ${item.productId} 的数量未填写`);
return;
}
if (!item.lotNo) {
this.$modal.msgError(`物料编码 ${item.productId} 的批次号未填写`);
return;
}
if (!item.unit) {
this.$modal.msgError(`物料编码 ${item.productId} 的机型未填写`);
return;
}
if (!item.spare9) {
this.$modal.msgError(`物料编码 ${item.productId} 的分销未填写`);
return;
}
}
// 构建请求数据