You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

380 lines
11 KiB

<style lang="less">
@import "@/styles/table-common.less";
@import "./orderManage.less";
</style>
<template>
<div class="search">
<Card>
4 weeks ago
<Tabs v-model="tabName" :animated="false" @on-click="changeOrderTab">
1 week ago
<TabPane label="饭团订单" name="1"></TabPane>
<TabPane label="快递订单" name="2"></TabPane>
<TabPane label="跑腿订单" name="3"></TabPane>
</Tabs>
<Tabs v-model="tabName1" :animated="false" @on-click="changeTab">
<TabPane label="全部" name="10"></TabPane>
<TabPane label="待支付" name="0"></TabPane>
<TabPane label="待成团" name="1"></TabPane>
<TabPane label="待消费" name="2"></TabPane>
<TabPane label="待接单" name="3"></TabPane>
<TabPane label="待取货" name="4"></TabPane>
<TabPane label="待送达" name="5"></TabPane>
<TabPane label="已完成" name="6"></TabPane>
<TabPane label="待退款" name="7"></TabPane>
<TabPane label="已退款" name="8"></TabPane>
<TabPane label="已取消" name="9"></TabPane>
<TabPane label="售后中" name="11"></TabPane>
<TabPane label="已售后" name="12"></TabPane>
4 weeks ago
</Tabs>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
1 week ago
<Form ref="searchForm" :model="searchForm" inline :label-width="100">
<FormItem label="店铺名称" prop="orderLogistics">
<Input type="text" v-model="searchForm.shopName" clearable placeholder="请输入店铺名称"
style="width: 200px" />
</FormItem>
1 week ago
<FormItem label="收货人手机号" prop="kdOrderId1">
<Input type="text" v-model="searchForm.receiverPhone" clearable placeholder="请输入店铺名称"
style="width: 200px" />
</FormItem>
<FormItem style="margin-left: -35px" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleReset">重置</Button>
</FormItem>
</Form>
</Row>
<Row align="middle" justify="space-between" class="operation">
<div class="icons">
<Tooltip content="刷新" placement="top" transfer>
1 week ago
<Icon type="md-refresh" size="18" class="item" @click="getLogisticsInfo" />
</Tooltip>
<Tooltip :content="openSearch ? '关闭搜索' : '开启搜索'" placement="top" transfer>
<Icon type="ios-search" size="18" class="item tip" @click="openSearch = !openSearch" />
</Tooltip>
<Tooltip :content="openTip ? '关闭提示' : '开启提示'" placement="top" transfer>
<Icon type="md-bulb" size="18" class="item tip" @click="openTip = !openTip" />
</Tooltip>
<Tooltip content="表格密度" placement="top" transfer>
<Dropdown @on-click="changeTableSize" trigger="click">
<Icon type="md-list" size="18" class="item" />
<DropdownMenu slot="list">
<DropdownItem :selected="tableSize == 'default'" name="default">默认</DropdownItem>
<DropdownItem :selected="tableSize == 'large'" name="large">宽松</DropdownItem>
<DropdownItem :selected="tableSize == 'small'" name="small">紧密</DropdownItem>
</DropdownMenu>
</Dropdown>
</Tooltip>
</div>
</Row>
<Alert show-icon v-show="openTip">
已选择
<span class="select-count">{{ selectList.length }}</span>
<a class="select-clear" @click="clearSelectAll">清空</a>
</Alert>
4 weeks ago
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="showSelect" ref="table"></Table>
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNum" :total="total" :page-size="searchForm.pageSize"
@on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]"
size="small" show-total show-elevator show-sizer></Page>
</Row>
</Card>
4 weeks ago
<!-- 订单详情 -->
<Modal :title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="1000">
<logistics-address v-if="Visiable" ref="dialog"></logistics-address>
<div slot="footer" v-show="Visiable">
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
1 week ago
<addEdit :data="form" :type="showType" v-model="showOrder" @on-submit="getLogisticsInfo" />
</div>
</template>
<script>
import {
1 week ago
getOrderList
} from "@/api/index";
import addEdit from "./addEdit.vue";
3 weeks ago
import logisticsAddress from "@/views/sys/order-manage/logisticsAddress";
export default {
name: "order-manage",
components: {
addEdit,
4 weeks ago
logisticsAddress,
},
data() {
return {
tableSize: "default",
3 weeks ago
Visiable: false,
showOrder: false,
showType: "0",
openSearch: true,
openTip: true,
loading: true,
drop: false,
dropDownContent: "展开",
dropDownIcon: "ios-arrow-down",
selectList: [],
searchForm: {
pageNum: 1,
pageSize: 10,
1 week ago
regionId: JSON.parse(this.getStore("user")).departmentId,
4 weeks ago
searchType: 0,
1 week ago
searchStatus:0,
4 weeks ago
shopName: "",
1 week ago
mobile:'',
4 weeks ago
userId: ""
},
form: {},
columns: [{
type: "index",
width: 60,
align: "center",
fixed: "left",
},
{
4 weeks ago
title: "订单编号",
key: "id",
1 week ago
width: 200,
align: "center",
},
{
4 weeks ago
title: "用户账号",
key: "receiverPhone",
1 week ago
width: 130,
align: "center",
},
{
4 weeks ago
title: "店铺名称",
key: "shopName",
width: 200,
align: "center",
},
{
4 weeks ago
title: "交易金额",
key: "companyName",
width: 100,
align: "center",
},
{
4 weeks ago
title: "订单总金额",
key: "totalAmount",
1 week ago
width: 130,
align: "center",
},
{
4 weeks ago
title: "商家优惠券金额",
key: "receiverName",
width: 150,
align: "center",
},
{
4 weeks ago
title: "平台优惠券金额",
key: "weight",
4 weeks ago
width: 150,
align: "center",
},
{
4 weeks ago
title: "完成支付时间",
key: "createTime",
1 week ago
width: 170,
align: "center",
1 week ago
render: (h, params) => {
return h(
"div",
this.formatDateTime(params.row.createTime)
);
}
},
{
4 weeks ago
title: "订单状态",
key: "status",
1 week ago
width: 130,
align: "center",
1 week ago
render: (h, params) => {
let re = ""
if (params.row.status == 0) {
re = "待支付";
} else if (params.row.status == 1) {
re = "待成团";
} else if (params.row.status == 2) {
re = "待消费";
} else if (params.row.status == 3) {
re = "待接单";
} else if (params.row.status == 4) {
re = "待取货";
} else if (params.row.status == 5) {
re = "待送达";
} else if (params.row.status == 6) {
re = "已完成";
} else if (params.row.status == 7) {
re = "待退款";
} else if (params.row.status == 8) {
re = "已退款";
} else if (params.row.status == 9) {
re = "已取消";
} else if (params.row.status == 11) {
re = "售后中";
} else if (params.row.status == 12) {
re = "已售后";
}
return h(
"div",
re
);
}
},
{
title: "操作",
key: "action",
width: 170,
align: "center",
fixed: "right",
render: (h, params) => {
return h("div", [
h(
"a", {
on: {
click: () => {
3 weeks ago
this.showDetail(params.row);
},
},
},
"查看详情"
),
]);
},
},
],
data: [],
total: 0,
};
},
computed: {
colHidden: function() {
return this.columns.filter(function(e) {
return !e.hidden;
})
}
},
mounted() {
this.init();
},
methods: {
init() {
this.getLogisticsInfo()
},
1 week ago
formatDateTime(isoString) {
if (!isoString) return ''
const date = new Date(isoString)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
const hours = String(date.getHours()).padStart(2, '0')
const minutes = String(date.getMinutes()).padStart(2, '0')
const seconds = String(date.getSeconds()).padStart(2, '0')
return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
},
getMonth() {
let date = new Date()
let year = date.getFullYear().toString() //'年'
let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1).toString() : (date.getMonth() + 1)
.toString() //'月'
let da = date.getDate() < 10 ? '0' + date.getDate().toString() : date.getDate().toString() //'日'
let single = year + '-' + month + '-' + da //当天
return single
},
1 week ago
//订单状态切换2
changeTab(v) {
this.searchForm.pageNum = 1;
this.searchForm.searchStatus = v;
this.getLogisticsInfo();
},
//订单状态切换1
changeOrderTab(v){
console.log(v)
this.searchForm.pageNum = 1;
this.searchForm.searchType = v
this.getLogisticsInfo()
},
checkStatus(v) {
console.log('下拉框选择', v)
this.searchForm.orderStatus = v
},
changePage(v) {
this.searchForm.pageNum = v;
1 week ago
this.getLogisticsInfo();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
1 week ago
this.getLogisticsInfo();
},
changeTableSize(v) {
this.tableSize = v;
},
4 weeks ago
//查询订单
getLogisticsInfo() {
4 weeks ago
getOrderList(this.searchForm).then((res) => {
this.loading = false;
if (res.success) {
4 weeks ago
this.data = res.result.records
this.total = res.result.total;
}
});
},
3 weeks ago
handleSearch() {
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;
1 week ago
this.getLogisticsInfo();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;
// 重新加载数据
1 week ago
this.getLogisticsInfo();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order == "normal") {
this.searchForm.order = "";
}
1 week ago
this.getLogisticsInfo();
},
1 week ago
showDetail(v) {
// 转换null为""
for (let attr in v) {
if (v[attr] == null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
3 weeks ago
this.Visiable = true;
this.$nextTick(() => {
this.$refs.dialog.initRecharge(data);
});
},
dropDown() {
if (this.drop) {
this.dropDownContent = "展开";
this.dropDownIcon = "ios-arrow-down";
} else {
this.dropDownContent = "收起";
this.dropDownIcon = "ios-arrow-up";
}
this.drop = !this.drop;
},
showSelect(e) {
this.selectList = e;
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
}
};
</script>