移动端
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

555 linhas
22 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. <div class="header_main">
  14. 添加付款账户信息
  15. <div class="return_btn" @click="onClickLeft"></div>
  16. </div>
  17. <van-form @submit="goModify" @failed="getError" :show-error-message="false" scroll-to-error validate-first>
  18. <p class="main_title">基础信息</p>
  19. <div class="main_box">
  20. <van-field
  21. readonly
  22. clickable
  23. label="账户类型"
  24. placeholder="请选择"
  25. v-model="accountType"
  26. @click="showAccountType = true"
  27. input-align="right"
  28. right-icon="arrow-down"
  29. label-width="auto"
  30. required
  31. />
  32. <van-popup v-model="showAccountType" position="bottom">
  33. <van-picker
  34. show-toolbar
  35. :columns="typeDictionaries"
  36. @confirm="onConfirmType"
  37. @cancel="showAccountType = false"
  38. />
  39. </van-popup>
  40. <van-field
  41. readonly
  42. clickable
  43. label="所属银行"
  44. placeholder="请选择"
  45. v-model="bankType"
  46. @click="showBankType = true"
  47. input-align="right"
  48. right-icon="arrow-down"
  49. label-width="auto"
  50. required
  51. :rules="[{ required: true , message:'请选择所属银行' }]"
  52. />
  53. <van-popup v-model="showBankType" position="bottom">
  54. <van-picker
  55. show-toolbar
  56. :columns="bankTypeOptions"
  57. @confirm="onConfirmBankType"
  58. @cancel="showBankType = false"
  59. />
  60. </van-popup>
  61. <van-field
  62. readonly
  63. clickable
  64. label="账户分类"
  65. placeholder="请选择"
  66. v-model="villageAccountType"
  67. @click="showVillageAccountType = true"
  68. input-align="right"
  69. right-icon="arrow-down"
  70. label-width="auto"
  71. required
  72. :rules="[{ required: true , message:'请选择账户分类' }]"
  73. v-if="accountType=='银行存款'&&(form.bankType==1||form.bankType==2)"
  74. />
  75. <van-popup v-model="showVillageAccountType" position="bottom">
  76. <van-picker
  77. show-toolbar
  78. :columns="villageAccountTypeOptions"
  79. @confirm="onConfirmVillageAccountType"
  80. @cancel="showVillageAccountType = false"
  81. />
  82. </van-popup>
  83. <van-field
  84. readonly
  85. clickable
  86. label="所属镇账户"
  87. placeholder="请选择"
  88. v-model="taccountId"
  89. @click="showTaccountId = true"
  90. input-align="right"
  91. right-icon="arrow-down"
  92. label-width="auto"
  93. required
  94. :rules="[{ required: true , message:'请选择所属镇账户' }]"
  95. v-if="accountType=='银行存款'&&(form.bankType=='1'||form.bankType=='2')&&form.villageAccountType!=2"
  96. />
  97. <van-popup v-model="showTaccountId" position="bottom">
  98. <van-picker
  99. show-toolbar
  100. :columns="taccountIdOptions"
  101. @confirm="onConfirmTaccountId"
  102. @cancel="showTaccountId = false"
  103. />
  104. </van-popup>
  105. <van-field label="客户编号" v-if="accountType=='银行存款'&&(form.bankType=='1'||form.bankType=='2'||form.bankType=='7')" required :rules="[{ required: true , message:'请输入客户编号' }]" v-model="form.cifNo" placeholder="请输入客户编号" input-align="right" label-width="auto"/>
  106. <van-field label="DN" v-if="accountType=='银行存款'&&form.bankType=='7'" required :rules="[{ required: true , message:'DN' }]" v-model="form.alternateField1" placeholder="请输入DN" input-align="right" label-width="auto"/>
  107. <van-field label="账簿号" v-if="accountType=='银行存款'&&villageAccountType=='多级账簿'" required :rules="[{ required: true , message:'请输入账簿号' }]" v-model="form.accountNo" placeholder="请输入账簿号" input-align="right" label-width="auto"/>
  108. <van-field label="管控类型" v-if="accountType=='银行存款'&&form.bankType==2&&villageAccountType=='多级账簿'">
  109. <template #right-icon>
  110. <van-radio-group direction="horizontal" v-model="form.managementControlType" @change="onConfirmManagementControlType" required :rules="[{ required: true , message:'请选择管控类型' }]">
  111. <van-radio name="1">账簿余额</van-radio>
  112. <van-radio name="2">中心账簿</van-radio>
  113. </van-radio-group>
  114. </template>
  115. </van-field>
  116. <van-field
  117. readonly
  118. clickable
  119. label="中心账套"
  120. placeholder="请选择"
  121. v-model="centralBookId"
  122. @click="showCentralBookId = true"
  123. input-align="right"
  124. right-icon="arrow-down"
  125. label-width="auto"
  126. required
  127. :rules="[{ required: true , message:'请选择中心账套' }]"
  128. v-if="accountType=='银行存款'&&form.managementControlType=='2'"
  129. />
  130. <van-popup v-model="showCentralBookId" position="bottom">
  131. <van-picker
  132. show-toolbar
  133. :columns="centralBookIdList"
  134. @confirm="onConfirmCentralBookId"
  135. @cancel="showCentralBookId = false"
  136. />
  137. </van-popup>
  138. <!-- <van-field
  139. readonly
  140. clickable
  141. label="会计科目"
  142. placeholder="请选择"
  143. v-model="centralSubjectId"
  144. @click="showCentralSubjectId = true"
  145. input-align="right"
  146. right-icon="arrow-down"
  147. label-width="auto"
  148. required
  149. :rules="[{ required: true , message:'请选择会计科目' }]"
  150. v-if="accountType=='银行存款'&&form.managementControlType=='2'"
  151. />
  152. <van-popup v-model="showCentralSubjectId" position="bottom">
  153. <van-picker
  154. show-toolbar
  155. :columns="centralSubjectIdList"
  156. @confirm="onConfirmCentralSubjectId"
  157. @cancel="showCentralSubjectId = false"
  158. />
  159. </van-popup> -->
  160. <van-field label="账户名称" required :rules="[{ required: true , message:'请输入账户名称' }]" v-model="form.accountName" placeholder="请输入账户名称" input-align="right" label-width="auto"/>
  161. <van-field label="银行账户" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入银行账户' }]" v-model="form.bankAccountNumber" placeholder="请输入银行账户" input-align="right" label-width="auto" required/>
  162. <van-field
  163. readonly
  164. clickable
  165. label="开户银行"
  166. placeholder="请选择"
  167. v-model="form.bankName"
  168. @click="showBankDeposit = true"
  169. input-align="right"
  170. right-icon="arrow-down"
  171. label-width="auto"
  172. required
  173. :rules="[{ required: true , message:'请选择开户银行' }]"
  174. v-if="accountType=='银行存款'"
  175. />
  176. <van-popup v-model="showBankDeposit" position="bottom">
  177. <van-picker
  178. show-toolbar
  179. :columns="bankDepositList"
  180. @confirm="onConfirmBankDeposit"
  181. @cancel="showBankDeposit = false"
  182. />
  183. </van-popup>
  184. <van-field label="联行号" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入联行号' }]" v-model="form.paymentLines" placeholder="请输入联行号" input-align="right" label-width="auto" required/>
  185. <!-- <van-field
  186. readonly
  187. clickable
  188. label="关联科目"
  189. placeholder="请选择"
  190. v-model="subjectDeatil"
  191. @click="showSubjectId = true"
  192. input-align="right"
  193. right-icon="arrow-down"
  194. label-width="auto"
  195. required
  196. :rules="[{ required: true , message:'请选择关联科目' }]"
  197. />
  198. <van-popup v-model="showSubjectId" position="bottom">
  199. <van-picker
  200. show-toolbar
  201. :columns="subjectDictionaries"
  202. @confirm="onConfirmSubject"
  203. @cancel="showSubjectId = false"
  204. />
  205. </van-popup> -->
  206. <van-field label="开户银行地址" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入开户银行地址' }]" v-model="form.site" placeholder="请输入开户银行地址" input-align="right" label-width="auto" required/>
  207. <van-field label="支付口令" v-if="accountType=='银行存款'" name="validator" :rules="[{ validator , message:'支付口令:请输入六位以上数字' }]" v-model="form.accountPassword" placeholder="请输入支付口令" input-align="right" label-width="auto" required/>
  208. <van-field label="账户类型" v-if="accountType=='银行存款'" required>
  209. <template #right-icon>
  210. <van-radio-group direction="horizontal" v-model="form.bankAccountType" required :rules="[{ required: true , message:'请选择账户类型' }]">
  211. <van-radio name="1">公户</van-radio>
  212. <van-radio name="2">私户</van-radio>
  213. </van-radio-group>
  214. </template>
  215. </van-field>
  216. <van-field label="初始余额" v-model="form.initialBalance" required :rules="[{ required: true , message:'请输入初始余额' }]" placeholder="请输入初始余额" input-align="right" label-width="auto"/>
  217. <van-field label="内部账号" v-if="accountType=='银行存款'&&form.bankType=='3'" v-model="form.alternateField1" required :rules="[{ required: true , message:'请输入内部账号' }]" placeholder="请输入内部账号" input-align="right" label-width="auto"/>
  218. <van-field label="内部户名" v-if="accountType=='银行存款'&&form.bankType=='3'" v-model="form.alternateField2" required :rules="[{ required: true , message:'请输入内部户名' }]" placeholder="请输入内部户名" input-align="right" label-width="auto"/>
  219. <van-field label="账簿号" v-if="accountType=='银行存款'&&form.bankType=='3'" v-model="form.alternateField3" required :rules="[{ required: true , message:'请输入账簿号' }]" placeholder="请输入账簿号" input-align="right" label-width="auto"/>
  220. <van-field label="手机号码" v-if="accountType=='银行存款'&&form.bankType=='4'" v-model="form.alternateField1" required :rules="[{ required: true , message:'请输入手机号' }]" placeholder="请输入手机号" input-align="right" label-width="auto"/>
  221. <van-field label="是否停用" required>
  222. <template #right-icon>
  223. <van-radio-group direction="horizontal" v-model="form.status" required :rules="[{ required: true , message:'请选择是否停用' }]">
  224. <van-radio name="Y">是</van-radio>
  225. <van-radio name="N">否</van-radio>
  226. </van-radio-group>
  227. </template>
  228. </van-field>
  229. </div>
  230. <p class="main_title" v-if="villageAccountType=='多级账簿'">账簿信息</p>
  231. <div class="main_box" v-if="villageAccountType=='多级账簿'">
  232. <van-field label="账簿是否限额" disabled>
  233. <template #right-icon>
  234. <van-radio-group direction="horizontal" v-model="form.alternateField1" :disabled="true">
  235. <van-radio name="Y">是</van-radio>
  236. <van-radio name="N">否</van-radio>
  237. </van-radio-group>
  238. </template>
  239. </van-field>
  240. <van-field label="单笔交易限额" v-model="form.alternateField2" placeholder="0.00" input-align="right" label-width="auto" :disabled="true"/>
  241. <van-field label="账簿是否透支" disabled>
  242. <template #right-icon>
  243. <van-radio-group direction="horizontal" v-model="form.alternateField3" :disabled="true">
  244. <van-radio name="Y">是</van-radio>
  245. <van-radio name="N">否</van-radio>
  246. </van-radio-group>
  247. </template>
  248. </van-field>
  249. <van-field label="透支类型" v-model="form.alternateField4" placeholder="无" input-align="right" label-width="auto" :disabled="true"/>
  250. <van-field label="透支额度(元)" v-model="form.alternateField5" placeholder="0.00" input-align="right" label-width="auto" :disabled="true"/>
  251. </div>
  252. <div style="padding: 16px 0;">
  253. <van-row>
  254. <van-col span="24" align="center">
  255. <van-button type="info" native-type="submit" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  256. </van-col>
  257. </van-row>
  258. <div class="clear"></div>
  259. </div>
  260. </van-form>
  261. </div>
  262. </template>
  263. <script>
  264. import { getSubjectDetail , addAccount,listDeposit,queryTaccount,getCentralBooks } from "@/api/onlineHome/bankAgriculture/paymentAccount";
  265. import {getCentralSubjects} from "../../../../api/onlineHome/bankAgriculture/paymentAccount";
  266. export default {
  267. name: "paymentAccountAdd",
  268. data() {
  269. return {
  270. showCentralSubjectId:false,
  271. showCentralBookId:false,
  272. showManagementControlType:false,
  273. showTaccountId:false,
  274. showVillageAccountType:false,
  275. villageAccountType:null,
  276. showAccountType:false,
  277. showSubjectId:false,
  278. showBankType:false,
  279. minDate: new Date(),
  280. showBankDeposit:false,
  281. maxDate: new Date(2025, 10, 1),
  282. currentDate: new Date(),
  283. jgList:{},
  284. managementControlType:'',
  285. taccountId:'',
  286. accountType:'',
  287. bankType:'',
  288. centralBookId:'',
  289. centralSubjectId:'',
  290. jglx:'',
  291. wfydlx:'',
  292. wfydlxDictionaries:[],
  293. jglxDictionaries:[],
  294. subjectDictionaries:[],
  295. typeDictionaries:[],
  296. villageAccountTypeOptions:[],
  297. taccountIdOptions:[],
  298. centralBookIdList:[],
  299. centralSubjectIdList:[],
  300. // 管控类型 == 中心账套时选择中心账套
  301. centralBooks: [],
  302. // 管控类型字典
  303. managementControlTypeOptions: [],
  304. bankDepositList:[],
  305. // 所属银行字典
  306. bankTypeOptions: [],
  307. subjectDeatil:'',
  308. bankDepositQueryParams: {
  309. bookId: null,
  310. deptId: null,
  311. payee: null,
  312. payeeAccount: null,
  313. bankDeposit: null,
  314. payeeType:null,
  315. bankType:null,
  316. status: "0",
  317. },
  318. form:{
  319. accountType: "102",
  320. bankUseType:"1",
  321. bankAccountType: "1",
  322. villageAccountType: "2",
  323. status: "N",
  324. }
  325. };
  326. },
  327. created() {
  328. this.getTaList();
  329. this.getDetail();
  330. },
  331. methods: {
  332. validator(val){
  333. return /^\d{6,}$/.test(val);
  334. },
  335. getDetail(){
  336. // 账户类型
  337. this.houseGetDicts("account_type_cashier").then((res) => {
  338. for (var i = 0; i < res.data.length; i++) {
  339. this.typeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  340. }
  341. });
  342. this.getDicts("cashier_account_management_control_type").then((res) => {
  343. for (var i = 0; i < res.data.length; i++) {
  344. this.managementControlTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  345. }
  346. });
  347. this.getDicts("bank_type").then(res => {
  348. for (var i = 0; i < res.data.length; i++) {
  349. this.bankTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  350. }
  351. });
  352. this.getDicts("village_account_type").then(res => {
  353. for (var i = 0; i < res.data.length; i++) {
  354. this.villageAccountTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  355. }
  356. });
  357. getSubjectDetail().then((res) => {
  358. for (var i = 0; i < res.rows.length; i++) {
  359. this.subjectDictionaries.push({text: res.rows[i].subjectNameAll, value: res.rows[i].subjectId});
  360. }
  361. });
  362. },
  363. getTaList(){
  364. let params= {
  365. // 分页
  366. pageNum: 1,
  367. pageSize: 100,
  368. bankType:this.form.bankType,
  369. }
  370. // this.getCentralBookOptions();
  371. queryTaccount(params).then(res => {
  372. this.taccountIdOptions = res.rows;
  373. for (var i = 0; i < res.rows.length; i++) {
  374. this.$set(this.taccountIdOptions[i], "text",res.rows[i].payee);
  375. this.$set(this.taccountIdOptions[i], "value",res.rows[i].id);
  376. }
  377. });
  378. },
  379. getError(e){
  380. this.$notify({ type: 'danger', message: e.errors[0].message });
  381. },
  382. onConfirmCentralBookId(val){
  383. this.showCentralBookId = false
  384. this.$set(this.form, "centralBookId",val.value);
  385. this.centralBookId = val.text
  386. getCentralSubjects({bookId: val.id}).then((res) => {
  387. this.centralSubjectIdList = res.data;
  388. for (var i = 0; i < res.data.length; i++) {
  389. this.$set(this.centralSubjectIdList[i], "text",res.data[i].subjectName);
  390. this.$set(this.centralSubjectIdList[i], "value",res.data[i].subjectId);
  391. }
  392. })
  393. },
  394. onConfirmCentralSubjectId(val){
  395. this.showCentralSubjectId = false
  396. this.$set(this.form, "centralSubjectId",val.value);
  397. this.centralSubjectId = val.text
  398. },
  399. onConfirmManagementControlType(val){
  400. if(val==2){
  401. getCentralBooks({yinnongTaccountId: this.form.taccountId}).then((res) => {
  402. this.centralBookIdList = res.data;
  403. for (var i = 0; i < res.data.length; i++) {
  404. this.$set(this.centralBookIdList[i], "text",res.data[i].bookName);
  405. this.$set(this.centralBookIdList[i], "value",res.data[i].id);
  406. }
  407. });
  408. }
  409. },
  410. onConfirmBankDeposit(val){
  411. this.showBankDeposit = false
  412. this.$set(this.form, "bankName", val.bankDeposit);
  413. this.$set(this.form, "paymentLines", val.payeePaymentLines);
  414. this.$set(this.form, "alternateField10", val.institutionNumber);
  415. },
  416. onConfirmTaccountId(val){
  417. this.showTaccountId = false
  418. this.taccountId = val.text
  419. console.log(val)
  420. this.$set(this.form, "taccountId", val.value);
  421. this.$set(this.form, "cifNo", val.cifNo);
  422. this.$set(this.form, "accountName", val.payee);
  423. this.$set(this.form, "managementControlType", val.managementControlType);
  424. this.$set(this.form, "accountPassword", val.accountPassword);
  425. this.$set(this.form, "centralBookId", val.centralBookId);
  426. this.taccountIdOptions.map(res => {
  427. if(res.id==val.value){
  428. if(this.form.villageAccountType === '3'){
  429. this.$set(this.form, "bankAccountNumber", res.payeeAccount);
  430. }
  431. //this.form.bankName = res.bankDeposit;
  432. this.$set(this.form, "bankName", res.bankDeposit);
  433. this.$set(this.form, "paymentLines", res.payeePaymentLines);
  434. }
  435. })
  436. },
  437. onConfirmBankType(val){
  438. this.showBankType = false
  439. this.bankType = val.text
  440. this.$set(this.form, "bankType", val.value);
  441. this.getTaList();
  442. this.$set(this.form, "bankName", '');
  443. this.$set(this.form, "paymentLines", '');
  444. this.bankDepositQueryParams.bankType = val.value;
  445. listDeposit(this.bankDepositQueryParams).then(response => {
  446. this.bankDepositList = response.rows;
  447. for (var i = 0; i < response.rows.length; i++) {
  448. this.$set(this.bankDepositList[i], "text",response.rows[i].bankDeposit);
  449. this.$set(this.bankDepositList[i], "value",response.rows[i].bankDeposit);
  450. }
  451. })
  452. },
  453. onConfirmVillageAccountType(val){
  454. this.showVillageAccountType = false
  455. this.villageAccountType = val.text
  456. this.$set(this.form, "villageAccountType", val.value);
  457. },
  458. onConfirmSubject(data){
  459. this.subjectDeatil = data.text;
  460. this.form.subjectId = data.value;
  461. this.form.subjectNameAll = data.text;
  462. this.showSubjectId = false;
  463. },
  464. onConfirmType(data){
  465. this.accountType = data.text;
  466. this.form.accountType = data.value;
  467. this.showAccountType = false;
  468. },
  469. goModify(){
  470. console.log(this.form)
  471. this.form.balance = this.form.initialBalance;
  472. addAccount(this.form).then((response) => {
  473. this.$toast.success('添加成功');
  474. setTimeout(function(){
  475. history.go(-1)
  476. },2000)
  477. });
  478. },
  479. goBack(){
  480. window.history.go(-1)
  481. }
  482. },
  483. }
  484. </script>
  485. <style scoped lang="scss">
  486. .app-container {
  487. padding-bottom: 2%;
  488. .header_main{
  489. height: 116px;
  490. background: url('../../../../assets/images/sunVillage_info/list_head.png') no-repeat;
  491. background-size: 100% 100%;
  492. position: fixed;
  493. top: 0;
  494. left: 0;
  495. width: 100%;
  496. font-size: 36px;
  497. line-height: 116px;
  498. text-align: center;
  499. color: #fff;
  500. position: relative;
  501. margin-bottom: 2%;
  502. .return_btn{
  503. width: 24px;
  504. height: 43.2px;
  505. background: url('../../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  506. background-size: 20px 36px;
  507. position: absolute;
  508. left: 38px;
  509. top: 36px;
  510. }
  511. .add_btn{
  512. width: 20PX;
  513. height: 20PX;
  514. background: url('../../../../../static/images/icon/icon_flow.png') center center no-repeat;
  515. background-size: 20PX 20PX;
  516. position: absolute;
  517. right: 38px;
  518. top: 36px;
  519. }
  520. }
  521. }
  522. .main_title{
  523. font-size: 0.4rem;
  524. color: #1D6FE9;
  525. margin: 0.2rem 6%;
  526. margin-top: 0;
  527. position: relative;
  528. }
  529. .main_box{
  530. width: 96%;
  531. margin: 0 auto;
  532. border-radius: 6px;
  533. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  534. overflow: hidden;
  535. background-color: #FFF;
  536. }
  537. .submitButton{
  538. width: 80%;
  539. margin: 0 auto;
  540. background-color: #1D6FE9;
  541. }
  542. .addFamily{
  543. position: absolute;
  544. top: -2px;
  545. right: 0;
  546. border-radius: 50%;
  547. }
  548. </style>