payCenter.vue 27 KB

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