diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue
index 92d425d9..0debe0b7 100644
--- a/src/views/statistics/stock_statistics.vue
+++ b/src/views/statistics/stock_statistics.vue
@@ -10,6 +10,7 @@
+
+
+
+
+
@@ -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;