add.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627
  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. }
  250. },
  251. onLoad(option) {
  252. this.operateParams.id = option.id
  253. let obj = {}
  254. // #ifdef MP-WEIXIN
  255. obj = wx.getMenuButtonBoundingClientRect()
  256. // #endif
  257. // #ifdef MP-BAIDU
  258. obj = swan.getMenuButtonBoundingClientRect()
  259. // #endif
  260. // #ifdef MP-ALIPAY
  261. my.hideAddToDesktopMenu()
  262. // #endif
  263. uni.getSystemInfo({
  264. success: res => {
  265. this.width = obj.left || res.windowWidth
  266. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  267. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  268. this.scrollH = res.windowWidth * 0.6
  269. }
  270. })
  271. },
  272. filters: {
  273. NumFormat: function(text) {
  274. //处理金额
  275. return Number(text).toFixed(2)
  276. }
  277. },
  278. computed: {
  279. ...mapState(['hasLogin', 'userInfo'])
  280. },
  281. methods: {
  282. bindPickerChange(e) {
  283. // 选择类别
  284. this.handleShopInfo = {}
  285. this.categoryTypeText = this.categoryActions[e.target.value].name
  286. this.operateParams.newReceiptType = this.categoryActions[e.target.value].value
  287. console.log('类别', this.categoryTypeText)
  288. console.log('款项类型', this.operateParams.newReceiptType)
  289. },
  290. showTuiDateTime() {
  291. this.$refs.dateTime.show()
  292. },
  293. bindStartDateChange(event) {
  294. //开始时间
  295. console.log('开始时间==>', event.result)
  296. this.operateParams.time = event.result
  297. },
  298. confirmDistinguish() {
  299. if (this.operateParams.newReceiptType === 0) {
  300. this.$util.msg('请选择二级类别', 2000)
  301. return
  302. }
  303. if (this.operateParams.newReceiptType === 1 || this.operateParams.newReceiptType === 3) {
  304. if(this.operateParams.shopId === '' ){
  305. this.$util.msg('请选择供应商', 2000)
  306. return
  307. }
  308. }
  309. if (this.operateParams.newReceiptType === 2) {
  310. if(this.operateParams.shopOrderId == '' ){
  311. this.$util.msg('请选择关联订单', 2000)
  312. return
  313. }
  314. }
  315. this.handReceiptConfirm()
  316. },
  317. handReceiptConfirm() {
  318. //操作款项
  319. this.OrderService.orderReceiptOperate(this.operateParams)
  320. .then(response => {
  321. this.$util.msg(response.msg, 2000, true, 'success')
  322. setTimeout(() => {
  323. uni.navigateBack({
  324. delta: 1
  325. })
  326. }, 2000)
  327. })
  328. .catch(error => {
  329. this.$util.msg(error.msg, 2000)
  330. })
  331. },
  332. handleShowClubpopup(type) {
  333. // 点击操作
  334. this.isClubpopupShow = true
  335. },
  336. handleChoiceaShopData(data){
  337. // 监听获取勾选供应商信息
  338. this.handleShopInfo = data
  339. this.operateParams.shopId = data.shopId
  340. this.operateParams.shopName = data.shopName
  341. console.log('监听获取勾选供应商信息',this.operateParams.shopId)
  342. },
  343. handleChangeOrder(){
  344. //跳转选择订单关联
  345. this.$api.navigateTo('/pages/relation/nonorder/list')
  346. },
  347. handleClick(e) {
  348. // 确认收款
  349. if (e.index == 1) {
  350. this.$api.navigateTo('/pages/collection/detail')
  351. }
  352. this.modal = false
  353. },
  354. hideMobel() {
  355. this.modal = false
  356. },
  357. toNoSms(url) {
  358. this.$api.navigateTo(url)
  359. },
  360. navBack() {
  361. uni.navigateBack({
  362. delta: 1
  363. })
  364. }
  365. },
  366. onPageScroll(e) {
  367. //实时获取到滚动的值
  368. if (e.scrollTop > 30) {
  369. this.isCmcustomClass = 'fiexd'
  370. } else {
  371. this.isCmcustomClass = 'left'
  372. }
  373. },
  374. onShow() {
  375. let pages = getCurrentPages()
  376. let currPage = pages[pages.length-1]
  377. if(currPage.data.select =='select'){
  378. let order = uni.getStorageSync('selectOrder')
  379. console.log('order=======>',order)
  380. this.operateParams.shopOrderId = order.shopOrderId
  381. this.shopOrderTerxt = `${order.shopOrderNo}(${order.shopOrderId})`
  382. }
  383. }
  384. }
  385. </script>
  386. <style lang="scss">
  387. @import '@/uni.scss';
  388. page {
  389. background: #fff;
  390. }
  391. .tui-header-box {
  392. width: 100%;
  393. background: #ffffff;
  394. z-index: 999;
  395. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  396. background-size: cover;
  397. &.fiexd {
  398. position: fixed;
  399. top: 0;
  400. left: 0;
  401. }
  402. }
  403. .header-top {
  404. width: 100%;
  405. font-size: 16px;
  406. font-weight: 500;
  407. height: 32px;
  408. display: flex;
  409. align-items: center;
  410. justify-content: center;
  411. position: relative;
  412. padding: 0 40rpx;
  413. }
  414. .header-sit {
  415. width: 100%;
  416. box-sizing: border-box;
  417. height: 80rpx;
  418. line-height: 80rpx;
  419. box-sizing: border-box;
  420. color: #ffffff;
  421. .header-sit-text {
  422. text-align: left;
  423. font-size: $font-size-40;
  424. font-weight: 600;
  425. font-family: '正楷';
  426. }
  427. .icon-fanhui {
  428. display: block;
  429. width: 80rpx;
  430. height: 80rpx;
  431. float: left;
  432. text-align: center;
  433. line-height: 80rpx;
  434. font-size: 46rpx;
  435. }
  436. }
  437. .mine {
  438. width: 100%;
  439. height: 100%;
  440. position: relative;
  441. }
  442. .distinguish-section {
  443. width: 100%;
  444. position: absolute;
  445. padding: 40rpx 20rpx;
  446. box-sizing: border-box;
  447. }
  448. .distinguish-section-conten {
  449. width: 100%;
  450. height: auto;
  451. position: relative;
  452. background-color: #ffffff;
  453. border-radius: 20rpx;
  454. padding: 20rpx;
  455. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  456. .section-top {
  457. width: 100%;
  458. height: 86rpx;
  459. box-sizing: border-box;
  460. padding-bottom: 20rpx;
  461. .title {
  462. float: left;
  463. width: 66rpx;
  464. line-height: 66rpx;
  465. color: #333333;
  466. text-align: left;
  467. .iconfont {
  468. color: #666666;
  469. font-size: $font-size-40;
  470. }
  471. }
  472. .button {
  473. float: right;
  474. box-sizing: border-box;
  475. padding: 0 24rpx;
  476. height: 100%;
  477. line-height: 66rpx;
  478. background: $btn-confirm;
  479. border-radius: 8rpx;
  480. text-align: center;
  481. color: #ffffff;
  482. }
  483. }
  484. .section-rows {
  485. width: 100%;
  486. height: 80rpx;
  487. box-sizing: border-box;
  488. padding: 0 20rpx;
  489. border-radius: 8rpx;
  490. background: #f8f8f8;
  491. margin-bottom: 20rpx;
  492. line-height: 80rpx;
  493. display: flex;
  494. position: relative;
  495. &.disabled {
  496. background: #e1e1e1;
  497. }
  498. .rows-label {
  499. flex: 3;
  500. .iconfont {
  501. margin-right: 8rpx;
  502. &.icon-yixuanze {
  503. color: $color-system;
  504. }
  505. }
  506. }
  507. .rows-mains {
  508. flex: 7;
  509. .input {
  510. width: 100%;
  511. height: 80rpx;
  512. box-sizing: border-box;
  513. padding-right: 40rpx;
  514. text-align: left;
  515. font-size: $font-size-26;
  516. color: #333333;
  517. }
  518. }
  519. .icon-xiayibu {
  520. display: block;
  521. width: 40rpx;
  522. height: 80rpx;
  523. position: absolute;
  524. right: 0;
  525. text-align: center;
  526. font-size: $font-size-32;
  527. }
  528. }
  529. .section-text {
  530. width: 100%;
  531. height: 66rpx;
  532. line-height: 66rpx;
  533. font-size: $font-size-24;
  534. color: #333333;
  535. }
  536. .section-textarea {
  537. width: 100%;
  538. height: 200rpx;
  539. box-sizing: border-box;
  540. padding: 20rpx;
  541. background: #f7f7f7;
  542. border-radius: 8rpx;
  543. .textarea {
  544. width: 100%;
  545. height: 100%;
  546. }
  547. }
  548. }
  549. .distinguish-button {
  550. width: 100%;
  551. height: 80rpx;
  552. margin-top: 100rpx;
  553. box-sizing: border-box;
  554. padding: 0 50rpx;
  555. display: flex;
  556. .button {
  557. flex: 1;
  558. height: 80rpx;
  559. margin: 0 20rpx;
  560. border-radius: 40rpx;
  561. text-align: center;
  562. color: #ffffff;
  563. line-height: 80rpx;
  564. font-size: $font-size-28;
  565. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  566. &.confirm{
  567. background: $btn-confirm;
  568. }
  569. &.cancel{
  570. background: $btn-cancel;
  571. color: #999999;
  572. }
  573. }
  574. }
  575. .uni-badge--small {
  576. -webkit-transform: scale(0.8);
  577. -ms-transform: scale(0.8);
  578. transform: scale(0.8);
  579. -webkit-transform-origin: center center;
  580. -ms-transform-origin: center center;
  581. transform-origin: center center;
  582. }
  583. .uni-badge {
  584. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  585. -webkit-box-sizing: border-box;
  586. box-sizing: border-box;
  587. font-size: 12px;
  588. line-height: 1;
  589. display: inline-block;
  590. padding: 3px 6px;
  591. color: #333;
  592. border-radius: 100px;
  593. background-color: #f1f1f1;
  594. }
  595. .uni-badge-error {
  596. color: #fff;
  597. background-color: #dd524d;
  598. }
  599. </style>