|
@@ -22,6 +22,7 @@
|
|
|
parmValue.page = 1;
|
|
|
searchList();
|
|
|
"
|
|
|
+ @selection="selection_change"
|
|
|
>
|
|
|
<template #table-header="{}">
|
|
|
<div style="width: 100%">
|
|
@@ -157,6 +158,16 @@
|
|
|
重置
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
+ <!-- 暂时注释,下版需要导出 -->
|
|
|
+ <el-col :span="4" style="width: 66px; float: right">
|
|
|
+
|
|
|
+ <el-button type="primary" style="margin-left:30px;" @click="download" :size="searchSize" class="fr">
|
|
|
+ 导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -212,7 +223,7 @@
|
|
|
<script>
|
|
|
import mixinPage from "@/mixins/elPaginationHandle";
|
|
|
import resToken from "@/mixins/resToken";
|
|
|
-
|
|
|
+import urlConfig from "@/apis/url-config";
|
|
|
import asyncRequest from "@/apis/service/purchaseIn/purchaseOrder";
|
|
|
import { columns, order_type_options, statusOptions } from "./columns";
|
|
|
import { mapGetters } from "vuex";
|
|
@@ -237,6 +248,8 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ changeList: [],
|
|
|
+ fileUrl: urlConfig.baseURL,
|
|
|
sitem: null,
|
|
|
select: "1",
|
|
|
input: "",
|
|
@@ -302,6 +315,79 @@ export default {
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ //选中触发函数
|
|
|
+ selection_change(e) {
|
|
|
+ const { list } = e;
|
|
|
+ //选中的数组集合
|
|
|
+ this.changeList = list.length > 0 ? JSON.parse(JSON.stringify(list)) : [];
|
|
|
+ },
|
|
|
+ //导出文件 (需要修改)
|
|
|
+ async download() {
|
|
|
+ if(this.changeList.length<=0){
|
|
|
+ this.$message.warning("请选择有效数据")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let model = {
|
|
|
+ cgdNos:[]
|
|
|
+ }
|
|
|
+ this.changeList.forEach(item => {
|
|
|
+ model.cgdNos.push(item.cgdNo)
|
|
|
+ });
|
|
|
+
|
|
|
+ // const res = await asyncRequest.exportcgdlist(model)
|
|
|
+
|
|
|
+
|
|
|
+ if (!this.loading) {
|
|
|
+ this.loading = true;
|
|
|
+ // let httpType = `aplication/zip`;
|
|
|
+ let model = {};
|
|
|
+ axios({
|
|
|
+ method: "post",
|
|
|
+ url: this.fileUrl + "admin/exportcgdlist",
|
|
|
+ responseType: "blob",
|
|
|
+ data: model,
|
|
|
+ headers: {
|
|
|
+ 'Content-Type': 'multipart/form-data',
|
|
|
+ },
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ // console.log(res)
|
|
|
+ // console.log(this.fileUrl)
|
|
|
+ // return;
|
|
|
+ if (res && res.status == 200 && res.data) {
|
|
|
+ let url = window.URL.createObjectURL(
|
|
|
+ new Blob([res.data], {
|
|
|
+ // type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=utf-8",
|
|
|
+ type: 'application/vnd.ms-excel'
|
|
|
+ })
|
|
|
+ );
|
|
|
+ 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对象
|
|
|
+ this.$message.success(`${message}导出成功!`);
|
|
|
+ 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;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
restSearch() {
|
|
|
this.sselect = "创建时间";
|
|
|
this.select = "1";
|