修改bug
This commit is contained in:
@@ -43,9 +43,9 @@ import basicPage from '../../../core/mixins/basic-page';
|
||||
import { parseTime } from '../../../core/mixins/code-filter';
|
||||
import {
|
||||
getQualityScrapDetPage,
|
||||
deleteQualityScrapDet
|
||||
deleteQualityScrapDet,
|
||||
} from '@/api/base/qualityScrapDet';
|
||||
|
||||
import { getList, } from "@/api/base/qualityScrapType";
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'createTime',
|
||||
@@ -98,10 +98,18 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '批次名',
|
||||
placeholder: '批次名',
|
||||
param: 'name',
|
||||
},
|
||||
label: '报废原因',
|
||||
placeholder: '报废原因',
|
||||
param: 'content',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '报废类型',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'typeId',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '查询',
|
||||
@@ -124,7 +132,10 @@ export default {
|
||||
components: {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {},
|
||||
created() { },
|
||||
mounted () {
|
||||
this.getDict();
|
||||
},
|
||||
methods: {
|
||||
// 获取数据列表
|
||||
getDataList() {
|
||||
@@ -134,13 +145,19 @@ export default {
|
||||
this.listQuery.total = response.data.total;
|
||||
this.dataListLoading = false;
|
||||
});
|
||||
},
|
||||
async getDict() {
|
||||
// 物料列表
|
||||
const res = await getList();
|
||||
this.formConfig[1].selectOptions = res.data;
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name ? val.name : undefined;
|
||||
this.listQuery.content = val.content ? val.content : undefined;
|
||||
this.listQuery.typeId = val.typeId ? val.typeId : undefined;
|
||||
this.getDataList();
|
||||
break;
|
||||
case 'reset':
|
||||
|
||||
@@ -98,8 +98,8 @@ export default {
|
||||
formConfig: [
|
||||
{
|
||||
type: 'input',
|
||||
label: '批次名',
|
||||
placeholder: '批次名',
|
||||
label: '报废类型',
|
||||
placeholder: '报废类型',
|
||||
param: 'name',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -9,12 +9,18 @@
|
||||
<el-tabs v-model="activeName" :stretch="true" @tab-click="handleTabClick">
|
||||
<el-tab-pane :label="'\u2002表格数据\u2002'" name="table">
|
||||
<!-- 列表 -->
|
||||
<div class="blue-title">产品名:{{ productDetail.name }} 产品规格:{{ productDetail.specifications }}</div>
|
||||
<base-table class="base-table__margin" :table-props="productProps" :page="1" :limit="10" :table-data="list">
|
||||
</base-table>
|
||||
<div v-for="(item,index) in downProps" :key="index">
|
||||
<div class="blue-title">工单:{{ list[index].workOrderName }}</div>
|
||||
<base-table class="base-table__margin" :table-props="item" :page="1" :limit="10"
|
||||
:table-data="downList[index]">
|
||||
</base-table>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'\u3000图形数据\u3000'" name="chart" style="overflow: inherit">
|
||||
<!-- <base-table class="base-table__margin" :table-props="valueTableProps" :page="1" :limit="10"
|
||||
:table-data="valueList" @emitFun="handleEmitFun"></base-table> -->
|
||||
<div id="main" style="height: 500px;width: 1000px;"></div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-col>
|
||||
@@ -49,7 +55,7 @@ import {
|
||||
// import Editor from '@/components/Editor';
|
||||
import moment from 'moment';
|
||||
// import DialogForm from './dialogForm.vue';
|
||||
|
||||
import * as echarts from 'echarts';
|
||||
// import basicPageMixin from '@/mixins/lb/basicPageMixin';
|
||||
export default {
|
||||
name: 'statisticalData',
|
||||
@@ -61,6 +67,12 @@ export default {
|
||||
return {
|
||||
list: [],
|
||||
dynamicProps: [],
|
||||
downProps: [],
|
||||
downList: [],
|
||||
productDetail: {
|
||||
name: null,
|
||||
specifications:null,
|
||||
},
|
||||
activeName: 'table',
|
||||
searchBarFormConfig: [
|
||||
// {
|
||||
@@ -202,19 +214,19 @@ export default {
|
||||
return [
|
||||
{
|
||||
// width: 160,
|
||||
prop: 'inspectionContent',
|
||||
label: '检测内容',
|
||||
prop: 'workOrderName',
|
||||
label: '工单名',
|
||||
},
|
||||
...this.dynamicProps,
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumInput',
|
||||
label: '检测类型总数',
|
||||
label: '上片总数',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'scrapRatio',
|
||||
label: '比例(%)',
|
||||
prop: 'sumOutput',
|
||||
label: '下片总数',
|
||||
// subcomponent: {
|
||||
// name: 'TextOnly',
|
||||
// props: {
|
||||
@@ -259,7 +271,61 @@ export default {
|
||||
}
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
methods: {
|
||||
handleTabClick() {
|
||||
if (this.activeName === 'chart') {
|
||||
var chartDom = document.getElementById('main');
|
||||
var myChart = echarts.init(chartDom);
|
||||
var option;
|
||||
let arrXAxis = []
|
||||
this.list.forEach((ele) => {
|
||||
arrXAxis.push(ele.workOrderName)
|
||||
})
|
||||
this.downList.forEach((ele) => {
|
||||
ele.forEach((item) => {
|
||||
if (ele.length !==0 && item.productionline) {
|
||||
arrXAxis.push('产线' + item.productionline)
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
let arrYAxis = []
|
||||
this.list.forEach((ele) => {
|
||||
// console.log(ele);
|
||||
arrYAxis.push(ele.sumInput)
|
||||
})
|
||||
this.downList.forEach((ele) => {
|
||||
ele.forEach((item) => {
|
||||
console.log(item);
|
||||
// if (ele.length !== 0 && item.productionline) {
|
||||
arrYAxis.push(item.sumInput)
|
||||
// }
|
||||
})
|
||||
})
|
||||
// console.log(arrXAxis);
|
||||
option = {
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: arrXAxis
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value'
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: arrYAxis,
|
||||
type: 'bar',
|
||||
showBackground: true,
|
||||
backgroundStyle: {
|
||||
color: 'rgba(180, 180, 180, 0.2)'
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
option && myChart.setOption(option);
|
||||
}
|
||||
},
|
||||
/** 获取搜索栏的产线列表 */
|
||||
// async getDict() {
|
||||
// const res = await getProductList()
|
||||
@@ -297,31 +363,71 @@ export default {
|
||||
/** 查询列表 */
|
||||
async getDataList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
// 执行查询
|
||||
this.downProps= []
|
||||
const res = await getInspectionData(this.queryParams)
|
||||
console.log(res);
|
||||
this.dynamicProps = this.filterNameData(res.data[0].upPart)
|
||||
this.productDetail.name = res.data[0].productName
|
||||
this.productDetail.specifications = res.data[0].specifications
|
||||
// this.productName = res.data[0].productName
|
||||
this.dynamicProps = this.filterNameData(res.data[0].upPart.nameData)
|
||||
console.log(this.dynamicProps)
|
||||
this.list = this.filterData(res.data[0].upPart.data)
|
||||
console.log(this.list);
|
||||
},
|
||||
filterNameData(upData) {
|
||||
console.log(upData);
|
||||
// upData.forEach((ele) => {
|
||||
const ndSet = new Set();
|
||||
upData.nameData.forEach((nd) => {
|
||||
ndSet.add(nd.name);
|
||||
});
|
||||
return Array.from(ndSet.values())
|
||||
.sort()
|
||||
.map((name) => ({
|
||||
prop: name,
|
||||
label: name,
|
||||
}));
|
||||
// })
|
||||
console.log(this.list)
|
||||
res.data[0].downPart.forEach((ele) => {
|
||||
// console.log(ele.data);
|
||||
let arr = this.downFilterNameData(ele.nameData)
|
||||
if (arr.length !== 0) {
|
||||
let propArr = [{
|
||||
// width: 160,
|
||||
prop: 'inspectionContent',
|
||||
label: '检测内容',
|
||||
},
|
||||
...arr,
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumInput',
|
||||
label: '原片总数',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'sumScrap',
|
||||
label: '未通过检测总数',
|
||||
},
|
||||
{
|
||||
// width: 128,
|
||||
prop: 'scrapRatio',
|
||||
label: '报废比例',
|
||||
}]
|
||||
this.downProps.push(propArr)
|
||||
}
|
||||
// this.downProps = []
|
||||
})
|
||||
res.data[0].downPart.forEach((ele) => {
|
||||
// console.log(ele.data);
|
||||
let arr =this.downFilterData(ele.data)
|
||||
if (arr.length !== 0) {
|
||||
this.downList.push(arr)
|
||||
}
|
||||
// this.downProps = []
|
||||
})
|
||||
|
||||
// console.log(this.downList);
|
||||
},
|
||||
filterData(data) {
|
||||
downFilterNameData(nameData) {
|
||||
const ndSet = new Set();
|
||||
nameData.forEach((nd) => {
|
||||
ndSet.add(nd.name);
|
||||
});
|
||||
return Array.from(ndSet.values())
|
||||
.sort()
|
||||
.map((name) => ({
|
||||
prop: name,
|
||||
label: name,
|
||||
}));
|
||||
// })
|
||||
},
|
||||
downFilterData(data) {
|
||||
return data.map((item) => {
|
||||
const { data: innerData } = item;
|
||||
const keyValuePairs = {};
|
||||
@@ -333,6 +439,39 @@ export default {
|
||||
...keyValuePairs,
|
||||
sumInput: item.sumInput,
|
||||
scrapRatio: item.scrapRatio,
|
||||
sumScrap: item.sumScrap
|
||||
};
|
||||
});
|
||||
},
|
||||
filterNameData(nameData) {
|
||||
// console.log(upData);
|
||||
// upData.forEach((ele) => {
|
||||
const ndSet = new Set();
|
||||
|
||||
nameData.forEach((nd) => {
|
||||
ndSet.add(nd.name);
|
||||
});
|
||||
return Array.from(ndSet.values())
|
||||
.sort()
|
||||
.map((name) => ({
|
||||
prop: name,
|
||||
label: name,
|
||||
}));
|
||||
// })
|
||||
},
|
||||
filterData(data) {
|
||||
return data.map((item) => {
|
||||
const { data: innerData } = item;
|
||||
const keyValuePairs = {};
|
||||
innerData.map((d) => {
|
||||
keyValuePairs[d.dynamicName] = d.dynamicValue;
|
||||
});
|
||||
return {
|
||||
inspectionContent: item.inspectionContent,
|
||||
workOrderName: item.workOrderName,
|
||||
...keyValuePairs,
|
||||
sumInput: item.sumInput,
|
||||
sumOutput: item.sumOutput,
|
||||
};
|
||||
});
|
||||
},
|
||||
@@ -456,5 +595,24 @@ export default {
|
||||
height: 36px;
|
||||
}
|
||||
}
|
||||
.blue-title {
|
||||
position: relative;
|
||||
padding: 4px 0;
|
||||
padding-left: 12px;
|
||||
font-size: 14px;
|
||||
color: #606266;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 6px;
|
||||
height: 16px;
|
||||
width: 4px;
|
||||
border-radius: 1px;
|
||||
background: #0b58ff;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
">
|
||||
<div class="factory-list__selector" style="margin: 12px" title="点击切换工厂" @mouseenter="factoryListOpen = true"
|
||||
@mouseleave="factoryListOpen = false">
|
||||
{{ currentFactory?.label || '点我选择工厂' }}
|
||||
{{ currentFactory?.label || '点我选择设备' }}
|
||||
<div class="factory-list__wrapper" :class="{ open: factoryListOpen }">
|
||||
<ul class="factory-list" v-if="sidebarContent.length" @click.prevent="factoryChangeHandler">
|
||||
<li v-for="fc in sidebarContent" :key="fc.id" :data-value="fc.id" class="factory-list__item"
|
||||
|
||||
@@ -69,8 +69,9 @@ export default {
|
||||
type: 'select',
|
||||
label: '工单号',
|
||||
placeholder: '请选择工单号',
|
||||
param: 'workOrderId',
|
||||
param: 'workOrderIdList',
|
||||
selectOptions: [],
|
||||
multiple:true,
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
@@ -188,8 +189,8 @@ export default {
|
||||
// },
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
workOrderId: undefined,
|
||||
productId: undefined,
|
||||
workOrderIdList:undefined,
|
||||
productionId: undefined,
|
||||
startTime: undefined,
|
||||
endTime: undefined,
|
||||
// productionLineId: null,
|
||||
@@ -244,21 +245,24 @@ 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.queryParams.param = {};
|
||||
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 = [];
|
||||
if (this.$route.query.woIdString) {
|
||||
this.queryParams.workOrderIdList = this.$route.query.woIdString
|
||||
}
|
||||
// if (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);
|
||||
// } else {
|
||||
// this.searchBarFormConfig[0].defaultSelect = [];
|
||||
// }
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
@@ -302,7 +306,8 @@ export default {
|
||||
// 执行查询
|
||||
const {
|
||||
data: { data, otherList, otherMap, nameData },
|
||||
} = await getStatisticalDataPage(this.queryParams)
|
||||
} = await getStatisticalDataPage(this.queryParams)
|
||||
console.log(this.queryParams);
|
||||
this.dynamicProps = this.filterNameData(nameData)
|
||||
this.list = this.filterData(data);
|
||||
},
|
||||
@@ -336,8 +341,8 @@ export default {
|
||||
/** 取消按钮 */
|
||||
handleSearchBarBtnClick(val) {
|
||||
if (val.btnName === 'search') {
|
||||
this.queryParams.workOrderId = val.workOrderId ? val.workOrderId : undefined
|
||||
this.queryParams.productId = val.productId ? val.productId : undefined
|
||||
this.queryParams.workOrderIdList = val.workOrderIdList ? val.workOrderIdList : undefined
|
||||
this.queryParams.productionId = val.productionId ? val.productionId : undefined
|
||||
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
|
||||
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
|
||||
|
||||
|
||||
Reference in New Issue
Block a user