Browse Source

设备操作弹窗

master
453530270@qq.com 2 years ago
parent
commit
50dbc4c959
  1. 33
      src/views/user/Index.vue
  2. 69
      src/views/user/modules/OpendevForm.vue
  3. 3
      src/views/user/modules/index.js

33
src/views/user/Index.vue

@ -85,12 +85,13 @@
<span class="actions" slot="action" slot-scope="item"> <span class="actions" slot="action" slot-scope="item">
<!-- <a title="会员充值" v-action:recharge @click="handleRecharge(item)">充值</a> --> <!-- <a title="会员充值" v-action:recharge @click="handleRecharge(item)">充值</a> -->
<!-- <a title="会员等级" v-action:grade @click="handleGrade(item)">等级</a> --> <!-- <a title="会员等级" v-action:grade @click="handleGrade(item)">等级</a> -->
<a title="开通" v-action:opendev @click="handleOpenDev(item)">开通</a> <a title="设备管理" v-action:opendev @click="handleOpenDev(item)">开通</a>
<a v-action:delete @click="handleDelete(item)">删除</a> <a v-action:delete @click="handleDelete(item)">删除</a>
</span> </span>
</s-table> </s-table>
<GradeForm ref="GradeForm" :gradeList="gradeList" @handleSubmit="handleRefresh" /> <GradeForm ref="GradeForm" :gradeList="gradeList" @handleSubmit="handleRefresh" />
<RechargeForm ref="RechargeForm" @handleSubmit="handleRefresh" /> <RechargeForm ref="RechargeForm" @handleSubmit="handleRefresh" />
<OpendevForm ref="OpendevForm" @handleSubmit="handleRefresh"/>
</a-card> </a-card>
</template> </template>
@ -98,7 +99,7 @@
import * as Api from '@/api/user' import * as Api from '@/api/user'
import * as GradeApi from '@/api/user/grade' import * as GradeApi from '@/api/user/grade'
import { STable } from '@/components' import { STable } from '@/components'
import { GradeForm, RechargeForm } from './modules' import { GradeForm, RechargeForm,OpendevForm } from './modules'
import PlatformIcon from '@/components/PlatformIcon' import PlatformIcon from '@/components/PlatformIcon'
export default { export default {
@ -107,6 +108,7 @@ export default {
STable, STable,
GradeForm, GradeForm,
RechargeForm, RechargeForm,
OpendevForm,
PlatformIcon PlatformIcon
}, },
data () { data () {
@ -123,20 +125,10 @@ export default {
title: '会员ID', title: '会员ID',
dataIndex: 'user_id' dataIndex: 'user_id'
}, },
// {
// title: '',
// dataIndex: 'avatar_url',
// scopedSlots: { customRender: 'avatar_url' }
// },
{ {
title: '昵称/手机号', title: '昵称/手机号',
scopedSlots: { customRender: 'main_info' } scopedSlots: { customRender: 'main_info' }
}, },
// {
// title: '',
// dataIndex: 'grade',
// scopedSlots: { customRender: 'grade' }
// },
{ {
title:'实名信息', title:'实名信息',
dataIndex:'real_name', dataIndex:'real_name',
@ -151,21 +143,6 @@ export default {
title:'设备编号', title:'设备编号',
dataIndex:"devsn" dataIndex:"devsn"
}, },
// {
// title: '/',
// dataIndex: 'balance',
// scopedSlots: { customRender: 'balance' }
// },
// {
// title: '',
// dataIndex: 'expend_money',
// scopedSlots: { customRender: 'expend_money' }
// },
// {
// title: '',
// dataIndex: 'platform',
// scopedSlots: { customRender: 'platform' }
// },
{ {
title: '注册时间', title: '注册时间',
dataIndex: 'create_time' dataIndex: 'create_time'
@ -211,7 +188,7 @@ export default {
// //
handleOpenDev(item){ handleOpenDev(item){
this.$refs.GradeForm.handle(item) this.$refs.OpendevForm.handle(item)
}, },
/** /**

69
src/views/user/modules/OpendevForm.vue

@ -12,40 +12,37 @@
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form :form="form"> <a-form :form="form">
<a-tabs :activeKey="activeKey" @change="onChangeTabs"> <a-tabs :activeKey="activeKey" @change="onChangeTabs">
<a-tab-pane :key="RECHARGE_TYPE_BALANCE" tab="充值余额">
<template v-if="activeKey === RECHARGE_TYPE_BALANCE"> <a-tab-pane :key="DEV_STATUS_OPEN" tab="操作设备">
<template v-if="activeKey === DEV_STATUS_OPEN">
<a-form-item class="mb-5" label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item class="mb-5" label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.user_id }}</span> <span>{{ record.user_id }}</span>
</a-form-item> </a-form-item>
<a-form-item class="mb-5" label="当前余额" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item class="mb-5" label="登记手机号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span class="c-p">{{ record.balance }}</span> <span class="c-p">{{ record.mobile }}</span>
</a-form-item> </a-form-item>
<a-form-item label="充值方式" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item class="mb-5" label="真实姓名" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span class="c-p">{{ record.real_name }}</span>
</a-form-item>
<a-form-item class="mb-5" label="身份证号码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span class="c-p">{{ record.id_no }}</span>
</a-form-item>
<a-form-item class="mb-5" label="登记设备编码" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span class="c-p">{{ record.devsn }}</span>
</a-form-item>
<a-form-item label="操作方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group <a-radio-group
v-decorator="[`${RECHARGE_TYPE_BALANCE}.mode`, { initialValue: 'inc', rules: [{ required: true }] }]" v-decorator="[`dev.status`, { initialValue: '10', rules: [{ required: true }] }]"
> >
<a-radio value="inc">增加</a-radio> <a-radio value="10">开启</a-radio>
<a-radio value="dec">减少</a-radio> <a-radio value="20">关闭</a-radio>
<a-radio value="final">最终金额</a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item label="变更金额" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number
:min="0.01"
v-decorator="[`${RECHARGE_TYPE_BALANCE}.money`, { initialValue: '', rules: [{ required: true, message: '请输入变更的金额' }] }]"
/>
</a-form-item>
<a-form-item label="管理员备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea
placeholder="请输入管理员备注"
:rows="3"
v-decorator="[`${RECHARGE_TYPE_BALANCE}.remark`, { rules: [{ required: true, message: '请输入管理员备注' }] }]"
/>
</a-form-item>
</template> </template>
</a-tab-pane> </a-tab-pane>
<a-tab-pane :key="RECHARGE_TYPE_POINTS" tab="充值积分"> <a-tab-pane :key="DEV_STATUS_CLOSE" tab="关闭设备">
<template v-if="activeKey === RECHARGE_TYPE_POINTS"> <template v-if="activeKey === DEV_STATUS_CLOSE">
<a-form-item class="mb-5" label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item class="mb-5" label="会员ID" :labelCol="labelCol" :wrapperCol="wrapperCol">
<span>{{ record.user_id }}</span> <span>{{ record.user_id }}</span>
</a-form-item> </a-form-item>
@ -54,7 +51,7 @@
</a-form-item> </a-form-item>
<a-form-item label="充值方式" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="充值方式" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-radio-group <a-radio-group
v-decorator="[`${RECHARGE_TYPE_POINTS}.mode`, { initialValue: 'inc', rules: [{ required: true }] }]" v-decorator="[`${DEV_STATUS_CLOSE}.mode`, { initialValue: 'inc', rules: [{ required: true }] }]"
> >
<a-radio value="inc">增加</a-radio> <a-radio value="inc">增加</a-radio>
<a-radio value="dec">减少</a-radio> <a-radio value="dec">减少</a-radio>
@ -64,14 +61,14 @@
<a-form-item label="变更数量" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="变更数量" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-input-number <a-input-number
:min="0.01" :min="0.01"
v-decorator="[`${RECHARGE_TYPE_POINTS}.value`, { initialValue: '', rules: [{ required: true, message: '请输入变更的金数量' }] }]" v-decorator="[`${DEV_STATUS_CLOSE}.value`, { initialValue: '', rules: [{ required: true, message: '请输入变更的金数量' }] }]"
/> />
</a-form-item> </a-form-item>
<a-form-item label="管理员备注" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item label="管理员备注" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-textarea <a-textarea
placeholder="请输入管理员备注" placeholder="请输入管理员备注"
:rows="3" :rows="3"
v-decorator="[`${RECHARGE_TYPE_POINTS}.remark`, { rules: [{ required: true, message: '请输入管理员备注' }] }]" v-decorator="[`${DEV_STATUS_CLOSE}.remark`, { rules: [{ required: true, message: '请输入管理员备注' }] }]"
/> />
</a-form-item> </a-form-item>
</template> </template>
@ -86,11 +83,10 @@
// import pick from 'lodash.pick' // import pick from 'lodash.pick'
import * as Api from '@/api/user' import * as Api from '@/api/user'
// : //
const RECHARGE_TYPE_BALANCE = 'balance' const DEV_STATUS_OPEN = "open"
// : const DEV_STATUS_CLOSE = "close"
const RECHARGE_TYPE_POINTS = 'points'
export default { export default {
components: { components: {
@ -98,7 +94,7 @@
data () { data () {
return { return {
// //
title: '会员充值', title: '设备管理',
// //
labelCol: { span: 7 }, labelCol: { span: 7 },
// //
@ -110,10 +106,10 @@
// //
form: this.$form.createForm(this), form: this.$form.createForm(this),
// tab // tab
activeKey: RECHARGE_TYPE_BALANCE, activeKey: DEV_STATUS_OPEN,
// //
RECHARGE_TYPE_BALANCE, DEV_STATUS_CLOSE,
RECHARGE_TYPE_POINTS, DEV_STATUS_OPEN,
// //
record: {} record: {}
} }
@ -122,6 +118,7 @@
// //
handle (record) { handle (record) {
console.log("open dev flag::",record)
// //
this.visible = true this.visible = true
// //

3
src/views/user/modules/index.js

@ -1,4 +1,5 @@
import GradeForm from './GradeForm' import GradeForm from './GradeForm'
import RechargeForm from './RechargeForm' import RechargeForm from './RechargeForm'
import OpendevForm from './OpendevForm'
export { GradeForm, RechargeForm } export { GradeForm, RechargeForm,OpendevForm }
Loading…
Cancel
Save