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.

237 lines
6.4 KiB

<template>
2 months ago
<div class="search">
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70">
<FormItem label="商家名" prop="rechargeId">
<Input type="text" v-model="searchForm.name" placeholder="请输入商家名" clearable
style="width: 200px" />
</FormItem>
<FormItem label="状态" prop="rechargeName">
<Input type="text" v-model="searchForm.rechargeName" placeholder="状态" clearable
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>
<Icon type="md-refresh" size="18" class="item" @click="getDataList" />
</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>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize" ref="table"
1 month ago
sortable="custom" ></Table>
2 months ago
<Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :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>
<!-- 订单详情 -->
1 month ago
<Modal :title="订单详情" v-model="Visiable" :mask-closable="false" :scrollabele="true" :width="850">
2 months ago
<logistics-address v-if="Visiable" ref="dialog"></logistics-address>
<div slot="footer" v-show="Visiable">
<Button type="text" @click="Visiable = false">关闭</Button>
</div>
</Modal>
</div>
</template>
<script>
2 months ago
import {
1 month ago
getGroupList
2 months ago
} from "@/api/index";
1 month ago
import logisticsAddress from "@/views/app/business/recharge/logisticsAddress";
2 months ago
export default {
name: "recharge",
components: {
logisticsAddress,
},
data() {
return {
Visiable: false,
tableSize: "default",
openSearch: true, // 显示搜索
openTip: true, // 显示提示
loading: true, // 表单加载状态
searchForm: {
1 month ago
shopId:'',
headUserId:'',
status:'',
productName:'',
isFace:'',
pageNumber: 1,
pageSize: 10,
2 months ago
},
1 month ago
2 months ago
columns: [{
type: "index",
width: 60,
align: "center",
},
{
title: "拼团编号",
1 month ago
key: "id",
2 months ago
align: "center",
},
{
1 month ago
title: "商品名",
key: "productName",
2 months ago
align: "center",
},
{
title: "成团时间",
1 month ago
key: "successTime",
2 months ago
align: "center",
},
{
1 month ago
title: "几人团/已拼成",
key: "targetMembers",
2 months ago
align: "center",
1 month ago
render: (h, params) => {
let re = params.row.targetMembers + '/' + params.row.currentMembers
return h(
"div",
re
);
}
2 months ago
},
{
title: "状态",
1 month ago
key: "status", //0 待成团 1成功 2失败 3面对面
2 months ago
align: "center",
1 month ago
render: (h, params) => {
let re = "",
color = "";
if (params.row.status == "3") {
re = "面对面";
color = "yellow";
} else if (params.row.status == "0") {
re = "待成团";
color = "yellow";
} else if (params.row.status == "1") {
re = "成功";
color = "green";
} else if (params.row.status == "2") {
re = "失败";
color = "red";
}
return h("div", [
h(
"Tag", {
props: {
color: color,
},
},
re
),
]);
},
2 months ago
},
{
title: "操作",
key: "action",
width: 200,
align: "center",
fixed: "right",
render: (h, params) => {
return h("div", [
1 month ago
2 months ago
h(
"a", {
on: {
click: () => {
1 month ago
this.getOrder(params.row.id);
2 months ago
},
},
},
"查看订单"
1 month ago
)
2 months ago
]);
},
},
],
data: [], // 表单数据
total: 0, // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
handleReset() {
this.$refs.searchForm.resetFields();
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
// 重新加载数据
this.getDataList();
},
1 month ago
//点击查看订单
getOrder(v){
console.log(v)
this.Visiable = true
this.$nextTick(() => {
this.$refs.dialog.initRecharge(v);
});
2 months ago
},
changeTableSize(v) {
this.tableSize = v;
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
1 month ago
getGroupList(this.searchForm).then((res) => {
2 months ago
this.loading = false;
if (res.success) {
1 month ago
this.data = res.result.records;
this.total = res.result.total;
2 months ago
if (this.data.length == 0 && this.searchForm.pageNumber > 1) {
this.searchForm.pageNumber -= 1;
this.getDataList();
}
}
});
},
},
mounted() {
this.init();
},
};
</script>
<style lang="less">
2 months ago
@import "@/styles/table-common.less";
</style>