Commit c76daee9 authored by rencs's avatar rencs

10.21 订单分成比例

parent b538f93d
<template> <template>
<div class="app-container calendar-list-container" v-loading.body="showLoadingBody"> <div
<div class="filter-container" ref="filter-container"> class="app-container calendar-list-container"
<el-button v-loading.body="showLoadingBody"
class="filter-item" >
style="margin-left: 10px;" <div class="filter-container" ref="filter-container">
@click="handleCreate" <el-button
type="primary" class="filter-item"
icon="edit" style="margin-left: 10px"
>添加</el-button> @click="handleCreate"
</div> type="primary"
<el-table :key="tableKey" :data="list" border fit highlight-current-row style="width: 600px"> icon="edit"
<el-table-column type="index" align="center" label="序号" width="98"></el-table-column> >添加</el-button
<el-table-column width="250" align="center" label="标题"> >
<template slot-scope="scope"> </div>
<span>{{scope.row.title}}</span> <el-table
</template> :key="tableKey"
</el-table-column> :data="list"
<el-table-column width="100" align="center" label="标识"> border
<template slot-scope="scope"> fit
<span>{{scope.row.type}}</span> highlight-current-row
</template> style="width: 600px"
</el-table-column> >
<el-table-column align="center" width="150" label="操作"> <el-table-column
<template slot-scope="scope"> type="index"
<el-button align="center"
size="small" label="序号"
class="el-button el-button--text el-button--small" width="98"
@click="handleUpdate(scope.row)" ></el-table-column>
>编辑</el-button> <el-table-column width="250" align="center" label="标题">
<el-button <template slot-scope="scope">
class="el-button el-button--text el-button--small" <span>{{ scope.row.title }}</span>
style="color: red;" </template>
v-if="scope.row.type!=88" </el-table-column>
size="small" <el-table-column width="100" align="center" label="标识">
@click="deleteHandler(scope.row)" <template slot-scope="scope">
>删除</el-button> <span>{{ scope.row.type }}</span>
<!--<el-button size="small" type="danger" @click="deleteHandler(scope.row)">删除--> </template>
<!--</el-button>--> </el-table-column>
</template> <el-table-column align="center" width="150" label="操作">
</el-table-column> <template slot-scope="scope">
</el-table> <el-button
<div v-show="!listLoading" class="pagination-container"> size="small"
<el-pagination class="el-button el-button--text el-button--small"
@size-change="handleSizeChange" @click="handleUpdate(scope.row)"
@current-change="handleCurrentChange" >编辑</el-button
:current-page.sync="listQuery.page" >
:page-sizes="[10,20,30, 50]" <el-button
:page-size="listQuery.limit" class="el-button el-button--text el-button--small"
layout="total, sizes, prev, pager, next, jumper" style="color: red"
:total="total" v-if="scope.row.type != 88"
></el-pagination> size="small"
</div> @click="deleteHandler(scope.row)"
<!-- banner modal弹窗 --> >删除</el-button
<el-dialog :title="modalTitle" :visible.sync="dialogVisible" :before-close="handleDialogClose"> >
<el-form :model="dialogFrom" :rules="rules" ref="dialogFrom" label-width="130px"> <!--<el-button size="small" type="danger" @click="deleteHandler(scope.row)">删除-->
<el-form-item label="标题" prop="title"> <!--</el-button>-->
<el-input v-model="dialogFrom.title" placeholder="请输入标题"></el-input> </template>
</el-form-item> </el-table-column>
<el-form-item label="标识" prop="type"> </el-table>
<el-input type="number" v-model.number="dialogFrom.type" placeholder="1,2,3……"></el-input> <div v-show="!listLoading" class="pagination-container">
</el-form-item> <el-pagination
<el-form-item label="参数" prop="params" v-show="dialogFrom.type != '88'"> @size-change="handleSizeChange"
<el-input v-model="dialogFrom.params" placeholder="请输入标题"></el-input> @current-change="handleCurrentChange"
</el-form-item> :current-page.sync="listQuery.page"
<el-row v-if="dialogFrom.type==88"> :page-sizes="[10, 20, 30, 50]"
<el-col :span="12"> :page-size="listQuery.limit"
<el-form-item label="最低提现金额" prop="minAmount"> layout="total, sizes, prev, pager, next, jumper"
<el-input v-model="dialogFrom.minAmount" placeholder="请输入最低提现金额"></el-input> :total="total"
<span style="color:#bfcbd9;">钱包余额,最低提现额度,达到此金额后才能提现</span> ></el-pagination>
</el-form-item> </div>
</el-col> <!-- banner modal弹窗 -->
</el-row> <el-dialog
<el-row v-if="dialogFrom.type==88"> :title="modalTitle"
<el-col :span="12"> :visible.sync="dialogVisible"
<el-form-item label="提现手续费" prop="proceduReates"> :before-close="handleDialogClose"
<el-input v-model="dialogFrom.proceduReates" placeholder="请输入提现手续费"></el-input> >
<span style="color:#bfcbd9;">提现收取的手续费</span> <el-form
</el-form-item> :model="dialogFrom"
</el-col> :rules="rules"
</el-row> ref="dialogFrom"
<el-row v-if="dialogFrom.type==88"> label-width="130px"
<el-col :span="12"> >
<el-form-item label="月额度" prop="amountOfMonth"> <el-form-item
<el-input v-model="dialogFrom.amountOfMonth" placeholder="请输入月额度"></el-input> v-show="dialogFrom.type != '66'"
</el-form-item> label="标题"
</el-col> prop="title"
</el-row> >
<el-row v-if="dialogFrom.type==88"> <el-input
<el-col :span="12"> v-model="dialogFrom.title"
<el-form-item label="日额度" prop="amountOfDay"> placeholder="请输入标题"
<el-input v-model="dialogFrom.amountOfDay" placeholder="请输入日额度"></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> <el-form-item v-show="dialogFrom.type != '66'" label="标识" prop="type">
</el-row> <el-input
<el-row v-if="dialogFrom.type==88"> type="number"
<el-col :span="12"> v-model.number="dialogFrom.type"
<el-form-item label="最多提现次数(月)" prop="maxNumberOfMonth"> placeholder="1,2,3……"
<el-input v-model="dialogFrom.maxNumberOfMonth" placeholder="请输入最多提现次数(月)"></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> <el-form-item
</el-row> label="参数"
<el-row v-if="dialogFrom.type==88"> prop="params"
<el-col :span="12"> v-show="dialogFrom.type != '88' && dialogFrom.type != '66'"
<el-form-item label="最多提现次数(日)" prop="maxNumberOfDay"> >
<el-input v-model="dialogFrom.maxNumberOfDay" placeholder="请输入最多提现次数(日)"></el-input> <el-input
</el-form-item> v-model="dialogFrom.params"
</el-col> placeholder="请输入标题"
</el-row> ></el-input>
<el-row v-if="dialogFrom.type==88"> </el-form-item>
<el-col :span="12">
<el-form-item label="提现方式" prop="withdrawWay">
<el-radio v-model="dialogFrom.withdrawWay" label="3">线上</el-radio>
<el-radio v-model="dialogFrom.withdrawWay" label="1">线下自动</el-radio>
<el-radio v-model="dialogFrom.withdrawWay" label="2">线下手动</el-radio>
</el-form-item>
</el-col>
</el-row>
<el-tabs v-model="activeName2" type="card"> <el-row v-if="dialogFrom.type == 66">
<el-tab-pane label="详情" name="first"> <el-col :span="12">
<!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>--> <el-form-item label="收车服务费">
<div class="editor-container" v-if="activeName2=='first'"> <el-input
<UE v-model="dialogFrom.closedVehicleAmout"
:editorId="activeName2" placeholder="请输入收车服务费"
:defaultMsg="dialogFrom.value" ></el-input>
:config="config" <span style="color: #bfcbd9"></span>
ref="ue" </el-form-item>
@ready="editorReadyEvent" </el-col>
></UE> </el-row>
</div> <el-row v-if="dialogFrom.type == 66">
</el-tab-pane> <el-col :span="12">
</el-tabs> <el-form-item label="平台抽成比">
<!--<el-form-item label="详情">--> <el-input
<!--<Editor @input="handelIncrease" :value="dialogFrom.value" :myQuillEditor="'myQuillEditorContent'"></Editor>--> v-model="dialogFrom.orderExtract"
<!--</el-form-item>--> placeholder="请输入平台抽成比例"
</el-form> ></el-input>
<div slot="footer" class="dialog-footer"> <span style="color: #bfcbd9"></span>
<el-button @click="cancelHandel">取 消</el-button> </el-form-item>
<el-button v-if="modalTitle=='创建'" type="primary" @click="create('dialogFrom')">确 定</el-button> </el-col>
<el-button v-else type="primary" @click="update('dialogFrom')">确 定</el-button> </el-row>
</div> <el-row v-if="dialogFrom.type == 66">
</el-dialog> <el-col :span="12">
<el-form-item label="订单抽成比">
<el-input
v-model="dialogFrom.platformExtract"
placeholder="请输入订单抽成比例"
></el-input>
<span style="color: #bfcbd9"></span>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="最低提现金额" prop="minAmount">
<el-input
v-model="dialogFrom.minAmount"
placeholder="请输入最低提现金额"
></el-input>
<span style="color: #bfcbd9"
>钱包余额,最低提现额度,达到此金额后才能提现</span
>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="提现手续费" prop="proceduReates">
<el-input
v-model="dialogFrom.proceduReates"
placeholder="请输入提现手续费"
></el-input>
<span style="color: #bfcbd9">提现收取的手续费</span>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="月额度" prop="amountOfMonth">
<el-input
v-model="dialogFrom.amountOfMonth"
placeholder="请输入月额度"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="日额度" prop="amountOfDay">
<el-input
v-model="dialogFrom.amountOfDay"
placeholder="请输入日额度"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="最多提现次数(月)" prop="maxNumberOfMonth">
<el-input
v-model="dialogFrom.maxNumberOfMonth"
placeholder="请输入最多提现次数(月)"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="最多提现次数(日)" prop="maxNumberOfDay">
<el-input
v-model="dialogFrom.maxNumberOfDay"
placeholder="请输入最多提现次数(日)"
></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="dialogFrom.type == 88">
<el-col :span="12">
<el-form-item label="提现方式" prop="withdrawWay">
<el-radio v-model="dialogFrom.withdrawWay" label="3"
>线上</el-radio
>
<el-radio v-model="dialogFrom.withdrawWay" label="1"
>线下自动</el-radio
>
<el-radio v-model="dialogFrom.withdrawWay" label="2"
>线下手动</el-radio
>
</el-form-item>
</el-col>
</el-row>
<!--多图上传--> <el-tabs
<!--<el-upload--> v-model="activeName2"
<!--:multiple="multiple"--> type="card"
<!--action="${pageContext.request.contextPath}/lookup/editEvidence/123"--> v-show="dialogFrom.type != 66"
<!--list-type="picture-card"--> >
<!--:auto-upload="false"--> <el-tab-pane label="详情" name="first">
<!--:http-request="uploadFile"--> <!--<Editor v-if="activeName2=='first'" @input="handelContentIncrease" :value="form.content" :myQuillEditor="'myQuillEditorContent'" :activeName2="activeName2"></Editor>-->
<!--ref="upload"--> <div class="editor-container" v-if="activeName2 == 'first'">
<!--&gt;--> <UE
<!--<i class="el-icon-plus"></i>--> :editorId="activeName2"
<!--</el-upload>--> :defaultMsg="dialogFrom.value"
<!--<el-button @click="subPicForm">提交上传</el-button>--> :config="config"
</div> ref="ue"
@ready="editorReadyEvent"
></UE>
</div>
</el-tab-pane>
</el-tabs>
<!--<el-form-item label="详情">-->
<!--<Editor @input="handelIncrease" :value="dialogFrom.value" :myQuillEditor="'myQuillEditorContent'"></Editor>-->
<!--</el-form-item>-->
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelHandel">取 消</el-button>
<el-button
v-if="modalTitle == '创建'"
type="primary"
@click="create('dialogFrom')"
>确 定</el-button
>
<el-button v-else type="primary" @click="update('dialogFrom')"
>确 定</el-button
>
</div>
</el-dialog>
<!--多图上传-->
<!--<el-upload-->
<!--:multiple="multiple"-->
<!--action="${pageContext.request.contextPath}/lookup/editEvidence/123"-->
<!--list-type="picture-card"-->
<!--:auto-upload="false"-->
<!--:http-request="uploadFile"-->
<!--ref="upload"-->
<!--&gt;-->
<!--<i class="el-icon-plus"></i>-->
<!--</el-upload>-->
<!--<el-button @click="subPicForm">提交上传</el-button>-->
</div>
</template> </template>
<style> <style>
.el-table__header { .el-table__header {
width: 100% !important; width: 100% !important;
} }
</style> </style>
<script> <script>
import 'static/css/uploadImg.css' // 引入图片上传组件对话框 import "static/css/uploadImg.css"; // 引入图片上传组件对话框
// import Editor from "../modal/editorTool";//富文本 // import Editor from "../modal/editorTool";//富文本
import UE from '../modal/Ueditor' //百度ue富文本 import UE from "../modal/Ueditor"; //百度ue富文本
import { formatDate } from 'utils/dateFormattor' import { formatDate } from "utils/dateFormattor";
import { import {
toEast8Date, toEast8Date,
deepCopyDate, deepCopyDate,
newEast8Date, newEast8Date,
convertDate2Str convertDate2Str,
} from 'utils/dateUtils' } from "utils/dateUtils";
import { import {
page, page,
addGeneral, addGeneral,
editGeneral, editGeneral,
delGeneral, delGeneral,
uploadFiles uploadFiles,
} from 'api/base_info/general' } from "api/base_info/general";
import rsCode from '../../utils/rsCode' import rsCode from "../../utils/rsCode";
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import { getToken } from '../../utils/auth' import { getToken } from "../../utils/auth";
import Element1 from '../admin/menu/components/element' import Element1 from "../admin/menu/components/element";
import ElRow from 'element-ui/packages/row/src/row' import ElRow from "element-ui/packages/row/src/row";
import ElCol from 'element-ui/packages/col/src/col' import ElCol from "element-ui/packages/col/src/col";
export default { export default {
name: 'tourManage', name: "tourManage",
components: { components: {
ElCol, ElCol,
ElRow, ElRow,
Element1, Element1,
UE UE,
// Editor // Editor
}, },
data() { data() {
return { return {
multiple: true, multiple: true,
formDate: '', formDate: "",
listQuery: { listQuery: {
page: 1, page: 1,
limit: 20 limit: 20,
}, },
config: { config: {
initialFrameWidth: null, initialFrameWidth: null,
initialFrameHeight: 350 initialFrameHeight: 350,
}, },
tableKey: 0, tableKey: 0,
activeName2: '', activeName2: "",
modalTitle: '创建', modalTitle: "创建",
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
dialogVisible: false, //添加、编辑弹框 dialogVisible: false, //添加、编辑弹框
showLoadingBody: false, showLoadingBody: false,
dialogFrom: { dialogFrom: {
title: '', title: "",
type: undefined, type: undefined,
value: '', value: "",
minAmount: 100, minAmount: 100,
proceduReates: 0.001, proceduReates: 0.001,
amountOfMonth: '', amountOfMonth: "",
amountOfDay: '', amountOfDay: "",
maxNumberOfMonth: '', maxNumberOfMonth: "",
maxNumberOfDay: '', maxNumberOfDay: "",
withdrawWay: 1, withdrawWay: 1,
params: '' params: "",
}, },
rules: { rules: {
title: { title: {
type: 'string', type: "string",
required: true, required: true,
message: '请输入标题', message: "请输入标题",
trigger: 'blur' trigger: "blur",
}, },
type: { type: {
required: true, required: true,
message: '请输入数字标识' message: "请输入数字标识",
}, },
proceduReates: { proceduReates: {
required: true, required: true,
message: '请输入提现手续费' message: "请输入提现手续费",
}, },
minAmount: { minAmount: {
required: true, required: true,
message: '请输入最低提现金额' message: "请输入最低提现金额",
}, },
amountOfMonth: { amountOfMonth: {
required: true, required: true,
message: '请输入月额度' message: "请输入月额度",
}, },
amountOfDay: { amountOfDay: {
required: true, required: true,
message: '请输入日额度' message: "请输入日额度",
}, },
maxNumberOfMonth: { maxNumberOfMonth: {
required: true, required: true,
message: '请输入最多提现次数(月)' message: "请输入最多提现次数(月)",
}, },
maxNumberOfDay: { maxNumberOfDay: {
required: true, required: true,
message: '请输入最多提现次数(日)' message: "请输入最多提现次数(日)",
}, },
withdrawWay: { withdrawWay: {
required: true, required: true,
message: '请选择提现方式' message: "请选择提现方式",
} },
}, },
list: null, list: null,
total: null, total: null,
listLoading: true, listLoading: true,
inline: true inline: true,
} };
}, },
created() { created() {
this.getList() this.getList();
}, },
computed: { computed: {
...mapGetters(['elements', 'belong2Type']) ...mapGetters(["elements", "belong2Type"]),
}, },
methods: { methods: {
/** /**
* 添加 * 添加
* */ * */
handleCreate() { handleCreate() {
this.cleanDialogFrom() this.cleanDialogFrom();
this.modalTitle = '创建' this.modalTitle = "创建";
this.activeName2 = 'first' this.activeName2 = "first";
this.dialogVisible = true this.dialogVisible = true;
}, },
/** /**
* 操作-删除 * 操作-删除
* */ * */
deleteHandler(row) { deleteHandler(row) {
this.$confirm('确定删除吗?', '提示', { this.$confirm("确定删除吗?", "提示", {
confirmButtonText: '确定', confirmButtonText: "确定",
cancelButtonText: '取消', cancelButtonText: "取消",
type: 'warning' type: "warning",
}).then(() => { }).then(() => {
delGeneral(row.id).then(response => { delGeneral(row.id).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '删除成功', message: "删除成功",
type: 'success', type: "success",
duration: 2000 duration: 2000,
}) });
this.getList() this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '删除失败', title: "删除失败",
message: rsCode.msg[response.code] message: rsCode.msg[response.code]
? rsCode.msg[response.code] ? rsCode.msg[response.code]
: '操作失败!', : "操作失败!",
type: 'error', type: "error",
duration: 2000 duration: 2000,
}) });
}
})
})
},
/**
* 点击 X 关闭对话框的回调
**/
handleDialogClose() {
this.activeName2 = ''
this.dialogVisible = false
},
/**
* 操作-编辑
* */
handleUpdate(row) {
this.modalTitle = '编辑'
this.dialogVisible = true
this.cleanDialogFrom()
typeof row.params == 'object' ? delete row.params : row
this.dialogFrom = row
this.activeName2 = 'first'
},
/**
* 弹框-取消
* */
cancelHandel() {
this.cleanDialogFrom()
this.dialogVisible = false
this.activeName2 = ''
},
/**
* 新建、编辑清空表单
* */
cleanDialogFrom() {
this.dialogFrom = {
title: '',
type: undefined,
value: '',
minAmount: 100,
proceduReates: 0.001,
amountOfMonth: '',
amountOfDay: '',
maxNumberOfMonth: '',
maxNumberOfDay: '',
withdrawWay: 1,
params: ''
}
this.activeName2 = ''
},
handleSizeChange(val) {
this.listQuery.limit = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.page = val
this.getList()
},
/**
* 获取通用设置列表数据
* */
getList() {
this.listLoading = true
page(this.listQuery).then(response => {
let totalCountRs = undefined
let listRs = undefined
if (
!this.$utils.isEmpty(response.data.rows) &&
this.$utils.isInteger(response.data.total)
) {
response.data.rows.map(function(item) {
item.visible2 = false
if (item.type == 88) {
//提现规则
item.params = JSON.parse(item.params)
item.minAmount = item.params.minAmount
item.proceduReates = item.params.proceduReates
item.amountOfMonth = item.params.amountOfMonth
item.amountOfDay = item.params.amountOfDay
item.maxNumberOfMonth = item.params.maxNumberOfMonth
item.maxNumberOfDay = item.params.maxNumberOfDay
item.withdrawWay = item.params.withdrawWay
}
})
listRs = response.data.rows
totalCountRs = response.data.total
}
// "{"minAmount":"11","proceduReates":"0.02"}"
this.listLoading = false
this.list = listRs
this.total = totalCountRs
})
},
/**
* 创建
* */
create(formName) {
this.$refs.dialogFrom.validate(valid => {
if (valid) {
let params = {
title: this.dialogFrom.title,
type: this.dialogFrom.type,
value: this.dialogFrom.value,
params: this.dialogFrom.params
}
if (this.dialogFrom.type == 88) {
//提现规则
let p = {
minAmount: this.dialogFrom.minAmount,
proceduReates: this.dialogFrom.proceduReates,
amountOfMonth: this.dialogFrom.amountOfMonth,
amountOfDay: this.dialogFrom.amountOfDay,
maxNumberOfMonth: this.dialogFrom.maxNumberOfMonth,
maxNumberOfDay: this.dialogFrom.maxNumberOfDay,
withdrawWay: this.dialogFrom.withdrawWay
}
params.params = JSON.stringify(p)
} else {
params.params = this.dialogFrom.params
}
addGeneral(params).then(response => {
if (response.status === 200) {
this.cleanDialogFrom()
this.dialogVisible = false
this.$notify({
title: '成功',
message: '添加成功',
type: 'success',
duration: 2000
})
this.getList()
} else {
this.$notify({
title: '添加失败',
message: rsCode.msg[response.code]
? rsCode.msg[response.code]
: '操作失败!',
type: 'error',
duration: 2000
})
}
})
} else {
return false
}
})
},
/**
* 编辑-更新
* */
update(formName) {
this.$refs.dialogFrom.validate(valid => {
if (valid) {
let params = {
id: this.dialogFrom.id,
title: this.dialogFrom.title,
type: this.dialogFrom.type,
value: this.dialogFrom.value,
params: this.dialogVisible.params
}
if (this.dialogFrom.type == 88) {
//提现规则
let p = {
minAmount: this.dialogFrom.minAmount,
proceduReates: this.dialogFrom.proceduReates,
amountOfMonth: this.dialogFrom.amountOfMonth,
amountOfDay: this.dialogFrom.amountOfDay,
maxNumberOfMonth: this.dialogFrom.maxNumberOfMonth,
maxNumberOfDay: this.dialogFrom.maxNumberOfDay,
withdrawWay: this.dialogFrom.withdrawWay
}
params.params = JSON.stringify(p)
} else {
params.params = this.dialogFrom.params
} }
});
});
},
/**
* 点击 X 关闭对话框的回调
**/
handleDialogClose() {
this.activeName2 = "";
this.dialogVisible = false;
},
/**
* 操作-编辑
* */
handleUpdate(row) {
this.modalTitle = "编辑";
this.dialogVisible = true;
this.cleanDialogFrom();
typeof row.params == "object" ? delete row.params : row;
this.dialogFrom = row;
if (row.type == 66) {
this.dialogFrom.closedVehicleAmout = JSON.parse(
row.params
).closedVehicleAmout;
this.dialogFrom.orderExtract = JSON.parse(row.params).orderExtract;
this.dialogFrom.platformExtract = JSON.parse(
row.params
).platformExtract;
}
this.activeName2 = "first";
},
/**
* 弹框-取消
* */
cancelHandel() {
this.cleanDialogFrom();
this.dialogVisible = false;
this.activeName2 = "";
},
/**
* 新建、编辑清空表单
* */
cleanDialogFrom() {
this.dialogFrom = {
title: "",
type: undefined,
value: "",
minAmount: 100,
proceduReates: 0.001,
amountOfMonth: "",
amountOfDay: "",
maxNumberOfMonth: "",
maxNumberOfDay: "",
withdrawWay: 1,
params: "",
};
this.activeName2 = "";
},
handleSizeChange(val) {
this.listQuery.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.listQuery.page = val;
this.getList();
},
/**
* 获取通用设置列表数据
* */
getList() {
this.listLoading = true;
page(this.listQuery).then((response) => {
let totalCountRs = undefined;
let listRs = undefined;
if (
!this.$utils.isEmpty(response.data.rows) &&
this.$utils.isInteger(response.data.total)
) {
response.data.rows.map(function (item) {
item.visible2 = false;
if (item.type == 88) {
//提现规则
item.params = JSON.parse(item.params);
item.minAmount = item.params.minAmount;
item.proceduReates = item.params.proceduReates;
item.amountOfMonth = item.params.amountOfMonth;
item.amountOfDay = item.params.amountOfDay;
item.maxNumberOfMonth = item.params.maxNumberOfMonth;
item.maxNumberOfDay = item.params.maxNumberOfDay;
item.withdrawWay = item.params.withdrawWay;
}
});
listRs = response.data.rows;
totalCountRs = response.data.total;
}
// "{"minAmount":"11","proceduReates":"0.02"}"
this.listLoading = false;
this.list = listRs;
this.total = totalCountRs;
});
},
/**
* 创建
* */
create(formName) {
this.$refs.dialogFrom.validate((valid) => {
if (valid) {
let params = {
title: this.dialogFrom.title,
type: this.dialogFrom.type,
value: this.dialogFrom.value,
params: this.dialogFrom.params,
};
if (this.dialogFrom.type == 88) {
//提现规则
let p = {
minAmount: this.dialogFrom.minAmount,
proceduReates: this.dialogFrom.proceduReates,
amountOfMonth: this.dialogFrom.amountOfMonth,
amountOfDay: this.dialogFrom.amountOfDay,
maxNumberOfMonth: this.dialogFrom.maxNumberOfMonth,
maxNumberOfDay: this.dialogFrom.maxNumberOfDay,
withdrawWay: this.dialogFrom.withdrawWay,
};
params.params = JSON.stringify(p);
} else {
params.params = this.dialogFrom.params;
}
addGeneral(params).then((response) => {
if (response.status === 200) {
this.cleanDialogFrom();
this.dialogVisible = false;
this.$notify({
title: "成功",
message: "添加成功",
type: "success",
duration: 2000,
});
this.getList();
} else {
this.$notify({
title: "添加失败",
message: rsCode.msg[response.code]
? rsCode.msg[response.code]
: "操作失败!",
type: "error",
duration: 2000,
});
}
});
} else {
return false;
}
});
},
/**
* 编辑-更新
* */
update(formName) {
this.$refs.dialogFrom.validate((valid) => {
if (valid) {
let params = {
id: this.dialogFrom.id,
title: this.dialogFrom.title,
type: this.dialogFrom.type,
value: this.dialogFrom.value,
params: this.dialogVisible.params,
};
if (this.dialogFrom.type == 88) {
//提现规则
let p = {
minAmount: this.dialogFrom.minAmount,
proceduReates: this.dialogFrom.proceduReates,
amountOfMonth: this.dialogFrom.amountOfMonth,
amountOfDay: this.dialogFrom.amountOfDay,
maxNumberOfMonth: this.dialogFrom.maxNumberOfMonth,
maxNumberOfDay: this.dialogFrom.maxNumberOfDay,
withdrawWay: this.dialogFrom.withdrawWay,
};
params.params = JSON.stringify(p);
} else {
params.params = this.dialogFrom.params;
}
editGeneral(params).then(response => { editGeneral(params).then((response) => {
if (response.status === 200) { if (response.status === 200) {
this.cleanDialogFrom() this.cleanDialogFrom();
this.dialogVisible = false this.dialogVisible = false;
this.$notify({ this.$notify({
title: '成功', title: "成功",
message: '编辑成功', message: "编辑成功",
type: 'success', type: "success",
duration: 2000 duration: 2000,
}) });
this.getList() this.getList();
} else { } else {
this.$notify({ this.$notify({
title: '编辑失败', title: "编辑失败",
message: rsCode.msg[response.code] message: rsCode.msg[response.code]
? rsCode.msg[response.code] ? rsCode.msg[response.code]
: '操作失败!', : "操作失败!",
type: 'error', type: "error",
duration: 2000 duration: 2000,
}) });
} }
}) });
} else { } else {
return false return false;
} }
}) });
}, },
/** /**
* 富文本 营地详情 * 富文本 营地详情
* */ * */
editorReadyEvent(instance) { editorReadyEvent(instance) {
let t = this let t = this;
instance.addListener('contentChange', () => { instance.addListener("contentChange", () => {
if (t.activeName2 == 'first') { if (t.activeName2 == "first") {
t.dialogFrom.value = instance.getContent() t.dialogFrom.value = instance.getContent();
} }
}) });
}, },
uploadFile(file) { uploadFile(file) {
this.formDate.append('files', file.file) this.formDate.append("files", file.file);
}, },
subPicForm() { subPicForm() {
this.formDate = new FormData() this.formDate = new FormData();
this.$refs.upload.submit() this.$refs.upload.submit();
this.formDate.append('WS_CODE', '12133') this.formDate.append("WS_CODE", "12133");
let config = { let config = {
headers: { headers: {
'Content-Type': 'multipart/form-data' "Content-Type": "multipart/form-data",
} },
} };
uploadFiles(this.formDate) uploadFiles(this.formDate)
.then(res => { .then((res) => {})
}) .catch((res) => {});
.catch(res => { },
}) },
} };
}
}
</script> </script>
<style> <style>
.v-modal { .v-modal {
z-index: 1000 !important; z-index: 1000 !important;
} }
.el-dialog__wrapper { .el-dialog__wrapper {
z-index: 1008 !important; z-index: 1008 !important;
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment