套餐应用经营场所

This commit is contained in:
墨大叔 2024-08-24 10:38:11 +08:00
parent 691cdbaa6e
commit 76741fee00
7 changed files with 208 additions and 64 deletions

View File

@ -9,6 +9,38 @@ export function listSmUser(query) {
}) })
} }
export function listAgent(query) {
return request({
url: '/system/smUser/agentList',
method: 'get',
params: query
})
}
export function listBiz(query) {
return request({
url: '/system/smUser/bizList',
method: 'get',
params: query
})
}
export function listInvestor(query) {
return request({
url: '/system/smUser/investorList',
method: 'get',
params: query
})
}
export function listStoreUser(query) {
return request({
url: '/system/smUser/storeList',
method: 'get',
params: query
})
}
// ids查询普通用户信息列表 // ids查询普通用户信息列表
export function listSmUserByIds(ids) { export function listSmUserByIds(ids) {

View File

@ -3,18 +3,19 @@
<template> <template>
<div> <div>
<el-input <template v-if="multiple">
v-if="multiple" <el-tag
rows="1" v-for="(item,index) of selected"
type="textarea" :key="item.storeId"
:value="inputBindValue" size="small"
@focus="openDialog" style="margin-right: 4px"
:size="size" disable-transitions
:disabled="disabled" :closable="!disabled"
readonly @close="onCloseSelected(index)"
:placeholder="placeholder"> >{{item.name}}</el-tag>
<template #suffix><i class="el-icon-arrow-right"/></template> <el-tag style="cursor: not-allowed" size="small" type="info" v-if="disabled">+</el-tag>
</el-input> <el-tag style="cursor: pointer" size="small" @click="openDialog" type="success" v-else>+</el-tag>
</template>
<el-input <el-input
v-else v-else
:value="inputBindValue" :value="inputBindValue"
@ -140,6 +141,10 @@ export default {
this.loadSelected(this.value); this.loadSelected(this.value);
}, },
methods: { methods: {
onCloseSelected(index) {
this.selected.splice(index, 1);
this.onSubmit(this.selected);
},
// //
loadSelected(ids) { loadSelected(ids) {
if (ids == null || ids.length === 0) { if (ids == null || ids.length === 0) {

View File

@ -63,6 +63,16 @@ export const $showColumns = {
} }
} }
}, },
methods: {
hideColumn(columns) {
if (this.columns != null) {
this.columns.filter(item => columns.includes(item.key))
.forEach(item => {
item.visible = false;
})
}
}
}
} }
// 充值服务费 // 充值服务费

View File

@ -105,9 +105,19 @@
<el-switch slot-scope="d" v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/> <el-switch slot-scope="d" v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/>
</el-table-column> </el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/> <el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
<el-table-column label="使用次数" align="center" prop="totalCount" width="180"> <el-table-column label="使用次数" align="center" prop="totalCount">
<template slot-scope="d">{{d.row.totalCount}} </template> <template slot-scope="d">{{d.row.totalCount}} </template>
</el-table-column> </el-table-column>
<el-table-column label="应用场所" align="center" prop="storeList" min-width="300">
<template slot-scope="d">
<el-tag
v-for="item in d.row.storeList"
:key="item.storeId"
@click="$router.push(`/mch/storeDetail?storeId=${item.storeId}`)"
style="cursor: pointer; margin: 0 4px 2px 0;"
>{{item.name}}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="200" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
@ -223,6 +233,9 @@
<form-col :span="span" label="自定义使用率" prop="usePoint" label-width="7em"> <form-col :span="span" label="自定义使用率" prop="usePoint" label-width="7em">
<el-input-number v-model="form.usePoint" placeholder="请输入使用率" :min="0" :max="100" :precision="0" controls-position="right" style="width: calc(100% - 1.5em)"/> % <el-input-number v-model="form.usePoint" placeholder="请输入使用率" :min="0" :max="100" :precision="0" controls-position="right" style="width: calc(100% - 1.5em)"/> %
</form-col> </form-col>
<form-col :span="span * 2" label="应用经营场所" prop="storeIds" label-width="7em">
<store-input v-model="form.storeIds" multiple/>
</form-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
@ -244,6 +257,7 @@ import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
import { SuitFeeMode, SuitFeeType } from '@/utils/constants' import { SuitFeeMode, SuitFeeType } from '@/utils/constants'
import DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue' import DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import StoreInput from '@/components/Business/Store/StoreInput.vue'
export default { export default {
name: "Suit", name: "Suit",
@ -280,7 +294,7 @@ export default {
} }
} }
}, },
components: { DeptTreeSelect, DeviceLink, UserInput, UserLink, DeviceInput }, components: { StoreInput, DeptTreeSelect, DeviceLink, UserInput, UserLink, DeviceInput },
props: { props: {
query: { query: {
type: Object, type: Object,
@ -441,6 +455,7 @@ export default {
deptId: this.deptId, deptId: this.deptId,
sort: 0, sort: 0,
enableCustomUse: false, enableCustomUse: false,
storeIds: []
}; };
if (this.$refs.form) { if (this.$refs.form) {
this.$refs.form.clearValidate(); this.$refs.form.clearValidate();
@ -476,6 +491,7 @@ export default {
const suitId = row.suitId || this.ids const suitId = row.suitId || this.ids
getSuit(suitId).then(response => { getSuit(suitId).then(response => {
let data = response.data; let data = response.data;
data.storeIds = data.storeList.map(item => item.storeId);
this.form = data; this.form = data;
this.open = true; this.open = true;
this.title = "修改套餐"; this.title = "修改套餐";

View File

@ -173,7 +173,13 @@
<dict-tag :options="dict.type.sm_device_status" :value="scope.row.status"/> <dict-tag :options="dict.type.sm_device_status" :value="scope.row.status"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="所属投资人" align="center" prop="userName" > <el-table-column label="代理商" align="center" prop="agentName" >
<user-link slot-scope="d" :id="d.row.agentId" :name="d.row.agentName"/>
</el-table-column>
<el-table-column label="业务员" align="center" prop="bizManName" >
<user-link slot-scope="d" :id="d.row.bizManId" :name="d.row.bizManName"/>
</el-table-column>
<el-table-column label="投资人" align="center" prop="userName" >
<user-link slot-scope="d" :id="d.row.userId" :name="d.row.userName"/> <user-link slot-scope="d" :id="d.row.userId" :name="d.row.userName"/>
</el-table-column> </el-table-column>
<el-table-column label="经营场所" align="center" prop="storeName" > <el-table-column label="经营场所" align="center" prop="storeName" >
@ -394,7 +400,7 @@ export default {
userQuery() { userQuery() {
return { return {
type: SmUserType.INVESTOR, type: SmUserType.INVESTOR,
ancestorId: this.form.agentId agentId: this.form.agentId
} }
}, },
// //

View File

@ -20,20 +20,6 @@
<el-descriptions-item label="经营场所数" v-if="userData.type === SmUserType.BUSINESS_PLACE">{{userData.storeCount | defaultValue}} </el-descriptions-item> <el-descriptions-item label="经营场所数" v-if="userData.type === SmUserType.BUSINESS_PLACE">{{userData.storeCount | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="分成比例" v-if="userData.type !== SmUserType.BUSINESS_PLACE">{{userData.point | money | defaultValue}} %</el-descriptions-item> <el-descriptions-item label="分成比例" v-if="userData.type !== SmUserType.BUSINESS_PLACE">{{userData.point | money | defaultValue}} %</el-descriptions-item>
<el-descriptions-item label="设备数">{{userData.deviceCount | defaultValue}} </el-descriptions-item> <el-descriptions-item label="设备数">{{userData.deviceCount | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="设备服务费">
<template v-if="userData.serviceRate == null || userData.serviceType == null">跟随渠道</template>
<template v-else>
<dict-tag :options="dict.type.service_type" :value="userData.serviceType" size="mini"/>
{{userData.serviceRate}} {{serviceUnit(userData.serviceType)}}
</template>
</el-descriptions-item>
<el-descriptions-item label="提现服务费">
<template v-if="userData.withdrawServiceRate == null || userData.withdrawServiceType == null">跟随渠道</template>
<template v-else>
<dict-tag :options="dict.type.withdraw_service_type" :value="userData.withdrawServiceType" size="mini"/>
{{userData.withdrawServiceRate}} {{serviceUnit(userData.withdrawServiceType)}}
</template>
</el-descriptions-item>
<el-descriptions-item label="账户余额">{{userData.balance | money | defaultValue}} </el-descriptions-item> <el-descriptions-item label="账户余额">{{userData.balance | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="总收入">{{userData.totalIncome | money | defaultValue}} </el-descriptions-item> <el-descriptions-item label="总收入">{{userData.totalIncome | money | defaultValue}} </el-descriptions-item>
<el-descriptions-item label="总充值">{{userData.rechargeAmount | money | defaultValue}} </el-descriptions-item> <el-descriptions-item label="总充值">{{userData.rechargeAmount | money | defaultValue}} </el-descriptions-item>
@ -52,14 +38,52 @@
<el-card class="box-card"> <el-card class="box-card">
<el-tabs> <el-tabs>
<el-tab-pane label="设备列表" lazy v-if="userData.type === SmUserType.INVESTOR"> <template v-if="userData.type === SmUserType.SALE">
<user-device :user-id="userData.userId"/> <el-tab-pane label="代理商列表" lazy>
</el-tab-pane> <sm-user :query="{referenceId: userData.userId, type: SmUserType.SALE}"/>
<el-tab-pane label="经营场所分成" lazy v-if="userData.type === SmUserType.INVESTOR"> </el-tab-pane>
<store-investor :query="{investorId: userData.userId}" :view="views.user"/> <el-tab-pane label="业务员列表" lazy >
</el-tab-pane> <sm-user :query="{referenceId: userData.userId, type: SmUserType.BIZ}"/>
<el-tab-pane label="设备列表" lazy v-if="userData.type === SmUserType.SALE"> </el-tab-pane>
<device v-if="userData.userId != null" :query="{saleId: this.userData.userId}"/> <el-tab-pane label="投资人列表" lazy >
<sm-user :query="{agentId: userData.userId, type: SmUserType.INVESTOR}"/>
</el-tab-pane>
<el-tab-pane label="合作场所" lazy >
<store-investor :query="{investorAgentId: userData.userId}"/>
</el-tab-pane>
<el-tab-pane label="设备列表" lazy>
<device v-if="userData.userId != null" :query="{agentId: this.userData.userId}"/>
</el-tab-pane>
</template>
<template v-if="userData.type === SmUserType.BIZ">
<el-tab-pane label="业务员列表" lazy >
<sm-user :query="{referenceId: userData.userId, type: SmUserType.BIZ}"/>
</el-tab-pane>
<el-tab-pane label="投资人列表" lazy >
<sm-user :query="{referenceId: userData.userId, type: SmUserType.INVESTOR}"/>
</el-tab-pane>
<el-tab-pane label="合作场所" lazy >
<store-investor :query="{bizId: userData.userId}" :view="views.user"/>
</el-tab-pane>
<el-tab-pane label="设备列表" lazy>
<device v-if="userData.userId != null" :query="{investorReferenceId: this.userData.userId}"/>
</el-tab-pane>
</template>
<template v-if="userData.type === SmUserType.INVESTOR">
<el-tab-pane label="设备列表" lazy>
<user-device :user-id="userData.userId"/>
</el-tab-pane>
<el-tab-pane label="合作场所" lazy>
<store-investor :query="{investorId: userData.userId}" :view="views.user"/>
</el-tab-pane>
</template>
<template v-if="userData.type === SmUserType.BUSINESS_PLACE">
<el-tab-pane label="经营场所" lazy>
<store :query="{userId: userData.userId}" :view="views.user"/>
</el-tab-pane>
</template>
<el-tab-pane label="余额变化记录" lazy>
<record-balance v-if="userData.userId != null" :query="{userId: userData.userId}" :view="views.user"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="经营场所列表" lazy v-if="userData.type === SmUserType.BUSINESS_PLACE"> <el-tab-pane label="经营场所列表" lazy v-if="userData.type === SmUserType.BUSINESS_PLACE">
<store :query="{userId: userData.userId}" :view="views.user"/> <store :query="{userId: userData.userId}" :view="views.user"/>
@ -67,15 +91,9 @@
<el-tab-pane label="收款账户" lazy> <el-tab-pane label="收款账户" lazy>
<account v-if="userData.userId != null" :query="{userId: userData.userId}" :view="views.user"/> <account v-if="userData.userId != null" :query="{userId: userData.userId}" :view="views.user"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="充值提现记录" lazy> <!-- <el-tab-pane label="用户秘钥" lazy>-->
<user-account :landlord-id="userData.userId"/> <!-- <access :query="{userId: userData.userId}" :view="views.user"/>-->
</el-tab-pane> <!-- </el-tab-pane>-->
<el-tab-pane label="余额变化记录" lazy>
<record-balance :query="{userId: userData.userId}" :view="views.user"/>
</el-tab-pane>
<el-tab-pane label="用户秘钥" lazy>
<access :query="{userId: userData.userId}" :view="views.user"/>
</el-tab-pane>
</el-tabs> </el-tabs>
</el-card> </el-card>
</template> </template>
@ -99,11 +117,12 @@ import { SmUserType } from '@/utils/constants'
import Device from '@/views/system/device/index.vue' import Device from '@/views/system/device/index.vue'
import StoreInvestor from '@/views/ss/storeInvestor/index.vue' import StoreInvestor from '@/views/ss/storeInvestor/index.vue'
import SmUser from '@/views/system/smUser/index.vue' import SmUser from '@/views/system/smUser/index.vue'
import User from '@/views/system/user/index.vue'
export default { export default {
name: 'User/:userId', name: 'User/:userId',
mixins: [$view, $serviceType], mixins: [$view, $serviceType],
components: { StoreInvestor, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart}, components: { SmUser, User, StoreInvestor, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
dicts: ['service_type', 'withdraw_service_type', 'user_type'], dicts: ['service_type', 'withdraw_service_type', 'user_type'],
computed: { computed: {
SmUser() { SmUser() {

View File

@ -99,8 +99,11 @@
<template v-else-if="column.key === 'phonenumber'"> <template v-else-if="column.key === 'phonenumber'">
<user-link :id="d.row.userId" :name="d.row.phonenumber"/> <user-link :id="d.row.userId" :name="d.row.phonenumber"/>
</template> </template>
<template v-else-if="column.key === 'referenceMobile'"> <template v-else-if="column.key === 'referenceId'">
<user-link :id="d.row.referenceId" :name="d.row.referenceMobile"/> <user-link :id="d.row.referenceId" :name="d.row.referenceName"/>
</template>
<template v-else-if="column.key === 'agentId'">
<user-link :id="d.row.agentId" :name="d.row.agentName"/>
</template> </template>
<template v-else-if="column.key === 'point'"> <template v-else-if="column.key === 'point'">
{{d.row.point | money | defaultValue}} % {{d.row.point | money | defaultValue}} %
@ -108,14 +111,17 @@
<template v-else-if="column.key === 'storeCount'"> <template v-else-if="column.key === 'storeCount'">
{{d.row.storeCount | defaultValue}} {{d.row.storeCount | defaultValue}}
</template> </template>
<template v-else-if="column.key === 'rechargeAmount'"> <template v-else-if="column.key === 'deviceCount'">
{{d.row.rechargeAmount | money}} {{d.row.deviceCount | defaultValue}}
</template> </template>
<template v-else-if="column.key === 'withDrawlAmount'"> <template v-else-if="column.key === 'billCount'">
{{d.row.withDrawlAmount | money}} {{d.row.billCount | defaultValue}}
</template> </template>
<template v-else-if="column.key === 'balance'"> <template v-else-if="column.key === 'investorCount'">
{{d.row.balance | money}} {{d.row.investorCount | defaultValue}}
</template>
<template v-else-if="['rechargeAmount', 'withDrawlAmount', 'balance', 'billAmount'].includes(column.key)">
{{d.row[column.key] | money | defaultValue}}
</template> </template>
<template v-else-if="column.key === 'status'"> <template v-else-if="column.key === 'status'">
<dict-tag :options="dict.type.sm_user_status" :value="d.row.status"/> <dict-tag :options="dict.type.sm_user_status" :value="d.row.status"/>
@ -124,7 +130,7 @@
<el-tag :type="d.row.deviceAdmin ? 'danger' : 'info'">{{d.row.deviceAdmin ? '是' : '否'}}</el-tag> <el-tag :type="d.row.deviceAdmin ? 'danger' : 'info'">{{d.row.deviceAdmin ? '是' : '否'}}</el-tag>
</template> </template>
<template v-else> <template v-else>
{{d.row[column.key]}} {{d.row[column.key] | defaultValue}}
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
@ -225,7 +231,7 @@ import {
getSmUser, getSmUser,
addSmUser, addSmUser,
updateSmUser, updateSmUser,
delSmUser delSmUser, listAgent, listBiz, listInvestor, listStoreUser
} from '@/api/system/smUser' } from '@/api/system/smUser'
import { $serviceType, $showColumns, $withdrawServiceType } from '@/utils/mixins' import { $serviceType, $showColumns, $withdrawServiceType } from '@/utils/mixins'
import UserLink from '@/components/Business/SmUser/UserLink.vue' import UserLink from '@/components/Business/SmUser/UserLink.vue'
@ -244,6 +250,14 @@ export default {
mixins: [$showColumns, $serviceType, $withdrawServiceType], mixins: [$showColumns, $serviceType, $withdrawServiceType],
dicts: ['sm_user_status', 'user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'], dicts: ['sm_user_status', 'user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
components: { DeptTreeSelect, UserInput, UserLink }, components: { DeptTreeSelect, UserInput, UserLink },
props: {
query: {
type: Object,
default: () => {
return {}
}
}
},
computed: { computed: {
...mapGetters(['deptId']), ...mapGetters(['deptId']),
SmUserType() { SmUserType() {
@ -287,7 +301,7 @@ export default {
{key: 'phonenumber', visible: true, label: '手机号码', align: 'center', minWidth: null, sortable: true}, {key: 'phonenumber', visible: true, label: '手机号码', align: 'center', minWidth: null, sortable: true},
{key: 'userName', visible: true, label: '用户名称', align: 'center', minWidth: null, sortable: false}, {key: 'userName', visible: true, label: '用户名称', align: 'center', minWidth: null, sortable: false},
{key: 'type', visible: true, label: '用户类型', align: 'center', minWidth: null, sortable: true}, {key: 'type', visible: true, label: '用户类型', align: 'center', minWidth: null, sortable: true},
{key: 'referenceMobile', visible: true, label: '推广人', align: 'center', minWidth: null, sortable: true}, {key: 'referenceId', visible: true, label: '推广人', align: 'center', minWidth: null, sortable: true},
{key: 'remark', visible: true, label: '备注', align: 'center', minWidth: null, sortable: false, overflow: true}, {key: 'remark', visible: true, label: '备注', align: 'center', minWidth: null, sortable: false, overflow: true},
{key: 'status', visible: true, label: '账号状态', align: 'center', minWidth: null, sortable: true}, {key: 'status', visible: true, label: '账号状态', align: 'center', minWidth: null, sortable: true},
{key: 'createTime', visible: true, label: '创建时间', align: 'center', minWidth: "120", sortable: true}, {key: 'createTime', visible: true, label: '创建时间', align: 'center', minWidth: "120", sortable: true},
@ -296,6 +310,12 @@ export default {
{key: 'balance', visible: true, label: '账户余额', align: 'center', minWidth: null, sortable: true}, {key: 'balance', visible: true, label: '账户余额', align: 'center', minWidth: null, sortable: true},
{key: 'point', visible: true, label: '分成比例', align: 'center', minWidth: null, sortable: true}, {key: 'point', visible: true, label: '分成比例', align: 'center', minWidth: null, sortable: true},
{key: 'deviceAdmin', visible: false, label: '设备管理员', align: 'center', minWidth: null, sortable: false}, {key: 'deviceAdmin', visible: false, label: '设备管理员', align: 'center', minWidth: null, sortable: false},
{key: 'agentId', visible: true, label: '直属代理商', align: 'center', minWidth: null, sortable: false},
{key: 'investorCount', visible: true, label: '投资人数', align: 'center', minWidth: null, sortable: false},
{key: 'storeCount', visible: true, label: '经营场所数', align: 'center', minWidth: null, sortable: false},
{key: 'deviceCount', visible: true, label: '设备数', align: 'center', minWidth: null, sortable: false},
{key: 'billCount', visible: true, label: '订单数', align: 'center', minWidth: null, sortable: false},
{key: 'billAmount', visible: true, label: '订单总额', align: 'center', minWidth: null, sortable: false},
], ],
openServiceRate: false, openServiceRate: false,
// //
@ -332,8 +352,23 @@ export default {
}; };
}, },
created() { created() {
this.type = this.query.type;
this.type = this.$route.query.type; this.type = this.$route.query.type;
this.queryParams.type = this.type; this.queryParams.type = this.type;
if (this.type === SmUserType.INVESTOR) {
this.hideColumn(['investorCount', 'billAmount']);
} else if (this.type === SmUserType.BUSINESS_PLACE) {
this.hideColumn(['investorCount', 'billAmount', 'point', 'agentId', 'deviceCount', 'billCount', 'billAmount', 'referenceId'])
} else if (this.type === SmUserType.NORMAL) {
this.hideColumn(['investorCount', 'billAmount', 'point', 'agentId', 'deviceCount', 'billCount', 'billAmount', 'storeCount', 'referenceId'])
}
this.queryParams = {
...this.queryParams,
...this.query
}
this.getList(); this.getList();
}, },
methods: { methods: {
@ -363,11 +398,32 @@ export default {
/** 查询普通用户信息列表 */ /** 查询普通用户信息列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listSmUser(this.queryParams).then(response => { if (this.type === SmUserType.SALE) {
this.smUserList = response.rows; listAgent(this.queryParams).then(res => {
this.total = response.total; this.afterList(res);
this.loading = false; })
}); } else if (this.type === SmUserType.BIZ) {
listBiz(this.queryParams).then(res => {
this.afterList(res);
})
} else if (this.type === SmUserType.INVESTOR) {
listInvestor(this.queryParams).then(res => {
this.afterList(res);
})
} else if (this.type === SmUserType.BUSINESS_PLACE) {
listStoreUser(this.queryParams).then(res => {
this.afterList(res);
})
} else {
listSmUser(this.queryParams).then(res => {
this.afterList(res);
});
}
},
afterList(res) {
this.smUserList = res.rows;
this.total = res.total;
this.loading = false;
}, },
// //
cancel() { cancel() {