add.vue 14 KB

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