This commit is contained in:
朱菊兰 2024-07-24 15:42:37 +08:00
parent 6aabe6dd90
commit c2defa2da6
12 changed files with 1428 additions and 833 deletions

View File

@ -14,9 +14,9 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境 # 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082' # VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://192.168.0.33:48082' # VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_BASE_API = 'http://192.168.1.164:48082' # VUE_APP_BASE_API = 'http://192.168.1.164:48082'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080' # VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082' VUE_APP_BASE_API = 'http://192.168.1.81:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082' # VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.159:48080' # VUE_APP_BASE_API = 'http://192.168.4.159:48080'
# VUE_APP_BASE_API = 'http://192.168.1.56:48082' # VUE_APP_BASE_API = 'http://192.168.1.56:48082'

View File

@ -1,218 +1,215 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 --> <search-bar
<search-bar :formConfigs="formConfig"
:formConfigs="formConfig" ref="searchBarForm"
ref="searchBarForm" @headBtnClick="buttonClick" />
@headBtnClick="buttonClick" <!-- 列表 -->
/> <base-table
<!-- 列表 --> :page="queryParams.pageNo"
<base-table :limit="queryParams.pageSize"
:page="queryParams.pageNo" :table-props="tableProps"
:limit="queryParams.pageSize" :table-data="list"
:table-props="tableProps" :max-height="tableH">
:table-data="list" <method-btn
:max-height="tableH" v-if="tableBtn.length"
> slot="handleBtn"
<method-btn :width="80"
v-if="tableBtn.length" label="操作"
slot="handleBtn" :method-list="tableBtn"
:width="80" @clickBtn="handleClick" />
label="操作" </base-table>
:method-list="tableBtn" <pagination
@clickBtn="handleClick" :page.sync="queryParams.pageNo"
/> :limit.sync="queryParams.pageSize"
</base-table> :total="total"
<pagination @pagination="getList" />
:page.sync="queryParams.pageNo" <!-- 新增 -->
:limit.sync="queryParams.pageSize" <base-dialog
:total="total" :dialogTitle="addOrEditTitle"
@pagination="getList" :dialogVisible="centervisible"
/> @cancel="handleCancel"
<!-- 新增 --> @confirm="handleConfirm"
<base-dialog :before-close="handleCancel">
:dialogTitle="addOrEditTitle" <energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
:dialogVisible="centervisible" </base-dialog>
@cancel="handleCancel" </div>
@confirm="handleConfirm"
:before-close="handleCancel"
>
<energy-plc-add ref="energyPlc" @successSubmit="successSubmit" />
</base-dialog>
</div>
</template> </template>
<script> <script>
import { getEnergyPlcPage, deleteEnergyPlc } from "@/api/base/energyPlc"; import { getEnergyPlcPage, deleteEnergyPlc } from '@/api/base/energyPlc';
// import { publicFormatter } from '@/utils/dict' // import { publicFormatter } from '@/utils/dict'
import EnergyPlcAdd from './components/energyPlcAdd.vue' import EnergyPlcAdd from './components/energyPlcAdd.vue';
import tableHeightMixin from '@/mixins/tableHeightMixin';
const tableProps = [ const tableProps = [
{ {
prop: 'plcTableName', prop: 'plcTableName',
label: '关联表名' label: '关联表名',
}, },
{ {
prop: 'code', prop: 'code',
label: '关联表编码', label: '关联表编码',
minWidth: 150, minWidth: 150,
showOverflowtooltip: true showOverflowtooltip: true,
}, },
{ {
prop: 'name', prop: 'name',
label: '标识名' label: '标识名',
}, },
{ {
prop: 'enName', prop: 'enName',
label: '英文标识名' label: '英文标识名',
}, },
{ {
prop: 'collection', prop: 'collection',
label: '是否采集' label: '是否采集',
}, },
{ {
prop: 'description', prop: 'description',
label: '描述', label: '描述',
showOverflowtooltip: true showOverflowtooltip: true,
} },
] ];
export default { export default {
name: "EnergyPlc", name: 'EnergyPlc',
components: { EnergyPlcAdd }, components: { EnergyPlcAdd },
data() { mixins: [tableHeightMixin],
return { data() {
formConfig: [ return {
{ formConfig: [
type: 'input', {
label: '标识名', type: 'input',
placeholder: '标识名', label: '标识名',
param: 'name' placeholder: '标识名',
}, param: 'name',
{ },
type: 'button', {
btnName: '查询', type: 'button',
name: 'search', btnName: '查询',
color: 'primary' name: 'search',
}, color: 'primary',
{ },
type: 'separate' {
}, type: 'separate',
{ },
type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '', {
btnName: '新增', type: this.$auth.hasPermi('base:energy-plc:create') ? 'button' : '',
name: 'add', btnName: '新增',
color: 'success', name: 'add',
plain: true color: 'success',
} plain: true,
], },
tableProps, ],
tableBtn: [ tableProps,
this.$auth.hasPermi('base:energy-plc:update') tableBtn: [
? { this.$auth.hasPermi('base:energy-plc:update')
type: 'edit', ? {
btnName: '编辑' type: 'edit',
} btnName: '编辑',
: undefined, }
this.$auth.hasPermi('base:energy-plc:delete') : undefined,
? { this.$auth.hasPermi('base:energy-plc:delete')
type: 'delete', ? {
btnName: '删除' type: 'delete',
} btnName: '删除',
: undefined }
].filter((v) => v), : undefined,
tableH: this.tableHeight(260), ].filter((v) => v),
collectionList: [ collectionList: [
{value: 0,label: '否'}, { value: 0, label: '否' },
{value: 1,label: '是'} { value: 1, label: '是' },
], ],
// //
total: 0, total: 0,
// //
list: [], list: [],
// //
addOrEditTitle: "", addOrEditTitle: '',
// //
centervisible: false, centervisible: false,
// //
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 20, pageSize: 20,
name: null name: null,
} },
}; };
}, },
created() { created() {
window.addEventListener('resize', () => { this.getList();
this.tableH = this.tableHeight(260) },
}) methods: {
this.getList(); buttonClick(val) {
}, switch (val.btnName) {
methods: { case 'search':
buttonClick(val) { this.queryParams.pageNo = 1;
switch (val.btnName) { this.queryParams.name = val.name;
case 'search': this.getList();
this.queryParams.pageNo = 1; break;
this.queryParams.name = val.name default:
this.getList() this.addOrEditTitle = '新增';
break this.centervisible = true;
default: this.$nextTick(() => {
this.addOrEditTitle = '新增' this.$refs.energyPlc.init();
this.centervisible = true });
this.$nextTick(() => { }
this.$refs.energyPlc.init() },
}) /** 查询列表 */
} getList() {
}, getEnergyPlcPage(this.queryParams).then((response) => {
/** 查询列表 */ let arr = response.data.list || [];
getList() { arr &&
getEnergyPlcPage(this.queryParams).then(response => { arr.map((item) => {
let arr = response.data.list || []; this.collectionList.map((i) => {
arr&&arr.map(item => { if (item.collection === i.value) {
this.collectionList.map(i => { item.collection = i.label;
if (item.collection === i.value) { }
item.collection = i.label });
} });
}) this.list = arr;
}) this.total = response.data.total;
this.list = arr });
this.total = response.data.total; },
}); handleClick(val) {
}, switch (val.type) {
handleClick(val) { case 'edit':
switch (val.type) { this.addOrEditTitle = '编辑';
case 'edit': this.$nextTick(() => {
this.addOrEditTitle = '编辑' this.$refs.energyPlc.init(val.data.id);
this.$nextTick(() => { });
this.$refs.energyPlc.init(val.data.id) this.centervisible = true;
}) break;
this.centervisible = true default:
break this.handleDelete(val.data);
default: }
this.handleDelete(val.data) },
} handleCancel() {
}, this.$refs.energyPlc.formClear();
handleCancel() { this.centervisible = false;
this.$refs.energyPlc.formClear() this.addOrEditTitle = '';
this.centervisible = false },
this.addOrEditTitle = '' handleConfirm() {
}, this.$refs.energyPlc.submitForm();
handleConfirm() { },
this.$refs.energyPlc.submitForm() successSubmit() {
}, this.handleCancel();
successSubmit() { this.getList();
this.handleCancel() },
this.getList() /** 删除按钮操作 */
}, handleDelete(row) {
/** 删除按钮操作 */ this.$modal
handleDelete(row) { .delConfirm(row.name)
this.$modal.confirm('是否确认删除关联表名为"' + row.name + '"的数据项?').then(function() { .then(function () {
return deleteEnergyPlc(row.id); return deleteEnergyPlc(row.id);
}).then(() => { })
this.queryParams.pageNo = 1; .then(() => {
this.getList(); this.queryParams.pageNo = 1;
this.$modal.msgSuccess("删除成功"); this.getList();
}).catch(() => {}); this.$modal.msgSuccess('删除成功');
} })
} .catch(() => {});
},
},
}; };
</script> </script>

View File

@ -0,0 +1,649 @@
<template>
<div class="app-container">
<!-- 搜索工作栏 -->
<!-- 列表 -->
<el-row>
<el-col class="custom-tabs">
<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">
<SearchBar
:formConfigs="searchBarFormConfig"
ref="search-bar"
@headBtnClick="handleSearchBarBtnClick" />
<div id="main" style="height: 500px; width: 1000px"></div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<!-- 分页组件 -->
<!-- <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" /> -->
<!-- 对话框(添加 / 修改) -->
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="50%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" />
</base-dialog> -->
</div>
</template>
<script>
import {
getInspectionData,
getProductList,
getWorkOrderList,
} from '@/api/monitoring/statisticalData';
// 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',
// components: {
// DialogForm,
// },
// mixins: [basicPageMixin],
data() {
return {
list: [],
dynamicProps: [],
downProps: [],
downList: [],
productDetail: {
name: null,
specifications: null,
},
activeName: 'table',
searchBarFormConfig: [
{
type: 'label',
label: '当前检测数据柱状图',
// placeholder: '',
// param: 'workOrderId',
// selectOptions: [],
},
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'productionId',
// selectOptions: [],
// },
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'inspectionDetContent',
// },
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange', // datetimerange
// // format: 'yyyy-MM-dd HH:mm:ss',
// format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// defaultTime: ['00:00:00', '23:59:59'],
// param: 'checkTime',
// // width: 350,
// },
// {
// type: 'button',
// btnName: '',
// name: 'search',
// color: 'primary',
// },
// {
// type: 'separate',
// },
// // {
// // type: this.$auth.hasPermi(
// // 'base:quality-inspection-record:create'
// // )
// // ? 'button'
// // : '',
// // btnName: '',
// // name: 'add',
// // plain: true,
// // color: 'success',
// // },
],
// tableBtn: [
// this.$auth.hasPermi('base:quality-inspection-record:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('base:quality-inspection-record:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
// tableProps: [
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
// {
// // width: 128,
// prop: 'inspectionDetContent',
// label: '',
// },
// {
// // width: 128,
// prop: 'lineName',
// label: '线',
// },
// {
// // width: 128,
// prop: 'checkPerson',
// label: '',
// },
// {
// // width: 160,
// prop: 'checkTime',
// label: '',
// filter: (val) =>
// val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
// },
// {
// width: 90,
// prop: 'source',
// label: '',
// filter: (val) => ['', '', ''][val],
// },
// ],
// keys, queryParams pageNo, pageSize key
// searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
// form: {
// id: undefined,
// inspectionDetId: undefined,
// inspectionDetContent: undefined,
// productionLineId: undefined,
// sectionId: undefined,
// checkPerson: undefined,
// checkTime: undefined,
// source: undefined,
// explainText: undefined,
// remark: undefined,
// },
//
queryParams: {
workOrderId: undefined,
productId: undefined,
startTime: undefined,
endTime: undefined,
// productionLineId: null,
},
};
},
created() {
// this.getProductLineList();
},
computed: {
productProps() {
return [
{
// width: 160,
prop: 'workOrderName',
label: '工单名称',
},
...this.dynamicProps,
{
// width: 128,
prop: 'sumInput',
label: '上片总数',
},
{
// width: 128,
prop: 'sumOutput',
label: '下片总数',
// subcomponent: {
// name: 'TextOnly',
// props: {
// injectData: {
// type: Object,
// default: () => ({}),
// },
// },
// data() {
// return {
// text: '',
// };
// },
// methods: {
// handleEmit(payload) {
// console.log('handleEmit', payload);
// },
// },
// render(h) {
// return h('el-button', { props: { type: 'text' } }, this.text);
// },
// },
},
];
},
},
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 = [];
}
this.getList();
},
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,
barWidth: '20',
label: {
show: true,
position: 'top',
},
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)',
},
},
],
};
option && myChart.setOption(option);
}
},
/** 获取搜索栏的产线列表 */
// async getDict() {
// const res = await getProductList()
// const result = await getWorkOrderList()
// console.log(res);
// this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
// return {
// name: item.name,
// id:item.id
// }
// })
// this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// },
// getProductLineList() {
// this.$axios('/base/production-line/listAll').then((response) => {
// this.searchBarFormConfig[0].selectOptions = response.data.map(
// (item) => {
// return {
// name: item.name,
// id: item.id,
// };
// }
// );
// });
// },
getList() {
this.getDataList();
// this.getDict()
},
/** 查询列表 */
async getDataList() {
this.loading = true;
//
this.downProps = [];
const res = await getInspectionData(this.queryParams);
console.log(res);
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);
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);
},
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 = {};
innerData.map((d) => {
keyValuePairs[d.dynamicName] = d.dynamicValue;
});
return {
inspectionContent: item.inspectionContent,
...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,
};
});
},
/** 取消按钮 */
handleSearchBarBtnClick(val) {
if (val.btnName === 'search') {
this.queryParams.workOrderId = val.workOrderId
? val.workOrderId
: undefined;
this.queryParams.productId = val.productId ? val.productId : undefined;
this.queryParams.startTime = val.checkTime
? val.checkTime[0]
: undefined;
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.getList();
}
console.log(val);
},
/** 搜索按钮操作 */
// handleQuery() {
// this.queryParams.pageNo = 1;
// this.getList();
// },
// /** */
// resetQuery() {
// this.resetForm('queryForm');
// this.handleQuery();
// },
// /** */
// handleAdd() {
// this.reset();
// this.open = true;
// this.title = '';
// },
// /** */
// handleUpdate(row) {
// this.reset();
// const id = row.id;
// getQualityInspectionRecord(id).then((response) => {
// /** */
// const info = {}
// Object.keys(this.form).forEach(key => {
// info[key] = response.data[key]
// });
// this.form = info;
// this.open = true;
// this.title = '';
// });
// },
// /** */
// submitForm() {
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
// }
// //
// if (this.form.id != null) {
// updateQualityInspectionRecord(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// return;
// }
// //
// createQualityInspectionRecord(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// });
// },
// /** */
// handleDelete(row) {
// const id = row.id;
// this.$modal
// .confirm('"' + row.inspectionDetContent + '"?')
// .then(function () {
// return deleteQualityInspectionRecord(id);
// })
// .then(() => {
// this.getList();
// this.$modal.msgSuccess('');
// })
// .catch(() => {});
// },
// /** */
// handleExport() {
// //
// let params = { ...this.queryParams };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal
// .confirm('?')
// .then(() => {
// this.exportLoading = true;
// return exportQualityInspectionRecordExcel(params);
// })
// .then((response) => {
// this.$download.excel(response, '.xls');
// this.exportLoading = false;
// })
// .catch(() => {});
// },
},
};
</script>
<style scoped lang="scss">
:deep(.custom-tabs) {
.el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.el-tabs__content {
overflow: visible;
}
.el-tabs__item {
padding-left: 0 !important;
padding-right: 0 !important;
line-height: 36px !important;
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>

View File

@ -0,0 +1,125 @@
<template>
<div id="currentDataChart" style="width: 100%; height: 300px"></div>
</template>
<script>
import * as echarts from 'echarts';
import resize from '@/utils/chartMixins/resize';
export default {
name: 'BaseChart',
mixins: [resize],
data() {
return {
chartDom: '',
chart: '',
};
},
// props: {
// chartData: {
// type: Array,
// required: true,
// default: () => {
// return [];
// },
// },
// },
// watch: {
// chartData: function () {
// this.getChart();
// },
// },
mounted() {
window.addEventListener('resize', () => {
this.getChart();
});
},
methods: {
getChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose(); // Dom
}
this.chartDom = document.getElementById('currentDataChart');
this.chart = echarts.init(this.chartDom);
// if (this.chartData.length === 0) {
// return false;
// }
var option = {
color: [
'#288AFF',
'#73DE93',
'#FFCE6A',
'#63BDFF',
'#7164FF',
'#FF6860',
'#FF9747',
'#B0EB42',
'#D680FF',
'#0043D2',
],
// legend: {
// data: keys,
// right: '1%',
// },
tooltip: {
trigger: 'axis',
},
grid: {
left: '1%',
right: '1%',
bottom: '3%',
containLabel: true,
},
xAxis: {
type: 'category',
data: ['1', '2', '3', '4', '5'],
},
yAxis: {
type: 'value',
},
series: [
{
data: [50, 30, 40, 50, 60],
type: 'bar',
stack: 'a',
barWidth: 20,
name: '产线1',
},
{
data: [30, 50, 44, 52, 39],
type: 'bar',
stack: 'a',
barWidth: 20,
name: '产线2',
},
{
data: [53, 33, 43, 53, 63],
type: 'bar',
stack: 'a',
barWidth: 20,
name: '产线3',
},
{
data: [35, 39, 44, 65, 45],
type: 'bar',
stack: 'a',
barWidth: 20,
name: '产线4',
},
{
data: [50, 30, 40, 50, 60],
type: 'bar',
stack: 'a',
barWidth: 20,
name: '产线5',
},
],
};
option && this.chart.setOption(option);
},
},
};
</script>

View File

@ -0,0 +1,167 @@
<template>
<div>
<base-table
:table-props="tableProps"
:page="1"
:limit="1000"
:table-data="list" />
<div class="orderBox">
<div class="title">
<span>工单工单1</span>
<span>产品名称名称1</span>
<span>规格规格1</span>
</div>
<div class="custom-tabs">
<el-tabs v-model="activeName" :stretch="true">
<el-tab-pane :label="'\u2002表格\u2002'" name="table">
<!-- 列表 -->
<base-table
:table-props="tableProps2"
:page="1"
:limit="1000"
:table-data="list2" />
</el-tab-pane>
<el-tab-pane
:label="'\u3000图表\u3000'"
name="chart"
style="overflow: inherit">
<baseChart />
</el-tab-pane>
</el-tabs>
</div>
</div>
</div>
</template>
<script>
import BaseChart from './baseChart.vue';
export default {
name: 'CurrentTest',
components: { BaseChart },
data() {
return {
activeName: 'table',
tableProps: [
{
prop: 'workOrderName',
label: '工单名称',
showOverflowtooltip: true,
},
{
prop: 'prodName',
label: '产品名称',
showOverflowtooltip: true,
},
{
prop: 'line1',
label: '产线1',
showOverflowtooltip: true,
},
{
prop: 'line2',
label: '产线2',
showOverflowtooltip: true,
},
{
prop: 'line3',
label: '产线3',
showOverflowtooltip: true,
},
{
prop: 'total',
label: '上片总数',
showOverflowtooltip: true,
},
{
prop: 'total2',
label: '下片总数',
showOverflowtooltip: true,
},
],
list: [
{ workOrderName: '工单1' },
{ workOrderName: '工单2' },
{ workOrderName: '工单3' },
{ workOrderName: '工单4' },
{ workOrderName: '工单5' },
{ workOrderName: '工单6' },
],
tableProps2: [
{
prop: 'workOrderName',
label: '检测内容',
showOverflowtooltip: true,
},
{
prop: 'prodName',
label: '原片总数',
showOverflowtooltip: true,
},
{
prop: 'line1',
label: '产线1',
showOverflowtooltip: true,
},
{
prop: 'line2',
label: '产线2',
showOverflowtooltip: true,
},
{
prop: 'line3',
label: '产线3',
showOverflowtooltip: true,
},
{
prop: 'total',
label: '未通过检测总数',
showOverflowtooltip: true,
},
{
prop: 'total2',
label: '报废比例',
showOverflowtooltip: true,
},
],
list2: [
{ workOrderName: '工单1' },
{ workOrderName: '工单2' },
{ workOrderName: '工单3' },
{ workOrderName: '工单4' },
{ workOrderName: '工单5' },
{ workOrderName: '工单6' },
],
};
},
};
</script>
<style scoped lang="scss">
.orderBox {
padding-top: 16px;
}
.title {
span {
display: inline-block;
width: 300px;
font-size: 14px;
padding-bottom: 10px;
}
}
:deep(.custom-tabs) {
.el-tabs__header {
margin-bottom: 8px;
display: inline-block;
transform: translateY(-12px);
}
.el-tabs__content {
overflow: visible;
}
.el-tabs__item {
padding-left: 0 !important;
padding-right: 0 !important;
line-height: 36px !important;
height: 36px;
}
}
</style>

View File

@ -0,0 +1,179 @@
<template>
<base-table
:table-props="tableProps"
:table-data="list"
:max-height="tableH" />
</template>
<script>
import tableHeightMixin from '@/mixins/tableHeightMixin';
export default {
name: 'HourData',
mixins: [tableHeightMixin],
data() {
return {
heightNum: 200,
tableProps: [
{
prop: 'name',
lable: '检测内容',
},
{
label: '2024-01-01 01:00:00',
children: [
{
prop: 'line1-1',
label: '产线1',
},
{
prop: 'line1-2',
label: '产线2',
},
{
prop: 'line1-3',
label: '产线3',
},
{
prop: 'line1-4',
label: '产线4',
},
],
},
{
label: '2024-01-01 02:00:00',
children: [
{
prop: 'line2-1',
label: '产线1',
},
{
prop: 'line2-2',
label: '产线2',
},
{
prop: 'line2-3',
label: '产线3',
},
{
prop: 'line2-4',
label: '产线4',
},
],
},
{
label: '2024-01-01 03:00:00',
children: [
{
prop: 'line3-1',
label: '产线1',
},
{
prop: 'line3-2',
label: '产线2',
},
{
prop: 'line3-3',
label: '产线3',
},
{
prop: 'line3-4',
label: '产线4',
},
],
},
],
list: [
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
{
name: '磨边缺陷数',
'line1-1': 1,
'line1-2': 2,
'line1-3': 3,
'line1-4': 4,
'line2-1': 5,
'line2-2': 6,
'line2-3': 7,
'line2-4': 8,
'line3-1': 9,
'line3-2': 10,
'line3-3': 11,
'line3-4': 12,
},
],
};
},
};
</script>

View File

@ -1,622 +1,88 @@
<template> <template>
<div class="app-container"> <div class="currentDataContainer">
<!-- 搜索工作栏 --> <div class="topBox">
<!-- 列表 --> <el-menu
<el-row> :default-active="activeName"
<el-col class="custom-tabs"> mode="horizontal"
<el-tabs v-model="activeName" :stretch="true" @tab-click="handleTabClick"> @select="handleSelect">
<el-tab-pane :label="'\u2002表格数据\u2002'" name="table"> <el-menu-item index="currentTest">当前检测数据</el-menu-item>
<!-- 列表 --> <el-menu-item index="24hour">24小时检测数据</el-menu-item>
<div class="blue-title">产品名{{ productDetail.name }} 产品规格{{ productDetail.specifications }}</div> </el-menu>
<base-table class="base-table__margin" :table-props="productProps" :page="1" :limit="10" :table-data="list"> </div>
</base-table> <div class="bottomBox">
<div v-for="(item,index) in downProps" :key="index"> <!-- 当前检测数据 -->
<div class="blue-title">工单名称:{{ list[index].workOrderName }}</div> <div v-if="activeName === 'currentTest'">
<base-table class="base-table__margin" :table-props="item" :page="1" :limit="10" <CurrentTest />
:table-data="downList[index]"> </div>
</base-table> <!-- 24小时检测数据 -->
</div> <div v-if="activeName === '24hour'">
</el-tab-pane> <HourData />
<el-tab-pane :label="'\u3000图形数据\u3000'" name="chart" style="overflow: inherit"> </div>
<SearchBar :formConfigs="searchBarFormConfig" ref="search-bar" @headBtnClick="handleSearchBarBtnClick" /> </div>
<div id="main" style="height: 500px;width: 1000px;"></div> </div>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<!-- 分页组件 -->
<!-- <pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
@pagination="getList" /> -->
<!-- 对话框(添加 / 修改) -->
<!-- <base-dialog
:dialogTitle="title"
:dialogVisible="open"
width="50%"
@close="cancel"
@cancel="cancel"
@confirm="submitForm">
<DialogForm v-if="open" ref="form" v-model="form" />
</base-dialog> -->
</div>
</template> </template>
<script> <script>
import { import CurrentTest from './currentTest.vue';
getInspectionData, import HourData from './hourData.vue';
getProductList,
getWorkOrderList
} from '@/api/monitoring/statisticalData';
// 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 { export default {
name: 'statisticalData', name: 'currentData',
// components: {
// DialogForm,
// },
// mixins: [basicPageMixin],
data() { data() {
return { return {
list: [], activeName: 'currentTest',
dynamicProps: [],
downProps: [],
downList: [],
productDetail: {
name: null,
specifications:null,
},
activeName: 'table',
searchBarFormConfig: [
{
type: 'label',
label: '当前检测数据柱状图',
// placeholder: '',
// param: 'workOrderId',
// selectOptions: [],
},
// {
// type: 'select',
// label: '',
// placeholder: '',
// param: 'productionId',
// selectOptions: [],
// },
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'inspectionDetContent',
// },
// {
// type: 'datePicker',
// label: '',
// dateType: 'daterange', // datetimerange
// // format: 'yyyy-MM-dd HH:mm:ss',
// format: 'yyyy-MM-dd',
// valueFormat: 'timestamp',
// rangeSeparator: '-',
// startPlaceholder: '',
// endPlaceholder: '',
// defaultTime: ['00:00:00', '23:59:59'],
// param: 'checkTime',
// // width: 350,
// },
// {
// type: 'button',
// btnName: '',
// name: 'search',
// color: 'primary',
// },
// {
// type: 'separate',
// },
// // {
// // type: this.$auth.hasPermi(
// // 'base:quality-inspection-record:create'
// // )
// // ? 'button'
// // : '',
// // btnName: '',
// // name: 'add',
// // plain: true,
// // color: 'success',
// // },
],
// tableBtn: [
// this.$auth.hasPermi('base:quality-inspection-record:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('base:quality-inspection-record:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
// tableProps: [
// {
// prop: 'createTime',
// label: '',
// fixed: true,
// width: 180,
// filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
// },
// {
// // width: 128,
// prop: 'inspectionDetContent',
// label: '',
// },
// {
// // width: 128,
// prop: 'lineName',
// label: '线',
// },
// {
// // width: 128,
// prop: 'checkPerson',
// label: '',
// },
// {
// // width: 160,
// prop: 'checkTime',
// label: '',
// filter: (val) =>
// val != null ? moment(val).format('yyyy-MM-DD HH:mm:ss') : '-',
// },
// {
// width: 90,
// prop: 'source',
// label: '',
// filter: (val) => ['', '', ''][val],
// },
// ],
// keys, queryParams pageNo, pageSize key
// searchBarKeys: ['inspectionDetContent', 'checkTime', 'productionLineId'],
// form: {
// id: undefined,
// inspectionDetId: undefined,
// inspectionDetContent: undefined,
// productionLineId: undefined,
// sectionId: undefined,
// checkPerson: undefined,
// checkTime: undefined,
// source: undefined,
// explainText: undefined,
// remark: undefined,
// },
//
queryParams: {
workOrderId: undefined,
productId: undefined,
startTime: undefined,
endTime: undefined,
// productionLineId: null,
},
}; };
}, },
created() { components: {
// this.getProductLineList(); CurrentTest,
}, HourData,
computed: { },
productProps() { methods: {
return [ handleSelect(name) {
{ this.activeName = name;
// width: 160, },
prop: 'workOrderName',
label: '工单名称',
},
...this.dynamicProps,
{
// width: 128,
prop: 'sumInput',
label: '上片总数',
},
{
// width: 128,
prop: 'sumOutput',
label: '下片总数',
// subcomponent: {
// name: 'TextOnly',
// props: {
// injectData: {
// type: Object,
// default: () => ({}),
// },
// },
// data() {
// return {
// text: '',
// };
// },
// methods: {
// handleEmit(payload) {
// console.log('handleEmit', payload);
// },
// },
// render(h) {
// return h('el-button', { props: { type: 'text' } }, this.text);
// },
// },
},
];
},
},
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 = [];
}
this.getList()
},
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,
barWidth: '20',
label: {
show: true,
position: 'top'
},
backgroundStyle: {
color: 'rgba(180, 180, 180, 0.2)'
}
}
]
};
option && myChart.setOption(option);
}
},
/** 获取搜索栏的产线列表 */
// async getDict() {
// const res = await getProductList()
// const result = await getWorkOrderList()
// console.log(res);
// this.searchBarFormConfig[1].selectOptions = res.data.map((item) => {
// return {
// name: item.name,
// id:item.id
// }
// })
// this.searchBarFormConfig[0].selectOptions = result.data.map((item) => {
// return {
// name: item.name,
// id: item.id
// }
// })
// },
// getProductLineList() {
// this.$axios('/base/production-line/listAll').then((response) => {
// this.searchBarFormConfig[0].selectOptions = response.data.map(
// (item) => {
// return {
// name: item.name,
// id: item.id,
// };
// }
// );
// });
// },
getList() {
this.getDataList()
// this.getDict()
},
/** 查询列表 */
async getDataList() {
this.loading = true;
//
this.downProps= []
const res = await getInspectionData(this.queryParams)
console.log(res);
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)
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);
},
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 = {};
innerData.map((d) => {
keyValuePairs[d.dynamicName] = d.dynamicValue;
});
return {
inspectionContent: item.inspectionContent,
...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,
};
});
},
/** 取消按钮 */
handleSearchBarBtnClick(val) {
if (val.btnName === 'search') {
this.queryParams.workOrderId = val.workOrderId ? val.workOrderId : undefined
this.queryParams.productId = val.productId ? val.productId : undefined
this.queryParams.startTime = val.checkTime ? val.checkTime[0] : undefined
this.queryParams.endTime = val.checkTime ? val.checkTime[1] : undefined
this.getList()
}
console.log(val);
}
/** 搜索按钮操作 */
// handleQuery() {
// this.queryParams.pageNo = 1;
// this.getList();
// },
// /** */
// resetQuery() {
// this.resetForm('queryForm');
// this.handleQuery();
// },
// /** */
// handleAdd() {
// this.reset();
// this.open = true;
// this.title = '';
// },
// /** */
// handleUpdate(row) {
// this.reset();
// const id = row.id;
// getQualityInspectionRecord(id).then((response) => {
// /** */
// const info = {}
// Object.keys(this.form).forEach(key => {
// info[key] = response.data[key]
// });
// this.form = info;
// this.open = true;
// this.title = '';
// });
// },
// /** */
// submitForm() {
// this.$refs['form'].validate((valid) => {
// if (!valid) {
// return;
// }
// //
// if (this.form.id != null) {
// updateQualityInspectionRecord(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// return;
// }
// //
// createQualityInspectionRecord(this.form).then((response) => {
// this.$modal.msgSuccess('');
// this.open = false;
// this.getList();
// });
// });
// },
// /** */
// handleDelete(row) {
// const id = row.id;
// this.$modal
// .confirm('"' + row.inspectionDetContent + '"?')
// .then(function () {
// return deleteQualityInspectionRecord(id);
// })
// .then(() => {
// this.getList();
// this.$modal.msgSuccess('');
// })
// .catch(() => {});
// },
// /** */
// handleExport() {
// //
// let params = { ...this.queryParams };
// params.pageNo = undefined;
// params.pageSize = undefined;
// this.$modal
// .confirm('?')
// .then(() => {
// this.exportLoading = true;
// return exportQualityInspectionRecordExcel(params);
// })
// .then((response) => {
// this.$download.excel(response, '.xls');
// this.exportLoading = false;
// })
// .catch(() => {});
// },
}, },
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
:deep(.custom-tabs) { .currentDataContainer {
.el-tabs__header { width: 100%;
margin-bottom: 8px; min-height: calc(100vh - 120px - 8px);
display: inline-block; background: rgba(242, 244, 249, 1);
transform: translateY(-12px); .topBox {
} .el-menu {
background-color: #f2f4f9;
.el-tabs__content { margin-bottom: 8px;
overflow: visible; }
} .el-menu.el-menu--horizontal {
border-bottom: none;
.el-tabs__item { width: 100%;
padding-left: 0 !important; .el-menu-item {
padding-right: 0 !important; height: 48px;
line-height: 36px !important; line-height: 48px;
height: 36px; width: calc((100% / 2) - 4px);
} border-radius: 8px;
} background-color: #fff;
.blue-title { font-size: 16px;
position: relative; font-weight: 500;
padding: 4px 0; color: rgba(22, 22, 22, 0.65);
padding-left: 12px; text-align: center;
font-size: 14px; }
color: #606266; :first-child {
font-weight: 700; margin-right: 8px;
margin-bottom: 12px; }
.el-menu-item.is-active {
&::before { border-width: 4px;
content: ''; color: #161616;
position: absolute; }
left: 0; }
top: 6px; .el-tabs__active-bar {
height: 16px; display: none;
width: 4px; }
border-radius: 1px; }
background: #0b58ff; .bottomBox {
} min-height: calc(100vh - 184px);
background: #fff;
padding: 16px;
border-radius: 8px;
}
} }
</style> </style>

View File

@ -231,7 +231,7 @@ export default {
searchBarFormConfig: [ searchBarFormConfig: [
{ {
type: 'select', type: 'select',
label: '工单', label: '工单名称',
selectOptions: [], selectOptions: [],
labelField: 'name', labelField: 'name',
valueField: 'id', valueField: 'id',

View File

@ -202,6 +202,7 @@ export default {
selectOptions: [], selectOptions: [],
filterable: true, filterable: true,
clearable: false, clearable: false,
defaultSelect: '',
}, },
{ {
// parent: 'dateFilterType', // parent: 'dateFilterType',
@ -246,7 +247,6 @@ export default {
}, },
created() { created() {
this.getWorkOrder(); this.getWorkOrder();
this.getList();
}, },
methods: { methods: {
/** 准备工厂数据 */ /** 准备工厂数据 */
@ -262,7 +262,16 @@ export default {
id: item.id, id: item.id,
}; };
}); });
this.searchBarFormConfig[0].defaultSelect =
this.searchBarFormConfig[0].selectOptions[0].id;
this.queryParams.workOrderId =
this.searchBarFormConfig[0].selectOptions[0].id;
} else {
this.searchBarFormConfig[0].selectOptions = [];
this.searchBarFormConfig[0].defaultSelect = '';
this.queryParams.workOrderId = '';
} }
this.getList();
}, },
/** 查询列表 */ /** 查询列表 */
async getList() { async getList() {
@ -284,14 +293,11 @@ export default {
}); });
}, },
handleSearchBarBtnClick({ btnName, ...payload }) { handleSearchBarBtnClick({ btnName, ...payload }) {
console.log(btnName); this.queryParams.workOrderId = payload.workOrderId || null;
console.log(payload); this.queryParams.recordTime = payload.recordTime || undefined;
if (btnName == 'search') { if (btnName == 'search') {
this.queryParams.workOrderId = payload.workOrderId || null;
this.queryParams.recordTime = payload.recordTime || undefined;
this.getList(); this.getList();
} else { } else {
// this.queryParams.recordTime = null;
this.exportExcel(); this.exportExcel();
console.log('导出'); console.log('导出');
} }

View File

@ -111,9 +111,10 @@ export default {
type: 'select', type: 'select',
label: '工单名称', label: '工单名称',
selectOptions: [], selectOptions: [],
labelField: 'name',
valueField: 'id',
param: 'workOrderId', param: 'workOrderId',
defaultSelect: '',
filterable: true,
clearable: false,
}, },
{ {
type: 'datePicker', type: 'datePicker',
@ -153,7 +154,6 @@ export default {
// AddOrUpdate, // AddOrUpdate,
}, },
created() { created() {
this.getList();
this.getDict(); this.getDict();
}, },
methods: { methods: {
@ -172,6 +172,11 @@ export default {
}; };
}); });
console.log(this.formConfig[0].selectOptions); console.log(this.formConfig[0].selectOptions);
this.formConfig[0].defaultSelect =
this.formConfig[0].selectOptions[0].id || '';
this.listQuery.workOrderId =
this.formConfig[0].selectOptions[0].id || '';
this.getList();
}); });
}, },
handleExport() { handleExport() {

View File

@ -115,7 +115,6 @@ export default {
}; };
}, },
created() { created() {
this.getList();
this.getDict(); this.getDict();
}, },
methods: { methods: {
@ -135,7 +134,9 @@ export default {
}); });
this.formConfig[0].defaultSelect = this.formConfig[0].defaultSelect =
this.formConfig[0].selectOptions[0].id || ''; this.formConfig[0].selectOptions[0].id || '';
console.log(this.formConfig[0].selectOptions); this.listQuery.workOrderId =
this.formConfig[0].selectOptions[0].id || '';
this.getList();
}); });
}, },
buttonClick(val) { buttonClick(val) {