入库部分和接口

This commit is contained in:
张怡蓉
2026-01-27 17:31:05 +08:00
parent 407b1f08b5
commit 0ffe411dba
12 changed files with 247 additions and 87 deletions

View File

@@ -19,9 +19,9 @@
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="供应商" prop="supplierId">
<el-form-item label="供应商" prop="classNo">
<el-input
v-model="form.supplierName"
v-model="form.classNo"
placeholder="请选择供应商"
@click.native="openSupplierSelector"
readonly
@@ -73,11 +73,40 @@
<!-- <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="unit" />
<el-table-column fixed label="规格型号" align="left" prop="spec" />
<el-table-column fixed label="层级关系" align="left" prop="spare1" />
<el-table-column fixed label="上层物料" align="left" prop="spare2" />
<el-table-column fixed label="顶层物料" align="left" prop="spare3" />
<el-table-column fixed label="单位" align="left" >
<template slot-scope="scope">
<el-input
v-model="scope.row.unit"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column fixed label="规格型号" align="left" prop="spec" />
<el-table-column fixed label="层级关系" align="left" >
<template slot-scope="scope">
<el-input
v-model="scope.row.spare1"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column fixed label="上层物料" align="left" >
<template slot-scope="scope">
<el-input
v-model="scope.row.spare2"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column label="顶层物料" align="left" >
<template slot-scope="scope">
<el-input
v-model="scope.row.spare3"
controls-position="right"
/>
</template>
</el-table-column>
<el-table-column label="数量" width="120" align="left">
<template slot-scope="scope">
<el-input-number
@@ -92,7 +121,7 @@
<el-input
v-model="scope.row.lotNo"
controls-position="right"
required="required"/>
/>
</template>
</el-table-column>
<!-- <el-table-column label="单位" width="120" align="right">-->
@@ -554,24 +583,24 @@ export default {
const newProducts = this.selectedProducts.map(item => ({
productGuid: item.productGuid,
productId: item.productId,
parentId: item.parentId,
price: item.price,
cargoNo: item.cargoNo,
unit: "",
// parentId: item.parentId,
// price: item.price,
// cargoNo: item.cargoNo,
// unit: "",
spec: item.spec,
remark: item.remark,
// remark: item.remark,
productName: item.productName,
quantity: 1,
spare1: item.spare1,
spare2: item.spare2,
spare3: item.spare3,
spare4: item.spare4,
spare5: item.spare5,
spare6: item.spare6,
spare7: item.spare7,
spare8: item.spare8,
spare9:"",
lotNo:"",
// quantity: 1,
// spare1: item.spare1,
// spare2: item.spare2,
// spare3: item.spare3,
// spare4: item.spare4,
// spare5: item.spare5,
// spare6: item.spare6,
// spare7: item.spare7,
// spare8: item.spare8,
// spare9:"",
// lotNo:"",
}));
this.productList.push(...newProducts);
@@ -618,59 +647,60 @@ export default {
for (let i = 0; i < this.productList.length; i++) {
const item = this.productList[i];
if (!item.spare1) {
this.$modal.msgError(`品号 ${item.productId} 的型号未填写`);
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} 的分销未填写`);
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;
// }
}
// 构建请求数据
const data = {
warehouseId: "01",
supplierId: this.form.supplierId,
classNo:this.classNo,
remark: this.form.remark,
inType:this.form.inType,
erpBill:this.form.erpBill,
@@ -686,12 +716,12 @@ export default {
spare1: item.spare1,
spare2: item.spare2,
spare3: item.spare3,
spare4: item.spare4,
spare5: item.spare5,
spare6: item.spare6,
spare7: item.spare7,
spare8: item.spare8,
spare9: item.spare9,
// spare4: item.spare4,
// spare5: item.spare5,
// spare6: item.spare6,
// spare7: item.spare7,
// spare8: item.spare8,
// spare9: item.spare9,
unit:item.unit,
productName: item.productName
}))

View File

@@ -267,7 +267,7 @@ import VueQr from 'vue-qr'
export default {
name: "StockIn",
dicts: ['bill_resource', 'in_bill_status', 'in_bill_type', 'bill_resource'],
dicts: ['bill_resource', 'in_bill_status', 'in_bill_type'],
components: {
vueEasyPrint,
VueQr