移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

collectionAdd2.vue 11 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. <template>
  2. <div class="app-container">
  3. <van-nav-bar
  4. left-arrow
  5. fixed
  6. placeholder
  7. @click-left="goBack"
  8. >
  9. <template #title>
  10. <p style="font-weight: bold;">添加收款账户信息</p>
  11. </template>
  12. </van-nav-bar>
  13. <van-form @submit="goAdd" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  14. <p class="main_title">基础信息</p>
  15. <div class="main_box">
  16. <van-field label="收款方" required :rules="[{ required: true , message:'请输入收款方' }]" v-model="form.payee" placeholder="请输入收款方" input-align="right" label-width="auto"/>
  17. <van-field label="收款账户" required :rules="[{ required: true , message:'请输入收款账户' }]" v-model="form.payeeAccount" placeholder="请输入收款账户" input-align="right" label-width="auto"/>
  18. <van-field
  19. readonly
  20. clickable
  21. label="所属银行"
  22. placeholder="请选择"
  23. v-model="bankType"
  24. @click="isPeersRead ? showBankType = true : ''"
  25. input-align="right"
  26. right-icon="arrow-down"
  27. label-width="auto"
  28. required
  29. :rules="[{ required: true , message:'请选择所属银行' }]"
  30. />
  31. <van-popup v-model="showBankType" position="bottom">
  32. <van-picker
  33. show-toolbar
  34. :columns="bankTypeOptions"
  35. @confirm="onConfirmBankType"
  36. @cancel="showBankType = false"
  37. />
  38. </van-popup>
  39. <van-field
  40. readonly
  41. clickable
  42. label="开户银行"
  43. placeholder="请选择"
  44. @click="showBankDeposit = true"
  45. v-model="bankDeposit"
  46. input-align="right"
  47. right-icon="arrow-down"
  48. label-width="auto"
  49. required
  50. :rules="[{ required: true , message:'请选择开户银行' }]"
  51. />
  52. <van-popup v-model="showBankDeposit" position="bottom" @close="bankDepositValue = ''" @closed="bankDepositSearch">
  53. <van-search v-model="bankDepositValue" show-action placeholder="请输入开户银行名称搜索" >
  54. <template #action>
  55. <div @click="bankDepositSearch">搜索</div>
  56. </template>
  57. </van-search>
  58. <van-picker
  59. show-toolbar
  60. :columns="bankDepositOptions"
  61. @confirm="onConfirmBankDeposit"
  62. @cancel="showBankDeposit = false"
  63. />
  64. </van-popup>
  65. <van-field label="联行号" readonly required :rules="[{ required: true , message:'请输入联行号' }]" v-model="form.payeePaymentLines" input-align="right" label-width="auto"/>
  66. </div>
  67. <div class="main_box" style="margin-top: 10px;">
  68. <van-field label="备注" v-model="form.remark" type="textarea" placeholder="请输入备注" input-align="right" rows="3" label-width="auto"/>
  69. </div>
  70. <div class="main_box" style="margin-top: 10px;">
  71. <van-cell title="账户类型" required>
  72. <template #right-icon>
  73. <van-radio-group direction="horizontal" required :rules="[{ required: true , message:'请选择账户类型' }]" v-model="form.accountType">
  74. <van-radio name="1">公户</van-radio>
  75. <van-radio name="2">私户</van-radio>
  76. </van-radio-group>
  77. </template>
  78. </van-cell>
  79. <van-field
  80. readonly
  81. clickable
  82. label="收款人类型"
  83. placeholder="请选择"
  84. v-model="payeeType"
  85. input-align="right"
  86. right-icon="arrow-down"
  87. label-width="auto"
  88. required
  89. :rules="[{ required: true , message:'请选择收款人类型' }]"
  90. />
  91. <!-- @click="showPayeeType = true"-->
  92. <van-popup v-model="showPayeeType" position="bottom">
  93. <van-picker
  94. show-toolbar
  95. :columns="payeeTypeOptions"
  96. @confirm="onConfirmPayeeType"
  97. @cancel="showPayeeType = false"
  98. />
  99. </van-popup>
  100. <van-cell title="数据状态" required>
  101. <template #right-icon>
  102. <van-radio-group direction="horizontal" required :rules="[{ required: true , message:'请选择数据状态' }]" v-model="form.status">
  103. <van-radio name="0">正常</van-radio>
  104. <!-- <van-radio name="1">停用</van-radio>-->
  105. </van-radio-group>
  106. </template>
  107. </van-cell>
  108. </div>
  109. <div style="padding: 16px 0;">
  110. <van-row>
  111. <van-col span="24" align="center">
  112. <van-button type="info" native-type="submit" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  113. </van-col>
  114. </van-row>
  115. <div class="clear"></div>
  116. </div>
  117. </van-form>
  118. </div>
  119. </template>
  120. <script>
  121. import { addPayee,listDeposit } from "@/api/onlineHome/bankAgriculture/collectionAccount";
  122. export default {
  123. name: "collectionAdd",
  124. data() {
  125. return {
  126. isPeersRead:true,
  127. showBankType:false,
  128. showBankDeposit:false,
  129. showPayeeType:false,
  130. depositListShow:false,
  131. bankDepositValue:'',
  132. form:{
  133. accountType:'1',
  134. status:'0',
  135. payeeType:'4'
  136. },
  137. bankType:'',
  138. payeeType:'公务卡',
  139. bankDeposit:'',
  140. bankTypeOptions:[],
  141. statusOptions:[],
  142. accountTypeOptions:[],
  143. payeeTypeOptions:[],
  144. bankDepositOptions:[],
  145. };
  146. },
  147. created() {
  148. this.getDictionaries();
  149. const accountType = this.$route.params.accountType;
  150. const isPeers = this.$route.params.isPeers;
  151. const bankType = this.$route.params.bankType;
  152. console.log(this.$route.params.option)
  153. if (accountType){this.form.accountType = accountType;}
  154. if (isPeers){
  155. this.form.isPeers = isPeers;
  156. if (isPeers == 'Y'){
  157. this.isPeersRead = false;
  158. this.getDicts("bank_type").then((res) => {
  159. let bankText = this.selectDictLabel(res.data,bankType);
  160. let data = {
  161. text : bankText,
  162. value : bankType
  163. }
  164. this.onConfirmBankType(data);
  165. });
  166. }
  167. }
  168. },
  169. methods: {
  170. getDictionaries(){
  171. this.houseGetDicts("bank_type_all").then((res) => {
  172. for(var i = 0 ; i < res.data.length ; i++){
  173. this.bankTypeOptions.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  174. }
  175. });
  176. this.houseGetDicts("sys_normal_disable").then((res) => {
  177. console.log(res)
  178. for(var i = 0 ; i < res.data.length ; i++){
  179. this.statusOptions.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  180. }
  181. });
  182. this.houseGetDicts("bank_account_type").then((res) => {
  183. console.log(res)
  184. for(var i = 0 ; i < res.data.length ; i++){
  185. this.accountTypeOptions.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  186. }
  187. });
  188. this.houseGetDicts("payee_type").then((res) => {
  189. for(var i = 0 ; i < res.data.length ; i++){
  190. this.payeeTypeOptions.push({text:res.data[i].dictLabel,value:res.data[i].dictValue});
  191. }
  192. });
  193. },
  194. getError(e){
  195. this.$notify({ type: 'danger', message: e.errors[0].message });
  196. },
  197. onConfirmBankType(data){
  198. this.bankType = data.text;
  199. this.form.bankType = data.value;
  200. this.bankDeposit = ""
  201. this.form.payeePaymentLines = ""
  202. this.showBankType = false;
  203. let queryParams={
  204. "bankType":this.form.bankType,
  205. "bankDeposit":this.bankDepositValue,
  206. "status": "0",
  207. }
  208. listDeposit(queryParams).then(response => {
  209. this.bankDepositOptions = []
  210. for(var i = 0 ; i < response.rows.length ; i++){
  211. this.bankDepositOptions.push({"text":response.rows[i].bankDeposit,"value":response.rows[i].id,
  212. "payeePaymentLines":response.rows[i].payeePaymentLines,"institutionNumber":response.rows[i].institutionNumber});
  213. }
  214. });
  215. },
  216. bankDepositSearch(data){
  217. this.bankDepositOptions = [];
  218. let queryParams={
  219. "bankType":this.form.bankType,
  220. "bankDeposit":this.bankDepositValue,
  221. "status": "0",
  222. }
  223. listDeposit(queryParams).then(response => {
  224. this.bankDepositOptions = []
  225. for(var i = 0 ; i < response.rows.length ; i++){
  226. this.bankDepositOptions.push({"text":response.rows[i].bankDeposit,"value":response.rows[i].id,
  227. "payeePaymentLines":response.rows[i].payeePaymentLines,"institutionNumber":response.rows[i].institutionNumber});
  228. }
  229. });
  230. },
  231. onConfirmBankDeposit(data){
  232. this.bankDeposit = data.text
  233. this.form.bankDeposit = data.text
  234. this.form.payeePaymentLines = data.payeePaymentLines
  235. this.form.alternateField10 = data.institutionNumber
  236. this.showBankDeposit = false;
  237. this.depositListShow = false;
  238. },
  239. onConfirmPayeeType(data){
  240. this.payeeType = data.text;
  241. this.form.payeeType = data.value;
  242. this.showPayeeType = false;
  243. },
  244. goAdd(){
  245. var that = this;
  246. addPayee(this.form).then(response => {
  247. this.$toast.success('新增成功');
  248. setTimeout(function(){
  249. that.form.bankTypeText = that.bankType;
  250. that.$router.push({name: 'approvalAdd2', params: { payeeForm: that.form }});
  251. // history.go(-1)
  252. },2000)
  253. });
  254. },
  255. goBack(){
  256. window.history.go(-1)
  257. },
  258. selectDeposit(val){
  259. //depositListShow
  260. if (val == '' || this.bankDeposit == ''){return;}
  261. this.depositListShow = true;
  262. let queryParams={
  263. "bankType":this.form.bankType,
  264. "status": "0",
  265. "bankDeposit":this.bankDeposit,
  266. "pageNum":1,
  267. "pageSize":10
  268. }
  269. listDeposit(queryParams).then(response => {
  270. this.bankDepositOptions = []
  271. for(var i = 0 ; i < response.rows.length ; i++){
  272. this.bankDepositOptions.push(
  273. {
  274. "text":response.rows[i].bankDeposit,
  275. "value":response.rows[i].id,
  276. "payeePaymentLines":response.rows[i].payeePaymentLines,
  277. "institutionNumber":response.rows[i].institutionNumber
  278. }
  279. );
  280. }
  281. });
  282. }
  283. },
  284. }
  285. </script>
  286. <style scoped lang="scss">
  287. .deposit_list{
  288. height: 18vh;
  289. width: 96%;
  290. position: absolute;
  291. background: #fff;
  292. box-shadow: 0 10PX 10PX rgba(0, 0, 0, .5);
  293. left: 2%;
  294. z-index: 9;
  295. border-radius: 0 0 5PX 5PX;
  296. overflow-y: scroll;
  297. }
  298. .app-container {
  299. padding: 2% 0;
  300. }
  301. .main_title{
  302. font-size: 0.4rem;
  303. color: #1D6FE9;
  304. margin: 0.2rem 6%;
  305. margin-top: 0;
  306. position: relative;
  307. }
  308. .main_box{
  309. width: 96%;
  310. margin: 0 auto;
  311. border-radius: 6px;
  312. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  313. overflow: hidden;
  314. background-color: #FFF;
  315. }
  316. .submitButton{
  317. width: 80%;
  318. margin: 0 auto;
  319. background-color: #1D6FE9;
  320. }
  321. .addFamily{
  322. position: absolute;
  323. top: -2px;
  324. right: 0;
  325. border-radius: 50%;
  326. }
  327. </style>