Merge branch 'test' into lb

This commit is contained in:
lb 2023-09-12 11:10:45 +08:00
commit d595bf2660
10 changed files with 1228 additions and 2 deletions

View File

@ -1,3 +1,10 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2023-09-11 15:55:29
# @LastEditors: DY
# @Description:
###
# 开发环境配置
ENV = 'development'

View File

@ -52,7 +52,7 @@
"crypto-js": "^4.0.0",
"echarts": "5.4.0",
"element-ui": "2.15.12",
"file-saver": "2.0.5",
"file-saver": "^2.0.5",
"fuse.js": "6.6.2",
"highlight.js": "9.18.5",
"js-beautify": "1.13.0",

View File

@ -1,3 +1,10 @@
/*
* @Author: zhp
* @Date: 2023-08-28 14:29:51
* @LastEditTime: 2023-08-31 14:33:46
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 创建产线工段

View File

@ -0,0 +1,159 @@
<!--
* @Author: zhp
* @Date: 2023-09-11 14:21:21
* @LastEditTime: 2023-09-11 14:26:04
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [
{
prop: 'productionLineName',
label: '产线名称',
align: 'center',
},
{
prop: '',
label: '工段名称',
align: 'center',
},
{
prop: '',
label: '进片数量/片',
align: 'center',
},
{
prop: '',
label: '出片数量/片',
align: 'center',
},
{
prop: '',
label: '损耗数量/片',
align: 'center',
},
{
prop: '',
label: '损耗面积/m²',
align: 'center',
},
{
prop: '',
label: '损耗比例/%',
align: 'center',
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLineBindProductLogPage,
},
tableProps,
tableData: [],
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'productionLineId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'createTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '导出',
name: 'export',
},
],
};
},
components: {
},
created() {
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;
});
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.productionLineId = val.productionLineId;
this.listQuery.productId = val.productId;
this.listQuery.createTime = val.createTime;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,152 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [
{
prop: 'productionLineName',
label: '产线',
align: 'center',
},
{
prop: '',
label: '合计',
align: 'center',
},
{
prop: '',
label: '进片数量/片',
align: 'center',
},
{
prop: '',
label: '出片数量/片',
align: 'center',
},
{
prop: '',
label: '损耗数量/片',
align: 'center',
},
{
prop: '',
label: '损耗面积/m²',
align: 'center',
},
{
prop: '',
label: '损耗比例/%',
align: 'center',
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLineBindProductLogPage,
},
tableProps,
tableData: [],
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'productionLineId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'createTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '导出',
name: 'export',
},
],
};
},
components: {
},
created() {
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;
});
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.productionLineId = val.productionLineId;
this.listQuery.productId = val.productId;
this.listQuery.createTime = val.createTime;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -195,7 +195,7 @@ export default {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.pageSize = 10;.7
this.listQuery.name = val.name;
this.getDataList();
break;

View File

@ -0,0 +1,296 @@
<!--
* @Author: Do not edit
* @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-09-11 15:52:20
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:selectWidth="55"
:table-data="tableData"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
<!-- <div>
<el-button @click="down()">1111</el-button>
<el-table :data="tableData1" stripe style="width: 100%">
<el-table-column prop="date" label="日期" width="180" />
<el-table-column prop="name" label="姓名" />
<el-table-column prop="address" label="地址" />
</el-table>
</div> -->
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import {
getFactoryPage,
exportFactoryExcel,
} from '@/api/core/base/factory';
import * as XLSX from 'xlsx'
import FileSaver from 'file-saver'
const tableData1 = [
{
date: '2016-05-03',
name: 'fom',
address: 'No'
},
{
date: '2016-05-02',
name: 'fom',
address: '189'
},
{
date: '2016-0225-03',
name: 'fom',
address: 'Ndddo'
},
{
date: '2016-04445-02',
name: 'fom',
address: '18edd9'
}
]
const tableProps = [
{
prop: 'code',
label: '报表类型',
align: 'center',
},
{
prop: 'createTime',
label: '统计开始时间',
align: 'center',
filter: parseTime,
},
{
prop: 'createTime3',
label: '统计结束时间',
align: 'center',
filter: parseTime,
},
{
prop: 'name',
label: '产线名称',
align: 'center',
},
{
prop: 'address',
label: '投入数量/片',
align: 'center',
},
{
prop: 'remark44',
label: '产出数量/片',
align: 'center',
},
{
prop: 'remark23',
label: '产出面积/㎡',
align: 'center',
},
{
prop: 'remark145',
label: '损耗数量/片',
align: 'center',
},
{
prop: 'remark22',
label: '损耗面积/㎡',
align: 'center',
},
{
prop: 'remark1',
label: '损耗比例%',
align: 'center',
}
];
export default {
data() {
return {
urlOptions: {
getDataListURL: getFactoryPage,
exportURL: exportFactoryExcel,
},
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData1,
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
tableProps,
tableBtn: [],
// tableBtn: [
// this.$auth.hasPermi(`base:factory:update`)
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi(`base:factory:delete`)
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v)=>v),
tableData: [],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'line'
},
{
type: 'select',
label: '报表类型',
selectOptions: [],
param: 'name',
},
{
type: 'datePicker',
label: '统计开始时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}
],
};
},
created() {},
methods: {
down() {
//
const selectedData = this.tableData1.slice(0, 2)
console.log('你好', selectedData, this.tableData1)
//
const exportData = [
{date: '日期', name: '姓名', address: '地址'},
...selectedData
]
//id dom
const worksheet = XLSX.utils.json_to_sheet(exportData, { skipHeader: true })
const workbook = XLSX.utils.book_new()
XLSX.utils.book_append_sheet(workbook, worksheet, "Sheet1")
const workbookOutput = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' })
try {
FileSaver.saveAs(new Blob([workbookOutput], { type: 'application/octet-stream' }), 'hihi.xlsx')
} catch (e) {
console.log(e)
}
},
selectChange(val) {
console.log(val)
this.selectedList = val
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.total = response.data.total;
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '工厂.xls');
this.exportLoading = false;
}).catch(() => { });
}
},
};
</script>

View File

@ -0,0 +1,205 @@
<!--
* @Author: Do not edit
* @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-08-31 15:15:31
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:selectWidth="55"
:table-data="tableData"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import {
getFactoryPage,
exportFactoryExcel,
} from '@/api/core/base/factory';
const tableProps = [
{
prop: 'name',
label: '产线名称',
align: 'center',
},
{
prop: 'address',
label: '投入数量/片',
align: 'center',
},
{
prop: 'remark44',
label: '产出数量/片',
align: 'center',
},
{
prop: 'remark23',
label: '产出面积/㎡',
align: 'center',
},
{
prop: 'remark145',
label: '损耗数量/片',
align: 'center',
},
{
prop: 'remark22',
label: '损耗面积/㎡',
align: 'center',
},
{
prop: 'remark1',
label: '损耗比例%',
align: 'center',
}
];
export default {
data() {
return {
urlOptions: {
getDataListURL: getFactoryPage,
exportURL: exportFactoryExcel,
},
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
tableProps,
tableBtn: [],
tableData: [],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'line'
},
{
type: 'datePicker',
label: '时间范围',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}
],
};
},
created() {},
methods: {
selectChange(val) {
console.log(val)
this.selectedList = val
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.total = response.data.total;
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '工厂.xls');
this.exportLoading = false;
}).catch(() => { });
}
},
};
</script>

View File

@ -0,0 +1,240 @@
<!--
* @Author: Do not edit
* @Date: 2023-08-29 14:59:29
* @LastEditTime: 2023-08-31 15:31:40
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:selectWidth="55"
:table-data="tableData"
@selection-change="selectChange"
>
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import { parseTime } from '../../mixins/code-filter';
import {
getFactoryPage,
exportFactoryExcel,
} from '@/api/core/base/factory';
const tableProps = [
{
prop: 'code',
label: '产线类型',
align: 'center',
},
{
prop: 'createTime',
label: '统计开始时间',
align: 'center',
filter: parseTime,
},
{
prop: 'createTime3',
label: '统计结束时间',
align: 'center',
filter: parseTime,
},
{
prop: 'name',
label: '产线名称',
align: 'center',
},
{
prop: 'name1',
label: '工段名称',
align: 'center',
},
{
prop: 'address',
label: '投入数量/片',
align: 'center',
},
{
prop: 'remark44',
label: '产出数量/片',
align: 'center',
},
{
prop: 'remark23',
label: '产出面积/㎡',
align: 'center',
},
{
prop: 'remark145',
label: '损耗数量/片',
align: 'center',
},
{
prop: 'remark22',
label: '损耗面积/㎡',
align: 'center',
},
{
prop: 'remark1',
label: '损耗比例%',
align: 'center',
}
];
export default {
data() {
return {
urlOptions: {
getDataListURL: getFactoryPage,
exportURL: exportFactoryExcel,
},
urlOptions: {
getDataListURL: '',
deleteURL: '',
statusUrl: '',
exportURL: ''
},
tableData: [],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 1,
},
exportLoading: false,
dataListLoading: false,
addOrEditTitle: '',
addOrUpdateVisible: false,
tableProps,
tableBtn: [],
tableData: [],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'line'
},
{
type: 'select',
label: '工段',
selectOptions: [],
param: 'section'
},
{
type: 'select',
label: '报表类型',
selectOptions: [],
param: 'name',
},
{
type: 'datePicker',
label: '统计开始时间',
dateType: 'datetimerange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: "yyyy-MM-ddTHH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
// type: this.$auth.hasPermi('base:factory:export') ? 'button' : '',
type: 'button',
btnName: '导出',
name: 'export',
color: 'warning',
}
],
};
},
created() {},
methods: {
selectChange(val) {
console.log(val)
this.selectedList = val
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.name = val.name;
this.listQuery.code = val.code;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
//
getDataList() {
this.dataListLoading = true;
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data.list;
this.total = response.data.total;
this.dataListLoading = false;
});
},
//
sizeChangeHandle(val) {
this.listQuery.pageSize = val;
this.listQuery.pageNo = 1;
this.getDataList();
},
//
currentChangeHandle(val) {
this.listQuery.pageNo = val;
this.getDataList();
},
handleExport() {
//
let params = { ...this.queryParams };
params.pageNo = undefined;
params.pageSize = undefined;
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
this.exportLoading = true;
return this.urlOptions.exportURL(params);
}).then(response => {
this.$download.excel(response, '工厂.xls');
this.exportLoading = false;
}).catch(() => { });
}
},
};
</script>

View File

@ -0,0 +1,160 @@
<template>
<div class="app-container">
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<base-table
v-loading="dataListLoading"
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:table-data="tableData" />
<pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" />
</div>
</template>
<script>
import basicPage from '../../mixins/basic-page';
import { parseTime } from '../../mixins/code-filter';
import { getLineBindProductLogPage } from '@/api/core/base/lineBindProductLog';
import { getProductionLinePage } from '@/api/core/base/productionLine';
import { getWorkshopSectionPage } from '@/api/core/base/workshopSection';
const tableProps = [
{
prop: 'productionLineName',
label: '产线名称',
align: 'center',
},
{
prop: '',
label: '工段名称',
align: 'center',
},
{
prop: '',
label: '进片数量/片',
align: 'center',
},
{
prop: '',
label: '出片数量/片',
align: 'center',
},
{
prop: '',
label: '损耗数量/片',
align: 'center',
},
{
prop: '',
label: '损耗面积/m²',
align: 'center',
},
{
prop: '',
label: '损耗比例/%',
align: 'center',
}
];
export default {
mixins: [basicPage],
data() {
return {
urlOptions: {
getDataListURL: getLineBindProductLogPage,
},
tableProps,
tableData: [],
optionArrUrl: [getProductionLinePage, getWorkshopSectionPage],
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'productionLineId',
defaultSelect: '',
filterable: true,
},
{
type: 'select',
label: '工段',
selectOptions: [],
param: 'productId',
defaultSelect: '',
filterable: true,
},
{
type: 'datePicker',
label: '时间',
dateType: 'daterange',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'createTime',
},
{
type: 'button',
btnName: '搜索',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '导出',
name: 'export',
},
],
};
},
components: {
},
created() {
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;
});
});
},
buttonClick(val) {
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.listQuery.productionLineId = val.productionLineId;
this.listQuery.productId = val.productId;
this.listQuery.createTime = val.createTime;
this.getDataList();
break;
case 'reset':
this.$refs.searchBarForm.resetForm();
this.listQuery = {
pageSize: 10,
pageNo: 1,
total: 1,
};
this.getDataList();
break;
default:
console.log(val);
}
},
},
};
</script>