list.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302
  1. <template>
  2. <view class="container mine clearfix">
  3. <view class="tui-header-box first" :style="{ height: CustomBar + 6 + 'px' }">
  4. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 20 + 'px' }"></view>
  5. <view class="header-sit">
  6. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  7. <text class="header-sit-text">收款列表</text>
  8. <text class="iconfont icon-iconfonticonfontsousuo1" @click.stop="rDrawer"></text>
  9. </view>
  10. </view>
  11. <view class="tui-header-tabs day clearfix" :style="{ top: CustomBar + 6 + 'px' }">
  12. <view class="main one">
  13. <view
  14. class="main-item one"
  15. v-for="(item, index) in listTabs"
  16. :key="index"
  17. :class="{ active: currents == index }"
  18. @click="tabClick(1, index, item.type)"
  19. >
  20. <view class="text">{{ item.name }}</view>
  21. </view>
  22. </view>
  23. <view class="main day" v-if="currents == 0">
  24. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  25. <view
  26. class="main-item tab"
  27. v-for="(item, index) in listTabsType"
  28. :key="index"
  29. :class="{ tabActive: tabCurrents == index }"
  30. @click="tabClick(2, index, item.type)"
  31. >
  32. <view class="text">{{ item.name }}</view>
  33. </view>
  34. </scroll-view>
  35. </view>
  36. <view class="main day" v-if="currents == 1">
  37. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  38. <view
  39. class="main-item tab small"
  40. v-for="(item, index) in listNoTbasType"
  41. :key="index"
  42. :class="{ tabActive: tabCurrents == index }"
  43. @click="tabClick(3, index, item.type)"
  44. >
  45. <view class="text">{{ item.name }}</view>
  46. </view>
  47. </scroll-view>
  48. </view>
  49. <view class="main day" v-if="currents == 2 || currents == 3">
  50. <scroll-view class="scroll-view_H" scroll-x="true" scroll-left="120">
  51. <view
  52. class="main-item tab"
  53. v-for="(item, index) in listReturnType"
  54. :key="index"
  55. :class="{ tabActive: tabCurrents == index }"
  56. @click="tabClick(2, index, item.type)"
  57. >
  58. <view class="text">{{ item.name }}</view>
  59. </view>
  60. </scroll-view>
  61. </view>
  62. </view>
  63. <tui-skeleton
  64. v-if="skeletonShow"
  65. backgroundColor="#fafafa"
  66. borderRadius="10rpx"
  67. :isLoading="true"
  68. :loadingType="7"
  69. />
  70. <view
  71. class="user-section"
  72. v-else
  73. :style="{
  74. top: CustomBar + 105 + 'px',
  75. left: 0 + 'px'
  76. }"
  77. >
  78. <view class="header-content">
  79. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  80. <!-- 空白页 -->
  81. <empty v-if="isEmpty" :typeIndex="currents" :navbarHeight="navbarHeight"></empty>
  82. <!-- 列表 -->
  83. <view v-else class="tui-order-content">
  84. <view class="tui-order-item" v-for="(receipt, payIndex) in payList" :key="payIndex">
  85. <view class="list-title" @click.stop="receiptDetail(receipt)">
  86. <view class="list-title-t">
  87. <view class="list-title-tip">
  88. <text class="badges">{{ receipt.receiptType | formatReceiptType }}</text>
  89. <text class="badges">{{ receipt.organizeId | organizeName }}</text>
  90. <text class="badgesb" v-if="receipt.secondHandOrderFlag == 1">二手</text>
  91. <text class="badgesa" v-if="receipt.receiptType == 2 && receipt.newReceiptType">
  92. {{ receipt.newReceiptType | formatNewReceiptType }}
  93. </text>
  94. </view>
  95. <view
  96. class="list-title-num"
  97. :style="{ color: formatColor(receipt.receiptStatus) }"
  98. >{{ receipt.receiptStatusText }}</view
  99. >
  100. </view>
  101. <view class="list-title-b">
  102. 收款金额:<text class="text">¥{{ receipt.receiptAmount | NumFormat }}</text>
  103. </view>
  104. <view class="list-title-b" v-if="receipt.associateAmount">
  105. 关联金额:<text class="text">¥{{ receipt.associateAmount | NumFormat }}</text>
  106. </view>
  107. <view class="list-title-b">
  108. 收款账号:<text class="text">{{ receipt.payTypeText }}</text>
  109. </view>
  110. <view class="list-title-b">
  111. 收款时间:<text class="text">{{ receipt.receiptDate }}</text>
  112. </view>
  113. <view class="list-title-b" v-if="receipt.reviewDate">
  114. 审核时间:<text class="text">{{ receipt.reviewDate }}</text>
  115. </view>
  116. <view class="list-title-b" v-if="userName">
  117. 客户名称:<text class="text">{{ receipt.userName }}</text>
  118. </view>
  119. <template v-if="receipt.smsContent">
  120. <view class="list-title-b">收款短信:</view>
  121. <view class="list-title-b sms">
  122. <text class="text">{{ receipt.smsContent }}</text>
  123. </view>
  124. </template>
  125. </view>
  126. <button
  127. class="list-shaore"
  128. open-type="share"
  129. :data-receipt="receipt"
  130. v-if="USER_TYPE != 1 && receipt.receiptType != 3"
  131. >
  132. <text class="iconfont icon-fenxiang"></text>
  133. </button>
  134. <!-- 底部button -->
  135. <list-button
  136. ref="listButton"
  137. :status="receipt.receiptStatus"
  138. :dataInfo="receipt"
  139. v-if="handlebBtnVisible"
  140. @buttonConfirm="handButtonConfirm"
  141. >
  142. </list-button>
  143. </view>
  144. <!--加载loadding-->
  145. <tui-loadmore :visible="loadding" :index="3" type="black" />
  146. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text="nomoreText" />
  147. <!--加载loadding-->
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. <!-- 口头返佣按钮 -->
  153. <!-- <view
  154. class="tui-icon-button"
  155. v-if="currents == 2 && returnBtnVisible"
  156. @click="toNoSms('/pages/relation/return/list')"
  157. >
  158. <text class="iconfont icon-jiahao"></text>
  159. </view> -->
  160. <!-- 平台服务费按钮 -->
  161. <view
  162. class="tui-icon-button service"
  163. v-if="operateParams.receiptType === 10 && serviceBtnVisible"
  164. @click="toNoSms('/pages/relation/service/list')"
  165. >
  166. <text class="iconfont icon-jiahao"></text>
  167. </view>
  168. <!--右抽屉-->
  169. <tui-drawer mode="right" :visible="rightDrawer" @close="closeDrawer">
  170. <view class="d-container clearfix" :style="{ paddingTop: CustomBar + 10 + 'px' }">
  171. <view class="drawer-main">
  172. <view class="drawer-main-name">日期</view>
  173. <view class="drawer-main-time">
  174. <view class="drawer-main-time-input">
  175. <picker
  176. mode="date"
  177. :value="date"
  178. :start="startDate"
  179. :end="endDate"
  180. @change="bindStartDateChange"
  181. >
  182. <text class="input-text">{{ listQuery.startDate }}</text>
  183. </picker>
  184. <text class="iconfont icon-riqi"></text>
  185. </view>
  186. <view class="line">-</view>
  187. <view class="drawer-main-time-input">
  188. <picker
  189. mode="date"
  190. :value="date"
  191. :start="startDate"
  192. :end="endDate"
  193. @change="bindEndDateChange"
  194. >
  195. <text class="input-text">{{ listQuery.endDate }}</text>
  196. </picker>
  197. <text class="iconfont icon-riqi"></text>
  198. </view>
  199. </view>
  200. <view class="drawer-main-name">收款短信(全匹配)</view>
  201. <view class="drawer-main-textarea">
  202. <textarea class="textarea" placeholder="收款短信内容..." v-model="listQuery.smsContent" />
  203. </view>
  204. </view>
  205. <view class="drawer-input btn" :style="{ paddingBottom: isIphoneX ? '68rpx' : '34rpx' }">
  206. <view class="drawer-btn clear" @click="closeDrawer">取消</view>
  207. <view class="drawer-btn comfrim" @click="handSearchConfirm">确定</view>
  208. </view>
  209. </view>
  210. </tui-drawer>
  211. <!-- 弹窗 -->
  212. <tui-modal
  213. :show="modal"
  214. @click="handleClick"
  215. @cancel="hideMobel"
  216. :content="contentModalText"
  217. color="#333"
  218. :size="32"
  219. shape="circle"
  220. :maskClosable="false"
  221. />
  222. <!--设非订单款项弹窗 -->
  223. <tui-modal :show="modal1" :padding="'40rpx 30rpx'" @cancel="hideMobel1" :custom="true" fadeIn>
  224. <view class="tui-modal-custom">
  225. <view class="tui-prompt-title">非订单款项</view>
  226. <view class="tui-prompt-textarea">
  227. <textarea
  228. :class="modal1 ? 'show' : 'none'"
  229. class="textarea"
  230. placeholder="请填写说明(必填)"
  231. v-model="noOrderReason"
  232. />
  233. </view>
  234. <view class="tui-prompt-flex">
  235. <view class="btn btn-cancel" @click="hideMobel1">取消</view>
  236. <view class="btn btn-confirm" @click="handleClick1">确定</view>
  237. </view>
  238. </view>
  239. </tui-modal>
  240. </view>
  241. </template>
  242. <script>
  243. import authorize from '@/common/config/authorize.js'
  244. import headerBack from '@/components/cm-module/headerNavbar/header-back' //自定义导航
  245. import listButton from '@/components/cm-module/orderDetails/list-button' //按钮
  246. import modalLayer from '@/components/modal-layer'
  247. import empty from '@/components/empty'
  248. import { listTabsType, listReturnType, listNoTbasType } from '@/utils/config.tabs.js'
  249. import { mapState, mapMutations } from 'vuex'
  250. const defaultListQuery = {
  251. endDate: '', //筛选结束时间
  252. pageNum: 1, //页码
  253. pageSize: 10, //每页数量
  254. receiptStatus: 0, //收款状态:0全部 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  255. receiptType: 1, //收款款项类型:1订单款,2非订单款,3返佣款 , 5供应商退款
  256. smsContent: '', //收款短信
  257. startDate: '' //筛选开始时间
  258. }
  259. export default {
  260. components: {
  261. listButton,
  262. empty
  263. },
  264. data() {
  265. const currentDate = this.getDate({
  266. format: true
  267. })
  268. return {
  269. CustomBar: this.CustomBar, // 顶部导航栏高度
  270. isIphoneX: this.$store.state.isIphoneX,
  271. skeletonShow: true,
  272. listTabs: [], // 收款款项类型
  273. listTabsType: listTabsType, //收款状态:
  274. listReturnType: listReturnType, //收款状态:
  275. listNoTbasType: listNoTbasType, //非订单筛选类别:
  276. date: currentDate,
  277. currents: 0,
  278. tabCurrents: 0,
  279. listQuery: Object.assign({}, defaultListQuery),
  280. operateParams: {
  281. id: 0,
  282. receiptType: 0,
  283. delFlag: 0
  284. },
  285. payList: [],
  286. noOrderReason: '', //设置费订单款备注
  287. scrollTop: 0,
  288. isEmpty: false,
  289. loadding: false,
  290. pullUpOn: true,
  291. hasNextPage: false,
  292. pullFlag: true,
  293. navbarHeight: '',
  294. nomoreText: '上拉显示更多',
  295. contentModalText: '', //操作文字提示语句
  296. modal: false,
  297. modal1: false,
  298. rightDrawer: false,
  299. hanldReceipt: {}, //储存监听收款信息
  300. handleOperId: 0, //操作类型
  301. height: 64, //header高度
  302. top: 0, //标题图标距离顶部距离
  303. scrollH: 0, //滚动总高度
  304. opcity: 1
  305. }
  306. },
  307. onLoad() {
  308. let obj = {}
  309. uni.getSystemInfo({
  310. success: res => {
  311. this.width = obj.left || res.windowWidth
  312. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  313. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  314. this.scrollH = res.windowWidth * 0.6
  315. }
  316. })
  317. },
  318. computed: {
  319. ...mapState(['USER_TYPE', 'handlebBtnVisible', 'returnBtnVisible', 'serviceBtnVisible', 'handleListTabs']),
  320. startDate() {
  321. return this.getDate('start')
  322. },
  323. endDate() {
  324. return this.getDate('end')
  325. }
  326. },
  327. methods: {
  328. ...mapMutations(['login', 'logout']),
  329. async getWxAuthorize() {
  330. // 初始化授权登录设置菜单权限
  331. try {
  332. const wXCode = await authorize.getCode('weixin')
  333. const wEchat = await authorize.getUserInfo('weixin')
  334. const param = { code: wXCode, encryptedData: wEchat.encryptedData, iv: wEchat.iv }
  335. const res = await this.UserService.UserLoginAuthApplets(param)
  336. const data = res.data
  337. this.login(data)
  338. this.$store.commit('updateStatus', data)
  339. this.listTabs = this.handleListTabs
  340. console.log('listTabs', this.listTabs)
  341. this.getOrderDatainit()
  342. } catch (error) {
  343. this.logout()
  344. this.$store.commit('updateStatus', error.data)
  345. }
  346. },
  347. // 获取收款列表数据
  348. async getOrderDatainit() {
  349. try {
  350. this.initListQuery()
  351. const res = await this.OrderService.orderReceiptList(this.listQuery)
  352. const data = res.data
  353. if (data.list && data.list.length > 0) {
  354. this.isEmpty = false
  355. this.hasNextPage = data.hasNextPage
  356. this.payList = data.list
  357. this.pullFlag = false
  358. setTimeout(() => {
  359. this.pullFlag = true
  360. }, 500)
  361. if (this.hasNextPage) {
  362. this.pullUpOn = false
  363. this.nomoreText = '上拉显示更多'
  364. } else {
  365. if (this.payList.length < 4) {
  366. this.pullUpOn = true
  367. this.loadding = false
  368. } else {
  369. this.pullUpOn = false
  370. this.loadding = false
  371. this.nomoreText = '已至底部'
  372. }
  373. }
  374. } else {
  375. this.isEmpty = true
  376. }
  377. this.skeletonShow = false
  378. } catch (error) {
  379. console.log('error', error)
  380. }
  381. },
  382. // 上拉加载分页数据
  383. async getOnReachBottomData() {
  384. try {
  385. this.listQuery.pageNum += 1
  386. const res = await this.OrderService.orderReceiptList(this.listQuery)
  387. const data = res.data
  388. if (data.list && data.list.length > 0) {
  389. this.hasNextPage = data.hasNextPage
  390. this.payList = this.payList.concat(data.list)
  391. this.pullFlag = false // 防上拉暴滑
  392. setTimeout(() => {
  393. this.pullFlag = true
  394. }, 500)
  395. if (this.hasNextPage) {
  396. this.pullUpOn = false
  397. this.nomoreText = '上拉显示更多'
  398. } else {
  399. this.pullUpOn = false
  400. this.loadding = false
  401. this.nomoreText = '已至底部'
  402. }
  403. }
  404. } catch (error) {
  405. console.log('error', error)
  406. }
  407. },
  408. // 跳转
  409. receiptDetail(receipt) {
  410. switch (receipt.receiptType) {
  411. case 1: // 1:订单 1待确认、2已确认(待审核)、3审核通过、4审核未通过、5收款撤销【线上支付成功为审核通过】
  412. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  413. // 订单待确认
  414. this.$api.navigateTo(`/pages/relation/ordinary/index?id=${receipt.id}`)
  415. } else if (receipt.receiptStatus == 2) {
  416. // 待审核
  417. this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${receipt.id}`)
  418. } else if (receipt.receiptStatus == 3) {
  419. // 审核通过
  420. this.$api.navigateTo(`/pages/relation/ordinary/detail?id=${receipt.id}`)
  421. }
  422. break
  423. case 2: // 2:非订单
  424. this.$api.navigateTo(`/pages/relation/nonorder/detail?id=${receipt.id}`)
  425. break
  426. case 3: // 3:返佣
  427. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  428. // 返佣待确认
  429. this.$api.navigateTo(`/pages/relation/return/index?id=${receipt.id}`)
  430. } else if (receipt.receiptStatus == 2) {
  431. this.$api.navigateTo(`/pages/relation/return/detail?id=${receipt.id}`)
  432. }
  433. break
  434. case 10: // 10:平台服务费
  435. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  436. // 平台服务费待确认
  437. this.$api.navigateTo(`/pages/relation/service/index?id=${receipt.id}`)
  438. } else if (receipt.receiptStatus == 2 || receipt.receiptStatus == 3) {
  439. console.log('111111111111')
  440. this.$api.navigateTo(`/pages/relation/service/detail?id=${receipt.id}`)
  441. }
  442. break
  443. case 11: // 11:平台服务费欠款
  444. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  445. // 平台服务费待确认
  446. this.$api.navigateTo(`/pages/relation/service/index?id=${receipt.id}`)
  447. } else if (receipt.receiptStatus == 2 || receipt.receiptStatus == 3) {
  448. this.$api.navigateTo(`/pages/relation/service/detail?id=${receipt.id}`)
  449. }
  450. break
  451. case 5: // 4:供应商退款
  452. if (receipt.receiptStatus == 1 || receipt.receiptStatus == 4 || receipt.receiptStatus == 5) {
  453. // 返佣待确认
  454. this.$api.navigateTo(`/pages/relation/refund/index?id=${receipt.id}`)
  455. } else if (receipt.receiptStatus == 2) {
  456. this.$api.navigateTo(`/pages/relation/refund/detail?id=${receipt.id}`)
  457. }
  458. break
  459. }
  460. },
  461. handButtonConfirm(data) {
  462. //获取点击操作
  463. console.log('data', data)
  464. this.handShowAlert(data.handleAction, data.receipt)
  465. },
  466. handShowAlert(handleAction, receipt) {
  467. //执行
  468. switch (handleAction.handleId) {
  469. case 0: // 作废
  470. this.contentModalText = '该款项将作废,请重新识别收款短信!'
  471. this.modal = true
  472. break
  473. case 1: // 设为普通款
  474. this.contentModalText = '确认将该款项设为普通款项?'
  475. this.modal = true
  476. break
  477. case 2: // 设为非订单款
  478. this.$api.navigateTo(`/pages/relation/nonorder/add?id=${receipt.id}`)
  479. break
  480. case 10: // 设为平台服务费
  481. this.contentModalText = '确认将该款项设为平台服务费?'
  482. this.modal = true
  483. break
  484. case 4: // 设为供应商退款
  485. this.contentModalText = '确认将该款项设为供应商退款?'
  486. this.modal = true
  487. break
  488. }
  489. this.hanldReceipt = receipt
  490. this.handleOperId = handleAction.handleId
  491. },
  492. handleClick(e) {
  493. // 确定操作
  494. let index = e.index
  495. if (index == 1) {
  496. switch (this.handleOperId) {
  497. case 0: // 作废
  498. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  499. break
  500. case 1: // 设为普通款
  501. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  502. break
  503. case 10: // 设为返佣款
  504. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  505. break
  506. case 4: // 设为供应商退款
  507. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  508. break
  509. }
  510. }
  511. this.modal = false
  512. },
  513. handleClick1() {
  514. // 确认设为非订单款项
  515. console.log('handleOperId', this.handleOperId)
  516. console.log('hanldReceipt', this.hanldReceipt)
  517. if (this.noOrderReason == '') {
  518. this.$util.msg('请输入设为非订单款项说明!', 2000)
  519. return
  520. }
  521. this.modal1 = false
  522. this.handReceiptConfirm(this.handleOperId, this.hanldReceipt)
  523. },
  524. handReceiptConfirm(handleOperId, hanldReceipt) {
  525. //操作款项
  526. this.operateParams.id = hanldReceipt.id
  527. switch (
  528. this.handleOperId // 设置接口参数
  529. ) {
  530. case 0: // 作废
  531. this.operateParams.delFlag = 1
  532. this.operateParams.receiptType = hanldReceipt.receiptType
  533. break
  534. case 1: // 设为普通款
  535. this.operateParams.receiptType = 1
  536. break
  537. case 2: // 设为非订单款
  538. this.operateParams.receiptType = 2
  539. this.operateParams.noOrderReason = this.noOrderReason
  540. break
  541. case 10: // 设为返佣款
  542. this.operateParams.receiptType = 10
  543. break
  544. case 4: // 设为供应商退款
  545. this.operateParams.receiptType = 5
  546. break
  547. }
  548. this.OrderService.orderReceiptOperate(this.operateParams)
  549. .then(response => {
  550. this.$util.msg(response.msg, 2000, true, 'success')
  551. setTimeout(() => {
  552. this.getOrderDatainit()
  553. }, 2000)
  554. })
  555. .catch(error => {
  556. this.$util.msg(error.msg, 2000)
  557. })
  558. },
  559. handSearchConfirm() {
  560. this.getOrderDatainit()
  561. this.rightDrawer = false
  562. },
  563. hideMobel() {
  564. this.modal = false
  565. },
  566. hideMobel1() {
  567. this.modal1 = false
  568. },
  569. formatColor(state) {
  570. //设置邀请码状态亚瑟
  571. let stateColor = '',
  572. stateColorObject = {
  573. 1: '#ff7900',
  574. 2: '#4cd964',
  575. 3: '#19be6b',
  576. 4: '#ed3f14',
  577. 5: '#F74D54'
  578. }
  579. Object.keys(stateColorObject).forEach(function(key) {
  580. if (key == state) {
  581. stateColor = stateColorObject[key]
  582. }
  583. })
  584. return stateColor
  585. },
  586. getDate(type) {
  587. const date = new Date()
  588. let year = date.getFullYear()
  589. let month = date.getMonth() + 1
  590. let day = date.getDate()
  591. if (type === 'start') {
  592. year = year - 1
  593. } else if (type === 'end') {
  594. year = year + 1
  595. }
  596. month = month > 9 ? month : '0' + month
  597. day = day > 9 ? day : '0' + day
  598. return `${year}-${month}-${day}`
  599. },
  600. bindStartDateChange(event) {
  601. //开始时间
  602. this.listQuery.startDate = event.detail.value
  603. },
  604. bindEndDateChange(event) {
  605. //结束时间
  606. this.listQuery.endDate = event.detail.value
  607. },
  608. rDrawer() {
  609. //弹出抽屉
  610. this.rightDrawer = true
  611. },
  612. closeDrawer(e) {
  613. //关闭抽屉
  614. this.rightDrawer = false
  615. },
  616. tabClick(num, index, type) {
  617. switch (num) {
  618. case 1: // 订单款
  619. this.isEmpty = false
  620. this.pullUpOn = true
  621. this.currents = index
  622. this.listQuery.receiptType = type
  623. this.listQuery.receiptStatus = 0
  624. this.listQuery.startDate = ''
  625. this.listQuery.endDate = ''
  626. this.listQuery.smsContent = ''
  627. this.listQuery.newReceiptType = ''
  628. this.getOrderDatainit()
  629. this.tabCurrents = 0
  630. break
  631. case 2:
  632. this.isEmpty = false
  633. this.pullUpOn = true
  634. this.tabCurrents = index
  635. this.listQuery.startDate = ''
  636. this.listQuery.endDate = ''
  637. this.listQuery.smsContent = ''
  638. this.listQuery.receiptStatus = type
  639. this.getOrderDatainit()
  640. break
  641. case 3: // 非订单款类别选项
  642. this.isEmpty = false
  643. this.pullUpOn = true
  644. this.tabCurrents = index
  645. this.listQuery.startDate = ''
  646. this.listQuery.endDate = ''
  647. this.listQuery.smsContent = ''
  648. this.listQuery.newReceiptType = type
  649. this.getOrderDatainit()
  650. break
  651. }
  652. },
  653. toNoSms(url) {
  654. this.$api.navigateTo(url)
  655. },
  656. navBack() {
  657. uni.navigateBack({
  658. delta: 1
  659. })
  660. },
  661. initListQuery() {
  662. // 初始化
  663. this.payList = []
  664. this.loadding = true
  665. this.pullUpOn = true
  666. this.listQuery.pageNum = 1
  667. },
  668. formatReceiptType(value) {
  669. //订单状态文字和颜色
  670. var HtmlStateText = '',
  671. stateTextObject = {
  672. 1: '订单款',
  673. 2: '非订单款',
  674. 3: '返佣款',
  675. 4: '订单款或者非订单款',
  676. 5: '供应商退款'
  677. }
  678. Object.keys(stateTextObject).forEach(function(key) {
  679. if (key == value) {
  680. HtmlStateText = stateTextObject[key]
  681. }
  682. })
  683. return HtmlStateText
  684. }
  685. },
  686. onPageScroll(e) {
  687. //实时获取到滚动的值
  688. },
  689. onReachBottom() {
  690. if (this.hasNextPage) {
  691. this.loadding = true
  692. this.pullUpOn = true
  693. this.getOnReachBottomData()
  694. }
  695. },
  696. onPullDownRefresh() {
  697. setTimeout(() => {
  698. this.getOrderDatainit()
  699. uni.stopPullDownRefresh()
  700. }, 200)
  701. },
  702. onShareAppMessage(res) {
  703. //分享购买优惠券
  704. const receipt = res.target.dataset.receipt
  705. const receiptTypeText = this.formatReceiptType(receipt.receiptType)
  706. if (res.from === 'button') {
  707. // console.log('来自页面内转发按钮')
  708. return {
  709. title: `¥${receipt.receiptAmount.toFixed(2)} | ${receipt.receiptDate} | ${
  710. receipt.receiptStatusText
  711. }(${receiptTypeText})`,
  712. path: `/pages/login/login-share?id=${receipt.id}`,
  713. imageUrl: 'https://static.caimei365.com/app/crm/image/icon-share@2x.jpg'
  714. }
  715. }
  716. },
  717. onShow() {
  718. this.getWxAuthorize()
  719. }
  720. }
  721. </script>
  722. <style lang="scss">
  723. @import '@/uni.scss';
  724. page {
  725. background: #f7f7f7;
  726. }
  727. .tui-header-box {
  728. width: 100%;
  729. background: #ffffff;
  730. z-index: 999;
  731. position: fixed;
  732. top: 0;
  733. left: 0;
  734. background-size: cover;
  735. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  736. }
  737. .tui-header-tabs {
  738. width: 100%;
  739. height: auto;
  740. margin-bottom: 40rpx;
  741. padding: 20rpx;
  742. background: #4688fa;
  743. box-sizing: border-box;
  744. position: fixed;
  745. z-index: 999;
  746. border-radius: 0 0 10rpx 10rpx;
  747. &.day {
  748. background: #ffffff;
  749. padding: 20rpx 0rpx;
  750. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  751. }
  752. .title {
  753. font-size: $font-size-36;
  754. line-height: 60rpx;
  755. color: #fff;
  756. font-weight: bold;
  757. margin-bottom: 20rpx;
  758. }
  759. .main {
  760. width: 100%;
  761. height: 80rpx;
  762. &.day {
  763. height: 80rpx;
  764. box-sizing: border-box;
  765. padding: 20rpx 10rpx;
  766. border-top: 1px solid #efefef;
  767. .scroll-view_H {
  768. white-space: nowrap;
  769. width: 100%;
  770. height: 80rpx;
  771. }
  772. }
  773. &.one {
  774. }
  775. .main-item {
  776. float: left;
  777. text-align: center;
  778. color: #ffffff;
  779. box-sizing: border-box;
  780. &.one {
  781. width: 25%;
  782. .text {
  783. width: 100%;
  784. height: 80rpx;
  785. line-height: 80rpx;
  786. display: block;
  787. float: left;
  788. font-size: $font-size-28;
  789. color: #666666;
  790. text-align: center;
  791. font-weight: 600;
  792. font-family: '正楷';
  793. }
  794. }
  795. &.tab {
  796. width: 140rpx;
  797. border-radius: 30rpx;
  798. background: #f7f7f7;
  799. margin: 0 10rpx;
  800. padding: 0 20rpx;
  801. .text {
  802. width: 100%;
  803. height: 50rpx;
  804. line-height: 50rpx;
  805. display: block;
  806. float: left;
  807. font-size: $font-size-24;
  808. color: #666666;
  809. text-align: center;
  810. }
  811. &.small {
  812. width: auto;
  813. border-radius: 30rpx;
  814. background: #f7f7f7;
  815. margin: 0 5rpx;
  816. padding: 0 18rpx;
  817. .text {
  818. width: 100%;
  819. height: 50rpx;
  820. line-height: 50rpx;
  821. display: block;
  822. float: left;
  823. font-size: $font-size-22;
  824. color: #666666;
  825. text-align: center;
  826. }
  827. &.tabActive {
  828. .text {
  829. color: $btn-confirm;
  830. }
  831. }
  832. }
  833. }
  834. &.active {
  835. .text {
  836. color: $btn-confirm;
  837. font-size: $font-size-28;
  838. position: relative;
  839. &::before {
  840. content: '';
  841. width: 60rpx;
  842. height: 4rpx;
  843. background: $btn-confirm;
  844. position: absolute;
  845. left: 50%;
  846. bottom: 0;
  847. margin-left: -30rpx;
  848. }
  849. }
  850. }
  851. &.tabActive {
  852. .text {
  853. color: $btn-confirm;
  854. }
  855. }
  856. }
  857. }
  858. }
  859. .header-top {
  860. width: 100%;
  861. font-size: 16px;
  862. font-weight: 500;
  863. height: 32px;
  864. display: flex;
  865. align-items: center;
  866. justify-content: center;
  867. position: relative;
  868. padding: 0 40rpx;
  869. }
  870. .header-sit {
  871. width: 100%;
  872. box-sizing: border-box;
  873. height: 80rpx;
  874. line-height: 80rpx;
  875. box-sizing: border-box;
  876. color: #ffffff;
  877. .header-sit-text {
  878. text-align: left;
  879. font-size: $font-size-40;
  880. font-weight: 600;
  881. font-family: '正楷';
  882. }
  883. .icon-fanhui {
  884. display: block;
  885. width: 80rpx;
  886. height: 80rpx;
  887. float: left;
  888. text-align: center;
  889. line-height: 80rpx;
  890. font-size: 42rpx;
  891. }
  892. .icon-iconfonticonfontsousuo1 {
  893. font-size: 42rpx;
  894. margin-left: 30rpx;
  895. }
  896. }
  897. .mine {
  898. width: 100%;
  899. height: 100%;
  900. position: relative;
  901. }
  902. .user-section {
  903. position: absolute;
  904. width: 100%;
  905. }
  906. .header-content {
  907. width: 100%;
  908. height: auto;
  909. position: relative;
  910. background-color: #f7f7f7;
  911. .tui-header-btm {
  912. width: 100%;
  913. padding: 0 30rpx;
  914. box-sizing: border-box;
  915. display: flex;
  916. align-items: center;
  917. justify-content: space-between;
  918. color: #fff;
  919. }
  920. .tui-btm-item {
  921. flex: 1;
  922. display: flex;
  923. flex-direction: column;
  924. align-items: center;
  925. justify-content: center;
  926. }
  927. .tui-btm-num {
  928. font-size: 32rpx;
  929. font-weight: 600;
  930. position: relative;
  931. }
  932. .tui-btm-text {
  933. font-size: 24rpx;
  934. opacity: 0.85;
  935. padding-top: 4rpx;
  936. }
  937. }
  938. .uni-badge--small {
  939. -webkit-transform: scale(0.8);
  940. -ms-transform: scale(0.8);
  941. transform: scale(0.8);
  942. -webkit-transform-origin: center center;
  943. -ms-transform-origin: center center;
  944. transform-origin: center center;
  945. }
  946. .uni-badge {
  947. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  948. -webkit-box-sizing: border-box;
  949. box-sizing: border-box;
  950. font-size: 12px;
  951. line-height: 1;
  952. display: inline-block;
  953. padding: 3px 6px;
  954. color: #333;
  955. border-radius: 100px;
  956. background-color: #f1f1f1;
  957. }
  958. .uni-badge-error {
  959. color: #fff;
  960. background-color: #dd524d;
  961. }
  962. .tui-order-list {
  963. margin-top: 24rpx;
  964. width: 100%;
  965. position: relative;
  966. box-sizing: border-box;
  967. padding: 0 20rpx;
  968. }
  969. .tui-order-content {
  970. width: 100%;
  971. height: auto;
  972. }
  973. .tui-order-item {
  974. display: flex;
  975. flex-direction: column;
  976. width: 100%;
  977. padding: 20rpx 20rpx;
  978. background: #fff;
  979. margin-bottom: 24rpx;
  980. border-radius: 10rpx;
  981. position: relative;
  982. .list-shaore {
  983. width: 80rpx;
  984. height: 80rpx;
  985. line-height: 80rpx;
  986. text-align: center;
  987. position: absolute;
  988. right: 0;
  989. top: 0;
  990. background: transparent;
  991. border-radius: 0;
  992. border: 0;
  993. margin: 0;
  994. .iconfont {
  995. font-size: 48rpx;
  996. color: $color-system;
  997. }
  998. }
  999. }
  1000. .list-title {
  1001. width: 100%;
  1002. height: auto;
  1003. .list-title-t {
  1004. width: 100%;
  1005. height: 50rpx;
  1006. float: left;
  1007. font-size: $font-size-28;
  1008. padding-bottom: 10rpx;
  1009. margin-bottom: 10rpx;
  1010. .list-title-num {
  1011. float: left;
  1012. text-align: left;
  1013. color: #999999;
  1014. line-height: 40rpx;
  1015. font-size: $font-size-24;
  1016. }
  1017. .list-title-tip {
  1018. float: left;
  1019. .badges {
  1020. display: block;
  1021. float: left;
  1022. padding: 0 15rpx;
  1023. height: 36rpx;
  1024. line-height: 36rpx;
  1025. border-radius: 18rpx;
  1026. background: #ecf5ff;
  1027. font-size: $font-size-22;
  1028. text-align: center;
  1029. color: #409eff;
  1030. margin-right: 20rpx;
  1031. }
  1032. .badgesa {
  1033. display: block;
  1034. float: left;
  1035. padding: 0 15rpx;
  1036. height: 36rpx;
  1037. line-height: 36rpx;
  1038. border-radius: 18rpx;
  1039. background: #f0f9eb;
  1040. font-size: $font-size-22;
  1041. text-align: center;
  1042. color: #67c23a;
  1043. margin-right: 20rpx;
  1044. }
  1045. .badgesb {
  1046. display: block;
  1047. float: left;
  1048. padding: 0 15rpx;
  1049. height: 36rpx;
  1050. line-height: 36rpx;
  1051. border-radius: 18rpx;
  1052. background: #f4f4f5;
  1053. font-size: $font-size-22;
  1054. text-align: center;
  1055. color: #909399;
  1056. margin-right: 20rpx;
  1057. }
  1058. }
  1059. }
  1060. .list-title-b {
  1061. width: 100%;
  1062. height: 40rpx;
  1063. float: left;
  1064. font-size: $font-size-24;
  1065. line-height: 40rpx;
  1066. color: #666666;
  1067. text-align: left;
  1068. .text {
  1069. color: #999999;
  1070. }
  1071. &.sms {
  1072. height: auto;
  1073. }
  1074. }
  1075. }
  1076. .d-container {
  1077. width: 580rpx;
  1078. padding: 80rpx 0;
  1079. .drawer-main {
  1080. width: 100%;
  1081. height: auto;
  1082. box-sizing: border-box;
  1083. float: left;
  1084. .drawer-main-name {
  1085. width: 100%;
  1086. height: 80rpx;
  1087. line-height: 80rpx;
  1088. text-align: left;
  1089. font-size: $font-size-26;
  1090. color: #333333;
  1091. box-sizing: border-box;
  1092. padding: 0 20rpx;
  1093. font-weight: bold;
  1094. }
  1095. .drawer-main-time {
  1096. width: 100%;
  1097. height: 56rpx;
  1098. box-sizing: border-box;
  1099. .line {
  1100. color: #999999;
  1101. float: left;
  1102. line-height: 56rpx;
  1103. }
  1104. .drawer-main-time-input {
  1105. width: 228rpx;
  1106. height: 56rpx;
  1107. background: #f7f7f7;
  1108. border-radius: 28rpx;
  1109. box-sizing: border-box;
  1110. padding: 0 20rpx;
  1111. line-height: 56rpx;
  1112. float: left;
  1113. margin: 0 20rpx;
  1114. position: relative;
  1115. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1116. .input-text {
  1117. display: block;
  1118. height: 56rpx;
  1119. font-size: 26rpx;
  1120. color: #666666;
  1121. }
  1122. .icon-riqi {
  1123. color: $color-system;
  1124. display: block;
  1125. width: 40rpx;
  1126. height: 56rpx;
  1127. position: absolute;
  1128. right: 10rpx;
  1129. top: 0;
  1130. line-height: 56rpx;
  1131. }
  1132. }
  1133. }
  1134. .drawer-main-textarea {
  1135. width: 100%;
  1136. height: 160rpx;
  1137. box-sizing: border-box;
  1138. padding: 0 20rpx;
  1139. background: #ffffff;
  1140. border-radius: 8rpx;
  1141. .textarea {
  1142. width: 100%;
  1143. height: 100%;
  1144. background: #f7f7f7;
  1145. box-sizing: border-box;
  1146. padding: 20rpx 20rpx;
  1147. font-size: $font-size-24;
  1148. border-radius: 8rpx;
  1149. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1150. }
  1151. }
  1152. }
  1153. .drawer-input {
  1154. width: 100%;
  1155. float: left;
  1156. box-sizing: border-box;
  1157. padding: 24rpx 10rpx 0 10rpx;
  1158. border: 1px solid rgba(0, 0, 0, 0.2);
  1159. border-radius: 4rpx;
  1160. position: relative;
  1161. background-color: #ffffff;
  1162. &.btn {
  1163. border: none;
  1164. display: flex;
  1165. position: fixed;
  1166. left: 0;
  1167. bottom: 0;
  1168. }
  1169. .drawer-btn {
  1170. width: 210rpx;
  1171. height: 84rpx;
  1172. border-radius: 42rpx;
  1173. background: $btn-confirm;
  1174. line-height: 84rpx;
  1175. text-align: center;
  1176. font-size: $font-size-26;
  1177. color: #ffffff;
  1178. flex: 1;
  1179. margin: 0 10rpx;
  1180. &.comfrim {
  1181. background: $btn-confirm;
  1182. }
  1183. &.clear {
  1184. background: #f7f7f7;
  1185. color: #999999;
  1186. }
  1187. }
  1188. }
  1189. }
  1190. .tui-icon-button {
  1191. width: 80rpx;
  1192. height: 80rpx;
  1193. line-height: 80rpx;
  1194. text-align: center;
  1195. border-radius: 50%;
  1196. background: linear-gradient(45deg, #1cbbb4 0%, #0081ff 100%);
  1197. box-shadow: 0 8rpx 8rpx 0 rgba(86, 119, 252, 0.2);
  1198. position: fixed;
  1199. bottom: 120rpx;
  1200. right: 20rpx;
  1201. &.service {
  1202. background: #07c160;
  1203. }
  1204. .icon-jiahao {
  1205. font-size: $font-size-44;
  1206. color: #ffffff;
  1207. }
  1208. }
  1209. .tui-prompt-title {
  1210. line-height: 44rpx;
  1211. text-align: center;
  1212. }
  1213. .tui-prompt-textarea {
  1214. width: 100%;
  1215. height: 160rpx;
  1216. box-sizing: border-box;
  1217. background: #f7f7f7;
  1218. border-radius: 8rpx;
  1219. padding: 15rpx 20rpx;
  1220. margin-top: 10rpx;
  1221. .textarea {
  1222. width: 100%;
  1223. height: 100%;
  1224. font-size: $font-size-26;
  1225. &.none {
  1226. display: none;
  1227. }
  1228. }
  1229. }
  1230. .tui-prompt-flex {
  1231. width: 100%;
  1232. height: 70rpx;
  1233. display: flex;
  1234. margin-top: 20rpx;
  1235. .btn {
  1236. flex: 1;
  1237. line-height: 70rpx;
  1238. font-size: $font-size-26;
  1239. text-align: center;
  1240. color: #ffffff;
  1241. border-radius: 33rpx;
  1242. margin: 0 24rpx;
  1243. &.btn-cancel {
  1244. background: #f7f7f7;
  1245. color: #999999;
  1246. }
  1247. &.btn-confirm {
  1248. background: $color-system;
  1249. }
  1250. }
  1251. }
  1252. </style>