tb-people-bank.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>银行卡修改</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  8. <!-- 所有的 css js 资源 -->
  9. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
  12. <script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
  13. <script src="https://unpkg.com/jquery@3.4.1/dist/jquery.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <script src="../../static/kj/upload-util.js"></script>
  17. <style type="text/css">
  18. .c-panel .el-form .c-label {
  19. width: 7em !important;
  20. }
  21. .c-panel .el-form .el-input,
  22. .c-panel .el-form .el-textarea__inner {
  23. width: 350px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <div class="vue-box" :class="{sbot: id}" style="display: none;" :style="'display: block;'">
  29. <!-- ------- 内容部分 ------- -->
  30. <div class="s-body">
  31. <div class="c-panel">
  32. <el-form size="mini" v-if="m">
  33. <el-row>
  34. <div class="c-item br">
  35. <label class="c-label">银行:</label>
  36. <el-select v-model="m.bankName" placeholder="请选择" filterable size="mini">
  37. <el-option label="请选择" :value="0" disabled></el-option>
  38. <el-option v-for="(item,index) in bankList" :key="index" :label="item.bankName"
  39. :value="item.bankName"> </el-option>
  40. </el-select>
  41. </div>
  42. <div class="c-item br">
  43. <label class="c-label">银行卡号:</label>
  44. <el-input size="mini" v-model="m.bankCode"></el-input>
  45. </div>
  46. </el-row>
  47. <div class="c-item br s-ok">
  48. <label class="c-label"></label>
  49. <el-button size="mini" type="primary" icon="el-icon-plus" @click="ok()">保存</el-button>
  50. </div>
  51. </el-form>
  52. </div>
  53. </div>
  54. <!-- ------- 底部按钮 ------- -->
  55. <div class="s-foot">
  56. <el-button size="mini" type="primary" @click="ok()">确定</el-button>
  57. <el-button size="mini" @click="sa.closeCurrIframe()">取消</el-button>
  58. </div>
  59. </div>
  60. <script>
  61. var app = new Vue({
  62. el: '.vue-box',
  63. data: {
  64. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  65. m: {
  66. id: '', // 主键
  67. bankName: '', // 银行名称
  68. bankCode: '', // 银行卡号
  69. }, // 实体对象
  70. bankList: []
  71. },
  72. methods: {
  73. getBankList() {
  74. sa.ajax('/sp-admin/TbBank/getAll', function(resp) {
  75. this.bankList = resp.data;
  76. }.bind(this));
  77. },
  78. // 提交数据
  79. ok: function() {
  80. if (this.id > 0) {
  81. sa.ajax('/level-one-server/TbPeople/saveBankInfo', {id:this.id,bankName:this.m.bankName,bankAccount:this.m.bankCode}, function(res) {
  82. sa.alert('修改成功', this.clean);
  83. }.bind(this));
  84. }
  85. },
  86. // 添加/修改 完成后的动作
  87. clean: function() {
  88. parent.app.f5(); // 刷新父页面列表
  89. sa.closeCurrIframe(); // 关闭本页
  90. },
  91. initFn() {
  92. // 初始化数据
  93. if (this.id > 0) {
  94. sa.ajax('/level-one-server/TbPeople/getById?id=' + this.id, function(res) {
  95. this.m = res.data;
  96. if (res.data == null) {
  97. sa.alert('未能查找到 id=' + this.id + " 详细数据");
  98. }
  99. }.bind(this))
  100. };
  101. }
  102. },
  103. mounted: function() {
  104. this.initFn()
  105. this.getBankList()
  106. }
  107. })
  108. </script>
  109. </body>
  110. </html>