套餐应用经营场所
This commit is contained in:
parent
691cdbaa6e
commit
76741fee00
|
@ -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查询普通用户信息列表
|
||||
export function listSmUserByIds(ids) {
|
||||
|
|
|
@ -3,18 +3,19 @@
|
|||
|
||||
<template>
|
||||
<div>
|
||||
<el-input
|
||||
v-if="multiple"
|
||||
rows="1"
|
||||
type="textarea"
|
||||
:value="inputBindValue"
|
||||
@focus="openDialog"
|
||||
:size="size"
|
||||
:disabled="disabled"
|
||||
readonly
|
||||
:placeholder="placeholder">
|
||||
<template #suffix><i class="el-icon-arrow-right"/></template>
|
||||
</el-input>
|
||||
<template v-if="multiple">
|
||||
<el-tag
|
||||
v-for="(item,index) of selected"
|
||||
:key="item.storeId"
|
||||
size="small"
|
||||
style="margin-right: 4px"
|
||||
disable-transitions
|
||||
:closable="!disabled"
|
||||
@close="onCloseSelected(index)"
|
||||
>{{item.name}}</el-tag>
|
||||
<el-tag style="cursor: not-allowed" size="small" type="info" v-if="disabled">+</el-tag>
|
||||
<el-tag style="cursor: pointer" size="small" @click="openDialog" type="success" v-else>+</el-tag>
|
||||
</template>
|
||||
<el-input
|
||||
v-else
|
||||
:value="inputBindValue"
|
||||
|
@ -140,6 +141,10 @@ export default {
|
|||
this.loadSelected(this.value);
|
||||
},
|
||||
methods: {
|
||||
onCloseSelected(index) {
|
||||
this.selected.splice(index, 1);
|
||||
this.onSubmit(this.selected);
|
||||
},
|
||||
// 加载选中的值
|
||||
loadSelected(ids) {
|
||||
if (ids == null || ids.length === 0) {
|
||||
|
|
|
@ -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;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 充值服务费
|
||||
|
|
|
@ -105,9 +105,19 @@
|
|||
<el-switch slot-scope="d" v-model="d.row.enabled" @change="(nv) => {onChangeEnabled(d.row, nv)}"/>
|
||||
</el-table-column>
|
||||
<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>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -223,6 +233,9 @@
|
|||
<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)"/> %
|
||||
</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-form>
|
||||
<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 DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue'
|
||||
import { mapGetters } from 'vuex'
|
||||
import StoreInput from '@/components/Business/Store/StoreInput.vue'
|
||||
|
||||
export default {
|
||||
name: "Suit",
|
||||
|
@ -280,7 +294,7 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
components: { DeptTreeSelect, DeviceLink, UserInput, UserLink, DeviceInput },
|
||||
components: { StoreInput, DeptTreeSelect, DeviceLink, UserInput, UserLink, DeviceInput },
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
|
@ -441,6 +455,7 @@ export default {
|
|||
deptId: this.deptId,
|
||||
sort: 0,
|
||||
enableCustomUse: false,
|
||||
storeIds: []
|
||||
};
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.clearValidate();
|
||||
|
@ -476,6 +491,7 @@ export default {
|
|||
const suitId = row.suitId || this.ids
|
||||
getSuit(suitId).then(response => {
|
||||
let data = response.data;
|
||||
data.storeIds = data.storeList.map(item => item.storeId);
|
||||
this.form = data;
|
||||
this.open = true;
|
||||
this.title = "修改套餐";
|
||||
|
|
|
@ -173,7 +173,13 @@
|
|||
<dict-tag :options="dict.type.sm_device_status" :value="scope.row.status"/>
|
||||
</template>
|
||||
</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"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="经营场所" align="center" prop="storeName" >
|
||||
|
@ -394,7 +400,7 @@ export default {
|
|||
userQuery() {
|
||||
return {
|
||||
type: SmUserType.INVESTOR,
|
||||
ancestorId: this.form.agentId
|
||||
agentId: this.form.agentId
|
||||
}
|
||||
},
|
||||
// 店铺查询条件
|
||||
|
|
|
@ -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.point | money | 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.totalIncome | 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-tabs>
|
||||
<el-tab-pane label="设备列表" lazy v-if="userData.type === SmUserType.INVESTOR">
|
||||
<user-device :user-id="userData.userId"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="经营场所分成" lazy v-if="userData.type === SmUserType.INVESTOR">
|
||||
<store-investor :query="{investorId: userData.userId}" :view="views.user"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="设备列表" lazy v-if="userData.type === SmUserType.SALE">
|
||||
<device v-if="userData.userId != null" :query="{saleId: this.userData.userId}"/>
|
||||
<template v-if="userData.type === SmUserType.SALE">
|
||||
<el-tab-pane label="代理商列表" lazy>
|
||||
<sm-user :query="{referenceId: userData.userId, type: SmUserType.SALE}"/>
|
||||
</el-tab-pane>
|
||||
<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="{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 label="经营场所列表" lazy v-if="userData.type === SmUserType.BUSINESS_PLACE">
|
||||
<store :query="{userId: userData.userId}" :view="views.user"/>
|
||||
|
@ -67,15 +91,9 @@
|
|||
<el-tab-pane label="收款账户" lazy>
|
||||
<account v-if="userData.userId != null" :query="{userId: userData.userId}" :view="views.user"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="充值提现记录" lazy>
|
||||
<user-account :landlord-id="userData.userId"/>
|
||||
</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-tab-pane label="用户秘钥" lazy>-->
|
||||
<!-- <access :query="{userId: userData.userId}" :view="views.user"/>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</template>
|
||||
|
@ -99,11 +117,12 @@ import { SmUserType } from '@/utils/constants'
|
|||
import Device from '@/views/system/device/index.vue'
|
||||
import StoreInvestor from '@/views/ss/storeInvestor/index.vue'
|
||||
import SmUser from '@/views/system/smUser/index.vue'
|
||||
import User from '@/views/system/user/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'User/:userId',
|
||||
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'],
|
||||
computed: {
|
||||
SmUser() {
|
||||
|
|
|
@ -99,8 +99,11 @@
|
|||
<template v-else-if="column.key === 'phonenumber'">
|
||||
<user-link :id="d.row.userId" :name="d.row.phonenumber"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'referenceMobile'">
|
||||
<user-link :id="d.row.referenceId" :name="d.row.referenceMobile"/>
|
||||
<template v-else-if="column.key === 'referenceId'">
|
||||
<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 v-else-if="column.key === 'point'">
|
||||
{{d.row.point | money | defaultValue}} %
|
||||
|
@ -108,14 +111,17 @@
|
|||
<template v-else-if="column.key === 'storeCount'">
|
||||
{{d.row.storeCount | defaultValue}} 家
|
||||
</template>
|
||||
<template v-else-if="column.key === 'rechargeAmount'">
|
||||
{{d.row.rechargeAmount | money}} 元
|
||||
<template v-else-if="column.key === 'deviceCount'">
|
||||
{{d.row.deviceCount | defaultValue}} 台
|
||||
</template>
|
||||
<template v-else-if="column.key === 'withDrawlAmount'">
|
||||
{{d.row.withDrawlAmount | money}} 元
|
||||
<template v-else-if="column.key === 'billCount'">
|
||||
{{d.row.billCount | defaultValue}} 单
|
||||
</template>
|
||||
<template v-else-if="column.key === 'balance'">
|
||||
{{d.row.balance | money}} 元
|
||||
<template v-else-if="column.key === 'investorCount'">
|
||||
{{d.row.investorCount | defaultValue}} 人
|
||||
</template>
|
||||
<template v-else-if="['rechargeAmount', 'withDrawlAmount', 'balance', 'billAmount'].includes(column.key)">
|
||||
{{d.row[column.key] | money | defaultValue}} 元
|
||||
</template>
|
||||
<template v-else-if="column.key === '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>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
{{d.row[column.key] | defaultValue}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
@ -225,7 +231,7 @@ import {
|
|||
getSmUser,
|
||||
addSmUser,
|
||||
updateSmUser,
|
||||
delSmUser
|
||||
delSmUser, listAgent, listBiz, listInvestor, listStoreUser
|
||||
} from '@/api/system/smUser'
|
||||
import { $serviceType, $showColumns, $withdrawServiceType } from '@/utils/mixins'
|
||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
|
@ -244,6 +250,14 @@ export default {
|
|||
mixins: [$showColumns, $serviceType, $withdrawServiceType],
|
||||
dicts: ['sm_user_status', 'user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
|
||||
components: { DeptTreeSelect, UserInput, UserLink },
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['deptId']),
|
||||
SmUserType() {
|
||||
|
@ -287,7 +301,7 @@ export default {
|
|||
{key: 'phonenumber', visible: true, label: '手机号码', align: 'center', minWidth: null, sortable: true},
|
||||
{key: 'userName', visible: true, label: '用户名称', align: 'center', minWidth: null, sortable: false},
|
||||
{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: 'status', visible: true, label: '账号状态', align: 'center', minWidth: null, 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: 'point', visible: true, label: '分成比例', align: 'center', minWidth: null, sortable: true},
|
||||
{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,
|
||||
// 遮罩层
|
||||
|
@ -332,8 +352,23 @@ export default {
|
|||
};
|
||||
},
|
||||
created() {
|
||||
this.type = this.query.type;
|
||||
this.type = this.$route.query.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();
|
||||
},
|
||||
methods: {
|
||||
|
@ -363,11 +398,32 @@ export default {
|
|||
/** 查询普通用户信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listSmUser(this.queryParams).then(response => {
|
||||
this.smUserList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
if (this.type === SmUserType.SALE) {
|
||||
listAgent(this.queryParams).then(res => {
|
||||
this.afterList(res);
|
||||
})
|
||||
} 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() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user