index.vue 14 KB

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