sms.vue 16 KB

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