index.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341
  1. <template>
  2. <view class="container mine clearfix">
  3. <view
  4. class="tui-header-box first"
  5. :style="{ height: isCmcustomClass == 'fiexd' ? CustomBar + 6 + 'px' : CustomBar + 6 + 'px' }"
  6. :class="isCmcustomClass"
  7. >
  8. <view class="header-top" :style="{ paddingTop: top + 'px', lineHeight: CustomBar + 20 + 'px' }"></view>
  9. <view class="header-sit">
  10. <text class="iconfont icon-fanhui" @click.stop="this.$api.navigateBack(1)"></text>
  11. <text class="header-sit-text">关联订单</text>
  12. </view>
  13. </view>
  14. <tui-skeleton
  15. v-if="skeletonShow"
  16. backgroundColor="#fafafa"
  17. borderRadius="10rpx"
  18. :isLoading="true"
  19. :loadingType="7"
  20. ></tui-skeleton>
  21. <view class="container-content" v-else>
  22. <view class="tui-header-tabs day clearfix" :style="{ top: CustomBar + 6 + 'px' }">
  23. <view v-if="!isShowHeader">
  24. <view class="tui-header-top">
  25. <view class="title"> 收款信息 </view>
  26. <view class="tui-header-button" v-if="receiptInfo.orderList.length>0">
  27. <view class="button btn-confirm" @click.stop="showReceiptModel"> 查看关联信息 </view>
  28. </view>
  29. </view>
  30. <view class="tui-header-item">
  31. <view class="list-title-t">
  32. <view class="list-title-tip">
  33. <text class="badges">{{ receiptInfo.receiptType | formatReceiptType }}款</text>
  34. </view>
  35. <view class="list-title-num" :style="{ color: formatColor(receiptInfo.receiptStatus) }">{{
  36. receiptInfo.receiptStatus | formatStateType
  37. }}</view>
  38. </view>
  39. <view class="list-title-b">
  40. <view class="list-title-b-item ">
  41. 收款金额:<text class="text">¥{{ receiptInfo.receiptAmount | NumFormat }} </text>
  42. </view>
  43. <view class="list-title-b-item ">
  44. 收款类型:<text class="text">{{ receiptInfo.payTypeText }}</text>
  45. </view>
  46. </view>
  47. <view class="list-title-b">
  48. 收款时间:<text class="text">{{ receiptInfo.receiptDate }}</text>
  49. </view>
  50. <view class="list-title-b">收款短信:</view>
  51. <view class="list-title-b sms">
  52. <text class="text">{{ receiptInfo.smsContent ? receiptInfo.smsContent : '无' }}</text>
  53. </view>
  54. <view class="list-icon" v-if="receiptInfo.tipMsg">
  55. <image
  56. class="list-icon-image"
  57. src="https://static.caimei365.com/app/crm/image/icon-noconfirm@2x.png"
  58. mode=""
  59. v-if="receiptInfo.receiptStatus == 1"
  60. ></image>
  61. <image
  62. class="list-icon-image"
  63. src="https://static.caimei365.com/app/crm/image/icon-noaudit@2x.png"
  64. mode=""
  65. v-if="receiptInfo.receiptStatus == 2"
  66. ></image>
  67. </view>
  68. </view>
  69. </view>
  70. <view class="tui-header-tabmain">
  71. <input
  72. v-if="currents == 3"
  73. class="input"
  74. type="text"
  75. v-model="refundListQuery.shopName"
  76. confirm-type="search"
  77. @confirm="subMitSearch(2)"
  78. placeholder="搜索关键词(供应商名称)"
  79. />
  80. <input
  81. v-else
  82. class="input"
  83. type="text"
  84. v-model="listQuery.keyword"
  85. confirm-type="search"
  86. @confirm="subMitSearch(1)"
  87. placeholder="搜索关键词(客户名称/订单号)"
  88. />
  89. <text class="iconfont icon-sousuo"></text>
  90. </view>
  91. <view class="tui-header-tabmain">
  92. <view
  93. class="main-item one"
  94. v-for="(item, index) in listTabs"
  95. :key="index"
  96. :class="{ active: currents == index }"
  97. @click="tabClick(1, index)"
  98. >
  99. <view class="text">{{ item.name }}</view>
  100. </view>
  101. </view>
  102. <view class="tui-header-tabmain day">
  103. <view
  104. class="main-item tab"
  105. v-for="(item, index) in listReturnType"
  106. :key="index"
  107. :class="{ tabActive: tabCurrents == index }"
  108. @click="tabClick(2, index)"
  109. >
  110. <view class="text">{{ item.name }}</view>
  111. </view>
  112. </view>
  113. </view>
  114. <view
  115. class="user-section"
  116. :style="{
  117. top: isIphoneX ? CustomBar + 330 + 'px' : CustomBar + 315 + 'px',
  118. left: 0 + 'px',
  119. paddingBottom: isIphoneX ? '178rpx' : '144rpx'
  120. }"
  121. >
  122. <view class="header-content">
  123. <view :class="{ 'tui-order-list': scrollTop >= 0 }" class="clearfix">
  124. <!-- 空白页 -->
  125. <empty v-if="isEmpty" :typeIndex="currents" :navbarHeight="navbarHeight"></empty>
  126. <!-- 列表 -->
  127. <view v-else class="tui-order-content">
  128. <view class="tui-order-item" v-for="(order, orderIndex) in orderList" :key="orderIndex">
  129. <template v-if="currents != 3">
  130. <receipt-details :orderInfo="order"></receipt-details>
  131. <view
  132. class="list-checked"
  133. @click="checkedOrder(order)"
  134. v-if="order.surplusAmount > 0"
  135. >
  136. <text
  137. class="iconfont"
  138. :class="order.isChecked ? 'icon-yixuanze' : 'icon-weixuanze'"
  139. ></text>
  140. </view>
  141. <view class="list-detail" @click="orderDetail(order.id)">
  142. <text class="iconfont icon-xiayibu"></text>
  143. </view>
  144. </template>
  145. <template v-if="currents == 3">
  146. <receipt-refund :orderInfo="order"></receipt-refund>
  147. <view class="list-checked" @click="checkedRefundOrder(order, orderIndex)">
  148. <text
  149. class="iconfont"
  150. :class="
  151. checkedRefundIndex == orderIndex ? 'icon-yixuanze' : 'icon-weixuanze'
  152. "
  153. ></text>
  154. </view>
  155. <view class="list-detail" @click="orderDetail(order.id)">
  156. <text class="iconfont icon-xiayibu"></text>
  157. </view>
  158. </template>
  159. </view>
  160. <!--加载loadding-->
  161. <tui-loadmore :visible="loadding" :index="3" type="black"></tui-loadmore>
  162. <tui-nomore :visible="!pullUpOn" bgcolor="#F7F7F7" :text="nomoreText"></tui-nomore>
  163. <!--加载loadding-->
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. <view class="distinguish-button" :style="{ paddingBottom: isIphoneX ? '68rpx' : '24rpx' }">
  169. <view class="button" @click="confirmDistinguish">确认</view>
  170. </view>
  171. </view>
  172. <!-- 弹窗 -->
  173. <tui-modal
  174. :show="modal"
  175. @click="handleClick"
  176. @cancel="hideMobel(0)"
  177. :content="contentModalText"
  178. color="#333"
  179. :size="32"
  180. shape="circle"
  181. :maskClosable="false"
  182. ></tui-modal>
  183. <!-- 关联提示弹窗 -->
  184. <receipt-modal
  185. v-if="modal1"
  186. :show="modal1"
  187. :amount="receiptInfo.receiptAmount"
  188. :totalOrder="totalOrder"
  189. :modelTpye="modelTpye"
  190. @cancel="hideMobel(1)"
  191. @click="handleClick1">
  192. </receipt-modal>
  193. <receipt-orderDetails
  194. v-if="modal2"
  195. :receipt="receiptInfo"
  196. @cancel="hideMobel(2)"
  197. >
  198. </receipt-orderDetails>
  199. </view>
  200. </template>
  201. <script>
  202. import receiptModal from '@/components/cm-module/receipt/receipt-modal'
  203. import receiptDetails from '@/components/cm-module/receipt/receipt-details'
  204. import receiptRefund from '@/components/cm-module/receipt/receipt-refund'
  205. import receiptOrderDetails from '@/components/cm-module/receipt/receipt-orderDetails'
  206. import empty from '@/components/empty'
  207. import wxLogin from '@/services/wxLogin.js'
  208. import { mapState, mapMutations } from 'vuex'
  209. const defaultListQuery = {
  210. id: 0, //收款Id
  211. keyword: '', // 搜索关键词(客户名称/订单号)
  212. orderReceiptStatus: '1,2', //订单收款状态:1待收款(协销待确认款项的订单),2部分收款(已确认款项的订单),3已收款(已确认款项的订单)
  213. organizeId: 0, // 商品订单 0 定金订单 0 小程序订单 3 退款子订单 4
  214. pageNum: 1, // 页码
  215. pageSize: 10, // 条数
  216. type: 0 // 0商品订单(默认),1订金订单
  217. }
  218. const defaultRefundListQuery = {
  219. id: 0, //收款Id
  220. confirmedType: 0, // 0待确认,2已确认
  221. shopName: '', //供应商名称
  222. pageNum: 1, // 页码
  223. pageSize: 10 // 条数
  224. }
  225. export default {
  226. components: {
  227. empty,
  228. receiptModal,
  229. receiptDetails,
  230. receiptRefund,
  231. receiptOrderDetails
  232. },
  233. data() {
  234. return {
  235. CustomBar: this.CustomBar, // 顶部导航栏高度
  236. isIphoneX: this.$store.state.isIphoneX,
  237. receiptInfo: {},
  238. listTabs: [
  239. {
  240. name: '商品订单',
  241. type: 1
  242. },
  243. {
  244. name: '订金订单',
  245. type: 2
  246. },
  247. {
  248. name: '小程序订单',
  249. type: 3
  250. },
  251. {
  252. name: '退款子订单',
  253. type: 4
  254. }
  255. ],
  256. listReturnType: [
  257. {
  258. name: '待确认',
  259. type: 2
  260. },
  261. {
  262. name: '已确认',
  263. type: 3
  264. }
  265. ],
  266. listQuery: Object.assign({}, defaultListQuery),
  267. refundListQuery: Object.assign({}, defaultRefundListQuery),
  268. currents: 0,
  269. tabCurrents: 0,
  270. orderList: [],
  271. scrollTop: 0,
  272. isEmpty: false,
  273. loadding: false,
  274. pullUpOn: true,
  275. hasNextPage: false,
  276. pullFlag: true,
  277. navbarHeight: '',
  278. nomoreText: '上拉显示更多',
  279. contentModalText: '', //操作文字提示语句
  280. modal: false,
  281. modal1: false,
  282. modal2: false,
  283. hanldOrder: '', //储存监听订单信息
  284. OperationType: '', //操作类型
  285. isCmcustomClass: 'left',
  286. isShowHeader: false,
  287. height: 64, //header高度
  288. top: 0, //标题图标距离顶部距离
  289. scrollH: 0, //滚动总高度
  290. opcity: 1,
  291. checkedOrderList: [],
  292. checkedIds:[],
  293. checkedRefundIndex: 0,
  294. confirmParams:{
  295. confirmType:4,
  296. id:0,
  297. orderIds:'',
  298. },
  299. skeletonShow: true,
  300. modelTpye:1,// 收款弹窗类型
  301. totalOrder: {
  302. orderNums:1,
  303. payTotalFee: 0, // 订单金额
  304. balancePayFee: 0, // 余额抵扣
  305. payableAmount: 0, // 应收金额
  306. paidAmount: 0 ,// 已收金额
  307. surplusAmount:0 // 剩余应收
  308. } // 统计都选相同的订单数据
  309. }
  310. },
  311. onLoad(option) {
  312. console.log('option', option)
  313. let obj = {}
  314. uni.getSystemInfo({
  315. success: res => {
  316. this.width = obj.left || res.windowWidth
  317. this.height = obj.top ? obj.top + obj.height + 8 : res.statusBarHeight + 44
  318. this.top = obj.top ? obj.top + (obj.height - 32) / 2 : res.statusBarHeight + 6
  319. this.scrollH = res.windowWidth * 0.6
  320. }
  321. })
  322. this.listQuery.id = this.refundListQuery.id = this.confirmParams.id = option.id
  323. this.getOrderReceiptDetail(this.listQuery.id)
  324. },
  325. computed: {
  326. ...mapState(['hasLogin'])
  327. },
  328. methods: {
  329. getOrderReceiptDetail(id) {
  330. // 收款详情
  331. this.OrderService.orderReceiptDetail({ id: id })
  332. .then(response => {
  333. this.receiptInfo = response.data
  334. this.getOrderReceiptOrders()
  335. })
  336. .catch(err => {
  337. this.$util.msg(err.msg, 2000)
  338. })
  339. },
  340. getOrderReceiptOrders() {
  341. // 收款详情-订单列表
  342. this.OrderService.orderReceiptOrders(this.listQuery)
  343. .then(response => {
  344. let data = response.data
  345. this.hasNextPage = response.data.hasNextPage
  346. if (data.list && data.list.length > 0) {
  347. this.isEmpty = false
  348. this.orderList = data.list.map((el, index) => {
  349. el.isChecked = false
  350. return el
  351. })
  352. this.pullFlag = false
  353. setTimeout(() => {
  354. this.pullFlag = true
  355. }, 500)
  356. if (this.hasNextPage) {
  357. this.pullUpOn = false
  358. this.nomoreText = '上拉显示更多'
  359. } else {
  360. if (this.orderList.length < 3) {
  361. this.pullUpOn = true
  362. } else {
  363. this.pullUpOn = false
  364. this.loadding = false
  365. this.nomoreText = '已至底部'
  366. }
  367. }
  368. } else {
  369. this.isEmpty = true
  370. }
  371. this.skeletonShow = false
  372. })
  373. .catch(err => {
  374. this.$util.msg(err.msg, 2000)
  375. })
  376. },
  377. orderReceiptRefundOrders() {
  378. // 收款详情-退款子订单列表
  379. this.OrderService.orderReceiptRefundOrders(this.refundListQuery)
  380. .then(response => {
  381. let data = response.data
  382. this.hasNextPage = response.data.hasNextPage
  383. if (data.list && data.list.length > 0) {
  384. this.isEmpty = false
  385. this.orderList = data.list.map((el, index) => {
  386. el.isChecked = false
  387. return el
  388. })
  389. this.pullFlag = false
  390. setTimeout(() => {
  391. this.pullFlag = true
  392. }, 500)
  393. if (this.hasNextPage) {
  394. this.pullUpOn = false
  395. this.nomoreText = '上拉显示更多'
  396. } else {
  397. if (this.orderList.length < 3) {
  398. this.pullUpOn = true
  399. } else {
  400. this.pullUpOn = false
  401. this.loadding = false
  402. this.nomoreText = '已至底部'
  403. }
  404. }
  405. } else {
  406. this.isEmpty = true
  407. }
  408. })
  409. .catch(err => {
  410. this.$util.msg(err.msg, 2000)
  411. })
  412. },
  413. orderReceiptRefundOrdersBottom() {
  414. this.refundListQuery.pageNum += 1
  415. this.OrderService.orderReceiptRefundOrders(this.refundListQuery)
  416. .then(response => {
  417. let data = response.data
  418. if (data.list && data.list.length > 0) {
  419. this.hasNextPage = data.hasNextPage
  420. let list = data.list.map((el, index) => {
  421. el.isChecked = false
  422. return el
  423. })
  424. this.orderList = this.orderList.concat(list)
  425. this.pullFlag = false // 防上拉暴滑
  426. setTimeout(() => {
  427. this.pullFlag = true
  428. }, 500)
  429. if (this.hasNextPage) {
  430. this.pullUpOn = false
  431. this.nomoreText = '上拉显示更多'
  432. } else {
  433. this.pullUpOn = false
  434. this.loadding = false
  435. this.nomoreText = '已至底部'
  436. }
  437. }
  438. })
  439. .catch(error => {
  440. this.$util.msg(error.msg, 2000)
  441. })
  442. },
  443. orderReceiptOrdersBottom() {
  444. this.listQuery.pageNum += 1
  445. this.OrderService.orderReceiptOrders(this.listQuery)
  446. .then(response => {
  447. let data = response.data
  448. if (data.list && data.list.length > 0) {
  449. this.hasNextPage = data.hasNextPage
  450. let list = data.list.map((el, index) => {
  451. el.isChecked = false
  452. return el
  453. })
  454. this.orderList = this.orderList.concat(list)
  455. this.pullFlag = false // 防上拉暴滑
  456. setTimeout(() => {
  457. this.pullFlag = true
  458. }, 500)
  459. if (this.hasNextPage) {
  460. this.pullUpOn = false
  461. this.nomoreText = '上拉显示更多'
  462. } else {
  463. this.pullUpOn = false
  464. this.loadding = false
  465. this.nomoreText = '已至底部'
  466. }
  467. }
  468. })
  469. .catch(error => {
  470. this.$util.msg(error.msg, 2000)
  471. })
  472. },
  473. subMitSearch(type) {
  474. // 确认搜索
  475. switch (type) {
  476. case 1: // 订单
  477. this.listQuery.pageNum = 1
  478. this.getOrderReceiptOrders()
  479. break
  480. case 2: // 订单
  481. this.refundListQuery.pageNum = 1
  482. this.orderReceiptRefundOrders()
  483. break
  484. }
  485. },
  486. getOnReachBottomData() {
  487. //上拉加载
  488. if (this.currents == 3) {
  489. this.orderReceiptRefundOrdersBottom()
  490. } else {
  491. this.orderReceiptOrdersBottom()
  492. }
  493. },
  494. orderDetail(id) {
  495. //订单详情跳转
  496. this.$api.navigateTo(`/pages/relation/order/detail?orderId=${id}`)
  497. },
  498. handleClick(e) {
  499. //用户操作订单
  500. let index = e.index
  501. if (index == 1) {
  502. switch (this.OperationType) {
  503. case 'delete': //删除订单
  504. this.handOrderDetele(this.hanldOrder)
  505. break
  506. case 'cancel': //取消订单
  507. this.modal = true
  508. this.handCenceConfirm(this.hanldOrder)
  509. break
  510. case 'refund': //退款
  511. this.modal = true
  512. this.handRefundConfirm(this.hanldOrder)
  513. break
  514. case 'returned': //退货
  515. this.modal = true
  516. this.handReturnedConfirm(this.hanldOrder)
  517. break
  518. case 'confirm': //确认收货
  519. this.handOrderConfirm(this.hanldOrder)
  520. break
  521. case 'cancelRefund': //确认收货
  522. this.handCancelRefundConfirm(this.hanldOrder)
  523. break
  524. }
  525. }
  526. this.modal = false
  527. },
  528. handleClick1(data){
  529. switch(data){
  530. case 1: // 小额抹平确认
  531. console.log('小额抹平确认')
  532. this.confirmParams.confirmType = data
  533. this.confirmParams.orderIds = this.checkedIds.join(',')
  534. this.orderReceiptConfirm()
  535. this.modal1 = false
  536. break
  537. case 3: // 大额退款余额
  538. console.log('大额退款余额')
  539. this.confirmParams.confirmType = data
  540. this.confirmParams.orderIds = this.checkedIds.join(',')
  541. this.orderReceiptConfirm()
  542. this.modal1 = false
  543. break
  544. case 4: // 确认关联
  545. console.log('确认关联')
  546. this.confirmParams.confirmType = data
  547. this.confirmParams.orderIds = this.checkedIds.join(',')
  548. this.orderReceiptConfirm()
  549. this.modal1 = false
  550. break
  551. }
  552. },
  553. orderReceiptConfirm(){
  554. //确认关联或抹平或退款余额
  555. this.OrderService.orderReceiptConfirm(this.confirmParams)
  556. .then(response => {
  557. this.$api.navigateTo(`/pages/relation/ordinary/examine-detail?id=${this.confirmParams.id}`)
  558. })
  559. .catch(error => {
  560. this.$util.msg(error.msg, 2000)
  561. })
  562. },
  563. confirmDistinguish() {
  564. // 点击确认
  565. const list = []
  566. this.checkedOrderList.forEach(el => {
  567. if (list.indexOf(el.userId) == -1) {
  568. list.push(el.userId)
  569. }
  570. })
  571. if (this.checkedOrderList.length == 0) {
  572. this.$util.msg('请选择需要关联的订单!', 2000)
  573. return
  574. }
  575. if(this.currents === 1){// 订金订单每次只能关联一个订单
  576. if (this.checkedOrderList.length > 1) {
  577. this.$util.msg('订金订单每次只能关联一个订单!', 2000)
  578. return
  579. }
  580. }
  581. if(this.currents === 3){// 退款子订单每次只能关联一个子订单
  582. if (this.checkedOrderList.length > 1) {
  583. this.$util.msg('只能选择一个子订单!', 2000)
  584. return
  585. }
  586. }
  587. if (list.length > 1) {
  588. this.$util.msg('请选择相同机构的订单!', 2000)
  589. return
  590. }
  591. let payTotalFee = 0 //订单金额
  592. let balancePayFee = 0 //余额抵扣
  593. let payableAmount = 0 //应收金额
  594. let paidAmount = 0 //已收金额
  595. let surplusAmount = 0 //剩余应收
  596. this.checkedOrderList.forEach(el => {
  597. payTotalFee += el.payTotalFee
  598. balancePayFee += el.balancePayFee
  599. payableAmount += el.payableAmount
  600. paidAmount += el.paidAmount
  601. surplusAmount += el.surplusAmount
  602. this.checkedIds.push(el.orderId)
  603. })
  604. // 赋值
  605. this.totalOrder.payTotalFee = Number(payTotalFee.toFixed(2))
  606. this.totalOrder.surplusAmount = Number(surplusAmount.toFixed(2))
  607. this.totalOrder.balancePayFee = Number(balancePayFee.toFixed(2))
  608. this.totalOrder.payableAmount = Number(payableAmount.toFixed(2))
  609. this.totalOrder.paidAmount = Number(paidAmount.toFixed(2))
  610. this.totalOrder.orderNums = this.checkedOrderList.length
  611. if(this.currents === 1){// 收款金额必须等于订金订单金额才能关联
  612. if (this.receiptInfo.receiptAmount != this.totalOrder.payTotalFee) {
  613. this.$util.msg('收款金额必须等于订金订单金额才能关联!', 2000)
  614. return
  615. }
  616. }
  617. console.log('totalOrder', this.totalOrder)
  618. //处理收款状态的几种类型
  619. if(this.receiptInfo.receiptAmount == this.totalOrder.payableAmount || (this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) > 10){
  620. //收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10
  621. this.modelTpye = 1
  622. console.log('收款金额等于订单应收金额 或者是 订单应收总金额减去收款金额大于等于10',this.modelTpye)
  623. }else if(this.receiptInfo.receiptAmount > this.totalOrder.payableAmount){
  624. //收款金额大于订单应收金额(可退款到余额)
  625. this.modelTpye = 2
  626. console.log('收款金额大于订单应收金额(可退款到余额)',this.modelTpye)
  627. }else if((this.totalOrder.payableAmount - this.receiptInfo.receiptAmount) <= 10){
  628. //订单应收总金额减去收款金额小于等于10元时,才能抹平确认
  629. this.modelTpye = 3
  630. console.log('订单应收总金额减去收款金额小于等于10元时,才能抹平确认)',this.modelTpye)
  631. }
  632. this.modal1 = true
  633. },
  634. checkedOrder(order) {
  635. // 勾选关联订单
  636. order.isChecked = !order.isChecked
  637. if (order.isChecked) {
  638. this.checkedOrderList.push(order)
  639. } else {
  640. this.checkedOrderList.splice(this.checkedOrderList.indexOf(order), 1)
  641. }
  642. },
  643. checkedRefundOrder(order, index) {
  644. // 勾选退款子订单
  645. this.checkedOrderList = []
  646. this.checkedRefundIndex = index
  647. this.checkedOrderList.push(order)
  648. },
  649. hideMobel(type) {
  650. switch(type){
  651. case 0:
  652. this.modal = false
  653. break
  654. case 1:
  655. this.modal1 = false
  656. break
  657. case 2:
  658. this.modal2 = false
  659. break
  660. }
  661. },
  662. formatColor(state) {
  663. //设置颜色
  664. let stateColor = '',
  665. stateColorObject = {
  666. 1: '#FEAC20',
  667. 2: '#4cd964',
  668. 3: '#34CC8C',
  669. 4: '#F94B4B',
  670. 5: '#007aff'
  671. }
  672. Object.keys(stateColorObject).forEach(function(key) {
  673. if (key == state) {
  674. stateColor = stateColorObject[key]
  675. }
  676. })
  677. return stateColor
  678. },
  679. tabClick(type, index) {
  680. this.pullUpOn = true //切换时隐藏
  681. this.loadding = false //切换时隐藏
  682. this.listQuery.type = 0 //切换是设置订单类型
  683. switch (type) {
  684. case 1: // 切换订单类型
  685. this.currents = index
  686. this.tabCurrents = 0
  687. switch (this.currents) {
  688. case 0: // 商品订单
  689. this.listQuery.pageNum = 1
  690. this.listQuery.organizeId = 0
  691. this.getOrderReceiptOrders()
  692. break
  693. case 1:
  694. this.listQuery.type = 1
  695. this.listQuery.pageNum = 1
  696. this.listQuery.organizeId = 0
  697. this.getOrderReceiptOrders()
  698. break
  699. case 2:
  700. this.listQuery.pageNum = 1
  701. this.listQuery.organizeId = 3
  702. this.getOrderReceiptOrders()
  703. break
  704. case 3:
  705. this.refundListQuery.pageNum = 1
  706. this.orderReceiptRefundOrders()
  707. break
  708. }
  709. break
  710. case 2: // 切换收款状态
  711. this.tabCurrents = index
  712. if (this.currents == 3) {
  713. if (this.tabCurrents == 0) {
  714. this.refundListQuery.confirmedType = 0
  715. } else {
  716. this.refundListQuery.confirmedType = 2
  717. }
  718. this.refundListQuery.pageNum = 1
  719. this.orderReceiptRefundOrders()
  720. } else {
  721. if (this.tabCurrents == 0) {
  722. this.listQuery.orderReceiptStatus = '1,2'
  723. } else {
  724. this.listQuery.orderReceiptStatus = '3'
  725. }
  726. this.listQuery.pageNum = 1
  727. this.getOrderReceiptOrders()
  728. }
  729. }
  730. },
  731. showReceiptModel(){//
  732. this.modal2 = true
  733. }
  734. },
  735. onPageScroll(e) {
  736. //实时获取到滚动的值
  737. if (e.scrollTop > 30) {
  738. this.isCmcustomClass = 'fiexd'
  739. } else {
  740. this.isCmcustomClass = 'left'
  741. }
  742. if (e.scrollTop > 180) {
  743. this.isShowHeader = true
  744. } else {
  745. this.isShowHeader = false
  746. }
  747. },
  748. onReachBottom() {
  749. if (this.hasNextPage) {
  750. this.loadding = true
  751. this.pullUpOn = true
  752. this.getOnReachBottomData()
  753. }
  754. },
  755. onPullDownRefresh() {
  756. setTimeout(() => {
  757. this.listQuery.pageNum = 1
  758. this.getOrderReceiptOrders()
  759. uni.stopPullDownRefresh()
  760. }, 200)
  761. },
  762. onShareAppMessage(res) {
  763. //分享购买优惠券
  764. console.log('receiptInfo', receiptInfo)
  765. if (res.from === 'button') {
  766. // console.log('来自页面内转发按钮')
  767. }
  768. return {
  769. title: `【待确认】收款金额${receiptInfo.receiptAmount.toFixed(2)}元,收款时间:${receiptInfo.receiptDate}`,
  770. path: `pages/seller/cart/coupon-share?payment=${receiptInfo.id}`,
  771. imageUrl: 'https://static.caimei365.com/app/img/icon/icon-shareCoupon@2x.png'
  772. }
  773. },
  774. onShow() {
  775. this.$api.getComStorage('userInfo').then(resolve => {
  776. this.listQuery.merchantId = resolve.id
  777. // this.getOrderDatainit(this.currents)
  778. })
  779. }
  780. }
  781. </script>
  782. <style lang="scss">
  783. @import '@/uni.scss';
  784. page {
  785. background: #f7f7f7;
  786. }
  787. .tui-header-box {
  788. width: 100%;
  789. background: #ffffff;
  790. z-index: 999;
  791. position: fixed;
  792. top: 0;
  793. left: 0;
  794. background-size: cover;
  795. background-image: url(https://static.caimei365.com/app/crm/image/statistic_bg2.png);
  796. &.fiexd {
  797. }
  798. &.first {
  799. }
  800. }
  801. .header-top {
  802. width: 100%;
  803. font-size: 16px;
  804. font-weight: 500;
  805. height: 32px;
  806. display: flex;
  807. align-items: center;
  808. justify-content: center;
  809. position: relative;
  810. padding: 0 40rpx;
  811. }
  812. .header-sit {
  813. width: 100%;
  814. box-sizing: border-box;
  815. height: 80rpx;
  816. line-height: 80rpx;
  817. box-sizing: border-box;
  818. color: #ffffff;
  819. .header-sit-text {
  820. text-align: left;
  821. font-size: $font-size-40;
  822. font-weight: 600;
  823. font-family: '正楷';
  824. }
  825. .icon-fanhui {
  826. display: block;
  827. width: 80rpx;
  828. height: 80rpx;
  829. float: left;
  830. text-align: center;
  831. line-height: 80rpx;
  832. font-size: 42rpx;
  833. }
  834. }
  835. .tui-header-tabs {
  836. width: 100%;
  837. height: auto;
  838. margin-bottom: 40rpx;
  839. padding: 20rpx 24rpx;
  840. background: #ffffff;
  841. box-sizing: border-box;
  842. position: fixed;
  843. z-index: 999;
  844. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  845. .tui-header-top {
  846. width: 100%;
  847. height: 66rpx;
  848. box-sizing: border-box;
  849. float: left;
  850. .title {
  851. float: left;
  852. line-height: 66rpx;
  853. color: #333333;
  854. text-align: left;
  855. font-size: $font-size-30;
  856. font-weight: 600;
  857. }
  858. .tui-header-button {
  859. float: right;
  860. box-sizing: border-box;
  861. height: 100%;
  862. line-height: 66rpx;
  863. padding: 5rpx 0;
  864. .button {
  865. float: left;
  866. box-sizing: border-box;
  867. padding: 0 24rpx;
  868. height: 100%;
  869. line-height: 56rpx;
  870. border-radius: 8rpx;
  871. text-align: center;
  872. color: #ffffff;
  873. margin-left: 10rpx;
  874. &.btn-confirm {
  875. background: #f0ad4e
  876. }
  877. &.btn-error {
  878. background: #ff5000;
  879. }
  880. }
  881. }
  882. }
  883. .tui-header-item {
  884. width: 100%;
  885. height: auto;
  886. margin-top: 10rpx;
  887. position: relative;
  888. float: left;
  889. .list-title-t {
  890. width: 100%;
  891. height: 50rpx;
  892. float: left;
  893. font-size: $font-size-28;
  894. padding-bottom: 10rpx;
  895. margin-bottom: 10rpx;
  896. .list-title-num {
  897. float: left;
  898. text-align: left;
  899. color: #999999;
  900. margin-left: 30rpx;
  901. line-height: 40rpx;
  902. }
  903. .list-title-tip {
  904. float: left;
  905. .badges {
  906. display: block;
  907. float: left;
  908. padding: 0 15rpx;
  909. height: 40rpx;
  910. line-height: 40rpx;
  911. border-radius: 4rpx;
  912. background: $btn-confirm;
  913. font-size: $font-size-24;
  914. text-align: center;
  915. color: #ffffff;
  916. }
  917. }
  918. }
  919. .list-title-b {
  920. width: 100%;
  921. height: 40rpx;
  922. float: left;
  923. font-size: $font-size-24;
  924. line-height: 40rpx;
  925. color: #666666;
  926. text-align: left;
  927. .text {
  928. color: #999999;
  929. }
  930. .list-title-b-item {
  931. width: 50%;
  932. height: 100%;
  933. float: left;
  934. }
  935. &.sms {
  936. height: 100rpx;
  937. padding: 10rpx;
  938. border-radius: 4rpx;
  939. }
  940. }
  941. .list-icon {
  942. width: 120rpx;
  943. height: 120rpx;
  944. border-radius: 10rpx;
  945. position: absolute;
  946. right: 0;
  947. top: 0;
  948. color: #dd524d;
  949. z-index: 99;
  950. .list-icon-image{
  951. width: 120rpx;
  952. height: 120rpx;
  953. display: block;
  954. }
  955. }
  956. }
  957. .tui-header-tabmain {
  958. width: 100%;
  959. height: 70rpx;
  960. float: left;
  961. position: relative;
  962. &.day {
  963. height: 70rpx;
  964. box-sizing: border-box;
  965. padding: 20rpx 0;
  966. border-top: 1px solid #efefef;
  967. }
  968. .main-item {
  969. float: left;
  970. text-align: left;
  971. color: #ffffff;
  972. box-sizing: border-box;
  973. &.one {
  974. width: 25%;
  975. .text {
  976. width: 100%;
  977. height: 70rpx;
  978. line-height: 70rpx;
  979. display: block;
  980. float: left;
  981. font-size: $font-size-28;
  982. color: #666666;
  983. text-align: left;
  984. font-weight: 600;
  985. font-family: '正楷';
  986. }
  987. }
  988. &.tab {
  989. width: 140rpx;
  990. border-radius: 8rpx;
  991. background: #f7f7f7;
  992. margin-right: 15rpx;
  993. padding: 0 20rpx;
  994. .text {
  995. width: 100%;
  996. height: 50rpx;
  997. line-height: 50rpx;
  998. display: block;
  999. float: left;
  1000. font-size: $font-size-24;
  1001. color: #666666;
  1002. text-align: center;
  1003. }
  1004. }
  1005. &.active {
  1006. .text {
  1007. color: $btn-confirm;
  1008. font-size: $font-size-28;
  1009. }
  1010. }
  1011. &.tabActive {
  1012. background: $btn-confirm;
  1013. .text {
  1014. color: #ffffff;
  1015. }
  1016. }
  1017. }
  1018. .input {
  1019. width: 100%;
  1020. height: 70rpx;
  1021. box-sizing: border-box;
  1022. padding: 0 20rpx;
  1023. padding-left: 70rpx;
  1024. background: #f7f7f7;
  1025. border-radius: 8rpx;
  1026. }
  1027. .icon-sousuo {
  1028. width: 80rpx;
  1029. height: 70rpx;
  1030. display: block;
  1031. line-height: 70rpx;
  1032. text-align: center;
  1033. color: #999999;
  1034. font-size: $font-size-40;
  1035. position: absolute;
  1036. left: 0;
  1037. top: 0;
  1038. }
  1039. }
  1040. .button-content {
  1041. width: 100%;
  1042. height: auto;
  1043. float: left;
  1044. position: relative;
  1045. .btn {
  1046. height: 64rpx;
  1047. padding: 0 20rpx;
  1048. margin: 10rpx 0 0 0;
  1049. line-height: 64rpx;
  1050. font-size: $font-size-26;
  1051. text-align: center;
  1052. border-radius: 6rpx;
  1053. float: right;
  1054. }
  1055. .btn-confirm {
  1056. background-color: #ff5000;
  1057. color: #ffffff;
  1058. }
  1059. }
  1060. }
  1061. .distinguish-button {
  1062. width: 100%;
  1063. position: fixed;
  1064. bottom: 0;
  1065. left: 0;
  1066. background-color: #ffffff;
  1067. padding: 0 50rpx;
  1068. padding-top: 20rpx;
  1069. .button {
  1070. width: 100%;
  1071. height: 80rpx;
  1072. background: $btn-confirm;
  1073. border-radius: 40rpx;
  1074. text-align: center;
  1075. color: #ffffff;
  1076. line-height: 80rpx;
  1077. font-size: $font-size-28;
  1078. box-shadow: 0 10rpx 14rpx 0 rgba(86, 119, 252, 0.2);
  1079. }
  1080. }
  1081. .user-section {
  1082. position: absolute;
  1083. width: 100%;
  1084. }
  1085. .header-content {
  1086. width: 100%;
  1087. height: auto;
  1088. position: relative;
  1089. background-color: #f7f7f7;
  1090. .tui-header-btm {
  1091. width: 100%;
  1092. padding: 0 30rpx;
  1093. box-sizing: border-box;
  1094. display: flex;
  1095. align-items: center;
  1096. justify-content: space-between;
  1097. color: #fff;
  1098. }
  1099. .tui-btm-item {
  1100. flex: 1;
  1101. display: flex;
  1102. flex-direction: column;
  1103. align-items: center;
  1104. justify-content: center;
  1105. }
  1106. .tui-btm-num {
  1107. font-size: 32rpx;
  1108. font-weight: 600;
  1109. position: relative;
  1110. }
  1111. .tui-btm-text {
  1112. font-size: 24rpx;
  1113. opacity: 0.85;
  1114. padding-top: 4rpx;
  1115. }
  1116. }
  1117. .uni-badge--small {
  1118. -webkit-transform: scale(0.8);
  1119. -ms-transform: scale(0.8);
  1120. transform: scale(0.8);
  1121. -webkit-transform-origin: center center;
  1122. -ms-transform-origin: center center;
  1123. transform-origin: center center;
  1124. }
  1125. .uni-badge {
  1126. font-family: 'Helvetica Neue', Helvetica, sans-serif;
  1127. -webkit-box-sizing: border-box;
  1128. box-sizing: border-box;
  1129. font-size: 12px;
  1130. line-height: 1;
  1131. display: inline-block;
  1132. padding: 3px 6px;
  1133. color: #333;
  1134. border-radius: 100px;
  1135. background-color: #f1f1f1;
  1136. }
  1137. .uni-badge-error {
  1138. color: #fff;
  1139. background-color: #dd524d;
  1140. }
  1141. .tui-order-list {
  1142. margin-top: 24rpx;
  1143. width: 100%;
  1144. position: relative;
  1145. box-sizing: border-box;
  1146. padding: 0 20rpx;
  1147. }
  1148. .tui-order-content {
  1149. width: 100%;
  1150. height: auto;
  1151. }
  1152. .tui-order-item {
  1153. display: flex;
  1154. flex-direction: column;
  1155. width: 100%;
  1156. padding: 20rpx 20rpx;
  1157. background: #fff;
  1158. margin-bottom: 24rpx;
  1159. border-radius: 8rpx;
  1160. position: relative;
  1161. .list-checked {
  1162. width: 80rpx;
  1163. height: 80rpx;
  1164. line-height: 80rpx;
  1165. text-align: center;
  1166. position: absolute;
  1167. right: 0;
  1168. top: 0;
  1169. .iconfont {
  1170. font-size: 38rpx;
  1171. color: $color-system;
  1172. }
  1173. }
  1174. .list-detail {
  1175. width: 80rpx;
  1176. height: 290rpx;
  1177. line-height: 290rpx;
  1178. text-align: center;
  1179. position: absolute;
  1180. right: 0;
  1181. top: 80rpx;
  1182. .iconfont {
  1183. font-size: $font-size-30;
  1184. color: #999999;
  1185. }
  1186. }
  1187. }
  1188. .d-container {
  1189. width: 580rpx;
  1190. padding: 80rpx 0;
  1191. .drawer-main {
  1192. width: 100%;
  1193. height: auto;
  1194. box-sizing: border-box;
  1195. float: left;
  1196. .drawer-main-name {
  1197. width: 100%;
  1198. height: 80rpx;
  1199. line-height: 80rpx;
  1200. text-align: left;
  1201. font-size: $font-size-26;
  1202. color: #333333;
  1203. box-sizing: border-box;
  1204. padding: 0 20rpx;
  1205. font-weight: bold;
  1206. }
  1207. .drawer-main-time {
  1208. width: 100%;
  1209. height: 56rpx;
  1210. box-sizing: border-box;
  1211. .line {
  1212. color: #999999;
  1213. float: left;
  1214. line-height: 56rpx;
  1215. }
  1216. .drawer-main-time-input {
  1217. width: 228rpx;
  1218. height: 56rpx;
  1219. background: #f7f7f7;
  1220. border-radius: 28rpx;
  1221. box-sizing: border-box;
  1222. padding: 0 20rpx;
  1223. line-height: 56rpx;
  1224. float: left;
  1225. margin: 0 20rpx;
  1226. position: relative;
  1227. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1228. .input-text {
  1229. display: block;
  1230. height: 56rpx;
  1231. font-size: 26rpx;
  1232. color: #666666;
  1233. }
  1234. .icon-riqi {
  1235. color: $color-system;
  1236. display: block;
  1237. width: 40rpx;
  1238. height: 56rpx;
  1239. position: absolute;
  1240. right: 10rpx;
  1241. top: 0;
  1242. line-height: 56rpx;
  1243. }
  1244. }
  1245. }
  1246. .drawer-main-textarea {
  1247. width: 100%;
  1248. height: 160rpx;
  1249. box-sizing: border-box;
  1250. padding: 0 20rpx;
  1251. background: #ffffff;
  1252. border-radius: 8rpx;
  1253. .textarea {
  1254. width: 100%;
  1255. height: 100%;
  1256. background: #f7f7f7;
  1257. box-sizing: border-box;
  1258. padding: 20rpx 20rpx;
  1259. font-size: $font-size-24;
  1260. border-radius: 8rpx;
  1261. box-shadow: 0 10rpx 10rpx 0 rgba(86, 119, 252, 0.2);
  1262. }
  1263. }
  1264. }
  1265. .drawer-input {
  1266. width: 100%;
  1267. float: left;
  1268. box-sizing: border-box;
  1269. padding: 24rpx 10rpx 0 10rpx;
  1270. border: 1px solid rgba(0, 0, 0, 0.2);
  1271. border-radius: 4rpx;
  1272. position: relative;
  1273. background-color: #ffffff;
  1274. &.btn {
  1275. border: none;
  1276. display: flex;
  1277. position: fixed;
  1278. left: 0;
  1279. bottom: 0;
  1280. }
  1281. .drawer-btn {
  1282. width: 210rpx;
  1283. height: 84rpx;
  1284. border-radius: 42rpx;
  1285. background: $btn-confirm;
  1286. line-height: 84rpx;
  1287. text-align: center;
  1288. font-size: $font-size-26;
  1289. color: #ffffff;
  1290. flex: 1;
  1291. margin: 0 10rpx;
  1292. &.comfrim {
  1293. background: $btn-confirm;
  1294. }
  1295. &.clear {
  1296. background: #f7f7f7;
  1297. color: #999999;
  1298. }
  1299. }
  1300. }
  1301. }
  1302. </style>