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