新增报表和首页

master
zhaoxiaolin 1 year ago
parent 5d9cebb6d7
commit 88977214cd

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = Open Platform VUE_APP_TITLE = 榄菊管理系统
# 开发环境配置 # 开发环境配置
ENV = 'development' ENV = 'development'

@ -1,5 +1,5 @@
# 页面标题 # 页面标题
VUE_APP_TITLE = Open Platform VUE_APP_TITLE = 榄菊管理系统
NODE_ENV = production NODE_ENV = production

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 31 KiB

@ -42,3 +42,20 @@ export function delReportWork(id) {
method: 'delete' method: 'delete'
}); });
} }
// 查询工单的工序完成列表
export function getProcessFinishList(query) {
return request({
url: '/mes/reportWork/getProcessFinishList',
method: 'get',
params: query
});
}
//成品产量报表
export function getProductionList(query) {
return request({
url: '/mes/reportWork/getProductionList',
method: 'get',
params: query
});
}

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>

@ -7,6 +7,8 @@ import * as echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize' import resize from './mixins/resize'
export default { export default {
mixins: [resize], mixins: [resize],
props: { props: {
@ -20,7 +22,7 @@ export default {
}, },
height: { height: {
type: String, type: String,
default: '350px' default: '260px'
}, },
autoResize: { autoResize: {
type: Boolean, type: Boolean,
@ -39,12 +41,19 @@ export default {
watch: { watch: {
chartData: { chartData: {
deep: true, deep: true,
handler(val) { //handler(val) {
this.setOptions(val) //debugger
//this.setOptions(val)
//}
handler(newValue,oldValue){
this.chart.dispose();
this.chartData=newValue;
this.initChart(); //echarts
} }
} }
}, },
mounted() { mounted() {
debugger
this.$nextTick(() => { this.$nextTick(() => {
this.initChart() this.initChart()
}) })
@ -61,10 +70,14 @@ export default {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.setOptions(this.chartData) this.setOptions(this.chartData)
}, },
setOptions({ expectedData, actualData } = {}) { setOptions({seriesNames,xAxisDatas,seriesDatas} = {}) {
this.chart.setOption({ this.chart.setOption({
/**
title: {
text: '小榄工厂蚊香车间周产量一览'
},**/
xAxis: { xAxis: {
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], data: xAxisDatas,//
boundaryGap: false, boundaryGap: false,
axisTick: { axisTick: {
show: false show: false
@ -90,44 +103,21 @@ export default {
} }
}, },
legend: { legend: {
data: ['expected', 'actual'] data: seriesNames
}, },
series: [{ series:seriesDatas,
name: 'expected', itemStyle: { toolbox:{
normal: { show: true,
color: '#FF005A', feature: {
lineStyle: { dataZoom: {
color: '#FF005A', yAxisIndex: 'none'
width: 2 },
} dataView: { readOnly: false },
} magicType: { type: ['line', 'bar'] },
}, restore: {},
smooth: true, saveAsImage: {}
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'
}]
}) })
} }
} }

@ -45,15 +45,25 @@ export default {
this.chart = echarts.init(this.$el, 'macarons') this.chart = echarts.init(this.$el, 'macarons')
this.chart.setOption({ this.chart.setOption({
title: {
text: '包装线01',
//subtext: '',
bottom: 'bottom'
},
tooltip: { tooltip: {
trigger: 'item', trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)' formatter: '{a} <br/>{b} : {c} ({d}%)'
}, },
/**
legend: { legend: {
left: 'center', left: 'center',
bottom: '10', bottom: '10',
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts'] data: ['榄菊檀香型精品线香蚊香(60装)','榄菊加大盘高级型蚊香优惠装(30装)',
}, '榄菊高级型蚊香3+1家庭特惠装(18装)',
'榄菊牌小盘高级型黑蚊香(中天繁体)(60装)(出口)',
'榄菊牌小盘高级型蚊香筒装(繁体版)(6装)(出口)'
]
},**/
series: [ series: [
{ {
name: 'WEEKLY WRITE ARTICLES', name: 'WEEKLY WRITE ARTICLES',
@ -62,11 +72,11 @@ export default {
radius: [15, 95], radius: [15, 95],
center: ['50%', '38%'], center: ['50%', '38%'],
data: [ data: [
{ value: 320, name: 'Industries' }, { value: 320, name: '榄菊檀香型精品线香蚊香(60装)' },
{ value: 240, name: 'Technology' }, { value: 240, name: '榄菊加大盘高级型蚊香优惠装(30装)' },
{ value: 149, name: 'Forex' }, { value: 149, name: '榄菊高级型蚊香3+1家庭特惠装(18装)' },
{ value: 100, name: 'Gold' }, { value: 100, name: '榄菊牌小盘高级型黑蚊香(中天繁体)(60装)(出口)' },
{ value: 59, name: 'Forecasts' } { value: 59, name: '榄菊牌小盘高级型蚊香筒装(繁体版)(6装)(出口)' }
], ],
animationEasing: 'cubicInOut', animationEasing: 'cubicInOut',
animationDuration: 2600 animationDuration: 2600

@ -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>

@ -2,36 +2,22 @@
<div class="app-container home"> <div class="app-container home">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :sm="24" :lg="24"> <el-col :sm="24" :lg="24">
<blockquote class="text-warning" style="font-size: 14px"> <span style="font-size: 20px;margin: 40%;color: cadetblue;">小榄工厂本月产量</span>
</blockquote>
<hr />
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :sm="24" :lg="12" style="padding-left: 20px"> <el-col :span="24">
<h2>榄菊生产管理系统</h2> <div style="border: 1px solid #cfdee4;">
<p> <line-chart :chart-data="lineChartData" ref="lineChart"/>
<b>当前版本:</b> <span>v{{ version }}</span> </div>
</p>
</el-col>
<el-col :sm="24" :lg="12" style="padding-left: 50px">
<el-row>
<el-col :span="12">
<h2>管理模块</h2>
</el-col> </el-col>
</el-row> </el-row>
<el-row> <el-row :gutter="20">
<el-col :span="6"> <el-col :span="12">
<h3>1.计划管理</h3> <pie-chart ref="pieChart"/>
<h3>2.工艺管理</h3>
<h3>3.MES管理</h3>
<h3>4.WMS管理</h3>
<h3>5.基础数据管理</h3>
<h3>6.系统服务管理</h3>
</el-col> </el-col>
</el-row> <el-col :span="12">
<pie-chart ref="pieChart2"/>
</el-col> </el-col>
</el-row> </el-row>
<el-divider /> <el-divider />
@ -41,12 +27,57 @@
</template> </template>
<script> <script>
import LineChart from './dashboard/LineChart';
import PieChart from './dashboard/PieChart';
import PieChart2 from './dashboard/PieChart2';
export default { export default {
name: "Index", name: "Index",
components: {
LineChart,PieChart,PieChart2
},
data() { data() {
const lineChartData= {
seriesNames: ['榄菊大盘薰衣草蚊香筒装(18装)', '榄菊儿宝健蚊香(60装)', '榄菊小盘无烟型蚊香赠品装(288装)', '榄菊无烟型蚊香优惠装(30装)', '榄菊加大盘儿宝健蚊香(60装)'],
xAxisDatas: ['2023/08/01', '2023/08/02', '2023/08/03', '2023/08/04', '2023/08/05', '2023/08/06', '2023/08/07',
'2023/08/08','2023/08/09','2023/08/10','2023/08/11','2023/08/12','2023/08/13','2023/08/14',
],
seriesDatas: [
{
name: '榄菊大盘薰衣草蚊香筒装(18装)',
type: 'line',
stack: 'Total',
data: [120, 132, 101, 134, 90, 230, 210,120, 132, 101, 134, 90, 230, 210]
},
{
name: '榄菊儿宝健蚊香(60装)',
type: 'line',
stack: 'Total',
data: [220, 182, 191, 234, 290, 330, 310,220, 182, 191, 234, 290, 330, 310]
},
{
name: '榄菊小盘无烟型蚊香赠品装(288装)',
type: 'line',
stack: 'Total',
data: [150, 232, 201, 154, 190, 330, 410,150, 232, 201, 154, 190, 330, 410]
},
{
name: '榄菊无烟型蚊香优惠装(30装)',
type: 'line',
stack: 'Total',
data: [320, 332, 301, 334, 390, 330, 150, 320, 332, 301, 334, 390, 330, 320]
},
{
name: '榄菊加大盘儿宝健蚊香(60装)',
type: 'line',
stack: 'Total',
data: [820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290, 1330, 1320]
}
]
}
return { return {
// //
version: "1.0.0", version: "1.0.0",
lineChartData: lineChartData
}; };
}, },
methods: { methods: {

@ -1,5 +1,5 @@
<template> <template>
<div class="login"> <div class="login" style="padding-right: 10%;">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">榄菊生产管理系统</h3> <h3 class="title">榄菊生产管理系统</h3>
<el-form-item prop="username"> <el-form-item prop="username">
@ -158,7 +158,7 @@ export default {
<style rel="stylesheet/scss" lang="scss"> <style rel="stylesheet/scss" lang="scss">
.login { .login {
display: flex; display: flex;
justify-content: center; justify-content: end;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/images/login-background.jpg"); background-image: url("../assets/images/login-background.jpg");

@ -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…
Cancel
Save