fix: 检验大表需按照班次筛选

This commit is contained in:
shijing 2025-09-03 16:29:40 +08:00
parent bb67831a61
commit 8c545f3705
2 changed files with 100 additions and 64 deletions

View File

@ -7,13 +7,37 @@
clearable clearable
style="width: 200px;" style="width: 200px;"
></el-input> ></el-input>
<el-select
v-model="query.shiftcc"
placeholder="尺寸班次"
style="width: 130px;"
>
<el-option
v-for="item in shiftOptions"
:label="item.name"
:value="item.name"
:key="item.id"
></el-option>
</el-select>
<el-select
v-model="query.shiftwg"
placeholder="外观班次"
style="width: 130px;"
>
<el-option
v-for="item in shiftOptions"
:label="item.name"
:value="item.name"
:key="item.id"
></el-option>
</el-select>
<el-date-picker <el-date-picker
v-model="query.cc_data_start" v-model="query.cc_data_start"
type="date" type="date"
placeholder="尺寸检验开始日期" placeholder="尺寸检验开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.cc_data_end" v-model="query.cc_data_end"
@ -21,7 +45,7 @@
placeholder="尺寸检验结束日期" placeholder="尺寸检验结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.wg_data_start" v-model="query.wg_data_start"
@ -29,7 +53,7 @@
placeholder="外观检验开始日期" placeholder="外观检验开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.wg_data_end" v-model="query.wg_data_end"
@ -37,7 +61,7 @@
placeholder="外观检验结束日期" placeholder="外观检验结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.fx_data_start" v-model="query.fx_data_start"
@ -45,7 +69,7 @@
placeholder="返修开始日期" placeholder="返修开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.fx_data_end" v-model="query.fx_data_end"
@ -53,7 +77,7 @@
placeholder="返修结束日期" placeholder="返修结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-button <el-button
type="primary" type="primary"
@ -349,6 +373,8 @@ export default {
wg_data_end:'', wg_data_end:'',
fx_data_start:'', fx_data_start:'',
fx_data_end:'', fx_data_end:'',
shiftcc:'',
shiftwg:'',
}, },
params: { params: {
page:1, page:1,
@ -364,13 +390,21 @@ export default {
dataTotal:0, dataTotal:0,
options:[], options:[],
tableData:[], tableData:[],
shiftOptions:[],
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
that.getList(); that.getList();
that.getShift();
}, },
methods: { methods: {
getShift(){
let that = this;
that.$API.mtm.shift.list.req({page:0}).then((res) => {
that.shiftOptions = res;
});
},
getList(val){ getList(val){
let that = this; let that = this;
that.params.page = val?val:1; that.params.page = val?val:1;
@ -409,56 +443,37 @@ export default {
if(key=='batch'){ if(key=='batch'){
obj.field = "batch"; obj.field = "batch";
obj.compare = "contains"; obj.compare = "contains";
arr1.push(obj);
arr2.push(obj);
arr3.push(obj);
}else if(key=='cc_data_start'){ }else if(key=='cc_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__尺寸检验_日期"; obj.field = "data__尺寸检验_日期";
arr1.push(obj);
}else if(key=='cc_data_end'){ }else if(key=='cc_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__尺寸检验_日期"; obj.field = "data__尺寸检验_日期";
arr1.push(obj); }else if(key=='shiftcc'){
obj.compare = "";
obj.field = "data__尺寸检验_班次";
}else if(key=='wg_data_start'){ }else if(key=='wg_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__外观检验_日期"; obj.field = "data__外观检验_日期";
arr2.push(obj);
}else if(key=='wg_data_end'){ }else if(key=='wg_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__外观检验_日期"; obj.field = "data__外观检验_日期";
arr2.push(obj); }else if(key=='shiftwg'){
obj.compare = "";
obj.field = "data__外观检验_班次";
}else if(key=='fx_data_start'){ }else if(key=='fx_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__返修_日期"; obj.field = "data__返修_日期";
arr3.push(obj);
}else if(key=='fx_data_end'){ }else if(key=='fx_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__返修_日期"; obj.field = "data__返修_日期";
arr3.push(obj);
} }
arr1.push(obj);
arr2.push(obj);
arr3.push(obj);
} }
} }
if((that.query.cc_data_start != ""&&that.query.cc_data_start != null)||(that.query.cc_data_end != ""&&that.query.cc_data_end != null)){ that.params.querys.push(arr1,arr2,arr3);
console.log('arr1');
console.log(arr1);
that.params.querys.push(arr1);
}
if((that.query.wg_data_start != ""&&that.query.wg_data_start != null)||(that.query.wg_data_end != ""&&that.query.wg_data_end != null)){
console.log('arr2');
console.log(arr2);
that.params.querys.push(arr2);
}
if((that.query.fx_data_start != ""&&that.query.fx_data_start != null)||(that.query.fx_data_end != ""&&that.query.fx_data_end != null)){
console.log('arr3');
console.log(arr3);
that.params.querys.push(arr3);
}
if((that.query.cc_data_start == ""||that.query.cc_data_start == null)&&(that.query.cc_data_end == ""||that.query.cc_data_end== null)&&
(that.query.wg_data_start == ""||that.query.wg_data_start == null)&&(that.query.wg_data_end == ""||that.query.wg_data_end == null)&&
(that.query.fx_data_start == ""||that.query.fx_data_start == null)&&(that.query.fx_data_end == ""||that.query.fx_data_end == null)){
that.params.querys.push(arr1,arr2,arr3);
}
this.getList(); this.getList();
}, },
getSummaries({ columns, data }) { getSummaries({ columns, data }) {

View File

@ -7,13 +7,37 @@
clearable clearable
style="width: 200px;" style="width: 200px;"
></el-input> ></el-input>
<el-select
v-model="query.shiftcc"
placeholder="尺寸班次"
style="width: 130px;"
>
<el-option
v-for="item in shiftOptions"
:label="item.name"
:value="item.name"
:key="item.id"
></el-option>
</el-select>
<el-select
v-model="query.shiftwg"
placeholder="外观班次"
style="width: 130px;"
>
<el-option
v-for="item in shiftOptions"
:label="item.name"
:value="item.name"
:key="item.id"
></el-option>
</el-select>
<el-date-picker <el-date-picker
v-model="query.cc_data_start" v-model="query.cc_data_start"
type="date" type="date"
placeholder="尺寸检验开始日期" placeholder="尺寸检验开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.cc_data_end" v-model="query.cc_data_end"
@ -21,7 +45,7 @@
placeholder="尺寸检验结束日期" placeholder="尺寸检验结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.wg_data_start" v-model="query.wg_data_start"
@ -29,7 +53,7 @@
placeholder="外观检验开始日期" placeholder="外观检验开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.wg_data_end" v-model="query.wg_data_end"
@ -37,7 +61,7 @@
placeholder="外观检验结束日期" placeholder="外观检验结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.fx_data_start" v-model="query.fx_data_start"
@ -45,7 +69,7 @@
placeholder="返修开始日期" placeholder="返修开始日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin: 5px" style="width: 130px; margin: 5px"
></el-date-picker> ></el-date-picker>
<el-date-picker <el-date-picker
v-model="query.fx_data_end" v-model="query.fx_data_end"
@ -53,7 +77,7 @@
placeholder="返修结束日期" placeholder="返修结束日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
clearable clearable
style="width: 160px; margin:0" style="width: 130px; margin:0"
></el-date-picker> ></el-date-picker>
<el-button <el-button
type="primary" type="primary"
@ -290,6 +314,8 @@ export default {
wg_data_end:'', wg_data_end:'',
fx_data_start:'', fx_data_start:'',
fx_data_end:'', fx_data_end:'',
shiftcc:'',
shiftwg:'',
}, },
params: { params: {
page:1, page:1,
@ -305,13 +331,21 @@ export default {
dataTotal:0, dataTotal:0,
options:[], options:[],
tableData:[], tableData:[],
shiftOptions:[],
}; };
}, },
mounted() { mounted() {
let that = this; let that = this;
that.getList(); that.getList();
that.getShift();
}, },
methods: { methods: {
getShift(){
let that = this;
that.$API.mtm.shift.list.req({page:0}).then((res) => {
that.shiftOptions = res;
});
},
getList(val){ getList(val){
let that = this; let that = this;
that.params.page = val?val:1; that.params.page = val?val:1;
@ -350,50 +384,37 @@ export default {
if(key=='batch'){ if(key=='batch'){
obj.field = "batch"; obj.field = "batch";
obj.compare = "contains"; obj.compare = "contains";
arr1.push(obj);
arr2.push(obj);
arr3.push(obj);
}else if(key=='cc_data_start'){ }else if(key=='cc_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__尺寸检验_日期"; obj.field = "data__尺寸检验_日期";
arr1.push(obj);
}else if(key=='cc_data_end'){ }else if(key=='cc_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__尺寸检验_日期"; obj.field = "data__尺寸检验_日期";
arr1.push(obj); }else if(key=='shiftcc'){
obj.compare = "";
obj.field = "data__尺寸检验_班次";
}else if(key=='wg_data_start'){ }else if(key=='wg_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__外观检验_日期"; obj.field = "data__外观检验_日期";
arr2.push(obj);
}else if(key=='wg_data_end'){ }else if(key=='wg_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__外观检验_日期"; obj.field = "data__外观检验_日期";
arr2.push(obj); }else if(key=='shiftwg'){
obj.compare = "";
obj.field = "data__外观检验_班次";
}else if(key=='fx_data_start'){ }else if(key=='fx_data_start'){
obj.compare = "gte"; obj.compare = "gte";
obj.field = "data__返修_日期"; obj.field = "data__返修_日期";
arr3.push(obj);
}else if(key=='fx_data_end'){ }else if(key=='fx_data_end'){
obj.compare = "lte"; obj.compare = "lte";
obj.field = "data__返修_日期"; obj.field = "data__返修_日期";
arr3.push(obj);
} }
arr1.push(obj);
arr2.push(obj);
arr3.push(obj);
} }
} }
if((that.query.cc_data_start != ""&&that.query.cc_data_start != null)||(that.query.cc_data_end != ""&&that.query.cc_data_end != null)){ that.params.querys.push(arr1,arr2,arr3);
that.params.querys.push(arr1);
}
if((that.query.wg_data_start != ""&&that.query.wg_data_start != null)||(that.query.wg_data_end != ""&&that.query.wg_data_end != null)){
that.params.querys.push(arr2);
}
if((that.query.fx_data_start != ""&&that.query.fx_data_start != null)||(that.query.fx_data_end != ""&&that.query.fx_data_end != null)){
that.params.querys.push(arr3);
}
if((that.query.cc_data_start == ""||that.query.cc_data_start == null)&&(that.query.cc_data_end == ""||that.query.cc_data_end== null)&&
(that.query.wg_data_start == ""||that.query.wg_data_start == null)&&(that.query.wg_data_end == ""||that.query.wg_data_end == null)&&
(that.query.fx_data_start == ""||that.query.fx_data_start == null)&&(that.query.fx_data_end == ""||that.query.fx_data_end == null)){
that.params.querys.push(arr1,arr2,arr3);
}
this.getList(); this.getList();
}, },
getSummaries({ columns, data }) { getSummaries({ columns, data }) {