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