| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- <?php
- use common\helpers\ComponentHelper;
- ?>
- <div id="app" v-cloak>
- <el-card class="box-card" v-loading="loading" shadow="never" style="border:0;min-width: 1200px;" body-style="background-color: #f3f3f3;padding: 10px 0 0;">
- <div slot="header">
- <div>
- <span>基础设置</span>
- </div>
- </div>
- <div class="form_box">
- <el-form :model="ruleForm" :rules="rules" size="small" ref="ruleForm" label-width="150px">
- <el-card shadow="never">
- <div slot="header">
- <div>
- <span>基础设置</span>
- </div>
- </div>
- <div>
- <el-row>
- <el-col :span="16">
- <el-form-item label="提现开启验证码校验" prop="is_enable">
- <div>
- <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0">
- </el-switch>
- </div>
- </el-form-item>
- <el-form-item label="原商城绑定的手机" prop="cash_mobile">
- <el-col :span="6">
- {{ruleForm.mobile}}
- </el-col>
- </el-form-item>
- <el-form-item label="修改提现审核手机号" prop="cash_mobile">
- <el-col :span="6">
- <el-input size="small" v-model="ruleForm.cash_mobile" placeholder="请输入提现审核接收验证码手机号" autocomplete="off"></el-input>
- </el-col>
- </el-form-item>
- <el-form-item label="商城手机验证码" prop="captcha">
- <el-col :span="6">
- <el-input size="small" v-model="ruleForm.captcha" placeholder="请输入商城绑定的手机验证码" autocomplete="off"></el-input>
- </el-col>
- <el-button size="mini" type="text" icon="" style="padding: 0 10px;margin-left:6px;background-color:#409EFF;color:#fff;height:32px;" :disabled="is_disabled" @click="sendCaptcha">发送验证码</el-button>
- </el-form-item>
- </el-col>
- </el-row>
- </div>
- <div class="nitoce">
- <div style="padding: 5px 0">提现风控:</div>
- <div style="padding: 5px 0">1.防止未经过老板确认,私自发放提现佣金,导致财务损失!财务每次操作提现审核按钮需要输入老板指定手机号的验证码,才可以才做提现审核。</div>
- <div style="padding: 5px 0">2.更改验证手机需要商城绑定的手机号码验证码才可以修改。</div>
- <div style="padding: 5px 0">3.验证码间隔45分钟未操作提现审核,需要重新输入验证码,防止验证码一直长期有效。</div>
- </div>
- </el-card>
- </el-form>
- <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="store('ruleForm')" size="small">保存
- </el-button>
- </div>
- </el-card>
- </div>
- <script>
- const app = new Vue({
- el: '#app',
- data() {
- return {
- loading: false,
- btnLoading: false,
- cat_show: false,
- show_share_level: false,
- is_disabled: false,
- mall_id : 0,
- ruleForm: {
- is_enable: 0,
- captcha: '',
- mobile: '',
- cash_mobile: ''
- },
- rules: {
- captcha: [{
- required: true,
- message: '请输入验证码',
- trigger: 'change'
- }],
- cash_mobile: [{
- required: true,
- message: '请输入提现审核接收验证码手机号',
- trigger: 'change'
- }],
- }
- }
- },
- mounted: function() {
- this.loadData();
- },
- methods: {
- loadData() {
- this.loading = true;
- request({
- params: {
- r: 'cash-risk/default/index',
- },
- method: 'get'
- }).then(e => {
- console.log('e:', e);
- this.loading = false;
- if (e.data.code == 0) {
- Object.assign(this.ruleForm, e.data.data);
- this.ruleForm.commission = e.data.data.commission;
- this.ruleForm.score = e.data.data.score;
- this.mall_id = e.data.data.mall_id;
- }
- }).catch(e => {
- this.loading = false;
- this.$message.error(e);
- })
- },
- store(formName) {
- let title_obj = {};
- this.$nextTick(() => {
- let elFormItemLabelDom = document.getElementsByClassName("el-form-item__label");
- for (let i = 0; i < elFormItemLabelDom.length; i++) {
- let labKey = elFormItemLabelDom[i].getAttribute("for");
- let labVal = elFormItemLabelDom[i].innerText;
- title_obj[labKey] = labVal;
- }
- })
- this.$refs[formName].validate((valid) => {
- if (valid) {
- this.btnLoading = true;
- request({
- params: {
- r: 'cash-risk/default/index',
- },
- method: 'post',
- data: {
- basic: this.ruleForm,
- }
- }).then(e => {
- this.btnLoading = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg);
- location. reload();
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error(e);
- this.btnLoading = false;
- })
- } else {
- this.btnLoading = false;
- console.log('error submit!!');
- return false;
- }
- });
- },
- sendCaptcha() {
- this.is_disabled = true;
- if (!this.ruleForm.mobile) {
- this.$message.error('商城未绑定手机号');
- return false;
- }
- request({
- params: {
- r: 'common/sms/send',
- },
- method: 'post',
- data: {
- //captcha: this.ruleForm.captcha,
- mobile: this.ruleForm.mobile,
- sms_type: 'cash_risk_config',
- valid_time: 20,
- mall_id : this.mall_id
- }
- }).then(e => {
- this.is_disabled = false;
- if (e.data.code == 0) {
- this.$message.success(e.data.msg + ',验证码已发送到:' + this.ruleForm.mobile);
- } else {
- this.$message.error(e.data.msg);
- }
- }).catch(e => {
- this.$message.error(e);
- this.btnLoading = false;
- })
- }
- }
- });
- </script>
- <style>
- .form_box {
- background-color: #f3f3f3;
- padding: 0 0 20px;
- }
- .button-item {
- margin-top: 12px;
- padding: 9px 25px;
- }
- .el-input-group__append {
- background-color: #fff;
- color: #353535;
- }
- .nitoce {
- margin: 10px 0 20px 0;
- /* border: 1px solid #ccc; */
- border-radius: 5px;
- /* background: #ccc; */
- color: #ff0303;
- font-size: 15px;
- /* font-weight: 900; */
- }
- </style>
|