|
@@ -90,7 +90,7 @@ import tableList from "@/components/tableList";
|
|
|
import pagination from "@/components/pagination";
|
|
|
import dislogTip from "./dislogTip.vue";
|
|
|
import dislogOrderDetails from "../components/dislogOrderDetails.vue";
|
|
|
-import * as baseUrls from "@/utils/request.js";
|
|
|
+import { exportFn } from "@/utils/index.js";
|
|
|
import { orderList, orderExport } from "@/api/financed/index";
|
|
|
export default {
|
|
|
name: "cost",
|
|
@@ -294,17 +294,10 @@ export default {
|
|
|
console.log(data);
|
|
|
},
|
|
|
batchExport() {
|
|
|
- orderExport(this.backData()).then((res) => {
|
|
|
+ const fn = [orderExport, orderExport, orderExport][this.type - 1];
|
|
|
+ fn(this.backData()).then((res) => {
|
|
|
if (res.msg) {
|
|
|
- let url = baseUrls.baseURL + "common/download?fileName=" + res.msg;
|
|
|
- let link = document.createElement("a");
|
|
|
- let fileName = "导出应收应付数据" + ".xlsx";
|
|
|
- document.body.appendChild(link);
|
|
|
- link.href = url;
|
|
|
- link.dowmload = fileName;
|
|
|
- link.click();
|
|
|
- link.remove();
|
|
|
- this.$message.success("导出成功");
|
|
|
+ exportFn(res.msg, "导出应收应付数据");
|
|
|
} else {
|
|
|
this.$message.error("导出失败");
|
|
|
}
|
|
@@ -323,12 +316,12 @@ export default {
|
|
|
this.init();
|
|
|
},
|
|
|
handelClick(row) {
|
|
|
- console.log(row);
|
|
|
this.activeOrderInfo = row;
|
|
|
this.dialogVisible = true;
|
|
|
},
|
|
|
- orderList(data) {
|
|
|
- orderList(data)
|
|
|
+ getDataList(data) {
|
|
|
+ const fn = [orderList, orderList, orderList][this.type - 1];
|
|
|
+ fn(data)
|
|
|
.then((res) => {
|
|
|
this.tableData = res.rows;
|
|
|
this.total = res.total;
|
|
@@ -346,9 +339,7 @@ export default {
|
|
|
pageNum: 1,
|
|
|
};
|
|
|
}
|
|
|
- [this.orderList, this.orderList, this.orderList][this.type](
|
|
|
- this.backData()
|
|
|
- );
|
|
|
+ this.getDataList(this.backData());
|
|
|
},
|
|
|
backData() {
|
|
|
let data = this.formData;
|