wangfukang 3 weeks ago
parent
commit
353a2e5f8b
  1. 5
      src/api/app.js
  2. 25
      src/views/app/business/courier/courier.vue
  3. 13
      src/views/app/business/logiticsCompany/dictManage.vue
  4. 2
      src/views/app/business/logiticsCompany/transferStation.vue
  5. 187
      src/views/app/components/withdrawRecordModal.vue
  6. 18
      src/views/app/shop/dictManage.vue
  7. 5
      src/views/app/shop/mernage.vue
  8. 25
      src/views/app/shop/shop.vue
  9. 350
      src/views/app/shopArea/shopArea.vue

5
src/api/app.js

@ -440,6 +440,11 @@ export const getShopData = (params) => {
return getRequest('/app/shop/getByCondition', params)
}
// 提现记录分页
export const getReturnCommissionPage = (params) => {
return getRequest('/app/returnCommission/page', params)
}
export const getAllShopData = () => {
return getRequest('/app/shop/getAll')
}

25
src/views/app/business/courier/courier.vue

@ -90,6 +90,7 @@
<Button type="text" @click="ruleVisible = false">关闭</Button>
</div>
</Modal>
<withdraw-record-modal ref="withdrawRecordModal" :table-size="tableSize" />
<addEdit :data="form" :type="showType" v-model="showWorker" @on-submit="getDataList" />
</div>
</template>
@ -122,13 +123,15 @@
import excel from "@/libs/excel";
import addEdit from "./addEdit.vue";
import logisticsAddress from "@/views/app/business/courier/logisticsAddress.vue";
import withdrawRecordModal from "@/views/app/components/withdrawRecordModal.vue";
import dict from "@/views/my-components/hiver/dict";
export default {
name: "Courier",
components: {
addEdit,
dict,
logisticsAddress
logisticsAddress,
withdrawRecordModal
},
data() {
return {
@ -348,7 +351,7 @@
{
title: "操作",
key: "action",
width: 340,
width: 420,
align: "center",
fixed: "right",
render: (h, params) => {
@ -480,6 +483,21 @@
},
}),
fullTimeAction,
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.openWithdrawRecords(params.row);
},
},
},
"提现记录"
),
]);
},
},
@ -598,6 +616,9 @@
this.$refs.dialog.initRecharge(v);
});
},
openWithdrawRecords(v) {
this.$refs.withdrawRecordModal.open(v, "worker");
},
handleSearch() {
this.searchForm.pageNum = 1;
this.searchForm.pageSize = 10;

13
src/views/app/business/logiticsCompany/dictManage.vue

@ -140,6 +140,18 @@ export default {
key: "shopName",
minWidth: 150,
},
{
title: "商家类型",
key: "merchantType",
width: 110,
render: (h, params) => {
const typeMap = {
1: "外卖商家",
2: "团购商家",
};
return h("span", typeMap[params.row.merchantType] || "-");
},
},
{
title: "原价",
key: "originalPrice",
@ -263,6 +275,7 @@ export default {
status: v.status,
startTime: v.startTime,
endTime: v.endTime,
merchantType: v.merchantType == null ? null : Number(v.merchantType),
remark: v.remark || "",
};
this.editDateRange = v.startTime && v.endTime ? [v.startTime, v.endTime] : [];

2
src/views/app/business/logiticsCompany/transferStation.vue

@ -207,6 +207,7 @@ export default {
contactPhone: item.contactPhone,
regionId: item.regionId,
shopArea: item.shopArea,
merchantType: item.merchantType,
}));
}
}).catch(() => {
@ -305,6 +306,7 @@ export default {
status: 1,
getAreaId: this.selectNode.regionId || this.regionId,
shoArea: this.selectNode.shopArea || "",
merchantType: this.selectNode.merchantType == null ? null : Number(this.selectNode.merchantType),
startTime: null,
endTime: null,
remark: "",

187
src/views/app/components/withdrawRecordModal.vue

@ -0,0 +1,187 @@
<style lang="less" scoped>
.withdraw-record-owner {
margin-bottom: 12px;
}
</style>
<template>
<Modal :title="title" v-model="visible" :mask-closable="false" :width="1100">
<div class="withdraw-record-owner">
<span>{{ ownerLabel }}{{ ownerName }}</span>
</div>
<Table :loading="loading" border :columns="columns" :data="data" :size="tableSize"></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>
<div slot="footer">
<Button type="text" @click="visible = false">关闭</Button>
</div>
</Modal>
</template>
<script>
import {
getReturnCommissionPage
} from "@/api/app";
export default {
name: "WithdrawRecordModal",
props: {
tableSize: {
type: String,
default: "default"
}
},
data() {
return {
visible: false,
loading: false,
ownerType: "",
ownerInfo: {},
searchForm: {
shopId: "",
workerId: "",
pageNum: 1,
pageSize: 10
},
data: [],
total: 0,
columns: [
{
type: "index",
width: 60,
align: "center"
},
{
title: "提现时间",
key: "createTime",
minWidth: 170,
render: (h, params) => h("span", this.displayValue(params.row.createTime))
},
{
title: "提现金额(元)",
key: "commission",
minWidth: 130,
render: (h, params) => h("span", this.formatAmount(params.row.commission))
},
{
title: "提现状态",
key: "status",
minWidth: 110,
render: (h, params) => {
const status = this.formatStatus(params.row.status);
return h("Tag", {
props: {
color: status.color
}
}, status.text);
}
},
{
title: "支付宝姓名",
key: "aliName",
minWidth: 130,
render: (h, params) => h("span", this.displayValue(params.row.aliName))
},
{
title: "支付宝账号",
key: "aliAccount",
minWidth: 170,
render: (h, params) => h("span", this.displayValue(params.row.aliAccount))
},
{
title: "备注",
key: "remark",
minWidth: 180,
render: (h, params) => h("span", this.displayValue(params.row.remark))
},
{
title: "失败原因",
key: "failMessage",
minWidth: 180,
render: (h, params) => h("span", this.displayValue(params.row.failMessage))
}
]
};
},
computed: {
title() {
return this.ownerLabel + "提现记录";
},
ownerLabel() {
return this.ownerType === "worker" ? "配送员" : "店铺";
},
ownerName() {
if (this.ownerType === "worker") {
return this.ownerInfo.workerName || "-";
}
return this.ownerInfo.shopName || "-";
}
},
methods: {
open(row, ownerType) {
this.ownerType = ownerType;
this.ownerInfo = row || {};
this.searchForm = {
shopId: ownerType === "shop" ? (this.ownerInfo.id || this.ownerInfo.shopId || "") : "",
workerId: ownerType === "worker" ? (this.ownerInfo.workerId || this.ownerInfo.id || "") : "",
pageNum: 1,
pageSize: 10
};
this.visible = true;
this.getDataList();
},
getDataList() {
this.loading = true;
getReturnCommissionPage(this.searchForm).then((res) => {
if (res.success) {
const result = res.result || {};
this.data = result.records || result.content || [];
this.total = Number(result.total || result.totalElements) || 0;
if (this.data.length == 0 && this.searchForm.pageNum > 1) {
this.searchForm.pageNum -= 1;
this.getDataList();
}
}
}).finally(() => {
this.loading = false;
});
},
changePage(v) {
this.searchForm.pageNum = v;
this.getDataList();
},
changePageSize(v) {
this.searchForm.pageNum = 1;
this.searchForm.pageSize = v;
this.getDataList();
},
displayValue(v) {
return v === null || v === undefined || v === "" ? "-" : v;
},
formatAmount(v) {
const number = Number(v);
return isNaN(number) ? "0.00" : number.toFixed(2);
},
formatStatus(v) {
if (v == "1") {
return {
text: "提现成功",
color: "green"
};
}
if (v == "2") {
return {
text: "提现失败",
color: "red"
};
}
return {
text: "审核中",
color: "orange"
};
}
}
};
</script>

18
src/views/app/shop/dictManage.vue

@ -356,11 +356,11 @@
<FormItem label="可售时间" class="form-noheight">
<div>
<div style="line-height: 37px;">
<input type="radio" :checked="addGoodsForm.sellTime==0" name="sellTime" @click="checkSellTime('0')" />全时段售卖
<input type="radio" :checked="addGoodsForm.sellTime==1" name="sellTime" @click="checkSellTime('1')" />自定义时段
<input type="radio" :checked="Number(addGoodsForm.sellTime) === 0" name="sellTime" @change="checkSellTime(0)" />全时段售卖
<input type="radio" :checked="Number(addGoodsForm.sellTime) === 1" name="sellTime" @change="checkSellTime(1)" />自定义时段
</div>
</div>
<div style="display: flex;" v-if="addGoodsForm.sellTime == 1">
<div style="display: flex;" v-if="Number(addGoodsForm.sellTime) === 1">
<TimePicker format="HH:mm" v-model="addGoodsForm.sellBeginTime" @on-change="selectDateRange" placeholder="选择起始时间"/>
<div style="width: 10px;height: 10px;"></div>
<TimePicker format="HH:mm" v-model="addGoodsForm.sellEndTime" @on-change="selectDateRange" placeholder="选择结束时间"/>
@ -1437,7 +1437,15 @@
this.getCateGorySon(this.categoryData[this.categoryIndex].id)
},
checkSellTime(type){
this.addGoodsForm.sellTime = type;
const sellTime = Number(type);
this.$set(this.addGoodsForm, "sellTime", sellTime);
if (sellTime === 0) {
this.$set(this.addGoodsForm, "sellBeginTime", "");
this.$set(this.addGoodsForm, "sellEndTime", "");
}
},
selectDateRange(){
this.$forceUpdate();
},
checkisMoreBuy(type){
this.addGoodsForm.isMoreBuy = type;
@ -1791,7 +1799,7 @@
});
this.specValueArr = this.addGoodsForm.attributeListPrice
this.addGoodsForm.sellTime = this.addGoodsForm.sellBeginTime != '' ? 1 : 0
this.$set(this.addGoodsForm, "sellTime", this.addGoodsForm.sellBeginTime != "" ? 1 : 0)
this.setGoodsCategoryName(this.addGoodsForm.categoryId)
this.modalVisible = true;
},

5
src/views/app/shop/mernage.vue

@ -57,11 +57,11 @@
</Col>
</Row>
<Row :gutter="32">
<Col span="12">
<!-- <Col span="12">
<FormItem label="排名" prop="shoprank">
<Input v-model="form.shoprank" autocomplete="off" :maxlength="16" />
</FormItem>
</Col>
</Col> -->
<Col span="12">
<FormItem label="是否价格锁定" class="form-noheight">
<dict dict="yesorno" v-model="form.isPriceLock" transfer />
@ -249,6 +249,7 @@
this.form.passStrength = strength;
},
submit1() {
this.form.shoprank = 0
//
if (this.form.type != '' && this.form.type != null) {
this.shopType.forEach(item => {

25
src/views/app/shop/shop.vue

@ -101,6 +101,7 @@
</Modal>
<check-password ref="checkPass" @on-success="resetPass" />
<withdraw-record-modal ref="withdrawRecordModal" :table-size="tableSize" />
<addEdit :data="form" :type="showType" v-model="showUser" @on-submit="getDataList" />
<mernage :data="form" ref="dialog" :type="showTypeMe" v-model="showmernage" @on-submit="getDataList" />
@ -126,6 +127,7 @@
import addEdit from "./addEdit.vue";
import mernage from "./mernage.vue";
import logisticsAddress from "@/views/app/shop/logisticsAddress.vue";
import withdrawRecordModal from "@/views/app/components/withdrawRecordModal.vue";
import dict from "@/views/my-components/hiver/dict";
import goodsList from "./dictManage.vue";
@ -146,7 +148,8 @@
addEdit,
mernage,
dict,
goodsList
goodsList,
withdrawRecordModal
},
data() {
return {
@ -288,7 +291,7 @@
{
title: "操作",
key: "action",
width: 170,
width: 280,
align: "center",
fixed: "right",
render: (h, params) => {
@ -393,6 +396,21 @@
},
"管理商品"
),
h("Divider", {
props: {
type: "vertical",
},
}),
h(
"a", {
on: {
click: () => {
this.openWithdrawRecords(params.row);
},
},
},
"提现记录"
),
]);
},
},
@ -509,6 +527,9 @@
this.$refs.courierDialog.initRecharge(v);
});
},
openWithdrawRecords(v) {
this.$refs.withdrawRecordModal.open(v, "shop");
},
add() {
this.showType = "2";
this.showUser = true;

350
src/views/app/shopArea/shopArea.vue

@ -126,6 +126,38 @@
<FormItem label="区域名称" prop="title">
<Input v-model="form.title" />
</FormItem>
<FormItem v-if="showEditParentAgent" label="上级代理">
<div style="display: flex">
<Input
v-model="form.parentAgentName"
readonly
placeholder="请根据手机号搜索选择上级代理"
style="margin-right: 10px"
/>
<Button @click="openParentAgentModal('edit')" icon="ios-search"
>选择用户</Button
>
<Button
v-if="form.parentAgentId"
@click="clearParentAgent('edit')"
style="margin-left: 10px"
>清空</Button
>
</div>
</FormItem>
<FormItem
v-if="showEditParentAgent"
label="返佣比例"
prop="commissionRatio"
>
<InputNumber
:min="0"
:max="100"
:precision="0"
v-model="form.commissionRatio"
></InputNumber>
<span style="margin-left: 8px">%</span>
</FormItem>
<FormItem label="排序值" prop="sortOrder">
<Tooltip
@ -217,6 +249,38 @@
<FormItem label="区域名称" prop="title">
<Input v-model="formAdd.title" />
</FormItem>
<FormItem v-if="showAddParentAgent" label="上级代理">
<div style="display: flex">
<Input
v-model="formAdd.parentAgentName"
readonly
placeholder="请根据手机号搜索选择上级代理"
style="margin-right: 10px"
/>
<Button @click="openParentAgentModal('add')" icon="ios-search"
>选择用户</Button
>
<Button
v-if="formAdd.parentAgentId"
@click="clearParentAgent('add')"
style="margin-left: 10px"
>清空</Button
>
</div>
</FormItem>
<FormItem
v-if="showAddParentAgent"
label="返佣比例"
prop="commissionRatio"
>
<InputNumber
:min="0"
:max="100"
:precision="0"
v-model="formAdd.commissionRatio"
></InputNumber>
<span style="margin-left: 8px">%</span>
</FormItem>
<FormItem label="排序值" prop="sortOrder">
<Tooltip
trigger="hover"
@ -265,6 +329,61 @@
>
</div>
</Modal>
<Modal
title="选择上级代理"
v-model="agentModalVisible"
:mask-closable="false"
:width="760"
>
<Form
ref="agentSearchForm"
:model="agentSearchForm"
inline
:label-width="70"
@keydown.enter.native="handleAgentSearch"
>
<FormItem label="手机号" prop="mobile">
<Input
type="text"
v-model="agentSearchForm.mobile"
clearable
placeholder="请输入手机号"
style="width: 220px"
/>
</FormItem>
<FormItem class="br">
<Button @click="handleAgentSearch" type="primary" icon="ios-search"
>搜索</Button
>
<Button @click="handleAgentReset">重置</Button>
</FormItem>
</Form>
<Table
:loading="agentLoading"
border
:columns="agentColumns"
:data="agentData"
style="margin: 10px 0"
></Table>
<Row type="flex" justify="end">
<Page
:current="agentSearchForm.pageNumber"
:total="agentTotal"
:page-size="agentSearchForm.pageSize"
@on-change="changeAgentPage"
@on-page-size-change="changeAgentPageSize"
:page-size-opts="[10, 20, 50]"
size="small"
show-total
show-elevator
show-sizer
:transfer="true"
></Page>
</Row>
<div slot="footer">
<Button type="text" @click="agentModalVisible = false">关闭</Button>
</div>
</Modal>
</div>
</template>
@ -277,13 +396,22 @@ import {
deleteShopArea,
searchShopArea,
} from "@/api/app";
import userSelect from "@/views/my-components/hiver/user-select";
import { getUserListData } from "@/api/index";
export default {
name: "shopArea",
components: {
userSelect,
},
data() {
const validateCommissionRatio = (rule, value, callback) => {
if (value === "" || value == null || value === "null") {
callback();
return;
}
const ratio = Number(value);
if (!Number.isInteger(ratio) || ratio < 0 || ratio > 100) {
callback(new Error("返佣比例需为0或1-100之间的整数"));
return;
}
callback();
};
return {
showType: "tree",
loading: true,
@ -305,8 +433,21 @@ export default {
sortOrder: 0,
isCanteen: 0,
status: 0,
parentAgentId: "",
parentAgentName: "",
commissionRatio: 0,
},
formAdd: {},
agentModalVisible: false,
agentSelectTarget: "add",
agentLoading: false,
agentSearchForm: {
mobile: "",
pageNumber: 1,
pageSize: 10,
sort: "createTime",
order: "desc",
},
formValidate: {
title: [{ required: true, message: "请输入名称", trigger: "blur" }],
sortOrder: [
@ -325,10 +466,63 @@ export default {
trigger: "change",
},
],
commissionRatio: [
{
validator: validateCommissionRatio,
trigger: "change",
},
],
},
submitLoading: false,
data: [],
dataEdit: [],
agentData: [],
agentTotal: 0,
agentColumns: [
{
type: "index",
width: 60,
align: "center",
},
{
title: "用户名",
key: "nickname",
minWidth: 130,
},
{
title: "登录账号",
key: "username",
minWidth: 130,
},
{
title: "手机号",
key: "mobile",
minWidth: 130,
},
{
title: "操作",
key: "action",
width: 100,
align: "center",
render: (h, params) => {
return h(
"Button",
{
props: {
type: "primary",
size: "small",
},
on: {
click: () => {
this.selectParentAgent(params.row);
},
},
},
"选择"
);
},
},
],
columns: [
{
type: "selection",
@ -347,6 +541,21 @@ export default {
sortable: true,
tree: true,
},
{
title: "上级代理",
key: "parentAgentName",
minWidth: 120,
},
{
title: "返佣比例",
key: "commissionRatio",
minWidth: 100,
align: "center",
render: (h, params) => {
const ratio = params.row.commissionRatio;
return h("span", ratio || ratio === 0 ? `${ratio}%` : "");
},
},
{
title: "排序",
key: "sortOrder",
@ -419,8 +628,35 @@ export default {
isDepartmentAgent() {
return !!this.userDepartmentId;
},
showEditParentAgent() {
return this.form && this.form.id && this.isRootArea(this.form.parentId);
},
showAddParentAgent() {
return this.formAdd && this.isRootArea(this.formAdd.parentId);
},
},
methods: {
isRootArea(parentId) {
return parentId === 0 || parentId === "0";
},
clearParentAgentValue(target) {
this.$set(target, "parentAgentId", "");
this.$set(target, "parentAgentName", "");
},
normalizeParentAgent(target) {
if (!this.isRootArea(target.parentId)) {
this.clearParentAgentValue(target);
this.$delete(target, "commissionRatio");
} else if (
target.commissionRatio === "" ||
target.commissionRatio == null ||
target.commissionRatio === "null"
) {
this.$set(target, "commissionRatio", 0);
} else {
this.$set(target, "commissionRatio", Number(target.commissionRatio));
}
},
init() {
this.getParentList();
this.getParentListEdit();
@ -534,8 +770,19 @@ export default {
this.editTitle = data.title;
//
this.form = data;
this.$refs.mainHeader.setData(data.mainHeaders);
this.$refs.viceHeader.setData(data.viceHeaders);
if (!this.form.parentAgentId) {
this.$set(this.form, "parentAgentId", "");
}
if (!this.form.parentAgentName) {
this.$set(this.form, "parentAgentName", "");
}
if (
this.form.commissionRatio === undefined ||
this.form.commissionRatio === "" ||
this.form.commissionRatio === "null"
) {
this.$set(this.form, "commissionRatio", 0);
}
} else {
this.cancelEdit();
}
@ -546,9 +793,18 @@ export default {
data.selected = false;
}
this.$refs.form.resetFields();
this.$refs.mainHeader.clearData();
this.$refs.viceHeader.clearData();
delete this.form.id;
this.form = {
id: "",
title: null,
parentId: "",
parentTitle: "",
sortOrder: 0,
isCanteen: 0,
status: 0,
parentAgentId: "",
parentAgentName: "",
commissionRatio: 0,
};
this.editTitle = "";
},
selectTreeEdit(v) {
@ -568,6 +824,7 @@ export default {
}
this.form.parentId = data.id;
this.form.parentTitle = data.title;
this.normalizeParentAgent(this.form);
}
},
cancelAdd() {
@ -579,6 +836,7 @@ export default {
this.form.status = 0;
},
submitEdit() {
this.normalizeParentAgent(this.form);
this.$refs.form.validate((valid) => {
if (valid) {
if (!this.form.id) {
@ -588,6 +846,7 @@ export default {
this.submitLoading = true;
delete this.form.mainHeaders;
delete this.form.viceHeaders;
this.normalizeParentAgent(this.form);
editShopArea(this.form).then((res) => {
this.submitLoading = false;
if (res.success) {
@ -601,9 +860,11 @@ export default {
});
},
submitAdd() {
this.normalizeParentAgent(this.formAdd);
this.$refs.formAdd.validate((valid) => {
if (valid) {
this.submitLoading = true;
this.normalizeParentAgent(this.formAdd);
addShopArea(this.formAdd).then((res) => {
this.submitLoading = false;
if (res.success) {
@ -626,6 +887,8 @@ export default {
sortOrder: this.data.length + 1,
isCanteen: null,
status: 0,
parentAgentId: "",
parentAgentName: "",
};
this.modalVisible = true;
return;
@ -644,6 +907,8 @@ export default {
sortOrder: this.form.children.length + 1,
isCanteen: null,
status: 0,
parentAgentId: "",
parentAgentName: "",
};
this.modalVisible = true;
},
@ -659,9 +924,76 @@ export default {
sortOrder: this.data.length + 1,
isCanteen: null,
status: 0,
parentAgentId: "",
parentAgentName: "",
commissionRatio: 0,
};
this.modalVisible = true;
},
openParentAgentModal(target) {
this.agentSelectTarget = target;
this.agentModalVisible = true;
this.handleAgentReset();
},
handleAgentSearch() {
this.agentSearchForm.pageNumber = 1;
this.agentSearchForm.pageSize = 10;
this.getAgentDataList();
},
handleAgentReset() {
this.agentSearchForm.mobile = "";
this.agentSearchForm.pageNumber = 1;
this.agentSearchForm.pageSize = 10;
this.agentData = [];
this.agentTotal = 0;
},
changeAgentPage(v) {
this.agentSearchForm.pageNumber = v;
this.getAgentDataList();
},
changeAgentPageSize(v) {
this.agentSearchForm.pageSize = v;
this.getAgentDataList();
},
getAgentDataList() {
const mobile = (this.agentSearchForm.mobile || "").trim();
if (!mobile) {
this.$Message.warning("请输入手机号搜索用户");
return;
}
this.agentLoading = true;
getUserListData({
id: "",
mobile,
status: "",
pageNumber: this.agentSearchForm.pageNumber,
pageSize: this.agentSearchForm.pageSize,
sort: this.agentSearchForm.sort,
order: this.agentSearchForm.order,
}).then((res) => {
this.agentLoading = false;
if (res.success) {
this.agentData = res.result.content;
this.agentTotal = res.result.totalElements;
}
});
},
selectParentAgent(v) {
const target =
this.agentSelectTarget === "edit" ? this.form : this.formAdd;
this.$set(target, "parentAgentId", v.id);
this.$set(
target,
"parentAgentName",
v.nickname || v.username || v.mobile
);
this.agentModalVisible = false;
this.$Message.success(`选择用户 ${target.parentAgentName} 成功`);
},
clearParentAgent(targetType) {
const target = targetType === "edit" ? this.form : this.formAdd;
this.clearParentAgentValue(target);
},
changeSelect(v) {
this.selectList = v;
},

Loading…
Cancel
Save