更新
This commit is contained in:
@@ -43,8 +43,8 @@
|
||||
<script>
|
||||
import AddOrUpdate from './add-or-updata';
|
||||
import basicPage from '@/mixins/basic-page';
|
||||
import { getLineAll } from '@/api/base/productionLine';
|
||||
import { getcostOriginRatioHisPage } from '@/api/cost/costOriginRatioHis';
|
||||
import { getLinePage } from '@/api/base/productionLine';
|
||||
import { getcostOriginRatioHisPage,exportcostOriginRatioHisExcel } from '@/api/cost/costOriginRatioHis';
|
||||
import { parseTime } from '@/filter/code-filter';
|
||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||
const tableProps = [
|
||||
@@ -52,10 +52,12 @@ const tableProps = [
|
||||
prop: 'recTime',
|
||||
label: '日期',
|
||||
filter: (val) => parseTime(val, '{y}年{m}月{d}日'),
|
||||
width:130,
|
||||
},
|
||||
{
|
||||
prop: 'bindObjectName',
|
||||
label: '产线',
|
||||
width:145,
|
||||
},
|
||||
{
|
||||
prop: 'thick',
|
||||
@@ -128,6 +130,15 @@ export default {
|
||||
name: 'search',
|
||||
color: 'primary',
|
||||
},
|
||||
{
|
||||
type: 'separate',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
btnName: '导出',
|
||||
name: 'export',
|
||||
color: 'warning',
|
||||
},
|
||||
],
|
||||
listQuery: {
|
||||
statisticType: 1,
|
||||
@@ -148,8 +159,13 @@ export default {
|
||||
AddOrUpdate,
|
||||
},
|
||||
created() {
|
||||
getLineAll().then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data;
|
||||
const params ={
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
pdType: 1
|
||||
}
|
||||
getLinePage(params).then((response) => {
|
||||
this.formConfig[1].selectOptions = response.data.list;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
@@ -172,7 +188,8 @@ export default {
|
||||
case 'export':
|
||||
this.listQuery.pageNo = 1;
|
||||
this.listQuery.pageSize = 10;
|
||||
this.listQuery.name = val.name;
|
||||
this.listQuery.bindObjectId = val.name || null;
|
||||
this.listQuery.statisticType = val.statisticType || 1;
|
||||
this.listQuery.startTime = val.searchTime ? val.searchTime[0] : null;
|
||||
this.listQuery.endTime = val.searchTime
|
||||
? val.searchTime[1].substr(0, 10) + ' 23:59:59'
|
||||
@@ -195,6 +212,25 @@ export default {
|
||||
this.otherMethods(val);
|
||||
}
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
let exportURL, title;
|
||||
exportURL = exportcostOriginRatioHisExcel;
|
||||
title = '原片成本-原片良品率';
|
||||
// 处理查询参数
|
||||
let params = { ...this.listQuery };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm('是否确认导出所有数据项?')
|
||||
.then(() => {
|
||||
return exportURL(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, title + '报表.xls');
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user