merchant-web/src/views/modules/operation-management/order/index.vue

412 lines
10 KiB
Vue
Raw Normal View History

2024-12-15 09:35:41 +00:00
<template>
<div style="height: calc(100vh - 200px)">
<obj-table-plus
ref="oTable"
style="height: 100%"
:tableCols="tableCols"
:tableProp="tableProp"
@query="queryList"
v-model="dataList"
:tableEvent="tableEvent"
2024-12-19 12:03:16 +00:00
:enableAutoQuery="false"
2024-12-15 09:35:41 +00:00
>
<template slot="tableTop">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="订单号">
2024-12-19 12:03:16 +00:00
<el-select v-model="formInline.group" placeholder="请选择">
<el-option
v-for="item in statusList"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
2024-12-15 09:35:41 +00:00
</el-form-item>
2024-12-19 12:03:16 +00:00
<el-form-item v-if="storeList.length > 1" label="摊铺">
<el-select
class="filter-item"
style="width: 200px"
v-model="formInline.shopId"
placeholder="请选择摊铺"
2024-12-15 09:35:41 +00:00
>
2024-12-19 12:03:16 +00:00
<el-option
v-for="item in storeList"
:key="item.shopId"
:label="item.shopName"
:value="item.shopId"
>
</el-option>
</el-select>
2024-12-15 09:35:41 +00:00
</el-form-item>
<el-form-item>
<el-button type="primary" @click="$refs.oTable.reload()"
>查询</el-button
>
<el-button type="primary" @click="Reset">重置</el-button>
</el-form-item>
</el-form>
<!-- <el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane
v-for="item in statusList"
:key="item.value"
:label="item.label"
:name="item.value"
></el-tab-pane>
</el-tabs> -->
<!-- <div class="mb-2">
<el-button type="primary" size="small" @click="addProduct"
>批量导出</el-button
>
</div> -->
</template>
</obj-table-plus>
2024-12-27 10:03:02 +00:00
<!-- 订单详情 -->
<viewDetails ref="viewDetails"></viewDetails>
2024-12-15 09:35:41 +00:00
</div>
</template>
<script>
2024-12-27 10:03:02 +00:00
import viewDetails from "./popup/view-details.vue";
import content from "./popup/content.vue";
2024-12-15 09:35:41 +00:00
import { mapState } from "vuex";
export default {
2024-12-27 10:03:02 +00:00
components: { content,viewDetails },
2024-12-15 09:35:41 +00:00
data() {
return {
activeName: "5",
value1: "1",
advanceSellStatus: "",
dataList: [],
formInline: {
2024-12-19 12:03:16 +00:00
group: "",
2024-12-15 09:35:41 +00:00
shopId: "",
},
tableProp: {
"auto-resize": true,
border: true,
height: "auto",
"row-id": "id",
"show-overflow": false,
},
statusList: [
{
2024-12-19 12:03:16 +00:00
label: "历史订单",
2024-12-15 09:35:41 +00:00
value: "0",
},
{
2024-12-19 12:03:16 +00:00
label: "进行中",
2024-12-15 09:35:41 +00:00
value: "1",
},
{
2024-12-19 12:03:16 +00:00
label: "新订单",
2024-12-15 09:35:41 +00:00
value: "2",
},
{
2024-12-19 12:03:16 +00:00
label: "待备货",
2024-12-15 09:35:41 +00:00
value: "3",
},
{
2024-12-19 12:03:16 +00:00
label: "待配送",
value: "4",
2024-12-15 09:35:41 +00:00
},
{
2024-12-19 12:03:16 +00:00
label: "售后订单",
value: "5",
2024-12-15 09:35:41 +00:00
},
],
productFilterType: "SALE",
selectList: [],
};
},
2024-12-19 12:03:16 +00:00
created() {
this.formInline = {
group: "0",
shopId: this.shopId,
};
this.$nextTick(() => {
this.$refs.oTable.reload();
});
},
2024-12-15 09:35:41 +00:00
methods: {
// getData() {
// this.$api.mer_admin
// .storeList({ marketId: this.formInline.marketId })
// .then((res) => {
// this.storeList = res.data.data;
// this.formInline.shopId = res.data.data[0].shopId;
// this.$nextTick(() => {
// this.$refs.oTable.reload();
// });
// });
// },
addProduct() {
this.$refs.addOrUpdate.toggle().add();
},
deleteProduct() {
console.log(this.selectList);
let integers = this.selectList.map((item) => {
return item.id;
});
this.$confirm("此操作将删除该商品, 是否继续?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
console.log("111");
this.$api.mer_admin.BatchDeleteProducts(integers).then((res) => {
this.$refs.oTable.reload();
});
})
.catch(() => {
this.$message({
type: "info",
message: "已取消删除",
});
});
},
queryList(pageNo, pageSize) {
this.$api.mer_admin
.orderPage({
pageNumber: pageNo,
pageSize: pageSize,
2024-12-19 12:03:16 +00:00
...this.formInline,
2024-12-15 09:35:41 +00:00
})
.then((res) => {
console.log(res);
this.$refs.oTable.complete(
res.data.data.data,
Number(res.data.data.total)
);
})
.catch((err) => {
this.$refs.oTable.complete(false);
});
},
Reset() {
this.formInline = {
2024-12-19 12:03:16 +00:00
group: "0",
shopId: this.shopId,
2024-12-15 09:35:41 +00:00
};
this.$refs.oTable.reload();
},
handleClick(e) {
console.log(e.name);
if (e.name == "5") {
this.advanceSellStatus = "";
} else {
this.advanceSellStatus = e.name;
}
this.$refs.oTable.reload();
},
addEarlyWarning() {
this.$refs.earlyWarning.toggle().add();
},
},
computed: {
tableCols() {
return [
// { type: "checkbox", width: "60px", fixed: "left" },
{
2024-12-19 12:03:16 +00:00
type: "seq",
width: "60px",
fixed: "left",
2024-12-16 13:00:34 +00:00
align: "center",
2024-12-19 12:03:16 +00:00
title: "序号",
2024-12-16 13:00:34 +00:00
},
{
2024-12-19 12:03:16 +00:00
title: "商品详情",
2024-12-16 13:00:34 +00:00
// align: "center",
// width: "120px",
// field: "unitOrderStatus",
type: "jsx-out",
render: (col) => {
console.log(col);
2024-12-19 12:03:16 +00:00
return <content />;
2024-12-15 09:35:41 +00:00
},
},
2024-12-19 12:03:16 +00:00
{
title: "总订单号",
align: "center",
width: "120px",
field: "orderNo",
},
{
title: "结算单位订单号",
align: "center",
width: "120px",
field: "unitOrderNo",
},
2024-12-15 09:35:41 +00:00
{
2024-12-16 13:00:34 +00:00
title: "总商品数量",
align: "center",
width: "120px",
field: "productCount",
},
{
title: "顾客支付",
align: "center",
width: "120px",
field: "totalMoney",
},
{
title: "配送费",
align: "center",
width: "120px",
field: "deliveryMoney",
},
{
title: "优惠券减免",
2024-12-15 09:35:41 +00:00
align: "center",
2024-12-16 13:00:34 +00:00
width: "120px",
field: "couponMoney",
},
{
title: "下单时间",
align: "center",
width: "120px",
field: "payTime",
},
{
title: "预计送达时间",
align: "center",
width: "120px",
field: "predictDeliveryTime",
},
{
title: "预计收入",
align: "center",
width: "120px",
field: "predictIncome",
},
{
title: "距离",
align: "center",
width: "120px",
field: "distance",
},
{
title: "预计自动取消时间",
align: "center",
width: "120px",
field: "predictAutoCancelTime",
},
{
title: "备注",
align: "center",
width: "120px",
field: "remark",
},
{
title: "包装费",
align: "center",
width: "120px",
field: "packageMoney",
},
{
title: "平台服务费",
align: "center",
width: "120px",
field: "platformMoney",
},
{
title: "备餐完成时间",
align: "center",
width: "120px",
field: "completePrepareTime",
},
{
title: "开始配送时间",
align: "center",
width: "120px",
field: "startDeliveryTime",
},
{
title: "配送完成时间",
align: "center",
width: "120px",
field: "startDeliveryTime",
},
{
title: "开始配送时间",
align: "center",
width: "120px",
field: "startDeliveryTime",
},
{
title: "订单退款状态",
align: "center",
width: "120px",
field: "refundStatus",
},
{
title: "申请退款原因",
align: "center",
width: "120px",
field: "refundReason",
},
{
title: "订单商品",
field: "productPhotoList",
align: "center",
width: "80px",
2024-12-15 09:35:41 +00:00
type: "jsx",
render: ({ row }) => {
return (
2024-12-16 13:00:34 +00:00
<el-image
preview-src-list={[row.refundImg]}
src={row.refundImg}
></el-image>
2024-12-15 09:35:41 +00:00
);
},
2024-12-16 13:00:34 +00:00
},
{
title: "申请退款时间",
align: "center",
width: "120px",
field: "applyRefundTime",
2024-12-15 09:35:41 +00:00
},
{
title: "操作",
fixed: "right",
type: "jsx",
align: "center",
width: "100px",
render: ({ row }) => {
let changeInventory = () => {
this.$refs.addStock.toggle(row).update();
};
return (
<div>
<el-button size="mini" type="primary" onClick={changeInventory}>
查看
</el-button>
</div>
);
},
},
];
},
tableEvent() {
return {
"checkbox-all": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
"checkbox-change": ({ records, reserves }) => {
this.selectList = [...records, ...reserves];
},
};
},
...mapState("userData", [
"isMerchant",
"marketList",
"storeList",
"marketId",
"shopId",
]),
},
};
</script>
<style lang="scss" scoped></style>