床垫版提交
This commit is contained in:
parent
1841255e50
commit
691cdbaa6e
44
src/api/ss/bonus.js
Normal file
44
src/api/ss/bonus.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询分成明细列表
|
||||
export function listBonus(query) {
|
||||
return request({
|
||||
url: '/ss/bonus/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询分成明细详细
|
||||
export function getBonus(id) {
|
||||
return request({
|
||||
url: '/ss/bonus/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增分成明细
|
||||
export function addBonus(data) {
|
||||
return request({
|
||||
url: '/ss/bonus',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改分成明细
|
||||
export function updateBonus(data) {
|
||||
return request({
|
||||
url: '/ss/bonus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除分成明细
|
||||
export function delBonus(id) {
|
||||
return request({
|
||||
url: '/ss/bonus/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
src/api/ss/storeInvestor.js
Normal file
44
src/api/ss/storeInvestor.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询经营场所投资人关联列表
|
||||
export function listStoreInvestor(query) {
|
||||
return request({
|
||||
url: '/ss/storeInvestor/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询经营场所投资人关联详细
|
||||
export function getStoreInvestor(id) {
|
||||
return request({
|
||||
url: '/ss/storeInvestor/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增经营场所投资人关联
|
||||
export function addStoreInvestor(data) {
|
||||
return request({
|
||||
url: '/ss/storeInvestor',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改经营场所投资人关联
|
||||
export function updateStoreInvestor(data) {
|
||||
return request({
|
||||
url: '/ss/storeInvestor',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除经营场所投资人关联
|
||||
export function delStoreInvestor(id) {
|
||||
return request({
|
||||
url: '/ss/storeInvestor/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -11,7 +11,11 @@
|
|||
:size="size"
|
||||
:disabled="disabled"
|
||||
readonly
|
||||
:placeholder="placeholder"/>
|
||||
:placeholder="placeholder">
|
||||
<template #suffix>
|
||||
<i class="el-icon-arrow-right"/>
|
||||
</template>
|
||||
</el-input>
|
||||
<el-input
|
||||
v-else
|
||||
:value="inputBindValue"
|
||||
|
@ -21,7 +25,7 @@
|
|||
readonly
|
||||
:placeholder="placeholder">
|
||||
<template #suffix>
|
||||
<div class="input-suffix"></div>
|
||||
<dict-tag v-if="showType" :value="selected.map(item => item.type)" :options="dict.type.user_type" size="small" style="display: inline-block"/>
|
||||
<i class="el-icon-arrow-right"/>
|
||||
</template>
|
||||
</el-input>
|
||||
|
@ -43,6 +47,7 @@ import SmUserDialog from '@/components/Business/SmUser/smUserDialog.vue'
|
|||
|
||||
export default {
|
||||
name: 'UserInput',
|
||||
dicts: ['user_type'],
|
||||
components: { SmUserDialog },
|
||||
props:{
|
||||
// 标题
|
||||
|
@ -110,6 +115,11 @@ export default {
|
|||
return JSON.stringify(obj);
|
||||
}
|
||||
},
|
||||
// 是否展示用户角色
|
||||
showType: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -27,11 +27,14 @@
|
|||
<el-table-column align="center" type="selection" v-if="multiple"></el-table-column>
|
||||
<el-table-column label="#" type="index" align="center"></el-table-column>
|
||||
<el-table-column label="手机号" align="center" prop="phonenumber"></el-table-column>
|
||||
<el-table-column label="用户类型" align="center" prop="type" width="100">
|
||||
<el-table-column label="用户类型" align="center" prop="type" width="120">
|
||||
<dict-tag slot-scope="d" :options="dict.type.user_type" :value="d.row.type"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark"></el-table-column>
|
||||
<el-table-column label="用户名" align="center" prop="userName"></el-table-column>
|
||||
<el-table-column label="分成比例" align="center" prop="point">
|
||||
<template slot-scope="d">{{d.row.point | money | defaultValue}} %</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
:limit.sync="searchForm.pageSize"
|
||||
|
|
|
@ -106,9 +106,8 @@ export default {
|
|||
// 获取数据列表
|
||||
searchList() {
|
||||
this.loadTable = true;
|
||||
|
||||
if (this.userType === UserType.APP) {
|
||||
mchListStore().then(response => {
|
||||
mchListStore(this.searchForm).then(response => {
|
||||
this.tableData = response.rows;
|
||||
this.total = response.total;
|
||||
// 刷新表格状态
|
||||
|
@ -119,7 +118,7 @@ export default {
|
|||
this.loadTable = false;
|
||||
})
|
||||
} else {
|
||||
listStore.then(response => {
|
||||
listStore(this.searchForm).then(response => {
|
||||
this.tableData = response.rows;
|
||||
this.total = response.total;
|
||||
// 刷新表格状态
|
||||
|
|
|
@ -114,7 +114,7 @@ export const PayBillStatus = {
|
|||
// 用户类型
|
||||
export const SmUserType = {
|
||||
NORMAL: "1", // 普通用户
|
||||
SALE: "2", // 分销商
|
||||
SALE: "2", // 代理商
|
||||
BIZ: "3", // 业务员
|
||||
INVESTOR: "4", // 投资人
|
||||
BUSINESS_PLACE: "5", // 经营场所
|
||||
|
|
416
src/views/ss/bonus/index.vue
Normal file
416
src/views/ss/bonus/index.vue
Normal file
|
@ -0,0 +1,416 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="订单编号" prop="billNo" v-if="notHasView(views.recharge)">
|
||||
<el-input
|
||||
v-model="queryParams.billNo"
|
||||
placeholder="请输入订单编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.bonus_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方" prop="arrivalName">
|
||||
<el-input
|
||||
v-model="queryParams.arrivalName"
|
||||
placeholder="请输入收款方名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方类型" prop="arrivalType" label-width="6em">
|
||||
<el-select v-model="queryParams.arrivalType" placeholder="请选择收款方类型" clearable @change="handleQuery">
|
||||
<el-option
|
||||
v-for="dict in dict.type.bonus_arrival_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['ss:bonus:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="bonusList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'status'">
|
||||
<dict-tag :options="dict.type.bonus_status" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'arrivalType'">
|
||||
<dict-tag :options="dict.type.bonus_arrival_type" :value="d.row[column.key]"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'point'">
|
||||
{{d.row.point | money | defaultValue}} %
|
||||
</template>
|
||||
<template v-else-if="['amount', 'refundAmount'].includes(column.key)">
|
||||
{{d.row[column.key] | money | defaultValue}} 元
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key] | defaultValue}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||
<!-- <template slot-scope="scope">-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- @click="handleUpdate(scope.row)"-->
|
||||
<!-- v-hasPermi="['ss:bonus:edit']"-->
|
||||
<!-- >修改</el-button>-->
|
||||
<!-- <el-button-->
|
||||
<!-- size="mini"-->
|
||||
<!-- type="text"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- @click="handleDelete(scope.row)"-->
|
||||
<!-- v-hasPermi="['ss:bonus:remove']"-->
|
||||
<!-- >删除</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-table-column>-->
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改分成明细对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="订单ID" prop="billId">
|
||||
<el-input v-model="form.billId" placeholder="请输入订单ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单编号" prop="billNo">
|
||||
<el-input v-model="form.billNo" placeholder="请输入订单编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.bonus_status"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{dict.label}}</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方ID" prop="arrivalId">
|
||||
<el-input v-model="form.arrivalId" placeholder="请输入收款方ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分成方名称" prop="arrivalName">
|
||||
<el-input v-model="form.arrivalName" placeholder="请输入分成方名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="收款方类型" prop="arrivalType">
|
||||
<el-select v-model="form.arrivalType" placeholder="请选择收款方类型">
|
||||
<el-option
|
||||
v-for="dict in dict.type.bonus_arrival_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="分成比例" prop="point">
|
||||
<el-input v-model="form.point" placeholder="请输入分成比例" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分成金额" prop="amount">
|
||||
<el-input v-model="form.amount" placeholder="请输入分成金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="退款金额" prop="refundAmount">
|
||||
<el-input v-model="form.refundAmount" placeholder="请输入退款金额" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分成时间" prop="payTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.payTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择分成时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listBonus, getBonus, delBonus, addBonus, updateBonus } from "@/api/ss/bonus";
|
||||
import { $showColumns, $view } from '@/utils/mixins'
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "Bonus",
|
||||
mixins: [$showColumns, $view],
|
||||
dicts: ['bonus_status', 'bonus_arrival_type'],
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: true, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'billNo', visible: true, label: '订单编号', minWidth: null, sortable: true, overflow: false, align: 'center', width: "180"},
|
||||
{key: 'status', visible: true, label: '状态', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'arrivalName', visible: true, label: '收款方名称', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'arrivalType', visible: true, label: '收款方类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'point', visible: true, label: '分成比例', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'amount', visible: true, label: '分成金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'payTime', visible: true, label: '分成时间', minWidth: "120", sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'refundAmount', visible: true, label: '退款金额', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 分成明细表格数据
|
||||
bonusList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
id: null,
|
||||
billId: null,
|
||||
billNo: null,
|
||||
status: null,
|
||||
arrivalId: null,
|
||||
arrivalName: null,
|
||||
arrivalType: null,
|
||||
point: null,
|
||||
amount: null,
|
||||
refundAmount: null,
|
||||
ancestors: null,
|
||||
payTime: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
billId: [
|
||||
{ required: true, message: "订单ID不能为空", trigger: "blur" }
|
||||
],
|
||||
billNo: [
|
||||
{ required: true, message: "订单编号不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
],
|
||||
arrivalId: [
|
||||
{ required: true, message: "收款方ID不能为空", trigger: "blur" }
|
||||
],
|
||||
arrivalName: [
|
||||
{ required: true, message: "分成方名称不能为空", trigger: "blur" }
|
||||
],
|
||||
arrivalType: [
|
||||
{ required: true, message: "收款方类型不能为空", trigger: "change" }
|
||||
],
|
||||
point: [
|
||||
{ required: true, message: "分成比例不能为空", trigger: "blur" }
|
||||
],
|
||||
ancestors: [
|
||||
{ required: true, message: "收款方祖级列表不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...this.query
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询分成明细列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listBonus(this.queryParams).then(response => {
|
||||
this.bonusList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
billId: null,
|
||||
billNo: null,
|
||||
status: null,
|
||||
arrivalId: null,
|
||||
arrivalName: null,
|
||||
arrivalType: null,
|
||||
point: null,
|
||||
amount: null,
|
||||
refundAmount: null,
|
||||
ancestors: null,
|
||||
createTime: null,
|
||||
payTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加分成明细";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getBonus(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改分成明细";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateBonus(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addBonus(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除分成明细编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delBonus(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('ss/bonus/export', {
|
||||
...this.queryParams
|
||||
}, `bonus_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -52,17 +52,6 @@
|
|||
v-hasPermi="['ss:shareCode:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['ss:shareCode:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
|
@ -145,49 +134,30 @@
|
|||
<!-- 添加或修改推广码对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="推广码编号" prop="codeNo">
|
||||
<el-input v-model="form.codeNo" placeholder="请输入推广码编号" />
|
||||
<el-form-item label="创建人" prop="userId">
|
||||
<user-input
|
||||
v-model="form.userId"
|
||||
@change="onChangeCreator"
|
||||
:query="{types: [SmUserType.SALE, SmUserType.BIZ]}"
|
||||
show-type
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建人ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入创建人ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="推广的角色类型" prop="userType">
|
||||
<el-select v-model="form.userType" placeholder="请选择推广的角色类型">
|
||||
<el-form-item label="推广角色" prop="userType">
|
||||
<el-select v-model="form.userType" placeholder="请选择推广的角色类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.user_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
:disabled="disabledUserType(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="推广的分成比例%" prop="point">
|
||||
<el-input v-model="form.point" placeholder="请输入推广的分成比例%" />
|
||||
<el-form-item label="投资人" prop="investorId" v-if="form.userType === SmUserType.BUSINESS_PLACE">
|
||||
<user-input v-model="form.investorId" placeholder="请选择推广经营场所绑定的投资人" :query="{type: SmUserType.INVESTOR}" show-type/>
|
||||
</el-form-item>
|
||||
<el-form-item label="推广经营场所绑定的投资人ID" prop="investorId">
|
||||
<el-input v-model="form.investorId" placeholder="请输入推广经营场所绑定的投资人ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="推广码过期时间" prop="expireTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.expireTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择推广码过期时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用者ID" prop="useUserId">
|
||||
<el-input v-model="form.useUserId" placeholder="请输入使用者ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用者经营场所ID" prop="useStoreId">
|
||||
<el-input v-model="form.useStoreId" placeholder="请输入使用者经营场所ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="使用时间" prop="useTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.useTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择使用时间">
|
||||
</el-date-picker>
|
||||
<el-form-item label="分成比例" prop="point">
|
||||
<el-input-number v-model="form.point" placeholder="请输入分成比例" controls-position="right" :min="0" :max="100" :precision="2" style="width: calc(100% - 1.5em)"/> %
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -201,6 +171,8 @@
|
|||
<script>
|
||||
import { listShareCode, getShareCode, delShareCode, addShareCode, updateShareCode } from "@/api/ss/shareCode";
|
||||
import { $showColumns } from '@/utils/mixins';
|
||||
import UserInput from '@/components/Business/SmUser/UserInput.vue'
|
||||
import { SmUserType } from '@/utils/constants'
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
|
@ -210,10 +182,32 @@ const defaultSort = {
|
|||
|
||||
export default {
|
||||
name: "ShareCode",
|
||||
computed: {
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
},
|
||||
disabledUserType() {
|
||||
return (value) => {
|
||||
if (value === SmUserType.NORMAL) {
|
||||
return true;
|
||||
}
|
||||
// 代理商
|
||||
if (this.creatorUserType === SmUserType.SALE) {
|
||||
return ![SmUserType.SALE, SmUserType.BIZ].includes(value);
|
||||
}
|
||||
if (this.creatorUserType === SmUserType.BIZ) {
|
||||
return ![SmUserType.BIZ, SmUserType.BUSINESS_PLACE, SmUserType.INVESTOR].includes(value);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
components: { UserInput },
|
||||
mixins: [$showColumns],
|
||||
dicts: ['user_type'],
|
||||
data() {
|
||||
return {
|
||||
creatorUserType: null, // 创建者的用户类型
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'codeId', visible: true, label: '推广码ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
|
@ -268,24 +262,18 @@ export default {
|
|||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
codeNo: [
|
||||
{ required: true, message: "推广码编号不能为空", trigger: "blur" }
|
||||
],
|
||||
userId: [
|
||||
{ required: true, message: "创建人ID不能为空", trigger: "blur" }
|
||||
{ required: true, message: "创建人不能为空", trigger: "change" }
|
||||
],
|
||||
userType: [
|
||||
{ required: true, message: "推广的角色类型不能为空", trigger: "change" }
|
||||
{ required: true, message: "推广角色不能为空", trigger: "change" }
|
||||
],
|
||||
point: [
|
||||
{ required: true, message: "推广的分成比例%不能为空", trigger: "blur" }
|
||||
],
|
||||
createTime: [
|
||||
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||
],
|
||||
status: [
|
||||
{ required: true, message: "状态不能为空", trigger: "change" }
|
||||
{ required: true, type: 'number', message: "分成比例不能为空", trigger: "blur" }
|
||||
],
|
||||
investorId: [
|
||||
{ required: true, message: "投资人不能为空", trigger: "change" }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
|
@ -293,6 +281,12 @@ export default {
|
|||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
onChangeCreator(user) {
|
||||
this.creatorUserType = user.type;
|
||||
if (this.disabledUserType(this.form.userType)) {
|
||||
this.form.userType = null;
|
||||
}
|
||||
},
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
|
@ -355,12 +349,14 @@ export default {
|
|||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.creatorUserType = null;
|
||||
this.open = true;
|
||||
this.title = "添加推广码";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
this.creatorUserType = null;
|
||||
const codeId = row.codeId || this.ids
|
||||
getShareCode(codeId).then(response => {
|
||||
this.form = response.data;
|
||||
|
|
|
@ -101,6 +101,9 @@
|
|||
<el-tab-pane label="设备列表" :lazy="true">
|
||||
<device-list :store-id="store.storeId"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="分成详情" :lazy="true">
|
||||
<store-investor :query="{storeId: store.storeId}" :view="views.store"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="收入记录" :lazy="true">
|
||||
<recharge-list :store-id="store.storeId"/>
|
||||
</el-tab-pane>
|
||||
|
@ -109,8 +112,6 @@
|
|||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -123,6 +124,7 @@ import StoreRechargeReport from '@/views/ss/store/components/storeRechargeReport
|
|||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import StoreApply from '@/views/ss/storeApply/index.vue'
|
||||
import { views } from '@/utils/constants'
|
||||
import StoreInvestor from '@/views/ss/storeInvestor/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'storeDetail',
|
||||
|
@ -131,7 +133,7 @@ export default {
|
|||
return views
|
||||
}
|
||||
},
|
||||
components: { StoreApply, UserLink, StoreRechargeReport, RechargeList, DeviceList, PlaceSearchMap },
|
||||
components: { StoreInvestor, StoreApply, UserLink, StoreRechargeReport, RechargeList, DeviceList, PlaceSearchMap },
|
||||
dicts: ['ss_store_type', 'store_status'],
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -132,6 +132,9 @@
|
|||
<el-table-column label="上月收入" align="center" prop="lastMonthIncome" >
|
||||
<template slot-scope="d">{{d.row.lastMonthIncome | money | defaultValue}} 元</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额" align="center" prop="balance" >
|
||||
<template slot-scope="d">{{d.row.balance | money | defaultValue}} 元</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
|
@ -175,7 +178,7 @@
|
|||
<form-col label="经营场所图片" prop="picture" :span="span * 2">
|
||||
<image-upload v-model="form.picture" :limit="9"/>
|
||||
</form-col>
|
||||
<form-col label="所属用户" prop="userId" :span="span">
|
||||
<form-col label="负责人" prop="userId" :span="span">
|
||||
<user-input v-model="form.userId" :query="userQuery" :disabled="hasView(views.user)"/>
|
||||
</form-col>
|
||||
<form-col label="是否在地图展示" prop="show" :span="span" label-width="9em">
|
||||
|
@ -240,7 +243,7 @@ import SmUserSelect from '@/components/Business/SmUser/smUserSelect.vue'
|
|||
import UserInput from '@/components/Business/SmUser/UserInput.vue'
|
||||
import PlaceSearchDialog from '@/components/Map/PlaceSearch/PlaceSearchDialog.vue'
|
||||
import AreaTextSelect from '@/components/AreaTextSelect/index.vue'
|
||||
import { parseTime } from '../../../utils/ruoyi'
|
||||
import { parseTime } from '@/utils/ruoyi'
|
||||
import { $view } from '@/utils/mixins'
|
||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import StoreLink from '@/components/Business/Store/StoreLink.vue'
|
||||
|
|
345
src/views/ss/storeInvestor/index.vue
Normal file
345
src/views/ss/storeInvestor/index.vue
Normal file
|
@ -0,0 +1,345 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="经营场所" prop="storeName" v-if="notHasView(views.store)">
|
||||
<el-input
|
||||
v-model="queryParams.storeName"
|
||||
placeholder="请输入经营场所名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="投资人" prop="investorMobile" v-if="notHasView(views.user)">
|
||||
<el-input
|
||||
v-model="queryParams.investorMobile"
|
||||
placeholder="请输入投资人手机号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['ss:storeInvestor:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['ss:storeInvestor:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['ss:storeInvestor:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="storeInvestorList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="onSortChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<template v-for="column of showColumns">
|
||||
<el-table-column
|
||||
:key="column.key"
|
||||
:label="column.label"
|
||||
:prop="column.key"
|
||||
:align="column.align"
|
||||
:min-width="column.minWidth"
|
||||
:sort-orders="orderSorts"
|
||||
:sortable="column.sortable"
|
||||
:show-overflow-tooltip="column.overflow"
|
||||
:width="column.width"
|
||||
>
|
||||
<template slot-scope="d">
|
||||
<template v-if="column.key === 'id'">
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
<template v-else-if="column.key === 'investorMobile'">
|
||||
<user-link :id="d.row.investorId" :name="d.row.investorMobile"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'storeName'">
|
||||
<store-link :id="d.row.storeId" :name="d.row.storeName"/>
|
||||
</template>
|
||||
<template v-else-if="column.key === 'point'">
|
||||
{{d.row.point | money | defaultValue}} %
|
||||
</template>
|
||||
<template v-else>
|
||||
{{d.row[column.key]}}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['ss:storeInvestor:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['ss:storeInvestor:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改经营场所投资人关联对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="投资人" prop="investorId">
|
||||
<user-input v-model="form.investorId" :disabled="hasView(views.user)" :query="{type: SmUserType.INVESTOR}"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="经营场所" prop="storeId">
|
||||
<store-input v-model="form.storeId" :disabled="hasView(views.store)"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="经营场所分成比例" prop="point" label-width="10em">
|
||||
<el-input-number v-model="form.point" placeholder="请输入经营场所分成比例" :min="0" :max="100" :precision="2" style="width: calc(100% - 1.5em)"/> %
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listStoreInvestor, getStoreInvestor, delStoreInvestor, addStoreInvestor, updateStoreInvestor } from "@/api/ss/storeInvestor";
|
||||
import { $showColumns, $view } from '@/utils/mixins'
|
||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import StoreLink from '@/components/Business/Store/StoreLink.vue'
|
||||
import UserInput from '@/components/Business/SmUser/UserInput.vue'
|
||||
import StoreInput from '@/components/Business/Store/StoreInput.vue'
|
||||
import { SmUserType } from '@/utils/constants'
|
||||
|
||||
// 默认排序字段
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
order: "descending"
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "StoreInvestor",
|
||||
computed: {
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
}
|
||||
},
|
||||
mixins: [$showColumns, $view],
|
||||
components: { StoreInput, UserInput, StoreLink, UserLink },
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 字段列表
|
||||
columns: [
|
||||
{key: 'id', visible: false, label: 'ID', minWidth: null, sortable: true, overflow: false, align: 'center', width: "80"},
|
||||
{key: 'investorMobile', visible: true, label: '投资人', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'storeName', visible: true, label: '经营场所', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'point', visible: true, label: '经营场所分成比例', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
],
|
||||
// 排序方式
|
||||
orderSorts: ['ascending', 'descending', null],
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 经营场所投资人关联表格数据
|
||||
storeInvestorList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
defaultSort,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderByColumn: defaultSort.prop,
|
||||
isAsc: defaultSort.order,
|
||||
id: null,
|
||||
storeId: null,
|
||||
investorId: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
storeId: [
|
||||
{ required: true, message: "经营场所不能为空", trigger: "change" }
|
||||
],
|
||||
investorId: [
|
||||
{ required: true, message: "投资人不能为空", trigger: "change" }
|
||||
],
|
||||
point: [
|
||||
{ required: true, message: "经营场所分成比例不能为空", trigger: "blur" }
|
||||
],
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...this.query
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 当排序按钮被点击时触发 **/
|
||||
onSortChange(column) {
|
||||
if (column.order == null) {
|
||||
this.queryParams.orderByColumn = defaultSort.prop;
|
||||
this.queryParams.isAsc = defaultSort.order;
|
||||
} else {
|
||||
this.queryParams.orderByColumn = column.prop;
|
||||
this.queryParams.isAsc = column.order;
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
/** 查询经营场所投资人关联列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listStoreInvestor(this.queryParams).then(response => {
|
||||
this.storeInvestorList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
storeId: null,
|
||||
investorId: this.query.investorId,
|
||||
point: null,
|
||||
createTime: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加经营场所投资人关联";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getStoreInvestor(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改经营场所投资人关联";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateStoreInvestor(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addStoreInvestor(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除经营场所投资人关联编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delStoreInvestor(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('ss/storeInvestor/export', {
|
||||
...this.queryParams
|
||||
}, `storeInvestor_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -87,21 +87,27 @@
|
|||
<el-table v-loading="loading" :data="suitList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="编号" align="center" prop="suitId" width="80"/>
|
||||
<el-table-column label="名称" align="center" prop="name" width="100"/>
|
||||
<el-table-column label="收费模式" align="center" prop="feeMode">
|
||||
<dict-tag slot-scope="d" :value="d.row.feeMode" :options="dict.type.suit_fee_mode"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="收费类型" align="center" prop="feeType" width="160">
|
||||
<dict-tag slot-scope="d" :value="d.row.feeType" :options="dict.type.suit_fee_type"/>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格/押金" align="center" prop="price" width="100">
|
||||
<el-table-column label="名称" align="center" prop="name" width="200"/>
|
||||
<!-- <el-table-column label="收费模式" align="center" prop="feeMode">-->
|
||||
<!-- <dict-tag slot-scope="d" :value="d.row.feeMode" :options="dict.type.suit_fee_mode"/>-->
|
||||
<!-- </el-table-column>-->
|
||||
<!-- <el-table-column label="收费类型" align="center" prop="feeType" width="160">-->
|
||||
<!-- <dict-tag slot-scope="d" :value="d.row.feeType" :options="dict.type.suit_fee_type"/>-->
|
||||
<!-- </el-table-column>-->
|
||||
<el-table-column label="价格" align="center" prop="price" width="100">
|
||||
<template slot-scope="d">{{d.row.price | money}} 元</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="通电时长" align="center" prop="price" width="100">
|
||||
<template slot-scope="d">{{d.row.value}} {{suitTimeUnit(d.row.timeUnit)}}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详细说明" align="center" prop="description" show-overflow-tooltip min-width="300"/>
|
||||
<el-table-column label="是否启用" align="center" prop="enabled">
|
||||
<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">
|
||||
<template slot-scope="d">{{d.row.totalCount}} 次</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
|
||||
|
@ -140,27 +146,27 @@
|
|||
<form-col :span="span" label="套餐名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入套餐名称" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="收费模式" prop="feeMode" >
|
||||
<el-select v-model="form.feeMode" style="width: 100%" @change="onChangeFeeMode">
|
||||
<el-option
|
||||
v-for="option of dict.type.suit_fee_mode"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<form-col :span="span" label="收费方式" prop="feeType">
|
||||
<el-select v-model="form.feeType" style="width: 100%">
|
||||
<el-option
|
||||
v-for="option of dict.type.suit_fee_type"
|
||||
:key="option.value"
|
||||
:label="option.label"
|
||||
:value="option.value"
|
||||
:disabled="disabledFeeType(option)"
|
||||
/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<!-- <form-col :span="span" label="收费模式" prop="feeMode" >-->
|
||||
<!-- <el-select v-model="form.feeMode" style="width: 100%" @change="onChangeFeeMode">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="option of dict.type.suit_fee_mode"-->
|
||||
<!-- :key="option.value"-->
|
||||
<!-- :label="option.label"-->
|
||||
<!-- :value="option.value"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </form-col>-->
|
||||
<!-- <form-col :span="span" label="收费方式" prop="feeType">-->
|
||||
<!-- <el-select v-model="form.feeType" style="width: 100%">-->
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="option of dict.type.suit_fee_type"-->
|
||||
<!-- :key="option.value"-->
|
||||
<!-- :label="option.label"-->
|
||||
<!-- :value="option.value"-->
|
||||
<!-- :disabled="disabledFeeType(option)"-->
|
||||
<!-- />-->
|
||||
<!-- </el-select>-->
|
||||
<!-- </form-col>-->
|
||||
<form-col :span="span" label="价格" prop="price" v-if="[SuitFeeType.TIMING, SuitFeeType.COUNT].includes(form.feeType)">
|
||||
<el-input-number v-model="form.price" placeholder="请输入价格(元)" :min="0" :precision="2" controls-position="right" style="width: calc(100% - 2em)"/> 元
|
||||
</form-col>
|
||||
|
@ -211,9 +217,12 @@
|
|||
</el-col>
|
||||
</el-row>
|
||||
</form-col>
|
||||
<!-- <form-col :span="span * 2" label="应用设备" prop="deviceIds">-->
|
||||
<!-- <device-input v-model="form.deviceIds" multiple :before-open="beforeOpenDevice" :query="deviceQuery"/>-->
|
||||
<!-- </form-col>-->
|
||||
<form-col :span="span" label="启用自定义使用率" prop="enableCustomUse" label-width="9em">
|
||||
<el-switch v-model="form.enableCustomUse"/>
|
||||
</form-col>
|
||||
<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>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
|
@ -251,12 +260,6 @@ export default {
|
|||
return findLabel(this.dict.type.time_unit, unit);
|
||||
}
|
||||
},
|
||||
// 设备查询条件
|
||||
deviceQuery() {
|
||||
return {
|
||||
userId: this.form.userId
|
||||
}
|
||||
},
|
||||
// 收费方式禁用的情况:单次收费,不支持分时段
|
||||
disabledFeeType() {
|
||||
return (option) => {
|
||||
|
@ -407,19 +410,6 @@ export default {
|
|||
this.amountIndex = index;
|
||||
}
|
||||
},
|
||||
onChangeUser(nv) {
|
||||
if (!isEmpty(this.form.deviceIds)) {
|
||||
this.$message.info("由于切换了用户,请重新选择应用设备")
|
||||
this.form.deviceIds = []
|
||||
}
|
||||
},
|
||||
beforeOpenDevice() {
|
||||
if (this.form.userId == null) {
|
||||
this.$message.warning("请先选择所属用户");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
/** 查询套餐列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
|
@ -443,14 +433,14 @@ export default {
|
|||
value: null,
|
||||
price: null,
|
||||
description: null,
|
||||
timeUnit: "3",
|
||||
deviceIds: this.query.deviceId ? [this.query.deviceId] : [],
|
||||
timeUnit: "2",
|
||||
feeType: "1",
|
||||
feeMode: "1",
|
||||
gearAmount: [0,0,0,0],
|
||||
gearTime: [],
|
||||
deptId: this.deptId,
|
||||
sort: 0,
|
||||
enableCustomUse: false,
|
||||
};
|
||||
if (this.$refs.form) {
|
||||
this.$refs.form.clearValidate();
|
||||
|
@ -486,7 +476,6 @@ export default {
|
|||
const suitId = row.suitId || this.ids
|
||||
getSuit(suitId).then(response => {
|
||||
let data = response.data;
|
||||
data.deviceIds = data.deviceList.map(item => item.deviceId);
|
||||
this.form = data;
|
||||
this.open = true;
|
||||
this.title = "修改套餐";
|
||||
|
|
|
@ -91,11 +91,11 @@
|
|||
|
||||
<el-card class="box-card">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="套餐列表" :lazy="true">
|
||||
<suit v-if="deviceData.deviceId != null" :view="views.device" :query="{deviceId: deviceData.deviceId}"/>
|
||||
</el-tab-pane>
|
||||
<!-- <el-tab-pane label="套餐列表" :lazy="true">-->
|
||||
<!-- <suit v-if="deviceData.deviceId != null" :view="views.device" :query="{deviceId: deviceData.deviceId}"/>-->
|
||||
<!-- </el-tab-pane>-->
|
||||
<el-tab-pane label="用户充值记录" :lazy="true">
|
||||
<recharge-record :device-id="deviceData.deviceId"/>
|
||||
<recharge-record v-if="deviceData.deviceId != null" :device-id="deviceData.deviceId"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="时长变化记录" :lazy="true">
|
||||
<record-time :query="{deviceId: deviceData.deviceId}" view="device"/>
|
||||
|
|
|
@ -223,7 +223,7 @@
|
|||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="6em">
|
||||
<el-row :gutter="gutter">
|
||||
<form-col :span="span" label="自定义图片" prop="customPicture">
|
||||
<form-col :span="span * 2" label="自定义图片" prop="customPicture">
|
||||
<image-upload v-model="form.customPicture" :limit="1"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="型号" prop="modelId">
|
||||
|
@ -238,17 +238,29 @@
|
|||
<form-col :span="span" label="设备名称" prop="deviceName">
|
||||
<el-input v-model="form.deviceName" placeholder="请输入设备名称" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="所属分销商" prop="saleId">
|
||||
<user-input v-model="form.saleId"/>
|
||||
<form-col :span="span" label="所属代理商" prop="agentId">
|
||||
<user-input v-model="form.agentId" :query="{type: SmUserType.SALE}" @change="onChangeSale"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="投资人" prop="userId">
|
||||
<user-input v-model="form.userId"/>
|
||||
<user-input v-model="form.userId" :before-open="beforeOpenUser" :query="userQuery" @change="onChangeInvestor"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="经营场所" prop="storeId">
|
||||
<store-input v-model="form.storeId"/>
|
||||
<store-input v-model="form.storeId" :before-open="beforeOpenStore" :query="storeQuery"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="尺寸" prop="size">
|
||||
<el-input v-model="form.size" placeholder="请输入尺寸" maxlength="200" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="面料" prop="fabric">
|
||||
<el-input v-model="form.fabric" placeholder="请输入面料" maxlength="200" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="填充物" prop="fill">
|
||||
<el-input v-model="form.fill" placeholder="请输入填充物" maxlength="200" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="所属房间" prop="room">
|
||||
<el-input v-model="form.room" placeholder="请输入所属房间" maxlength="200" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span * 2" label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" maxlength="200" show-word-limit/>
|
||||
</form-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
|
@ -289,13 +301,22 @@ import ModelDialog from '@/components/Business/Model/modelDialog.vue'
|
|||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import StoreLink from '@/components/Business/Store/StoreLink.vue'
|
||||
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
|
||||
import { $serviceType } from '@/utils/mixins'
|
||||
import { $serviceType, $view } from '@/utils/mixins'
|
||||
import { SmUserType } from '@/utils/constants'
|
||||
|
||||
export default {
|
||||
name: "Device",
|
||||
mixins: [$serviceType],
|
||||
components: { DeviceLink, StoreLink, UserLink, ModelDialog, UserInput, StoreInput, SnInput, QrCode, SmUserSelect, ModelSelect},
|
||||
mixins: [$serviceType, $view],
|
||||
dicts: ['sm_device_online_status', 'sm_device_status', 'sm_device_outage_way','sm_device_notice_way', 'service_type', 'time_unit'],
|
||||
components: { DeviceLink, StoreLink, UserLink, ModelDialog, UserInput, StoreInput, SnInput, QrCode, SmUserSelect, ModelSelect},
|
||||
props: {
|
||||
query: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 是否展示选择型号弹窗
|
||||
|
@ -357,6 +378,9 @@ export default {
|
|||
};
|
||||
},
|
||||
computed: {
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
},
|
||||
isEdit() {
|
||||
return this.title === "修改设备";
|
||||
},
|
||||
|
@ -366,15 +390,55 @@ export default {
|
|||
return getWxIndexUrl({ s: device.deviceNo});
|
||||
}
|
||||
},
|
||||
// 投资人查询条件
|
||||
userQuery() {
|
||||
return {
|
||||
type: SmUserType.INVESTOR,
|
||||
ancestorId: this.form.agentId
|
||||
}
|
||||
},
|
||||
// 店铺查询条件
|
||||
storeQuery() {
|
||||
return {
|
||||
investorId: this.form.userId
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.queryParams = {
|
||||
...this.queryParams,
|
||||
...this.query,
|
||||
...this.$route.query
|
||||
}
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
onChangeSale(user) {
|
||||
if (this.form.userId != null) {
|
||||
this.form.userId = null;
|
||||
this.$message.info("由于更改了代理商,请重新选择投资人")
|
||||
}
|
||||
},
|
||||
onChangeInvestor(user) {
|
||||
if (this.form.storeId != null) {
|
||||
this.form.storeId = null;
|
||||
this.$message.info("由于更改了投资人,请重新选择经营场所")
|
||||
}
|
||||
},
|
||||
beforeOpenStore() {
|
||||
if (this.form.userId == null) {
|
||||
this.$message.warning("请先选择投资人");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
beforeOpenUser() {
|
||||
if (this.form.agentId == null) {
|
||||
this.$message.warning("请先选择所属代理商");
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 选中型号后
|
||||
onSubmitBatchModel(model) {
|
||||
if (model == null) {
|
||||
|
|
|
@ -1,34 +1,34 @@
|
|||
<template>
|
||||
<div class="app-container" v-loading="loading">
|
||||
<el-row :gutter="12">
|
||||
<el-col :span="18">
|
||||
<el-card class="box-card">
|
||||
<el-descriptions title="基本信息">
|
||||
<el-descriptions-item label="订单编号">{{detail.billNo | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="交易状态" :span="2">
|
||||
<el-descriptions-item label="交易状态">
|
||||
<dict-tag :value="detail.status" :options="dict.type.sm_transaction_bill_status" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="交易金额">{{detail.money | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="收款人到账金额">{{detail.arrivalAmount | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="手续费">{{detail.serviceCharge | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="平台渠道成本">{{detail.channelCost | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="平台利润">{{detail.serviceCharge - detail.channelCost | money | defaultValue}} 元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<el-descriptions title="设备套餐信息">
|
||||
<el-descriptions-item label="设备编号">
|
||||
<device-link :id="detail.deviceId" :text="detail.deviceNo"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="设备名称">
|
||||
<device-link :id="detail.deviceId" :text="detail.deviceName"/>
|
||||
</el-descriptions-item>
|
||||
|
||||
<el-descriptions-item label="经营场所">
|
||||
<store-link :id="detail.storeId" :name="detail.storeName"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="经营场所地址">
|
||||
{{detail.storeAddress | defaultValue}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="房间号">
|
||||
{{detail.deviceRoom | defaultValue}}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
<el-card class="box-card">
|
||||
<el-descriptions title="套餐信息">
|
||||
<el-descriptions-item label="套餐名称">{{detail.suitName | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐计费模式">
|
||||
<dict-tag :value="detail.suitFeeMode" :options="dict.type.suit_fee_mode" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐计费类型">
|
||||
<dict-tag :value="detail.suitFeeType" :options="dict.type.suit_fee_type" size="small"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐时长" v-if="detail.suitFeeType === SuitFeeType.TIMING">{{detail.suitTime | defaultValue}} {{suitTimeUnit(detail.suitTimeUnit)}}</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐电量" v-if="detail.suitFeeType === SuitFeeType.COUNT">{{detail.suitTime | defaultValue}} 度</el-descriptions-item>
|
||||
<el-descriptions-item label="设备充值状态" v-if="[SuitFeeType.TIMING, SuitFeeType.COUNT].includes(detail.suitFeeType)">
|
||||
|
@ -39,16 +39,12 @@
|
|||
<el-descriptions-item label="套餐开始时间">{{detail.suitStartTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐结束时间">{{detail.suitEndTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐失效时间">{{detail.suitExpireTime | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐开始使用时设备总用电量">{{detail.suitStartEle | defaultValue}} 度</el-descriptions-item>
|
||||
<el-descriptions-item label="套餐结束使用时设备总用电量">{{detail.suitEndEle | defaultValue}} 度</el-descriptions-item>
|
||||
<el-descriptions-item label="当前设备总用电量" v-if="[SuitFeeType.TIME_COUNT].includes(detail.suitFeeType)">
|
||||
{{detail.deviceTotalEle | money | defaultValue}} 度
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-card class="box-card">
|
||||
<el-descriptions title="支付方信息">
|
||||
<el-descriptions title="支付方信息" :column="1">
|
||||
<el-descriptions-item label="用户名称">
|
||||
<user-link :id="detail.userId" :name="detail.userName"/>
|
||||
</el-descriptions-item>
|
||||
|
@ -58,26 +54,17 @@
|
|||
<el-descriptions-item label="支付时间">{{detail.payTime | defaultValue}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<el-descriptions title="收款方信息">
|
||||
<el-descriptions-item label="收款人">{{detail.mchName | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="收款人手机号">{{detail.mchMobile | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="经营场所名称">{{detail.storeName | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="经营场所地址">{{detail.storeAddress | defaultValue}}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
<el-descriptions>
|
||||
<el-descriptions-item label="总计退款金额">{{detail.refundAmount | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="商户总计退款金额">{{detail.refundMchAmount | money | defaultValue}} 元</el-descriptions-item>
|
||||
<el-descriptions-item label="服务费总计退款金额">{{detail.refundServiceAmount | money | defaultValue}} 元</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-card class="box-card">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="支付信息" lazy>
|
||||
<pay-bill v-if="detail.billId != null" :query="{bstId: detail.billId}" :view="views.recharge"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="分成信息" lazy>
|
||||
<bonus :query="{billId: detail.billId}" :view="views.recharge"/>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</div>
|
||||
|
@ -91,10 +78,12 @@ import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
|
|||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import { SuitFeeType, views } from '@/utils/constants'
|
||||
import PayBill from '@/views/ss/payBill/index.vue'
|
||||
import StoreLink from '@/components/Business/Store/StoreLink.vue'
|
||||
import Bonus from '@/views/ss/bonus/index.vue'
|
||||
|
||||
export default {
|
||||
name: 'RechargeDetail',
|
||||
components: { PayBill, UserLink, DeviceLink, Refund },
|
||||
components: { Bonus, StoreLink, PayBill, UserLink, DeviceLink, Refund },
|
||||
dicts: ['channel_type','sm_transaction_bill_status', 'sm_transaction_bill_device_recharge_status', 'time_unit', 'suit_fee_mode', 'suit_fee_type'],
|
||||
computed: {
|
||||
views() {
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
<div class="user-header">
|
||||
<el-avatar :size="64" :src="userData.avatar"></el-avatar>
|
||||
<el-row type="flex" class="name-box">
|
||||
<span class="user-name">{{userData.nickName}}</span>
|
||||
<el-tag type="primary" v-if="userData.isMch">商户</el-tag>
|
||||
<span class="user-name">{{userData.userName}}</span>
|
||||
<dict-tag :options="dict.type.user_type" :value="userData.type"/>
|
||||
</el-row>
|
||||
<div class="phone-number">{{userData.phonenumber}}</div>
|
||||
</div>
|
||||
|
@ -17,7 +17,8 @@
|
|||
<div class="user-description">
|
||||
<el-descriptions :column="2">
|
||||
<el-descriptions-item label="微信" :span="2">{{userData.wxOpenId | defaultValue}}</el-descriptions-item>
|
||||
<el-descriptions-item label="经营场所数">{{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="设备数">{{userData.deviceCount | defaultValue}} 台</el-descriptions-item>
|
||||
<el-descriptions-item label="设备服务费">
|
||||
<template v-if="userData.serviceRate == null || userData.serviceType == null">跟随渠道</template>
|
||||
|
@ -51,17 +52,20 @@
|
|||
|
||||
<el-card class="box-card">
|
||||
<el-tabs>
|
||||
<el-tab-pane label="设备列表" lazy>
|
||||
<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>
|
||||
<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}"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="经营场所列表" lazy v-if="userData.type === SmUserType.BUSINESS_PLACE">
|
||||
<store :query="{userId: userData.userId}" :view="views.user"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="套餐列表" lazy>
|
||||
<suit :query="{userId: userData.userId}" :view="views.user"/>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="账户列表" lazy>
|
||||
<account :query="{userId: userData.userId}" :view="views.user"/>
|
||||
<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"/>
|
||||
|
@ -91,13 +95,23 @@ import Store from '@/views/ss/store/index.vue'
|
|||
import RecordBalance from '@/views/ss/recordBalance/index.vue'
|
||||
import Account from '@/views/ss/account/index.vue'
|
||||
import Suit from '@/views/ss/suit/index.vue'
|
||||
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'
|
||||
|
||||
export default {
|
||||
name: 'User/:userId',
|
||||
mixins: [$view, $serviceType],
|
||||
components: { Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
||||
components: { StoreInvestor, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||
dicts: ['service_type', 'withdraw_service_type', 'user_type'],
|
||||
computed: {
|
||||
SmUser() {
|
||||
return SmUser
|
||||
},
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
},
|
||||
serviceUnit() {
|
||||
return (type) => {
|
||||
return type === '2' ? '元' : '%';
|
||||
|
|
|
@ -178,11 +178,21 @@
|
|||
<form-col :span="span" label="头像">
|
||||
<image-upload v-model="form.avatar" :limit="1"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="部门" prop="deptId" v-if="type === SmUserType.SALE">
|
||||
<form-col :span="span" label="用户类型" prop="type">
|
||||
<el-select v-model="form.type" placeholder="请选择用户类型" style="width: 100%">
|
||||
<el-option
|
||||
v-for="dict in dict.type.user_type"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</form-col>
|
||||
<form-col :span="span" label="部门" prop="deptId" v-if="form.type === SmUserType.SALE">
|
||||
<dept-tree-select v-model="form.deptId"/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="推广人" prop="referenceId" v-if="type !== SmUserType.SALE">
|
||||
<user-input v-model="form.referenceId" @change="onChangeReference"/>
|
||||
<form-col :span="span" label="推广人" prop="referenceId" v-if="![SmUserType.NORMAL, SmUserType.BUSINESS_PLACE].includes(form.type)">
|
||||
<user-input v-model="form.referenceId" @change="onChangeReference" show-type :query="referenceQuery" />
|
||||
</form-col>
|
||||
<form-col :span="span" label="用户名" prop="userName">
|
||||
<el-input v-model="form.userName" placeholder="请输入用户名" />
|
||||
|
@ -193,7 +203,7 @@
|
|||
<form-col :span="span" label="密码" prop="password">
|
||||
<el-input v-model="form.password" placeholder="请输入密码" type="password" :maxlength="32" show-word-limit/>
|
||||
</form-col>
|
||||
<form-col :span="span" label="分成比例" prop="point">
|
||||
<form-col :span="span" label="分成比例" prop="point" v-if="![SmUserType.NORMAL, SmUserType.BUSINESS_PLACE].includes(form.type)">
|
||||
<el-input-number v-model="form.point" placeholder="请输入分成比例" :precision="2" controls-position="right" :min="0" style="width: calc(100% - 1.5em)"/> %
|
||||
</form-col>
|
||||
<form-col :span="span * 2" label="备注" prop="remark">
|
||||
|
@ -215,15 +225,14 @@ import {
|
|||
getSmUser,
|
||||
addSmUser,
|
||||
updateSmUser,
|
||||
delSmUser,
|
||||
updateServiceRate,
|
||||
resetSmUserService
|
||||
delSmUser
|
||||
} from '@/api/system/smUser'
|
||||
import { $serviceType, $showColumns, $withdrawServiceType } from '@/utils/mixins'
|
||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||
import UserInput from '@/components/Business/SmUser/UserInput.vue'
|
||||
import DeptTreeSelect from '@/components/Business/Dept/DeptTreeSelect.vue'
|
||||
import { SmUserType, UserType } from '@/utils/constants'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
const defaultSort = {
|
||||
prop: "createTime",
|
||||
|
@ -232,14 +241,42 @@ const defaultSort = {
|
|||
|
||||
export default {
|
||||
name: "SmUser",
|
||||
mixins: [$showColumns, $serviceType, $withdrawServiceType],
|
||||
dicts: ['sm_user_status', 'user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
|
||||
components: { DeptTreeSelect, UserInput, UserLink },
|
||||
computed: {
|
||||
...mapGetters(['deptId']),
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
},
|
||||
// 推广人查询条件
|
||||
referenceQuery() {
|
||||
if (this.type === SmUserType.SALE) {
|
||||
return {type: SmUserType.SALE, excludeId: this.form.userId}
|
||||
}
|
||||
if (this.type === SmUserType.BIZ) {
|
||||
return {types: [SmUserType.SALE, SmUserType.BIZ], excludeId: this.form.userId}
|
||||
}
|
||||
return {type: SmUserType.BIZ, excludeId: this.form.userId}
|
||||
},
|
||||
rules() {
|
||||
return {
|
||||
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
|
||||
phonenumber: [{ required: true, message: '请输入手机号', trigger: 'blur' },
|
||||
{ pattern: /^1(3|4|5|7|8|9)\d{9}$/, message: '手机号格式错误', trigger: 'blur' }
|
||||
],
|
||||
referenceId: [
|
||||
{required: this.form.type !== SmUserType.SALE, message: '请选择推广人', trigger: 'blur' }
|
||||
],
|
||||
deptId: [
|
||||
{required: true,message: '请选择部门', trigger: 'blur' }
|
||||
],
|
||||
point: [
|
||||
{ required: true, type: 'number', message: "分成比例不能为空", trigger: "blur" },
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
mixins: [$showColumns, $serviceType, $withdrawServiceType],
|
||||
components: { DeptTreeSelect, UserInput, UserLink },
|
||||
dicts: ['sm_user_status', 'user_type', 'sys_user_sex', 'service_type', 'withdraw_service_type'],
|
||||
data() {
|
||||
return {
|
||||
defaultSort,
|
||||
|
@ -248,7 +285,7 @@ export default {
|
|||
columns: [
|
||||
{key: 'userId', visible: true, label: '用户ID', align: 'center', minWidth: "80", sortable: true},
|
||||
{key: 'phonenumber', visible: true, label: '手机号码', align: 'center', minWidth: null, sortable: true},
|
||||
{key: 'userName', visible: false, 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: 'referenceMobile', visible: true, label: '推广人', align: 'center', minWidth: null, sortable: true},
|
||||
{key: 'remark', visible: true, label: '备注', align: 'center', minWidth: null, sortable: false, overflow: true},
|
||||
|
@ -292,19 +329,6 @@ export default {
|
|||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
userName: [{ required: true, message: '请输入用户名称', trigger: 'blur' }],
|
||||
phonenumber: [{ required: true, message: '请输入手机号', trigger: 'blur' },
|
||||
{ pattern: /^1(3|4|5|7|8|9)\d{9}$/, message: '手机号格式错误', trigger: 'blur' }
|
||||
],
|
||||
referenceId: [
|
||||
{required: true,message: '请选择推广人', trigger: 'blur' }
|
||||
],
|
||||
deptId: [
|
||||
{required: true,message: '请选择部门', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
@ -362,7 +386,9 @@ export default {
|
|||
isMch: false,
|
||||
deviceAdmin: false,
|
||||
serviceType: '1',
|
||||
type: this.type
|
||||
type: this.type,
|
||||
deptId: this.deptId,
|
||||
point: 0,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user