新增报表和首页
parent
5d9cebb6d7
commit
88977214cd
Binary file not shown.
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 31 KiB |
Binary file not shown.
Before Width: | Height: | Size: 509 KiB After Width: | Height: | Size: 166 KiB |
@ -0,0 +1,136 @@
|
||||
<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
|
||||
},
|
||||
chartData: {
|
||||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null,
|
||||
lineChartData: lineChartData
|
||||
}
|
||||
},
|
||||
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() {
|
||||
this.chart = echarts.init(this.$el, 'macarons')
|
||||
this.setOptions(this.chartData)
|
||||
},
|
||||
setOptions({ expectedData, actualData } = {}) {
|
||||
this.chart.setOption({
|
||||
xAxis: {
|
||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
|
||||
boundaryGap: false,
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
grid: {
|
||||
left: 10,
|
||||
right: 10,
|
||||
bottom: 20,
|
||||
top: 30,
|
||||
containLabel: true
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'cross'
|
||||
},
|
||||
padding: [5, 10]
|
||||
},
|
||||
yAxis: {
|
||||
axisTick: {
|
||||
show: false
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
data: ['expected', 'actual']
|
||||
},
|
||||
series: [{
|
||||
name: 'expected', itemStyle: {
|
||||
normal: {
|
||||
color: '#FF005A',
|
||||
lineStyle: {
|
||||
color: '#FF005A',
|
||||
width: 2
|
||||
}
|
||||
}
|
||||
},
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
data: expectedData,
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'cubicInOut'
|
||||
},
|
||||
{
|
||||
name: 'actual',
|
||||
smooth: true,
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: '#3888fa',
|
||||
lineStyle: {
|
||||
color: '#3888fa',
|
||||
width: 2
|
||||
},
|
||||
areaStyle: {
|
||||
color: '#f3f8ff'
|
||||
}
|
||||
}
|
||||
},
|
||||
data: actualData,
|
||||
animationDuration: 2800,
|
||||
animationEasing: 'quadraticOut'
|
||||
}]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,88 @@
|
||||
<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: '300px'
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
this.initChart()
|
||||
})
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (!this.chart) {
|
||||
return
|
||||
}
|
||||
this.chart.dispose()
|
||||
this.chart = null
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
this.chart = echarts.init(this.$el, 'macarons')
|
||||
|
||||
this.chart.setOption({
|
||||
title: {
|
||||
text: '包装线02',
|
||||
subtext: '本月产量',
|
||||
left: 'center'
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'item',
|
||||
formatter: '{a} <br/>{b} : {c} ({d}%)'
|
||||
},
|
||||
legend: {
|
||||
left: 'center',
|
||||
bottom: '10',
|
||||
data: ['榄菊檀香型精品线香蚊香(60装)','榄菊加大盘高级型蚊香优惠装(30装)',
|
||||
'榄菊高级型蚊香3+1家庭特惠装(18装)',
|
||||
'榄菊牌小盘高级型黑蚊香(中天繁体)(60装)(出口)',
|
||||
'榄菊牌小盘高级型蚊香筒装(繁体版)(6装)(出口)'
|
||||
]
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: 'WEEKLY WRITE ARTICLES',
|
||||
type: 'pie',
|
||||
roseType: 'radius',
|
||||
radius: [15, 95],
|
||||
center: ['50%', '38%'],
|
||||
data: [
|
||||
{ value: 320, name: '榄菊檀香型精品线香蚊香(60装)' },
|
||||
{ value: 240, name: '榄菊加大盘高级型蚊香优惠装(30装)' },
|
||||
{ value: 149, name: '榄菊高级型蚊香3+1家庭特惠装(18装)' },
|
||||
{ value: 100, name: '榄菊牌小盘高级型黑蚊香(中天繁体)(60装)(出口)' },
|
||||
{ value: 59, name: '榄菊牌小盘高级型蚊香筒装(繁体版)(6装)(出口)' }
|
||||
],
|
||||
animationEasing: 'cubicInOut',
|
||||
animationDuration: 2600
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
@ -0,0 +1,238 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
|
||||
<el-form-item label="生产日期" prop="productDateArray">
|
||||
<el-date-picker
|
||||
v-model="queryParams.productDateArray"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="工单编号" prop="workorderCode">
|
||||
<el-input
|
||||
v-model="queryParams.workorderCode"
|
||||
placeholder="请输入工单编号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编码" prop="orderCode">
|
||||
<el-input
|
||||
v-model="queryParams.orderCode"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input
|
||||
v-model="queryParams.productCode"
|
||||
placeholder="请输入产品编码"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入产品名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="productSpc">
|
||||
<el-input
|
||||
v-model="queryParams.productSpc"
|
||||
placeholder="请输入规格型号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['mes:prepare:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="prepareList">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 序号 -->
|
||||
<el-table-column type="index" align="center" :index="indexMethod" label="序号"/>
|
||||
<el-table-column label="工单生产日期" align="center" prop="productDate" width="120">
|
||||
<!--<template slot-scope="scope"><span>{{ parseTime(scope.row.productDate, '{y}-{m}-{d}') }}</span></template>-->
|
||||
</el-table-column>
|
||||
<el-table-column label="订单编号" align="center" prop="orderCode" width="130"/>
|
||||
<el-table-column label="工单编号" align="center" prop="workorderCode" width="130"/>
|
||||
<el-table-column label="产品编码" align="center" prop="productCode" width="130"/>
|
||||
<el-table-column label="产品名称" align="center" prop="productName" width="160"/>
|
||||
<el-table-column label="规格型号" align="center" prop="productSpc" />
|
||||
<el-table-column label="工序编码" align="center" prop="processCode" />
|
||||
<el-table-column label="工序名称" align="center" prop="processName" width="90"/>
|
||||
<el-table-column label="工单排产数量" align="center" prop="quantity" width="100"/>
|
||||
<el-table-column label="已生产数量" align="center" prop="quantityFeedback" width="100"/>
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getProcessFinishList} from "@/api/mes/reportWork";
|
||||
import moment from 'moment';
|
||||
export default {
|
||||
name: "Prepare",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 备料单表格数据
|
||||
prepareList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
productDateArray: [new Date(),new Date()],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
parentOrder: null,
|
||||
orderId: null,
|
||||
orderCode: null,
|
||||
productId: null,
|
||||
productCode: null,
|
||||
prodType: null,
|
||||
productName: null,
|
||||
productSpc: null,
|
||||
wetDetailPlanId: null,
|
||||
productDate: null,
|
||||
shiftId: null,
|
||||
ancestors: null,
|
||||
status: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
factoryCode: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index){
|
||||
return index+1 ;
|
||||
},
|
||||
/** 查询备料单列表 */
|
||||
getList() {
|
||||
|
||||
if(this.queryParams.productDateArray!=null){
|
||||
this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD');
|
||||
this.queryParams.productDateEnd = moment(this.queryParams.productDateArray[1]).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
getProcessFinishList(this.queryParams).then(response => {
|
||||
this.prepareList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
prepareId: null,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
parentOrder: null,
|
||||
orderId: null,
|
||||
orderCode: null,
|
||||
productId: null,
|
||||
productCode: null,
|
||||
prodType: null,
|
||||
productName: null,
|
||||
productSpc: null,
|
||||
wetDetailPlanId: null,
|
||||
productDate: null,
|
||||
shiftId: null,
|
||||
ancestors: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
factoryCode: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('mes/reportWork/processFinishExport', {
|
||||
...this.queryParams
|
||||
}, `processFinish_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="98px">
|
||||
<el-form-item label="报工日期" prop="productDateArray">
|
||||
<el-date-picker
|
||||
v-model="queryParams.productDateArray"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编码" prop="orderCode">
|
||||
<el-input
|
||||
v-model="queryParams.orderCode"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品编号" prop="productCode">
|
||||
<el-input
|
||||
v-model="queryParams.productCode"
|
||||
placeholder="请输入产品编码"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="产品名称" prop="productName">
|
||||
<el-input
|
||||
v-model="queryParams.productName"
|
||||
placeholder="请输入产品名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="规格型号" prop="productSpc">
|
||||
<el-input
|
||||
v-model="queryParams.productSpc"
|
||||
placeholder="请输入规格型号"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="工厂名称" prop="factoryName">
|
||||
<el-input
|
||||
v-model="queryParams.factoryName"
|
||||
placeholder="请输入工厂名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车间名称" prop="carName">
|
||||
<el-input
|
||||
v-model="queryParams.carName"
|
||||
placeholder="请输入车间名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="机台名称" prop="machineName">
|
||||
<el-input
|
||||
v-model="queryParams.machineName"
|
||||
placeholder="请输入机台名称"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['mes:prepare:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="prepareList"
|
||||
:summary-method="getSummaries"
|
||||
show-summary
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- 序号 -->
|
||||
<el-table-column type="index" align="center" :index="indexMethod" label="序号"/>
|
||||
<el-table-column label="工厂编码" align="center" prop="factoryCode" />
|
||||
<el-table-column label="工厂名称" align="center" prop="factoryName" />
|
||||
<el-table-column label="车间编码" align="center" prop="carCode" />
|
||||
<el-table-column label="车间名称" align="center" prop="carName" />
|
||||
<el-table-column label="机台编码" align="center" prop="machineCode" />
|
||||
<el-table-column label="机台名称" align="center" prop="machineName" />
|
||||
<el-table-column label="订单编号" align="center" prop="orderCode" />
|
||||
<el-table-column label="产品编码" align="center" prop="productCode" width="120"/>
|
||||
<el-table-column label="产品名称" align="center" prop="productName" width="150"/>
|
||||
<el-table-column label="规格型号" align="center" prop="productSpc" />
|
||||
<el-table-column label="派工数量" align="center" prop="quantity" />
|
||||
<el-table-column label="报工数量" align="center" prop="quantityFeedback" />
|
||||
<el-table-column label="单位" align="center" prop="unit" />
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getProductionList} from "@/api/mes/reportWork";
|
||||
import moment from 'moment';
|
||||
export default {
|
||||
name: "Prepare",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 备料单表格数据
|
||||
prepareList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
productDateArray: [new Date(),new Date()],
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
parentOrder: null,
|
||||
orderId: null,
|
||||
orderCode: null,
|
||||
productId: null,
|
||||
productCode: null,
|
||||
prodType: null,
|
||||
productName: null,
|
||||
productSpc: null,
|
||||
wetDetailPlanId: null,
|
||||
productDate: null,
|
||||
shiftId: null,
|
||||
ancestors: null,
|
||||
status: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
factoryCode: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
indexMethod(index){
|
||||
return index+1 ;
|
||||
},
|
||||
/** 查询备料单列表 */
|
||||
getList() {
|
||||
|
||||
if(this.queryParams.productDateArray!=null){
|
||||
this.queryParams.productDateStart = moment(this.queryParams.productDateArray[0]).format('YYYY-MM-DD');
|
||||
this.queryParams.productDateEnd = moment(this.queryParams.productDateArray[1]).format('YYYY-MM-DD');
|
||||
}
|
||||
|
||||
this.loading = true;
|
||||
getProductionList(this.queryParams).then(response => {
|
||||
this.prepareList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
prepareId: null,
|
||||
workorderCode: null,
|
||||
workorderName: null,
|
||||
parentOrder: null,
|
||||
orderId: null,
|
||||
orderCode: null,
|
||||
productId: null,
|
||||
productCode: null,
|
||||
prodType: null,
|
||||
productName: null,
|
||||
productSpc: null,
|
||||
wetDetailPlanId: null,
|
||||
productDate: null,
|
||||
shiftId: null,
|
||||
ancestors: null,
|
||||
status: null,
|
||||
remark: null,
|
||||
attr1: null,
|
||||
attr2: null,
|
||||
attr3: null,
|
||||
attr4: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
factoryCode: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('mes/prepare/export', {
|
||||
...this.queryParams
|
||||
}, `prepare_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
getSummaries(param) {
|
||||
const { columns, data } = param;
|
||||
const sums = [];
|
||||
columns.forEach((column, index) => {
|
||||
if (index === 0) {
|
||||
sums[index] = '合计';
|
||||
return;
|
||||
}
|
||||
const values = data.map(item => Number(item[column.property]));
|
||||
if (!values.every(value => isNaN(value))) {
|
||||
sums[index] = values.reduce((prev, curr) => {
|
||||
const value = Number(curr);
|
||||
if (!isNaN(value)) {
|
||||
return prev + curr;
|
||||
} else {
|
||||
return prev;
|
||||
}
|
||||
}, 0);
|
||||
sums[index] += '';
|
||||
if(sums[index] > 1000000){
|
||||
sums[index] = '';
|
||||
}
|
||||
} else {
|
||||
sums[index] = '';//N/A
|
||||
}
|
||||
});
|
||||
|
||||
return sums;
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue