nosms.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. <template>
  2. <view class="container mine clearfix">
  3. <!-- <cu-custom :navbar-data='nvabarData' @navigateBack="hanldNavigateBack"></cu-custom> -->
  4. <view class="tui-header-box first"
  5. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 10 + 'px' : CustomBar + 30 + 'px' }"
  6. :class="isCmcustomClass">
  7. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 30 + 'px' }"></view>
  8. <view class="header-sit">
  9. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  10. <text class="header-sit-text">无短信收款</text>
  11. </view>
  12. </view>
  13. <view class="tui-header-box"
  14. :style="{ height: CustomBar + 30 + 'px', backgroundImage: 'url(https://static.caimei365.com/app/crm/image/statistic_bg1.png)' }">
  15. </view>
  16. <view class="distinguish-section" :style="{ top: CustomBar + 'px', left: 0 + 'px' }">
  17. <view class="distinguish-section-conten">
  18. <view class="section-top">
  19. <view class="button" @click="toNoSms('/pages/collection/list')"> <text
  20. class="iconfont icon-wodedingdan"></text> 收款列表 </view>
  21. </view>
  22. <view class="section-rows">
  23. <view class="rows-label">款项类型:</view>
  24. <view class="rows-mains">
  25. <picker @change="bindPickerChange(1, $event)" :value="index" :range="paymentActions"
  26. range-key="name">
  27. <input class="input" type="text" disabled="true" v-model="paymentTypeText" value=""
  28. placeholder="请选择款项类型" />
  29. </picker>
  30. </view>
  31. <text class="iconfont icon-xiayibu"></text>
  32. </view>
  33. <view class="section-rows">
  34. <view class="rows-label">收款时间:</view>
  35. <view class="rows-mains">
  36. <input class="input" type="text" v-model="params.time" disabled="true" placeholder="请选择收款时间"
  37. @click="showTuiDateTime" />
  38. </view>
  39. <text class="iconfont icon-xiayibu"></text>
  40. </view>
  41. <view class="section-rows">
  42. <view class="rows-label">收款类型:</view>
  43. <view class="rows-mains">
  44. <picker @change="bindPickerChange(2, $event)" :value="index" :range="banksActions"
  45. range-key="name">
  46. <input class="input" type="text" disabled="true" v-model="banksTypeText"
  47. placeholder="请选择收款类型" />
  48. </picker>
  49. </view>
  50. <text class="iconfont icon-xiayibu"></text>
  51. </view>
  52. <view class="section-rows">
  53. <view class="rows-label">收款金额:</view>
  54. <view class="rows-mains">
  55. <input class="input" v-model="params.amount" @blur="changeNumber($event)" type="number"
  56. placeholder="请输入收款金额" />
  57. </view>
  58. </view>
  59. <view class="section-rows" :class="isCheckedCharge ? '' : 'disabled'">
  60. <view class="rows-label">
  61. <text class="iconfont" :class="isCheckedCharge ? 'icon-yixuanze' : 'icon-weixuanze'"
  62. @click="checkedCharge"></text>
  63. 手续费:
  64. </view>
  65. <view class="rows-mains">
  66. <input class="input" v-model="params.chargeValue" :disabled="!isCheckedCharge" type="text"
  67. placeholder="请输入手续费" />
  68. </view>
  69. </view>
  70. <view class="section-text">收款短信(备注,必填)</view>
  71. <view class="section-textarea">
  72. <textarea class="textarea" :disabled="modal" placeholder="请输入收款备注..." v-model="params.remarks" />
  73. </view>
  74. </view>
  75. <view class="distinguish-button">
  76. <view class="button" @click="confirmDistinguish">收款</view>
  77. </view>
  78. </view>
  79. <!-- 时间组件 -->
  80. <tui-datetime ref="dateTime" :type="7" :startYear="startYear" :endYear="endYear" cancelColor="#555555"
  81. color="#4688fa" @confirm="bindStartDateChange"></tui-datetime>
  82. <!-- 弹窗提示 -->
  83. <tui-modal :show="modal" @click="handleClick" @cancel="hideMobel" :title="contentModalTitle"
  84. :content="contentModalText" :button="modalButton" color="#333" :size="32" shape="circle"
  85. :maskClosable="false">
  86. </tui-modal>
  87. </view>
  88. </template>
  89. <script>
  90. import statistic_bg2 from '@/static/temp/statistic_bg2.png'
  91. import statistic_bg1 from '@/static/temp/statistic_bg1.png'
  92. import wxLogin from '@/services/wxLogin.js'
  93. import {
  94. mapState,
  95. mapMutations
  96. } from 'vuex'
  97. export default {
  98. data() {
  99. return {
  100. nvabarData: {
  101. //顶部自定义导航
  102. showCapsule: 1, // 是否显示左上角图标 1表示显示 0表示不显示,
  103. showSearch: 0,
  104. title: '', // 导航栏 中间的标题
  105. haveBack: false,
  106. home: false,
  107. textLeft: this.$store.state.isIphone,
  108. bgColor: '#D33020',
  109. textColor: '#ffffff'
  110. },
  111. type: 7,
  112. setDateTime: '',
  113. startYear: 1980,
  114. endYear: 2030,
  115. modalButton: [{
  116. text: '取消',
  117. type: 'gray',
  118. plain: true //是否空心
  119. },
  120. {
  121. text: '确认',
  122. customStyle: {
  123. color: '#fff',
  124. bgColor: '#4688fa'
  125. },
  126. plain: false
  127. }
  128. ],
  129. paymentActions: [{
  130. name: '普通款项',
  131. value: 1
  132. },
  133. {
  134. name: '返佣款项',
  135. value: 2
  136. },
  137. {
  138. name: '供应商退款',
  139. value: 3
  140. }
  141. ],
  142. banksActions: [{
  143. name: '建设银行-7297',
  144. value: 1
  145. },
  146. {
  147. name: '广发银行-0115',
  148. value: 2
  149. },
  150. {
  151. name: '中信银行-7172',
  152. value: 3
  153. },
  154. {
  155. name: '中信银行-0897',
  156. value: 4
  157. },
  158. {
  159. name: '中信银行0897-财付通',
  160. value: 5
  161. },
  162. {
  163. name: '中信银行0897-支付宝',
  164. value: 6
  165. },
  166. {
  167. name: '支付宝',
  168. value: 7
  169. },
  170. {
  171. name: '微信支付',
  172. value: 8
  173. },
  174. {
  175. name: '快钱支付',
  176. value: 9
  177. }
  178. ],
  179. paymentTypeText: '普通款项', // 款项类型显示文案
  180. banksTypeText: '建设银行-7297', // 款项类型显示文案
  181. params: {
  182. type: 1,
  183. banksType: 1,
  184. amount: '',
  185. chargeValue: '',
  186. remarks: '',
  187. time: this.$api.getNowFormatDate()
  188. },
  189. infoData: {},
  190. isCmcustomClass: 'left',
  191. statistic_bg: statistic_bg2,
  192. statistic_bg1: statistic_bg1,
  193. CustomBar: this.CustomBar, // 顶部导航栏高度
  194. height: 64, //header高度
  195. top: 0, //标题图标距离顶部距离
  196. scrollH: 0, //滚动总高度
  197. opcity: 1,
  198. isCheckedCharge: false,
  199. contentModalTitle: '',
  200. contentModalText: '', //操作文字提示语句
  201. modal: false,
  202. }
  203. },
  204. onLoad() {
  205. let obj = {}
  206. // #ifdef MP-WEIXIN
  207. obj = wx.getMenuButtonBoundingClientRect()
  208. // #endif
  209. // #ifdef MP-BAIDU
  210. obj = swan.getMenuButtonBoundingClientRect()
  211. // #endif
  212. // #ifdef MP-ALIPAY
  213. my.hideAddToDesktopMenu()
  214. // #endif
  215. uni.getSystemInfo({
  216. success: res => {
  217. this.width = obj.left || res.windowWidth
  218. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  219. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  220. this.scrollH = res.windowWidth * 0.6
  221. }
  222. })
  223. },
  224. filters: {
  225. NumFormat: function(text) {
  226. //处理金额
  227. return Number(text).toFixed(2)
  228. }
  229. },
  230. computed: {
  231. ...mapState(['hasLogin', 'userInfo'])
  232. },
  233. methods: {
  234. bindPickerChange(type, e) {
  235. // 选择选项
  236. switch (type) {
  237. case 1:
  238. this.paymentTypeText = this.paymentActions[e.target.value].name
  239. this.params.type = this.paymentActions[e.target.value].value
  240. console.log('款项类型', this.paymentTypeText)
  241. console.log('款项类型', this.params.type)
  242. break
  243. case 2:
  244. this.banksTypeText = this.banksActions[e.target.value].name
  245. this.params.banksType = this.banksActions[e.target.value].value
  246. console.log('收款类型', this.params.banksType)
  247. break
  248. }
  249. },
  250. showTuiDateTime() {
  251. this.$refs.dateTime.show()
  252. },
  253. bindStartDateChange(event) {
  254. //开始时间
  255. console.log('开始时间==>', event.result)
  256. this.params.time = event.result
  257. },
  258. confirmDistinguish() {
  259. if (this.params.amount == '') {
  260. this.$util.msg('请输入收款金额', 2000)
  261. return
  262. }
  263. if (this.isCheckedCharge) {
  264. if (this.params.chargeValue == '') {
  265. this.$util.msg('请输入手续费', 2000)
  266. return
  267. }
  268. }
  269. if (this.params.remarks == '') {
  270. this.$util.msg('请填写收款备注', 2000)
  271. return
  272. }
  273. if (this.params.type == 1) {
  274. this.contentModalTitle = '确定收款吗?'
  275. this.contentModalText = '确认前请仔细检查各项数据是否正确,确认收款后将不能进行修改。' //操作文字提示语句
  276. } else if (this.params.type == 2) {
  277. this.contentModalTitle = ''
  278. this.contentModalText = '确定返佣收款吗?' //操作文字提示语句
  279. } else if (this.params.type == 3) {
  280. this.contentModalTitle = ''
  281. this.contentModalText = '确定供应商退款吗?' //操作文字提示语句
  282. }
  283. this.modal = true
  284. console.log('收款')
  285. },
  286. handleClick(e) {
  287. // 确认收款
  288. if (e.index == 1) {
  289. this.$api.navigateTo('/pages/collection/detail')
  290. }
  291. this.modal = false
  292. },
  293. hideMobel() {
  294. this.modal = false
  295. },
  296. checkedCharge() {
  297. // 勾选手续费
  298. this.isCheckedCharge = !this.isCheckedCharge
  299. },
  300. changeNumber(e) {
  301. // 校验输入为数字
  302. if (!this.$api.isNumber(e.detail.value)) {
  303. this.params.amount = ''
  304. } else {
  305. this.params.amount = e.detail.value
  306. }
  307. },
  308. toNoSms(url){
  309. this.$api.navigateTo(url)
  310. },
  311. navBack() {
  312. uni.navigateBack({
  313. delta: 1
  314. })
  315. }
  316. },
  317. onPageScroll(e) {
  318. //实时获取到滚动的值
  319. if (e.scrollTop > 30) {
  320. this.isCmcustomClass = 'fiexd'
  321. } else {
  322. this.isCmcustomClass = 'left'
  323. }
  324. },
  325. onPullDownRefresh() {
  326. setTimeout(() => {
  327. // this.initSsoMemberCollectionList()
  328. uni.stopPullDownRefresh()
  329. }, 200)
  330. },
  331. onShow() {
  332. if (this.hasLogin) {
  333. this.GetDataInfo()
  334. }
  335. }
  336. }
  337. </script>
  338. <style lang="scss">
  339. @import '@/uni.scss';
  340. page {
  341. background: #fff;
  342. }
  343. .tui-header-box {
  344. width: 100%;
  345. background: #ffffff;
  346. z-index: 999;
  347. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  348. background-size: cover;
  349. &.fiexd {
  350. position: fixed;
  351. top: 0;
  352. left: 0;
  353. }
  354. }
  355. .header-top {
  356. width: 100%;
  357. font-size: 16px;
  358. font-weight: 500;
  359. height: 32px;
  360. display: flex;
  361. align-items: center;
  362. justify-content: center;
  363. position: relative;
  364. padding: 0 40rpx;
  365. }
  366. .header-sit {
  367. width: 100%;
  368. box-sizing: border-box;
  369. height: 80rpx;
  370. line-height: 80rpx;
  371. box-sizing: border-box;
  372. color: #ffffff;
  373. .header-sit-text {
  374. text-align: left;
  375. font-size: $font-size-40;
  376. font-weight: 600;
  377. font-family: '正楷';
  378. }
  379. .icon-fanhui {
  380. display: block;
  381. width: 80rpx;
  382. height: 80rpx;
  383. float: left;
  384. text-align: center;
  385. line-height: 80rpx;
  386. font-size: 42rpx;
  387. }
  388. }
  389. .mine {
  390. width: 100%;
  391. height: 100%;
  392. position: relative;
  393. }
  394. .distinguish-section {
  395. width: 100%;
  396. position: absolute;
  397. padding: 40rpx 20rpx;
  398. box-sizing: border-box;
  399. }
  400. .distinguish-section-conten {
  401. width: 100%;
  402. height: auto;
  403. position: relative;
  404. background-color: #ffffff;
  405. border-radius: 20rpx;
  406. padding: 20rpx;
  407. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  408. .section-top {
  409. width: 100%;
  410. height: 86rpx;
  411. box-sizing: border-box;
  412. padding-bottom: 20rpx;
  413. .title {
  414. float: left;
  415. width: 66rpx;
  416. line-height: 66rpx;
  417. color: #333333;
  418. text-align: left;
  419. .iconfont {
  420. color: #666666;
  421. font-size: $font-size-40;
  422. }
  423. }
  424. .button {
  425. float: right;
  426. box-sizing: border-box;
  427. padding: 0 24rpx;
  428. height: 100%;
  429. line-height: 66rpx;
  430. background: $btn-confirm;
  431. border-radius: 8rpx;
  432. text-align: center;
  433. color: #ffffff;
  434. }
  435. }
  436. .section-rows {
  437. width: 100%;
  438. height: 80rpx;
  439. box-sizing: border-box;
  440. padding: 0 20rpx;
  441. border-radius: 8rpx;
  442. background: #f8f8f8;
  443. margin-bottom: 20rpx;
  444. line-height: 80rpx;
  445. display: flex;
  446. position: relative;
  447. &.disabled {
  448. background: #e1e1e1;
  449. }
  450. .rows-label {
  451. flex: 3;
  452. .iconfont {
  453. margin-right: 8rpx;
  454. &.icon-yixuanze {
  455. color: $color-system;
  456. }
  457. }
  458. }
  459. .rows-mains {
  460. flex: 7;
  461. .input {
  462. width: 100%;
  463. height: 80rpx;
  464. box-sizing: border-box;
  465. padding-right: 40rpx;
  466. text-align: left;
  467. font-size: $font-size-28;
  468. color: #333333;
  469. }
  470. }
  471. .icon-xiayibu {
  472. display: block;
  473. width: 40rpx;
  474. height: 80rpx;
  475. position: absolute;
  476. right: 0;
  477. text-align: center;
  478. font-size: $font-size-32;
  479. }
  480. }
  481. .section-text {
  482. width: 100%;
  483. height: 66rpx;
  484. line-height: 66rpx;
  485. font-size: $font-size-24;
  486. color: #333333;
  487. }
  488. .section-textarea {
  489. width: 100%;
  490. height: 200rpx;
  491. box-sizing: border-box;
  492. padding: 20rpx;
  493. background: #f7f7f7;
  494. border-radius: 8rpx;
  495. .textarea {
  496. width: 100%;
  497. height: 100%;
  498. }
  499. }
  500. }
  501. .distinguish-button {
  502. width: 100%;
  503. height: 80rpx;
  504. margin-top: 100rpx;
  505. box-sizing: border-box;
  506. padding: 0 50rpx;
  507. .button {
  508. width: 100%;
  509. height: 80rpx;
  510. background: $btn-confirm;
  511. border-radius: 40rpx;
  512. text-align: center;
  513. color: #ffffff;
  514. line-height: 80rpx;
  515. font-size: $font-size-28;
  516. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  517. }
  518. }
  519. .uni-badge--small {
  520. -webkit-transform: scale(0.8);
  521. -ms-transform: scale(0.8);
  522. transform: scale(0.8);
  523. -webkit-transform-origin: center center;
  524. -ms-transform-origin: center center;
  525. transform-origin: center center;
  526. }
  527. .uni-badge {
  528. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  529. -webkit-box-sizing: border-box;
  530. box-sizing: border-box;
  531. font-size: 12px;
  532. line-height: 1;
  533. display: inline-block;
  534. padding: 3px 6px;
  535. color: #333;
  536. border-radius: 100px;
  537. background-color: #f1f1f1;
  538. }
  539. .uni-badge-error {
  540. color: #fff;
  541. background-color: #dd524d;
  542. }
  543. </style>