accInf.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951
  1. <template>
  2. <div class="app-container zap-main">
  3. <search-bar :hiddenSetting="true" @query="handleQuery" @reset="resetQuery">
  4. <el-form
  5. :model="queryParams"
  6. ref="queryForm"
  7. :inline="true"
  8. v-show="showSearch"
  9. label-width="100px"
  10. >
  11. <el-form-item label="账户卡号" prop="paiAccno">
  12. <el-input
  13. v-model="queryParams.paiAccno"
  14. placeholder="请输入账户卡号"
  15. clearable
  16. @keyup.enter.native="handleQuery"
  17. maxlength="25"
  18. />
  19. </el-form-item>
  20. </el-form>
  21. </search-bar>
  22. <div class="zap-content zap-margin-top">
  23. <el-button
  24. type="primary"
  25. icon="el-icon-plus"
  26. @click="handleAdd"
  27. v-hasPermi="['accInf:accInf:add']"
  28. >添加对公账户</el-button
  29. >
  30. </div>
  31. <el-table
  32. class="zap-table"
  33. v-loading="loading"
  34. :data="accList"
  35. @selection-change="handleSelectionChange"
  36. stripe
  37. >
  38. <el-table-column label="序号" type="index" width="55" align="center" />
  39. <el-table-column label="开户行" align="center" prop="paiBankName" />
  40. <el-table-column
  41. label="账户类型"
  42. :formatter="formulaFormat"
  43. align="center"
  44. prop="paiAcctype"
  45. />
  46. <el-table-column label="账户卡号" align="center" prop="paiAccno" />
  47. <el-table-column
  48. label="账户状态"
  49. :formatter="formulaFormatSend"
  50. align="center"
  51. prop="paiStatus"
  52. />
  53. <el-table-column
  54. label="操作"
  55. align="center"
  56. class-name="small-padding fixed-width"
  57. >
  58. <template slot-scope="scope">
  59. <el-button
  60. size="mini"
  61. type="text"
  62. icon="el-icon-edit"
  63. @click="handleUpdate(scope.row)"
  64. v-hasPermi="['accInf:accInf:edit']"
  65. v-if="scope.row.paiAcctype == '00' || scope.row.paiAcctype == '01'"
  66. >修改</el-button
  67. >
  68. <el-button
  69. size="mini"
  70. type="text"
  71. icon="el-icon-delete"
  72. @click="handleDelete(scope.row)"
  73. v-hasPermi="['accInf:accInf:delete']"
  74. v-if="scope.row.paiAcctype == '01'"
  75. >删除</el-button
  76. >
  77. <el-button
  78. size="mini"
  79. type="text"
  80. icon="el-icon-withdrawal"
  81. @click="handleWithdrawal(scope.row)"
  82. v-hasPermi="['user:wthdrawal:add']"
  83. v-if="
  84. scope.row.paiAcctype == '06' ||
  85. scope.row.paiAcctype == '07' ||
  86. scope.row.paiAcctype == '08'
  87. "
  88. >提现</el-button
  89. >
  90. <el-button
  91. size="mini"
  92. type="text"
  93. icon="el-icon-recharge"
  94. @click="handleRecharge(scope.row)"
  95. v-if="
  96. scope.row.paiAcctype == '06' ||
  97. scope.row.paiAcctype == '07' ||
  98. scope.row.paiAcctype == '08'
  99. "
  100. >充值</el-button
  101. >
  102. <el-button
  103. size="mini"
  104. type="text"
  105. icon="el-icon-view"
  106. @click="handleDetail(scope.row)"
  107. v-if="scope.row.paiAcctype == '06'"
  108. >交易明细</el-button
  109. >
  110. </template>
  111. </el-table-column>
  112. </el-table>
  113. <pagination
  114. v-show="total > 0"
  115. :total="total"
  116. :page.sync="queryParams.pageNum"
  117. :limit.sync="queryParams.pageSize"
  118. @pagination="getList"
  119. />
  120. <!-- 添加对公账户 -->
  121. <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
  122. <el-form
  123. ref="form"
  124. :model="form"
  125. :rules="rules"
  126. label-width="120px"
  127. :inline="true"
  128. >
  129. <el-form-item prop="smiType" label="开户银行" size="large">
  130. <el-select
  131. @change="changePayer"
  132. v-model="form.paiBankName"
  133. filterable
  134. clearable
  135. remote
  136. reserve-keyword
  137. placeholder="请选择开户银行"
  138. :remote-method="getBankList"
  139. >
  140. <el-option
  141. v-for="(item, index) in bankList"
  142. :key="index"
  143. :label="item.zcbiBankName"
  144. :value="item.zcbiBankName"
  145. >
  146. </el-option>
  147. </el-select>
  148. </el-form-item>
  149. <el-form-item label="分支行" prop="paiQlbankname" size="large">
  150. <el-input
  151. v-model="form.paiQlbankname"
  152. clearable
  153. style="width: 215px"
  154. placeholder="请输入分支行"
  155. maxlength="15"
  156. />
  157. </el-form-item>
  158. <el-form-item label="账户名称" prop="scySocialCode" size="large">
  159. <el-input
  160. v-model="form.paiAccnoName"
  161. disabled
  162. clearable
  163. style="width: 215px"
  164. placeholder="请输入账户名称"
  165. maxlength="18"
  166. />
  167. </el-form-item>
  168. <el-form-item label="账户卡号" prop="paiAccno" size="large">
  169. <el-input
  170. v-model="form.paiAccno"
  171. clearable
  172. style="width: 215px"
  173. placeholder="请输入账户卡号"
  174. maxlength="22"
  175. />
  176. </el-form-item>
  177. </el-form>
  178. <el-row style="height: 109px" type="flex" align="middle" justify="center">
  179. <el-button type="primary" plain @click="cancel">取 消</el-button>
  180. <el-button type="primary" @click="submitForm">确 定</el-button>
  181. </el-row>
  182. </el-dialog>
  183. <!-- 修改对公账户 -->
  184. <el-dialog :title="title" :visible.sync="edit" width="800px" append-to-body>
  185. <el-form
  186. ref="form"
  187. :model="form"
  188. :rules="rules"
  189. label-width="120px"
  190. :inline="true"
  191. >
  192. <el-form-item prop="smiType" label="开户银行" size="large">
  193. <el-select
  194. @change="changePayer"
  195. v-model="form.paiBankName"
  196. :disabled="disableds"
  197. filterable
  198. clearable
  199. remote
  200. reserve-keyword
  201. placeholder="请选择开户银行"
  202. :remote-method="getBankList"
  203. >
  204. <el-option
  205. v-for="(item, index) in bankList"
  206. :key="index"
  207. :label="item.zcbiBankName"
  208. :value="item.zcbiBankName"
  209. >
  210. </el-option>
  211. </el-select>
  212. </el-form-item>
  213. <el-form-item label="分支行" prop="paiQlbankname" size="large">
  214. <el-input
  215. v-model="form.paiQlbankname"
  216. clearable
  217. style="width: 215px"
  218. placeholder="请输入分支行"
  219. maxlength="15"
  220. />
  221. </el-form-item>
  222. <el-form-item label="账户名称" prop="paiAccnoName" size="large">
  223. <el-input
  224. v-model="form.paiAccnoName"
  225. disabled
  226. clearable
  227. style="width: 215px"
  228. placeholder="请输入账户名称"
  229. maxlength="18"
  230. />
  231. </el-form-item>
  232. <el-form-item label="账户卡号" prop="paiAccno" size="large">
  233. <el-input
  234. v-model="form.paiAccno"
  235. :disabled="disableds"
  236. clearable
  237. style="width: 215px"
  238. placeholder="请输入账户卡号"
  239. maxlength="22"
  240. />
  241. </el-form-item>
  242. </el-form>
  243. <el-row style="height: 109px" type="flex" align="middle" justify="center">
  244. <el-button type="primary" plain @click="cancelEdit">取 消</el-button>
  245. <el-button type="primary" @click="submitEdit">确 定</el-button>
  246. </el-row>
  247. </el-dialog>
  248. <!-- 充值页面 -->
  249. <el-dialog
  250. :title="title"
  251. :visible.sync="recharge"
  252. width="800px"
  253. append-to-body
  254. >
  255. <el-form
  256. ref="form"
  257. :model="form"
  258. :rules="rules"
  259. label-width="120px"
  260. :inline="true"
  261. >
  262. <el-row type="flex" align="middle" class="zap-title"
  263. ><span class="zap-title__prefix"></span
  264. >复制以下信息,去银行客户端转账</el-row
  265. >
  266. <el-form-item label="开户银行" prop="paiBankName" size="large">
  267. <el-input
  268. v-model="form.paiBankName"
  269. style="width: 215px"
  270. placeholder="请输入开户银行"
  271. maxlength="15"
  272. />
  273. </el-form-item>
  274. <el-form-item label="分支行" prop="paiQlbankname" size="large">
  275. <el-input
  276. v-model="form.paiQlbankname"
  277. clearable
  278. style="width: 215px"
  279. placeholder="请输入分支行"
  280. maxlength="15"
  281. />
  282. </el-form-item>
  283. <el-form-item label="账户名称" prop="paiAccnoName" size="large">
  284. <el-input
  285. v-model="form.paiAccnoName"
  286. clearable
  287. style="width: 215px"
  288. placeholder="请输入账户名称"
  289. maxlength="18"
  290. />
  291. </el-form-item>
  292. <el-form-item label="账户卡号" prop="paiAccno" size="large">
  293. <el-input
  294. v-model="form.paiAccno"
  295. clearable
  296. style="width: 215px"
  297. placeholder="请输入账户卡号"
  298. maxlength="15"
  299. />
  300. </el-form-item>
  301. </el-form>
  302. <el-row style="height: 109px" type="flex" align="middle" justify="center">
  303. <el-button type="primary" plain @click="cancelRecharge"
  304. >确 认</el-button
  305. >
  306. </el-row>
  307. </el-dialog>
  308. <!-- 提现页面 -->
  309. <el-dialog
  310. :title="title"
  311. :visible.sync="withdrawal"
  312. width="800px"
  313. append-to-body
  314. >
  315. <el-form
  316. ref="form"
  317. :model="form"
  318. :rules="rules"
  319. label-width="120px"
  320. :inline="true"
  321. >
  322. <el-form-item label="账户卡号" prop="paiAccno" size="large">
  323. <el-select
  324. v-model="form.paiAccno"
  325. filterable
  326. clearable
  327. remote
  328. reserve-keyword
  329. placeholder="请选择账户卡号"
  330. >
  331. <el-option
  332. v-for="(item, index) in cardList"
  333. :key="index"
  334. :label="item.paiAccno+'/'+item.paiQlbankname"
  335. :value="item.paiAccno"
  336. @click.native="changeAcc(item)"
  337. >
  338. </el-option>
  339. </el-select>
  340. </el-form-item>
  341. <el-button
  342. type="primary"
  343. icon="el-icon-plus"
  344. @click="handleAdd"
  345. v-hasPermi="['accInf:accInf:add']"
  346. >添加对公账户</el-button
  347. >
  348. <el-form-item label="开户银行" prop="paiBankName" size="large">
  349. <el-input
  350. v-model="form.paiBankName"
  351. disabled
  352. clearable
  353. style="width: 215px"
  354. placeholder="请输入开户银行"
  355. maxlength="15"
  356. />
  357. </el-form-item>
  358. <el-form-item label="分支行" prop="paiQlbankname" size="large">
  359. <el-input
  360. v-model="form.paiQlbankname"
  361. disabled
  362. clearable
  363. style="width: 215px"
  364. placeholder="请输入分支行"
  365. maxlength="15"
  366. />
  367. </el-form-item>
  368. <el-form-item label="账户名称" prop="paiAccnoName" size="large">
  369. <el-input
  370. v-model="form.paiAccnoName"
  371. disabled
  372. clearable
  373. style="width: 215px"
  374. placeholder="请输入账户名称"
  375. maxlength="18"
  376. />
  377. </el-form-item>
  378. <el-form-item label="提现金额" prop="amount" size="large">
  379. <el-input
  380. v-model="form.amount"
  381. clearable
  382. style="width: 215px"
  383. placeholder="请输入提现金额"
  384. maxlength="18"
  385. />
  386. </el-form-item>
  387. <el-form-item label="电子账户" prop="accno" size="large" style="display:none">
  388. <el-input
  389. v-model="form.accno"
  390. clearable
  391. style="width: 215px"
  392. placeholder="请输入电子账户"
  393. maxlength="18"
  394. />
  395. </el-form-item>
  396. <el-button type="primary" plain @click="allMoney">全部提现</el-button>
  397. <el-form-item prop="cade">
  398. <el-input v-model="form.shortMessageCode" type="text" maxlength="" auto-complete="off" placeholder="请输入验证码">
  399. <svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
  400. <el-button class="zap-code-button" slot="suffix" @click="sendMessage" :disabled="sendShortMessageBtn">{{codeBtnWord}}</el-button>
  401. </el-input>
  402. </el-form-item>
  403. <el-row type="flex" align="middle" class="zap-title"
  404. ><span class="zap-title__prefix"></span>可提现金额:{{KYAMT ? KYAMT : 0.00}}元</el-row
  405. >
  406. </el-form>
  407. <el-row style="height: 109px" type="flex" align="middle" justify="center">
  408. <el-button type="primary" plain @click="cancelWithdrawal"
  409. >确 认</el-button
  410. >
  411. </el-row>
  412. </el-dialog>
  413. </div>
  414. </template>
  415. <script>
  416. import { listAcc,addAcc,updateAcc,delAcc,listBank,detailsAcc,listCard,wthdrawal,listChargeStatus,payMoney} from "@/api/system/accInf";
  417. import { balance } from "@/api/bank/bankInterface";
  418. import { listElectronicsAcc } from "@/api/common/companyAcc";
  419. import {sendMessageForMoney} from "@/api/login";
  420. import { release } from 'os';
  421. import Cookies from 'js-cookie';
  422. export default {
  423. name: "accInf",
  424. data() {
  425. return {
  426. //验证码
  427. sendShortMessageBtn : false,
  428. codeBtnWord: '获取验证码', // 获取验证码按钮文字
  429. //可用余额
  430. KYAMT: null,
  431. //电子账户
  432. accno: null,
  433. // id隐藏
  434. isShow: false,
  435. // 遮罩层
  436. loading: true,
  437. // 选中数组
  438. ids: [],
  439. // 非单个禁用
  440. single: true,
  441. // 非多个禁用
  442. multiple: true,
  443. // 显示搜索条件
  444. showSearch: true,
  445. //联系人隐藏
  446. disabled: false,
  447. disableds: false,
  448. // 总条数
  449. total: 0,
  450. // 账户表格数据
  451. accList: [],
  452. //账户卡号数据
  453. cardList: [],
  454. //姓名
  455. nameList: [],
  456. bankList: [],
  457. //字典
  458. formulaOptions: [],
  459. formulaOptionsSend: [],
  460. UserList: [],
  461. enclosureList: [],
  462. sfzList: [],
  463. // 弹出层标题
  464. title: "",
  465. // 是否显示弹出层
  466. open: false,
  467. // 是否显示弹出层
  468. edit: false,
  469. // 是否显示弹出层
  470. recharge: false,
  471. // 是否显示弹出层
  472. withdrawal: false,
  473. // 查询参数
  474. queryParams: {
  475. pageNum: 1,
  476. pageSize: 10,
  477. scyName: null,
  478. smiType: null,
  479. smiManager: null,
  480. smiContract: null,
  481. smiContractPhone: null,
  482. sfsContent: null,
  483. sfsIsDel: null,
  484. sfsRemark: null,
  485. ssId: null,
  486. ssName: null,
  487. },
  488. // 表单参数
  489. form: {
  490. shortMessageCode: null
  491. },
  492. // 表单校验
  493. rules: {
  494. paiBankName: [
  495. {
  496. required: true,
  497. message: "开户银行不能为空",
  498. trigger: ["change", "blur"],
  499. },
  500. ],
  501. paiQlbankname: [
  502. {
  503. required: true,
  504. message: "分支行不能为空",
  505. trigger: ["change", "blur"],
  506. },
  507. ],
  508. paiAccno: [
  509. {
  510. required: true,
  511. message: "银行卡号不能为空",
  512. trigger: ["change", "blur"],
  513. },
  514. ],
  515. amount: [
  516. {
  517. required: true,
  518. message: "提现金额不能为空",
  519. trigger: ["change", "blur"],
  520. },
  521. ],
  522. },
  523. };
  524. },
  525. created() {
  526. this.getList();
  527. this.getBankList();
  528. this.getDicts("pay_pai_acctype").then((response) => {
  529. this.formulaOptions = response.data;
  530. });
  531. this.getDicts("pay_pai_status").then((response) => {
  532. this.formulaOptionsSend = response.data;
  533. });
  534. },
  535. methods: {
  536. //切换账款类型
  537. changePayer(value) {
  538. if (value) {
  539. this.$set(this.form, "paiQlbankname", value);
  540. }
  541. },
  542. //提现选择账户
  543. changeAcc(item){
  544. if (item.paiAccno) {
  545. this.$set(this.form, "paiQlbankname", item.paiQlbankname);
  546. this.$set(this.form, "paiBankName", item.paiBankName);
  547. this.$set(this.form, "paiAccnoName", item.paiAccnoName);
  548. }
  549. },
  550. /** 查询账户列表 */
  551. getList() {
  552. this.loading = true;
  553. listAcc(this.queryParams).then((response) => {
  554. this.accList = response.data.records;
  555. this.total = response.data.total;
  556. this.loading = false;
  557. });
  558. },
  559. //查询对公账户
  560. listCard(){
  561. listCard().then((response) => {
  562. this.cardList = response.data.records;
  563. });
  564. },
  565. // 取消按钮
  566. cancel() {
  567. this.open = false;
  568. },
  569. // 修改取消按钮
  570. cancelEdit() {
  571. this.edit = false;
  572. this.reset();
  573. },
  574. // 充值取消按钮
  575. cancelRecharge() {
  576. this.recharge = false;
  577. this.reset();
  578. },
  579. //全部提现
  580. allMoney(){
  581. this.$set(this.form, "amount", this.KYAMT);
  582. },
  583. // 提现按钮
  584. cancelWithdrawal() {
  585. var self = this;
  586. this.$refs["form"].validate(valid => {
  587. if (valid) {
  588. const loading = self.$loading({
  589. lock: true,
  590. text: "Loading",
  591. spinner: "el-icon-loading",
  592. background: "rgba(0, 0, 0, 0.7)",
  593. });
  594. if(eval(self.form.amount) > eval(self.KYAMT)){
  595. self.$message({
  596. message: '提现金额不得大于可提现金额!',
  597. type: 'warning'
  598. });
  599. loading.close();
  600. }else if(self.form.shortMessageCode == null || self.form.shortMessageCode == ""){
  601. self.msgError("请输入短信验证码!");
  602. loading.close();
  603. }else{
  604. console.log(self.form.shortMessageCode,'验证码')
  605. //stAccNo:实体账户 dzAccNo:电子账户 tranAmt:提现金额 shortMessageCode:短信验证码
  606. var map = {'stAccNo': self.form.paiAccno,'dzAccNo':self.form.accno,'tranAmt':self.form.amount,'shortMessageCode':self.form.shortMessageCode}
  607. wthdrawal(map).then((response) =>{
  608. debugger
  609. if(response.data.status == "1"){
  610. loading.close();
  611. self.msgSuccess("提现成功");
  612. this.withdrawal = false;
  613. this.getList();
  614. }else if(response.data.status == "0"){
  615. loading.close();
  616. self.msgSuccess("提现中");
  617. this.withdrawal = false;
  618. this.getList();
  619. }else if(response.data.status == "2"){
  620. loading.close();
  621. self.msgError("提现失败,请稍后再试");
  622. this.withdrawal = false;
  623. this.getList();
  624. }
  625. }).catch(() => {
  626. loading.close();
  627. });
  628. }
  629. }
  630. });
  631. //this.withdrawal = false;
  632. //this.reset();
  633. },
  634. // 表单重置
  635. reset() {
  636. this.form = {
  637. scyId: null,
  638. scyName: null,
  639. smiType: null,
  640. smiManager: null,
  641. smiContract: null,
  642. smiContractPhone: null,
  643. sfsContent: null,
  644. sfsIsDel: null,
  645. createBy: null,
  646. createTime: null,
  647. updateBy: null,
  648. updateTime: null,
  649. sfsRemark: null,
  650. ssId: null,
  651. ssName: null,
  652. amount: null,
  653. shortMessageCode: null
  654. };
  655. this.noneBtnImg = false;
  656. this.enclosureList = [];
  657. this.sfzList = [];
  658. this.resetForm("form");
  659. this.accno = null,
  660. this.KYAMT = null
  661. },
  662. /** 搜索按钮操作 */
  663. handleQuery() {
  664. this.queryParams.pageNum = 1;
  665. this.getList();
  666. },
  667. /** 重置按钮操作 */
  668. resetQuery() {
  669. this.resetForm("queryForm");
  670. this.handleQuery();
  671. },
  672. // 多选框选中数据
  673. handleSelectionChange(selection) {
  674. this.ids = selection.map((item) => item.scyId);
  675. this.single = selection.length !== 1;
  676. this.multiple = !selection.length;
  677. },
  678. //资方类型
  679. formulaFormat(row, column) {
  680. return this.selectDictLabel(this.formulaOptions, row.paiAcctype);
  681. },
  682. //奖项
  683. formulaFormatSend(row, column) {
  684. return this.selectDictLabel(this.formulaOptionsSend, row.paiStatus);
  685. },
  686. //查询银行名称
  687. getBankList(paiBankName) {
  688. this.queryParams.paiBankName = paiBankName;
  689. listBank(this.queryParams).then((response) => {
  690. this.bankList = response.data.records;
  691. });
  692. },
  693. /** 新增按钮操作 */
  694. handleAdd() {
  695. this.reset();
  696. this.open = true;
  697. detailsAcc().then((response) => {
  698. this.$set(this.form, "paiAccnoName", response.data.company);
  699. });
  700. this.title = "添加对公账户";
  701. },
  702. /** 修改按钮操作 */
  703. handleUpdate(row) {
  704. this.reset();
  705. const paiId = row.paiId || this.ids;
  706. detailsAcc(paiId).then((response) => {
  707. debugger
  708. this.form = response.data.sccInf[0];
  709. this.edit = true;
  710. if (response.data.sccInf[0].paiAcctype == "00") {
  711. this.disableds = true;
  712. }else{
  713. this.disableds = false;
  714. }
  715. this.title = "修改对公账户";
  716. });
  717. },
  718. /** 充值按钮操作 */
  719. handleRecharge(row) {
  720. this.reset();
  721. const paiId = row.paiId || this.ids;
  722. detailsAcc(paiId).then((response) => {
  723. this.form = response.data.sccInf[0];
  724. this.recharge = true;
  725. this.title = "充值转账";
  726. });
  727. },
  728. /** 提现按钮操作 */
  729. handleWithdrawal(row) {
  730. var self = this;
  731. self.reset();
  732. //查询本企业电子账户余额
  733. listElectronicsAcc().then((response) =>{
  734. if(response.data[0]){
  735. self.accno = response.data[0].paiAccno
  736. self.$set(self.form, "accno", response.data[0].paiAccno);
  737. balance(response.data[0].paiAccno).then((response) =>{
  738. self.KYAMT = response.data.kyAmt
  739. })
  740. }
  741. }).then(() =>{
  742. listChargeStatus(self.accno).then((response) =>{
  743. debugger
  744. const list = response.data;
  745. if(list.length > 0){
  746. const newDatas = []
  747. let confirmText = []
  748. const h = self.$createElement
  749. for (let i = 0; i < list.length; i++) {
  750. confirmText = [
  751. `编号:${list[i].zfrNumber}`,`费用:${list[i].zciAmount}`
  752. ]
  753. for (const j in confirmText) {
  754. newDatas.push(h('p', null, confirmText[j]))
  755. }
  756. }
  757. self.$confirm('提示', {
  758. title: '请缴纳手续费',
  759. message: h('div', null, newDatas),
  760. confirmButtonText: '确定',
  761. cancelButtonText: '取消',
  762. center: true
  763. })
  764. .then(function(){
  765. const loading = self.$loading({
  766. lock: true,
  767. text: "Loading",
  768. spinner: "el-icon-loading",
  769. background: "rgba(0, 0, 0, 0.7)",
  770. });
  771. var map = {'accNo':self.accno}
  772. payMoney(map).then((response) =>{
  773. debugger
  774. const resultList = response.data;
  775. if(resultList.length > 0){
  776. self.msgError("缴费失败!");
  777. loading.close();
  778. }else{
  779. loading.close();
  780. self.$message({
  781. message: '缴费成功',
  782. type: 'success'
  783. });
  784. listCard().then((response) => {
  785. self.cardList = response.data.records;
  786. });
  787. const paiId = row.paiId || self.ids;
  788. detailsAcc(paiId).then((response) => {
  789. self.form = response.data.sccInf[0];
  790. self.withdrawal = true;
  791. self.title = "提现";
  792. });
  793. }
  794. }).catch(() => {
  795. loading.close();
  796. });
  797. })
  798. }else{
  799. listCard().then((response) => {
  800. self.cardList = response.data.records;
  801. });
  802. const paiId = row.paiId || self.ids;
  803. detailsAcc(paiId).then((response) => {
  804. self.form = response.data.sccInf[0];
  805. self.withdrawal = true;
  806. self.title = "提现";
  807. });
  808. }
  809. })
  810. })
  811. },
  812. //交易明细按钮
  813. handleDetail(row){
  814. Cookies.set("/accInf/accInfDetail/")
  815. this.$router.push({ path: "/accInf/accInfDetail/"});
  816. },
  817. // accNo(item) {
  818. // if(item.paiAccno){
  819. // balance(item.paiAccno).then((response) =>{
  820. // this.KYAMT = response.data.list.row.KYAMT
  821. // })
  822. // }
  823. // },
  824. /** 新增提交按钮 */
  825. submitForm() {
  826. this.$refs["form"].validate((valid) => {
  827. if (valid) {
  828. const loading = this.$loading({
  829. lock: true,
  830. text: "Loading",
  831. spinner: "el-icon-loading",
  832. background: "rgba(0, 0, 0, 0.7)",
  833. });
  834. addAcc(this.form)
  835. .then((response) => {
  836. loading.close();
  837. this.msgSuccess("新增成功");
  838. this.open = false;
  839. this.getList();
  840. this.listCard();
  841. })
  842. .catch((response) => {
  843. loading.close();
  844. });
  845. }
  846. });
  847. },
  848. /** 提交按钮 */
  849. submitEdit() {
  850. this.$refs["form"].validate((valid) => {
  851. if (valid) {
  852. const loading = this.$loading({
  853. lock: true,
  854. text: "Loading",
  855. spinner: "el-icon-loading",
  856. background: "rgba(0, 0, 0, 0.7)",
  857. });
  858. updateAcc(this.form)
  859. .then((response) => {
  860. loading.close();
  861. this.msgSuccess("修改成功");
  862. this.edit = false;
  863. this.getList();
  864. })
  865. .catch((response) => {
  866. loading.close();
  867. });
  868. }
  869. });
  870. },
  871. /** 删除按钮操作 */
  872. handleDelete(row) {
  873. const paiId = row.paiId || this.ids;
  874. const paiAccno = row.paiAccno;
  875. this.$confirm(
  876. '是否确认删除账户卡号为"' + paiAccno + '"的数据项?',
  877. "警告",
  878. {
  879. confirmButtonText: "确定",
  880. cancelButtonText: "取消",
  881. type: "warning",
  882. }
  883. )
  884. .then(function () {
  885. return delAcc(paiId);
  886. })
  887. .then(() => {
  888. this.getList();
  889. this.msgSuccess("删除成功");
  890. });
  891. },
  892. sendMessage(){
  893. this.$refs.form.validate((valid) => {
  894. if (valid) {
  895. // 调用获取短信验证码接口
  896. sendMessageForMoney(this.form.phone, this.form.code, this.form.uuid).then(response => {
  897. this.sendShortMessageBtn = true;
  898. this.msgSuccess("发送成功!");
  899. // 因为下面用到了定时器,需要保存this指向
  900. let that = this
  901. that.waitTime = 60;
  902. this.codeBtnWord = `${this.waitTime}s 后重新获取`
  903. let timer = setInterval(function(){
  904. if(that.waitTime>1){
  905. that.waitTime--
  906. that.codeBtnWord = `${that.waitTime}s 后重新获取`
  907. }else{
  908. clearInterval(timer)
  909. that.codeBtnWord = '获取验证码'
  910. that.waitTime = 60
  911. that.sendShortMessageBtn = false;
  912. }
  913. },1000)
  914. }).catch((response)=>{
  915. });
  916. }
  917. })
  918. },
  919. },
  920. };
  921. </script>
  922. <style rel="stylesheet/scss" lang="scss">
  923. // 验证码
  924. .login-code {
  925. height: 55px;
  926. img {
  927. cursor: pointer;
  928. vertical-align: middle;
  929. }
  930. }
  931. .login-code-img {
  932. flex: 1;
  933. height: 55px;
  934. margin-left: 8px;
  935. }
  936. .rightulliimg{
  937. width: 860px;
  938. }
  939. .divider_left{
  940. margin-left: -40px;
  941. }
  942. </style>