Commit ffa609d2 by wangweidong

Merge remote-tracking branch 'origin/dev' into dev

parents 7aab30c7 a9297d45
...@@ -208,5 +208,16 @@ export default { ...@@ -208,5 +208,16 @@ export default {
'&entrustId=' + '&entrustId=' +
data.entrustId data.entrustId
) )
.then(res => res),
generateReport: data =>
http
.post(
'soil/v1/exp_report/generate_report?entrustId=' +
data.entrustId +
'&templateId=' +
data.templateId +
'&expReportIds=' +
data.expReportIds
)
.then(res => res) .then(res => res)
} }
...@@ -173,10 +173,39 @@ export default { ...@@ -173,10 +173,39 @@ export default {
if (data) { if (data) {
console.log(this.selectIds) console.log(this.selectIds)
console.log(data) console.log(data)
this._makeCodeExcel(data)
} else { } else {
this.$refs.pageTable._hideLoading() this.$refs.pageTable._hideLoading()
} }
}, },
_makeCodeExcel: async function(data) {
this.$refs.pageTable._hideLoading()
const result = await soilSample.generateReport({
entrustId: this.formObj.entrustId,
expReportIds: this.selectIds,
templateId: data.id
})
if (result) {
// await this._page()
if (result === null || result === undefined) {
this.$Message.warning('证书编制失败,请联系管理员!')
this.$refs.pageTable._hideLoading()
return false
} else {
this._viewReport(result)
}
}
},
_viewReport(data) {
if (data) {
this.$openWindowModeless({
objectKey: data.objectKey,
idType: 10,
id: data.id,
isReport: 4
})
}
},
_reportMakeOk: async function() { _reportMakeOk: async function() {
const result = await soilSample.reportMake({ const result = await soilSample.reportMake({
entrustId: this.formObj.entrustId, entrustId: this.formObj.entrustId,
...@@ -257,16 +286,16 @@ export default { ...@@ -257,16 +286,16 @@ export default {
this._viewReport(result) this._viewReport(result)
} }
}, },
_viewReport(data) { // _viewReport(data) {
if (data) { // if (data) {
this.$openWindowModeless({ // this.$openWindowModeless({
objectKey: data.objectKey, // objectKey: data.objectKey,
idType: 11, // idType: 11,
id: data.id, // id: data.id,
isReport: 4 // isReport: 4
}) // })
} // }
}, // },
// 查看原始记录 // 查看原始记录
_recordView(originalRecordId) { _recordView(originalRecordId) {
let recordUrl = '' let recordUrl = ''
......
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