fix:库存统计只算仓库库存

This commit is contained in:
shijing 2024-05-24 15:27:00 +08:00
parent e01877ebd2
commit 02475672d7
1 changed files with 35 additions and 17 deletions

View File

@ -68,16 +68,28 @@
<el-table-column type="index" width="50" />
<el-table-column
label="物料名"
prop="name"
></el-table-column>
<el-table-column
label="型号"
prop="model"
></el-table-column>
<el-table-column
label="规格"
prop="specification"
prop="material_name"
></el-table-column>
<el-table-column label="型号">
<template #default="scope">
<span
v-if="scope.row.material_"
style="color: #999999"
>({{ scope.row.material_.model }})</span
>
</template>
</el-table-column>
<el-table-column label="规格">
<template #default="scope">
<span
v-if="scope.row.material_"
style="color: #999999"
>({{
scope.row.material_.specification
}})</span
>
</template>
</el-table-column>
<el-table-column
label="库存总数"
prop="count"
@ -88,7 +100,10 @@
>
<template #default="scope">
<el-input
v-model="scope.row.week_esitimate_consume"
v-model="
scope.row.material_
.week_esitimate_consume
"
@blur="weekcountChange(scope.row)"
></el-input>
</template>
@ -100,15 +115,16 @@
<template #default="scope">
<span
v-if="
scope.row.week_esitimate_consume &&
scope.row.week_esitimate_consume !==
null
scope.row.material_ &&
scope.row.material_
.week_esitimate_consume !== null
"
>
{{
Math.floor(
scope.row.count /
scope.row.week_esitimate_consume
scope.row.material_
.week_esitimate_consume
) * 7
}}
</span>
@ -268,7 +284,7 @@ export default {
data() {
return {
mioTypeEnum,
apiObj: this.$API.mtm.material.list,
apiObj: this.$API.inm.warehouse.batch,
materialType: "",
params: { is_hidden: false, type: 10, count__gte: 1 },
query: {
@ -337,9 +353,11 @@ export default {
},
//
weekcountChange(row) {
let obj = { week_esitimate_consume: row.week_esitimate_consume };
let obj = {
week_esitimate_consume: row.material_.week_esitimate_consume,
};
this.$API.mtm.material.setWeekConsume
.req(row.id, obj)
.req(row.material_.id, obj)
.then((res) => {
console.log(res);
this.$refs.tables1.refresh();