移动端
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

568 строки
23 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. <p class="main_title">基础信息</p>
  15. <div class="main_box">
  16. <van-field
  17. readonly
  18. clickable
  19. label="账户类型"
  20. placeholder="请选择"
  21. v-model="accountType"
  22. @click="showAccountType = true"
  23. input-align="right"
  24. right-icon="arrow-down"
  25. label-width="auto"
  26. required
  27. />
  28. <van-popup v-model="showAccountType" position="bottom">
  29. <van-picker
  30. show-toolbar
  31. :columns="typeDictionaries"
  32. @confirm="onConfirmType"
  33. @cancel="showAccountType = false"
  34. />
  35. </van-popup>
  36. <van-field
  37. readonly
  38. clickable
  39. label="所属银行"
  40. placeholder="请选择"
  41. v-model="bankType"
  42. @click="showBankType = true"
  43. input-align="right"
  44. right-icon="arrow-down"
  45. label-width="auto"
  46. required
  47. :rules="[{ required: true , message:'请选择所属银行' }]"
  48. />
  49. <van-popup v-model="showBankType" position="bottom">
  50. <van-picker
  51. show-toolbar
  52. :columns="bankTypeOptions"
  53. @confirm="onConfirmBankType"
  54. @cancel="showBankType = false"
  55. />
  56. </van-popup>
  57. <van-field
  58. readonly
  59. clickable
  60. label="账户分类"
  61. placeholder="请选择"
  62. v-model="villageAccountType"
  63. @click="showVillageAccountType = true"
  64. input-align="right"
  65. right-icon="arrow-down"
  66. label-width="auto"
  67. required
  68. :rules="[{ required: true , message:'请选择账户分类' }]"
  69. v-if="accountType=='银行存款'&&(form.bankType==1||form.bankType==2)"
  70. />
  71. <van-popup v-model="showVillageAccountType" position="bottom">
  72. <van-picker
  73. show-toolbar
  74. :columns="villageAccountTypeOptions"
  75. @confirm="onConfirmVillageAccountType"
  76. @cancel="showVillageAccountType = false"
  77. />
  78. </van-popup>
  79. <van-field
  80. readonly
  81. clickable
  82. label="所属镇账户"
  83. placeholder="请选择"
  84. v-model="taccountId"
  85. @click="showTaccountId = true"
  86. input-align="right"
  87. right-icon="arrow-down"
  88. label-width="auto"
  89. required
  90. :rules="[{ required: true , message:'请选择所属镇账户' }]"
  91. v-if="accountType=='银行存款'&&(form.bankType=='1'||form.bankType=='2')&&form.villageAccountType!=2"
  92. />
  93. <van-popup v-model="showTaccountId" position="bottom">
  94. <van-picker
  95. show-toolbar
  96. :columns="taccountIdOptions"
  97. @confirm="onConfirmTaccountId"
  98. @cancel="showTaccountId = false"
  99. />
  100. </van-popup>
  101. <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"/>
  102. <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"/>
  103. <van-field label="账簿号" v-if="accountType=='银行存款'&&villageAccountType=='多级账簿'" required :rules="[{ required: true , message:'请输入账簿号' }]" v-model="form.accountNo" placeholder="请输入账簿号" input-align="right" label-width="auto"/>
  104. <van-field label="管控类型" v-if="accountType=='银行存款'&&form.bankType==2&&villageAccountType=='多级账簿'">
  105. <template #right-icon>
  106. <van-radio-group direction="horizontal" v-model="form.managementControlType" @change="onConfirmManagementControlType" required :rules="[{ required: true , message:'请选择管控类型' }]">
  107. <van-radio name="1">账簿余额</van-radio>
  108. <van-radio name="2">中心账簿</van-radio>
  109. </van-radio-group>
  110. </template>
  111. </van-field>
  112. <van-field
  113. readonly
  114. clickable
  115. label="中心账套"
  116. placeholder="请选择"
  117. v-model="centralBookId"
  118. @click="showCentralBookId = true"
  119. input-align="right"
  120. right-icon="arrow-down"
  121. label-width="auto"
  122. required
  123. :rules="[{ required: true , message:'请选择中心账套' }]"
  124. v-if="accountType=='银行存款'&&form.managementControlType=='2'"
  125. />
  126. <van-popup v-model="showCentralBookId" position="bottom">
  127. <van-picker
  128. show-toolbar
  129. :columns="centralBookIdList"
  130. @confirm="onConfirmCentralBookId"
  131. @cancel="showCentralBookId = false"
  132. />
  133. </van-popup>
  134. <van-field
  135. readonly
  136. clickable
  137. label="会计科目"
  138. placeholder="请选择"
  139. v-model="centralSubjectId"
  140. @click="showCentralSubjectId = true"
  141. input-align="right"
  142. right-icon="arrow-down"
  143. label-width="auto"
  144. required
  145. :rules="[{ required: true , message:'请选择会计科目' }]"
  146. v-if="accountType=='银行存款'&&form.managementControlType=='2'"
  147. />
  148. <van-popup v-model="showCentralSubjectId" position="bottom">
  149. <van-picker
  150. show-toolbar
  151. :columns="centralSubjectIdList"
  152. @confirm="onConfirmCentralSubjectId"
  153. @cancel="showCentralSubjectId = false"
  154. />
  155. </van-popup>
  156. <van-field label="账户名称" required :rules="[{ required: true , message:'请输入账户名称' }]" v-model="form.accountName" placeholder="请输入账户名称" input-align="right" label-width="auto"/>
  157. <van-field label="银行账户" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入银行账户' }]" v-model="form.bankAccountNumber" placeholder="请输入银行账户" input-align="right" label-width="auto" required/>
  158. <div>
  159. <van-field
  160. label="开户银行"
  161. placeholder="请选择"
  162. v-model="form.bankName"
  163. input-align="right"
  164. label-width="auto"
  165. required
  166. :rules="[{ required: true , message:'请选择开户银行' }]"
  167. v-if="accountType=='银行存款'"
  168. @input="selectDeposit"
  169. @focus="selectDeposit"
  170. />
  171. <div class="deposit_list" v-show="depositListShow">
  172. <van-cell style="cursor: pointer;" :title="item.text" @click="onConfirmBankDeposit(item)" v-for="(item,index) in bankDepositList" />
  173. </div>
  174. </div>
  175. <van-popup v-model="showBankDeposit" position="bottom">
  176. <van-picker
  177. show-toolbar
  178. :columns="bankDepositList"
  179. @confirm="onConfirmBankDeposit"
  180. @cancel="showBankDeposit = false"
  181. />
  182. </van-popup>
  183. <van-field label="联行号" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入联行号' }]" v-model="form.paymentLines" placeholder="请输入联行号" input-align="right" label-width="auto" required/>
  184. <van-field label="上级清算行" v-model="form.clearingBank" input-align="right" label-width="auto" disabled/>
  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:'支付口令至少6个字符,必须包括字母、数字和符号' }]" 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. depositListShow:false,
  280. minDate: new Date(),
  281. showBankDeposit:false,
  282. maxDate: new Date(2025, 10, 1),
  283. currentDate: new Date(),
  284. jgList:{},
  285. managementControlType:'',
  286. taccountId:'',
  287. accountType:'',
  288. bankType:'',
  289. centralBookId:'',
  290. centralSubjectId:'',
  291. jglx:'',
  292. wfydlx:'',
  293. wfydlxDictionaries:[],
  294. jglxDictionaries:[],
  295. subjectDictionaries:[],
  296. typeDictionaries:[],
  297. villageAccountTypeOptions:[],
  298. taccountIdOptions:[],
  299. centralBookIdList:[],
  300. centralSubjectIdList:[],
  301. // 管控类型 == 中心账套时选择中心账套
  302. centralBooks: [],
  303. // 管控类型字典
  304. managementControlTypeOptions: [],
  305. bankDepositList:[],
  306. // 所属银行字典
  307. bankTypeOptions: [],
  308. subjectDeatil:'',
  309. bankDepositQueryParams: {
  310. bookId: null,
  311. deptId: null,
  312. payee: null,
  313. payeeAccount: null,
  314. bankDeposit: null,
  315. payeeType:null,
  316. bankType:null,
  317. status: "0",
  318. },
  319. form:{
  320. accountType: "102",
  321. bankUseType:"1",
  322. bankAccountType: "1",
  323. villageAccountType: "2",
  324. status: "N",
  325. bankName: "",
  326. }
  327. };
  328. },
  329. created() {
  330. this.getTaList();
  331. this.getDetail();
  332. },
  333. methods: {
  334. validator(val){
  335. return /^(?=.*\d)(?=.*[a-zA-Z])(?=.*[~!@#$%^&*])[\da-zA-Z~!@#$%^&*]{6,}$/.test(val);
  336. },
  337. getDetail(){
  338. // 账户类型
  339. this.houseGetDicts("account_type_cashier").then((res) => {
  340. for (var i = 0; i < res.data.length; i++) {
  341. this.typeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  342. }
  343. });
  344. this.getDicts("cashier_account_management_control_type").then((res) => {
  345. for (var i = 0; i < res.data.length; i++) {
  346. this.managementControlTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  347. }
  348. });
  349. this.getDicts("bank_type").then(res => {
  350. for (var i = 0; i < res.data.length; i++) {
  351. this.bankTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  352. }
  353. });
  354. this.getDicts("village_account_type").then(res => {
  355. for (var i = 0; i < res.data.length; i++) {
  356. this.villageAccountTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  357. }
  358. });
  359. getSubjectDetail().then((res) => {
  360. for (var i = 0; i < res.rows.length; i++) {
  361. this.subjectDictionaries.push({text: res.rows[i].subjectNameAll, value: res.rows[i].subjectId});
  362. }
  363. });
  364. },
  365. getTaList(){
  366. let params= {
  367. // 分页
  368. pageNum: 1,
  369. pageSize: 100,
  370. bankType:this.form.bankType,
  371. }
  372. // this.getCentralBookOptions();
  373. queryTaccount(params).then(res => {
  374. this.taccountIdOptions = res.rows;
  375. for (var i = 0; i < res.rows.length; i++) {
  376. this.$set(this.taccountIdOptions[i], "text",res.rows[i].payee);
  377. this.$set(this.taccountIdOptions[i], "value",res.rows[i].id);
  378. }
  379. });
  380. },
  381. getError(e){
  382. this.$notify({ type: 'danger', message: e.errors[0].message });
  383. },
  384. onConfirmCentralBookId(val){
  385. this.showCentralBookId = false
  386. this.$set(this.form, "centralBookId",val.value);
  387. this.centralBookId = val.text
  388. getCentralSubjects({bookId: val.id}).then((res) => {
  389. this.centralSubjectIdList = res.data;
  390. for (var i = 0; i < res.data.length; i++) {
  391. this.$set(this.centralSubjectIdList[i], "text",res.data[i].subjectName);
  392. this.$set(this.centralSubjectIdList[i], "value",res.data[i].subjectId);
  393. }
  394. })
  395. },
  396. onConfirmCentralSubjectId(val){
  397. this.showCentralSubjectId = false
  398. this.$set(this.form, "centralSubjectId",val.value);
  399. this.centralSubjectId = val.text
  400. },
  401. onConfirmManagementControlType(val){
  402. if(val==2){
  403. getCentralBooks({yinnongTaccountId: this.form.taccountId}).then((res) => {
  404. this.centralBookIdList = res.data;
  405. for (var i = 0; i < res.data.length; i++) {
  406. this.$set(this.centralBookIdList[i], "text",res.data[i].bookName);
  407. this.$set(this.centralBookIdList[i], "value",res.data[i].id);
  408. }
  409. });
  410. }
  411. },
  412. onConfirmBankDeposit(val){
  413. this.showBankDeposit = false;
  414. this.depositListShow = false;
  415. console.log(val)
  416. this.$set(this.form, "bankName", val.text);
  417. this.$set(this.form, "paymentLines", val.payeePaymentLines);
  418. this.$set(this.form, "clearingBank", val.clearingBank);
  419. this.$set(this.form, "alternateField10", val.institutionNumber);
  420. },
  421. onConfirmTaccountId(val){
  422. this.showTaccountId = false
  423. this.taccountId = val.text
  424. console.log(val)
  425. this.$set(this.form, "taccountId", val.value);
  426. this.$set(this.form, "cifNo", val.cifNo);
  427. this.$set(this.form, "accountName", val.payee);
  428. this.$set(this.form, "managementControlType", val.managementControlType);
  429. this.$set(this.form, "accountPassword", val.accountPassword);
  430. this.$set(this.form, "centralBookId", val.centralBookId);
  431. this.taccountIdOptions.map(res => {
  432. if(res.id==val.value){
  433. if(this.form.villageAccountType === '3'){
  434. this.$set(this.form, "bankAccountNumber", res.payeeAccount);
  435. }
  436. //this.form.bankName = res.bankDeposit;
  437. this.$set(this.form, "bankName", res.bankDeposit);
  438. this.$set(this.form, "paymentLines", res.payeePaymentLines);
  439. }
  440. })
  441. },
  442. onConfirmBankType(val){
  443. this.showBankType = false
  444. this.bankType = val.text
  445. this.$set(this.form, "bankType", val.value);
  446. this.getTaList();
  447. this.$set(this.form, "bankName", '');
  448. this.$set(this.form, "paymentLines", '');
  449. this.$set(this.form, "clearingBank", '');
  450. this.bankDepositQueryParams.bankType = val.value;
  451. listDeposit(this.bankDepositQueryParams).then(response => {
  452. this.bankDepositList = response.rows;
  453. for (var i = 0; i < response.rows.length; i++) {
  454. this.$set(this.bankDepositList[i], "text",response.rows[i].bankDeposit);
  455. this.$set(this.bankDepositList[i], "value",response.rows[i].bankDeposit);
  456. }
  457. })
  458. },
  459. onConfirmVillageAccountType(val){
  460. this.showVillageAccountType = false
  461. this.villageAccountType = val.text
  462. this.$set(this.form, "villageAccountType", val.value);
  463. },
  464. onConfirmSubject(data){
  465. this.subjectDeatil = data.text;
  466. this.form.subjectId = data.value;
  467. this.form.subjectNameAll = data.text;
  468. this.showSubjectId = false;
  469. },
  470. onConfirmType(data){
  471. this.accountType = data.text;
  472. this.form.accountType = data.value;
  473. this.showAccountType = false;
  474. },
  475. goModify(){
  476. console.log(this.form)
  477. this.form.balance = this.form.initialBalance;
  478. addAccount(this.form).then((response) => {
  479. this.$toast.success('添加成功');
  480. setTimeout(function(){
  481. history.go(-1)
  482. },2000)
  483. });
  484. },
  485. goBack(){
  486. window.history.go(-1)
  487. },
  488. selectDeposit(val){
  489. //depositListShow
  490. console.log(val)
  491. console.log(this.form.bankName)
  492. if (val == '' || this.form.bankName == ''){return;}
  493. this.depositListShow = true;
  494. let queryParams={
  495. "bankType":this.form.bankType,
  496. "status": "0",
  497. "bankDeposit":this.form.bankName,
  498. "pageNum":1,
  499. "pageSize":10
  500. }
  501. listDeposit(queryParams).then(response => {
  502. this.bankDepositList = []
  503. for(var i = 0 ; i < response.rows.length ; i++){
  504. this.bankDepositList.push(
  505. {
  506. "text":response.rows[i].bankDeposit,
  507. "value":response.rows[i].id,
  508. "payeePaymentLines":response.rows[i].payeePaymentLines,
  509. "clearingBank":response.rows[i].clearingBank,
  510. "institutionNumber":response.rows[i].institutionNumber
  511. }
  512. );
  513. }
  514. });
  515. }
  516. },
  517. }
  518. </script>
  519. <style scoped lang="scss">
  520. .deposit_list{
  521. height: 18vh;
  522. width: 96%;
  523. position: absolute;
  524. background: #fff;
  525. box-shadow: 0 10PX 10PX rgba(0, 0, 0, .5);
  526. left: 2%;
  527. z-index: 9;
  528. border-radius: 0 0 5PX 5PX;
  529. overflow-y: scroll;
  530. }
  531. .app-container {
  532. padding: 2% 0;
  533. }
  534. .main_title{
  535. font-size: 0.4rem;
  536. color: #1D6FE9;
  537. margin: 0.2rem 6%;
  538. margin-top: 0;
  539. position: relative;
  540. }
  541. .main_box{
  542. width: 96%;
  543. margin: 0 auto;
  544. border-radius: 6px;
  545. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  546. overflow: hidden;
  547. background-color: #FFF;
  548. }
  549. .submitButton{
  550. width: 80%;
  551. margin: 0 auto;
  552. background-color: #1D6FE9;
  553. }
  554. .addFamily{
  555. position: absolute;
  556. top: -2px;
  557. right: 0;
  558. border-radius: 50%;
  559. }
  560. </style>