Commit 0736dec0 authored by 沈翠玲's avatar 沈翠玲

生产报表导出

parent 480f34b2
......@@ -35,6 +35,9 @@
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="$t('明细')">
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<el-table v-loading="loading" :data="tbodys" :max-height="tableHeight">
<el-table-column :label="item.label" :width="item.width" align="center" :prop="item.value" v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope">
......@@ -63,8 +66,9 @@
</el-option>
</el-select>
</el-col>
<el-col :span="1">
<el-col :span="3">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
<el-button type="primary" size="mini" @click="handleExport" :disabled="Number(tabIndex) !== 0 && !statisisType">{{$t('导出')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="tbodys1" :max-height="tableHeight">
......@@ -348,6 +352,33 @@ export default {
this.loading = false;
});
},
handleExport(){
let apiName = ''
if (Number(this.tabIndex) === 0) {
apiName = 'report/pro/feedback/getList/export'
} else if(this.statisisType === i18n.t('车间')){
apiName = 'report/pro/feedback/getListByWorkshop/export'
} else if(this.statisisType === i18n.t('工作中心')){
apiName = 'report/pro/feedback/getListByWorkstation/export'
} else if(this.statisisType === i18n.t('工作单元')){
apiName = 'report/pro/feedback/getListByWorkunit/export'
} else if(this.statisisType === i18n.t('工序')){
apiName = 'report/pro/feedback/getListByProcess/export'
} else if(this.statisisType === i18n.t('人员')){
apiName = 'report/pro/feedback/getListByUser/export'
} else if(this.statisisType === i18n.t('工单')) {
apiName = 'report/pro/feedback/getListByWorkOrder/export'
} else if(this.statisisType === i18n.t('不合格原因')) {
apiName = 'report/pro/feedback/getListByDefect/export'
}
this.download(
apiName,
{
...this.queryParams,
},
`abnormalAnaly_${new Date().getTime()}.xlsx`
);
},
/** 搜索按钮操作 */
handleQuery() {
if (Number(this.tabIndex) === 1 && !this.statisisType) this.$modal.msgWarnning(this.$t(i18n.t('请选择统计方式')));
......@@ -376,14 +407,6 @@ export default {
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
}
}
};
......
......@@ -66,7 +66,9 @@
</el-form>
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<div class="table-box" style="width: 100%">
<el-table v-loading="loading" :data="tbodys" show-summary class='tableHei' :max-height="tableHeight" :summary-method="getSummaries">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders.slice(0, 2)" :key="index + 'key'" fixed="left" width="150" />
......@@ -194,7 +196,7 @@ export default {
this._resizeHandler()
})
this._resizeHandler = () => {
this.tableHeight = window.innerHeight - 320
this.tableHeight = window.innerHeight - 370
}
window.addEventListener('resize', this._resizeHandler)
},
......@@ -207,6 +209,27 @@ export default {
watch: {
},
methods: {
handleExport(){
let apiName = ''
if(this.statisisType === i18n.t('车间')){
apiName = 'dailyProductionReport/getListByWorkshop/export'
} else if(this.statisisType === i18n.t('工作中心')){
apiName = 'dailyProductionReport/getListByWorkstation/export'
} else if(this.statisisType === i18n.t('工作单元')){
apiName = 'dailyProductionReport/getListByWorkunit/export'
} else if(this.statisisType === i18n.t('工序')){
apiName = 'dailyProductionReport/getListByProcess/export'
} else if(this.statisisType === i18n.t('人员')){
apiName = 'dailyProductionReport/getListByUser/export'
}
this.download(
apiName,
{
...this.queryParams,
},
`dailyProductionReport_${new Date().getTime()}.xlsx`
);
},
getSummaries(param){
const { columns, data } = param
const sums = []
......
......@@ -63,7 +63,9 @@
</el-form>
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<div class="table-box" style="width: 100%">
<el-table v-loading="loading" :data="tbodys" show-summary class='tableHei' :max-height="tableHeight" :summary-method="getSummaries">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders.slice(0, 2)" :key="index + 'key'" fixed="left" width="150" />
......@@ -203,6 +205,27 @@ export default {
watch: {
},
methods: {
handleExport(){
let apiName = ''
if(this.statisisType === i18n.t('车间')){
apiName = 'monthlyProductionReport/getListByWorkshop/export'
} else if(this.statisisType === i18n.t('工作中心')){
apiName = 'monthlyProductionReport/getListByWorkstation/export'
} else if(this.statisisType === i18n.t('工作单元')){
apiName = 'monthlyProductionReport/getListByWorkunit/export'
} else if(this.statisisType === i18n.t('工序')){
apiName = 'monthlyProductionReport/getListByProcess/export'
} else if(this.statisisType === i18n.t('人员')){
apiName = 'monthlyProductionReport/getListByUser/export'
}
this.download(
apiName,
{
...this.queryParams,
},
`monthlyProductionReport_${new Date().getTime()}.xlsx`
);
},
getSummaries(param){
const { columns, data } = param
const sums = []
......
......@@ -33,6 +33,9 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{$t('重置')}}</el-button>
</el-form-item>
</el-form>
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<el-table v-loading="loading" :data="tbodys" @row-click="mainTableClick" :height="tableHeight" :row-class-name="tableRowClassName">
<el-table-column :label="$t('项目号')" align="center" prop="customerProjectNo"></el-table-column>
<el-table-column :label="$t('订单号')" align="center" prop="orderCode"></el-table-column>
......@@ -294,13 +297,14 @@ export default {
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
handleExport(){
this.download(
'report/pro/workOrderProgress/getList/export',
{
...this.queryParams,
},
`productProcess_${new Date().getTime()}.xlsx`
);
}
}
};
......
......@@ -81,6 +81,9 @@
<el-tabs type="border-card" @tab-click="tabClick">
<el-tab-pane :label="$t('明细')">
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys" >
<el-table-column :label="item.label" align="center" :prop="item.value" :width="item.width" v-for="(item, index) in theaders" :key="index">
<template slot-scope="scope">
......@@ -109,8 +112,9 @@
</el-option>
</el-select>
</el-col>
<el-col :span="1">
<el-col :span="3">
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{$t('查询')}}</el-button>
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :max-height="tableHeight" :data="tbodys1">
......@@ -437,13 +441,30 @@ import dayjs from 'dayjs'
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 导出按钮操作 */
handleExport() {
const row = this.selectedRows[0]
this.download('pro/serial/lpn/record/export', {
salesVoucher: row.salesVoucher,
salesVoucherItem: row.salesVoucherItem,
}, `dta_${new Date().getTime()}.xlsx`)
handleExport(){
let apiName = ''
if (Number(this.tabIndex) === 0) {
apiName = 'report/pro/feedback/getList/export'
} else if(this.statisisType === i18n.t('车间')){
apiName = 'report/pro/feedback/getListByWorkshop/export'
} else if(this.statisisType === i18n.t('工作中心')){
apiName = 'report/pro/feedback/getListByWorkstation/export'
} else if(this.statisisType === i18n.t('工作单元')){
apiName = 'report/pro/feedback/getListByWorkunit/export'
} else if(this.statisisType === i18n.t('工序')){
apiName = 'report/pro/feedback/getListByProcess/export'
} else if(this.statisisType === i18n.t('人员')){
apiName = 'report/pro/feedback/getListByUser/export'
} else if(this.statisisType === i18n.t('工单')) {
apiName = 'report/pro/feedback/getListByWorkOrder/export'
}
this.download(
apiName,
{
...this.queryParams,
},
`statistAnaly_${new Date().getTime()}.xlsx`
);
}
}
};
......
......@@ -63,7 +63,9 @@
</el-form>
<el-row style="margin-bottom: 10px;">
<el-button type="primary" size="mini" @click="handleExport">{{$t('导出')}}</el-button>
</el-row>
<div class="table-box" style="width: 100%">
<el-table v-loading="loading" :data="tbodys" show-summary class='tableHei' :max-height="tableHeight" :summary-method="getSummaries">
<el-table-column :label="item.label" align="center" :prop="item.value" v-for="(item, index) in theaders.slice(0, 2)" :key="index + 'key'" fixed="left" width="150" />
......@@ -203,6 +205,27 @@ export default {
watch: {
},
methods: {
handleExport(){
let apiName = ''
if(this.statisisType === i18n.t('车间')){
apiName = 'weeklyProductionReport/getListByWorkshop/export'
} else if(this.statisisType === i18n.t('工作中心')){
apiName = 'weeklyProductionReport/getListByWorkstation/export'
} else if(this.statisisType === i18n.t('工作单元')){
apiName = 'weeklyProductionReport/getListByWorkunit/export'
} else if(this.statisisType === i18n.t('工序')){
apiName = 'weeklyProductionReport/getListByProcess/export'
} else if(this.statisisType === i18n.t('人员')){
apiName = 'weeklyProductionReport/getListByUser/export'
}
this.download(
apiName,
{
...this.queryParams,
},
`weeklyProductionReport_${new Date().getTime()}.xlsx`
);
},
getSummaries(param){
const { columns, data } = param
const sums = []
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment