提交 23ed5d5a 编写于 作者: 张平's avatar 张平

Merge branch 'dev-export-20201026' into 'release'

Dev export 20201026 商城 导出商品,订单

codereviewer:ping.zhang

See merge request !225
......@@ -54,7 +54,7 @@ service.interceptors.request.use(config => {
}
if( process.env.BUILD_ENV == "development" ){ // 本地开发环境qgit
// console.log('环境变量>>>> ', process.env.BUILD_ENV);
config.headers['token'] = '663645D26D40417AA86E5395D933E7B7';
config.headers['token'] = 'C5172D7D7825463CA46752A894236AC2';
// config.headers['token'] = localStorage.getItem('storageToken')
}else{
config.headers['token'] = localStorage.getItem('storageToken')
......
......@@ -171,4 +171,25 @@ export const getCircleDept = (params) => {
})
};
export const getGoodsExportUrl = (params) => {
return fetch({
headers,
url: getBaseUrl('store/goods/export'),
method: 'post',
data: params,
description: '商品导出',
})
};
export const getOrdersExportUrl = (params) => {
debugger
return fetch({
headers,
url: getBaseUrl('/store/orders/admin/export'),
method: 'get',
params: params,
description: '导出订单',
})
};
......@@ -33,13 +33,14 @@
</el-col>
</el-row>
<el-row :gutter="30" type="flex" style="margin-top: 10px">
<el-col :span="18">
<el-col :span="12">
<el-button type="primary" size="small" @click="batchOpt('on')">批量上架</el-button>
<el-button type="primary" size="small" @click="batchOpt('off')">批量下架</el-button>
</el-col>
<el-col :span="6" style="text-align: right">
<el-button type="primary" size="small" @click="batchOpt(3)">批量导入</el-button>
<el-col :span="12" style="text-align: right">
<el-button type="primary" size="small" @click="exportOpt">批量导出商品</el-button>
<el-button type="primary" size="small" @click="batchOpt(3)">批量导入商品</el-button>
<el-button type="primary" size="small" @click="edit('add')">新建单个商品</el-button>
</el-col>
</el-row>
......@@ -173,7 +174,7 @@
<script>
import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import { getRangeList,updateRangeStatus} from "../../utils/yqrange/yqrangeApi";
import { getRangeList,updateRangeStatus, getGoodsExportUrl, getOrdersExportUrl } from "../../utils/yqrange/yqrangeApi";
import { getGoodsList,batchOnOff,uploadExcel} from '@/utils/goods';
import { getBaseUrl } from '@/utils/index'
var typeList = [{
......@@ -406,7 +407,7 @@
setTimeout(()=>{
this.getLists()
},2000)
}
})
}
......@@ -524,7 +525,6 @@
this.getLists();
},
handleSizeChange(val) {
this.searchForm.pageSize = val;
this.searchForm.pageNo = 1;
......@@ -534,6 +534,17 @@
this.searchForm.pageNo = val;
this.getLists();
},
exportOpt() {
const { goodsIdList, goodsType, goodsName, storeId } = this.searchForm;
getGoodsExportUrl({ goodsIdList, goodsType, goodsName, storeId }).then(res => {
if (res.code != '000000') {
this.$message({ message: res.message, type: 'error' });
return;
}
window.open(res.data);
});
}
},
}
</script>
......
......@@ -29,6 +29,7 @@
<el-col :span="6" style="text-align: right">
<el-button type="primary" size="small" @click="searchList">查询</el-button>
<el-button type="default" size="small" @click="resetForm" style="margin-left:0;">重置</el-button>
<el-button type="primary" size="small" @click="exportOrder">导出订单</el-button>
</el-col>
</el-row>
</el-form>
......@@ -238,6 +239,7 @@
// import { openLoading, closeLoading } from "../../utils/utils";
import BreadCrumb from "@/components/breadcrumb.vue";
import SendSetDialog from "@/components/shop/send-set-dialog";
import { getOrdersExportUrl } from "@/utils/yqrange/yqrangeApi";
import { queryOrderList, updateExpress, refundApply } from "@/utils/shop";
import { toDecimal2 } from '@/utils';
......@@ -489,6 +491,17 @@
}
});
},
exportOrder() {
const { goodsName, orderNo, receiver, orderDate, storeId } = this.searchForm;
getOrdersExportUrl({ goodsName, orderNo, receiver, orderDate, storeId }).then(res => {
if (res.code != '000000') {
this.$message({ message: res.message, type: 'error' });
return;
}
window.open(res.data);
});
}
},
filters: {
toFixed2: function (value) {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册