基础,物料,设备

This commit is contained in:
helloDy
2023-11-07 15:53:01 +08:00
parent 1d38a560ec
commit fcb1885bf7
21 changed files with 827 additions and 588 deletions

View File

@@ -19,7 +19,7 @@
// import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine';
// import { getProductionLinePage } from '@/api/core/base/productionLine';
import lineChart from '../LineChart'
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
@@ -58,21 +58,20 @@ export default {
dataListLoading:false,
tableData: [],
listQuery: {
lineIds: [],
time: ''
// lineIds: [],
recordTime: []
},
dateLabelList: [],
optionArrUrl: [getProductionLinePage ],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineIds',
defaultSelect: '',
multiple:true,
filterable: true,
},
// {
// type: 'select',
// label: '产线',
// selectOptions: [],
// param: 'lineIds',
// defaultSelect: '',
// multiple:true,
// filterable: true,
// },
{
type: 'datePicker',
label: '时间',
@@ -94,22 +93,22 @@ export default {
};
},
created() {
this.getArr();
// this.getArr();
},
methods: {
getArr() {
const params = {
page: 1,
limit: 500,
};
this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list
// this.formConfig[0].defaultSelect = response.data.list[0].id
this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
});
});
},
// getArr() {
// const params = {
// page: 1,
// limit: 500,
// };
// this.optionArrUrl.forEach((item, index) => {
// item(params).then((response) => {
// this.formConfig[index].selectOptions = response.data.list
// // this.formConfig[0].defaultSelect = response.data.list[0].id
// this.$set(this.formConfig[0], 'defaultSelect', response.data.list[0].id)
// });
// });
// },
getData() {
// this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId;
@@ -230,12 +229,26 @@ export default {
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined
// this.listQuery.productId = val.productId;
this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
// this.listQuery.recordTime = val.time ? new Date(val.time).getTime() : undefined
if (val.time) {
const tempTtime = new Date(val.time)
let day = 0
switch (tempTtime.getMonth() + 1) {
case 1, 3, 5, 7, 8, 10, 12:
day = 31;
break;
case 2:
day = 28;
break;
case 4, 6, 9, 11:
day = 30;
break;
}
console.log(parseTime(new Date(tempTtime.getFullYear(), 11, 31, 23, 59, 59)))
this.listQuery.recordTime = [
val.time,
parseTime(new Date(tempTtime.getFullYear(), tempTtime.getMonth(), day, 23, 59, 59))
]
this.getData()
} else {
this.$message({