fix:库存统计查询更改

This commit is contained in:
shijing 2024-05-28 14:56:44 +08:00
parent 4dc039bef6
commit 13eb12434f
1 changed files with 25 additions and 51 deletions

View File

@ -8,7 +8,7 @@
</div>
<div class="right-panel">
<el-select
v-model="params.material__type"
v-model="params.type"
clearable
@change="materialTypeChange"
>
@ -32,10 +32,7 @@
</el-header>
<el-main>
<scTable
v-show="
params.material__type == 10 ||
params.material__type == 20
"
v-show="params.type == 10 || params.type == 20"
ref="tables1"
:data="tableData1"
id="exportDiv1"
@ -55,11 +52,11 @@
</scTable>
<scTable
v-show="
params.material__type == 30 ||
params.material__type == 40 ||
params.material__type == 50 ||
params.material__type == 60 ||
params.material__type == 70
params.type == 30 ||
params.type == 40 ||
params.type == 50 ||
params.type == 60 ||
params.type == 70
"
ref="tables1"
:apiObj="apiObj"
@ -71,63 +68,43 @@
<el-table-column type="index" width="50" />
<el-table-column
label="物料名"
prop="material_name"
prop="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 label="型号" prop="model">
</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 label="规格" prop="specification">
</el-table-column>
<el-table-column
label="库存总数"
prop="count"
prop="count_mb"
></el-table-column>
<el-table-column
label="周预估值"
v-if="params.material__type == 30"
v-if="params.type == 30"
>
<template #default="scope">
<el-input
v-model="
scope.row.material_
.week_esitimate_consume
"
v-model="scope.row.week_esitimate_consume"
@blur="weekcountChange(scope.row)"
></el-input>
</template>
</el-table-column>
<el-table-column
label="可用天数"
v-if="params.material__type == 30"
v-if="params.type == 30"
>
<template #default="scope">
<span
v-if="
scope.row.material_ &&
scope.row.material_
.week_esitimate_consume !== null
scope.row.week_esitimate_consume &&
scope.row.week_esitimate_consume !==
null
"
>
{{
Math.floor(
scope.row.count /
scope.row.material_
.week_esitimate_consume
scope.row.count_mb /
scope.row.week_esitimate_consume
) * 7
}}
</span>
@ -287,9 +264,9 @@ export default {
data() {
return {
mioTypeEnum,
apiObj: this.$API.inm.warehouse.batch,
apiObj: this.$API.mtm.material.list,
materialType: "",
params: { is_hidden: false, material__type: 10, count__gte: 1 },
params: { is_hidden: false, type: 10, count__gte: 1 },
query: {
mio_type: mioTypeEnum.values[0].key,
},
@ -337,13 +314,10 @@ export default {
materialTypeChange() {
let that = this;
that.tableData1 = [];
if (
that.params.material__type == 10 ||
that.params.material__type == 20
) {
if (that.params.type == 10 || that.params.type == 20) {
let obj = {
query: {
material_types: that.params.material__type,
material_types: that.params.type,
},
};
that.$API.bi.dataset.exec
@ -360,10 +334,10 @@ export default {
//
weekcountChange(row) {
let obj = {
week_esitimate_consume: row.material_.week_esitimate_consume,
week_esitimate_consume: row.week_esitimate_consume,
};
this.$API.mtm.material.setWeekConsume
.req(row.material_.id, obj)
.req(row.id, obj)
.then((res) => {
console.log(res);
this.$refs.tables1.refresh();