tb-account-manager.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport"
  6. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  7. <!-- 所有的 css js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/jquery.min.js"></script>
  13. <script src="../../static/kj/layer/layer.js"></script>
  14. <script src="../../static/sa.js"></script>
  15. </head>
  16. <body>
  17. <div id='account' style="padding: 10px;">
  18. <el-row :gutter="15">
  19. <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
  20. <el-col :span="24">
  21. <el-form-item label="账户:" prop="accountNo">
  22. {{formData.accountNo}}
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="24">
  26. <el-form-item label="总金额:" prop="totalMoney">
  27. {{formData.totalMoney}}元
  28. </el-form-item>
  29. </el-col>
  30. <el-col :span="24" v-if="sa.isAuth('tb-costomer-account-charge')">
  31. <el-form-item label="充值(元):" prop="money">
  32. <el-input-number v-model="money" placeholder="请输入充值金额" :step='1' step-strictly
  33. :precision='1' controls-position=right :min='0'></el-input-number>
  34. </el-form-item>
  35. </el-col>
  36. <el-col :span="12" v-if="sa.isAuth('tb-costomer-account-charge')">
  37. <el-form-item label="" prop="field108">
  38. <el-button type="primary" icon="el-icon-check" size="medium" @click="submitForm"> 确认充值
  39. </el-button>
  40. </el-form-item>
  41. </el-col>
  42. <el-col :span="12">
  43. <el-form-item label="" prop="field109">
  44. <el-button type="info" icon="el-icon-close" size="medium" @click="sa.closeCurrIframe()"> 关闭
  45. </el-button>
  46. </el-form-item>
  47. </el-col>
  48. </el-form>
  49. </el-row>
  50. <el-dialog title="核验身份" :visible="modal.visible" width="500px">
  51. <el-form size="mini">
  52. <div class="c-item br">
  53. <label class="c-label"><label style="color: red">*</label>登录密码:</label>
  54. <el-input placeholder="请输入登录密码" v-model="modal.form.password"></el-input>
  55. </div>
  56. </el-form>
  57. <span slot="footer" class="dialog-footer">
  58. <el-button @click="modal.visible=false">关闭</el-button>
  59. <el-button type="primary" @click="subFn">确定</el-button>
  60. </span>
  61. </el-dialog>
  62. </div>
  63. <script>
  64. var app = new Vue({
  65. el: '#account',
  66. data: {
  67. customerId: sa.p('customerId', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  68. formData: {
  69. accountNo: '',
  70. totalMoney: '',
  71. lockMoney: '',
  72. actMoney: '',
  73. },
  74. money: '',
  75. rules: {
  76. money: [{
  77. required: true,
  78. message: '请输入充值金额',
  79. trigger: 'blur'
  80. }],
  81. },
  82. modal: {
  83. visible: false,
  84. form: {
  85. password: ''
  86. }
  87. }
  88. },
  89. methods: {
  90. subFn() {
  91. },
  92. submitForm() {
  93. if (!this.money || this.money < 0) {
  94. sa.alert('请输入充值金额')
  95. return;
  96. }
  97. sa.ajax('/TbAccount/recharge', {
  98. customerId: this.customerId,
  99. money: this.money
  100. }, function (resp) {
  101. sa.alert('充值成功');
  102. setTimeout(() => {
  103. sa.closeCurrIframe();
  104. }, 1500)
  105. }.bind(this))
  106. },
  107. getCustomerAccount() {
  108. sa.ajax('/TbAccount/getCustomerAccount', {
  109. customerId: this.customerId
  110. }, function (resp) {
  111. this.formData = resp.data;
  112. }.bind(this))
  113. }
  114. },
  115. mounted: function () {
  116. this.getCustomerAccount()
  117. }
  118. })
  119. </script>
  120. </body>
  121. </html>