绑定代理商、商户
This commit is contained in:
parent
9c8c32ccee
commit
c07f7e6c45
|
@ -136,7 +136,7 @@ export function switchDevice(deviceId, open) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// 强制解绑设备
|
// 强制解绑设备商户
|
||||||
export function unbind(deviceId) {
|
export function unbind(deviceId) {
|
||||||
return request({
|
return request({
|
||||||
url: `/system/device/${deviceId}/unbind`,
|
url: `/system/device/${deviceId}/unbind`,
|
||||||
|
@ -144,6 +144,37 @@ export function unbind(deviceId) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 绑定设备商户
|
||||||
|
export function bindMch(deviceId, mchId) {
|
||||||
|
return request({
|
||||||
|
url: `/system/device/${deviceId}/bindMch`,
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
mchId
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 绑定设备代理商
|
||||||
|
export function bindAgent(deviceId, agentId, agentServiceRate) {
|
||||||
|
return request({
|
||||||
|
url: `/system/device/${deviceId}/bindAgent`,
|
||||||
|
method: 'put',
|
||||||
|
params: {
|
||||||
|
agentId,
|
||||||
|
agentServiceRate
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 强制解绑设备代理商
|
||||||
|
export function unbindAgent(deviceId) {
|
||||||
|
return request({
|
||||||
|
url: `/system/device/${deviceId}/unbindAgent`,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 更新设备服务费
|
// 更新设备服务费
|
||||||
export function updateDeviceServiceRate(deviceId, serviceRate) {
|
export function updateDeviceServiceRate(deviceId, serviceRate) {
|
||||||
return request({
|
return request({
|
||||||
|
|
|
@ -139,6 +139,15 @@ export default {
|
||||||
color: '#31d697',
|
color: '#31d697',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
}, {
|
||||||
|
name: '订单手机号收入(元)',
|
||||||
|
type: 'line',
|
||||||
|
data: this.getChartData(this.billData, 'billMobileAmount'),
|
||||||
|
itemStyle: {
|
||||||
|
normal: {
|
||||||
|
color: '#d6316b',
|
||||||
|
}
|
||||||
|
},
|
||||||
}, {
|
}, {
|
||||||
name: '渠道成本(元)',
|
name: '渠道成本(元)',
|
||||||
type: 'line',
|
type: 'line',
|
||||||
|
|
|
@ -182,7 +182,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listReceiveBill, getReceiveBill, delReceiveBill, addReceiveBill, updateReceiveBill } from "@/api/ss/receiveBill";
|
import { listReceiveBill, getReceiveBill, delReceiveBill, addReceiveBill, updateReceiveBill } from "@/api/ss/receiveBill";
|
||||||
import { $showColumns } from '@/utils/mixins';
|
import { $showColumns, $view } from '@/utils/mixins'
|
||||||
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||||
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
|
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
|
||||||
import { parseTime } from '../../../utils/ruoyi'
|
import { parseTime } from '../../../utils/ruoyi'
|
||||||
|
@ -196,8 +196,16 @@ const defaultSort = {
|
||||||
export default {
|
export default {
|
||||||
name: "ReceiveBill",
|
name: "ReceiveBill",
|
||||||
components: { DeviceLink, UserLink },
|
components: { DeviceLink, UserLink },
|
||||||
mixins: [$showColumns],
|
mixins: [$showColumns, $view],
|
||||||
dicts: ['receive_bill_type', 'receive_bill_status'],
|
dicts: ['receive_bill_type', 'receive_bill_status'],
|
||||||
|
props: {
|
||||||
|
query: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 字段列表
|
// 字段列表
|
||||||
|
@ -275,6 +283,10 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
this.queryParams = {
|
||||||
|
...this.queryParams,
|
||||||
|
...this.query
|
||||||
|
}
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
355
src/views/system/bindRecord/index.vue
Normal file
355
src/views/system/bindRecord/index.vue
Normal file
|
@ -0,0 +1,355 @@
|
||||||
|
<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="设备SN" prop="deviceNo" v-if="notHasView(views.device)">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.deviceNo"
|
||||||
|
placeholder="请输入设备SN"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户名称" prop="userName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.userName"
|
||||||
|
placeholder="请输入用户名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-select v-model="queryParams.type" placeholder="请选择类型" clearable @change="handleQuery">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.device_bind_record_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户类型" prop="userType">
|
||||||
|
<el-select v-model="queryParams.userType" placeholder="请选择用户类型" clearable @change="handleQuery">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.device_bind_record_user_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="['system:record:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="recordList" @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 === 'recordId'">
|
||||||
|
{{d.row[column.key]}}
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'deviceId'">
|
||||||
|
<device-link :id="d.row.deviceId" :text="d.row.deviceNo"/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'userId'">
|
||||||
|
<user-link :id="d.row.userId" :name="d.row.userName"/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'type'">
|
||||||
|
<dict-tag :options="dict.type.device_bind_record_type" :value="d.row[column.key]"/>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="column.key === 'userType'">
|
||||||
|
<dict-tag :options="dict.type.device_bind_record_user_type" :value="d.row[column.key]"/>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
{{d.row[column.key]}}
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</template>
|
||||||
|
</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="deviceId">
|
||||||
|
<el-input v-model="form.deviceId" placeholder="请输入设备" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户" prop="userId">
|
||||||
|
<el-input v-model="form.userId" placeholder="请输入用户" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="类型" prop="type">
|
||||||
|
<el-select v-model="form.type" placeholder="请选择类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.device_bind_record_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户类型" prop="userType">
|
||||||
|
<el-select v-model="form.userType" placeholder="请选择用户类型">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.device_bind_record_user_type"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</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 { delRecord, addRecord, updateRecord } from "@/api/system/record";
|
||||||
|
import { $showColumns, $view } from '@/utils/mixins'
|
||||||
|
import UserLink from '@/components/Business/SmUser/UserLink.vue'
|
||||||
|
import { getBindRecord, listBindRecord } from '@/api/system/bindRecord'
|
||||||
|
import DeviceLink from '@/components/Business/Device/DeviceLink.vue'
|
||||||
|
import { views } from '@/utils/constants'
|
||||||
|
|
||||||
|
// 默认排序字段
|
||||||
|
const defaultSort = {
|
||||||
|
prop: "createTime",
|
||||||
|
order: "descending"
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BindRecord",
|
||||||
|
components: { DeviceLink, UserLink },
|
||||||
|
mixins: [$showColumns, $view],
|
||||||
|
dicts: ['device_bind_record_type', 'device_bind_record_user_type'],
|
||||||
|
props: {
|
||||||
|
query: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
return {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 字段列表
|
||||||
|
columns: [
|
||||||
|
{key: 'recordId', visible: false, label: '记录id', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'createTime', visible: true, label: '时间', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'deviceId', visible: true, label: '设备', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'userId', visible: true, label: '用户', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'userType', visible: true, label: '用户类型', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||||
|
{key: 'type', 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,
|
||||||
|
// 设备绑定记录表格数据
|
||||||
|
recordList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
defaultSort,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
orderByColumn: defaultSort.prop,
|
||||||
|
isAsc: defaultSort.order,
|
||||||
|
deviceId: null,
|
||||||
|
userId: null,
|
||||||
|
type: null,
|
||||||
|
userType: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
deviceId: [
|
||||||
|
{ required: true, message: "设备不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
userId: [
|
||||||
|
{ required: true, message: "用户不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
createTime: [
|
||||||
|
{ required: true, message: "创建时间不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
type: [
|
||||||
|
{ required: true, message: "类型不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
userType: [
|
||||||
|
{ required: true, message: "用户类型不能为空", trigger: "change" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
if (this.view === views.device) {
|
||||||
|
this.hideColumn(['deviceId'])
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
listBindRecord(this.queryParams).then(response => {
|
||||||
|
this.recordList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
recordId: null,
|
||||||
|
deviceId: null,
|
||||||
|
userId: null,
|
||||||
|
createTime: null,
|
||||||
|
type: null,
|
||||||
|
userType: 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.recordId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加设备绑定记录";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const recordId = row.recordId || this.ids
|
||||||
|
getBindRecord(recordId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改设备绑定记录";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.recordId != null) {
|
||||||
|
updateRecord(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addRecord(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const recordIds = row.recordId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除设备绑定记录编号为"' + recordIds + '"的数据项?').then(function() {
|
||||||
|
return delRecord(recordIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/record/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `record_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
48
src/views/system/device/components/BindAgentButton.vue
Normal file
48
src/views/system/device/components/BindAgentButton.vue
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-button style="width: 100%" type="success" icon="el-icon-link" size="small" plain @click="showDialog = true">绑定代理商</el-button>
|
||||||
|
|
||||||
|
<sm-user-dialog :show.sync="showDialog" @select="handleSubmit"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmUserDialog from '@/components/Business/SmUser/smUserDialog.vue'
|
||||||
|
import { bindAgent, bindMch } from '@/api/system/device'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BindAgentButton",
|
||||||
|
components: { SmUserDialog },
|
||||||
|
props: {
|
||||||
|
deviceId: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSubmit(user) {
|
||||||
|
this.$prompt("请输入代理商设备服务费(%)", "提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
inputPattern: /^\d+$/,
|
||||||
|
inputErrorMessage: '请输入数字',
|
||||||
|
inputPlaceholder: "请输入代理商设备服务费",
|
||||||
|
inputValue: user.agentDeviceService,
|
||||||
|
}).then(({value}) => {
|
||||||
|
bindAgent(this.deviceId, user.userId, value).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("绑定成功");
|
||||||
|
this.showDialog = false;
|
||||||
|
this.$emit('success');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
45
src/views/system/device/components/BindMchButton.vue
Normal file
45
src/views/system/device/components/BindMchButton.vue
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-button style="width: 100%" type="success" icon="el-icon-link" size="small" plain @click="showDialog = true">绑定商户</el-button>
|
||||||
|
|
||||||
|
<sm-user-dialog :show.sync="showDialog" @select="handleSubmit"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import SmUserDialog from '@/components/Business/SmUser/smUserDialog.vue'
|
||||||
|
import { bindMch } from '@/api/system/device'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "BindMchButton",
|
||||||
|
components: { SmUserDialog },
|
||||||
|
props: {
|
||||||
|
deviceId: {
|
||||||
|
type: String,
|
||||||
|
default: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
showDialog: false,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleSubmit(user) {
|
||||||
|
this.$confirm(`确定要绑定商户【${user.userName}】吗?`, '提示', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
bindMch(this.deviceId, user.userId).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("绑定成功");
|
||||||
|
this.showDialog = false;
|
||||||
|
this.$emit('success');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -1,71 +0,0 @@
|
||||||
<template>
|
|
||||||
<div>
|
|
||||||
<el-table v-loading="loading" :data="recordList">
|
|
||||||
<el-table-column align="center" type="index" label="#"></el-table-column>
|
|
||||||
<el-table-column align="center" label="时间" prop="createTime"></el-table-column>
|
|
||||||
<el-table-column align="center" label="用户名称" prop="userName"></el-table-column>
|
|
||||||
</el-table>
|
|
||||||
|
|
||||||
<pagination
|
|
||||||
:auto-scroll="false"
|
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getRecordList"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {listBindRecord} from "@/api/system/bindRecord";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'bindRecord',
|
|
||||||
props: {
|
|
||||||
// 设备id
|
|
||||||
deviceId: {
|
|
||||||
type: String,
|
|
||||||
default: null
|
|
||||||
}
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
recordList: [], // 记录列表
|
|
||||||
loading: false,
|
|
||||||
total: 0,
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 20,
|
|
||||||
deviceId: null,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
deviceId(nv, ov) {
|
|
||||||
this.getRecordList(nv);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getRecordList(this.deviceId);
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
// 获取记录列表
|
|
||||||
getRecordList(deviceId) {
|
|
||||||
if(deviceId == null) {
|
|
||||||
this.recordList = [];
|
|
||||||
this.total = 0;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.loading = true;
|
|
||||||
this.queryParams.deviceId = deviceId | this.deviceId;
|
|
||||||
listBindRecord(this.queryParams).then(response => {
|
|
||||||
this.recordList = response.rows;
|
|
||||||
this.total = response.total;
|
|
||||||
}).finally(() => {
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
|
@ -109,7 +109,13 @@
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="备注">{{deviceData.remark | defaultValue}}</el-descriptions-item>
|
<el-descriptions-item label="备注">{{deviceData.remark | defaultValue}}</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
<el-button size="small" style="width: 100%" plain icon="el-icon-link" type="danger" @click="handleUnbind" v-if="deviceData.userId != null">解绑商户</el-button>
|
|
||||||
|
<el-row type="flex">
|
||||||
|
<el-button size="small" style="flex:1" plain icon="el-icon-link" type="danger" @click="handleUnbindAgent" v-if="deviceData.agentId != null">解绑代理商</el-button>
|
||||||
|
<bind-agent-button v-else style="flex: 1" :device-id="deviceData.deviceId" @success="getDevice"/>
|
||||||
|
<el-button size="small" style="flex:1" plain icon="el-icon-link" type="danger" @click="handleUnbind" v-if="deviceData.userId != null">解绑商户</el-button>
|
||||||
|
<bind-mch-button v-else style="flex: 1" :device-id="deviceData.deviceId" @success="getDevice"/>
|
||||||
|
</el-row>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -135,8 +141,8 @@
|
||||||
<el-tab-pane label="抄表记录" :lazy="true">
|
<el-tab-pane label="抄表记录" :lazy="true">
|
||||||
<reading-record :device-id="deviceData.deviceId"/>
|
<reading-record :device-id="deviceData.deviceId"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane label="绑定记录" :lazy="true">
|
<el-tab-pane label="绑定/解绑记录" :lazy="true">
|
||||||
<bind-record :device-id="deviceData.deviceId"/>
|
<bind-record :query="{deviceId: deviceData.deviceId}" :view="views.device"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
@ -174,7 +180,7 @@ import {
|
||||||
resetDevice,
|
resetDevice,
|
||||||
resetEleDevice,
|
resetEleDevice,
|
||||||
switchDevice,
|
switchDevice,
|
||||||
unbind
|
unbind, unbindAgent
|
||||||
} from '@/api/system/device'
|
} from '@/api/system/device'
|
||||||
import LineChart from "@/views/dashboard/LineChart.vue";
|
import LineChart from "@/views/dashboard/LineChart.vue";
|
||||||
import RechargeRecord from "@/views/system/device/components/rechargeRecord.vue";
|
import RechargeRecord from "@/views/system/device/components/rechargeRecord.vue";
|
||||||
|
@ -182,7 +188,7 @@ import QrCode from "@/components/QrCode/index.vue";
|
||||||
import MeterRecordReport from "@/views/system/device/components/meterRecordReport.vue";
|
import MeterRecordReport from "@/views/system/device/components/meterRecordReport.vue";
|
||||||
import ReadingRecord from "@/views/system/device/components/readingRecord.vue";
|
import ReadingRecord from "@/views/system/device/components/readingRecord.vue";
|
||||||
import {getWxIndexUrl} from "@/utils/wx";
|
import {getWxIndexUrl} from "@/utils/wx";
|
||||||
import BindRecord from "@/views/system/device/components/bindRecord.vue";
|
import BindRecord from "@/views/system/bindRecord/index.vue";
|
||||||
import ResetRecord from "@/views/system/device/components/resetRecord.vue";
|
import ResetRecord from "@/views/system/device/components/resetRecord.vue";
|
||||||
import TenantList from "@/views/system/device/components/tenantList.vue";
|
import TenantList from "@/views/system/device/components/tenantList.vue";
|
||||||
import SuitList from '@/views/system/device/components/suitList.vue'
|
import SuitList from '@/views/system/device/components/suitList.vue'
|
||||||
|
@ -196,12 +202,16 @@ import Recharge from '@/views/system/recharge/index.vue'
|
||||||
import BooleanTag from '@/components/BooleanTag/index.vue'
|
import BooleanTag from '@/components/BooleanTag/index.vue'
|
||||||
import { DeviceServiceMode, ModelTag } from '@/utils/constants'
|
import { DeviceServiceMode, ModelTag } from '@/utils/constants'
|
||||||
import { isEmpty } from '@/utils'
|
import { isEmpty } from '@/utils'
|
||||||
|
import BindMchButton from '@/views/system/device/components/BindMchButton.vue'
|
||||||
|
import BindAgentButton from '@/views/system/device/components/BindAgentButton.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Device/:deviceId',
|
name: 'Device/:deviceId',
|
||||||
mixins: [$serviceType, $view],
|
mixins: [$serviceType, $view],
|
||||||
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag', 'sm_device_online_status', 'service_type', 'device_service_mode', 'time_unit'],
|
dicts: ['sm_device_status', 'sm_device_outage_way', 'sm_device_notice_way', 'sm_model_tag', 'sm_device_online_status', 'service_type', 'device_service_mode', 'time_unit'],
|
||||||
components: {
|
components: {
|
||||||
|
BindAgentButton,
|
||||||
|
BindMchButton,
|
||||||
BooleanTag,
|
BooleanTag,
|
||||||
Recharge,
|
Recharge,
|
||||||
UserLink,
|
UserLink,
|
||||||
|
@ -285,6 +295,22 @@ export default {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
handleUnbindAgent() {
|
||||||
|
this.$confirm('是否强制解绑该代理商?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
unbindAgent(this.deviceData.deviceId).then(res => {
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.getDevice();
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
handleSwitch(open) {
|
handleSwitch(open) {
|
||||||
this.$confirm(`是否确认强制${open ? '开启' : '关闭'}设备?`, '警告', {
|
this.$confirm(`是否确认强制${open ? '开启' : '关闭'}设备?`, '警告', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
|
|
|
@ -157,10 +157,12 @@
|
||||||
<el-descriptions-item label="商户查看手机号功能开启状态">
|
<el-descriptions-item label="商户查看手机号功能开启状态">
|
||||||
<boolean-tag :value="detail.mchShowMobile" true-text="已开启" false-text="未开启" size="small"/>
|
<boolean-tag :value="detail.mchShowMobile" true-text="已开启" false-text="未开启" size="small"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="商户查看手机号价格">{{detail.mchShowMobilePrice | money | defaultValue}} 元</el-descriptions-item>
|
<template v-if="detail.mchShowMobile">
|
||||||
<el-descriptions-item label="商户查看手机号状态">
|
<el-descriptions-item label="商户查看手机号价格">{{detail.mchShowMobilePrice | money | defaultValue}} 元</el-descriptions-item>
|
||||||
<dict-tag :value="detail.mchShowMobileStatus" :options="dict.type.recharge_mch_show_mobile_status" size="small"/>
|
<el-descriptions-item label="商户查看手机号状态">
|
||||||
</el-descriptions-item>
|
<dict-tag :value="detail.mchShowMobileStatus" :options="dict.type.recharge_mch_show_mobile_status" size="small"/>
|
||||||
|
</el-descriptions-item>
|
||||||
|
</template>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<el-dialog :visible.sync="visible" width="700px" title="用户配置" @open="onOpen">
|
<el-dialog :visible.sync="visible" width="600px" title="用户配置" @open="onOpen">
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px" v-loading="loading">
|
<el-form ref="form" :model="form" :rules="rules" label-width="5em" v-loading="loading">
|
||||||
<el-row v-if="showCurrent">
|
<el-row v-if="showCurrent">
|
||||||
<form-col :span="span" label="当前用户" label-width="5em">
|
<form-col :span="span" label="当前用户" label-width="5em">
|
||||||
{{form.realOrUserName | defaultValue}}
|
{{form.realOrUserName | defaultValue}}
|
||||||
|
@ -8,10 +8,10 @@
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<group-title title="订单显示用户手机号"/>
|
<group-title title="订单显示用户手机号"/>
|
||||||
<form-col :span="8" label="是否开启" label-width="11">
|
<form-col :span="10" label="是否开启" label-width="5em">
|
||||||
<el-switch v-model="form.showBillMobile" active-text="开启" inactive-text="不开启"/>
|
<el-switch v-model="form.showBillMobile" active-text="开启" inactive-text="不开启"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="16" label="单价" prop="showBillMobilePrice" v-if="form.showBillMobile">
|
<form-col :span="14" label="单价" prop="showBillMobilePrice" v-if="form.showBillMobile">
|
||||||
<el-input v-model="form.showBillMobilePrice" :min="0" type="number" placeholder="请输入单价">
|
<el-input v-model="form.showBillMobilePrice" :min="0" type="number" placeholder="请输入单价">
|
||||||
<template #append>元 / 单</template>
|
<template #append>元 / 单</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
@ -27,24 +27,24 @@
|
||||||
</form-col>
|
</form-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<form-col :span="8" label="限制提现" prop="limitWithdraw">
|
<form-col :span="10" label="限制提现" prop="limitWithdraw">
|
||||||
<el-switch v-model="form.limitWithdraw" active-text="限制" inactive-text="不限制"/>
|
<el-switch v-model="form.limitWithdraw" active-text="限制" inactive-text="不限制"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<template v-if="form.limitWithdraw">
|
<template v-if="form.limitWithdraw">
|
||||||
<form-col :span="16" label="限制提现至" prop="limitWithdrawTime" label-width="6em">
|
<form-col :span="14" label="限制提现至" prop="limitWithdrawTime" label-width="6em">
|
||||||
<el-date-picker type="datetime" v-model="form.limitWithdrawTime" placeholder="请选择限制提现时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
|
<el-date-picker type="datetime" v-model="form.limitWithdrawTime" placeholder="请选择限制提现时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="24" label="限制原因" prop="limitWithdraw">
|
<form-col :span="24" label="限制原因" prop="limitWithdraw" label-width="5em">
|
||||||
<el-input v-model="form.limitWithdrawReason" type="textarea" placeholder="请输入限制提现的原因(展示给用户查看)" show-word-limit maxlength="200"/>
|
<el-input v-model="form.limitWithdrawReason" type="textarea" placeholder="请输入限制提现的原因(展示给用户查看)" show-word-limit maxlength="200"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
</template>
|
</template>
|
||||||
</el-row>
|
</el-row>
|
||||||
<el-row>
|
<el-row>
|
||||||
<form-col :span="8" label="限制退款" prop="limitRefund">
|
<form-col :span="10" label="限制退款" prop="limitRefund" label-width="5em">
|
||||||
<el-switch v-model="form.limitRefund" active-text="限制" inactive-text="不限制"/>
|
<el-switch v-model="form.limitRefund" active-text="限制" inactive-text="不限制"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<template v-if="form.limitRefund">
|
<template v-if="form.limitRefund">
|
||||||
<form-col :span="16" label="限制退款至" prop="limitRefundTime" label-width="6em">
|
<form-col :span="14" label="限制退款至" prop="limitRefundTime" label-width="6em">
|
||||||
<el-date-picker type="datetime" v-model="form.limitRefundTime" placeholder="请选择限制退款时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
|
<el-date-picker type="datetime" v-model="form.limitRefundTime" placeholder="请选择限制退款时间(为空则为永久)" value-format="yyyy-MM-dd HH:mm:ss" :clearable="false" style="width: 100%"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
<form-col :span="24" label="限制原因" prop="limitRefundReason">
|
<form-col :span="24" label="限制原因" prop="limitRefundReason">
|
||||||
|
@ -53,9 +53,18 @@
|
||||||
</template>
|
</template>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
<el-row v-if="form.type === SmUserType.AGENT">
|
||||||
|
<group-title title="代理商配置"/>
|
||||||
|
<form-col :span="24" label="默认设备服务费" label-width="8em" prop="agentDeviceService">
|
||||||
|
<el-input v-model="form.agentDeviceService" type="number" :min="0" placeholder="请输入默认设备服务费">
|
||||||
|
<template #append>%</template>
|
||||||
|
</el-input>
|
||||||
|
</form-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
<el-row>
|
<el-row>
|
||||||
<group-title title="其他设置"/>
|
<group-title title="其他设置"/>
|
||||||
<form-col :span="8" label="是否为设备管理员" label-width="11" prop="deviceAdmin">
|
<form-col :span="8" label="是否为设备管理员" label-width="9em" prop="deviceAdmin">
|
||||||
<el-switch v-model="form.deviceAdmin" active-text="是" inactive-text="否" @change="onChangeDeviceAdmin"/>
|
<el-switch v-model="form.deviceAdmin" active-text="是" inactive-text="否" @change="onChangeDeviceAdmin"/>
|
||||||
</form-col>
|
</form-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -72,6 +81,7 @@
|
||||||
import { getSmUser, updateSmUser } from '@/api/system/smUser'
|
import { getSmUser, updateSmUser } from '@/api/system/smUser'
|
||||||
import LineField from '@/components/LineField/index.vue'
|
import LineField from '@/components/LineField/index.vue'
|
||||||
import GroupTitle from '@/components/GroupTitle/index.vue'
|
import GroupTitle from '@/components/GroupTitle/index.vue'
|
||||||
|
import { SmUserType } from '@/utils/constants'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "UserConfigDialog",
|
name: "UserConfigDialog",
|
||||||
|
@ -91,6 +101,9 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
SmUserType() {
|
||||||
|
return SmUserType
|
||||||
|
},
|
||||||
visible: {
|
visible: {
|
||||||
set(val) {
|
set(val) {
|
||||||
this.$emit('update:show', val);
|
this.$emit('update:show', val);
|
||||||
|
|
|
@ -95,6 +95,9 @@
|
||||||
<el-tab-pane label="提现列表" lazy>
|
<el-tab-pane label="提现列表" lazy>
|
||||||
<withdraw :query="{userId: userData.userId}" :view="views.user"/>
|
<withdraw :query="{userId: userData.userId}" :view="views.user"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
<el-tab-pane label="应收账" lazy>
|
||||||
|
<receive-bill :query="{userId: userData.userId}" :view="views.user"/>
|
||||||
|
</el-tab-pane>
|
||||||
<el-tab-pane label="账变记录" lazy>
|
<el-tab-pane label="账变记录" lazy>
|
||||||
<record-balance :query="{userId: userData.userId}" :view="views.user"/>
|
<record-balance :query="{userId: userData.userId}" :view="views.user"/>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
|
@ -137,11 +140,12 @@ import Withdraw from '@/views/system/withdraw/index.vue'
|
||||||
import RealName from '@/views/ss/realName/index.vue'
|
import RealName from '@/views/ss/realName/index.vue'
|
||||||
import UserConfigDialog from '@/views/system/smUser/components/UserConfigDialog.vue'
|
import UserConfigDialog from '@/views/system/smUser/components/UserConfigDialog.vue'
|
||||||
import { SmUserType } from '@/utils/constants'
|
import { SmUserType } from '@/utils/constants'
|
||||||
|
import ReceiveBill from '@/views/ss/receiveBill/index.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'User/:userId',
|
name: 'User/:userId',
|
||||||
mixins: [$view, $serviceType],
|
mixins: [$view, $serviceType],
|
||||||
components: { UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
components: { ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||||
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
||||||
computed: {
|
computed: {
|
||||||
SmUserType() {
|
SmUserType() {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user