index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. <template>
  2. <view class="">
  3. <view class="content">
  4. <view style='background:#fff;display:flex;' class="cu-bar search">
  5. <u-search placeholder="请输入业务编号或对方名称" v-model="searchKeyWord" @custom="doSearch"></u-search>
  6. </view>
  7. <view style='background:#fff;padding:0 15px;'>
  8. <view @click='tabcarchange(0)' class='line' :class='status==0?"active":""'>全部</view>
  9. <view @click='tabcarchange(1)' class='line' :class='status==1?"active":""'>待签收</view>
  10. <view @click='tabcarchange(2)' class='line' :class='status==2?"active":""'>待结算</view>
  11. </view>
  12. <view class="no-data" v-if="isShowNoData">
  13. 暂无相关结果
  14. </view>
  15. <view class="" v-if="!isShowNoData">
  16. <view v-for="(item,index) in listData" :key="index">
  17. <view @click.stop='sendreceiverecord(item)' class="guess-section">
  18. <view class="list-item">
  19. <view class="list-item-left">
  20. <view class='type send' v-if="item.shipperPhone==userInfo.phone">发</view>
  21. <view class='type put' v-if="item.shipperPhone!=userInfo.phone">收</view>
  22. <view class="number">
  23. <view class='businessnumber'>{{item.businessNumber}}</view>
  24. <view class='consigner'>{{item.consignee}}</view>
  25. </view>
  26. </view>
  27. <view class="list-item-right">
  28. <view class='time'>{{item.createDate}}</view>
  29. <view class='goods'>{{item.goodsName}}</view>
  30. </view>
  31. </view>
  32. <view style='width:100%;' class='goodsstatus'>
  33. <text style='margin-right:10px;'>待签收:{{item.signedFor}}</text>
  34. <text>待结算:{{item.toSettled}}</text>
  35. </view>
  36. <view style='width:100%;' class='flex justify-end'>
  37. <view class='del' @click.stop="delRow(item)">删除</view>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view v-show="isLoadMore">
  43. <uni-load-more :status="loadStatus"></uni-load-more>
  44. </view>
  45. </view>
  46. <view class="footer">
  47. <button @click='addgoods' class='addgoods'>新建发货任务</button>
  48. </view>
  49. </view>
  50. </template>
  51. <script>
  52. import store from "@/store";
  53. export default {
  54. name: "business",
  55. data() {
  56. return {
  57. searchKeyWord: '',
  58. content: '搜索',
  59. status: 0,
  60. listData: [],
  61. searchData: {},
  62. userinfo: {},
  63. isShowNoData: false,
  64. currentPage: 1, //页数
  65. pageSize: 10, //每次取条目数
  66. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  67. isLoadMore: false, //是否加载中
  68. scrollTop: 0,
  69. }
  70. },
  71. onShow() {
  72. },
  73. onLoad(options) {
  74. // 获取用户信息
  75. this.getUserInfo()
  76. //获取列表数据
  77. this.initData();
  78. },
  79. onPageScroll(e) {
  80. this.scrollTop = e.scrollTop;
  81. },
  82. onReachBottom() { //上拉触底函数
  83. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  84. this.isLoadMore = true
  85. this.currentPage += 1
  86. this.getListData(this.status)
  87. }
  88. },
  89. onPullDownRefresh() {
  90. this.currentPage = 1
  91. this.isLoadMore = false
  92. this.loadStatus = 'loading'
  93. this.listData = []
  94. this.getListData(this.status)
  95. setTimeout(function() {
  96. uni.stopPullDownRefresh();
  97. }, 1000);
  98. },
  99. methods: {
  100. getUserInfo() {
  101. this.userinfo = store.getters.getUserInfo
  102. },
  103. addgoods() {
  104. uni.navigateTo({
  105. url: '/pageA/freightTransport/addsendgoods?phone=' + this.userInfo.phone
  106. })
  107. },
  108. sendreceiverecord(item) {
  109. if (item.shipperPhone == this.userInfo.phone) {
  110. uni.navigateTo({
  111. url: '/pageA/freightTransport/record/sendrecord?id=' + item.id
  112. })
  113. } else {
  114. uni.navigateTo({
  115. url: '/pageA/freightTransport/record/payrecord?id=' + item.id
  116. })
  117. }
  118. },
  119. initData() {
  120. this.currentPage = 1
  121. this.isLoadMore = false
  122. this.loadStatus = 'more'
  123. this.getListData(0)
  124. },
  125. getListData(state, type) {
  126. let _data = {
  127. currentPage: this.currentPage,
  128. pageSize: this.pageSize
  129. }
  130. if (state == "searchKeyWord") {
  131. _data.searchKeyWord = type
  132. _data.accountNumber = this.userInfo.phone
  133. } else {
  134. _data.searchType = state
  135. _data.accountNumber = this.userInfo.phone
  136. }
  137. let that = this
  138. uni.showLoading({
  139. title: '正在加载',
  140. mask: true
  141. })
  142. this.$api.doRequest('get', '/freightReceivingDispatching/selectFreightReceivingDispatchingPage', _data)
  143. .then(res => {
  144. if (res.data.code == 200) {
  145. that.listData = res.data.data.records;
  146. // that.listData = that.listData.concat(res.data.data.records);
  147. for (let i = 0; i < that.listData.length; i++) {
  148. that.utils.nullToString(that.listData[i])
  149. that.listData[i].toSettled = that.listData[i].toSettled == '' ? 0 : that.listData[i]
  150. .toSettled
  151. that.listData[i].signedFor = that.listData[i].signedFor == '' ? 0 : that.listData[i]
  152. .signedFor
  153. }
  154. console.log(that.listData)
  155. // if(that.listData.length==0){
  156. // that.isShowNoData = true
  157. // }else{
  158. // that.isShowNoData = false
  159. // }
  160. that.isLoadMore = true
  161. that.loadStatus = 'nomore'
  162. } else {
  163. if (that.currentPage > 1) {
  164. that.currentPage = 1
  165. }
  166. that.isLoadMore = true
  167. that.loadStatus = 'nomore'
  168. }
  169. uni.hideLoading()
  170. }).catch(res => {
  171. that.$api.msg(res.data.data.errmsg)
  172. that.isLoadMore = false
  173. that.loadStatus = 'nomore'
  174. if (that.currentPage > 1) {
  175. that.currentPage = 1
  176. }
  177. uni.hideLoading()
  178. // uni.showToast({
  179. // title: res.data.message,
  180. // icon: 'none',
  181. // duration: 2000
  182. // })
  183. })
  184. },
  185. tabcarchange(val) {
  186. this.currentPage = 1
  187. this.searchKeyWord = ""
  188. this.listData = []
  189. console.log(val)
  190. this.status = val
  191. this.getListData(val)
  192. },
  193. // 搜索
  194. doSearch() {
  195. console.log(this.searchKeyWord)
  196. this.getListData("searchKeyWord", this.searchKeyWord)
  197. },
  198. //删除
  199. delRow(val) {
  200. uni.showModal({
  201. content: '货运信息(业务编号'+val.businessNumber+')删除后不可恢复,是否确定删除?',
  202. cancelText: "返回",
  203. confirmText: "删除",
  204. confirmColor:"#22C572",
  205. success: function(res) {
  206. if (res.confirm) {
  207. this.$api.doRequest('post',
  208. 'freightReceivingDispatching/api/deleteFreightReceivingDispatching', {
  209. "id": val.id
  210. }).then(res => {
  211. if (res.data.code == 200) {
  212. // this.listData = res.data.data.records;
  213. uni.showToast({
  214. title: "删除成功!",
  215. icon: 'none',
  216. duration: 2000
  217. })
  218. this.getListData(0)
  219. }
  220. }).catch(res => {
  221. // uni.showToast({
  222. // title: res.data.message,
  223. // icon: 'none',
  224. // duration: 2000
  225. // })
  226. })
  227. } else if (res.cancel) {
  228. }
  229. }
  230. });
  231. }
  232. }
  233. }
  234. </script>
  235. <style lang='scss'>
  236. page,
  237. .content {
  238. background: #F5F6FA;
  239. padding-bottom: 50px;
  240. }
  241. .line {
  242. display: inline-block;
  243. padding: 5px;
  244. position: relative;
  245. font-size: 17px;
  246. }
  247. .line:nth-last-of-type(2),
  248. .line:nth-last-of-type(1) {
  249. margin-left: 68rpx;
  250. }
  251. .line.active {
  252. font-size: 19px;
  253. font-weight: 900;
  254. }
  255. .line.active:after {
  256. content: '';
  257. display: block;
  258. position: absolute;
  259. width: 38px;
  260. left: 50%;
  261. transform: translateX(-50%);
  262. bottom: 0;
  263. border-bottom: 1px solid #22C572;
  264. }
  265. .cu-tag.badge {
  266. right: 26rpx;
  267. }
  268. .cu-item {
  269. height: 80rpx;
  270. display: inline-block;
  271. line-height: 80rpx;
  272. }
  273. .search-form {
  274. background: #F5F6F9;
  275. padding-left: 20rpx;
  276. }
  277. .title-tip {
  278. color: #E63113;
  279. text-align: right;
  280. }
  281. .tag1 {
  282. background: #F5F6F9;
  283. padding: 5px;
  284. color: #333333;
  285. display: inline-flex;
  286. font-size: 22rpx;
  287. border-radius: 3px;
  288. margin: 3px;
  289. }
  290. .tag {
  291. background: #F5F6F9;
  292. padding: 7px 12px;
  293. color: #333333;
  294. display: inline-flex;
  295. font-size: 22rpx;
  296. border-radius: 15px;
  297. margin: 3px;
  298. }
  299. .tag-bule {
  300. background: #EBEEFA;
  301. color: #5C76DF;
  302. }
  303. .tag-green {
  304. background: #C6F7BC;
  305. color: #065112;
  306. }
  307. .tag-yellow {
  308. background: #F9F2EA;
  309. color: #BE9C69;
  310. }
  311. .tag-red {
  312. background: #FEECE6;
  313. color: #FE6430;
  314. }
  315. .text-white {
  316. color: #fff;
  317. }
  318. .text-white text {
  319. position: relative;
  320. z-index: 2;
  321. background: linear-gradient(45deg, #3DC146, #B2D612);
  322. padding: 5px 10px;
  323. border-radius: 38rpx;
  324. }
  325. .guess-section {
  326. padding-bottom: 100upx;
  327. display: flex;
  328. flex-wrap: wrap;
  329. padding: 30upx;
  330. background: #fff;
  331. margin: 10px;
  332. border-radius: 6px;
  333. .type {
  334. border-radius: 10px;
  335. padding: 5px;
  336. wdith: 22px;
  337. height: 22px;
  338. line-height: 14px;
  339. font-size: 12px;
  340. }
  341. .type.send {
  342. background: #22C572;
  343. color: #fff;
  344. }
  345. .type.put {
  346. background: #FD714F;
  347. color: #fff;
  348. }
  349. .businessnumber {
  350. font-size: 16px;
  351. font-weight: 600;
  352. }
  353. .time {
  354. color: #878C9C;
  355. }
  356. .goods,
  357. .consigner {
  358. font-size: 24rpx;
  359. font-weight: 500;
  360. color: #333333;
  361. text-align: right;
  362. margin: 20rpx 0
  363. }
  364. .goodsstatus {
  365. background: #F9F9FA;
  366. color: #9698A2;
  367. padding: 10px 0;
  368. padding-left: 47px;
  369. margin: 10px 0;
  370. }
  371. .del {
  372. width: 60px;
  373. height: 33px;
  374. line-height: 33px;
  375. font-size: 14px;
  376. background: #fff;
  377. border: 1px solid #CDCDCD;
  378. border-radius: 30px;
  379. text-align: center;
  380. }
  381. }
  382. .navbar {
  383. position: fixed;
  384. left: 0;
  385. top: var(--window-top);
  386. display: flex;
  387. width: 100%;
  388. height: 80upx;
  389. background: #fff;
  390. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  391. z-index: 10;
  392. .nav-item {
  393. flex: 1;
  394. display: flex;
  395. justify-content: center;
  396. align-items: center;
  397. height: 100%;
  398. font-size: 30upx;
  399. color: $font-color-dark;
  400. position: relative;
  401. &.current {
  402. color: $base-color;
  403. &:after {
  404. content: '';
  405. position: absolute;
  406. left: 50%;
  407. bottom: 0;
  408. transform: translateX(-50%);
  409. width: 120upx;
  410. height: 0;
  411. border-bottom: 4upx solid $base-color;
  412. }
  413. }
  414. }
  415. .p-box {
  416. display: flex;
  417. flex-direction: column;
  418. .yticon {
  419. display: flex;
  420. align-items: center;
  421. justify-content: center;
  422. width: 30upx;
  423. height: 14upx;
  424. line-height: 1;
  425. margin-left: 4upx;
  426. font-size: 26upx;
  427. color: #888;
  428. &.active {
  429. color: $base-color;
  430. }
  431. }
  432. .xia {
  433. transform: scaleY(-1);
  434. }
  435. }
  436. .cate-item {
  437. display: flex;
  438. justify-content: center;
  439. align-items: center;
  440. height: 100%;
  441. width: 80upx;
  442. position: relative;
  443. font-size: 44upx;
  444. &:after {
  445. content: '';
  446. position: absolute;
  447. left: 0;
  448. top: 50%;
  449. transform: translateY(-50%);
  450. border-left: 1px solid #ddd;
  451. width: 0;
  452. height: 36upx;
  453. }
  454. }
  455. }
  456. /* 分类 */
  457. .cate-mask {
  458. position: fixed;
  459. left: 0;
  460. top: var(--window-top);
  461. bottom: 0;
  462. width: 100%;
  463. background: rgba(0, 0, 0, 0);
  464. z-index: 95;
  465. transition: .3s;
  466. .cate-content {
  467. width: 630upx;
  468. height: 100%;
  469. background: #fff;
  470. float: right;
  471. transform: translateX(100%);
  472. transition: .3s;
  473. }
  474. &.none {
  475. display: none;
  476. }
  477. &.show {
  478. background: rgba(0, 0, 0, .4);
  479. .cate-content {
  480. transform: translateX(0);
  481. }
  482. }
  483. }
  484. .cate-list {
  485. display: flex;
  486. flex-direction: column;
  487. height: 100%;
  488. .cate-item {
  489. display: flex;
  490. align-items: center;
  491. height: 90upx;
  492. padding-left: 30upx;
  493. font-size: 28upx;
  494. color: #555;
  495. position: relative;
  496. }
  497. .two {
  498. height: 64upx;
  499. color: #303133;
  500. font-size: 30upx;
  501. background: #f8f8f8;
  502. }
  503. .active {
  504. color: $base-color;
  505. }
  506. }
  507. .introduce-section .title {
  508. font-size: 17px;
  509. font-weight: bold;
  510. height: 40px;
  511. line-height: 40px;
  512. flex: 2.5;
  513. border-bottom: 1px solid #EEEEEE;
  514. }
  515. .introduce-section .address {
  516. color: #878C9C;
  517. font-size: 12px;
  518. padding: 10px 0 10px;
  519. }
  520. .introduce-section .price {
  521. padding: 10px 0 10px;
  522. color: #FD714F;
  523. font-size: 19px;
  524. font-weight: 700;
  525. }
  526. .introduce-section .guess-item {
  527. border-radius: 10px;
  528. background: #fff;
  529. padding: 0upx 30upx 20upx;
  530. margin: 8px;
  531. border-bottom: 1px solid #ccc;
  532. }
  533. /* 销售信息 */
  534. .introduce-section {
  535. .title-tip {
  536. flex: 1;
  537. }
  538. .price-box {
  539. display: flex;
  540. align-items: baseline;
  541. font-size: 26upx;
  542. }
  543. .price {
  544. font-size: $font-lg + 2upx;
  545. }
  546. .m-price {
  547. margin: 0 12upx;
  548. color: $font-color-light;
  549. text-decoration: line-through;
  550. }
  551. .coupon-tip {
  552. align-items: center;
  553. padding: 4upx 10upx;
  554. background: $uni-color-primary;
  555. font-size: $font-sm;
  556. color: #fff;
  557. border-radius: 6upx;
  558. line-height: 1;
  559. transform: translateY(-4upx);
  560. }
  561. .bot-row {
  562. display: flex;
  563. align-items: center;
  564. height: 50upx;
  565. font-size: $font-sm;
  566. color: $font-color-light;
  567. view {
  568. flex: 1;
  569. }
  570. }
  571. }
  572. .footer {
  573. background: #fff;
  574. position: fixed;
  575. bottom: 0;
  576. width: 100%;
  577. padding: 20px 0;
  578. }
  579. .addgoods {
  580. width: 90%;
  581. background: #22C572;
  582. color: #fff;
  583. border-radius: 30px;
  584. }
  585. .addgoods:after {
  586. border: none;
  587. }
  588. .cu-bar {
  589. padding: 0 30rpx;
  590. }
  591. .no-data {
  592. /* background: red; */
  593. text-align: center;
  594. font-size: 36rpx;
  595. margin-top: 300rpx;
  596. }
  597. .list-item {
  598. width: 100%;
  599. display: flex;
  600. justify-content: space-between;
  601. .list-item-left {
  602. display: flex;
  603. align-items: center;
  604. .number {
  605. margin-left: 40rpx;
  606. }
  607. }
  608. }
  609. </style>