add.vue 14 KB

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