index.php 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. use common\helpers\ComponentHelper;
  3. ?>
  4. <div id="app" v-cloak>
  5. <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;">
  6. <div slot="header">
  7. <div>
  8. <span>基础设置</span>
  9. </div>
  10. </div>
  11. <div class="form_box">
  12. <el-form :model="ruleForm" :rules="rules" size="small" ref="ruleForm" label-width="150px">
  13. <el-card shadow="never">
  14. <div slot="header">
  15. <div>
  16. <span>基础设置</span>
  17. </div>
  18. </div>
  19. <div>
  20. <el-row>
  21. <el-col :span="16">
  22. <el-form-item label="提现开启验证码校验" prop="is_enable">
  23. <div>
  24. <el-switch v-model="ruleForm.is_enable" :active-value="1" :inactive-value="0">
  25. </el-switch>
  26. </div>
  27. </el-form-item>
  28. <el-form-item label="原商城绑定的手机" prop="cash_mobile">
  29. <el-col :span="6">
  30. {{ruleForm.mobile}}
  31. </el-col>
  32. </el-form-item>
  33. <el-form-item label="修改提现审核手机号" prop="cash_mobile">
  34. <el-col :span="6">
  35. <el-input size="small" v-model="ruleForm.cash_mobile" placeholder="请输入提现审核接收验证码手机号" autocomplete="off"></el-input>
  36. </el-col>
  37. </el-form-item>
  38. <el-form-item label="商城手机验证码" prop="captcha">
  39. <el-col :span="6">
  40. <el-input size="small" v-model="ruleForm.captcha" placeholder="请输入商城绑定的手机验证码" autocomplete="off"></el-input>
  41. </el-col>
  42. <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>
  43. </el-form-item>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. <div class="nitoce">
  48. <div style="padding: 5px 0">提现风控:</div>
  49. <div style="padding: 5px 0">1.防止未经过老板确认,私自发放提现佣金,导致财务损失!财务每次操作提现审核按钮需要输入老板指定手机号的验证码,才可以才做提现审核。</div>
  50. <div style="padding: 5px 0">2.更改验证手机需要商城绑定的手机号码验证码才可以修改。</div>
  51. <div style="padding: 5px 0">3.验证码间隔45分钟未操作提现审核,需要重新输入验证码,防止验证码一直长期有效。</div>
  52. </div>
  53. </el-card>
  54. </el-form>
  55. <el-button :loading="btnLoading" class="button-item" type="primary" style="margin-top: 24px;" @click="store('ruleForm')" size="small">保存
  56. </el-button>
  57. </div>
  58. </el-card>
  59. </div>
  60. <script>
  61. const app = new Vue({
  62. el: '#app',
  63. data() {
  64. return {
  65. loading: false,
  66. btnLoading: false,
  67. cat_show: false,
  68. show_share_level: false,
  69. is_disabled: false,
  70. mall_id : 0,
  71. ruleForm: {
  72. is_enable: 0,
  73. captcha: '',
  74. mobile: '',
  75. cash_mobile: ''
  76. },
  77. rules: {
  78. captcha: [{
  79. required: true,
  80. message: '请输入验证码',
  81. trigger: 'change'
  82. }],
  83. cash_mobile: [{
  84. required: true,
  85. message: '请输入提现审核接收验证码手机号',
  86. trigger: 'change'
  87. }],
  88. }
  89. }
  90. },
  91. mounted: function() {
  92. this.loadData();
  93. },
  94. methods: {
  95. loadData() {
  96. this.loading = true;
  97. request({
  98. params: {
  99. r: 'cash-risk/default/index',
  100. },
  101. method: 'get'
  102. }).then(e => {
  103. console.log('e:', e);
  104. this.loading = false;
  105. if (e.data.code == 0) {
  106. Object.assign(this.ruleForm, e.data.data);
  107. this.ruleForm.commission = e.data.data.commission;
  108. this.ruleForm.score = e.data.data.score;
  109. this.mall_id = e.data.data.mall_id;
  110. }
  111. }).catch(e => {
  112. this.loading = false;
  113. this.$message.error(e);
  114. })
  115. },
  116. store(formName) {
  117. let title_obj = {};
  118. this.$nextTick(() => {
  119. let elFormItemLabelDom = document.getElementsByClassName("el-form-item__label");
  120. for (let i = 0; i < elFormItemLabelDom.length; i++) {
  121. let labKey = elFormItemLabelDom[i].getAttribute("for");
  122. let labVal = elFormItemLabelDom[i].innerText;
  123. title_obj[labKey] = labVal;
  124. }
  125. })
  126. this.$refs[formName].validate((valid) => {
  127. if (valid) {
  128. this.btnLoading = true;
  129. request({
  130. params: {
  131. r: 'cash-risk/default/index',
  132. },
  133. method: 'post',
  134. data: {
  135. basic: this.ruleForm,
  136. }
  137. }).then(e => {
  138. this.btnLoading = false;
  139. if (e.data.code == 0) {
  140. this.$message.success(e.data.msg);
  141. location. reload();
  142. } else {
  143. this.$message.error(e.data.msg);
  144. }
  145. }).catch(e => {
  146. this.$message.error(e);
  147. this.btnLoading = false;
  148. })
  149. } else {
  150. this.btnLoading = false;
  151. console.log('error submit!!');
  152. return false;
  153. }
  154. });
  155. },
  156. sendCaptcha() {
  157. this.is_disabled = true;
  158. if (!this.ruleForm.mobile) {
  159. this.$message.error('商城未绑定手机号');
  160. return false;
  161. }
  162. request({
  163. params: {
  164. r: 'common/sms/send',
  165. },
  166. method: 'post',
  167. data: {
  168. //captcha: this.ruleForm.captcha,
  169. mobile: this.ruleForm.mobile,
  170. sms_type: 'cash_risk_config',
  171. valid_time: 20,
  172. mall_id : this.mall_id
  173. }
  174. }).then(e => {
  175. this.is_disabled = false;
  176. if (e.data.code == 0) {
  177. this.$message.success(e.data.msg + ',验证码已发送到:' + this.ruleForm.mobile);
  178. } else {
  179. this.$message.error(e.data.msg);
  180. }
  181. }).catch(e => {
  182. this.$message.error(e);
  183. this.btnLoading = false;
  184. })
  185. }
  186. }
  187. });
  188. </script>
  189. <style>
  190. .form_box {
  191. background-color: #f3f3f3;
  192. padding: 0 0 20px;
  193. }
  194. .button-item {
  195. margin-top: 12px;
  196. padding: 9px 25px;
  197. }
  198. .el-input-group__append {
  199. background-color: #fff;
  200. color: #353535;
  201. }
  202. .nitoce {
  203. margin: 10px 0 20px 0;
  204. /* border: 1px solid #ccc; */
  205. border-radius: 5px;
  206. /* background: #ccc; */
  207. color: #ff0303;
  208. font-size: 15px;
  209. /* font-weight: 900; */
  210. }
  211. </style>