Commit 45999212 authored by your yuchenglong's avatar your yuchenglong

update:导出,列表商品信息显示问题

parent 372f8a8c
......@@ -81,6 +81,7 @@
<el-col :span="12" style="text-align: right">
<el-button @click="exportOrder">导出</el-button>
<el-button @click="printOrder">打印</el-button>
<!-- <a href="bp-dev.ini.yidian-inc.com/order/background/order_export?marketing_id=1NJF2J&type=1">导出文件</a> -->
</el-col>
</el-row>
<el-tab-pane label="全部" name="all">
......@@ -100,9 +101,11 @@
label="订单状态"
></el-table-column>
<el-table-column prop="order_item" label="商品信息">
<!-- <template #default="scope">
{{ scope }}
</template> -->
<template #default="scope">
<div v-for="(item, index) in scope.row.order_item" :key="index">
{{ item.goods_name }}
</div>
</template>
</el-table-column>
<el-table-column prop="user_name" label="收货人"></el-table-column>
<el-table-column
......@@ -157,10 +160,13 @@
prop="order_status_text"
label="订单状态"
></el-table-column>
<el-table-column
prop="order_item"
label="商品信息"
></el-table-column>
<el-table-column prop="order_item" label="商品信息">
<template #default="scope">
<div v-for="(item, index) in scope.row.order_item" :key="index">
{{ item.goods_name }}
</div>
</template>
</el-table-column>
<el-table-column prop="user_name" label="收货人"></el-table-column>
<el-table-column
prop="sub_shop_name"
......@@ -175,12 +181,16 @@
></el-table-column>
<el-table-column fixed="right" label="操作" width="100">
<template #default="scope">
<!-- v-if="scope.row.order_status_text == '已支付'" -->
<el-button type="text" size="small" @click="refund(scope.row)"
<el-button
type="text"
size="small"
@click="refund(scope.row)"
v-show="scope.row.order_status_text == '已支付'"
>退款</el-button
>
<!-- v-else -->
<el-button-group>
<el-button-group
v-show="scope.row.order_status_text == '待退款'"
>
<el-button type="text" size="small" @click="agree(scope.row)"
>同意</el-button
>
......@@ -199,10 +209,13 @@
<el-dialog title="导出订单" width="25%" top="10%" v-model="exportShow">
<el-form-item class="exportForm" label>
<div>请选择导出活动{{ exportType }}的表格类型</div>
<el-checkbox-group v-model="exportSel.type">
<el-checkbox label="总表" name="type"></el-checkbox>
<el-checkbox label="商品表" name="type"></el-checkbox>
<el-checkbox label="配送表" name="type"></el-checkbox>
<el-checkbox-group v-model="exportSel">
<el-checkbox
v-for="i in exportSelOpt"
:label="i.type"
:key="i.type"
>{{ i.name }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
<el-form-item class="exportBtn">
......@@ -346,9 +359,12 @@ export default {
// 导出
exportShow: false,
exportType: "xxxxx",
exportSel: {
type: [],
},
exportSel: [],
exportSelOpt: [
{ type: "1", name: "总表" },
{ type: "2", name: "商品表" },
{ type: "3", name: "配送表" },
],
// 表格数据
orderTableData: [],
......@@ -431,8 +447,8 @@ export default {
handleClick(targetName) {
if (targetName.props.name == "all") {
this.orderQueryObj.order_status = "0";
this.orderStatusArr[1].disabled = true;
this.orderStatusArr[2].disabled = true;
this.orderStatusArr[1].disabled = false;
this.orderStatusArr[2].disabled = false;
} else {
this.orderQueryObj.order_status = "7";
this.orderStatusArr[1].disabled = true;
......@@ -448,20 +464,40 @@ export default {
// 确认导出
async confirmExport() {
console.log(this.exportSel.type);
const params = {
type: this.exportSel.type,
};
const res = await orderExport(params);
console.log(res);
if (this.orderQueryObj.marketing_id != "") {
const params = {
marketing_id: this.orderQueryObj.marketing_id,
type: this.exportSel,
};
const res = await orderExport(params);
if (res) {
const xlsx = "application/vnd.ms-excel";
const blob = new Blob([res], { type: xlsx });
const a = document.createElement("a");
a.download = "fileName.xls";
a.href = window.URL.createObjectURL(blob);
a.click();
a.remove();
this.exportShow = false;
} else {
this.$message.error("导出失败");
}
} else {
this.$message.error("请选择活动名称");
}
},
// 打印
async printOrder() {
const params = {
marketing_id: this.orderQueryObj.marketing_id,
};
const res = await orderPrint(params);
console.log(res);
if (this.orderQueryObj.marketing_id != "") {
const params = {
marketing_id: this.orderQueryObj.marketing_id,
};
const res = await orderPrint(params);
console.log(res);
} else {
this.$message.error("请选择活动名称");
}
},
// 获取订单列表
......@@ -499,14 +535,14 @@ export default {
console.log(res);
this.$message({
type: "success",
message: "退款成功!",
message: "已拒绝!",
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消",
});
// this.$message({
// type: "info",
// message: "已取消",
// });
});
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment