nosms.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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. }
  333. }
  334. </script>
  335. <style lang="scss">
  336. @import '@/uni.scss';
  337. page {
  338. background: #fff;
  339. }
  340. .tui-header-box {
  341. width: 100%;
  342. background: #ffffff;
  343. z-index: 999;
  344. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  345. background-size: cover;
  346. &.fiexd {
  347. position: fixed;
  348. top: 0;
  349. left: 0;
  350. }
  351. }
  352. .header-top {
  353. width: 100%;
  354. font-size: 16px;
  355. font-weight: 500;
  356. height: 32px;
  357. display: flex;
  358. align-items: center;
  359. justify-content: center;
  360. position: relative;
  361. padding: 0 40rpx;
  362. }
  363. .header-sit {
  364. width: 100%;
  365. box-sizing: border-box;
  366. height: 80rpx;
  367. line-height: 80rpx;
  368. box-sizing: border-box;
  369. color: #ffffff;
  370. .header-sit-text {
  371. text-align: left;
  372. font-size: $font-size-40;
  373. font-weight: 600;
  374. font-family: '正楷';
  375. }
  376. .icon-fanhui {
  377. display: block;
  378. width: 80rpx;
  379. height: 80rpx;
  380. float: left;
  381. text-align: center;
  382. line-height: 80rpx;
  383. font-size: 42rpx;
  384. }
  385. }
  386. .mine {
  387. width: 100%;
  388. height: 100%;
  389. position: relative;
  390. }
  391. .distinguish-section {
  392. width: 100%;
  393. position: absolute;
  394. padding: 40rpx 20rpx;
  395. box-sizing: border-box;
  396. }
  397. .distinguish-section-conten {
  398. width: 100%;
  399. height: auto;
  400. position: relative;
  401. background-color: #ffffff;
  402. border-radius: 20rpx;
  403. padding: 20rpx;
  404. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  405. .section-top {
  406. width: 100%;
  407. height: 86rpx;
  408. box-sizing: border-box;
  409. padding-bottom: 20rpx;
  410. .title {
  411. float: left;
  412. width: 66rpx;
  413. line-height: 66rpx;
  414. color: #333333;
  415. text-align: left;
  416. .iconfont {
  417. color: #666666;
  418. font-size: $font-size-40;
  419. }
  420. }
  421. .button {
  422. float: right;
  423. box-sizing: border-box;
  424. padding: 0 24rpx;
  425. height: 100%;
  426. line-height: 66rpx;
  427. background: $btn-confirm;
  428. border-radius: 8rpx;
  429. text-align: center;
  430. color: #ffffff;
  431. }
  432. }
  433. .section-rows {
  434. width: 100%;
  435. height: 80rpx;
  436. box-sizing: border-box;
  437. padding: 0 20rpx;
  438. border-radius: 8rpx;
  439. background: #f8f8f8;
  440. margin-bottom: 20rpx;
  441. line-height: 80rpx;
  442. display: flex;
  443. position: relative;
  444. &.disabled {
  445. background: #e1e1e1;
  446. }
  447. .rows-label {
  448. flex: 3;
  449. .iconfont {
  450. margin-right: 8rpx;
  451. &.icon-yixuanze {
  452. color: $color-system;
  453. }
  454. }
  455. }
  456. .rows-mains {
  457. flex: 7;
  458. .input {
  459. width: 100%;
  460. height: 80rpx;
  461. box-sizing: border-box;
  462. padding-right: 40rpx;
  463. text-align: left;
  464. font-size: $font-size-28;
  465. color: #333333;
  466. }
  467. }
  468. .icon-xiayibu {
  469. display: block;
  470. width: 40rpx;
  471. height: 80rpx;
  472. position: absolute;
  473. right: 0;
  474. text-align: center;
  475. font-size: $font-size-32;
  476. }
  477. }
  478. .section-text {
  479. width: 100%;
  480. height: 66rpx;
  481. line-height: 66rpx;
  482. font-size: $font-size-24;
  483. color: #333333;
  484. }
  485. .section-textarea {
  486. width: 100%;
  487. height: 200rpx;
  488. box-sizing: border-box;
  489. padding: 20rpx;
  490. background: #f7f7f7;
  491. border-radius: 8rpx;
  492. .textarea {
  493. width: 100%;
  494. height: 100%;
  495. }
  496. }
  497. }
  498. .distinguish-button {
  499. width: 100%;
  500. height: 80rpx;
  501. margin-top: 100rpx;
  502. box-sizing: border-box;
  503. padding: 0 50rpx;
  504. .button {
  505. width: 100%;
  506. height: 80rpx;
  507. background: $btn-confirm;
  508. border-radius: 40rpx;
  509. text-align: center;
  510. color: #ffffff;
  511. line-height: 80rpx;
  512. font-size: $font-size-28;
  513. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  514. }
  515. }
  516. .uni-badge--small {
  517. -webkit-transform: scale(0.8);
  518. -ms-transform: scale(0.8);
  519. transform: scale(0.8);
  520. -webkit-transform-origin: center center;
  521. -ms-transform-origin: center center;
  522. transform-origin: center center;
  523. }
  524. .uni-badge {
  525. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  526. -webkit-box-sizing: border-box;
  527. box-sizing: border-box;
  528. font-size: 12px;
  529. line-height: 1;
  530. display: inline-block;
  531. padding: 3px 6px;
  532. color: #333;
  533. border-radius: 100px;
  534. background-color: #f1f1f1;
  535. }
  536. .uni-badge-error {
  537. color: #fff;
  538. background-color: #dd524d;
  539. }
  540. </style>