payCenter.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778
  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;{{totalRecordPrice}}</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;{{totalRecordPrice}} (共计{{recordList.length || 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. export default {
  174. layout: 'mobile',
  175. middleware: 'authenticated',
  176. data () {
  177. return {
  178. fromUserPage: false,
  179. remindText: '',
  180. timeoutCount: '',
  181. page: 1,
  182. count: 10,
  183. accountList: [],
  184. recordList: [],
  185. switchType: 'record',
  186. // 分页重置标志
  187. isChange: false,
  188. showModal: false,
  189. bankList: [],
  190. showSimilar: false,
  191. bankAccountObj: {
  192. bankname: '',
  193. branchname: '',
  194. number: '',
  195. accountname: ''
  196. },
  197. validBankAccountObj: {
  198. bankname: false,
  199. branchname: false,
  200. number: false,
  201. accountname: false
  202. },
  203. filterParams: {
  204. keyword: '',
  205. fromDate: '',
  206. toDate: '',
  207. remitteeType: ''
  208. },
  209. currentId: '',
  210. showReuseModal: false,
  211. totalRecordPrice: 0,
  212. file: '',
  213. dateObj: {
  214. fromDate: '',
  215. toDate: ''
  216. },
  217. filterOptions: [
  218. {
  219. title: '交易方式',
  220. selectOption: 'remitteeType',
  221. selectItems: [{key: '全部',
  222. val: null
  223. }, {
  224. key: '买家付款',
  225. val: 'PAIDTOVENDOR'
  226. }, {
  227. key: '平台代付',
  228. val: 'PAIDTOPLATFORM'
  229. }],
  230. defaultVal: null
  231. },
  232. // {
  233. // title: '交易状态',
  234. // selectOption: 'status',
  235. // selectItems: [{key: '全部',
  236. // val: 0
  237. // }, {
  238. // key: '已收款',
  239. // val: 1
  240. // }, {
  241. // key: '待收款',
  242. // val: 2
  243. // }],
  244. // defaultVal: 0
  245. // },
  246. {
  247. title: '交易时间',
  248. selectOption: 'date',
  249. selectItems: [{key: '全部',
  250. val: null
  251. }, {
  252. key: '一个月',
  253. val: 1
  254. }, {
  255. key: '三个月',
  256. val: 2
  257. }, {
  258. key: '六个月',
  259. val: 3
  260. }, {
  261. key: '自定义',
  262. val: 4
  263. }],
  264. defaultVal: null
  265. }
  266. ]
  267. }
  268. },
  269. components: {
  270. RemindBox,
  271. PullUp,
  272. ModalWrapper,
  273. EmptyStatus,
  274. BaseFilter
  275. },
  276. fetch ({store, route}) {
  277. return route.query.type ? Promise.all([store.dispatch('payCenter/loadVendorAccount', {count: 10, page: 1, sorting: {num: 'ASC'}, type: 'sup'})
  278. ]) : Promise.all([store.dispatch('payCenter/loadVendorRecord', {count: 10, page: 1, sorting: {'transferTime': 'DESC'}, type: 'sup'})])
  279. },
  280. asyncData({route}) {
  281. return {
  282. fromUserPage: route.query.type ? true : false,
  283. switchType: route.query.switchType || 'record'
  284. }
  285. },
  286. watch: {
  287. 'vendorAccount': {
  288. handler: function (val) {
  289. if (val && val.content) {
  290. if (this.isChange) {
  291. this.accountList = []
  292. this.isChange = false
  293. }
  294. this.accountList = [...this.accountList, ...val.content]
  295. }
  296. },
  297. immediate: true
  298. },
  299. 'vendorRecord': {
  300. handler: function (val) {
  301. if (val && val.content) {
  302. if (this.isChange) {
  303. this.recordList = []
  304. this.isChange = false
  305. this.totalRecordPrice = 0
  306. }
  307. this.totalRecordPrice = this.baseUtils.priceFixed(this.totalRecordPrice + this.recordData.data.data.total)
  308. this.recordList = [...this.recordList, ...val.content]
  309. }
  310. },
  311. immediate: true
  312. }
  313. },
  314. filters: {
  315. bankStatusFilter: function (status) {
  316. let result = '未知状态'
  317. switch (status) {
  318. case 101 :
  319. result = '待审核'
  320. break
  321. case 104:
  322. result = '使用中'
  323. break
  324. case 103:
  325. result = '未通过'
  326. break
  327. case 105:
  328. result = '已失效'
  329. break
  330. case 112:
  331. result = '已删除'
  332. break
  333. }
  334. return result
  335. },
  336. payTypeFilter: function (type) {
  337. if (type === 'PAIDTOVENDOR') {
  338. return '买家付款'
  339. } else if (type === 'PAIDTOPLATFORM') {
  340. return '平台代付'
  341. } else {
  342. return '其他'
  343. }
  344. }
  345. },
  346. computed: {
  347. accountData () {
  348. return this.$store.state.payCenter.data.vendorAccount
  349. },
  350. recordData () {
  351. return this.$store.state.payCenter.data.vendorRecord
  352. },
  353. vendorAccount () {
  354. return this.accountData.data
  355. },
  356. vendorRecord () {
  357. return this.recordData.data.data ? this.recordData.data.data.data : []
  358. },
  359. fetching () {
  360. return this.switchType === 'account' ? this.accountData.fetching : this.recordData.fetching
  361. },
  362. allPage () {
  363. return this.switchType === 'account' ? this.vendorAccount.totalPages : this.vendorRecord.totalPages
  364. },
  365. isEmpty () {
  366. return (this.switchType === 'record' && this.recordList.length === 0) || (this.switchType === 'account' && this.accountList.length === 0)
  367. },
  368. currencySymbol () {
  369. return this.recordList[0] ? this.recordList[0].currencyName : 'RMB'
  370. }
  371. },
  372. methods: {
  373. setRemindText: function (str) {
  374. this.remindText = str
  375. this.timeoutCount++
  376. },
  377. reloadList () {
  378. if (this.switchType === 'account') {
  379. this.$store.dispatch('payCenter/loadVendorAccount', {
  380. count: this.count,
  381. page: this.page,
  382. sorting: {num: 'ASC'},
  383. type: 'sup'
  384. })
  385. } else {
  386. this.$store.dispatch('payCenter/loadVendorRecord', {
  387. count: this.count,
  388. page: this.page,
  389. sorting: {'transferTime': 'DESC'},
  390. type: 'sup',
  391. fromDate: this.filterParams.fromDate || null,
  392. toDate: this.filterParams.toDate || null,
  393. keyword: this.filterParams.keyword || null,
  394. remitteeType: this.filterParams.remitteeType || null
  395. })
  396. }
  397. },
  398. initList () {
  399. this.isChange = true
  400. this.page = 1
  401. this.reloadList()
  402. },
  403. onPullUpAction () {
  404. this.page++
  405. this.reloadList()
  406. },
  407. setSwitchType (type) {
  408. this.switchType = type
  409. if (type === 'record') {
  410. this.initFilterParams()
  411. }
  412. this.initList()
  413. },
  414. initFilterParams () {
  415. this.filterParams = {
  416. keyword: '',
  417. fromDate: '',
  418. toDate: '',
  419. currencyName: '',
  420. method: ''
  421. }
  422. },
  423. filterRecord () {
  424. this.isChange = true
  425. this.page = 1
  426. this.reloadList()
  427. },
  428. onSelectAction (selectObj) {
  429. this.setSelect(selectObj.key, selectObj.value)
  430. },
  431. setSelect (type, val) {
  432. if (type === 'date') {
  433. if (val) {
  434. this.filterParams.fromDate = val.fromDate
  435. this.filterParams.toDate = val.toDate
  436. } else {
  437. this.filterParams.fromDate = null
  438. this.filterParams.toDate = null
  439. }
  440. } else {
  441. this.filterParams[type] = val
  442. }
  443. this.filterRecord()
  444. },
  445. setDate (type) {
  446. if (this.dateObj[type]) {
  447. this.filterParams[type] = new Date(this.dateObj[type]).getTime() - 8 * 60 * 60 * 1000
  448. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate > this.filterParams.toDate) {
  449. if (type === 'fromDate') {
  450. this.setRemindText('起始时间不能大于结束时间')
  451. } else {
  452. this.setRemindText('结束时间不能小于起始时间')
  453. }
  454. this.filterParams[type] = null
  455. this.dateObj[type] = null
  456. } else {
  457. if (this.filterParams.fromDate && this.filterParams.toDate && this.filterParams.fromDate === this.filterParams.toDate) {
  458. // 23:59:59
  459. this.filterParams.toDate += 23 * 60 * 60 * 1000 + 59 * 60 * 1000 + 59 * 1000
  460. }
  461. this.filterRecord()
  462. }
  463. } else {
  464. this.filterParams[type] = null
  465. this.filterRecord()
  466. }
  467. },
  468. reuseAccount (account) {
  469. if (account.status !== 105) {
  470. this.setRemindText(`该账户${this.$options.filters.bankStatusFilter(account.status)}`)
  471. } else {
  472. this.currentId = account.id
  473. this.showReuseModal = true
  474. }
  475. },
  476. setDefaultAccount () {
  477. this.$http.get(`/trade/bankInfo/setDefaultAccount/${this.currentId}`).then(() => {
  478. this.setRemindText('重新使用完成')
  479. this.initList()
  480. this.showReuseModal = false
  481. })
  482. },
  483. deleteAccount (account) {
  484. this.$http.delete(`/trade/bankInfo/delete/${account.id}`).then(res => {
  485. if (res.data === 'success') {
  486. this.setRemindText('删除成功')
  487. this.initList()
  488. }
  489. })
  490. },
  491. initAccount () {
  492. this.bankAccountObj = {
  493. bankname: '',
  494. branchname: '',
  495. number: '',
  496. accountname: ''
  497. }
  498. this.validBankAccountObj = {
  499. bankname: false,
  500. branchname: false,
  501. number: false,
  502. accountname: false
  503. }
  504. this.file = ''
  505. },
  506. openAddAccount () {
  507. if (!this.bankList || !this.bankList.length) {
  508. this.$http.get('/data/bank.json').then(res => {
  509. this.bankList = res.data.list
  510. this.initAccount()
  511. this.showModal = true
  512. })
  513. } else {
  514. this.initAccount()
  515. this.showModal = true
  516. }
  517. },
  518. setBankName (name) {
  519. this.bankAccountObj.bankname = name
  520. this.showSimilar = false
  521. this.validBankAccountObj.bankname = true
  522. },
  523. checkBranchname () {
  524. this.validBankAccountObj.branchname = true
  525. if (!(this.bankAccountObj.branchname && this.bankAccountObj.branchname.length)) {
  526. this.setRemindText('开户支行不能为空')
  527. this.validBankAccountObj.branchname = false
  528. } else if (this.baseUtils.getRealLen(this.bankAccountObj.branchname) > 40) {
  529. this.setRemindText('开户支行不能大于40字符')
  530. this.validBankAccountObj.branchname = false
  531. } else if (!/^[\u2E80-\u9FFF]+$/.test(this.bankAccountObj.branchname)) {
  532. this.setRemindText('请输入正确的开户支行')
  533. this.validBankAccountObj.branchname = false
  534. }
  535. },
  536. checkNumber () {
  537. this.validBankAccountObj.number = true
  538. if (!(this.bankAccountObj.number && this.bankAccountObj.number.length)) {
  539. this.validBankAccountObj.number = false
  540. this.setRemindText('银行账号不能为空')
  541. } else if (this.baseUtils.getRealLen(this.bankAccountObj.number) > 30) {
  542. this.setRemindText('银行账号不能大于30字符')
  543. this.validBankAccountObj.number = false
  544. } else if (!/^[0-9]+$/.test(this.bankAccountObj.number)) {
  545. this.setRemindText('请输入正确的银行账号')
  546. this.validBankAccountObj.number = false
  547. }
  548. if (this.validBankAccountObj.number) {
  549. this.$http.get('/trade/bankInfo/number/count', {params: {type: 1061, number: this.bankAccountObj.number}}).then(res => {
  550. if (res.data.success) {
  551. if (res.data.data === 0) {
  552. this.validBankAccountObj.number = true
  553. } else {
  554. this.validBankAccountObj.number = false
  555. this.setRemindText('银行账号校验失败')
  556. }
  557. } else {
  558. this.validBankAccountObj.number = false
  559. this.setRemindText(res.data.message || '银行账号校验失败')
  560. }
  561. }, err => {
  562. this.validBankAccountObj.number = false
  563. this.setRemindText(err.response.data || '银行账号校验失败')
  564. console.log(err)
  565. })
  566. }
  567. },
  568. checkAccountname () {
  569. this.validBankAccountObj.accountname = true
  570. if (!(this.bankAccountObj.accountname && this.bankAccountObj.accountname.length)) {
  571. this.validBankAccountObj.accountname = false
  572. this.setRemindText('账户名称不能为空')
  573. } else if (this.baseUtils.getRealLen(this.bankAccountObj.accountname) > 100) {
  574. this.setRemindText('账户名称不能大于100个字符')
  575. this.validBankAccountObj.accountname = false
  576. }
  577. },
  578. addAccount () {
  579. if (!this.validBankAccountObj.bankname) {
  580. this.setRemindText('请选择开户银行')
  581. } else if (!this.validBankAccountObj.branchname) {
  582. this.setRemindText('请填写正确的开户支行')
  583. } else if (!this.validBankAccountObj.number) {
  584. this.setRemindText('请填写正确的银行账号')
  585. } else if (!this.validBankAccountObj.accountname) {
  586. this.setRemindText('请填写正确的开户名称')
  587. } else if (!this.file) {
  588. this.setRemindText('请上传开户许可证')
  589. } else {
  590. let param = new FormData()
  591. param.append('file', this.file, this.file.name)
  592. param.append('bankInfo', JSON.stringify(this.bankAccountObj))
  593. let config = {
  594. headers: {'Content-Type': 'multipart/form-data'}
  595. }
  596. this.$http.post('/trade/bankInfo/save/enterprise?type=sup', param, config).then(res => {
  597. if (res.data.id) {
  598. this.setRemindText('新增账户成功')
  599. this.initList()
  600. this.showModal = false
  601. } else {
  602. this.setRemindText('新增账户失败')
  603. }
  604. }, err => {
  605. this.setRemindText(err.response.data || '新增账户失败')
  606. console.log(err)
  607. })
  608. }
  609. },
  610. onUpload (e) {
  611. let file = e.target.files[0]
  612. let arr = file.name.split('.')
  613. let type = arr[arr.length - 1]
  614. if ('pdf/png/jpg/jpeg'.indexOf(type.toLowerCase()) === -1) {
  615. this.setRemindText('仅支持jpg/jpeg/png/pdf格式的文件')
  616. } else if (file.size > 1024 * 1024 * 3) {
  617. this.setRemindText('请勿大于3M')
  618. } else {
  619. this.file = file
  620. }
  621. }
  622. }
  623. }
  624. </script>
  625. <style lang="scss">
  626. @import '~assets/scss/mobilePayCenter';
  627. .reuse-account-modal {
  628. .ra-remind {
  629. width: 6.3rem;
  630. height: 3.5rem;
  631. position: absolute;
  632. top: 50%;
  633. left: 50%;
  634. margin-top: -1.75rem;
  635. margin-left: -3.15rem;
  636. border-radius: .15rem;
  637. .header {
  638. height: .6rem;
  639. line-height: .6rem;
  640. background: #3976f4;
  641. border-top-left-radius: .15rem;
  642. border-top-right-radius: .15rem;
  643. i {
  644. font-size: .32rem;
  645. color: #fff;
  646. float: right;
  647. margin-right: .28rem;
  648. }
  649. }
  650. .content {
  651. background: #fff;
  652. padding: .53rem .77rem;
  653. span {
  654. font-size: .32rem;
  655. }
  656. i {
  657. font-size: .44rem;
  658. color: #3976f4;
  659. float: left;
  660. margin-right: .2rem;
  661. }
  662. }
  663. .footer {
  664. background: #fff;
  665. padding-bottom: .37rem;
  666. text-align: center;
  667. border-bottom-left-radius: .15rem;
  668. border-bottom-right-radius: .15rem;
  669. margin-top: -0.05rem;
  670. button {
  671. width: 2.22rem;
  672. height: .77rem;
  673. line-height: .77rem;
  674. color: #fff;
  675. font-size: .32rem;
  676. border-radius: .08rem;
  677. background: #bfbfbf;
  678. &:last-child {
  679. background: $base-color;
  680. margin-left: .3rem;
  681. }
  682. }
  683. }
  684. }
  685. }
  686. .record-list {
  687. margin-bottom: 1.26rem
  688. }
  689. .upload {
  690. input[disabled] {
  691. background: #eee;
  692. width: 2.88rem !important;
  693. }
  694. .upload-btn {
  695. display: inline-block;
  696. vertical-align: middle;
  697. width: 1.2rem;
  698. height: .56rem;
  699. line-height: .56rem;
  700. text-align: center;
  701. color: #fff;
  702. background: #fe9d03;
  703. position: relative;
  704. left: .2rem;
  705. border-radius: .04rem;
  706. font-size: .24rem;
  707. font-weight: normal;
  708. margin: 0;
  709. input {
  710. opacity: 0;
  711. width: 1.2rem;
  712. height: .56rem;
  713. position: absolute;
  714. top: 0;
  715. }
  716. }
  717. }
  718. .fix-count-wrap {
  719. position: fixed;
  720. bottom: .98rem;
  721. height: 1.25rem;
  722. text-align: right;
  723. background: #fff;
  724. border-radius: .02rem;
  725. border-top: 1px solid #bfbfbf;
  726. line-height: .62rem;
  727. font-size: .28rem;
  728. width: 100%;
  729. padding-right: .3rem;
  730. .content {
  731. margin-left: .39rem;
  732. &:first-child {
  733. span {
  734. color: #fd0303;
  735. }
  736. }
  737. &:nth-of-type(2) {
  738. span {
  739. color: #15b262;
  740. }
  741. }
  742. }
  743. }
  744. .mp-list .content-line .icon-tixing {
  745. font-size: .32rem;
  746. color: $base-color;
  747. margin-left: .05rem;
  748. }
  749. .am-remind-text {
  750. font-size: .26rem;
  751. color: #999;
  752. margin-top: .29rem;
  753. padding: .45rem 0;
  754. border-top: 1px solid #d2d2d2;
  755. i {
  756. color: #fd0303;
  757. width: 12%;
  758. }
  759. .fr {
  760. width: 88%;
  761. }
  762. }
  763. .vendor-pay {
  764. padding-bottom: 1rem;
  765. .mobile-modal .mobile-modal-wrapper {
  766. left: .2rem !important;
  767. right: .2rem !important;
  768. }
  769. }
  770. .vendor-pay-record {
  771. /*bottom: 2.23rem !important;*/
  772. padding-bottom: 1.25rem !important;
  773. }
  774. </style>