lb #31

Merged
g7hoo merged 2 commits from lb into test 2023-09-22 10:54:56 +08:00
3 changed files with 61 additions and 41 deletions
Showing only changes of commit dcda3a6294 - Show all commits

View File

@ -54,6 +54,7 @@
label="按钮盒识别码"
prop="buttonId"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入整数',
@ -98,12 +99,16 @@
label="按钮值"
prop="keyValue"
:rules="[
{ required: true, message: '不能为空', trigger: 'blur' },
{
type: 'number',
message: '请输入100以内的整数',
trigger: 'blur',
transform: (val) =>
Number(val) <= 100 && Number.isInteger(+val) && Number(val),
Number.isInteger(+val) &&
Number(val) >= 0 &&
Number(val) <= 100 &&
Number(val),
},
]">
<el-input
@ -165,10 +170,10 @@ export default {
watch: {
'dataForm.productionId': {
handler(id) {
this.getWorksectionList(id);
if (id != null) this.getWorksectionList(id);
},
immediate: true,
},
immediate: true
}
},
methods: {
/** 模拟透传 ref */

View File

@ -236,7 +236,8 @@ export default {
// width: 160,
prop: 'checkTime',
label: '检测时间',
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
filter: (val) =>
val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
},
{
width: 90,

View File

@ -332,29 +332,47 @@ export default {
},
mounted() {
if (this.$route.params.startTime && this.$route.params.endTime) {
this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
this.searchBarFormConfig[0].defaultSelect = [
this.$route.params.startTime,
this.$route.params.endTime,
];
this.queryParams.param = {};
this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime);
this.$set(
this.queryParams.param,
'startTime',
this.$route.params.startTime
);
this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
} else {
this.searchBarFormConfig[0].defaultSelect = []
this.searchBarFormConfig[0].defaultSelect = [];
}
this.getList();
},
watch: {
$route: 'initData'
$route: 'initData',
},
methods: {
initData(to) {
// console.log(to)
if (to.name === 'QualityStatistics') {
if (this.$route.params.startTime && this.$route.params.endTime) {
this.searchBarFormConfig[0].defaultSelect = [this.$route.params.startTime, this.$route.params.endTime]
this.searchBarFormConfig[0].defaultSelect = [
this.$route.params.startTime,
this.$route.params.endTime,
];
this.queryParams.param = {};
this.$set(this.queryParams.param, 'startTime', this.$route.params.startTime);
this.$set(this.queryParams.param, 'endTime', this.$route.params.endTime);
this.$set(
this.queryParams.param,
'startTime',
this.$route.params.startTime
);
this.$set(
this.queryParams.param,
'endTime',
this.$route.params.endTime
);
} else {
this.searchBarFormConfig[0].defaultSelect = []
this.searchBarFormConfig[0].defaultSelect = [];
}
this.getList();
}
@ -367,20 +385,17 @@ export default {
async getSummaryList() {
const response = await this.$axios({
url: '/monitoring/statistical-data/getUpPart',
method: 'get',
params: this.queryParams.param
method: 'post',
data: this.queryParams.param
? {
param: {
// startTime: new Date(2022, 6, 1, 0, 0, 0).getTime(), // '2023-07-01 00:00:00',
// endTime: new Date(2023, 7, 10, 0, 0, 0).getTime(), // '2023-08-10 00:00:00',
startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime,
},
}
: null,
: {},
});
this.summaryList = response.data;
console.log('summaryList', this.summaryList);
},
/** 获取 检测内容和产线关联 列表 */
async getDetailedList() {
@ -388,22 +403,21 @@ export default {
data: { data, otherList, otherMap, nameData },
} = await this.$axios({
url: '/monitoring/statistical-data/getDownPart',
params: this.queryParams.param
method: 'post',
data: this.queryParams.param
? {
param: {
// startTime: new Date(2023, 6, 1).getTime(), // '2023-07-01 00:00:00',
// endTime: new Date(2023, 7, 22).getTime(), // '2023-08-10 00:00:00',
startTime: this.queryParams.param.startTime,
endTime: this.queryParams.param.endTime,
},
}
: null,
: {},
});
// this.list = response.data;
console.log('data', data);
console.log('otherList', otherList);
console.log('otherMap', otherMap);
console.log('nameData', nameData);
// console.log('data', data);
// console.log('otherList', otherList);
// console.log('otherMap', otherMap);
// console.log('nameData', nameData);
this.dynamicProps = this.filterNameData(nameData);
this.list = this.filterData(data);