feat:统计分析->

库存统计 添加物料查询条件,以及右侧物料出入库记录的联动
This commit is contained in:
shijing 2025-10-20 11:23:41 +08:00
parent 354f82bd36
commit 73d96c57da
1 changed files with 66 additions and 12 deletions

View File

@ -10,6 +10,7 @@
<el-select
v-model="params.type"
clearable
style="width: 120px;"
@change="materialTypeChange"
>
<el-option
@ -20,6 +21,19 @@
>
</el-option>
</el-select>
<xtSelect
:apiObj="apiObj"
v-model="query.material"
v-model:obj="selectObj"
:labelField="'name'"
style="width: 150px;"
:params="mquery"
@change="selectMaterialChange"
>
<el-table-column label="名称" prop="name"></el-table-column>
<el-table-column label="型号" prop="model"></el-table-column>
<el-table-column label="规格" prop="spcification"></el-table-column>
</xtSelect>
<el-button
type="primary"
icon="el-icon-search"
@ -67,6 +81,7 @@
id="exportDiv11"
stripe
hideDo
:pageSize="500"
:summary-method="getSummaries2"
show-summary
>
@ -228,16 +243,28 @@ export default {
materialType: "",
params: { is_hidden: false, type: 10, count__gte: 1 },
query: {
material: "",
mio_type: mioTypeEnum.values[0].key,
},
mquery:{
page: 0,
type__in: "10",
is_hidden: false,
is_assemb: false,
},
selectObj: {},
mio_type_name: mioTypeEnum.values[0].text,
queryType: "月",
queryType: "",
queryDate: "",
start_date: "",
end_date: "",
currentYear: "",
currentMonth: "",
currentLastDay: "",
material_name: "",
material_type: "",
material_model: "",
material_specification: "",
tableData: [],
tableData1: [],
tableData11: [],
@ -258,7 +285,6 @@ export default {
{ id: 20, name: "半成品" },
{ id: 30, name: "主要原料" },
{ id: 40, name: "辅助材料" },
{ id: 70, name: "办公用品" },
],
};
},
@ -271,9 +297,9 @@ export default {
that.currentYear = year;
that.currentMonth = month > 9 ? month : "0" + month;
that.currentLastDay = lastDay;
that.queryDate = that.currentYear + "-" + that.currentMonth;
that.start_date = that.currentYear + "-" + that.currentMonth + "-01";
that.end_date = that.currentYear + "-" + that.currentMonth + "-" + lastDay;
that.queryDate = that.currentYear+'';
that.start_date = that.currentYear + "-01-01";
that.end_date = that.currentYear + "-12-31";
that.getTableData();
that.getTableData1();
},
@ -340,6 +366,9 @@ export default {
that.modelFilters11 = [];
that.specsFilters11 = [];
let nameList=[],specsList=[],modelList=[];
if(that.material_name!==''&&that.material_name!==null){
that.params.name = that.material_name;
}
this.$API.mtm.material.list.req(that.params).then((res) => {
that.tableData11 = res.results;
if(res.results.length>0){
@ -371,11 +400,14 @@ export default {
},
materialTypeChange(){
let that = this;
that.mquery.type__in = that.params.type;
that.material_type = that.params.type;
if(that.params.type == 10 || that.params.type == 20){
that.getTableData1();
}else{
that.getTableData11();
}
that.getTableData();
},
//
weekcountChange(row) {
@ -400,6 +432,18 @@ export default {
mio_type: that.query.mio_type,
},
};
if(that.material_name!==''&&that.material_name!==null){
obj.query.material_name = that.material_name;
}
if(that.material_type!==''&&that.material_type!==null){
obj.query.material_type = that.material_type;
}
if(that.material_model!==''&&that.material_model!==null){
obj.query.material_model = that.material_model;
}
if(that.material_specification!==''&&that.material_specification!==null){
obj.query.material_specification = that.material_specification;
}
that.$API.bi.dataset.exec.req(exec, obj).then((res) => {
if (res.data2.ds0) {
let data = res.data2.ds0;
@ -447,6 +491,16 @@ export default {
}
this.getTableData();
},
selectMaterialChange() {
var that = this;
console.log(that.selectObj);
that.query.material = that.selectObj.id;
that.material_name = that.selectObj.name;
that.material_type = that.selectObj.type;
that.material_model = that.selectObj.model;
that.material_specification = that.selectObj.specification;
that.getTableData();
},
handleQuery() {
let that = this;
if (that.queryType == "月") {
@ -523,25 +577,25 @@ export default {
},
filterName1(value, row) {
return row.物料名 == value;
return row.material_name == value;
},
filterSpecs1(value, row) {
return row.规格 == value;
return row.material_specification == value;
},
filterModel1(value, row) {
return row.型号 == value;
return row.material_model == value;
},
filterDept1(value, row) {
return row.完成车间 == value;
return row.dept_name == value;
},
filterName11(value, row) {
return row.物料名 == value;
return row.name == value;
},
filterSpecs11(value, row) {
return row.规格 == value;
return row.specification == value;
},
filterModel11(value, row) {
return row.型号 == value;
return row.model == value;
},
filterName2(value, row) {
return row.物料名 == value;