物流公司switch切换无效,代码注释添加

This commit is contained in:
mabo
2021-07-20 14:06:53 +08:00
parent 5062cad2b0
commit 0a248d89d5
74 changed files with 480 additions and 1060 deletions

View File

@@ -1,5 +1,5 @@
<template>
<div class="search">
<div>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
@@ -46,11 +46,9 @@
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
class="mt_10"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -82,15 +80,12 @@ export default {
data() {
return {
distributionStatusList, // 分销状态
openSearch: true, // 显示搜索
loading: true, // 表单加载状态
searchForm: {
// 搜索框初始化对象
pageNumber: 1, // 当前页数
pageSize: 10, // 页面大小
},
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "会员名称",
@@ -227,43 +222,30 @@ export default {
};
},
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) {
@@ -316,6 +298,3 @@ export default {
},
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="search">
<div>
<Card>
<Row @keydown.enter.native="handleSearch">
<Form
@@ -21,7 +21,6 @@
<Button
@click="handleSearch"
type="primary"
icon="ios-search"
class="search-btn"
>搜索</Button
>
@@ -34,11 +33,8 @@
:columns="columns"
:data="data"
ref="table"
sortable="custom"
@on-sort-change="changeSort"
@on-selection-change="changeSelect"
></Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<Page
:current="searchForm.pageNumber"
:total="total"
@@ -61,7 +57,6 @@ import { getDistributionListData, auditDistribution } from "@/api/distribution";
export default {
name: "distributionApply",
components: {},
data() {
return {
loading: true, // 表单加载状态
@@ -74,14 +69,6 @@ export default {
startDate: "", // 起始时间
endDate: "", // 终止时间
},
form: {
// 添加或编辑表单对象初始化数据
memberName: "",
},
// 表单验证规则
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "会员名称",
@@ -149,48 +136,31 @@ export default {
};
},
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;
},
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) {
@@ -198,9 +168,6 @@ export default {
this.total = res.result.total;
}
});
// 以下为模拟数据
//this.data = [
//];
this.total = this.data.length;
this.loading = false;
},
@@ -235,6 +202,3 @@ export default {
},
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -1,5 +1,5 @@
<template>
<div class="search">
<div>
<Card>
<Row @keydown.enter.native="handleSearch" >
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
@@ -15,11 +15,11 @@
</Select>
</Form-item>
<Form-item style="margin-left:-35px;" class="br">
<Button @click="handleSearch" type="primary" icon="ios-search">搜索</Button>
<Button @click="handleSearch" type="primary">搜索</Button>
</Form-item>
</Form>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect"></Table>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10"></Table>
<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>
@@ -55,12 +55,9 @@ import {
getDistributionCash,
auditDistributionCash
} from "@/api/distribution";
// import { parse } from 'date-fns';
import {cashStatusList} from './dataJson'
export default {
name: "distributionCash",
components: {
},
data() {
return {
cashStatusList, // 状态列表
@@ -81,8 +78,6 @@ export default {
price: "",
},
submitLoading: false, // 添加或编辑提交状态
selectList: [], // 多选数据
selectCount: 0, // 多选计数
columns: [
{
title: "编号",
@@ -202,21 +197,12 @@ export default {
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();
},
// 获取列表数据
getDataList() {
this.loading = true;
@@ -231,6 +217,7 @@ export default {
this.total = this.data.length;
this.loading = false;
},
// 通过还是拒绝申请
handleSubmit() {
let result = "拒绝"
if(this.result == 'PASS'){
@@ -258,6 +245,7 @@ export default {
}
});
},
// 弹出modal 审核
edit(v) {
this.modalTitle = "审核";
this.handleStatus = 'edit';
@@ -271,6 +259,7 @@ export default {
this.form = JSON.parse(JSON.stringify(v));
this.modalVisible = true;
},
// 弹出modal 查看
view(v){
this.modalTitle = "查看";
this.handleStatus = 'view';
@@ -293,6 +282,3 @@ export default {
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -1,22 +1,20 @@
<template>
<div class="search">
<div>
<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>
<Form @keydown.enter.native="handleSearch" 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 class="operation" style="margin:10px 0;">
<Button @click="delAll" type="primary">批量下架</Button>
</Row>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom" @on-sort-change="changeSort" @on-selection-change="changeSelect">
<template slot="goodsName" slot-scope="{row}">
@@ -33,7 +31,7 @@
</div>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<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>
@@ -45,14 +43,10 @@ import {
getDistributionGoods,
delDistributionGoods
} from "@/api/distribution";
import {getShopListData} from '@/api/shops'
export default {
name: "distributionGoods",
components: {
},
data() {
return {
shopList:[], // 店铺列表
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
@@ -161,50 +155,39 @@ export default {
};
},
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) {
@@ -215,68 +198,50 @@ export default {
this.total = this.data.length;
this.loading = false;
},
// 下架商品
remove(v) {
this.$Modal.confirm({
title: "确认删除",
// 记得确认修改此处
content: "您确认要删除么?",
title: "确认下架",
content: "您确认要下架么?",
loading: true,
onOk: () => {
// 删除
// 下架
delDistributionGoods(v.id).then(res => {
this.$Modal.remove();
if (res.success) {
this.$Message.success("删除成功");
this.$Message.success("下架成功");
this.getDataList();
}
});
}
});
},
// 批量下架
delAll() {
if (this.selectCount <= 0) {
this.$Message.warning("您还未选择要删除的数据");
this.$Message.warning("您还未选择要下架的数据");
return;
}
this.$Modal.confirm({
title: "确认删除",
content: "您确认要删除所选的 " + this.selectCount + " 条数据?",
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.$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() {
@@ -284,7 +249,5 @@ export default {
}
};
</script>
<style lang="scss">
@import "@/styles/table-common.scss";
</style>

View File

@@ -1,40 +1,38 @@
<template>
<div class="search">
<div>
<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>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" sortable="custom">
<Form ref="searchForm" @keydown.enter.native="handleSearch" :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>
<Table :loading="loading" border :columns="columns" :data="data" ref="table" class="mt_10">
<template slot-scope="{row}" slot="goodsMsg">
<div class="goods-msg">
<img :src="row.image" width="60" height="60" alt="">
@@ -56,7 +54,7 @@
<Tag :color="filterStatusColor(row.distributionOrderStatus)">{{filterStatus(row.distributionOrderStatus)}}</Tag>
</template>
</Table>
<Row type="flex" justify="end" class="page">
<Row type="flex" justify="end" class="mt_10">
<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>
@@ -81,8 +79,6 @@
orderStatusList, // 订单状态列表
shopList: [], // 店铺列表
distributionId: this.$route.query.id, // 分销id
openSearch: true, // 显示搜索
openTip: true, // 显示提示
loading: true, // 表单加载状态
searchForm: { // 搜索框初始化对象
pageNumber: 1, // 当前页数
@@ -154,24 +150,28 @@
};
},
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;
@@ -181,7 +181,6 @@
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;
@@ -194,7 +193,7 @@
this.total = this.data.length;
this.loading = false;
},
getShopList(val) { // 获取店铺列表
getShopList(val) { // 获取店铺列表 搜索用
const params = {
pageNumber: 1,
pageSize: 10,
@@ -253,8 +252,7 @@
}
};
</script>
<style lang="scss" >
@import "@/styles/table-common.scss";
<style lang="scss">
.goods-msg {
display: flex;
align-items: center;

View File

@@ -1,7 +1,7 @@
<template>
<div style="background-color: #fff;">
<Form ref="form" :model="form" :label-width="120" :rules="formValidate" style="padding: 10px;">
<Form ref="form" :model="form" :label-width="120" style="padding: 10px;">
<Divider orientation="left">分销设置</Divider>
<FormItem label="是否开启分销" prop="distribution">
@@ -25,49 +25,34 @@ import { setSetting, getSetting } from "@/api/index";
export default {
name: "distributionSetting",
components: {},
data() {
return {
loading: true, // 表单加载状态
form: {
// 添加或编辑表单对象初始化数据
isOpen: "",
distributionDay: "", //分销关系绑定天数
cashDay: "", //分销结算天数
},
// 表单验证规则
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) {
// 防抖处理一下
this.$options.filters.debounce(this.submit(), 1500);
}
});
this.$options.filters.debounce(this.submit(), 1500);
},
// 提交api
submit() {
setSetting("DISTRIBUTION_SETTING", this.form).then((res) => {
if (res.success) {