Commit 2c1f235c by zhuxiaomei

历史抽样单的下载打印

parent 25409d87
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
<div>样品名称:{{item.sampleName}}</div> <div>样品名称:{{item.sampleName}}</div>
<div>被抽样单位名称:{{item.testedName}}</div> <div>被抽样单位名称:{{item.testedName}}</div>
</div> </div>
<template #right>
<van-button square type="primary" text="打印" class="swipe-cell-btn"
@click="_print(item)"></van-button>
</template>
</van-swipe-cell> </van-swipe-cell>
</van-list> </van-list>
</div> </div>
...@@ -126,6 +130,23 @@ ...@@ -126,6 +130,23 @@
this.page = this.page + 1; this.page = this.page + 1;
this._getData() this._getData()
}, },
_print(item) {
//调用第三放程序打开指定文件(必须是本地路径)
this.$toast.loading({
message: '加载中...',
forbidClick: true,
});
var dtask = plus.downloader.createDownload(
this.$global.baseURL + '/drs/v1/sampling_summary/export_multi_sampling?id=' + item.id, {}, (d, status) => {
if (status == 200) {
plus.runtime.openFile(d.filename);//cn.wps.moffice_eng-----wps的包名
}
this.$toast.clear();
});
dtask.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
dtask.setRequestHeader('accessToken', localStorage.getItem('accessToken'));
dtask.start();
},
_goto(item) { _goto(item) {
if (item.testedType === 1) { if (item.testedType === 1) {
this.$router.push({path: '/sampling_list/sampling_list_detail_net', query: {id: item.id}}) this.$router.push({path: '/sampling_list/sampling_list_detail_net', query: {id: item.id}})
......
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