|
|
@@ -37,6 +37,7 @@
|
|
|
<router-link :to="'/oilsupplier/supplier/' + scope.row.Id + '/basisedit?certid=' + scope.row.CertId">
|
|
|
<el-button type="text" title="打开" icon="el-icon-edit" size="mini">打开</el-button>
|
|
|
</router-link>
|
|
|
+ <el-button type="text" @click="toWord(scope.row)" title="下载" size="mini" icon="el-icon-download" width="120px">下载</el-button>
|
|
|
|
|
|
<el-popover placement="top" title="提示">
|
|
|
<el-alert
|
|
|
@@ -458,6 +459,7 @@
|
|
|
<script>
|
|
|
import { mapGetters } from 'vuex';
|
|
|
import api from '@/api/oilsupplier/supplier';
|
|
|
+ import dataapi from '@/api/oilsupplier/dataentry'
|
|
|
import certApi from '@/api/oilsupplier/suppliercert'
|
|
|
|
|
|
export default {
|
|
|
@@ -955,7 +957,29 @@
|
|
|
console.error(err)
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+ //导出到Word文件
|
|
|
+ toWord (val) {
|
|
|
+ dataapi.docexport(val.Id, this.$axios)
|
|
|
+ .then(res => {
|
|
|
+ // response
|
|
|
+ if (res.data.code === 0) {
|
|
|
+ this.$message({
|
|
|
+ type: 'success',
|
|
|
+ message: res.data.message
|
|
|
+ })
|
|
|
+ let docurl = res.data.item
|
|
|
+ // 内网服务器专用
|
|
|
+ if (process.client && docurl.indexOf('/upfile') === 0) {
|
|
|
+ const myDomain = window.location.host
|
|
|
+ location.href = 'http://' + myDomain + '/' + docurl
|
|
|
+ } else {
|
|
|
+ location.href = 'http://' + docurl
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).catch(err => {
|
|
|
+ console.error(err)
|
|
|
+ })
|
|
|
+ },
|
|
|
getDictOptions() {
|
|
|
api.getDictList(this.$axios).then(res => {
|
|
|
//this.dictOptions.customerList = res.data.items['customerList']
|