移动端
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

paymentAccountAdd.vue 22 KiB

3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
3 年前
2 年前
2 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  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
  185. readonly
  186. clickable
  187. label="关联科目"
  188. placeholder="请选择"
  189. v-model="subjectDeatil"
  190. @click="showSubjectId = true"
  191. input-align="right"
  192. right-icon="arrow-down"
  193. label-width="auto"
  194. required
  195. :rules="[{ required: true , message:'请选择关联科目' }]"
  196. />
  197. <van-popup v-model="showSubjectId" position="bottom">
  198. <van-picker
  199. show-toolbar
  200. :columns="subjectDictionaries"
  201. @confirm="onConfirmSubject"
  202. @cancel="showSubjectId = false"
  203. />
  204. </van-popup>
  205. <van-field label="开户银行地址" v-if="accountType=='银行存款'" :rules="[{ required: true , message:'请输入开户银行地址' }]" v-model="form.site" placeholder="请输入开户银行地址" input-align="right" label-width="auto" required/>
  206. <van-field label="支付口令" v-if="accountType=='银行存款'" name="validator" :rules="[{ validator , message:'支付口令:请输入六位以上数字' }]" v-model="form.accountPassword" placeholder="请输入支付口令" input-align="right" label-width="auto" required/>
  207. <van-field label="账户类型" v-if="accountType=='银行存款'" required>
  208. <template #right-icon>
  209. <van-radio-group direction="horizontal" v-model="form.bankAccountType" required :rules="[{ required: true , message:'请选择账户类型' }]">
  210. <van-radio name="1">公户</van-radio>
  211. <van-radio name="2">私户</van-radio>
  212. </van-radio-group>
  213. </template>
  214. </van-field>
  215. <van-field label="初始余额" v-model="form.initialBalance" required :rules="[{ required: true , message:'请输入初始余额' }]" placeholder="请输入初始余额" input-align="right" label-width="auto"/>
  216. <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"/>
  217. <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"/>
  218. <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"/>
  219. <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"/>
  220. <van-field label="是否停用" required>
  221. <template #right-icon>
  222. <van-radio-group direction="horizontal" v-model="form.status" required :rules="[{ required: true , message:'请选择是否停用' }]">
  223. <van-radio name="Y">是</van-radio>
  224. <van-radio name="N">否</van-radio>
  225. </van-radio-group>
  226. </template>
  227. </van-field>
  228. </div>
  229. <p class="main_title" v-if="villageAccountType=='多级账簿'">账簿信息</p>
  230. <div class="main_box" v-if="villageAccountType=='多级账簿'">
  231. <van-field label="账簿是否限额" disabled>
  232. <template #right-icon>
  233. <van-radio-group direction="horizontal" v-model="form.alternateField1" :disabled="true">
  234. <van-radio name="Y">是</van-radio>
  235. <van-radio name="N">否</van-radio>
  236. </van-radio-group>
  237. </template>
  238. </van-field>
  239. <van-field label="单笔交易限额" v-model="form.alternateField2" placeholder="0.00" input-align="right" label-width="auto" :disabled="true"/>
  240. <van-field label="账簿是否透支" disabled>
  241. <template #right-icon>
  242. <van-radio-group direction="horizontal" v-model="form.alternateField3" :disabled="true">
  243. <van-radio name="Y">是</van-radio>
  244. <van-radio name="N">否</van-radio>
  245. </van-radio-group>
  246. </template>
  247. </van-field>
  248. <van-field label="透支类型" v-model="form.alternateField4" placeholder="无" input-align="right" label-width="auto" :disabled="true"/>
  249. <van-field label="透支额度(元)" v-model="form.alternateField5" placeholder="0.00" input-align="right" label-width="auto" :disabled="true"/>
  250. </div>
  251. <div style="padding: 16px 0;">
  252. <van-row>
  253. <van-col span="24" align="center">
  254. <van-button type="info" native-type="submit" class="submitButton">保<i style="margin-right: 1em;"></i>存</van-button>
  255. </van-col>
  256. </van-row>
  257. <div class="clear"></div>
  258. </div>
  259. </van-form>
  260. </div>
  261. </template>
  262. <script>
  263. import { getSubjectDetail , addAccount,listDeposit,queryTaccount,getCentralBooks } from "@/api/onlineHome/bankAgriculture/paymentAccount";
  264. import {getCentralSubjects} from "../../../../api/onlineHome/bankAgriculture/paymentAccount";
  265. export default {
  266. name: "paymentAccountAdd",
  267. data() {
  268. return {
  269. showCentralSubjectId:false,
  270. showCentralBookId:false,
  271. showManagementControlType:false,
  272. showTaccountId:false,
  273. showVillageAccountType:false,
  274. villageAccountType:null,
  275. showAccountType:false,
  276. showSubjectId:false,
  277. showBankType:false,
  278. depositListShow: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. bankName: "",
  325. }
  326. };
  327. },
  328. created() {
  329. this.getTaList();
  330. this.getDetail();
  331. },
  332. methods: {
  333. validator(val){
  334. return /^\d{6,}$/.test(val);
  335. },
  336. getDetail(){
  337. // 账户类型
  338. this.houseGetDicts("account_type_cashier").then((res) => {
  339. for (var i = 0; i < res.data.length; i++) {
  340. this.typeDictionaries.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  341. }
  342. });
  343. this.getDicts("cashier_account_management_control_type").then((res) => {
  344. for (var i = 0; i < res.data.length; i++) {
  345. this.managementControlTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  346. }
  347. });
  348. this.getDicts("bank_type").then(res => {
  349. for (var i = 0; i < res.data.length; i++) {
  350. this.bankTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  351. }
  352. });
  353. this.getDicts("village_account_type").then(res => {
  354. for (var i = 0; i < res.data.length; i++) {
  355. this.villageAccountTypeOptions.push({text: res.data[i].dictLabel, value: res.data[i].dictValue});
  356. }
  357. });
  358. getSubjectDetail().then((res) => {
  359. for (var i = 0; i < res.rows.length; i++) {
  360. this.subjectDictionaries.push({text: res.rows[i].subjectNameAll, value: res.rows[i].subjectId});
  361. }
  362. });
  363. },
  364. getTaList(){
  365. let params= {
  366. // 分页
  367. pageNum: 1,
  368. pageSize: 100,
  369. bankType:this.form.bankType,
  370. }
  371. // this.getCentralBookOptions();
  372. queryTaccount(params).then(res => {
  373. this.taccountIdOptions = res.rows;
  374. for (var i = 0; i < res.rows.length; i++) {
  375. this.$set(this.taccountIdOptions[i], "text",res.rows[i].payee);
  376. this.$set(this.taccountIdOptions[i], "value",res.rows[i].id);
  377. }
  378. });
  379. },
  380. getError(e){
  381. this.$notify({ type: 'danger', message: e.errors[0].message });
  382. },
  383. onConfirmCentralBookId(val){
  384. this.showCentralBookId = false
  385. this.$set(this.form, "centralBookId",val.value);
  386. this.centralBookId = val.text
  387. getCentralSubjects({bookId: val.id}).then((res) => {
  388. this.centralSubjectIdList = res.data;
  389. for (var i = 0; i < res.data.length; i++) {
  390. this.$set(this.centralSubjectIdList[i], "text",res.data[i].subjectName);
  391. this.$set(this.centralSubjectIdList[i], "value",res.data[i].subjectId);
  392. }
  393. })
  394. },
  395. onConfirmCentralSubjectId(val){
  396. this.showCentralSubjectId = false
  397. this.$set(this.form, "centralSubjectId",val.value);
  398. this.centralSubjectId = val.text
  399. },
  400. onConfirmManagementControlType(val){
  401. if(val==2){
  402. getCentralBooks({yinnongTaccountId: this.form.taccountId}).then((res) => {
  403. this.centralBookIdList = res.data;
  404. for (var i = 0; i < res.data.length; i++) {
  405. this.$set(this.centralBookIdList[i], "text",res.data[i].bookName);
  406. this.$set(this.centralBookIdList[i], "value",res.data[i].id);
  407. }
  408. });
  409. }
  410. },
  411. onConfirmBankDeposit(val){
  412. this.showBankDeposit = false;
  413. this.depositListShow = false;
  414. console.log(val)
  415. this.$set(this.form, "bankName", val.text);
  416. this.$set(this.form, "paymentLines", val.payeePaymentLines);
  417. this.$set(this.form, "alternateField10", val.institutionNumber);
  418. },
  419. onConfirmTaccountId(val){
  420. this.showTaccountId = false
  421. this.taccountId = val.text
  422. console.log(val)
  423. this.$set(this.form, "taccountId", val.value);
  424. this.$set(this.form, "cifNo", val.cifNo);
  425. this.$set(this.form, "accountName", val.payee);
  426. this.$set(this.form, "managementControlType", val.managementControlType);
  427. this.$set(this.form, "accountPassword", val.accountPassword);
  428. this.$set(this.form, "centralBookId", val.centralBookId);
  429. this.taccountIdOptions.map(res => {
  430. if(res.id==val.value){
  431. if(this.form.villageAccountType === '3'){
  432. this.$set(this.form, "bankAccountNumber", res.payeeAccount);
  433. }
  434. //this.form.bankName = res.bankDeposit;
  435. this.$set(this.form, "bankName", res.bankDeposit);
  436. this.$set(this.form, "paymentLines", res.payeePaymentLines);
  437. }
  438. })
  439. },
  440. onConfirmBankType(val){
  441. this.showBankType = false
  442. this.bankType = val.text
  443. this.$set(this.form, "bankType", val.value);
  444. this.getTaList();
  445. this.$set(this.form, "bankName", '');
  446. this.$set(this.form, "paymentLines", '');
  447. this.bankDepositQueryParams.bankType = val.value;
  448. listDeposit(this.bankDepositQueryParams).then(response => {
  449. this.bankDepositList = response.rows;
  450. for (var i = 0; i < response.rows.length; i++) {
  451. this.$set(this.bankDepositList[i], "text",response.rows[i].bankDeposit);
  452. this.$set(this.bankDepositList[i], "value",response.rows[i].bankDeposit);
  453. }
  454. })
  455. },
  456. onConfirmVillageAccountType(val){
  457. this.showVillageAccountType = false
  458. this.villageAccountType = val.text
  459. this.$set(this.form, "villageAccountType", val.value);
  460. },
  461. onConfirmSubject(data){
  462. this.subjectDeatil = data.text;
  463. this.form.subjectId = data.value;
  464. this.form.subjectNameAll = data.text;
  465. this.showSubjectId = false;
  466. },
  467. onConfirmType(data){
  468. this.accountType = data.text;
  469. this.form.accountType = data.value;
  470. this.showAccountType = false;
  471. },
  472. goModify(){
  473. console.log(this.form)
  474. this.form.balance = this.form.initialBalance;
  475. addAccount(this.form).then((response) => {
  476. this.$toast.success('添加成功');
  477. setTimeout(function(){
  478. history.go(-1)
  479. },2000)
  480. });
  481. },
  482. goBack(){
  483. window.history.go(-1)
  484. },
  485. selectDeposit(val){
  486. //depositListShow
  487. console.log(val)
  488. console.log(this.form.bankName)
  489. if (val == '' || this.form.bankName == ''){return;}
  490. this.depositListShow = true;
  491. let queryParams={
  492. "bankType":this.form.bankType,
  493. "status": "0",
  494. "bankDeposit":this.form.bankName,
  495. "pageNum":1,
  496. "pageSize":10
  497. }
  498. listDeposit(queryParams).then(response => {
  499. this.bankDepositList = []
  500. for(var i = 0 ; i < response.rows.length ; i++){
  501. this.bankDepositList.push(
  502. {
  503. "text":response.rows[i].bankDeposit,
  504. "value":response.rows[i].id,
  505. "payeePaymentLines":response.rows[i].payeePaymentLines,
  506. "institutionNumber":response.rows[i].institutionNumber
  507. }
  508. );
  509. }
  510. });
  511. }
  512. },
  513. }
  514. </script>
  515. <style scoped lang="scss">
  516. .deposit_list{
  517. height: 18vh;
  518. width: 96%;
  519. position: absolute;
  520. background: #fff;
  521. box-shadow: 0 10PX 10PX rgba(0, 0, 0, .5);
  522. left: 2%;
  523. z-index: 9;
  524. border-radius: 0 0 5PX 5PX;
  525. overflow-y: scroll;
  526. }
  527. .app-container {
  528. padding: 2% 0;
  529. }
  530. .main_title{
  531. font-size: 0.4rem;
  532. color: #1D6FE9;
  533. margin: 0.2rem 6%;
  534. margin-top: 0;
  535. position: relative;
  536. }
  537. .main_box{
  538. width: 96%;
  539. margin: 0 auto;
  540. border-radius: 6px;
  541. box-shadow: 0px 3px 6px 0px rgba(0,0,0,0.16);
  542. overflow: hidden;
  543. background-color: #FFF;
  544. }
  545. .submitButton{
  546. width: 80%;
  547. margin: 0 auto;
  548. background-color: #1D6FE9;
  549. }
  550. .addFamily{
  551. position: absolute;
  552. top: -2px;
  553. right: 0;
  554. border-radius: 50%;
  555. }
  556. </style>