index.vue 13 KB

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