zhp #24

Merged
zhp merged 2 commits from zhp into test 2023-09-13 16:02:03 +08:00
9 changed files with 534 additions and 263 deletions

View File

@ -1,10 +1,10 @@
### ###
# @Author: Do not edit # @Author: Do not edit
# @Date: 2023-08-29 09:40:39 # @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-09-11 15:55:29 # @LastEditTime: 2023-09-12 14:01:15
# @LastEditors: DY # @LastEditors: zhp
# @Description: # @Description:
### ###
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'
@ -12,7 +12,7 @@ ENV = 'development'
VUE_APP_TITLE = 芋道管理系统 VUE_APP_TITLE = 芋道管理系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
VUE_APP_BASE_API = 'http://192.168.1.49:48080' VUE_APP_BASE_API = 'http://192.168.1.188:48080'
# VUE_APP_BASE_API = 'http://192.168.1.8:48080' # VUE_APP_BASE_API = 'http://192.168.1.8:48080'
# VUE_APP_BASE_API = 'http://192.168.0.33:48080' # VUE_APP_BASE_API = 'http://192.168.0.33:48080'
# VUE_APP_BASE_API = 'http://192.168.1.188:48080' # VUE_APP_BASE_API = 'http://192.168.1.188:48080'

View File

@ -0,0 +1,24 @@
/*
* @Author: zhp
* @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-09-13 09:53:45
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
export function getYieldAnalysisPageData(data) {
return request({
url: '/analysis/production-analysis/getOutput',
method: 'post',
data: data
})
}
export function getCT(data) {
return request({
url: '/analysis/production-analysis/getCT',
method: 'post',
data: data
})
}

View File

@ -0,0 +1,16 @@
/*
* @Author: zhp
* @Date: 2023-09-12 14:07:04
* @LastEditTime: 2023-09-13 09:46:44
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
export function getSectionDataSearch(data) {
return request({
url: '/monitoring/production-monitor/getSectionDataSearch',
method: 'post',
data: data
})
}

View File

@ -1 +1 @@
<svg t="1627279997305" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11904" width="40" height="40"><path d="M938.7008 669.525333L938.7008 249.412267c0-90.555733-73.5232-164.078933-164.1472-164.078933L249.378133 85.333333c-90.555733 0-164.078933 73.48906699-164.078933 164.078933l0 525.2096c0 90.555733 73.454933 164.078933 164.07893301 164.078933l525.20959999 0c80.725333 0 147.8656-58.368 161.553067-135.099733-43.52-18.8416-232.106667-100.283733-330.376533-147.182933-74.786133 90.589867-153.088 144.930133-271.121067 144.930133s-196.81279999-72.704-187.357867-161.655467c6.2464-58.402133 46.2848-153.9072 220.296533-137.5232 91.682133 8.6016 133.666133 25.736533 208.418133 50.414933 19.3536-35.4304 35.4304-74.513067 47.616-116.0192L292.0448 436.565333l0-32.8704 164.0448 0 0-58.9824L256 344.712533l1e-8-36.181333 200.12373299 0L456.123733 223.3344c0 0 1.809067-13.312 16.520533-13.31200001l82.056533 1e-8 0 98.474667 213.333333 0 0 36.181333-213.333333 1e-8 0 58.98239999 174.045867 0c-16.00853301 65.1264-40.277333 124.962133-70.690133 177.220267C708.608 599.176533 938.7008 669.525333 938.7008 669.525333L938.7008 669.525333 938.7008 669.525333 938.7008 669.525333zM321.57013299 744.994133c-124.7232 0-144.452267-78.7456-137.83039999-111.65013299 6.5536-32.733867 42.666667-75.502933 112.0256-75.50293301 79.6672 0 151.04 20.445867 236.714667 62.088533C472.302933 698.333867 398.370133 744.994133 321.57013299 744.994133L321.57013299 744.994133 321.57013299 744.994133zM321.57013299 744.994133" fill="#1296db" p-id="11905"></path></svg> <svg t="1627279997305" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11904" width="40" height="40"><path d="M938.7008 669.525333L938.7008 249.412267c0-90.555733-73.5232-164.078933-164.1472-164.078933L249.378133 85.333333c-90.555733 0-164.078933 73.48906699-164.078933 164.078933l0 525.2096c0 90.555733 73.454933 164.078933 164.07893301 164.078933l525.20959999 0c80.725333 0 147.8656-58.368 161.553067-135.099733-43.52-18.8416-232.106667-100.283733-330.376533-147.182933-74.786133 90.589867-153.088 144.930133-271.121067 144.930133s-196.81279999-72.704-187.357867-161.655467c6.2464-58.402133 46.2848-153.9072 220.296533-137.5232 91.682133 8.6016 133.666133 25.736533 208.418133 50.414933 19.3536-35.4304 35.4304-74.513067 47.616-116.0192L292.0448 436.565333l0-32.8704 164.0448 0 0-58.9824L256 344.712533l1e-8-36.181333 200.12373299 0L456.123733 223.3344c0 0 1.809067-13.312 16.520533-13.31200001l82.056533 1e-8 0 98.474667 213.333333 0 0 36.181333-213.333333 1e-8 0 58.98239999 174.045867 0c-16.00853301 65.1264-40.277333 124.962133-70.690133 177.220267C708.608 599.176533 938.7008 669.525333 938.7008 669.525333L938.7008 669.525333 938.7008 669.525333 938.7008 669.525333zM321.57013299 744.994133c-124.7232 0-144.452267-78.7456-137.83039999-111.65013299 6.5536-32.733867 42.666667-75.502933 112.0256-75.50293301 79.6672 0 151.04 20.445867 236.714667 62.088533C472.302933 698.333867 398.370133 744.994133 321.57013299 744.994133L321.57013299 744.994133 321.57013299 744.994133zM321.57013299 744.994133" fill="#1296db" p-id="11905"></path></svg>

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,6 +1,13 @@
/*
* @Author: zhp
* @Date: 2023-09-11 16:18:44
* @LastEditTime: 2023-09-12 14:25:01
* @LastEditors: zhp
* @Description:
*/
import Mock from 'mockjs'; import Mock from 'mockjs';
const baseURL = 'http://192.168.1.49:48080/admin-api'; const baseURL = 'http://192.168.1.188:48080/admin-api';
Mock.setup({ Mock.setup({
timeout: 200, timeout: 200,

View File

@ -0,0 +1,93 @@
<!--
* @Author: zhp
* @Date: 2023-09-13 09:02:25
* @LastEditTime: 2023-09-13 10:33:20
* @LastEditors: zhp
* @Description:
-->
<template>
<div :class="className" :style="{height:height,width:width}" />
</template>
<script>
import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
// import resize from './mixins/resize'
export default {
// mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
},
width: {
type: String,
default: '100%'
},
height: {
type: String,
default: '350px'
},
// autoResize: {
// type: Boolean,
// default: true
// }
},
data() {
return {
chart: null
}
},
// watch: {
// chartData: {
// deep: true,
// handler(val) {
// this.setOptions(val)
// }
// }
// },
mounted() {
// this.$nextTick(() => {
// this.initChart()
// })
},
// beforeDestroy() {
// if (!this.chart) {
// return
// }
// this.chart.dispose()
// this.chart = null
// },
methods: {
initChart(xData, yData,lineName) {
console.log(xData,yData);
this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(xData, yData, lineName)
},
setOptions(xData, yData, lineName) {
let seriesData = []
lineName.forEach((item,index) => {
seriesData.push({
name: item,
data: yData[index],
type: 'line',
})
})
this.chart.setOption({
xAxis: {
type: 'category',
data: xData
},
legend: {
data:lineName
},
yAxis: {
type: 'value'
},
series: seriesData
})
}
}
}
</script>

View File

@ -1,159 +1,200 @@
<!--
* @Author: zhp
* @Date: 2023-09-11 14:21:21
* @LastEditTime: 2023-09-11 14:26:04
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData" />
ref="searchBarForm" <line-chart ref="lineChart" />
@headBtnClick="buttonClick" /> <!-- <pagination
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog'; import { getCT } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine'; import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; import lineChart from '../LineChart'
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [ // const tableProps = [
{ // // {
prop: 'productionLineName', // // prop: 'lineName',
label: '产线名称', // // label: '线',
align: 'center', // // align: 'center',
}, // // },
{ // // {
prop: '', // // prop: 'sum',
label: '工段名称', // // label: '',
align: 'center', // // align: 'center',
}, // // },
{ // // {
prop: '', // // prop: 'dynamicValue',
label: '进片数量/片', // // label: 'dynamicName',
align: 'center', // // align: 'center',
}, // // children:[
{
prop: '', // // ]
label: '出片数量/片', // // }
align: 'center', // ];
},
{
prop: '',
label: '损耗数量/片',
align: 'center',
},
{
prop: '',
label: '损耗面积/m²',
align: 'center',
},
{
prop: '',
label: '损耗比例/%',
align: 'center',
}
];
export default { export default {
mixins: [basicPage], components: {
data() { lineChart,
return { },
urlOptions: { // mixins: [basicPage],
getDataListURL: getLineBindProductLogPage, data() {
}, return {
tableProps, urlOptions: {
tableData: [], getDataListURL: getCT,
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage], },
formConfig: [ tableProps: [],
{ dataListLoading: false,
type: 'select', tableData: [],
label: '产线', listQuery: {
selectOptions: [], // time: ''
param: 'productionLineId', endTime: undefined,
defaultSelect: '', lineId:undefined,
filterable: true, startTime:undefined
}, },
{ xData: [],
type: 'datePicker', yData: [],
label: '时间', optionArrUrl: [getProductionLinePage],
dateType: 'daterange', formConfig: [
format: 'yyyy-MM-dd', {
valueFormat: 'yyyy-MM-dd HH:mm:ss', type: 'select',
rangeSeparator: '-', label: '产线',
startPlaceholder: '开始时间', selectOptions: [],
endPlaceholder: '结束时间', param: 'lineIds',
param: 'createTime', defaultSelect: '',
}, multiple: true,
{ filterable: true,
type: 'button', },
btnName: '搜索', {
name: 'search', type: 'datePicker',
color: 'primary', label: '时间',
}, dateType: 'datetime',
{ format: 'yyyy-MM-dd',
type: 'button', valueFormat: 'yyyy-MM-dd HH:mm:ss',
btnName: '导出', rangeSeparator: '-',
name: 'export', startPlaceholder: '开始时间',
}, endPlaceholder: '结束时间',
], param: 'time',
}; },
}, {
components: { type: 'button',
}, btnName: '搜索',
created() { name: 'search',
this.getArr(); color: 'primary',
}, }
methods: { ],
getArr() { };
const params = { },
page: 1, created() {
limit: 500, this.getArr();
}; },
this.optionArrUrl.forEach((item, index) => { methods: {
item(params).then((response) => { getArr() {
this.formConfig[index].selectOptions = response.data.list; const params = {
}); page: 1,
}); limit: 500,
}, };
buttonClick(val) { this.optionArrUrl.forEach((item, index) => {
switch (val.btnName) { item(params).then((response) => {
case 'search': this.formConfig[index].selectOptions = response.data.list
this.listQuery.pageNo = 1; });
this.listQuery.pageSize = 10; });
this.listQuery.productionLineId = val.productionLineId; },
this.listQuery.productId = val.productId; getData() {
this.listQuery.createTime = val.createTime; this.listQuery.lineId = '1672847052717821953'
this.getDataList(); this.listQuery.startTime = '1693497600000';
break; this.listQuery.endTime = '1693843200000';
case 'reset': this.urlOptions.getDataListURL(this.listQuery).then(res => {
this.$refs.searchBarForm.resetForm(); console.log(res)
this.listQuery = { let arr = [
pageSize: 10, {
pageNo: 1, prop: 'sectionName',
total: 1, label: '工段',
}; align: 'center',
this.getDataList(); },
break; {
default: prop: 'equName',
console.log(val); label: '设备',
} align: 'center',
}, },
}, ]
let eqArr= []
res.data.data.forEach((ele, index) => {
console.log(ele);
eqArr.push(ele.equName)
})
console.log(eqArr)
// console.log(res.data.nameData.slice(1))
res.data.nameData.forEach(item => {
if (eqArr[0] === item.parentId) {
const props = {
'prop': item.name,
'label': item.name,
'align': 'center'
}
}
arr[2].children.push(props)
})
let obj = {
lineName: res.data.data[0].lineName,
sum: res.data.data[0].sum,
}
res.data.data[0].data[0].children.forEach((item, index) => {
console.log(item)
// let data = 'data' + Number(index+1)
obj['' + item.dynamicName + ''] = item.dynamicValue
})
this.tableData = [obj]
console.log(this.tableData)
console.log(arr)
this.tableProps = arr
let xData = []
res.data.nameData.forEach(item => {
xData.push(item.name)
// arr[2].children.push(props)
})
let yData = []
res.data.data[0].data[0].children.forEach((item, index) => {
// console.log(item)
yData.push(item.dynamicValue)
// let data = 'data' + Number(index+1)
// obj['' + item.dynamicName + ''] = item.dynamicValue
})
console.log(this.yData)
this.$refs.lineChart.initChart(xData, yData)
// this.total = response.data.total;
// this.dataListLoading = false;
});
},
buttonClick(val) {
// console.log(val)
switch (val.btnName) {
case 'search':
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
this.getData()
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
}; };
</script> </script>

View File

@ -1,114 +1,95 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<search-bar <search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
:formConfigs="formConfig" <base-table v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData" />
ref="searchBarForm" <line-chart ref="lineChart" />
@headBtnClick="buttonClick" /> <!-- <pagination
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog'; import { getYieldAnalysisPageData } from '@/api/core/analysis/index';
import { getProductionLinePage } from '@/api/core/base/productionLine'; import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; import lineChart from '../LineChart'
// import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [ // const tableProps = [
{ // // {
prop: 'productionLineName', // // prop: 'lineName',
label: '产线', // // label: '线',
align: 'center', // // align: 'center',
}, // // },
{ // // {
prop: '', // // prop: 'sum',
label: '合计', // // label: '',
align: 'center', // // align: 'center',
}, // // },
{ // // {
prop: '', // // prop: 'dynamicValue',
label: '进片数量/片', // // label: 'dynamicName',
align: 'center', // // align: 'center',
}, // // children:[
{
prop: '', // // ]
label: '出片数量/片', // // }
align: 'center', // ];
},
{
prop: '',
label: '损耗数量/片',
align: 'center',
},
{
prop: '',
label: '损耗面积/m²',
align: 'center',
},
{
prop: '',
label: '损耗比例/%',
align: 'center',
}
];
export default { export default {
mixins: [basicPage], components: {
lineChart,
},
// mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getLineBindProductLogPage, getDataListURL: getYieldAnalysisPageData,
}, },
tableProps, tableProps:[],
tableData: [], dataListLoading:false,
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage], tableData: [],
listQuery: {
lineIds: [],
time: ''
},
xData: [],
yData:[],
optionArrUrl: [getProductionLinePage ],
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '产线', label: '产线',
selectOptions: [], selectOptions: [],
param: 'productionLineId', param: 'lineIds',
defaultSelect: '', defaultSelect: '',
multiple:true,
filterable: true, filterable: true,
}, },
{ {
type: 'datePicker', type: 'datePicker',
label: '时间', label: '时间',
dateType: 'daterange', dateType: 'datetime',
format: 'yyyy-MM-dd', format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss', valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'createTime', param: 'time',
}, },
{ {
type: 'button', type: 'button',
btnName: '搜索', btnName: '搜索',
name: 'search', name: 'search',
color: 'primary', color: 'primary',
}, }
{
type: 'button',
btnName: '导出',
name: 'export',
},
], ],
}; };
}, },
components: {
},
created() { created() {
this.getArr(); this.getArr();
}, },
@ -120,19 +101,109 @@ export default {
}; };
this.optionArrUrl.forEach((item, index) => { this.optionArrUrl.forEach((item, index) => {
item(params).then((response) => { item(params).then((response) => {
this.formConfig[index].selectOptions = response.data.list; this.formConfig[index].selectOptions = response.data.list
}); });
}); });
}, },
buttonClick(val) { getData() {
// this.listQuery.lineIds = ['1672847052717821953']
// this.listQuery.productId = val.productId;
// this.listQuery.time = '1694486098000';
this.urlOptions.getDataListURL(this.listQuery).then(res => {
let arr = [
{
prop: 'lineName',
label: '产线',
align: 'center',
},
{
prop: 'sum',
label: '合计',
align: 'center',
},
{
prop: res.data.nameData[0].name,
label: res.data.nameData[0].name,
align: 'center',
children:[
]
}
]
console.log(res.data.nameData.slice(1))
res.data.nameData.slice(1).forEach(item => {
const props = {
'prop': item.name,
'label': item.name,
'align': 'center'
}
arr[2].children.push(props)
})
let tableDataArr =[]
res.data.data.forEach(item => {
let obj = {}
obj.lineName= item.lineName,
obj.sum= item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
console.log(e.dynamicName)
obj['' + e.dynamicName + ''] = e.dynamicValue
console.log(obj['' + e.dynamicName + '']);
})
})
tableDataArr.push(obj)
});
this.tableData = tableDataArr
console.log(this.tableData)
console.log(arr)
this.tableProps = arr
let xData = []
res.data.nameData.slice(1).forEach(item => {
xData.push(item.name)
// arr[2].children.push(props)
})
let yAllData = []
let lineName = []
res.data.data.forEach(item => {
let yData = []
lineName.push(item.lineName)
// let obj = {}
// obj.lineName = item.lineName,
// obj.sum = item.sum,
item.data.forEach((ele, index) => {
// console.log(ele)
ele.children.forEach((e) => {
// let yData = []
yData.push(e.dynamicValue)
})
})
yAllData.push(yData)
});
console.log(lineName)
// res.data.data[0].data[0].children.forEach((item, index) => {
// // console.log(item)
// yData.push(item.dynamicValue)
// // let data = 'data' + Number(index+1)
// // obj['' + item.dynamicName + ''] = item.dynamicValue
// })
// console.log(this.yData)
this.$refs.lineChart.initChart(xData, yAllData, lineName)
// this.total = response.data.total;
// this.dataListLoading = false;
});
},
buttonClick(val) {
// console.log(val)
switch (val.btnName) { switch (val.btnName) {
case 'search': case 'search':
this.listQuery.pageNo = 1; this.listQuery.lineIds = val.lineIds ? val.lineIds :undefined
this.listQuery.pageSize = 10; // this.listQuery.productId = val.productId;
this.listQuery.productionLineId = val.productionLineId; this.listQuery.time = val.time ? new Date(val.time).getTime() : undefined
this.listQuery.productId = val.productId; // this.listQuery.pageNo = 1;
this.listQuery.createTime = val.createTime; // this.listQuery.pageSize = 10;
this.getDataList(); this.getData()
break; break;
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();

View File

@ -7,78 +7,82 @@
<base-table <base-table
v-loading="dataListLoading" v-loading="dataListLoading"
:table-props="tableProps" :table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" /> :table-data="tableData" />
<pagination <!-- <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo" :page.sync="listQuery.pageNo"
:total="listQuery.total" :total="listQuery.total"
@pagination="getDataList" /> @pagination="getDataList" /> -->
</div> </div>
</template> </template>
<script> <script>
import basicPage from '../../mixins/basic-page'; // import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter'; import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog'; import { getSectionDataSearch } from '@/api/core/monitoring';
import { getProductionLinePage } from '@/api/core/base/productionLine'; import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection'; import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [ const tableProps = [
{ {
prop: 'productionLineName', prop: 'proLineName',
label: '产线名称', label: '产线名称',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'sectionName',
label: '工段名称', label: '工段名称',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'inputNum',
label: '进片数量/片', label: '进片数量/片',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'outputNum',
label: '出片数量/片', label: '出片数量/片',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'lossNum',
label: '损耗数量/片', label: '损耗数量/片',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'lossArea',
label: '损耗面积/m²', label: '损耗面积/m²',
align: 'center', align: 'center',
}, },
{ {
prop: '', prop: 'lossRate',
label: '损耗比例/%', label: '损耗比例/%',
align: 'center', align: 'center',
} }
]; ];
export default { export default {
mixins: [basicPage], // mixins: [basicPage],
data() { data() {
return { return {
urlOptions: { urlOptions: {
getDataListURL: getLineBindProductLogPage, getDataListURL: getSectionDataSearch,
}, },
tableProps, tableProps,
tableData: [], tableData: [],
listQuery: {
proLineId:undefined,
sectionId: undefined,
startTime: undefined,
endTime: undefined,
},
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage], optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
formConfig: [ formConfig: [
{ {
type: 'select', type: 'select',
label: '产线', label: '产线',
selectOptions: [], selectOptions: [],
param: 'productionLineId', param: 'proLineId',
defaultSelect: '', defaultSelect: '',
filterable: true, filterable: true,
}, },
@ -86,7 +90,7 @@ export default {
type: 'select', type: 'select',
label: '工段', label: '工段',
selectOptions: [], selectOptions: [],
param: 'productId', param: 'sectionId',
defaultSelect: '', defaultSelect: '',
filterable: true, filterable: true,
}, },
@ -99,7 +103,7 @@ export default {
rangeSeparator: '-', rangeSeparator: '-',
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
param: 'createTime', param: 'timeSlot',
}, },
{ {
type: 'button', type: 'button',
@ -118,7 +122,8 @@ export default {
components: { components: {
}, },
created() { created() {
this.getArr(); this.getArr();
this.getDataList()
}, },
methods: { methods: {
getArr() { getArr() {
@ -131,16 +136,30 @@ export default {
this.formConfig[index].selectOptions = response.data.list; this.formConfig[index].selectOptions = response.data.list;
}); });
}); });
}, },
buttonClick(val) { getDataList() {
switch (val.btnName) { // this.listQuery.proLineId = '1672847052717821953';
case 'search': // this.listQuery.startTime = '1690626657000'
this.listQuery.pageNo = 1; // this.listQuery.endTime = '1693564257000'
this.listQuery.pageSize = 10; this.urlOptions.getDataListURL(this.listQuery).then(res => {
this.listQuery.productionLineId = val.productionLineId; this.tableData = res.data
this.listQuery.productId = val.productId; // this.total = response.data.total;
this.listQuery.createTime = val.createTime; this.dataListLoading = false;
this.getDataList(); });
},
buttonClick(val) {
console.log(val)
switch (val.btnName) {
case 'search':
console.log(val.timeSlot);
// this.listQuery.pageNo = 1;
// this.listQuery.pageSize = 10;
this.listQuery.proLineId = val.proLineId ? val.proLineId : undefined
this.listQuery.sectionId = val.sectionId ? val.sectionId : undefined
this.listQuery.startTime = val.timeSlot ? new Date(val.timeSlot[0]).getTime() : undefined
this.listQuery.endTime = val.timeSlot ? new Date(val.timeSlot[1]).getTime() : undefined
this.getDataList();
break; break;
case 'reset': case 'reset':
this.$refs.searchBarForm.resetForm(); this.$refs.searchBarForm.resetForm();