init
This commit is contained in:
@@ -94,13 +94,6 @@
|
||||
@click="handleEnableRate(scope.row,false)"
|
||||
v-hasPermi="['cai:userInvite:edit']"
|
||||
>关闭</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['cai:userInvite:edit']"
|
||||
>修改</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -112,24 +105,20 @@
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<update-invite-dialog v-if="updateInviteDialogVisible" ref="updateInviteDialog" @refreshDataList="getList" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listUserInvite, updateUserInvite} from "@/api/cai/userInvite";
|
||||
import {booleanList, isAnchorList} from "@/constant/statusMap";
|
||||
import UpdateInviteDialog from "@/views/cai/userInvite/update-invite-dialog";
|
||||
|
||||
export default {
|
||||
name: "UserInvite",
|
||||
components: {
|
||||
UpdateInviteDialog
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isAnchorList,booleanList,
|
||||
updateInviteDialogVisible: false,
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
@@ -185,12 +174,6 @@ export default {
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
handleUpdate(row){
|
||||
this.updateInviteDialogVisible = true
|
||||
this.$nextTick(() => {
|
||||
this.$refs.updateInviteDialog.init(row)
|
||||
})
|
||||
},
|
||||
handleEnableRate(row,enableRate) {
|
||||
let message = enableRate ? '开启' : '关闭';
|
||||
this.$modal.confirm('是否确认'+message+'用户"' + row.usercode + '"的好友邀请奖励?').then(() => {
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
<template>
|
||||
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="open" width="700px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="蜜瓜号" prop="usercode">
|
||||
<el-input v-model="form.usercode" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="好友守护分成" prop="guardIncomeRate">
|
||||
<el-input v-model="form.guardIncomeRate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="好友礼物分成" prop="giftIncomeRate">
|
||||
<el-input v-model="form.giftIncomeRate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="好友视频分成" prop="videoIncomeRate">
|
||||
<el-input v-model="form.videoIncomeRate" />
|
||||
</el-form-item>
|
||||
<el-form-item label="好友充值分成" prop="payIncomeRate">
|
||||
<el-input v-model="form.payIncomeRate" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="open = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ImageUpload from '@/components/ImageUpload/index'
|
||||
import {getUserInvite, updateUserInviteRate} from "@/api/cai/userInvite";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ImageUpload,
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
open: false,
|
||||
title: '',
|
||||
form:{
|
||||
id: undefined,
|
||||
usercode: undefined,
|
||||
guardIncomeRate: undefined,
|
||||
giftIncomeRate: undefined,
|
||||
videoIncomeRate: undefined,
|
||||
payIncomeRate: undefined,
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
guardIncomeRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
giftIncomeRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
videoIncomeRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
payIncomeRate: [
|
||||
{ required: true, message: "数据不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
buttonLoading: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods: {
|
||||
init (row) {
|
||||
let id = row.id
|
||||
this.form.id = id || undefined;
|
||||
this.title = "修改用户好友提成";
|
||||
this.open = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs['form'].resetFields();
|
||||
getUserInvite(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.form.usercode = row.usercode
|
||||
});
|
||||
})
|
||||
},
|
||||
// 表单提交
|
||||
submitForm () {
|
||||
this.$refs['form'].validate((valid) => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
updateUserInviteRate(this.form).then(data => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.buttonLoading = false;
|
||||
this.open = false
|
||||
this.$emit('refreshDataList')
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user