add.vue 14 KB

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