commit message

This commit is contained in:
Chopper
2021-05-13 10:56:04 +08:00
commit ec3e958037
728 changed files with 132685 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
// 分销商状态列表
export const distributionStatusList= [
{
value:'APPLY',
label:'申请中'
},
{
value:'RETREAT',
label:'已清退'
},
{
value:'REFUSE',
label:'审核拒绝'
},
{
value:'PASS',
label:'审核通过'
},
]
// 分销佣金状态列表
export const cashStatusList = [
{
value:'APPLY',
label:'待处理'
},
{
value:'REFUSE',
label:'拒绝'
},
{
value:'PASS',
label:'通过'
}
]
// 分销订单状态列表
export const orderStatusList = [
{
value:'WAIT_BILL',
label:'待结算'
},
{
value:'WAIT_CASH',
label:'待提现'
},
{
value:'COMPLETE_CASH',
label:'提现完成'
}
]

View File

@@ -0,0 +1,263 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
placeholder="请输入会员名称"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="状态">
<Select v-model="searchForm.distributionStatus" style="width:200px">
<Option v-for="item in distributionStatusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
</Row>
<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>
</Col>
</Row>
</div>
</template>
<script>
import {
getDistributionListData,
retreatDistribution,
resumeDistribution,
auditDistribution,
} from "@/api/distribution";
import {distributionStatusList} from './dataJson.js';
export default {
name: "distribution",
components: {
},
data() {
return {
distributionStatusList,
openSearch: true, // 显示搜索
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
},
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "会员名称",
key: "memberName",
minWidth: 120,
tooltip: true
},
{
title: "推广单数",
key: "orderNum",
minWidth: 120,
width: 150,
},
{
title: "分销金额",
key: "rebateTotal",
width: 150,
sortable: false,
render: (h, params) => {
return h('div', this.$options.filters.unitPrice(params.row.rebateTotal, '¥'))
}
},
{
title: "可用金额",
key: "canRebate",
width: 150,
sortable: false,
render: (h, params) => {
return h('div', this.$options.filters.unitPrice(params.row.rebateTotal, '¥'))
}
},
{
title: "冻结金额",
key: "commissionFrozen",
width: 150,
sortable: false,
render: (h, params) => {
return h('div', this.$options.filters.unitPrice(params.row.rebateTotal, '¥'))
}
},
{
title: "状态",
key: "distributionStatus",
width: 150,
sortable: false,
render: (h, params) => {
if (params.row.distributionStatus == "PASS") {
return h( "Badge", {props: { status: "success",text: "审核通过" } })
} else if (params.row.distributionStatus == "APPLY") {
return h( "Badge", {props: { status: "processing",text: "申请中" } })
} else if (params.row.distributionStatus == "RETREAT") {
return h( "Badge", {props: { status: "warning",text: "已清退" } })
} else if (params.row.distributionStatus == "REFUSE") {
return h( "Badge", {props: { status: "error",text: "审核拒绝" } })
}
}
},
{
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 140,
render: (h, params) => {
return h("div",{
style:{
display:'flex',
justifyContent:'center'
}
},
[
h(
"Button",
{
props: {
type: "error",
size: "small"
},
style:{marginRight:'5px', display:params.row.distributionStatus!='RETREAT'?'block':'none'},
on: {
click: () => {
this.retreat(params.row);
}
}
},
"清退"
),
h(
"Button",
{
props: {
type: "success",
size: "small"
},
style:{marginRight:'5px', display:params.row.distributionStatus=='RETREAT'?'block':'none'},
on: {
click: () => {
this.resume(params.row);
}
}
},
"恢复"
)
]);
}
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
see(v) {
this.$router.push({
name: "distributionOrder",
query: { id:v.memberId }
});
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
clearSelectAll() { // 清空
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
this.searchForm.status = "PASS";
// 带多条件搜索参数获取表单数据 请自行修改接口
getDistributionListData(this.searchForm).then(res => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
},
// 清退分销商
retreat(v) {
this.$Modal.confirm({
title: "提示",
// 记得确认修改此处
content: "您确认要清退 " + v.memberName + " ?",
loading: true,
onOk: () => {
// 删除
retreatDistribution(v.id).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
});
},
// 恢复分销商
resume(v){
this.$Modal.confirm({
title: '提示',
// 记得确认修改此处
content: "您确认要恢复 " + v.memberName + " ?",
loading: true,
onOk: () => {
// 删除
resumeDistribution(v.id).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
});
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,228 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="会员名称" prop="memberName">
<Input
type="text"
v-model="searchForm.memberName"
placeholder="请输入会员名称"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row style="margin-top: 10px">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"
@on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
</Row>
<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>
</Col>
</Row>
</div>
</template>
<script>
import {
getDistributionListData,
auditDistribution
} from "@/api/distribution";
export default {
name: "distributionApply",
components: {},
data() {
return {
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
startDate: "", // 起始时间
endDate: "" // 终止时间
},
selectDate: null,
form: { // 添加或编辑表单对象初始化数据
memberName: "",
},
// 表单验证规则
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "会员名称",
key: "memberName",
minWidth: 150,
tooltip: true,
},
{
title: "会员姓名",
key: "name",
minWidth: 120,
},
{
title: "提交时间",
key: "createTime",
minWidth: 150,
},
{
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 200,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.audit(params.row, "PASS");
}
}
},
"通过"
),
h(
"Button",
{
props: {
type: "error",
size: "small",
},
on: {
click: () => {
this.audit(params.row, "REFUSE");
}
}
},
"拒绝"
)
]);
}
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
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.selectDate = null;
this.searchForm.startDate = "";
this.searchForm.endDate = "";
// 重新加载数据
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
selectDateRange(v) {
if (v) {
this.searchForm.startDate = v[0];
this.searchForm.endDate = v[1];
}
},
getDataList() {
this.loading = true;
this.searchForm.distributionStatus = "APPLY";
// 带多条件搜索参数获取表单数据 请自行修改接口
getDistributionListData(this.searchForm).then(res => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
// 以下为模拟数据
//this.data = [
//];
this.total = this.data.length;
this.loading = false;
},
//审核
audit(v, status) {
let test = "拒绝"
if (status == "PASS") {
test = "通过"
}
let params = {
status : status
}
this.$Modal.confirm({
title: "确认" + test,
// 记得确认修改此处
content: "您确认要" + test + " " + v.memberName + " ?",
loading: true,
onOk: () => {
auditDistribution(v.id, params).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
});
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,314 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch" >
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Input class="search-input" v-model="searchForm.memberName">
<span slot="prepend">会员名称</span>
</Input>
<Input class="search-input" v-model="searchForm.sn">
<span slot="prepend">编号</span>
</Input>
<Form-item label="状态" style="margin-left: -20px">
<Select v-model="searchForm.distributionCashStatus" style="width:150px;">
<Option v-for="item in cashStatusList" :value="item.value" :key="item.value">{{ item.label }}</Option>
</Select>
</Form-item>
<Form-item style="margin-left:-35px;" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
</Form-item>
</Form>
</Row>
<Row class="padding-row">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
</Row>
<Row type="flex" justify="end" class="page padding-row">
<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>
</Col>
</Row>
<Modal :title="modalTitle" v-model="modalVisible" :mask-closable='false' :width="500">
<Form ref="form" :model="form" :label-width="100" :rules="formValidate" >
<FormItem label="编号">
<Input disabled v-model="form.sn" clearable style="width:100%"/>
</FormItem>
<FormItem label="会员名称">
<Input disabled v-model="form.distributionName" clearable style="width:100%"/>
</FormItem>
<FormItem label="金额">
<Input disabled v-model="form.price" clearable style="width:100%"/>
</FormItem>
<FormItem label="是否通过" prop="result" v-if="handleStatus =='edit'">
<RadioGroup v-model="result">
<Radio :key=0 :label=0>通过</Radio>
<Radio :key=-1 :label=-1>拒绝</Radio>
</RadioGroup>
</FormItem>
</Form>
<div slot="footer" v-if="handleStatus == 'edit'">
<Button type="text" @click="modalVisible=false">取消</Button>
<Button type="primary" :loading="submitLoading" @click="handleSubmit">提交</Button>
</div>
</Modal>
</div>
</template>
<script>
import {
getDistributionCash,
auditDistributionCash
} from "@/api/distribution";
// import { parse } from 'date-fns';
import {cashStatusList} from './dataJson'
export default {
name: "distributionCash",
components: {
},
data() {
return {
cashStatusList, // 状态列表
openSearch: true, // 显示搜索
loading: true, // 表单加载状态
modalVisible: false, // 添加或编辑显示
modalTitle: "", // 添加或编辑标题
result: -1,
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
handleStatus:'edit',// 判断是编辑还是查看
form: { // 添加或编辑表单对象初始化数据
sn: "",
memberName: "",
price: "",
},
auditForm: {
result: -1
},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "编号",
key: "sn",
minWidth: 200
},
{
title: "会员名称",
key: "distributionName",
minWidth: 120
},
{
title: "申请金额",
key: "price",
minWidth: 90,
render: (h, params) => {
if (params.row.price) {
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
}
}
},
{
title: "申请时间",
key: "createTime",
minWidth: 130
},
{
title: "处理时间",
key: "payTime",
minWidth: 130
},
{
title: "状态",
key: "distributionCashStatus",
minWidth: 100,
render: (h, params) => {
if (params.row.distributionCashStatus == 'APPLY') {
return h("div", "待处理");
}
if (params.row.distributionCashStatus == 'PASS') {
return h("div", "通过");
}
if (params.row.distributionCashStatus == 'REFUSE') {
return h("div", "审核拒绝");
}
},
},
{
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 130,
render: (h, params) => {
if(params.row.distributionCashStatus != 'APPLY'){
return h("div", [
h(
"Button",
{
props: {
type: "success",
size: "small",
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.view(params.row);
}
}
},
"查看"
),
]);
}else {
return h("div", [
h(
"Button",
{
props: {
type: "primary",
size: "small",
},
style: {
marginRight: "5px"
},
on: {
click: () => {
this.edit(params.row);
}
}
},
"审核"
),
]);
}
}
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
changePageSize(v) {
this.searchForm.pageSize = v;
this.getDataList();
},
handleSearch() {
this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10;
this.getDataList();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getDistributionCash(this.searchForm).then(res => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
handleSubmit() {
let result = "拒绝"
if(this.result == 0){
result = "通过"
}
this.$refs.form.validate(valid => {
if (valid) {
this.$Modal.confirm({
title: "确认审核",
content: "您确认要审核"+result+"么?",
loading: true,
onOk: () => {
this.auditForm.result = this.result;
auditDistributionCash(this.form.id,this.auditForm).then(res => {
if (res.success) {
this.$Modal.remove();
this.$Message.success("审核成功");
this.getDataList();
this.modalVisible = false;
}
});
}
})
}
});
},
edit(v) {
this.modalTitle = "审核";
this.handleStatus = 'edit';
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.modalVisible = true;
},
view(v){
this.modalTitle = "查看";
this.handleStatus = 'view';
this.$refs.form.resetFields();
// 转换null为""
for (let attr in v) {
if (v[attr] === null) {
v[attr] = "";
}
}
let str = JSON.stringify(v);
let data = JSON.parse(str);
this.form = data;
this.modalVisible = true;
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,283 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="商品名称" prop="goodsName">
<Input
type="text"
v-model="searchForm.goodsName"
placeholder="请输入商品名称"
clearable
style="width: 200px"
/>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="operation" style="margin-top: 10px">
<Button @click="delAll">批量删除</Button>
</Row>
<Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
</Row>
<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>
</Col>
</Row>
</div>
</template>
<script>
import {
getDistributionGoods,
delDistributionGoods
} from "@/api/distribution";
import {getShopListData} from '@/api/shops'
export default {
name: "distributionGoods",
components: {
},
data() {
return {
shopList:[], // 店铺列表
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
sort: "createTime", // 默认排序字段
order: "desc", // 默认排序方式
},
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
// 表头
{
type: "selection",
width: 60,
align: "center"
},
{
title: "商品图片",
key: "thumbnail",
width: 120,
align: "center",
render: (h, params) => {
return h("img", {
attrs: {
src: params.row.thumbnail,
alt: "加载图片失败"
},
style: {
cursor: "pointer",
width: "80px",
height: "60px",
margin: "10px 0",
"object-fit": "contain"
}
});
}
},
{
title: "商品名称",
key: "goodsName",
minWidth: 200,
tooltip: true
},
{
title: "商品价格",
key: "price",
minWidth: 100,
render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.price,'¥'));
}
},
{
title: "库存",
key: "quantity",
minWidth: 80
},
{
title: "添加时间",
key: "createTime",
width: 170
},
{
title: "店铺名称",
key: "storeName",
minWidth: 120,
tooltip: true
},
{
title: "佣金金额",
key: "commission",
minWidth: 120,
sortable: false,
render: (h, params) => {
return h("div", this.$options.filters.unitPrice(params.row.commission,'¥'));
}
},
{
title: "操作",
key: "action",
align: "center",
fixed: "right",
width: 150,
render: (h, params) => {
return h("div", [
h(
"Button",
{
props: {
type: "error",
size: "small"
},
on: {
click: () => {
this.remove(params.row);
}
}
},
"下架"
)
]);
}
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
// this.getShopList()
},
changePage(v) {
this.searchForm.pageNumber = v;
this.getDataList();
this.clearSelectAll();
},
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.init();
},
changeSort(e) {
this.searchForm.sort = e.key;
this.searchForm.order = e.order;
if (e.order === "normal") {
this.searchForm.order = "";
}
this.getDataList();
},
clearSelectAll() {
this.$refs.table.selectAll(false);
},
changeSelect(e) {
this.selectList = e;
this.selectCount = e.length;
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getDistributionGoods(this.searchForm).then(res => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
remove(v) {
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除么?",
loading: true,
onOk: () => {
// 删除
delDistributionGoods(v.id).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("删除成功");
this.getDataList();
}
});
}
});
},
delAll() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要删除的数据");
return;
}
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
loading: true,
onOk: () => {
let ids = []
this.selectList.forEach(item => {
ids.push(item.id)
});
// 批量删除
delDistributionGoods(ids.toString()).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("删除成功");
this.clearSelectAll();
this.getDataList();
}
});
}
});
},
getShopList(val){
const params = {
pageNumber:1,
pageSize:10,
storeName:''
}
if(val){
params.storeName = val;
}else {
params.storeName = ''
}
getShopListData(params).then(res => {
this.shopList = res.result.records
})
},
searchChange(val){
this.getShopList(val)
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,245 @@
<template>
<div class="search">
<Row>
<Col>
<Card>
<Row v-show="openSearch" @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="订单编号" prop="orderSn">
<Input
type="text"
v-model="searchForm.orderSn"
placeholder="请输入订单编号"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="分销商" prop="distributionName">
<Input
type="text"
v-model="searchForm.distributionName"
placeholder="请输入分销商名称"
clearable
style="width: 200px"
/>
</Form-item>
<Form-item label="店铺名称">
<Select v-model="searchForm.shopId" placeholder="请选择" @on-query-change="searchChange" filterable
clearable style="width: 150px">
<Option v-for="item in shopList" :value="item.id" :key="item.id">{{ item.storeName }}</Option>
</Select>
</Form-item>
<Form-item label="订单时间">
<DatePicker type="daterange" v-model="timeRange" format="yyyy-MM-dd" placeholder="选择时间"
style="width: 210px"></DatePicker>
</Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
</Form>
</Row>
<Row class="padding-row">
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom"></Table>
</Row>
<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>
</Col>
</Row>
</div>
</template>
<script>
import {
getDistributionOrder
} from "@/api/distribution";
import {orderStatusList} from './dataJson'
import {getShopListData} from '@/api/shops'
export default {
name: "distributionOrder",
components: {},
data() {
return {
timeRange: [],
orderStatusList,
shopList: [], // 店铺列表
distributionId: this.$route.query.id,
openSearch: true, // 显示搜索
openTip: true, // 显示提示
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
},
columns: [
{
title: "订单编号",
key: "orderSn",
minWidth: 120,
tooltip: true
},
{
title: "实付金额",
key: "orderPrice",
width: 130,
sortable: false,
render: (h, params) => {
if(params.row.orderPrice == null){
return h("div", this.$options.filters.unitPrice(0, '¥'));
}else{
return h("div", this.$options.filters.unitPrice(params.row.orderPrice, '¥'));
}
}
},
{
title: "退款金额",
key: "returnMoney",
width: 130,
sortable: false,
render: (h, params) => {
if(params.row.orderPrice == null){
return h("div", this.$options.filters.unitPrice(0, '¥'));
}else{
return h("div", this.$options.filters.unitPrice(params.row.returnMoney, '¥'));
}
}
},
{
title: "商品名称",
key: "goodsName",
minWidth: 120,
tooltip: true
},
{
title: "分销商",
key: "distributionName",
minWidth: 120,
tooltip: true
},
{
title: "店铺名称",
key: "storeName",
minWidth: 120,
},
{
title: "状态",
key: "distributionOrderStatus",
width: 100,
sortable: false,
render: (h, params) => {
if (params.row.distributionOrderStatus == 'COMPLETE_CASH') {
return h('div', '提现完成')
} else if (params.row.distributionOrderStatus == 'WAIT_BILL') {
return h('div', '待结算')
} else if (params.row.distributionOrderStatus == 'WAIT_CASH') {
return h('div', '待提现')
}
}
},
{
title: "佣金金额",
key: "rebateGrade",
width: 120,
sortable: false,
render: (h, params) => {
if(params.row.rebateGrade == null){
return h("div", this.$options.filters.unitPrice(0, '¥'));
}else{
return h("div", this.$options.filters.unitPrice(params.row.rebateGrade, '¥'));
}
}
},
{
title: "创建时间",
key: "createTime",
width: 180,
sortable: false,
}
],
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
this.getShopList()
},
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();
},
getDataList() {
this.searchForm.distributionId = this.distributionId;
this.loading = true;
if (this.timeRange && this.timeRange[0]) {
let startTime = this.timeRange[0]
let endTime = this.timeRange[1]
this.searchForm.startTime = this.$options.filters.unixToDate(startTime / 1000)
this.searchForm.endTime = this.$options.filters.unixToDate(endTime / 1000)
}
console.log(this.searchForm)
// 带多条件搜索参数获取表单数据 请自行修改接口
getDistributionOrder(this.searchForm).then(res => {
this.loading = false;
if (res.success) {
this.data = res.result.records;
this.total = res.result.total;
}
});
this.total = this.data.length;
this.loading = false;
},
getShopList(val) { // 获取店铺列表
const params = {
pageNumber: 1,
pageSize: 10,
storeName: ''
}
if (val) {
params.storeName = val;
} else {
params.storeName = ''
}
getShopListData(params).then(res => {
this.shopList = res.result.records
})
},
searchChange(val) { // 店铺搜索,键盘点击回调
this.getShopList(val)
}
},
mounted() {
this.init();
},
watch: {
$route(e) {
this.distributionId = e.query.id ? e.query.id : undefined;
this.getDataList();
}
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -0,0 +1,77 @@
<template>
<div style="background-color: #fff;">
<Form ref="form" :model="form" :label-width="120" :rules="formValidate" style="padding: 10px;">
<Divider orientation="left">分销设置</Divider>
<FormItem label="是否开启分销" prop="distribution">
<i-switch size="large" v-model="form.isOpen" :true-value="true" :false-value="false" @on-change="handleSubmit">
<span slot="open">开启</span>
<span slot="close">关闭</span>
</i-switch>
</FormItem>
</Form>
</div>
</template>
<script>
import {setSetting, getSetting} from "@/api/index";
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, // 表单加载状态
selectDate: null,
form: { // 添加或编辑表单对象初始化数据
isOpen: ""
},
// 表单验证规则
formValidate: {},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
data: [], // 表单数据
total: 0 // 表单数据总数
};
},
methods: {
init() {
this.getDataList();
},
getDataList() {
this.loading = true;
// 带多条件搜索参数获取表单数据 请自行修改接口
getSetting("DISTRIBUTION_SETTING").then(res => {
this.loading = false;
if (res.success) {
this.form = res.result;
}
});
this.loading = false;
},
handleSubmit() {
this.$refs.form.validate(valid => {
if (valid) {
setSetting("DISTRIBUTION_SETTING", this.form).then(res => {
if (res.success) {
this.$Message.success("操作成功");
this.getDataList();
}
});
}
})
}
},
mounted() {
this.init();
}
};
</script>
<style lang="scss" scoped>
</style>