rateSetting.vue 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <!-- -->
  2. <template>
  3. <div>
  4. <el-alert
  5. title="手续费设置"
  6. type="info"
  7. :closable="false"
  8. style="margin-bottom: 20px"
  9. ></el-alert>
  10. <el-form ref="form" label-position="top" :model="form" label-width="120px" :inline="true">
  11. <el-form-item label="手续费费率" prop="chargeRate"
  12. :rules="[{ required: true, message: '请输入手续费费率', trigger: 'blur' }]">
  13. <template slot="label">
  14. 手续费费率
  15. <el-tooltip placement="top" popper-class="mTooltip">
  16. <div slot="content">
  17. 每笔交易支付通道收取的手续费比例
  18. </div>
  19. <i
  20. class="el-icon-question"
  21. style="
  22. font-size: 18px;
  23. color: #f56c6c;
  24. position: relative;
  25. top: 2px;
  26. "
  27. ></i>
  28. </el-tooltip>
  29. </template>
  30. <el-input
  31. :disabled="isDisabled"
  32. v-model="form.chargeRate"
  33. @keyup.native='keyupEvent($event)'
  34. placeholder="请输入手续费费率"
  35. style="width: 238px;"
  36. type="number"
  37. >
  38. <div slot="append">‰</div>
  39. </el-input>
  40. </el-form-item>
  41. </el-form>
  42. </div>
  43. </template>
  44. <script>
  45. export default {
  46. props: ['type', 'data'],
  47. data () {
  48. return {
  49. form: {
  50. id: null,
  51. chargeRate: null
  52. }
  53. };
  54. },
  55. computed: {
  56. isDisabled() {
  57. return this.type == 'setting' ? true : false
  58. }
  59. },
  60. mounted () {
  61. if(this.data) {
  62. this.form.id = this.data.id
  63. this.form.chargeRate = this.data.chargeRate
  64. }
  65. },
  66. methods: {
  67. onSubmit() {
  68. let status = false
  69. this.$refs.form.validate(_ => {
  70. status = _
  71. })
  72. return status
  73. },
  74. getValues() {
  75. return this.form
  76. },
  77. },
  78. };
  79. </script>
  80. <style lang='scss' scoped>
  81. .el-input, .el-select {
  82. width: 300px !important;
  83. }
  84. </style>