index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  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 = that.listData.concat(res.data.data.records);
  146. for (let i = 0; i < that.listData.length; i++) {
  147. that.utils.nullToString(that.listData[i])
  148. that.listData[i].toSettled = that.listData[i].toSettled == '' ? 0 : that.listData[i]
  149. .toSettled
  150. that.listData[i].signedFor = that.listData[i].signedFor == '' ? 0 : that.listData[i]
  151. .signedFor
  152. }
  153. console.log(that.listData)
  154. // if(that.listData.length==0){
  155. // that.isShowNoData = true
  156. // }else{
  157. // that.isShowNoData = false
  158. // }
  159. that.isLoadMore = true
  160. that.loadStatus = 'nomore'
  161. } else {
  162. if (that.currentPage > 1) {
  163. that.currentPage = 1
  164. }
  165. that.isLoadMore = true
  166. that.loadStatus = 'nomore'
  167. }
  168. uni.hideLoading()
  169. }).catch(res => {
  170. that.$api.msg(res.data.data.errmsg)
  171. that.isLoadMore = false
  172. that.loadStatus = 'nomore'
  173. if (that.currentPage > 1) {
  174. that.currentPage = 1
  175. }
  176. uni.hideLoading()
  177. // uni.showToast({
  178. // title: res.data.message,
  179. // icon: 'none',
  180. // duration: 2000
  181. // })
  182. })
  183. },
  184. tabcarchange(val) {
  185. this.currentPage = 1
  186. this.searchKeyWord = ""
  187. this.listData = []
  188. console.log(val)
  189. this.status = val
  190. this.getListData(val)
  191. },
  192. // 搜索
  193. doSearch() {
  194. console.log(this.searchKeyWord)
  195. this.getListData("searchKeyWord", this.searchKeyWord)
  196. },
  197. //删除
  198. delRow(val) {
  199. uni.showModal({
  200. content: '货运信息(业务编号'+val.businessNumber+')删除后不可恢复,是否确定删除?',
  201. cancelText: "返回",
  202. confirmText: "删除",
  203. confirmColor:"#22C572",
  204. success: function(res) {
  205. if (res.confirm) {
  206. this.$api.doRequest('post',
  207. 'freightReceivingDispatching/api/deleteFreightReceivingDispatching', {
  208. "id": val.id
  209. }).then(res => {
  210. if (res.data.code == 200) {
  211. // this.listData = res.data.data.records;
  212. uni.showToast({
  213. title: "删除成功!",
  214. icon: 'none',
  215. duration: 2000
  216. })
  217. this.getListData(0)
  218. }
  219. }).catch(res => {
  220. // uni.showToast({
  221. // title: res.data.message,
  222. // icon: 'none',
  223. // duration: 2000
  224. // })
  225. })
  226. } else if (res.cancel) {
  227. }
  228. }
  229. });
  230. }
  231. }
  232. }
  233. </script>
  234. <style lang='scss'>
  235. page,
  236. .content {
  237. background: #F5F6FA;
  238. padding-bottom: 50px;
  239. }
  240. .line {
  241. display: inline-block;
  242. padding: 5px;
  243. position: relative;
  244. font-size: 17px;
  245. }
  246. .line:nth-last-of-type(2),
  247. .line:nth-last-of-type(1) {
  248. margin-left: 68rpx;
  249. }
  250. .line.active {
  251. font-size: 19px;
  252. font-weight: 900;
  253. }
  254. .line.active:after {
  255. content: '';
  256. display: block;
  257. position: absolute;
  258. width: 38px;
  259. left: 50%;
  260. transform: translateX(-50%);
  261. bottom: 0;
  262. border-bottom: 1px solid #22C572;
  263. }
  264. .cu-tag.badge {
  265. right: 26rpx;
  266. }
  267. .cu-item {
  268. height: 80rpx;
  269. display: inline-block;
  270. line-height: 80rpx;
  271. }
  272. .search-form {
  273. background: #F5F6F9;
  274. padding-left: 20rpx;
  275. }
  276. .title-tip {
  277. color: #E63113;
  278. text-align: right;
  279. }
  280. .tag1 {
  281. background: #F5F6F9;
  282. padding: 5px;
  283. color: #333333;
  284. display: inline-flex;
  285. font-size: 22rpx;
  286. border-radius: 3px;
  287. margin: 3px;
  288. }
  289. .tag {
  290. background: #F5F6F9;
  291. padding: 7px 12px;
  292. color: #333333;
  293. display: inline-flex;
  294. font-size: 22rpx;
  295. border-radius: 15px;
  296. margin: 3px;
  297. }
  298. .tag-bule {
  299. background: #EBEEFA;
  300. color: #5C76DF;
  301. }
  302. .tag-green {
  303. background: #C6F7BC;
  304. color: #065112;
  305. }
  306. .tag-yellow {
  307. background: #F9F2EA;
  308. color: #BE9C69;
  309. }
  310. .tag-red {
  311. background: #FEECE6;
  312. color: #FE6430;
  313. }
  314. .text-white {
  315. color: #fff;
  316. }
  317. .text-white text {
  318. position: relative;
  319. z-index: 2;
  320. background: linear-gradient(45deg, #3DC146, #B2D612);
  321. padding: 5px 10px;
  322. border-radius: 38rpx;
  323. }
  324. .guess-section {
  325. padding-bottom: 100upx;
  326. display: flex;
  327. flex-wrap: wrap;
  328. padding: 30upx;
  329. background: #fff;
  330. margin: 10px;
  331. border-radius: 6px;
  332. .type {
  333. border-radius: 10px;
  334. padding: 5px;
  335. wdith: 22px;
  336. height: 22px;
  337. line-height: 14px;
  338. font-size: 12px;
  339. }
  340. .type.send {
  341. background: #22C572;
  342. color: #fff;
  343. }
  344. .type.put {
  345. background: #FD714F;
  346. color: #fff;
  347. }
  348. .businessnumber {
  349. font-size: 16px;
  350. font-weight: 600;
  351. }
  352. .time {
  353. color: #878C9C;
  354. }
  355. .goods,
  356. .consigner {
  357. font-size: 24rpx;
  358. font-weight: 500;
  359. color: #333333;
  360. text-align: right;
  361. margin: 20rpx 0
  362. }
  363. .goodsstatus {
  364. background: #F9F9FA;
  365. color: #9698A2;
  366. padding: 10px 0;
  367. padding-left: 47px;
  368. margin: 10px 0;
  369. }
  370. .del {
  371. width: 60px;
  372. height: 33px;
  373. line-height: 33px;
  374. font-size: 14px;
  375. background: #fff;
  376. border: 1px solid #CDCDCD;
  377. border-radius: 30px;
  378. text-align: center;
  379. }
  380. }
  381. .navbar {
  382. position: fixed;
  383. left: 0;
  384. top: var(--window-top);
  385. display: flex;
  386. width: 100%;
  387. height: 80upx;
  388. background: #fff;
  389. box-shadow: 0 2upx 10upx rgba(0, 0, 0, .06);
  390. z-index: 10;
  391. .nav-item {
  392. flex: 1;
  393. display: flex;
  394. justify-content: center;
  395. align-items: center;
  396. height: 100%;
  397. font-size: 30upx;
  398. color: $font-color-dark;
  399. position: relative;
  400. &.current {
  401. color: $base-color;
  402. &:after {
  403. content: '';
  404. position: absolute;
  405. left: 50%;
  406. bottom: 0;
  407. transform: translateX(-50%);
  408. width: 120upx;
  409. height: 0;
  410. border-bottom: 4upx solid $base-color;
  411. }
  412. }
  413. }
  414. .p-box {
  415. display: flex;
  416. flex-direction: column;
  417. .yticon {
  418. display: flex;
  419. align-items: center;
  420. justify-content: center;
  421. width: 30upx;
  422. height: 14upx;
  423. line-height: 1;
  424. margin-left: 4upx;
  425. font-size: 26upx;
  426. color: #888;
  427. &.active {
  428. color: $base-color;
  429. }
  430. }
  431. .xia {
  432. transform: scaleY(-1);
  433. }
  434. }
  435. .cate-item {
  436. display: flex;
  437. justify-content: center;
  438. align-items: center;
  439. height: 100%;
  440. width: 80upx;
  441. position: relative;
  442. font-size: 44upx;
  443. &:after {
  444. content: '';
  445. position: absolute;
  446. left: 0;
  447. top: 50%;
  448. transform: translateY(-50%);
  449. border-left: 1px solid #ddd;
  450. width: 0;
  451. height: 36upx;
  452. }
  453. }
  454. }
  455. /* 分类 */
  456. .cate-mask {
  457. position: fixed;
  458. left: 0;
  459. top: var(--window-top);
  460. bottom: 0;
  461. width: 100%;
  462. background: rgba(0, 0, 0, 0);
  463. z-index: 95;
  464. transition: .3s;
  465. .cate-content {
  466. width: 630upx;
  467. height: 100%;
  468. background: #fff;
  469. float: right;
  470. transform: translateX(100%);
  471. transition: .3s;
  472. }
  473. &.none {
  474. display: none;
  475. }
  476. &.show {
  477. background: rgba(0, 0, 0, .4);
  478. .cate-content {
  479. transform: translateX(0);
  480. }
  481. }
  482. }
  483. .cate-list {
  484. display: flex;
  485. flex-direction: column;
  486. height: 100%;
  487. .cate-item {
  488. display: flex;
  489. align-items: center;
  490. height: 90upx;
  491. padding-left: 30upx;
  492. font-size: 28upx;
  493. color: #555;
  494. position: relative;
  495. }
  496. .two {
  497. height: 64upx;
  498. color: #303133;
  499. font-size: 30upx;
  500. background: #f8f8f8;
  501. }
  502. .active {
  503. color: $base-color;
  504. }
  505. }
  506. .introduce-section .title {
  507. font-size: 17px;
  508. font-weight: bold;
  509. height: 40px;
  510. line-height: 40px;
  511. flex: 2.5;
  512. border-bottom: 1px solid #EEEEEE;
  513. }
  514. .introduce-section .address {
  515. color: #878C9C;
  516. font-size: 12px;
  517. padding: 10px 0 10px;
  518. }
  519. .introduce-section .price {
  520. padding: 10px 0 10px;
  521. color: #FD714F;
  522. font-size: 19px;
  523. font-weight: 700;
  524. }
  525. .introduce-section .guess-item {
  526. border-radius: 10px;
  527. background: #fff;
  528. padding: 0upx 30upx 20upx;
  529. margin: 8px;
  530. border-bottom: 1px solid #ccc;
  531. }
  532. /* 销售信息 */
  533. .introduce-section {
  534. .title-tip {
  535. flex: 1;
  536. }
  537. .price-box {
  538. display: flex;
  539. align-items: baseline;
  540. font-size: 26upx;
  541. }
  542. .price {
  543. font-size: $font-lg + 2upx;
  544. }
  545. .m-price {
  546. margin: 0 12upx;
  547. color: $font-color-light;
  548. text-decoration: line-through;
  549. }
  550. .coupon-tip {
  551. align-items: center;
  552. padding: 4upx 10upx;
  553. background: $uni-color-primary;
  554. font-size: $font-sm;
  555. color: #fff;
  556. border-radius: 6upx;
  557. line-height: 1;
  558. transform: translateY(-4upx);
  559. }
  560. .bot-row {
  561. display: flex;
  562. align-items: center;
  563. height: 50upx;
  564. font-size: $font-sm;
  565. color: $font-color-light;
  566. view {
  567. flex: 1;
  568. }
  569. }
  570. }
  571. .footer {
  572. background: #fff;
  573. position: fixed;
  574. bottom: 0;
  575. width: 100%;
  576. padding: 20px 0;
  577. }
  578. .addgoods {
  579. width: 90%;
  580. background: #22C572;
  581. color: #fff;
  582. border-radius: 30px;
  583. }
  584. .addgoods:after {
  585. border: none;
  586. }
  587. .cu-bar {
  588. padding: 0 30rpx;
  589. }
  590. .no-data {
  591. /* background: red; */
  592. text-align: center;
  593. font-size: 36rpx;
  594. margin-top: 300rpx;
  595. }
  596. .list-item {
  597. width: 100%;
  598. display: flex;
  599. justify-content: space-between;
  600. .list-item-left {
  601. display: flex;
  602. align-items: center;
  603. .number {
  604. margin-left: 40rpx;
  605. }
  606. }
  607. }
  608. </style>