移动端
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

148 lignes
4.4 KiB

  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="$router.back(-1)"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加开户行</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form @submit="goModify" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  14. <div class="main_box">
  15. <van-field label="省" required :rules="[{ required: true , message:'请输入省' }]" v-model="form.sheng" placeholder="请输入省" input-align="right" label-width="auto"/>
  16. <van-field label="市" required :rules="[{ required: true , message:'请输入市' }]" v-model="form.shi" placeholder="请输入市" input-align="right" label-width="auto"/>
  17. <van-field
  18. readonly
  19. clickable
  20. label="所属银行"
  21. placeholder="请选择"
  22. v-model="bankType"
  23. @click="showBankType = true"
  24. input-align="right"
  25. right-icon="arrow-down"
  26. label-width="auto"
  27. required
  28. :rules="[{ required: true , message:'请选择所属银行' }]"
  29. />
  30. <van-popup v-model="showBankType" position="bottom">
  31. <van-picker
  32. show-toolbar
  33. :columns="bankTypeOptions"
  34. @confirm="onConfirmBankType"
  35. @cancel="showBankType = false"
  36. />
  37. </van-popup>
  38. <van-field label="开户行" required :rules="[{ required: true , message:'请输入开户行' }]" v-model="form.bankDeposit" placeholder="请输入开户行" input-align="right" label-width="auto"/>
  39. <van-field label="联行号" required :rules="[{ required: true , message:'请输入联行号' }]" v-model="form.payeePaymentLines" placeholder="请输入联行号" input-align="right" label-width="auto"/>
  40. <van-field label="机构号" v-model="form.institutionNumber" placeholder="请输入机构号" input-align="right" label-width="auto"/>
  41. </div>
  42. <div style="padding: 16px 0;">
  43. <van-row>
  44. <van-col span="24" align="center">
  45. <van-button type="info" native-type="submit" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  46. </van-col>
  47. </van-row>
  48. <div class="clear"></div>
  49. </div>
  50. </van-form>
  51. </div>
  52. </template>
  53. <script>
  54. import { addDeposit } from "@/api/onlineHome/bankAgriculture/bankOfDeposit";
  55. export default {
  56. name: "paymentAccountAdd",
  57. data() {
  58. return {
  59. showBankType:false,
  60. bankType:'',
  61. // 所属银行字典
  62. bankTypeOptions: [],
  63. form:{
  64. sheng: "", //省 必填
  65. shi: "", //市 必填
  66. bankType: "", //所属银行 必填
  67. bankDeposit: "", //开户行 必填
  68. payeePaymentLines: "", //联行号 //必填
  69. }
  70. };
  71. },
  72. created() {
  73. this.getDetail();
  74. },
  75. methods: {
  76. validator(val){
  77. return /^\d{6,}$/.test(val);
  78. },
  79. getDetail(){
  80. // 所属银行
  81. this.getDicts("bank_type_all").then(res => {
  82. for (var i = 0; i < res.data.length; i++) {
  83. this.bankTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  84. }
  85. });
  86. },
  87. getError(e){
  88. this.$notify({ type: 'danger', message: e.errors[0].message });
  89. },
  90. onConfirmBankType(val){
  91. this.showBankType = false
  92. this.bankType = val.text
  93. this.$set(this.form, "bankType", val.value);
  94. },
  95. goModify(){
  96. console.log(this.form)
  97. this.form.balance = this.form.initialBalance;
  98. addDeposit(this.form).then((response) => {
  99. this.$toast.success('添加成功');
  100. setTimeout(function(){
  101. history.go(-1)
  102. },2000)
  103. });
  104. },
  105. goBack(){
  106. window.history.go(-1)
  107. }
  108. },
  109. }
  110. </script>
  111. <style scoped lang="scss">
  112. .app-container {
  113. padding: 2% 0;
  114. }
  115. .main_title{
  116. font-size: 0.4rem;
  117. color: #1D6FE9;
  118. margin: 0.2rem 6%;
  119. margin-top: 0;
  120. position: relative;
  121. }
  122. .main_box{
  123. width: 96%;
  124. margin: 0 auto;
  125. border-radius: 6px;
  126. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  127. overflow: hidden;
  128. background-color: #FFF;
  129. }
  130. .submitButton{
  131. width: 80%;
  132. margin: 0 auto;
  133. background-color: #1D6FE9;
  134. }
  135. .addFamily{
  136. position: absolute;
  137. top: -2px;
  138. right: 0;
  139. border-radius: 50%;
  140. }
  141. </style>