nosms.vue 13 KB

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