预算和指标填报
This commit is contained in:
@@ -22,7 +22,9 @@
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button style="background-color: #0B58FF;" type="primary" @click="onSubmit">查询</el-button>
|
||||
<el-button type="primary" plain size="medium" @click='downLoadExcel'>模板下载</el-button>
|
||||
<el-button type="primary" plain size="medium" @click='importExcel'>导入</el-button>
|
||||
<el-button type="primary" plain size="medium" @click='exportExcel'>导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -99,7 +101,7 @@
|
||||
|
||||
<script>
|
||||
import Container from './container.vue'
|
||||
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData} from '@/api/cockpit'
|
||||
import { getLevelStruc, getTargetMonthPage, updateTargetMonthData, getTargetYearPage, updateTargetYearData,copyLastMonthData, copyLastYearData,importTemplateYS} from '@/api/cockpit'
|
||||
import inputArea from './inputArea.vue' // 导入输入组件
|
||||
import { publicFormatter } from '@/utils/dict';
|
||||
import {getAccessToken, getTenantId} from '@/utils/auth'
|
||||
@@ -460,6 +462,41 @@ export default {
|
||||
importExcel() {
|
||||
this.upload.open = true
|
||||
},
|
||||
downLoadExcel() {
|
||||
importTemplateYS({
|
||||
levelId:this.form.levelId,
|
||||
startTime: this.form.startTime,
|
||||
endTime: this.form.endTime,
|
||||
pageSize: 1000,
|
||||
template:1,
|
||||
pageNo: this.form.pageNo,
|
||||
timeDim:this.form.timeDim
|
||||
}).then(response => {
|
||||
let fileName = '';
|
||||
if (this.timeType === 'month') {
|
||||
fileName = '月度预算导入模板.xls';
|
||||
}else{
|
||||
fileName = '年度预算导入模板.xls';
|
||||
}
|
||||
this.$download.excel(response, fileName);
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
importTemplateYS({
|
||||
levelId:this.form.levelId,
|
||||
startTime: this.form.startTime,
|
||||
endTime: this.form.endTime,
|
||||
pageSize: 1000,
|
||||
template:0,
|
||||
pageNo: this.form.pageNo,
|
||||
timeDim:this.form.timeDim
|
||||
}).then(response => {
|
||||
let mon = this.timeType=== 'month'?moment(this.form.endTime).format('YYYYMM'):moment(this.form.endTime).format('YYYY');
|
||||
let factoryName = this.levelLList.filter(item => item.id == this.form.levelId)[0].name;
|
||||
let fileName = this.timeType=== 'month'?mon + factoryName + '月度预算表.xls':mon + factoryName + '年度预算表.xls';
|
||||
this.$download.excel(response, fileName);
|
||||
});
|
||||
},
|
||||
// 文件上传中处理
|
||||
handleFileUploadProgress(file, fileList) {
|
||||
console.log('文件上传中:',file, fileList)
|
||||
|
||||
Reference in New Issue
Block a user