|
@@ -10,6 +10,10 @@
|
|
|
>
|
|
|
<span>采购单编号:</span><span>{{ queryId }} </span>
|
|
|
<tolerance :newTime="newTime" v-if="newTime !== ''" :sitem="sitem" />
|
|
|
+
|
|
|
+ <el-button type="primary" style="margin-left:30px;" @click="download">
|
|
|
+ 下载<i class="el-icon-download el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
</div>
|
|
|
<el-tabs v-model="activeTabs">
|
|
|
<el-tab-pane label="业务详情" name="1">
|
|
@@ -183,6 +187,7 @@ import workDiffTable from "./components/work-diff-table";
|
|
|
import ShowDataTableColumns from "./components/ShowDataTableColumns";
|
|
|
import { order_type_options, statusOptions } from "./columns";
|
|
|
import tolerance from "./components/tolerance";
|
|
|
+import urlConfig from "@/apis/url-config";
|
|
|
export default {
|
|
|
name: "purchaseOrderDetail",
|
|
|
mixins: [mixinPage, resToken],
|
|
@@ -221,6 +226,8 @@ export default {
|
|
|
loading: false,
|
|
|
queryId: "",
|
|
|
ReturnAddModel: false, //采购单退货弹窗
|
|
|
+
|
|
|
+ fileUrl: urlConfig.baseURL,
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -228,6 +235,52 @@ export default {
|
|
|
this.initData();
|
|
|
},
|
|
|
methods: {
|
|
|
+ //导出文件
|
|
|
+ download(){
|
|
|
+ if (!this.loading) {
|
|
|
+ this.loading = true;
|
|
|
+ // let httpType = `aplication/zip`;
|
|
|
+ let model = {
|
|
|
+
|
|
|
+ };
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ url: this.fileUrl + "admin/checkexport",
|
|
|
+ responseType: "blob",
|
|
|
+ data: model,
|
|
|
+ // headers: {
|
|
|
+ // Accept: httpType,
|
|
|
+ // },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res && res.status == 200 && res.data) {
|
|
|
+ this.$message.success(`${message}导出成功!`);
|
|
|
+ let url = window.URL.createObjectURL(new Blob([res.data], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8'}))
|
|
|
+ let link = document.createElement('a')
|
|
|
+ link.style.display = 'none'
|
|
|
+ link.href = url
|
|
|
+ let excelName = '测试.xlsx'
|
|
|
+ link.setAttribute('download', excelName)
|
|
|
+ document.body.appendChild(link)
|
|
|
+ link.click()
|
|
|
+ link.remove()
|
|
|
+ window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.data.message);
|
|
|
+ setTimeout(() => {
|
|
|
+ this.loading = false;
|
|
|
+ }, 500);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((error) => {
|
|
|
+ console.log(error);
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
getNewTime() {
|
|
|
this.newTime = new Date().valueOf();
|
|
|
},
|