入库管理根据 物料名称和批号搜索
This commit is contained in:
@@ -67,15 +67,29 @@
|
||||
<el-table-column fixed :label="$t('receiveStockinAdd.spare1')" align="center" prop="spare1"/><!--英文描述-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.unit')" align="center" prop="unit" /><!--单位-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare2')" align="center" prop="spare2" /><!--单件净重KG-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.totalNetWeight')" align="center" prop="totalNetWeight" /><!--总净重-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.totalNetWeight')" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quantity * scope.row.spare2).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare3')" align="center" prop="spare3" /><!--箱号-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare4')" align="center" prop="spare4" /><!--包装方式-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare5')" align="center" prop="spare5" /><!--长MM-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare6')" align="center" prop="spare6" /><!--宽MM-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare7')" align="center" prop="spare7" /><!--高MM-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.spare8')" align="center" prop="spare8" /><!--体积m³-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.netWeight')" align="center" prop="netWeight" /><!--净重KG-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.grossWeight')" align="center" prop="grossWeight" /><!--毛重KG-->
|
||||
<!-- <el-table-column :label="$t('receiveStockinAdd.netWeight')" align="center" prop="netWeight" />净重KG -->
|
||||
<el-table-column :label="$t('receiveStockinAdd.netWeight')" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quantity * scope.row.spare2).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column :label="$t('receiveStockinAdd.grossWeight')" align="center" prop="grossWeight" />毛重KG -->
|
||||
<el-table-column :label="$t('receiveStockinAdd.grossWeight')" width="120" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (scope.row.quantity * scope.row.spare2).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('receiveStockinAdd.price')" align="center" prop="price" /><!--价格-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.remark')" align="center" prop="remark" /><!--描述-->
|
||||
<el-table-column :label="$t('receiveStockinAdd.batchNumber')" width="120" align="center">
|
||||
@@ -135,7 +149,7 @@
|
||||
|
||||
<div class="submit-block" style="margin-top: 20px; text-align: right">
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['receive:stockin:add']">{{ $t('receiveStockinAdd.submit') }}</el-button>
|
||||
<el-button @click="cancel">{{ $t('receiveStockinAdd.cancel') }}</el-button>
|
||||
<el-button @click="cancelPri">{{ $t('receiveStockinAdd.cancel') }}</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 选择物料对话框 -->
|
||||
@@ -348,19 +362,8 @@ export default {
|
||||
calculateTotal() {
|
||||
this.totalQuantity = this.productList.reduce((sum, item) => sum + (item.quantity || 0), 0);
|
||||
this.totalAmount = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.price || 0)), 0);
|
||||
|
||||
// 遍历产品列表,计算每个产品的重量
|
||||
this.productList.forEach(item => {
|
||||
// 计算总净重(单件净重×数量)
|
||||
item.totalNetWeight = (item.quantity || 0) * (item.spare2 || 0);
|
||||
// 净重等于总净重
|
||||
item.netWeight = item.totalNetWeight;
|
||||
// 毛重等于总净重
|
||||
item.grossWeight = item.totalNetWeight;
|
||||
});
|
||||
|
||||
// 计算表单总计
|
||||
this.totalNetWeight = this.productList.reduce((sum, item) => sum + (item.totalNetWeight || 0), 0);
|
||||
this.totalNetWeight = this.productList.reduce((sum, item) => sum + ((item.quantity || 0) * (item.spare2 || 0)), 0);
|
||||
this.netWeight = this.totalNetWeight;
|
||||
this.grossWeight = this.totalNetWeight;
|
||||
|
||||
@@ -370,6 +373,24 @@ export default {
|
||||
this.form.netWeight = this.netWeight;
|
||||
this.form.grossWeight = this.grossWeight;
|
||||
},
|
||||
cancelPri(){
|
||||
// 重置表单数据
|
||||
this.form = {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
};
|
||||
// 清空物料列表
|
||||
this.productList = [];
|
||||
// 重置计数器
|
||||
this.totalQuantity = 0;
|
||||
this.totalAmount = 0;
|
||||
// 重置表单校验结果
|
||||
this.$refs["form"].resetFields();
|
||||
|
||||
},
|
||||
/** 表单提交 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
@@ -415,20 +436,7 @@ export default {
|
||||
addStockin(data).then(() => {
|
||||
this.$modal.msgSuccess(this.$t('receiveStockinAdd.addSuccess'));
|
||||
// 重置表单数据
|
||||
this.form = {
|
||||
warehouseId: undefined,
|
||||
supplierId: undefined,
|
||||
remark: undefined,
|
||||
totalQuantity: 0,
|
||||
totalAmount: 0,
|
||||
};
|
||||
// 清空物料列表
|
||||
this.productList = [];
|
||||
// 重置计数器
|
||||
this.totalQuantity = 0;
|
||||
this.totalAmount = 0;
|
||||
// 重置表单校验结果
|
||||
this.$refs["form"].resetFields();
|
||||
cancelPri()
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -436,6 +444,7 @@ export default {
|
||||
cancel() {
|
||||
this.productSelectVisible = false;
|
||||
},
|
||||
|
||||
/** 导入按钮操作 */
|
||||
handleImport() {
|
||||
this.upload.title = this.$t('receiveStockinAdd.uploadTitle')
|
||||
@@ -454,7 +463,7 @@ export default {
|
||||
this.upload.open = false
|
||||
this.upload.isUploading = false
|
||||
this.$refs.upload.clearFiles()
|
||||
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
|
||||
//this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
|
||||
if (response.code === 200) {
|
||||
this.$modal.msgSuccess("导入成功");
|
||||
this.productList.push(...response.data)
|
||||
|
||||
@@ -108,18 +108,34 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('inReceiveStockin.supplierNo')" prop="supplierNo"><!--供应商编码-->
|
||||
<!-- <el-form-item :label="$t('inReceiveStockin.supplierNo')" prop="supplierNo"><!–供应商编码–>-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.supplierNo"-->
|
||||
<!-- :placeholder="$t('inReceiveStockin.inputSupplierNo')"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item :label="$t('inReceiveStockin.stockSource')" prop="stockSource"><!–单据来源–>-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.stockSource"-->
|
||||
<!-- :placeholder="$t('inReceiveStockin.inputStockSource')"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item :label="$t('inReceiveStockin.materialDesc')" prop="stockSource"><!--物料描述-->
|
||||
<el-input
|
||||
v-model="queryParams.supplierNo"
|
||||
:placeholder="$t('inReceiveStockin.inputSupplierNo')"
|
||||
v-model="queryParams.materialDesc"
|
||||
:placeholder="$t('inReceiveStockin.inputMaterialDesc')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('inReceiveStockin.stockSource')" prop="stockSource"><!--单据来源-->
|
||||
<el-form-item :label="$t('inReceiveStockin.lotNo')" prop="stockSource"><!--批号-->
|
||||
<el-input
|
||||
v-model="queryParams.stockSource"
|
||||
:placeholder="$t('inReceiveStockin.inputStockSource')"
|
||||
v-model="queryParams.lotNo"
|
||||
:placeholder="$t('inReceiveStockin.inputLotNo')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,22 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('inReceiveStockin.materialDesc')" prop="materialDesc"><!--物料描述-->
|
||||
<el-input
|
||||
v-model="queryParams.materialDesc"
|
||||
:placeholder="$t('inReceiveStockin.inputMaterialDesc')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('inReceiveStockin.lotNo')" prop="lotNo"><!--批号-->
|
||||
<el-input
|
||||
v-model="queryParams.lotNo"
|
||||
:placeholder="$t('inReceiveStockin.inputLotNo')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('inReceiveStockin.inType')" prop="inType"><!--入库类型-->
|
||||
<el-select v-model="queryParams.inType" :placeholder="$t('inReceiveStockin.selecInType')" clearable>
|
||||
<el-option
|
||||
|
||||
Reference in New Issue
Block a user