payCenter.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782
  1. <template>
  2. <div class="mobile-pay-center vendor-pay mobile-fix-content mobile-centerfix-content" :class="{'vendor-pay-record': switchType === 'record' && recordList.length}" id="mobileFixContent">
  3. <!--<div class="mp-head" v-if="!fromUserPage">-->
  4. <!--<span class="inline-block" :class="{'active': switchType === 'record'}" @click="setSwitchType('record')">交易记录</span>-->
  5. <!--<span class="inline-block" :class="{'active': switchType === 'account'}" @click="setSwitchType('account')">收款账户</span>-->
  6. <!--</div>-->
  7. <!-- 账户信息start -->
  8. <div class="mp-content" v-if="switchType == 'account'">
  9. <!--<p class="mp-content-header">已设置的账户信息<span class="fr" @click="openAddAccount"><i class="iconfont icon-xinzeng"></i>新增账户</span></p>-->
  10. <ul class="mp-list">
  11. <li v-for="account in accountList">
  12. <div class="content-line">
  13. <span class="inline-block title">开户银行:</span>
  14. <span class="inline-block content text-ellipse">{{account.bankname}}</span>
  15. </div>
  16. <div class="content-line">
  17. <span class="inline-block title">开户支行:</span>
  18. <span class="inline-block content text-ellipse">{{account.branchname}}</span>
  19. </div>
  20. <div class="content-line">
  21. <span class="inline-block title">银行账户:</span>
  22. <span class="inline-block content text-ellipse">{{account.number}}</span>
  23. </div>
  24. <div class="content-line">
  25. <span class="inline-block title">开户名称:</span>
  26. <span class="inline-block content text-ellipse">{{account.accountname}}</span>
  27. </div>
  28. <div class="content-line">
  29. <span class="inline-block title">状态:</span>
  30. <span class="inline-block content text-ellipse">
  31. {{account.status | bankStatusFilter}}
  32. <i v-if="account.status == 101" class="iconfont icon-tixing"></i>
  33. </span>
  34. </div>
  35. <div class="btn-wrap clearfix">
  36. <a class="inline-block" @click="reuseAccount(account)"><i class="iconfont icon-gouxuan1"></i>重新使用</a><!-- v-if="account.status == 105"-->
  37. <a class="inline-block" @click="deleteAccount(account)"><i class="iconfont icon-lajitong"></i>删除</a>
  38. </div>
  39. </li>
  40. </ul>
  41. <div class="com-btn-wrap mp-btn-wrap">
  42. <button @click.stop="openAddAccount"><i class="iconfont icon-add"></i>新增账户</button>
  43. </div>
  44. </div>
  45. <!-- 账户信息end -->
  46. <!-- 交易记录start -->
  47. <div class="mp-record" v-if="switchType == 'record'">
  48. <div class="search-content">
  49. <input type="text" placeholder="买家名称/订单号" v-model="filterParams.keyword" @keyup.13="filterRecord">
  50. <span @click="filterRecord"><i class="iconfont icon-sousuo"></i></span>
  51. </div>
  52. <div class="filters-wrap">
  53. <base-filter
  54. v-for="filterOption in filterOptions"
  55. :key="filterOption.selectOption"
  56. :selectItems="filterOption.selectItems"
  57. :defaultVal="filterOption.defaultVal"
  58. :selectOption="filterOption.selectOption"
  59. @selectAction="onSelectAction"
  60. :title="filterOption.title"></base-filter>
  61. </div>
  62. <ul class="mp-list record-list mp-list-record" v-if="recordList.length">
  63. <li v-for="record in recordList">
  64. <div class="content-line">
  65. <span class="inline-block title">订单号:</span>
  66. <nuxt-link :to="`/mobile/order/details?uuid=${baseUtils.enidfilter(record.puid)}&type=saler`" class="inline-block content text-ellipse link">{{record.orderid}}</nuxt-link>
  67. </div>
  68. <div class="content-line">
  69. <span class="inline-block title">金额:</span>
  70. <span class="inline-block content text-ellipse">{{record.currencyName | currencyFilter}}{{record.total}}</span>
  71. </div>
  72. <div class="content-line">
  73. <span class="inline-block title">买家:</span>
  74. <span class="inline-block content text-ellipse">{{record.buyerentername || record.buyername}}</span>
  75. </div>
  76. <div class="content-line">
  77. <span class="inline-block title">交易方式:</span>
  78. <span class="inline-block content text-ellipse">{{record.type | payTypeFilter}}</span>
  79. </div>
  80. <div class="content-line">
  81. <span class="inline-block title">时间:</span>
  82. <span class="inline-block content text-ellipse">{{record.transferTime | time}}</span>
  83. </div>
  84. <div class="content-line">
  85. <span class="inline-block title">状态:</span>
  86. <span class="inline-block content text-ellipse">收款成功</span>
  87. </div>
  88. </li>
  89. </ul>
  90. <div class="fix-count-wrap" v-if="recordList.length">
  91. <span class="content">已收总计:<span>{{currencySymbol | currencyFilter}}&nbsp;{{totalMoney}}</span></span>
  92. <!--<span class="content">支出总计:<span>{{currencySymbol | currencyFilter}}&nbsp;0</span></span>
  93. <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalRecordPrice}} (共计{{recordList.length || 0}}笔交易)</p>-->
  94. <p>结余:{{currencySymbol | currencyFilter}}&nbsp;{{totalMoney}} (共计{{recordData.data.data.data.totalElements || 0}}笔交易)</p>
  95. </div>
  96. </div>
  97. <!-- 交易记录end -->
  98. <!-- 新增账户弹框start -->
  99. <modal-wrapper :noHeader="true" :showModal="showModal" @closeAction="showModal = false">
  100. <div class="add-account-modal in-wrapper">
  101. <div class="account-modal">
  102. <p class="title">新增账户</p>
  103. <div class="modal-content-line">
  104. <span class="inline-block"><i>*</i>开户银行:</span>
  105. <input type="text" readonly placeholder="例如:中国银行" v-model="bankAccountObj.bankname" @click.stop="showSimilar = !showSimilar">
  106. <ul v-if="showSimilar" class="similar">
  107. <li class="text-ellipse" v-for="bank in bankList" @click.stop="setBankName(bank)">{{bank}}</li>
  108. </ul>
  109. </div>
  110. <div class="modal-content-line">
  111. <span class="inline-block"><i>*</i>开户支行:</span>
  112. <input type="text" placeholder="例如:乔香支行" v-model="bankAccountObj.branchname" @blur="checkBranchname">
  113. </div>
  114. <div class="modal-content-line">
  115. <span class="inline-block"><i>*</i>银行账号:</span>
  116. <input type="text" placeholder="请填写银行账号" v-model="bankAccountObj.number" @blur="checkNumber">
  117. </div>
  118. <div class="modal-content-line">
  119. <span class="inline-block"><i>*</i>开户名称:</span>
  120. <input type="text" placeholder="请填写开户人姓名或企业名称" v-model="bankAccountObj.accountname" @blur="checkAccountname">
  121. </div>
  122. <div class="modal-content-line upload">
  123. <span class="inline-block"><i>*</i>上传开户许可证:</span>
  124. <input type="text" v-model="file.name" disabled>
  125. <label class="upload-btn">选择文件
  126. <input type="file" @change="onUpload($event)" accept="image/jpeg,image/jpg,image/png,.pdf">
  127. </label>
  128. </div>
  129. <div class="am-btn-wrap">
  130. <button @click="showModal = false">取消</button>
  131. <button @click="addAccount">确认</button>
  132. </div>
  133. <p class="am-remind-text clearfix">
  134. <i class="fl">*声明:</i>
  135. <span class="fr">
  136. 1. 此账户为卖家收款账户,请仔细核对信息内容,若由信息错误造成的损失,优软商城不承担赔偿责任。
  137. <br/>
  138. 2. 卖家只能有唯一一个“使用中”的收款账户,新增账户审核通过后,原账户将自动失效。
  139. <br/>
  140. 3. 如您的企业名称、开户银行及账号变更,您须在优软商城开展资金结算前进行更正,否则发生转账错误优软商城不承担赔偿责任。
  141. <br/>
  142. 4. 更多的条款请阅读《优软商城代收代付协议》 。
  143. <br/>
  144. 5. 附件仅支持JPG、PNG、PDF格式,大小超过3M。
  145. </span>
  146. </p>
  147. </div>
  148. </div>
  149. </modal-wrapper>
  150. <!-- 新增账户弹框end -->
  151. <!-- 重新使用账户提示框start -->
  152. <div class="mobile-modal reuse-account-modal" v-show="showReuseModal">
  153. <div class="ra-remind">
  154. <div class="header"><i class="iconfont icon-guanbi1" @click="showReuseModal = false"></i></div>
  155. <div class="content"><i class="fa fa-exclamation-circle"></i>
  156. <span>此操作会让使用中的收款账户失效,是否确定重新使用?</span>
  157. </div>
  158. <div class="footer">
  159. <button @click="showReuseModal = false">取消</button>
  160. <button @click="setDefaultAccount()">确认</button>
  161. </div>
  162. </div>
  163. </div>
  164. <!-- 重新使用账户提示框end -->
  165. <remind-box :title="remindText" :timeoutCount="timeoutCount"></remind-box>
  166. <pull-up :fixId="'mobileFixContent'" :searchMore="fetching" :allPage="allPage" :page="page" @pullUpAction="onPullUpAction"></pull-up>
  167. <empty-status v-if="isEmpty" :text="switchType == 'record' ? '暂无交易记录' : '暂无账户信息'" :showLink="true"></empty-status>
  168. </div>
  169. </template>
  170. <script>
  171. import { RemindBox, PullUp, EmptyStatus } from '~components/mobile/common'
  172. import { ModalWrapper, BaseFilter } from '~components/mobile/base'
  173. import axios from '~plugins/axios'
  174. export default {
  175. layout: 'mobile',
  176. middleware: 'authenticated',
  177. data () {
  178. return {
  179. fromUserPage: false,
  180. remindText: '',
  181. timeoutCount: '',
  182. page: 1,
  183. count: 10,
  184. accountList: [],
  185. recordList: [],
  186. switchType: 'record',
  187. // 分页重置标志
  188. isChange: false,
  189. showModal: false,
  190. bankList: [],
  191. showSimilar: false,
  192. bankAccountObj: {
  193. bankname: '',
  194. branchname: '',
  195. number: '',
  196. accountname: ''
  197. },
  198. validBankAccountObj: {
  199. bankname: false,
  200. branchname: false,
  201. number: false,
  202. accountname: false
  203. },
  204. filterParams: {
  205. keyword: '',
  206. fromDate: '',
  207. toDate: '',
  208. remitteeType: ''
  209. },
  210. currentId: '',
  211. showReuseModal: false,
  212. totalRecordPrice: 0,
  213. file: '',
  214. dateObj: {
  215. fromDate: '',
  216. toDate: ''
  217. },
  218. filterOptions: [
  219. {
  220. title: '交易方式',
  221. selectOption: 'remitteeType',
  222. selectItems: [{key: '全部',
  223. val: null
  224. }, {
  225. key: '买家付款',
  226. val: 'PAIDTOVENDOR'
  227. }, {
  228. key: '平台代付',
  229. val: 'PLATFORMPAIDTOVENDOR'
  230. }],
  231. defaultVal: null
  232. },
  233. // {
  234. // title: '交易状态',
  235. // selectOption: 'status',
  236. // selectItems: [{key: '全部',
  237. // val: 0
  238. // }, {
  239. // key: '已收款',
  240. // val: 1
  241. // }, {
  242. // key: '待收款',
  243. // val: 2
  244. // }],
  245. // defaultVal: 0
  246. // },
  247. {
  248. title: '交易时间',
  249. selectOption: 'date',
  250. selectItems: [{key: '全部',
  251. val: null
  252. }, {
  253. key: '一个月',
  254. val: 1
  255. }, {
  256. key: '三个月',
  257. val: 2
  258. }, {
  259. key: '六个月',
  260. val: 3
  261. }, {
  262. key: '自定义',
  263. val: 4
  264. }],
  265. defaultVal: null
  266. }
  267. ],
  268. totalMoney: 0
  269. }
  270. },
  271. components: {
  272. RemindBox,
  273. PullUp,
  274. ModalWrapper,
  275. EmptyStatus,
  276. BaseFilter
  277. },
  278. fetch ({store, route}) {
  279. return route.query.type ? Promise.all([store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
  280. ]) : Promise.all([store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})])
  281. },
  282. async asyncData({route}) {
  283. let { data } = await axios.get('/trade/transfer/vendor/bankTransfer/ledger?type=sup')
  284. return {
  285. totalMoney: data.code === 1 ? data.data : 0,
  286. fromUserPage: Boolean(route.query.type),
  287. switchType: route.query.switchType || 'record'
  288. }
  289. },
  290. watch: {
  291. 'vendorAccount': {
  292. handler: function (val) {
  293. if (val && val.content) {
  294. if (this.isChange) {
  295. this.accountList = []
  296. this.isChange = false
  297. }
  298. this.accountList = [...this.accountList, ...val.content]
  299. }
  300. },
  301. immediate: true
  302. },
  303. 'vendorRecord': {
  304. handler: function (val) {
  305. if (val && val.content) {
  306. if (this.isChange) {
  307. this.recordList = []
  308. this.isChange = false
  309. this.totalRecordPrice = 0
  310. }
  311. // this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
  312. this.recordList = [...this.recordList, ...val.content]
  313. }
  314. },
  315. immediate: true
  316. }
  317. },
  318. filters: {
  319. bankStatusFilter: function (status) {
  320. let result = '未知状态'
  321. switch (status) {
  322. case 101 :
  323. result = '待审核'
  324. break
  325. case 104:
  326. result = '使用中'
  327. break
  328. case 103:
  329. result = '未通过'
  330. break
  331. case 105:
  332. result = '已失效'
  333. break
  334. case 112:
  335. result = '已删除'
  336. break
  337. }
  338. return result
  339. },
  340. payTypeFilter: function (type) {
  341. if (type === 'PAIDTOVENDOR') {
  342. return '买家付款'
  343. } else if (type === 'PLATFORMPAIDTOVENDOR') {
  344. return '平台代付'
  345. } else {
  346. return '其他'
  347. }
  348. }
  349. },
  350. computed: {
  351. accountData () {
  352. return this.$store.state.payCenter.data.vendorAccount
  353. },
  354. recordData () {
  355. return this.$store.state.payCenter.data.vendorRecord
  356. },
  357. vendorAccount () {
  358. return this.accountData.data
  359. },
  360. vendorRecord () {
  361. return this.recordData.data.data ? this.recordData.data.data.data : []
  362. },
  363. fetching () {
  364. return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
  365. },
  366. allPage () {
  367. return this.switchType === 'account' ? this.vendorAccount.totalPages : this.vendorRecord.totalPages
  368. },
  369. isEmpty () {
  370. return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
  371. },
  372. currencySymbol () {
  373. return this.recordList[0] ? this.recordList[0].currencyName : 'RMB'
  374. }
  375. },
  376. methods: {
  377. setRemindText: function (str) {
  378. this.remindText = str
  379. this.timeoutCount++
  380. },
  381. reloadList () {
  382. if (this.switchType === 'account') {
  383. this.$store.dispatch('payCenter/loadVendorAccount', {
  384. count: this.count,
  385. page: this.page,
  386. sorting: {num: 'ASC'},
  387. type: 'sup'
  388. })
  389. } else {
  390. this.$store.dispatch('payCenter/loadVendorRecord', {
  391. count: this.count,
  392. page: this.page,
  393. sorting: {'transferTime': 'DESC'},
  394. type: 'sup',
  395. fromDate: this.filterParams.fromDate || null,
  396. toDate: this.filterParams.toDate || null,
  397. keyword: this.filterParams.keyword || null,
  398. remitteeType: this.filterParams.remitteeType || null
  399. })
  400. }
  401. },
  402. initList () {
  403. this.isChange = true
  404. this.page = 1
  405. this.reloadList()
  406. },
  407. onPullUpAction () {
  408. this.page++
  409. this.reloadList()
  410. },
  411. setSwitchType (type) {
  412. this.switchType = type
  413. if (type === 'record') {
  414. this.initFilterParams()
  415. }
  416. this.initList()
  417. },
  418. initFilterParams () {
  419. this.filterParams = {
  420. keyword: '',
  421. fromDate: '',
  422. toDate: '',
  423. currencyName: '',
  424. method: ''
  425. }
  426. },
  427. filterRecord () {
  428. this.isChange = true
  429. this.page = 1
  430. this.reloadList()
  431. },
  432. onSelectAction (selectObj) {
  433. this.setSelect(selectObj.key, selectObj.value)
  434. },
  435. setSelect (type, val) {
  436. if (type === 'date') {
  437. if (val) {
  438. this.filterParams.fromDate = val.fromDate
  439. this.filterParams.toDate = val.toDate
  440. } else {
  441. this.filterParams.fromDate = null
  442. this.filterParams.toDate = null
  443. }
  444. } else {
  445. this.filterParams[type] = val
  446. }
  447. this.filterRecord()
  448. },
  449. setDate (type) {
  450. if (this.dateObj[type]) {
  451. this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
  452. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
  453. if (type === 'fromDate') {
  454. this.setRemindText('起始时间不能大于结束时间')
  455. } else {
  456. this.setRemindText('结束时间不能小于起始时间')
  457. }
  458. this.filterParams[type] = null
  459. this.dateObj[type] = null
  460. } else {
  461. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
  462. // 23:59:59
  463. this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
  464. }
  465. this.filterRecord()
  466. }
  467. } else {
  468. this.filterParams[type] = null
  469. this.filterRecord()
  470. }
  471. },
  472. reuseAccount (account) {
  473. if (account.status !== 105) {
  474. this.setRemindText(`该账户${this.$options.filters.bankStatusFilter(account.status)}`)
  475. } else {
  476. this.currentId = account.id
  477. this.showReuseModal = true
  478. }
  479. },
  480. setDefaultAccount () {
  481. this.$http.get(`/trade/bankInfo/setDefaultAccount/${this.currentId}`).then(() => {
  482. this.setRemindText('重新使用完成')
  483. this.initList()
  484. this.showReuseModal = false
  485. })
  486. },
  487. deleteAccount (account) {
  488. this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
  489. if (res.data === 'success') {
  490. this.setRemindText('删除成功')
  491. this.initList()
  492. }
  493. })
  494. },
  495. initAccount () {
  496. this.bankAccountObj = {
  497. bankname: '',
  498. branchname: '',
  499. number: '',
  500. accountname: ''
  501. }
  502. this.validBankAccountObj = {
  503. bankname: false,
  504. branchname: false,
  505. number: false,
  506. accountname: false
  507. }
  508. this.file = ''
  509. },
  510. openAddAccount () {
  511. if (!this.bankList || !this.bankList.length) {
  512. this.$http.get('/data/bank.json').then(res => {
  513. this.bankList = res.data.list
  514. this.initAccount()
  515. this.showModal = true
  516. })
  517. } else {
  518. this.initAccount()
  519. this.showModal = true
  520. }
  521. },
  522. setBankName (name) {
  523. this.bankAccountObj.bankname = name
  524. this.showSimilar = false
  525. this.validBankAccountObj.bankname = true
  526. },
  527. checkBranchname () {
  528. this.validBankAccountObj.branchname = true
  529. if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
  530. this.setRemindText('开户支行不能为空')
  531. this.validBankAccountObj.branchname = false
  532. } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
  533. this.setRemindText('开户支行不能大于40字符')
  534. this.validBankAccountObj.branchname = false
  535. } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
  536. this.setRemindText('请输入正确的开户支行')
  537. this.validBankAccountObj.branchname = false
  538. }
  539. },
  540. checkNumber () {
  541. this.validBankAccountObj.number = true
  542. if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
  543. this.validBankAccountObj.number = false
  544. this.setRemindText('银行账号不能为空')
  545. } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
  546. this.setRemindText('银行账号不能大于30字符')
  547. this.validBankAccountObj.number = false
  548. } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
  549. this.setRemindText('请输入正确的银行账号')
  550. this.validBankAccountObj.number = false
  551. }
  552. if (this.validBankAccountObj.number) {
  553. this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
  554. if (res.data.success) {
  555. if (res.data.data === 0) {
  556. this.validBankAccountObj.number = true
  557. } else {
  558. this.validBankAccountObj.number = false
  559. this.setRemindText('银行账号校验失败')
  560. }
  561. } else {
  562. this.validBankAccountObj.number = false
  563. this.setRemindText(res.data.message || '银行账号校验失败')
  564. }
  565. }, err => {
  566. this.validBankAccountObj.number = false
  567. this.setRemindText(err.response.data || '银行账号校验失败')
  568. console.log(err)
  569. })
  570. }
  571. },
  572. checkAccountname () {
  573. this.validBankAccountObj.accountname = true
  574. if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
  575. this.validBankAccountObj.accountname = false
  576. this.setRemindText('账户名称不能为空')
  577. } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
  578. this.setRemindText('账户名称不能大于100个字符')
  579. this.validBankAccountObj.accountname = false
  580. }
  581. },
  582. addAccount () {
  583. if (!this.validBankAccountObj.bankname) {
  584. this.setRemindText('请选择开户银行')
  585. } else if (!this.validBankAccountObj.branchname) {
  586. this.setRemindText('请填写正确的开户支行')
  587. } else if (!this.validBankAccountObj.number) {
  588. this.setRemindText('请填写正确的银行账号')
  589. } else if (!this.validBankAccountObj.accountname) {
  590. this.setRemindText('请填写正确的开户名称')
  591. } else if (!this.file) {
  592. this.setRemindText('请上传开户许可证')
  593. } else {
  594. let param = new FormData()
  595. param.append('file', this.file, this.file.name)
  596. param.append('bankInfo', JSON.stringify(this.bankAccountObj))
  597. let config = {
  598. headers: {'Content-Type': 'multipart/form-data'}
  599. }
  600. this.$http.post('/trade/bankInfo/save/enterprise?type=sup', param, config).then(res => {
  601. if (res.data.id) {
  602. this.setRemindText('新增账户成功')
  603. this.initList()
  604. this.showModal = false
  605. } else {
  606. this.setRemindText('新增账户失败')
  607. }
  608. }, err => {
  609. this.setRemindText(err.response.data || '新增账户失败')
  610. console.log(err)
  611. })
  612. }
  613. },
  614. onUpload (e) {
  615. let file = e.target.files[0]
  616. let arr = file.name.split('.')
  617. let type = arr[arr.length - 1]
  618. if ('pdf/png/jpg/jpeg'.indexOf(type.toLowerCase()) === -1) {
  619. this.setRemindText('仅支持jpg/jpeg/png/pdf格式的文件')
  620. } else if (file.size > 1024 * 1024 * 3) {
  621. this.setRemindText('请勿大于3M')
  622. } else {
  623. this.file = file
  624. }
  625. }
  626. }
  627. }
  628. </script>
  629. <style lang="scss">
  630. @import '~assets/scss/mobilePayCenter';
  631. .reuse-account-modal {
  632. .ra-remind {
  633. width: 6.3rem;
  634. height: 3.5rem;
  635. position: absolute;
  636. top: 50%;
  637. left: 50%;
  638. margin-top: -1.75rem;
  639. margin-left: -3.15rem;
  640. border-radius: .15rem;
  641. .header {
  642. height: .6rem;
  643. line-height: .6rem;
  644. background: #3976f4;
  645. border-top-left-radius: .15rem;
  646. border-top-right-radius: .15rem;
  647. i {
  648. font-size: .32rem;
  649. color: #fff;
  650. float: right;
  651. margin-right: .28rem;
  652. }
  653. }
  654. .content {
  655. background: #fff;
  656. padding: .53rem .77rem;
  657. span {
  658. font-size: .32rem;
  659. }
  660. i {
  661. font-size: .44rem;
  662. color: #3976f4;
  663. float: left;
  664. margin-right: .2rem;
  665. }
  666. }
  667. .footer {
  668. background: #fff;
  669. padding-bottom: .37rem;
  670. text-align: center;
  671. border-bottom-left-radius: .15rem;
  672. border-bottom-right-radius: .15rem;
  673. margin-top: -0.05rem;
  674. button {
  675. width: 2.22rem;
  676. height: .77rem;
  677. line-height: .77rem;
  678. color: #fff;
  679. font-size: .32rem;
  680. border-radius: .08rem;
  681. background: #bfbfbf;
  682. &:last-child {
  683. background: $base-color;
  684. margin-left: .3rem;
  685. }
  686. }
  687. }
  688. }
  689. }
  690. .record-list {
  691. margin-bottom: 1.26rem
  692. }
  693. .upload {
  694. input[disabled] {
  695. background: #eee;
  696. width: 2.88rem !important;
  697. }
  698. .upload-btn {
  699. display: inline-block;
  700. vertical-align: middle;
  701. width: 1.2rem;
  702. height: .56rem;
  703. line-height: .56rem;
  704. text-align: center;
  705. color: #fff;
  706. background: #fe9d03;
  707. position: relative;
  708. left: .2rem;
  709. border-radius: .04rem;
  710. font-size: .24rem;
  711. font-weight: normal;
  712. margin: 0;
  713. input {
  714. opacity: 0;
  715. width: 1.2rem;
  716. height: .56rem;
  717. position: absolute;
  718. top: 0;
  719. }
  720. }
  721. }
  722. .fix-count-wrap {
  723. position: fixed;
  724. bottom: .98rem;
  725. height: 1.25rem;
  726. text-align: right;
  727. background: #fff;
  728. border-radius: .02rem;
  729. border-top: 1px solid #bfbfbf;
  730. line-height: .62rem;
  731. font-size: .28rem;
  732. width: 100%;
  733. padding-right: .3rem;
  734. .content {
  735. margin-left: .39rem;
  736. &:first-child {
  737. span {
  738. color: #fd0303;
  739. }
  740. }
  741. &:nth-of-type(2) {
  742. span {
  743. color: #15b262;
  744. }
  745. }
  746. }
  747. }
  748. .mp-list .content-line .icon-tixing {
  749. font-size: .32rem;
  750. color: $base-color;
  751. margin-left: .05rem;
  752. }
  753. .am-remind-text {
  754. font-size: .26rem;
  755. color: #999;
  756. margin-top: .29rem;
  757. padding: .45rem 0;
  758. border-top: 1px solid #d2d2d2;
  759. i {
  760. color: #fd0303;
  761. width: 12%;
  762. }
  763. .fr {
  764. width: 88%;
  765. }
  766. }
  767. .vendor-pay {
  768. padding-bottom: 1rem;
  769. .mobile-modal .mobile-modal-wrapper {
  770. left: .2rem !important;
  771. right: .2rem !important;
  772. }
  773. }
  774. .vendor-pay-record {
  775. /*bottom: 2.23rem !important;*/
  776. padding-bottom: 1.25rem !important;
  777. }
  778. </style>