|
|
@@ -10,7 +10,7 @@ |
|
|
|
size="mini" |
|
|
|
type="primary" |
|
|
|
icon="el-icon-printer" |
|
|
|
@click="PrinterClick" |
|
|
|
@click="printReport" |
|
|
|
></el-button> |
|
|
|
<el-button size="mini" type="primary" @click="excelClick">Excel</el-button> |
|
|
|
<el-button size="mini" type="primary" @click="downloadSprintTestReport">PDF</el-button> |
|
|
@@ -135,6 +135,9 @@ export default { |
|
|
|
tableWidth: "", //表格宽度 |
|
|
|
databak: "", //数据备份 |
|
|
|
headerMonth:'',//标题时间 |
|
|
|
User_name:{ |
|
|
|
user_name:'' |
|
|
|
} |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
@@ -160,7 +163,6 @@ export default { |
|
|
|
id: 999999, |
|
|
|
user_name: "合计:", |
|
|
|
all_money: "", |
|
|
|
assign_money: "", |
|
|
|
partfull: "", |
|
|
|
// name: "合计:", |
|
|
|
// salary: "", |
|
|
@@ -208,6 +210,49 @@ export default { |
|
|
|
loading.close(); |
|
|
|
}, 2000); |
|
|
|
}, |
|
|
|
printReport() { |
|
|
|
this.$report.init().then(() => { |
|
|
|
//this.report.dialog = true; |
|
|
|
//实例化基础类 |
|
|
|
let report = new Stimulsoft.Report.StiReport(); |
|
|
|
//加载模板代码 |
|
|
|
|
|
|
|
let file = "/report/yuangonggongzi.mrt" |
|
|
|
report.loadFile(file) |
|
|
|
const bar = { |
|
|
|
month: this.month, |
|
|
|
staff: this.staffName |
|
|
|
} |
|
|
|
const User_name ={ |
|
|
|
User_name: this.user_name |
|
|
|
} |
|
|
|
|
|
|
|
//头 |
|
|
|
let dataSet = new Stimulsoft.System.Data.DataSet('source_0'); |
|
|
|
dataSet.readJson({ bar: bar }); |
|
|
|
report.regData(dataSet.dataSetName, "", dataSet); |
|
|
|
|
|
|
|
//明细 |
|
|
|
let dataSet1 = new Stimulsoft.System.Data.DataSet('source_1'); |
|
|
|
dataSet1.readJson({ root_gongzi_all: this.showtable }); |
|
|
|
console.log(this.showtable) |
|
|
|
report.regData(dataSet1.dataSetName, "", dataSet1); |
|
|
|
|
|
|
|
//汇总 |
|
|
|
let dataSet2 = new Stimulsoft.System.Data.DataSet('source_2'); |
|
|
|
dataSet2.readJson({ User_name: User_name }); |
|
|
|
console.log(); |
|
|
|
report.regData(dataSet2.dataSetName, "", dataSet2); |
|
|
|
|
|
|
|
//同步数据源 |
|
|
|
report.dictionary.synchronize(); |
|
|
|
//直接打印 |
|
|
|
report.renderAsync(() => { |
|
|
|
report.print(); |
|
|
|
this.$emit('startPrint', 0); |
|
|
|
}); |
|
|
|
}) |
|
|
|
}, |
|
|
|
PrinterClick() { |
|
|
|
if(this.gongzi_All.length==0){ |
|
|
|
this.$Message.error('暂无数据无法打印') |