second-apply.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="photo-msg">
  3. <Form ref="secondForm" :model="form" :rules="rules" :label-width="140">
  4. <h4>基础信息</h4>
  5. <FormItem prop="settlementBankAccountName" label="银行开户名">
  6. <Input
  7. type="text"
  8. v-model="form.settlementBankAccountName"
  9. placeholder="请填写银行开户名称"
  10. />
  11. </FormItem>
  12. <FormItem prop="settlementBankAccountNum" label="银行账号">
  13. <Input
  14. type="text"
  15. v-model="form.settlementBankAccountNum"
  16. placeholder="请填写银行账号"
  17. />
  18. </FormItem>
  19. <FormItem prop="settlementBankBranchName" label="开户银行支行名称">
  20. <Input
  21. type="text"
  22. v-model="form.settlementBankBranchName"
  23. placeholder="请填写开户银行支行名称"
  24. />
  25. </FormItem>
  26. <FormItem prop="settlementBankJointName" label="支行联行号">
  27. <Input
  28. type="text"
  29. v-model="form.settlementBankJointName"
  30. placeholder="请填写支行联行号"
  31. />
  32. </FormItem>
  33. <FormItem>
  34. <Button @click="$emit('change', 0)">返回</Button>
  35. <Button type="primary" :loading="loading" @click="next"
  36. >填写其他信息</Button
  37. >
  38. </FormItem>
  39. </Form>
  40. </div>
  41. </template>
  42. <script>
  43. import { applySecond } from '@/api/shopentry';
  44. export default {
  45. props: {
  46. content: {
  47. default: {},
  48. type: Object
  49. }
  50. },
  51. data () {
  52. return {
  53. loading: false, // 加载状态
  54. form: {}, // 表单数据
  55. rules: { // 验证规则
  56. settlementBankAccountName: [
  57. { required: true, message: '请填写银行开户名称' }
  58. ],
  59. settlementBankAccountNum: [
  60. { required: true, message: '请填写银行账号' }
  61. ],
  62. settlementBankBranchName: [
  63. { required: true, message: '请填写开户银行支行名称' }
  64. ],
  65. settlementBankJointName: [
  66. { required: true, message: '请填写支行联行号' }
  67. ]
  68. }
  69. };
  70. },
  71. methods: {
  72. next () {
  73. this.$refs.secondForm.validate((valid) => {
  74. if (valid) {
  75. this.loading = true;
  76. applySecond(this.form)
  77. .then((res) => {
  78. this.loading = false;
  79. if (res.success) this.$emit('change', 2);
  80. })
  81. .catch(() => {
  82. this.loading = false;
  83. });
  84. } else {
  85. console.log('error');
  86. }
  87. });
  88. }
  89. },
  90. mounted () {
  91. if (this.content != {}) {
  92. this.form = JSON.parse(JSON.stringify(this.content));
  93. this.$forceUpdate();
  94. }
  95. }
  96. };
  97. </script>
  98. <style lang="scss" scoped>
  99. h4 {
  100. margin-bottom: 10px;
  101. padding: 0 10px;
  102. border: 1px solid #ddd;
  103. background-color: #f8f8f8;
  104. font-weight: bold;
  105. color: #333;
  106. font-size: 14px;
  107. line-height: 40px;
  108. text-align: left;
  109. }
  110. .ivu-input-wrapper {
  111. width: 300px;
  112. }
  113. </style>